All Packages  This Package  Class Hierarchy  Class Search  Index

Class edu.utah.janos.antsr.route.DynamicRouteTable
java.lang.Object
   |
   +----edu.utah.janos.route.RouteTable
           |
           +----edu.utah.janos.route.WriteableRouteTable
                   |
                   +----edu.utah.janos.antsr.route.DynamicRouteTable

  Summary

public class  DynamicRouteTable
     extends edu.utah.janos.route.WriteableRouteTable
     implements edu.utah.janos.antsr.core.RouteTable
{
          // Fields 3
     public static final int INFINITY;
     private final Hashtable gateways;
     private final Hashtable gcPool;

          // Constructors 1
     public DynamicRouteTable();

          // Methods 9
     public void addRoute(int, int, String) throws NoSuchNodeAddress, AddressFormatException;
     public void configure(int, boolean, String) throws IOException, AddressFormatException, NoSuchNodeAddress;
     Hashtable gcPool();
     public Enumeration getGateways();
     public Enumeration getNeighbors();
     public RouteEntry getRoute(int);
     public RouteEntry getRoute(Integer);
     public int neighborCount();
     public void removeRoute(RouteEntry);
}

The ANTSR DynamicRouteTable contains all of the state and code for maintaining a dynamic routing table. This includes sending out periodic updates, sending out immediate updates, (and receiving both). GC'ing stale routes, etc.

I think there are some problems in here for a node that has more than one physical address. It will probably send the wrong info out to the other nodes...

Based very strongly on the dynamic route table from the original MIT ANTS. I renamed and moved a lot of things around, but I (hopefully) didn't change the update algorithm.

XXX access control issues.




  Fields

· INFINITY

Summary  |  Top

   public static final int INFINITY

Maximum cost of travelling to a node. Dunno why 16 is a good number.


· gcPool

Summary  |  Top
   private final Hashtable gcPool

GC pool; unavailable for retrieving routes from.

DynamicRouteEntries are added to the GC pool when they "expire". Later, they will be deleted from the GC pool, for good. DynamicRouteEntries might get "resuscitated" from the pool.

Maps Integer() wrapped destintion addresses to RouteEntries. XXX this is actually another RouteTable instance...


· gateways

Summary  |  Top
   private final Hashtable gateways

Gateways: hardwired connections to other networks. This map contains *only* the hardwired gateways. Nodes which are one hop away which are learned at run-time are not included in this map. XXX I think that is a bug.

Maps Integer() wrapped destintion addresses to DynamicRouteEntries. XXX this is actually another RouteTable instance...

Only really used in the sendRouteMessages() function.

See Also: sendRouteMessages


  Constructors

· DynamicRouteTable

Summary  |  Top

   public DynamicRouteTable() 


  Methods

· configure

Summary  |  Top
   public void configure(int nodeAddr, 
                         boolean doUpdates, 
                         String configFile)  throws IOException, AddressFormatException, NoSuchNodeAddress

XXX one-time function.

Implements:
configure in interface RouteTable


· getRoute

Summary  |  Top
   public RouteEntry getRoute(int activeDest) 

Retrive the current route to get to the given active address.

Overrides:
getRoute in class WriteableRouteTable
Implements:
getRoute in interface RouteTable


· getRoute

Summary  |  Top
   public RouteEntry getRoute(Integer activeDest) 
Overrides:
getRoute in class WriteableRouteTable


· gcPool

Summary  |  Top
   Hashtable gcPool() 


· getNeighbors

Summary  |  Top
   public Enumeration getNeighbors() 
Overrides:
getNeighbors in class RouteTable
Implements:
getNeighbors in interface RouteTable


· getGateways

Summary  |  Top
   public Enumeration getGateways() 


· neighborCount

Summary  |  Top
   public int neighborCount() 
Overrides:
neighborCount in class RouteTable
Implements:
neighborCount in interface RouteTable


· removeRoute

Summary  |  Top
   public void removeRoute(RouteEntry r) 

Remove a route from the table.

Overrides:
removeRoute in class WriteableRouteTable


· addRoute

Summary  |  Top
   public void addRoute(int activeDest, 
                        int activeNext, 
                        String physNext)  throws NoSuchNodeAddress, AddressFormatException

Add a route to the table.

XXX this is only invoked by RouteTableReader. Don't call internally...

Overrides:
addRoute in class WriteableRouteTable


All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7