|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RoutingAlgorithm
RoutingAlgorithm specifies the interface for a routing algorithm for a Node. Frames and new Packets are passed from the Node to the RoutingAlgorithm, and the RoutingAlgorithm is responsible for queuing a HardwareFrame at the Node in order to forward the Packet towards its destination.
In order to facilitate easy dynamic loading, all implementations of RoutingAlgorithm must have a default constructor.
Method Summary | |
---|---|
void |
arrived(HardwareFrame in)
Event when a HardwareFrame arrives destined for this Node that does not have a user Packet, or has a Packet not for this Node. |
void |
attached(Node us)
Event called when a Node is given a RemoteAlgorithm to route packets for it. |
void |
loopback(HardwareFrame in)
Event when a Node hears its own HardwareFrame (which is guaranteed to happen after a send completes). |
void |
newPacket(Node dest,
Packet packet)
Event when a Node wants to send a new Packet. |
void |
overheard(HardwareFrame in)
Event when a HardwareFrame is overheard by a Node (the HardwareFrame's destination is not the Node). |
void |
setSimulation(Simulation sim)
Sets the simulation for this RoutingAlgorithm. |
void |
terminated(HardwareFrame in)
Event when a HardwareFrame arrives destined for this Node that has a user Packet that is destined for this Node. |
Method Detail |
---|
void setSimulation(Simulation sim)
sim
- non-null Simulationvoid attached(Node us)
us
- non-null Nodevoid arrived(HardwareFrame in)
in
- non-null HardwareFrame receivedvoid terminated(HardwareFrame in)
in
- non-null HardwareFrame receivedvoid overheard(HardwareFrame in)
in
- non-null HardwareFrame receivedvoid loopback(HardwareFrame in)
in
- non-null HardwareFrame received whose source equals the "us" addressvoid newPacket(Node dest, Packet packet)
dest
- non-null Node as the destination (packet.getDest() == dest.getAddress())packet
- user packet data to send, with a destination address not equal to the address
for the sending Node.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |