Class DVNode

java.lang.Object
  extended by Node
      extended by DVNode

public class DVNode
extends Node

Distance Vector algorithm implementing node. If you want to tune the DV algorithm, this is the place.


Field Summary
 
Fields inherited from class Node
failed, lastHeardDelay, lastUpdatedSlot, neighbor, rand, uid
 
Constructor Summary
DVNode()
           
 
Method Summary
protected  void failureEvent()
          This method is invoked (by Node.java) when a previously running node goes down.
protected  void neighborFailureEvent(Node neighbor)
          Invoked when a timeout indicates that a neighbor node has failed.
protected  void processUpdate(UpdatePacket udp)
          Called for each update packet in this node's queue when it is selected to run during a time step.
protected  void recoveryEvent()
          This method is invoked (by Node.java) when a previously failed node comes back online.
protected  void startUpdate()
          When this node is selected to run during a time step, the "driver" code in Node.java: first calls this routine (startUpdate()) then with high, but not certain, probability calls processUpdate() for each update packet in the node's queue
  • protected  void stopUpdate()
              See comment before startUpdate().
     
    Methods inherited from class Node
    getRoutingTable, getUID, hasFailed, oracleComputeRoutingTable, oracleFillTable, sendUpdatePacket, setHasFailed, setupNeighborInformation, swapInQueues, takeStep, toString
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
     

    Constructor Detail

    DVNode

    public DVNode()
    Method Detail

    startUpdate

    protected void startUpdate()
    When this node is selected to run during a time step, the "driver" code in Node.java:
    1. first calls this routine (startUpdate())
    2. then with high, but not certain, probability calls processUpdate() for each update packet in the node's queue
    3. (1) and (3) allow some flexibility in the implementation of different (sub)classes of node, without having to meddle with the code in Node.java.

      Specified by:
      startUpdate in class Node

    processUpdate

    protected void processUpdate(UpdatePacket udp)
    Called for each update packet in this node's queue when it is selected to run during a time step.

    Specified by:
    processUpdate in class Node

    stopUpdate

    protected void stopUpdate()
    See comment before startUpdate().

    Specified by:
    stopUpdate in class Node

    failureEvent

    protected void failureEvent()
    This method is invoked (by Node.java) when a previously running node goes down.

    You are honor bound to throw away any information your node may have cached when this happens. (Node.java will have already thrown out what it knows about, i.e., the routing table.)

    Specified by:
    failureEvent in class Node

    recoveryEvent

    protected void recoveryEvent()
    This method is invoked (by Node.java) when a previously failed node comes back online. When the node failed, Node.java assigned it a new RoutingTable object, with the entries for all destinations set to "no next hop". You can/must do here anything you think is necessary.

    Because the base implementation depends on the logging done by the RouterTable object, we must force all "no path to the destination" entries into it. We do that here. (Note that RouterTable.startLogging() has already been called (by startUpdate()) when control reaches this point.)

    Node.java sets the routing table entry for this node to itself correctly when you return from this method.

    Specified by:
    recoveryEvent in class Node

    neighborFailureEvent

    protected void neighborFailureEvent(Node neighbor)
    Invoked when a timeout indicates that a neighbor node has failed.

    Specified by:
    neighborFailureEvent in class Node