|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object Thread Sim_entity Router FlowRouter
public class FlowRouter
This class implements a FlowRouter using a form of RIP for routing. The routing protocol used here is similar to Routing Information Protocol (RIP) . The routing protocol is run before Gridlets etc. can be submitted.
In case there are more than two routes to a destination, the route with the lower hopcount is used. Since in this simulation routers relay perfect information and links do not break down, RIP should be a reliable protocol to use.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class Router |
---|
DELAY, MAX_HOP_COUNT, reportWriter_ |
Fields inherited from class Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
FlowRouter(String name)
Creates a new FlowRouter object. |
|
FlowRouter(String name,
boolean trace)
Creates a new FlowRouter object with logging facility if it is turned on. |
Method Summary | |
---|---|
protected void |
advertiseHosts()
All hosts connected to this router are advertised to adjacent routers |
void |
attachHost(GridSimCore entity,
PacketScheduler sched)
Attaches an entity to this router. |
void |
attachRouter(Router router,
Link link,
PacketScheduler sched)
Joins two routers together. |
void |
attachRouter(Router router,
Link link,
PacketScheduler thisSched,
PacketScheduler otherSched)
Joins two routers with a Link. |
PacketScheduler |
getScheduler(int dest)
Returns the Scheduler that the router would use to reach a particular destination. |
PacketScheduler |
getScheduler(Packet np)
Returns the Scheduler associated with a packet. |
PacketScheduler |
getScheduler(String dest)
Returns the Scheduler that the router would use to reach a particular destination. |
void |
printRoutingTable()
Prints this router's routing table in a nice-formatted layout |
protected void |
processEndSimulation()
Informs the registered entities regarding to the end of a simulation. |
protected void |
processEvent(Sim_event ev)
Processes incoming events |
Methods inherited from class Router |
---|
body, registerOtherEntity, sendInitialEvent, write |
Methods inherited from class Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FlowRouter(String name) throws NullPointerException
FlowRouter(String, boolean)
.
name
- Name of this router
NullPointerException
- This happens when name is empty or nullFlowRouter(String, boolean)
public FlowRouter(String name, boolean trace) throws NullPointerException
name
- Name of this routertrace
- true if you want to record this router's
activity, false otherwise
NullPointerException
- This happens when name is empty or nullMethod Detail |
---|
protected void processEndSimulation()
processEndSimulation
in class Router
public void attachRouter(Router router, Link link, PacketScheduler thisSched, PacketScheduler otherSched)
attachRouter
in class Router
router
- The router on the other side to which this one will
be attached.link
- This is the link that will be used to connect the two
routers.thisSched
- The scheduling policy used on this routers egress port
when sending data through it.otherSched
- The scheduling policy that will be used on the
egress port of the router being connected to when
sending data to this router.public void attachRouter(Router router, Link link, PacketScheduler sched)
attachRouter
in class Router
router
- The Router to which this router will be connected.link
- The Link that will be used to join these routers.sched
- The scheduling policy used on the egress port of the
router when sending data through this route.public void attachHost(GridSimCore entity, PacketScheduler sched)
GridSimCore.getLink()
.
attachHost
in class Router
entity
- The entity to be attached.sched
- The scheduling policy that will be used on the egress
port when the router sends data to the entity being
joined.GridSimCore.getLink()
protected void processEvent(Sim_event ev)
processEvent
in class Router
ev
- a Sim_event objectpublic PacketScheduler getScheduler(Packet np)
getScheduler
in class Router
np
- NetPacket for which the associated scheduler is to be returned
public PacketScheduler getScheduler(int dest)
getScheduler
in class Router
dest
- id of the destination for which the Scheduler is required.
public PacketScheduler getScheduler(String dest)
getScheduler
in class Router
dest
- Name of the destination for which the Scheduler is required.
public void printRoutingTable()
printRoutingTable
in class Router
protected void advertiseHosts()
advertiseHosts
in class Router
|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |