jist.swans.route
Class RouteAodv.RouteRequest

java.lang.Object
  extended by jist.swans.route.RouteAodv.RouteRequest
Enclosing class:
RouteAodv

private static class RouteAodv.RouteRequest
extends java.lang.Object

Represents a request for a route by a node. A single route request can repeatedly broadcast RREQ messages, with increasing TTL value, until a route has been found. TTL values start at TTL_START, increment by TTL_INCREMENT, but do not exceed TTL_THRESHOLD.


Field Summary
private  NetAddress destIp
          Net address of node for which we seek a route.
private  boolean routeFound
          Indicates whether this request has been satisfied (route has been found).
private  int rreqId
          Route request identifier.
private  RouteAodv thisNode
          Reference to the encapsulating RouteAodv instance.
private  byte ttl
          Time to live.
 
Constructor Summary
RouteAodv.RouteRequest(NetAddress destIp, RouteAodv thisNode)
          Constructs a new Route Request object.
 
Method Summary
 void broadcast()
          Creates and broadcasts a RREQ message.
 NetAddress getDest()
          Returns destination net address.
 int getRreqId()
          Return RREQ id.
 byte getTtl()
          Returns TTL.
 void incTtl()
          Increments the TTL value by TTL_INCREMENT, but ensures that it does not exceed TTL_THRESHOLD.
 void obtainNewRreqId()
          Assigns a fresh RREQ id number, and updates the node's global RREQ id counter.
 void setRouteFound(boolean b)
          Sets the Route Found flag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

destIp

private NetAddress destIp
Net address of node for which we seek a route.


rreqId

private int rreqId
Route request identifier.


ttl

private byte ttl
Time to live.


routeFound

private boolean routeFound
Indicates whether this request has been satisfied (route has been found). Once set to true, this entry can be removed from the route request list.


thisNode

private RouteAodv thisNode
Reference to the encapsulating RouteAodv instance.

Constructor Detail

RouteAodv.RouteRequest

public RouteAodv.RouteRequest(NetAddress destIp,
                              RouteAodv thisNode)
Constructs a new Route Request object.

Parameters:
destIp - net address of node for which we seek a route
thisNode - reference to this RouteAodv instance
Method Detail

getRreqId

public int getRreqId()
Return RREQ id.

Returns:
RREQ id

getDest

public NetAddress getDest()
Returns destination net address.

Returns:
destination net address

getTtl

public byte getTtl()
Returns TTL.

Returns:
TTL value

obtainNewRreqId

public void obtainNewRreqId()
Assigns a fresh RREQ id number, and updates the node's global RREQ id counter.


incTtl

public void incTtl()
Increments the TTL value by TTL_INCREMENT, but ensures that it does not exceed TTL_THRESHOLD.


setRouteFound

public void setRouteFound(boolean b)
Sets the Route Found flag.

Parameters:
b - value to assign to flag

broadcast

public void broadcast()
Creates and broadcasts a RREQ message. Also, updates RREQ buffer and routing table.