SunSPOT API V3.0


com.sun.spot.peripheral.radio.mhrp.aodv.routing
Class RoutingTable

java.lang.Object
  extended by com.sun.spot.peripheral.radio.mhrp.aodv.routing.RoutingTable

public class RoutingTable
extends Object

An object that represents a routing table for the mesh

Version:
0.1
Author:
Allen Ajit George, Jochen Furtmueller

Method Summary
 void addRoute(long address, long nextHopMACAddress, int hopCount, int routeCost, int destSeqNumber)
          Create a new route entry using the parameters, then call doTableAddition()
 void addRoute(long senderMACAddress, RREP message)
          Create a new route entry based on a received route reply, then call doTableAddition()
 void addRoute(long senderMACAddress, RREQ message)
          Create a new route entry based on a received route request, then call doTableAddition()
 void cleanTable()
          delete all table entries that are expired
 void deactivateRoute(long originator, long destination)
          removes a node from the users list of a route and sets the activity flag to false
 void dumpTable()
           
 boolean freshenRoute(long address)
          increases the expiry time for a route that is specified by the destination address
 Vector getAllEntries()
          This method provides access to the entire routing table.
 int getDestinationSequenceNumber(long address)
          get the destination sequence number for a certain entry
static RoutingTable getInstance()
          retrieve a handle to this routing table
 RouteInfo getNextHopInfo(long address)
          returns an object that describes the route for a given destination
 void setOurAddress(long ourAddress)
          sets our IEEE Address
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static RoutingTable getInstance()
retrieve a handle to this routing table

Returns:
instance of this singleton

getNextHopInfo

public RouteInfo getNextHopInfo(long address)
returns an object that describes the route for a given destination

Parameters:
address - for which a route info is wanted
Returns:
routeInfo that has a valid next hop field if there was a route in the table, or a invalid next hop field if there was not

addRoute

public void addRoute(long address,
                     long nextHopMACAddress,
                     int hopCount,
                     int routeCost,
                     int destSeqNumber)
Create a new route entry using the parameters, then call doTableAddition()

Parameters:
address - destination address of route entry
nextHopMACAddress - address of next hop to this address
hopCount - number of hops to destination
routeCost - AODV route cost mechanism
destSeqNumber - AODV sequence number

addRoute

public void addRoute(long senderMACAddress,
                     RREQ message)
Create a new route entry based on a received route request, then call doTableAddition()

Parameters:
senderMACAddress - mac address of the requestor
message - route request message received

addRoute

public void addRoute(long senderMACAddress,
                     RREP message)
Create a new route entry based on a received route reply, then call doTableAddition()

Parameters:
senderMACAddress - sender of the route response
message - route response message received

getDestinationSequenceNumber

public int getDestinationSequenceNumber(long address)
get the destination sequence number for a certain entry

Parameters:
address - address of the entry that we are interested in
Returns:
destinationSequenceNumber

cleanTable

public void cleanTable()
delete all table entries that are expired


freshenRoute

public boolean freshenRoute(long address)
increases the expiry time for a route that is specified by the destination address

Parameters:
address - destination address to be refreshed
Returns:
true when finished

deactivateRoute

public void deactivateRoute(long originator,
                            long destination)
removes a node from the users list of a route and sets the activity flag to false

Parameters:
originator - originator of the route request
destination - destination address of route entry

getAllEntries

public Vector getAllEntries()
This method provides access to the entire routing table. It can be used to monitor the state of the routing table by an application. CAUTION: As this method accesses a syncronized object, it should not be called to often.

Returns:
vector of all routing entries

dumpTable

public void dumpTable()

setOurAddress

public void setOurAddress(long ourAddress)
sets our IEEE Address

Parameters:
ourAddress - our IEEE Address as a long

SunSPOT API V3.0


Copyright © 2006, 2007 Sun Microsystems, Inc. All Rights Reserved.