|
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 FnbRIPRouter
public class FnbRIPRouter
This class implements a Router 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. Note that this class is based on
RIPRouter
class.
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 | |
---|---|
FnbRIPRouter(String name,
boolean trace,
int my_id)
Creates a new FnbRIPRouter object with logging facility if it is turned on. |
|
FnbRIPRouter(String name,
boolean trace,
int my_id,
boolean stats)
Creates a new FnbRIPRouter object with logging facility if it is turned on. |
|
FnbRIPRouter(String name,
int my_id)
Creates a new RIPRouter object. |
|
FnbRIPRouter(String name,
int my_id,
boolean stats)
Creates a new RIPRouter object. |
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. |
int |
getMyID()
Returns the user specified ID of this router |
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()
At the end of simulations, write the counters into files. |
protected void |
processEvent(Sim_event ev)
Processes incoming events |
protected void |
sendInitialEvent()
Sends an initial event to itself regarding to the ARED parameters. |
Methods inherited from class Router |
---|
body, registerOtherEntity, 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 FnbRIPRouter(String name, int my_id) throws NullPointerException
FnbRIPRouter(String, boolean, int)
.
name
- Name of this routermy_id
- the user specified router ID.
For a router named "router0", my_id will be 0.
NullPointerException
- This happens when name is empty or nullFnbRIPRouter(String, boolean, int)
public FnbRIPRouter(String name, boolean trace, int my_id) throws NullPointerException
name
- Name of this routertrace
- true if you want to record this router's
activity, false otherwisemy_id
- the user specified router ID.
For a router named "router0", my_id will be 0.
NullPointerException
- This happens when name is empty or nullpublic FnbRIPRouter(String name, int my_id, boolean stats) throws NullPointerException
FnbRIPRouter(String, boolean, int)
.
name
- Name of this routermy_id
- the user specified router ID.
For a router named "router0", my_id will be 0.stats
- true if we want to record statistics
NullPointerException
- This happens when name is empty or nullFnbRIPRouter(String, boolean, int)
public FnbRIPRouter(String name, boolean trace, int my_id, boolean stats) throws NullPointerException
name
- Name of this routertrace
- true if you want to record this router's
activity, false otherwisemy_id
- the user specified router ID.
For a router named "router0", my_id will be 0.stats
- true if we want to recor statistics
NullPointerException
- This happens when name is empty or nullMethod Detail |
---|
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 objectprotected void processEndSimulation()
processEndSimulation
in class Router
protected void sendInitialEvent()
sendInitialEvent
in class Router
public PacketScheduler getScheduler(Packet np)
getScheduler
in class Router
np
- FnbNetPacket 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
public int getMyID()
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 |