|
DRCL J-Sim API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectdrcl.inet.InetUtil
The utility class that offers tools for building a network topology and so on.
| Field Summary |
| Constructor Summary | |
InetUtil()
|
|
| Method Summary | |
static void |
configure(Component network_)
Configures the "host" routing entries and the interface info at the area boundary routers. |
static void |
configure(java.lang.Object[] nodes_)
Configures the "host" routing entries and the interface info at the area boundary routers. |
static void |
configureFlat(Component network_)
Calls configureFlat(network_.getAllComponents(), true, true). |
static void |
configureFlat(Component network_,
boolean reassignNodeID_,
boolean setupInterface_)
Calls configureFlat(network_.getAllComponents(), reassignNodeID_,
setupInterface_). |
static void |
configureFlat(java.lang.Object[] nodes_)
Calls configureFlat(nodes_, true, true). |
static void |
configureFlat(java.lang.Object[] nodes_,
boolean reassignNodeID_,
boolean setupInterface_)
Sets up the "host" routing entries and the interface info at the area boundary routers in the flat network. |
static void |
connect(Component p1_,
Component p2_)
Connects two protocol components. |
static boolean |
connect(Component p1_,
Component p2_,
int protocolID_)
Connects two protocol components with the specified protocol ID. |
static void |
connectTCP(Component p1_,
Component p2_)
Connects two TCP components (TCP-TCPSink or TCPb's) with protocol ID automatically assigned |
static boolean |
connectTCP(Component p1_,
Component p2_,
int protocolID_)
Connects two TCP components (TCP-TCPSink or TCPb's) with the specified protocol ID. |
static int[][] |
createMeshAdjMatrix(int nc_,
int nr_)
Creates and returns the adjacency matrix for a regular mesh topology of the given size. |
static void |
createNodes(Component network_,
int nNodes_)
Creates nodes. |
static void |
createNodes(Component network_,
int startIndex_,
int endIndex_)
Creates nodes. |
static void |
createNodes(Component network_,
java.lang.String idPrefix_,
int nNodes_)
Creates nodes. |
static void |
createNodes(Component network_,
java.lang.String idPrefix_,
int startIndex_,
int endIndex_)
Creates nodes. |
static void |
createTopology(Component network_,
int[][] adjMatrix_)
Creates a network topology based on an adjacency matrix. |
static void |
createTopology(Component network_,
int[][] adjMatrix_,
boolean assignAddress_)
Creates a network topology based on an adjacency matrix. |
static void |
createTopology(Component network_,
int[][] adjMatrix_,
Link link_)
Creates a network topology based on an adjacency matrix. |
static void |
createTopology(Component network_,
int[][] adjMatrix_,
Link link_,
boolean assignAddress_)
Creates a network topology based on an adjacency matrix. |
static void |
createTopology(Component network_,
int[][] adjMatrix_,
long[] ids_)
Creates a network topology based on an adjacency matrix. |
static void |
createTopology(Component network_,
int[][] adjMatrix_,
long[] ids_,
Link link_)
Creates a network topology based on an adjacency matrix. |
static void |
createTopology(Component network_,
java.lang.Object[] existing_,
int[][] adjMatrix_)
Creates a network topology based on an adjacency matrix. |
static void |
createTopology(Component network_,
java.lang.Object[] existing_,
int[][] adjMatrix_,
boolean assignAddress_)
Creates a network topology based on an adjacency matrix. |
static void |
createTopology(Component network_,
java.lang.Object[] existing_,
int[][] adjMatrix_,
Link link_)
Creates a network topology based on an adjacency matrix. |
static void |
createTopology(Component network_,
java.lang.Object[] existing_,
int[][] adjMatrix_,
Link link_,
boolean assignAddress_)
Creates a network topology based on an adjacency matrix. |
static void |
createTopology(Component network_,
java.lang.Object[] existing_,
int[][] adjMatrix_,
long[] ids_)
Creates a network topology based on an adjacency matrix. |
static void |
createTopology(Component network_,
java.lang.Object[] existing_,
int[][] adjMatrix_,
long[] ids_,
Link link_)
Creates a network topology based on an adjacency matrix. |
static void |
createTopology(Component network_,
java.lang.String routerIDPrefix_,
java.lang.String hostIDPrefix_,
int[][] adjMatrix_,
Link link_)
Creates a network topology based on an adjacency matrix. |
static void |
createTopology(Component network_,
java.lang.String routerIDPrefix_,
java.lang.String hostIDPrefix_,
int[][] adjMatrix_,
Link link_,
boolean assignAddress_)
Creates a network topology based on an adjacency matrix. |
static void |
createTopology(Component network_,
java.lang.String routerIDPrefix_,
java.lang.String hostIDPrefix_,
int[][] adjMatrix_,
long[] ids_,
Link link_)
Creates a network topology based on an adjacency matrix. |
static void |
createTopology(Component network_,
java.lang.String routerIDPrefix_,
java.lang.String hostIDPrefix_,
java.lang.Object[] existing_,
int[][] adjMatrix_,
Link link_)
Creates a network topology based on an adjacency matrix. |
static void |
createTopology(Component network_,
java.lang.String routerIDPrefix_,
java.lang.String hostIDPrefix_,
java.lang.Object[] existing_,
int[][] adjMatrix_,
Link link_,
boolean assignAddress_)
Creates a network topology based on an adjacency matrix. |
static void |
createTopology(Component network_,
java.lang.String routerIDPrefix_,
java.lang.String hostIDPrefix_,
java.lang.Object[] existing_,
int[][] adjMatrix_,
long[] ids_,
Link link_)
Creates a network topology based on an adjacency matrix. |
static void |
createTopology(Component network_,
java.lang.String routerIDPrefix_,
java.lang.String hostIDPrefix_,
java.lang.Object[] existing_,
int[][] adjMatrix_,
long[] ids_,
Link link_,
boolean assignAddress_)
Creates a network topology based on an adjacency matrix. |
static Component |
createTrafficSource(TrafficModel trafficModel_,
long dest_)
Returns a traffic generator component that can be attached to core service layer. |
static Component |
createTrafficSource(TrafficModel trafficModel_,
long src_,
long dest_,
long tos_)
Returns a traffic generator component that generates Inet packets. |
static Component |
createTrafficSource(TrafficModel trafficModel_,
Node dest_)
Returns a traffic generator component that can be attached to core service layer. |
static Component |
createTrafficSource(TrafficModel trafficModel_,
java.lang.String id_,
Node src_,
Node dest_,
long tos_,
int protocol_)
Creates a traffic generator component that generates Inet packets and installs it on the source node. |
static TrafficSourceComponent |
createTrafficSource(TrafficModel trafficSourceModel_,
TrafficModel trafficShaperModel_,
long dest_)
Returns a ``shaped'' traffic source component that can be attached to core service layer. |
static TrafficSourceComponent |
createTrafficSource(TrafficModel trafficSourceModel_,
TrafficModel trafficShaperModel_,
long src_,
long dest_,
long tos_)
Returns a ``shaped'' traffic source component that generates Inet packets. |
static TrafficSourceComponent |
createTrafficSource(TrafficModel trafficSourceModel_,
TrafficModel trafficShaperModel_,
java.lang.String id_,
Node src_,
Node dest_,
long tos_,
int protocol_)
Creates a ``shaped'' traffic source component that generates Inet packets and installs it on the source node. |
static int[][] |
getAdjMatrixFromFile(java.lang.String filename_)
|
static int |
getPID(Component c_)
Returns the protocol ID of the component if the component is a well-defined protocol. |
static void |
setAddressByCIDR(Network network_)
|
static void |
setAddressByCIDR(Network network_,
long baseAddress_)
|
static void |
setAddressByCIDR(java.lang.Object[] nodes_)
|
static void |
setAddressByCIDR(java.lang.Object[] nodes_,
long baseAddress_)
|
static void |
setAddressByID(Network network_)
Assigns network addresses to all nodes in the network by extracting from component IDs. |
static void |
setAddressByID(Node node_)
Assigns a network address to the argument node by extracting from its component ID. |
static void |
setAddressByID(java.lang.Object[] nodes_)
Assigns network addresses to nodes by extracting from component IDs. |
static void |
setIDByAddress(Component network_)
|
static void |
setIDByAddress(java.lang.Object[] nodes_)
|
static void |
setNamTraceOn(Component net_,
NamTrace nam_)
Sets up a NamTrace on a network component.
|
static void |
setNamTraceOn(Component net_,
NamTrace nam_,
java.lang.String filename_,
java.lang.String[] colors_)
Sets up a NamTrace on a network component.
|
static NamTrace |
setNamTraceOn(Component net_,
java.lang.String filename_,
java.lang.String[] colors_)
Sets up a NamTrace on a network component.
|
static void |
setupBRoute(Node sourceNode,
Node destNode)
Setup a bidiretional route between two directly connected nodes. |
static void |
setupRoute(Node sourceNode,
Node destNode)
Setup a route between two directly connected nodes. |
static void |
setupRoutes(Component src_,
Component dest_,
long destAddr_,
long destAddrMask_)
Sets up routing table entries between two nodes. |
static void |
setupRoutes(Component network_,
int[][] adjMatrix_)
Sets up unicast routes (min-hop) in the network in one shot. |
static void |
setupRoutes(Component network_,
int[][] adjMatrix_,
long[] addr_)
Same as setupRoutes(Component, int[][]) except that
this method allows node addresses to be arbitrary as specified
in addr_. |
static void |
setupRoutes(Component network_,
int[][] adjMatrix_,
long[] addr_,
LinkCost linkcost_)
Same as #setupRoutes(Component, int[][], LinkCost)
except that
this method allows node addresses to be arbitrary as specified
in addr_. |
static void |
setupRoutes(Component src_,
java.lang.Object[] dest_,
long destAddr_)
Sets up routing table entries between the source node and multiple destination nodes. |
static void |
setupRoutes(Component src_,
java.lang.Object[] dest_,
long destAddr_,
long destAddrMask_)
Sets up routing table entries between the source node and multiple destination nodes. |
static void |
setupRoutes(Component src_,
java.lang.Object[] dests_,
long srcAddr_,
long srcAddrMask_,
long destAddr_,
long destAddrMask_)
Sets up routing table entries between the source node and multiple destination nodes. |
static void |
setupRoutes(Node[] nodes_,
int[][] adjMatrix_,
LinkCost linkcost_)
Sets up unicast routes (min-cost) in the network in one shot. |
static void |
setupRoutes(Node src_,
Node dest_)
|
static void |
setupRoutes(Node src_,
Node dest_,
java.lang.String bidirect_)
|
static void |
setupVIF(Node n1_,
int vifindex1_,
int mtu1_,
Node n2_,
int vifindex2_,
int mtu2_)
Sets up virtual interfaces between two nodes. |
static void |
setupVIF(Node n1_,
int vifindex1_,
Node n2_,
int vifindex2_)
|
static void |
setupVIF(Node n1_,
int vifindex1_,
Node n2_,
int vifindex2_,
int mtu_)
|
static java.lang.String |
toString(Network network_)
Prints the network address and mask of the specified network. |
static java.lang.String |
traceRoute(Node from_,
Node to_)
Returns the result of trace route in the format of "(hop): (hop_address), if=(outgoing_interface)", a line for each hop. |
static java.lang.Object[] |
traceRouteInObj(Node from_,
Node to_)
Returns the result of trace route in an array. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public InetUtil()
| Method Detail |
public static java.lang.String traceRoute(Node from_,
Node to_)
traceRouteInObj(Node, Node)
public static java.lang.Object[] traceRouteInObj(Node from_,
Node to_)
public static int[][] createMeshAdjMatrix(int nc_,
int nr_)
nc_ - # of columns in the mesh.nr_ - # of rows in the mesh.
public static void createNodes(Component network_,
int startIndex_,
int endIndex_)
endIndex_ - exclusive.
public static void createNodes(Component network_,
java.lang.String idPrefix_,
int startIndex_,
int endIndex_)
endIndex_ - exclusive.
public static void createNodes(Component network_,
int nNodes_)
public static void createNodes(Component network_,
java.lang.String idPrefix_,
int nNodes_)
public static int[][] getAdjMatrixFromFile(java.lang.String filename_)
throws java.lang.Exception
java.lang.Exception
public static void createTopology(Component network_,
int[][] adjMatrix_)
createTopology(network_, "n", "h", null,
adjMatrix_, null, null, true).
createTopology(Component, String, String, Object[], int[][], long[],
Link, boolean)
public static void createTopology(Component network_,
int[][] adjMatrix_,
boolean assignAddress_)
createTopology(network_, "n", "h", null,
adjMatrix_, null, null, assignAddress_).
createTopology(Component, String, String, Object[], int[][], long[],
Link, boolean)
public static void createTopology(Component network_,
int[][] adjMatrix_,
long[] ids_)
createTopology(network_, "n", "h", null,
adjMatrix_, ids_, null, true).
createTopology(Component, String, String, Object[], int[][], long[],
Link, boolean)
public static void createTopology(Component network_,
java.lang.Object[] existing_,
int[][] adjMatrix_)
createTopology(network_, "n", "h", existing_,
adjMatrix_, null, null, true).
createTopology(Component, String, String, Object[], int[][], long[],
Link, boolean)
public static void createTopology(Component network_,
java.lang.Object[] existing_,
int[][] adjMatrix_,
boolean assignAddress_)
createTopology(network_, "n", "h", existing_,
adjMatrix_, null, null, assignAddress_).
createTopology(Component, String, String, Object[], int[][], long[],
Link, boolean)
public static void createTopology(Component network_,
java.lang.Object[] existing_,
int[][] adjMatrix_,
long[] ids_)
createTopology(network_, "n", "h", existing_,
adjMatrix_, ids_, null, true).
createTopology(Component, String, String, Object[], int[][], long[],
Link, boolean)
public static void createTopology(Component network_,
int[][] adjMatrix_,
Link link_)
createTopology(network_, "n", "h", null,
adjMatrix_, null, link_, true).
createTopology(Component, String, String, Object[], int[][], long[],
Link, boolean)
public static void createTopology(Component network_,
int[][] adjMatrix_,
Link link_,
boolean assignAddress_)
createTopology(network_, "n", "h", null,
adjMatrix_, null, link_, assignAddress_).
createTopology(Component, String, String, Object[], int[][], long[],
Link, boolean)
public static void createTopology(Component network_,
int[][] adjMatrix_,
long[] ids_,
Link link_)
createTopology(network_, "n", "h", null,
adjMatrix_, ids_, link_, true).
createTopology(Component, String, String, Object[], int[][], long[],
Link, boolean)
public static void createTopology(Component network_,
java.lang.Object[] existing_,
int[][] adjMatrix_,
Link link_)
createTopology(network_, "n", "h", existing_,
adjMatrix_, null, link_, true).
createTopology(Component, String, String, Object[], int[][], long[],
Link, boolean)
public static void createTopology(Component network_,
java.lang.Object[] existing_,
int[][] adjMatrix_,
Link link_,
boolean assignAddress_)
createTopology(network_, "n", "h", existing_,
adjMatrix_, null, link_, assignAddress_).
createTopology(Component, String, String, Object[], int[][], long[],
Link, boolean)
public static void createTopology(Component network_,
java.lang.Object[] existing_,
int[][] adjMatrix_,
long[] ids_,
Link link_)
createTopology(network_, "n", "h", existing_,
adjMatrix_, ids_, link_, true).
createTopology(Component, String, String, Object[], int[][], long[],
Link, boolean)
public static void createTopology(Component network_,
java.lang.String routerIDPrefix_,
java.lang.String hostIDPrefix_,
int[][] adjMatrix_,
Link link_)
createTopology(network_, nodeIDPrefix_,
nodeIDPrefix_, null, adjMatrix_, null, link_, true).
createTopology(Component, String, String, Object[], int[][], long[],
Link, boolean)
public static void createTopology(Component network_,
java.lang.String routerIDPrefix_,
java.lang.String hostIDPrefix_,
int[][] adjMatrix_,
long[] ids_,
Link link_)
createTopology(network_, nodeIDPrefix_,
nodeIDPrefix_, null, adjMatrix_, ids_, link_, true).
createTopology(Component, String, String, Object[], int[][], long[],
Link, boolean)
public static void createTopology(Component network_,
java.lang.String routerIDPrefix_,
java.lang.String hostIDPrefix_,
int[][] adjMatrix_,
Link link_,
boolean assignAddress_)
createTopology(network_, nodeIDPrefix_,
nodeIDPrefix_, null, adjMatrix_, null, link_, assignAddress_).
createTopology(Component, String, String, Object[], int[][], long[],
Link, boolean)
public static void createTopology(Component network_,
java.lang.String routerIDPrefix_,
java.lang.String hostIDPrefix_,
java.lang.Object[] existing_,
int[][] adjMatrix_,
Link link_)
createTopology(network_, nodeIDPrefix_,
nodeIDPrefix_, existing_, adjMatrix_, null, link_, true).
createTopology(Component, String, String, Object[], int[][], long[],
Link, boolean)
public static void createTopology(Component network_,
java.lang.String routerIDPrefix_,
java.lang.String hostIDPrefix_,
java.lang.Object[] existing_,
int[][] adjMatrix_,
Link link_,
boolean assignAddress_)
createTopology(network_, nodeIDPrefix_,
nodeIDPrefix_, existing_, adjMatrix_, null, link_, assignAddress_).
createTopology(Component, String, String, Object[], int[][], long[],
Link, boolean)
public static void createTopology(Component network_,
java.lang.String routerIDPrefix_,
java.lang.String hostIDPrefix_,
java.lang.Object[] existing_,
int[][] adjMatrix_,
long[] ids_,
Link link_)
createTopology(network_, nodeIDPrefix_,
nodeIDPrefix_, existing_, adjMatrix_, ids_, link_, true).
createTopology(Component, String, String, Object[], int[][], long[],
Link, boolean)
public static void createTopology(Component network_,
java.lang.String routerIDPrefix_,
java.lang.String hostIDPrefix_,
java.lang.Object[] existing_,
int[][] adjMatrix_,
long[] ids_,
Link link_,
boolean assignAddress_)
adjMatrix_.length,
is the number of nodes. Each element in the first dimension is a
one-dimensional array, which represents the neighbors of the node.
The position of a neighbor in this one-dimensional array is the ID of
the port that the node uses to connect to the neighbor. Nodes are indexed
as 0, 1,..., (adjMatrix_.length-1). The neighbors are
represented by their indices. Each node may have a different number
of neighbors. As a result, the adjacency matrix looks like below:
Port index --> (port 0@) (port 1@)
node (node 0) neighbor(0,0) neighbor(0,1) ... neighbor(0, nb0)
index (node 1) neighbor(1,0) neighbor(1,1) ... neighbor(1, nb1)
| ...
V (node (n-1)) neighbor((n-1),0) neighbor((n-1),1) ... neighbor((n-1), nbn-1)
where n is the number of nodes, nbi is the number of neighbors of node i. The method distiguishes hosts and routers when specifying node IDs. Hosts are nodes with exactly one neighbor. Routers are nodes with more than one neighbor. Nodes are not created if it has no neighbor.
network_ - the component to put all the created nodes and links in.routerIDPrefix_ - ID prefix for routers.
The component ID of a node created is set to the concatenation of the
ID prefix and the node index in the adjacency matrix. If a node has
more than one connection, then it is considered as a router and this
argument is used as its ID prefix to construct its component ID.hostIDPrefix_ - ID prefix for hosts. If a node has none or one
connection, then it is considered as a host, and this argument is used
as its ID prefix to construct its component ID.
See routerIDPrefix_.existing_ - Array of the existing nodes/networks that are used in
constructing the topology One may use existing components in creating
the topology. The existing components are put in an array. The indices
to this array are the node indices as to adjMatrix_. When
creating the topology, a node is retrieved from this array, instead of
created anew, only if the index does not excess the size of the array
and the corresponding element in this array is not null.adjMatrix_ - The adjacency matrix. See above.ids_ - One may explicitly specify the ID's for the nodes.
The indices to this array are the node indices as to
adjMatrix_. If the array is not null, then its values
are used, instead of the node indices, to construct the component ID's.
See routerIDPrefix_.link_ - the link component used to connect nodes. Nodes are directly
connected if null is specified.assignAddress_ - if true, this method will assign network addresses
to all newly created nodes based on the component ID's.public static void setAddressByID(Network network_)
setAddressByID(network_.getAllComponents()).
network_ - the network component.setAddressByID(Object[])public static void setAddressByID(Node node_)
public static void setAddressByID(java.lang.Object[] nodes_)
nodes_ - array of components. Components that are not
drcl.inet.Node are omitted processed.public static void setIDByAddress(Component network_)
public static void setIDByAddress(java.lang.Object[] nodes_)
public static void setAddressByCIDR(Network network_)
public static void setAddressByCIDR(Network network_,
long baseAddress_)
public static void setAddressByCIDR(java.lang.Object[] nodes_)
public static void setAddressByCIDR(java.lang.Object[] nodes_,
long baseAddress_)
public static Component createTrafficSource(TrafficModel trafficModel_,
Node dest_)
public static Component createTrafficSource(TrafficModel trafficModel_,
long dest_)
public static TrafficSourceComponent createTrafficSource(TrafficModel trafficSourceModel_,
TrafficModel trafficShaperModel_,
long dest_)
public static Component createTrafficSource(TrafficModel trafficModel_,
long src_,
long dest_,
long tos_)
public static TrafficSourceComponent createTrafficSource(TrafficModel trafficSourceModel_,
TrafficModel trafficShaperModel_,
long src_,
long dest_,
long tos_)
public static Component createTrafficSource(TrafficModel trafficModel_,
java.lang.String id_,
Node src_,
Node dest_,
long tos_,
int protocol_)
id_ - the component ID of the generator.protocol_ - the protocol ID for the generator.
public static TrafficSourceComponent createTrafficSource(TrafficModel trafficSourceModel_,
TrafficModel trafficShaperModel_,
java.lang.String id_,
Node src_,
Node dest_,
long tos_,
int protocol_)
id_ - the component ID of the generator.protocol_ - the protocol ID for the generator.public static java.lang.String toString(Network network_)
public static void setupVIF(Node n1_,
int vifindex1_,
Node n2_,
int vifindex2_)
public static void setupVIF(Node n1_,
int vifindex1_,
Node n2_,
int vifindex2_,
int mtu_)
public static void setupVIF(Node n1_,
int vifindex1_,
int mtu1_,
Node n2_,
int vifindex2_,
int mtu2_)
public static void configure(Component network_)
Network component.
An area boundary router is defined
as the one that has one or more connections (to other hosts/routers)
that either cross its parent (Network) component's boundary or
are connected to hosts. A host is a node that has only one connection
AND does not contain routing table in it.
public static void configure(java.lang.Object[] nodes_)
Network component.
An area boundary router is defined
as the one that has one or more connections (to other hosts/routers)
that either cross its parent (Network) component's boundary or
are connected to hosts. A host is a node that has only one connection
AND does not contain routing table in it.
public static void configureFlat(Component network_)
configureFlat(network_.getAllComponents(), true, true).
public static void configureFlat(Component network_,
boolean reassignNodeID_,
boolean setupInterface_)
configureFlat(network_.getAllComponents(), reassignNodeID_,
setupInterface_).
public static void configureFlat(java.lang.Object[] nodes_)
configureFlat(nodes_, true, true).
public static void configureFlat(java.lang.Object[] nodes_,
boolean reassignNodeID_,
boolean setupInterface_)
The area can be represented by an area address in the format of a base address and a mask.
The interfaces of an ABR connected to other routers (outside of the area) are on the boundary of the area and called boundary interfaces. The method performs three tasks (two are optional and controlled by two flags in the arguments): (1) set up routing table entries in each ABR for the ABR to reach the hosts that are connected to it; (2) re-assign node IDs (addresses) to ABRs and hosts (optional); (3) put the area/subnet address to the boundary interfaces of ABRs (optional). This information can be used by a dynamic routing protocol for distributing route entries in a more compact fashion.
nodes_ - contains all the ABRs to be configured.reassignNodeID_ - set to true if one wishes to re-assign node
IDs (addresses) automatically; set to false to keep current node
IDs.setupInterface_ - set to true if one wishes to set up area/subnet
address on the boundary interfaces.
public static void setupRoutes(Component network_,
int[][] adjMatrix_)
n times of the shortest path algorithm to
compute a shortest path tree for each node as source.
This may take a long time for large networks.
network_ - contains all the nodes to be configured.adjMatrix_ - adjacency matrix describing network topology.
public static void setupRoutes(Node[] nodes_,
int[][] adjMatrix_,
LinkCost linkcost_)
n times of the shortest path algorithm to
This may take a long time for large networks.
nodes_ - array of nodes to be configured.adjMatrix_ - adjacency matrix describing network topology.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 createTopology(Component,String,
String,Object[],int[][],long[],drcl.inet.Link,boolean)
public static void setupRoutes(Component network_,
int[][] adjMatrix_,
long[] addr_)
setupRoutes(Component, int[][]) except that
this method allows node addresses to be arbitrary as specified
in addr_.
network_ - contains all the nodes to be configured.adjMatrix_ - adjacency matrix describing network topology.addr_ - node addresses. Indexing is matched between
addr_ and adjMatrix_.
public static void setupRoutes(Component network_,
int[][] adjMatrix_,
long[] addr_,
LinkCost linkcost_)
#setupRoutes(Component, int[][], LinkCost)
except that
this method allows node addresses to be arbitrary as specified
in addr_.
network_ - contains all the nodes to be configured.adjMatrix_ - adjacency matrix describing network topology.addr_ - node addresses. Indexing is matched between
addr_ and adjMatrix_.linkcost_ - see setupRoutes(Node[],int[][],LinkCost).
public static void setupRoutes(Node src_,
Node dest_)
public static void setupRoutes(Node src_,
Node dest_,
java.lang.String bidirect_)
public static void setupRoutes(Component src_,
Component dest_,
long destAddr_,
long destAddrMask_)
dest_ could be a network
component with (destAddr_, destAddrMask_) as
its network address.
destAddr_ - destination address, could be a multicast address.
public static void setupRoutes(Component src_,
java.lang.Object[] dest_,
long destAddr_)
destAddr_ - destination address, could be a multicast address.
public static void setupRoutes(Component src_,
java.lang.Object[] dest_,
long destAddr_,
long destAddrMask_)
destAddr_ - destination address, could be a multicast address.
public static void setupRoutes(Component src_,
java.lang.Object[] dests_,
long srcAddr_,
long srcAddrMask_,
long destAddr_,
long destAddrMask_)
dest_ could be a network
component with (destAddr_, destAddrMask_) as
its network address.
destAddr_ - destination address, could be a multicast address.
public static void setupRoute(Node sourceNode,
Node destNode)
public static void setupBRoute(Node sourceNode,
Node destNode)
public static NamTrace setNamTraceOn(Component net_,
java.lang.String filename_,
java.lang.String[] colors_)
NamTrace on a network component.
This method creates a NamTrace component and hooks it up with all the
nodes, links and queues in the network component.
Currently, this method only works for flat point-to-point network topology.
public static void setNamTraceOn(Component net_,
NamTrace nam_,
java.lang.String filename_,
java.lang.String[] colors_)
NamTrace on a network component.
This method creates a NamTrace component and hooks it up with all the
nodes, links and queues in the network component.
If nam_ is not added to a component hierarchy, it is
added to net_. A FileComponent is added to net_
and connected to nam_ to save the NAM trace.
Currently, this method only works for flat point-to-point network topology.
public static void setNamTraceOn(Component net_,
NamTrace nam_)
NamTrace on a network component.
This method hooks up all the nodes, links and queues in the network
component. Currently, this method only works for flat point-to-point
network topology.
public static int getPID(Component c_)
Component.getName().
public static void connectTCP(Component p1_,
Component p2_)
Node before one can call this method.
public static boolean connectTCP(Component p1_,
Component p2_,
int protocolID_)
Node before
one can call this method. Returns false if the protcol ID is already
in use.
public static void connect(Component p1_,
Component p2_)
public static boolean connect(Component p1_,
Component p2_,
int protocolID_)
|
DRCL J-Sim API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||