DRCL J-Sim API

drcl.inet.tool
Class routing_msp2

java.lang.Object
  extended bydrcl.net.graph.ShortestPathTree
      extended bydrcl.inet.tool.routing_msp2

public class routing_msp2
extends ShortestPathTree

This class sets up static routes for a network. The routes being set up form a shortest path tree rooted at each node as destination.

This class takes the adjacency matrix as the network topology and runs the Dijkstra algorithm to find the shortest path tree.

To use this class, invoke one of the setup(...) methods to install appropriate routing entries to nodes (this is done by Node.addRTEntry()). Or one can choose not to install routing entries but only return the result of the shortest path tree.


Field Summary
 int[][] adjMatrix
           
 int[][] childIndices
           
 LinkCost linkcost
           
 Node[] realNodes
           
 int[][] routes
           
 
Constructor Summary
routing_msp2()
           
 
Method Summary
 boolean isProfilingDetailEnabled()
           
 boolean isProfilingDetailPrintEnabled()
           
 boolean isProfilingEnabled()
           
 void reset()
           
 void setProfilingDetailEnabled(boolean e)
           
 void setProfilingDetailPrintEnabled(boolean e)
           
 void setProfilingEnabled(boolean e)
           
 void setup(Component network_, int[][] adjMatrix_)
          Sets up unicast routes for the network_.
 void setup(Component network_, int[][] adjMatrix_, boolean retainResult_, boolean installRoutes_)
          Sets up unicast routes for the network_.
 void setup(Component network_, int[][] adjMatrix_, long[] ids_)
          Sets up unicast routes for the network_.
 void setup(Component network_, int[][] adjMatrix_, long[] ids_, LinkCost linkcost_, boolean retainResult_, boolean installRoutes_)
          See setup(Component, int[][], boolean, boolean).
 void setup(Node[] realNodes_, int[][] adjMatrix_, LinkCost linkcost_, boolean retainResult_, boolean installRoutes_)
          Sets up unicast routes for the network_.
 void stopit()
           
 
Methods inherited from class drcl.net.graph.ShortestPathTree
getCost, isDebugEnabled, run, setDebugEnabled
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

realNodes

public Node[] realNodes

adjMatrix

public int[][] adjMatrix

linkcost

public LinkCost linkcost

childIndices

public int[][] childIndices

routes

public int[][] routes
Constructor Detail

routing_msp2

public routing_msp2()
Method Detail

setProfilingEnabled

public void setProfilingEnabled(boolean e)

isProfilingEnabled

public boolean isProfilingEnabled()

setProfilingDetailEnabled

public void setProfilingDetailEnabled(boolean e)

isProfilingDetailEnabled

public boolean isProfilingDetailEnabled()

setProfilingDetailPrintEnabled

public void setProfilingDetailPrintEnabled(boolean e)

isProfilingDetailPrintEnabled

public boolean isProfilingDetailPrintEnabled()

stopit

public void stopit()

setup

public void setup(Component network_,
                  int[][] adjMatrix_)
Sets up unicast routes for the network_. Assumes that nodes in the network are addressed at 0, 1, ..., and so on.

Parameters:
adjMatrix_ - adjacency matrix that describes network topology.

setup

public void setup(Component network_,
                  int[][] adjMatrix_,
                  long[] ids_)
Sets up unicast routes for the network_.

Parameters:
adjMatrix_ - adjacency matrix that describes network topology.
ids_ - real node addresses. ids_[0] is the node address of node 0. The indexing matches between ids_ and adjMatrix_.

setup

public void setup(Component network_,
                  int[][] adjMatrix_,
                  boolean retainResult_,
                  boolean installRoutes_)
Sets up unicast routes for the network_.

Parameters:
retainResult_ - if true, the result is stored in childIndices and routes which are (n x n) array where n is number of nodes. The first dimension is the destination node index. For the shortest path tree of each destination node, the second dimension records the child node index and interface index to child, respectively, in that tree.
installRoutes_ - true if results are installed to the nodes.

setup

public void setup(Component network_,
                  int[][] adjMatrix_,
                  long[] ids_,
                  LinkCost linkcost_,
                  boolean retainResult_,
                  boolean installRoutes_)
See setup(Component, int[][], boolean, boolean).

Parameters:
ids_ - real node addresses. ids_[0] is the node address of node 0. The indexing matches between ids_ and adjMatrix_.
linkcost_ - cost matrix for network links; use downstream node index as the first argument and the interface index of the downstream node (to the upstream node) as the 2nd argument. The interface index should be consistent with that in adjMatrix_. For the format of adjMatrix, see drcl.inet.InetUtil.createTopology(Component,String, String,Object[],int[][],long[],drcl.inet.Link,boolean)

reset

public void reset()

setup

public void setup(Node[] realNodes_,
                  int[][] adjMatrix_,
                  LinkCost linkcost_,
                  boolean retainResult_,
                  boolean installRoutes_)
Sets up unicast routes for the network_. The indices in realNodes_ must match those in adjMatrix_. The values in adjMatrix_ are indices to realNodes_.

If 'retainResult' is turned on, the result is returned in a (n x n) array where n is number of nodes. The first dimension is the destination node index. For the shortest path tree of each destination node, the second dimension records the parent node index in that tree.

Parameters:
linkcost_ - cost matrix for network links; use downstream node index as the first argument and the interface index of the downstream node (to the upstream node) as the 2nd argument. The interface index should be consistent with that in adjMatrix_. For the format of adjMatrix, see drcl.inet.InetUtil.createTopology(Component,String, String,Object[],int[][],long[],drcl.inet.Link,boolean)

DRCL J-Sim API

Copyright © 1998-2003 Distributed Real-time Computing Lab (DRCL). All Rights Reserved.     ~ To J-Sim Home ~