|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjist.swans.route.RouteDsr
public class RouteDsr
An implementation of the Dynamic Source Routing protocol.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface jist.swans.route.RouteInterface.Dsr |
---|
RouteInterface.Dsr.BufferedPacket |
Nested classes/interfaces inherited from interface jist.swans.route.RouteInterface |
---|
RouteInterface.Aodv, RouteInterface.BezierRouting, RouteInterface.Dsr, RouteInterface.ECGRIDRouting, RouteInterface.GenericRouting, RouteInterface.HeartbeatProtocol, RouteInterface.MultiTreeRouting, RouteInterface.RandomPathRouting, RouteInterface.ShortestPathRouting, RouteInterface.Zrp |
Field Summary | |
---|---|
static long |
BROADCAST_JITTER
The maximum amount of jitter before sending a packet. |
static long |
GRAT_REPLY_HOLDOFF
The minimum time between sending gratuitous Route Replies. |
static long |
MAINT_PERIOD
The timeout before retransmitting a packet using network-level acknowledgements. |
static int |
MAX_MAINT_REXMT
The maximum number of times a packet will be retransmitted using network-level acknowledgements. |
static long |
MAX_REQUEST_PERIOD
The maximum timeout before retransmitting a Route Request. |
static int |
MAX_REQUEST_TABLE_IDS
The maximum number of ID values to store in a single Route Request Table entry. |
static int |
MAX_SALVAGE_COUNT
The maximum number of times a packet can be salvaged. |
static byte |
MAX_TTL
The maximum Time-To-Live for a DSR packet. |
static long |
PASSIVE_ACK_TIMEOUT
The timeout before retransmitting a packet using passive acknowledgements. |
static long |
REQUEST_PERIOD
The initial timeout before retransmitting a Route Request. |
static long |
SEND_BUFFER_TIMEOUT
The maximum amount of time a packet can remain in the Send Buffer. |
static int |
TRY_PASSIVE_ACKS
The number of times to try retransmission using passive ackknowledgments. |
Constructor Summary | |
---|---|
RouteDsr(NetAddress localAddr)
Creates a new RouteDsr object. |
Method Summary | |
---|---|
void |
AddRouteReplyEntry(NetAddress originator,
NetAddress lastHop)
Adds a new entry to the Gratuitous Route Reply Table. |
void |
DeleteBuffer(RouteInterface.Dsr.BufferedPacket msg)
Removes the given BufferedPacket from the Send Buffer. |
void |
DeleteRouteReplyEntry(NetAddress originator,
NetAddress lastHop)
Deletes an entry from the Gratuitous Route Reply Table. |
void |
DiscoverRoute(NetAddress dest,
short requestId)
Initiates a Route Discovery for the given address. |
void |
dropNotify(Message msg,
MacAddress nextHopMac,
Reason reason)
Notification mechanism for packet dropped due to various "Reasons" |
RouteInterface.Dsr |
getProxy()
Gets the proxy interface for this object. |
void |
InsertBuffer(NetMessage.Ip msg)
Inserts a new packet into the Send Buffer, annotating it with the current system time. |
void |
InsertRouteCache(NetAddress dest,
NetAddress[] route)
Inserts a new route into the Route Cache. |
void |
peek(NetMessage msg,
MacAddress lastHop)
If the given message uses the DSR protocol, the DSR header is examined to see if any actions need to be performed on this packet (such as forwarding it). |
void |
receive(Message msg,
NetAddress src,
MacAddress lastHop,
byte macId,
NetAddress dst,
byte priority,
byte ttl)
Receives a message from the network. |
void |
send(NetMessage msg)
Sends the given message. |
void |
setNetEntity(NetInterface netEntity)
Sets the interface to the network layer. |
void |
TransmitWithNetworkAck(NetMessage.Ip msg,
java.lang.Short ackId,
long timeout,
int numRetransmits)
Sends the given message. |
void |
TransmitWithPassiveAck(NetMessage.Ip msg,
int numRetransmits)
Sends the given message and waits for a passive acknowledgement. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long BROADCAST_JITTER
public static final long SEND_BUFFER_TIMEOUT
public static final long REQUEST_PERIOD
public static final long MAX_REQUEST_PERIOD
public static final int MAX_MAINT_REXMT
public static final long MAINT_PERIOD
public static final long GRAT_REPLY_HOLDOFF
public static final long PASSIVE_ACK_TIMEOUT
public static final int TRY_PASSIVE_ACKS
public static final int MAX_REQUEST_TABLE_IDS
public static final byte MAX_TTL
public static final int MAX_SALVAGE_COUNT
Constructor Detail |
---|
public RouteDsr(NetAddress localAddr)
localAddr
- local node addressMethod Detail |
---|
public void dropNotify(Message msg, MacAddress nextHopMac, Reason reason)
NetInterface.NetHandler
dropNotify
in interface NetInterface.NetHandler
public void setNetEntity(NetInterface netEntity)
netEntity
- the interface to the network layerpublic RouteInterface.Dsr getProxy()
RouteInterface.Dsr
interface for this objectpublic void DiscoverRoute(NetAddress dest, short requestId)
DiscoverRoute
in interface RouteInterface.Dsr
dest
- the address to which we desire a routerequestId
- the ID number of the request to be performed.
DiscoverRoute
should always be invoked with a unique
value in this parameter.public void InsertRouteCache(NetAddress dest, NetAddress[] route)
dest
- the destination of the route to be addedroute
- the sequence of nodes from here to dest
. Neither
the IP address of this node nor of the dest
node should be
included in the route
array.public void InsertBuffer(NetMessage.Ip msg)
InsertBuffer
in interface RouteInterface.Dsr
msg
- the message to insert into the bufferpublic void DeleteBuffer(RouteInterface.Dsr.BufferedPacket msg)
BufferedPacket
from the Send Buffer.
DeleteBuffer
in interface RouteInterface.Dsr
msg
- the packet to remove from the Send Bufferpublic void AddRouteReplyEntry(NetAddress originator, NetAddress lastHop)
AddRouteReplyEntry
in interface RouteInterface.Dsr
originator
- the originator of the shortened Source RoutelastHop
- the most recent hop address of the shortened Source Routepublic void DeleteRouteReplyEntry(NetAddress originator, NetAddress lastHop)
DeleteRouteReplyEntry
in interface RouteInterface.Dsr
originator
- the originator of the shortened Source RoutelastHop
- the most recent hop address of the shortened Source Routepublic void TransmitWithPassiveAck(NetMessage.Ip msg, int numRetransmits)
TRY_PASSIVE_ACKS
times.
TransmitWithPassiveAck
in interface RouteInterface.Dsr
msg
- the message to be sentnumRetransmits
- the number of times this message has already been
retransmitted. Callers should usually pass in zero for this.public void TransmitWithNetworkAck(NetMessage.Ip msg, java.lang.Short ackId, long timeout, int numRetransmits)
MAX_MAINT_REXMT
times.
TransmitWithNetworkAck
in interface RouteInterface.Dsr
msg
- the message to be sentackId
- the ID number of the Acknowledgement Requesttimeout
- the number of clock ticks to wait before
retransmitting the messagenumRetransmits
- the number of times this packet has already been
transmitted. Callers should normally pass in zero for this.public void peek(NetMessage msg, MacAddress lastHop)
peek
in interface RouteInterface
msg
- the message to examinelastHop
- the MAC address of the node that sent this messagepublic void send(NetMessage msg)
peek
.
send
in interface NetInterface.NetHandler
send
in interface RouteInterface
msg
- the message to be sentpublic void receive(Message msg, NetAddress src, MacAddress lastHop, byte macId, NetAddress dst, byte priority, byte ttl)
receive
in interface NetInterface.NetHandler
msg
- the message being receivedsrc
- the address of the originator of the messagelastHop
- the MAC address of the most recent node to forward the messagemacId
- the ID of the MAC interfacedst
- the address of the destination of the message (which should
be the IP address of this node)priority
- the IP priority of the messagettl
- the IP time to live of the message
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |