gov.nist.antd.ssf.util
Class NetUtil

java.lang.Object
  |
  +--gov.nist.antd.ssf.util.NetUtil

public class NetUtil
extends java.lang.Object

This class contains tools for the GLASS network.

 This class was developed at the National Institute of Standards and
 Technology by employees of the Federal Government in the course of
 their official duties. Pursuant to title 17 Section 105 of the United
 States Code this software is not subject to copyright protection and
 is in the public domain.
 NIST assumes no responsibility whatsoever for its use by other parties,
 and makes no guarantees, expressed or implied, about its quality,
 reliability, or any other characteristic.
 
We would appreciate acknowledgement if the software is used.
NIST ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION AND DISCLAIM ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.

Author:
borchert
, rouil

Constructor Summary
private NetUtil()
          Private constructor to avoid instantiation
 
Method Summary
static EventManager getEventManager(Glass net)
          Determines the event manager in the active network.
static java.util.Vector getHosts(Glass net)
          Return a vector of the Hosts in the Net.
static link getLink(int id, Glass net)
          Return the link that has the requested id.
static java.util.Vector getLinks(Glass net)
          Return a vector of the links in the Net
static java.util.Vector getLSRs(Glass net)
          Return a vector of the LSRs in the Net.
static Host getNode(int id, Glass net)
          Return the node
static Host getNodeOfIP(int ip, Glass net)
          Get the node that has the given IP
static java.util.Vector getNodes(Glass net)
          Return a vector of all nodes in the Net
static java.util.Vector getNonOpticalLinks(Glass net)
          Return a vector of non aptical links in the Net
static java.util.Vector getNonOpticalNodes(Glass net)
          Return a vector of the non optical nodes in the Net
static java.util.Vector getOpticalLinks(Glass net)
          Return a vector of the optical links in the Net
static java.util.Vector getOXCEdgeRouters(Glass net)
          Return a vector of the OXCEdgeRouters in the Net
static java.util.Vector getOXCs(Glass net)
          Return a vector of the OXCs in the Net
static java.util.Vector getRouters(Glass net)
          Return a vector of the non optical Routers in the Net.
static long getSimulationTime(Glass net)
          Return the current simulation time for net
static int[][] getTopologyMatrix(Glass net)
          This method creates an 3xN ID-matrix out of the optical topology.
static void ResumeSimulationProgress(Glass net)
          Resume the simulation
static void setSimulationSpeed(Glass net, int slpTime)
          Control the speed of the simulation
static void stopSimulationProgess(Glass net)
          Resume the simulation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetUtil

private NetUtil()
Private constructor to avoid instantiation

Method Detail

getOXCs

public static java.util.Vector getOXCs(Glass net)
Return a vector of the OXCs in the Net

Parameters:
net - The network that contains the topology
Returns:
A vector of OXCs. It can be empty

getOXCEdgeRouters

public static java.util.Vector getOXCEdgeRouters(Glass net)
Return a vector of the OXCEdgeRouters in the Net

Parameters:
net - The network that contains the topology
Returns:
A vector of OXCEdgeRouters. It can be empty

getLSRs

public static java.util.Vector getLSRs(Glass net)
Return a vector of the LSRs in the Net.

Parameters:
net - The network that contains the topology.
Returns:
A vector of LSRs. It can be empty.

getRouters

public static java.util.Vector getRouters(Glass net)
Return a vector of the non optical Routers in the Net.

Parameters:
net - The network that contains the topology.
Returns:
A vector of Routers. It can be empty.

getHosts

public static java.util.Vector getHosts(Glass net)
Return a vector of the Hosts in the Net.

Parameters:
net - The network that contains the topology.
Returns:
A vector of Hosts. It can be empty.

getNonOpticalNodes

public static java.util.Vector getNonOpticalNodes(Glass net)
Return a vector of the non optical nodes in the Net

Parameters:
net - The network that contains the topology
Returns:
A vector of non optical nodes. It can be empty

getNodes

public static java.util.Vector getNodes(Glass net)
Return a vector of all nodes in the Net

Parameters:
net - The network that contains the topology
Returns:
A vector of nodes. It can be empty

getNode

public static Host getNode(int id,
                           Glass net)
Return the node

Parameters:
id - The id of the requested node.
net - The network that contains the topology
Returns:
The node or null if unknown id

getOpticalLinks

public static java.util.Vector getOpticalLinks(Glass net)
Return a vector of the optical links in the Net

Parameters:
net - The network that contains the topology
Returns:
A vector of optical links. It can be empty

getNonOpticalLinks

public static java.util.Vector getNonOpticalLinks(Glass net)
Return a vector of non aptical links in the Net

Parameters:
net - The network that contains the topology
Returns:
A vector of non optical links. It can be empty

getLinks

public static java.util.Vector getLinks(Glass net)
Return a vector of the links in the Net

Parameters:
net - The network that contains the topology
Returns:
A vector of links. It can be empty

getLink

public static link getLink(int id,
                           Glass net)
Return the link that has the requested id.

Parameters:
id - The id of the link requested.
net - The network that contains the topology
Returns:
The link or null if unknown id

getEventManager

public static EventManager getEventManager(Glass net)
Determines the event manager in the active network.

Parameters:
net - the network topology.
Returns:
the instance of the event manager.

getTopologyMatrix

public static int[][] getTopologyMatrix(Glass net)
This method creates an 3xN ID-matrix out of the optical topology. Each row in the matrix has the following information:
[Node1_ID; Node2_ID; Link_ID].
[row][0] = Node 1 ID
[row][1] = Node 2 ID
[row][2] = Link ID

Parameters:
net - the OpNet the optical topology resides in.
Returns:
an 2-dimensional array containing the network topology.

getNodeOfIP

public static Host getNodeOfIP(int ip,
                               Glass net)
Get the node that has the given IP

Parameters:
net - the OpNet the optical topology resides in.
ip - The IP address of the inderface.
Returns:
the host that contains the ip or null if invalid IP.

stopSimulationProgess

public static void stopSimulationProgess(Glass net)
Resume the simulation

Parameters:
net - the network topology.

ResumeSimulationProgress

public static void ResumeSimulationProgress(Glass net)
Resume the simulation

Parameters:
net - the network topology.

setSimulationSpeed

public static void setSimulationSpeed(Glass net,
                                      int slpTime)
Control the speed of the simulation

Parameters:
net - the network topology.
slpTime - The time for the timer to sleep.

getSimulationTime

public static long getSimulationTime(Glass net)
Return the current simulation time for net

Parameters:
net - the network topology.
Returns:
the simulation time