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

Constructor Index

 o RIPRouting()
initializes the internal routing table and registers protocol with the Routing Manager

Method Index

 o Addentry(TableEntry)
adds a new entry to the router table
 o CheckEntry(TableEntry)
Check if an entry is in the table
 o Delelement(String)
delete the entry for the active node from the routing table
 o Delelement1(String)
delete the entry for the active node from the routing table
 o Findelement(String)
find a table entry in the router table
 o getnexthop(String)
get next hop interface of Routing protocol
 o getNextHop(String)
get next hop (called by a smartpacket that wants to reroute itself)
 o getNumberOfHopsToNode(String)
returns number of hops required to reach a given destination
 o gettable()
returns a copy of the routing table
 o getUpdateInterval()
returns the routing update interval for this protocol
 o PortDown(String)
called when node is no longer reachable
 o PortUp(String)
called by the routing manager to inform the protocol of a new neighbor
 o SendTable(String)
Send the router table to given active node
 o SetFlag(String, int)
set timer of an entry in the table
 o Update(int, int, String)
updates the metric in a router table
 o UpdateTimers()
increment timers

Constructors

 o RIPRouting
 public RIPRouting()
initializes the internal routing table and registers protocol with the Routing Manager

Methods

 o 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
 o PortDown
 public void PortDown(String PortName)
called when node is no longer reachable

Parameters:
PortName - name of down active node
 o 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
 o 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
 o gettable
 protected static Vector gettable()
returns a copy of the routing table

Returns:
the routing table
See Also:
TableEntry
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o SendTable
 protected static void SendTable(String portname)
Send the router table to given active node

Parameters:
portname - name of active node
 o CheckEntry
 protected static synchronized void CheckEntry(TableEntry ten)
Check if an entry is in the table

Parameters:
ten - the table entry to be checked
 o UpdateTimers
 protected static void UpdateTimers()
increment timers

 o 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
 o 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
1