All Packages Class Hierarchy This Package Previous Next Index
Class magician.Node.RIPRouting
java.lang.Object
|
+----magician.Node.RIPRouting
- public class RIPRouting
- extends Object
- implements RoutingProtocol, PerfConstants
Implements the RIP routing protocol for the discovery of neighboring
active nodes. It implements the RoutingProtocol interface so
that this protocol can be "stitched" in with the RoutingMgr's
list of available protocols. In fact, this is the default routing protocol
for this implementation of the active network.
The RIPRouting protocol maintains an internal routing table which is implemented
as a vector of type TableEntry, which contains information about the
reachable nodes in the network and their hop distance from current node.
- See Also:
- RoutingMgr, TableEntry
-
RIPRouting()
- initializes the internal routing table and registers protocol with the Routing Manager
-
Addentry(TableEntry)
- adds a new entry to the router table
-
CheckEntry(TableEntry)
- Check if an entry is in the table
-
Delelement(String)
- delete the entry for the active node from the routing table
-
Delelement1(String)
- delete the entry for the active node from the routing table
-
Findelement(String)
- find a table entry in the router table
-
getnexthop(String)
- get next hop interface of Routing protocol
-
getNextHop(String)
- get next hop (called by a smartpacket that wants
to reroute itself)
-
getNumberOfHopsToNode(String)
- returns number of hops required to reach a given destination
-
gettable()
- returns a copy of the routing table
-
getUpdateInterval()
- returns the routing update interval for this protocol
-
PortDown(String)
- called when node is no longer reachable
-
PortUp(String)
-
called by the routing manager to inform the protocol of a new neighbor
-
SendTable(String)
- Send the router table to given active node
-
SetFlag(String, int)
- set timer of an entry in the table
-
Update(int, int, String)
- updates the metric in a router table
-
UpdateTimers()
- increment timers
RIPRouting
public RIPRouting()
- initializes the internal routing table and registers protocol with the Routing Manager
PortUp
public void PortUp(String hadr)
- called by the routing manager to inform the protocol of a new neighbor
- Parameters:
- hadr - the name of the neighboring active node
PortDown
public void PortDown(String PortName)
- called when node is no longer reachable
- Parameters:
- PortName - name of down active node
getNextHop
public static String getNextHop(String iaddr) throws NoRouteToHostException
- get next hop (called by a smartpacket that wants
to reroute itself)
- Parameters:
- iaddr - the destination to which the next hop is desired
- Returns:
- the name of the next hop
- Throws: NoRouteToHostException
- if no route exists or node is unreachable
getnexthop
public String getnexthop(String destination) throws NoRouteToHostException
- get next hop interface of Routing protocol
- Parameters:
- destination - the name of the destination active node
- Throws: NoRouteToHostException
- if no route exists or node is unreachable
gettable
protected static Vector gettable()
- returns a copy of the routing table
- Returns:
- the routing table
- See Also:
- TableEntry
Update
protected static void Update(int index,
int mtrc,
String fst)
- updates the metric in a router table
- Parameters:
- index - the index of the entry in the routing table
- mtrc - the number of hops
- fst - name of gateway
Addentry
protected static void Addentry(TableEntry entr)
- adds a new entry to the router table
- Parameters:
- entr - TableEntry object denoting new entry in the table
- See Also:
- TableEntry
Delelement
protected static void Delelement(String adr)
- delete the entry for the active node from the routing table
- Parameters:
- adr - name of active node to be deleted
Delelement1
protected static void Delelement1(String adr)
- delete the entry for the active node from the routing table
- Parameters:
- adr - name of active node to be deleted
SetFlag
protected static void SetFlag(String adr,
int flg)
- set timer of an entry in the table
- Parameters:
- adr - name of active node whose entry is to be changed
- flg - the value of the timer
Findelement
protected static int Findelement(String adr)
- find a table entry in the router table
- Parameters:
- adr - name of active node
- Returns:
- index of table entry
SendTable
protected static void SendTable(String portname)
- Send the router table to given active node
- Parameters:
- portname - name of active node
CheckEntry
protected static synchronized void CheckEntry(TableEntry ten)
- Check if an entry is in the table
- Parameters:
- ten - the table entry to be checked
UpdateTimers
protected static void UpdateTimers()
- increment timers
getNumberOfHopsToNode
public int getNumberOfHopsToNode(String laddr) throws NoRouteToHostException
- returns number of hops required to reach a given destination
- Parameters:
- laddr - the destination address
- Returns:
- number of hops required to reach it
- Throws: NoRouteToHostException
- if no route exists
getUpdateInterval
public int getUpdateInterval()
- returns the routing update interval for this protocol
- Returns:
- the update interval
All Packages Class Hierarchy This Package Previous Next Index