|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsimnet.RoutingTable
simnet.ShortestPath
A routing table that uses global knowledge to route packets on the shortest path. If changes are made to the topology, the update shortest path (usp) command must be run.
| Field Summary | |
private java.util.Hashtable |
idx2ip
For conversion between indicies and ip's. |
private java.util.Hashtable |
ip2idx
For conversion between ip's and indicies. |
private int[][] |
link
Link weight table |
private int[] |
path
Shortest path table |
private int[] |
table
Distances to destinations |
| Fields inherited from class simnet.RoutingTable |
node, NODE_ID |
| Constructor Summary | |
ShortestPath()
|
|
| Method Summary | |
private boolean |
allSeen(boolean[] seen)
Determines whether all Nodes have been seen. |
boolean |
applicableLink(Link l)
|
void |
build()
Generates a static and centralized routing table using Dijkstra' s shortest path algorithm. |
private int |
getClosest(int[] table,
boolean[] seen)
Determines the ID of the Node closest to the current Node that hasn' t been seen yet. |
int |
getDist(int to)
This is a dirty hack needed for Speed Test (to test how well bandwidth and latency are modeled) |
private int |
idx(int ip)
convert a node ip into an index |
void |
initialize(Node parent_node)
Initializes a new ShortestPath routing table by initializing its num_nodes and links fields as well as its link and path arrays. |
private int |
ip(int idx)
convert a node index into an ip |
private boolean |
isApplicableFromNATRouter(NATRouter nr,
Link l)
|
private boolean |
isApplicableRecursive(Link l)
|
int |
lookup(int to)
Determines the ID of the next hop in the path to the specified node. |
boolean |
prePlugout(java.lang.Object replacement)
Don't need to do anything special to get removed or replaced. |
private void |
printTable(int[] table)
Prints out an array (poorly named function). |
| 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 |
private java.util.Hashtable ip2idx
private java.util.Hashtable idx2ip
private int[][] link
private int[] path
private int[] table
| Constructor Detail |
public ShortestPath()
| Method Detail |
public void initialize(Node parent_node)
initialize in class RoutingTableparent_node - The Node this routing algorithm is running onprivate int ip(int idx)
private int idx(int ip)
public void build()
private boolean allSeen(boolean[] seen)
seen - a boolean array used to keep track of
which nodes have been seen
private int getClosest(int[] table,
boolean[] seen)
table - the path tableseen - an array that keeps track of seen Nodespublic int lookup(int to)
lookup in class RoutingTableto - the end of the path
public int getDist(int to)
private void printTable(int[] table)
table - the table to printpublic boolean applicableLink(Link l)
private boolean isApplicableRecursive(Link l)
private boolean isApplicableFromNATRouter(NATRouter nr,
Link l)
public boolean prePlugout(java.lang.Object replacement)
prePlugout in interface Pluggable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||