|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
simnet.Node
simnet.Router
simnet.AggregateRouter
A router that simulates a having a subnet attached to it.
| Nested Class Summary | |
private class |
AggregateRouter.Subnet
|
| Field Summary | |
protected AggregateRouter.Subnet[] |
subnets
Array of our subnets. |
protected int |
total_hosts
Total hosts in all subnets |
| Fields inherited from class simnet.Router |
fixed_bits |
| Fields inherited from class simnet.Node |
applications, default_plugins_loaded, frame, frozen, id, in_filters, in_links, ipid, isNatted, keep_going, name, natGW, ns, out_filters, out_links, pause, proc, random, resolver, routing_table, running, sim, sleeping, transports, ui, win |
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
AggregateRouter()
|
|
| Method Summary | |
protected void |
forward(IP_Packet ip_packet)
Forward a packet as normal, unless it is in our subnet and not for us - in that case, silently drop the packet. |
int |
getHopCount(int ip)
Returns the number of hops to an IP if it exists within our subnet, or -1 if that IP does not exist. |
int |
getSubnet(int ip)
Returns the subnet number the IP address is in, or -1 if that subnet doesn't exist or is outside the router's subnet. |
int |
getSubnetCount()
Return the number of /24 subnets based on our fixed_bits. |
void |
initialize(int router_id,
java.lang.String name)
Initializes a new Router by setting its ID, name, node class (Router) and a pointer to the Simulator. |
boolean |
isSubnetPresent(int num)
Does the specfied subnet number (NOT IP) exist? |
| Methods inherited from class simnet.Router |
getFixedBits, getNodeClass, setFixedBits |
| Methods inherited from class simnet.Node |
addBPF, addLink, addRule, clear, closeWindow, command, command, deleteRule, empty, finalize, getApplication, getHostByName, getLink, getPluginCount, getTitleString, getTransport, getTransport, integrate, isolate, kill, lookup, lookup, out, prePlugout, printout, printout, processWindowCommand, removeBPF, removeLink, run, setupNAT, start, stateful_kill, stateful_start, toString, toString, window |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, stop, stop, suspend, yield |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected AggregateRouter.Subnet[] subnets
protected int total_hosts
| Constructor Detail |
public AggregateRouter()
| Method Detail |
public void initialize(int router_id,
java.lang.String name)
initialize in class Routerrouter_id - ID of new nodename - name of new nodepublic int getSubnetCount()
protected void forward(IP_Packet ip_packet)
forward in class Routerip_packet - incoming IP packet to be forwardedpublic int getSubnet(int ip)
public boolean isSubnetPresent(int num)
public int getHopCount(int ip)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||