Sim.Routing.DSR
Class DSRRoutingAlgorithm

java.lang.Object
  extended by Sim.Routing.AbstractRoutingAlgorithm
      extended by Sim.Routing.DSR.DSRRoutingAlgorithm
All Implemented Interfaces:
RoutingAlgorithm

public class DSRRoutingAlgorithm
extends AbstractRoutingAlgorithm

DSRRoutingAlgorithm implements most of the DSR protocol.


Field Summary
 
Fields inherited from class Sim.Routing.AbstractRoutingAlgorithm
myNode
 
Constructor Summary
DSRRoutingAlgorithm()
           
 
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.
static void enableLog(boolean enabled)
          Set to true to enable logging of a lot of debugging information to standard output.
 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 terminated(HardwareFrame in)
          Event when a HardwareFrame arrives destined for this Node that has a user Packet that is destined for this Node.
 
Methods inherited from class Sim.Routing.AbstractRoutingAlgorithm
attached, getTime, loopback, scheduleEvent, setSimulation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DSRRoutingAlgorithm

public DSRRoutingAlgorithm()
Method Detail

enableLog

public static void enableLog(boolean enabled)
Set to true to enable logging of a lot of debugging information to standard output.


arrived

public 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. The data in the frame may need to be routed.

Specified by:
arrived in interface RoutingAlgorithm
Overrides:
arrived in class AbstractRoutingAlgorithm
Parameters:
in - non-null HardwareFrame received

terminated

public void terminated(HardwareFrame in)
Event when a HardwareFrame arrives destined for this Node that has a user Packet that is destined for this Node. The data has arrived at its final destination, so it does not need to be routed.

Specified by:
terminated in interface RoutingAlgorithm
Overrides:
terminated in class AbstractRoutingAlgorithm
Parameters:
in - non-null HardwareFrame received

newPacket

public void newPacket(Node dest,
                      Packet packet)
Event when a Node wants to send a new Packet. The RoutingAlgorithm should bundle the Packet in a HardwareFrame and send it through the Node.

Specified by:
newPacket in interface RoutingAlgorithm
Overrides:
newPacket in class AbstractRoutingAlgorithm
Parameters:
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.

overheard

public void overheard(HardwareFrame in)
Event when a HardwareFrame is overheard by a Node (the HardwareFrame's destination is not the Node).

For DSR, this checks for passive acknowledgement

Specified by:
overheard in interface RoutingAlgorithm
Overrides:
overheard in class AbstractRoutingAlgorithm
Parameters:
in - non-null HardwareFrame received