|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsimnet.RoutingTable
simnet.RIPRoutingTable
An implementation of the Routing Information Protocol (RIP). On routers, a RIP "daemon" will be run, but on hosts, all packets are forwarded to the host's gateway.
| Nested Class Summary | |
(package private) class |
RIPRoutingTable.RIPTimerTask
Inner class used to periodically send RIP Advertisments. |
| Field Summary | |
static int |
INFINITY
|
(package private) long |
last_start
|
(package private) long |
last_update
|
(package private) int |
msg_count
|
static int |
NORMAL_UPDATE_DELAY
How often (in ms) to send out advertisments. |
protected java.util.LinkedList |
queue
|
static int |
REPORT_STABLE_DELAY
|
(package private) Trie |
routeTrie
|
protected boolean |
sending_update
|
(package private) DatagramSocket |
sock
|
(package private) java.util.Timer |
timer
|
(package private) RIPRoutingTable.RIPTimerTask |
timertask
|
static int |
TRIGGERED_UPDATE_DELAY
How long to wait (in ms) before sending out a triggered update. |
| Fields inherited from class simnet.RoutingTable |
node, NODE_ID |
| Constructor Summary | |
RIPRoutingTable()
|
|
| Method Summary | |
int |
getDist(int to)
This is a dirty hack needed for Speed Test (to test how well bandwidth and latency are modelled) |
void |
initialize(Node parent_node)
If we are on a host, just keep a copy the node, if we are on a router, start open a socket and initalize the timer |
int |
lookup(int to)
Determines the ID of the next hop in the path to the specified node. |
boolean |
prePlugout(java.lang.Object replacement)
To clean up, stop the timer and close the socket; the routing table will get copied if appropriate. |
void |
PrintRoutingTable()
Prints the routing table. |
void |
processMessage(java.lang.Object o)
Receive a RIP advertisment message. |
protected void |
processMessageNow(java.lang.Object o)
Process a RIP advertisment message right now. |
void |
prt()
Prints the routing table. |
(package private) void |
reportTime()
For debugging, print out how long it took for the routing table to converge. |
void |
run()
Receives RIP advertisments. |
(package private) void |
updateTime()
For debugging, keep track of convergence status. |
| Methods inherited from class simnet.RoutingTable |
finalize, plugoutNotification |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
Trie routeTrie
java.util.Timer timer
RIPRoutingTable.RIPTimerTask timertask
DatagramSocket sock
long last_update
long last_start
public static final int REPORT_STABLE_DELAY
protected boolean sending_update
protected java.util.LinkedList queue
public static final int INFINITY
public static final int NORMAL_UPDATE_DELAY
public static final int TRIGGERED_UPDATE_DELAY
int msg_count
| Constructor Detail |
public RIPRoutingTable()
| Method Detail |
public void initialize(Node parent_node)
initialize in class RoutingTableparent_node - the node this routing table will run onpublic void run()
run in interface java.lang.Runnablepublic void prt()
public void processMessage(java.lang.Object o)
protected void processMessageNow(java.lang.Object o)
void reportTime()
void updateTime()
public int lookup(int to)
lookup in class RoutingTableto - the end of the path
public int getDist(int to)
public boolean prePlugout(java.lang.Object replacement)
prePlugout in interface Pluggablepublic void PrintRoutingTable()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||