|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--com.renesys.raceway.SSF.Entity
|
+--SSF.Net.Net
|
+--SSF.Net.OpNet
Top-level modeling class for a network simulation. One OpNet serves as the initializer for the entire simulation; it contains hosts, routers (which are hosts), and links. Net also serves as the central resource for clock granularity information and translation among NHI, CIDR, and IP addressing schemes.
Net may be run from the command line; use the -help flag to learn the syntax. This class is an extension of the class Net of SSFNet
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.
| Field Summary | |
private boolean |
configured
If configured it will be set to true. |
private java.util.Vector |
finalizers
Same use as SSFNet |
private long |
hct
The number of nodes in the net |
private static java.util.Hashtable |
timelineMap
|
| Fields inherited from class SSF.Net.Net |
cidrMap, frequency, generatorName, hosts, RunTime, sharingLevel, STREAM_PER_DISTRIBUTION, STREAM_PER_HOST, STREAM_PER_PROTOCOL, STREAM_PER_TIMELINE, streamName |
| Fields inherited from class com.renesys.raceway.SSF.Entity |
|
| Constructor Summary | |
(package private) |
OpNet()
Deprecated. Use the class Glasss.class instead of OpNet.class |
| Method Summary | |
static SSF.Util.Random.RandomDistribution |
accessRandomDistribution(ProtocolSession forProtocol,
com.renesys.raceway.DML.Configuration distcfg,
java.lang.String requestName)
Returns a reference to a random distribution that will be shared by consumers depending the value of .Net.randomstream.reproducibility_level Specification of the RandomDistribution is via a Configuration. |
static SSF.Util.Random.RandomDistribution |
accessRandomDistribution(ProtocolSession forProtocol,
java.lang.String distName,
java.lang.String requestName)
Returns a reference to a random distribution that will be shared by consumers depending the value of .Net.randomstream.reproducibility_level Specification of the RandomDistribution is by a name recognized by class method RandomStream.getDistribution(); the returned handle is for default values of the distribution's parameters. |
static SSF.Util.Random.RandomStream |
accessRandomStream(ProtocolSession forProtocol,
java.lang.String requestName)
Returns a reference to a raw random number generator output specified by the global attribute .Net.randomstream; that will be shared by consumers depending the value of .Net.randomstream.reproducibility_level. |
void |
addAlgorithm(OpNet net,
com.renesys.raceway.DML.Configuration algoCfg)
Add an algorithm. |
private OpticalChannelSegment |
checkSegment(ExtRouter source,
ExtRouter dest,
int port,
int lambda)
Check if the segment exists between two nodes |
void |
computeIP()
compute the IP addresses |
private void |
config_new_link(link L,
com.renesys.raceway.DML.Configuration lcfg,
java.lang.String default_timeline)
Configure a new link |
private void |
config_new_router_or_host(Host H,
com.renesys.raceway.DML.Configuration hcfg,
java.lang.String default_timeline)
Configure a new node |
void |
config(com.renesys.raceway.DML.Configuration cfg)
Configure a network model. |
private Algorithm |
configAlgo(com.renesys.raceway.DML.Configuration cfg)
Configure and return a centralized algorithm. |
private void |
configAlgorithms(com.renesys.raceway.DML.Configuration config)
Configure the centralized algorithms |
private void |
configConnections(com.renesys.raceway.DML.Configuration cfg)
Configure connections. |
private void |
configHostsRouters(com.renesys.raceway.DML.Configuration cfg)
Configure the hosts and routers within the network. |
private void |
configHostsRouters(com.renesys.raceway.DML.Configuration cfg,
java.lang.String in_nhi,
java.lang.String default_timeline)
Configure all nodes of this net. |
private void |
configLinks(com.renesys.raceway.DML.Configuration cfg)
Configure all links of this net. |
private void |
configLinks(com.renesys.raceway.DML.Configuration cfg,
java.lang.String in_nhi,
java.lang.String default_timeline)
Configure all links of this net. |
private void |
configNonStaticConnection(com.renesys.raceway.DML.Configuration cfg)
Parse the DML to configure a non-static lightPath |
void |
configRandomStreams(com.renesys.raceway.DML.Configuration cfg)
Configure the random streams. |
private void |
configStaticConnection(com.renesys.raceway.DML.Configuration cfg)
Parse the DML to configure a static lightPath |
private void |
configStaticRoutes()
Config the static routes for the IP layer |
static void |
configTimeline(com.renesys.raceway.SSF.Entity forEntity,
com.renesys.raceway.DML.Configuration cfg)
Helper function to let Hosts, Routers, Links set their alignments consistently from their respective config files, which share a common optional "alignment" attribute. |
private static void |
configTimeline(com.renesys.raceway.SSF.Entity forEntity,
java.lang.String alignspec)
configure the timeline for the given entity |
private void |
configureChannel(com.renesys.raceway.DML.Configuration cfg,
java.util.Vector nodes,
OpticalChannel oChannel)
Set a channel out of the DML |
void |
createTopology(java.lang.String[] argv)
This method is used to create a topology |
long |
getFrequency()
Get the frequency of this net |
java.util.Hashtable |
getHosts()
Get the table of the hosts. |
(package private) static void |
glassMain(java.lang.String[] argv)
Command line driver for the Glass class. |
java.lang.String |
ip_to_nhi(java.lang.String ipaddr)
Return the global NHI address corresponding to the given IP address |
static void |
main(java.lang.String[] argv)
not used anymore. |
java.lang.String |
nhi_to_cidr(java.lang.String naddr)
Return the CIDR block address corresponding to the given global NHI address. |
java.lang.String |
nhi_to_ip(java.lang.String naddr)
Return the IP address corresponding to the given global NHI address |
static long |
seconds(double s)
Static convenience function for computing number of clock ticks in a given number of seconds; simply returns s*frequency. |
void |
start(java.lang.String[] argv)
Start the simulation |
static void |
syntax()
Dump a summary of command-line syntax to standard error. |
protected void |
updateIPAdresses()
Update the IP adresses of all interface Called after a modification in the tree. |
void |
wrapup(java.lang.Runnable finalizer)
Same as SSFNet |
| Methods inherited from class com.renesys.raceway.SSF.Entity |
alignment, alignTo, coalignedEntities, inChannels, init, joinAll, makeIndependent, now, outChannels, pauseAll, playRole, processes, resumeAll, startAll, startAll, startClient, startClient, startServer, W, Z |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private java.util.Vector finalizers
private long hct
private static java.util.Hashtable timelineMap
private boolean configured
| Constructor Detail |
OpNet()
| Method Detail |
public static long seconds(double s)
s - The time in seconds
public java.lang.String nhi_to_ip(java.lang.String naddr)
nhi_to_ip in class Netnaddr - The NHI address.
public java.lang.String ip_to_nhi(java.lang.String ipaddr)
ip_to_nhi in class Netipaddr - The IP address.
public java.lang.String nhi_to_cidr(java.lang.String naddr)
nhi_to_cidr in class Netnaddr - The NHI address.
public static void syntax()
static void glassMain(java.lang.String[] argv)
Syntax: Glass [-nocheck]
[-dump]
[-relax]
[-ip a.b.c.d/m]
maxtime dmlfile1 [ dmlfile2 [...dmlfileN]]
-nocheck: don't schema-check the input DML file(s)
-dump: dump NHI/CIDR/IP address tables, but don't actually run the model
-relax: fail to enforce strict rules about CIDR/IP attributes
-ip addr: allocate IP addresses from the given block (default: 0.0.0.0/0)
argv - The command parameters.public static void main(java.lang.String[] argv)
argv - Not used anymore.public void wrapup(java.lang.Runnable finalizer)
wrapup in class Net
public void config(com.renesys.raceway.DML.Configuration cfg)
throws com.renesys.raceway.DML.configException
REQUIRED ATTRIBUTES: none
OBSOLETE ATTRIBUTES:
config in interface com.renesys.raceway.DML.Configurableconfig in class Netcfg - The DML configuration
com.renesys.raceway.DML.configException - if a configuration error occured.
public void configRandomStreams(com.renesys.raceway.DML.Configuration cfg)
throws com.renesys.raceway.DML.configException
configRandomStreams in class Netcfg - The DML configuration of the random streams.
com.renesys.raceway.DML.configException - when a configuration error occured.
public static SSF.Util.Random.RandomDistribution accessRandomDistribution(ProtocolSession forProtocol,
com.renesys.raceway.DML.Configuration distcfg,
java.lang.String requestName)
forProtocol - The protocol that share the random distributiondistcfg - The configuration of the random distributionrequestName - The stream name.
public static SSF.Util.Random.RandomDistribution accessRandomDistribution(ProtocolSession forProtocol,
java.lang.String distName,
java.lang.String requestName)
import cern.jet.random.*;
RandomDistribution rnd =
Net.accessRandomDistribution(this, "Uniform", "foo");
((Uniform)rnd.getImplementation()).setState(0.,1.); // go under the covers
for (int x=0; x<12000; x++) next_sample = rnd.nextDouble(); // etc.
forProtocol - The protocol that share the random distributiondistName - The name of the random distributionrequestName - The stream name.
public static SSF.Util.Random.RandomStream accessRandomStream(ProtocolSession forProtocol,
java.lang.String requestName)
generatorName = "MersenneTwister" stream = "DefaultStream" // root for the initial seed values, via MD5 reproducibility_level = "timeline" usage: RandomStream rng = Net.accessRandomStream(this, "foo"); for (int x=0; x<1000; x++) next_sample = rng.nextDouble();
forProtocol - The protocol that share the random distributionrequestName - The stream name.
private void configHostsRouters(com.renesys.raceway.DML.Configuration cfg)
throws com.renesys.raceway.DML.configException
cfg - The DML configuration of the nodes.
com.renesys.raceway.DML.configException
private void configHostsRouters(com.renesys.raceway.DML.Configuration cfg,
java.lang.String in_nhi,
java.lang.String default_timeline)
throws com.renesys.raceway.DML.configException
cfg - The net configurationin_nhi - The nhi address of the netdefault_timeline - The timeline for all links
com.renesys.raceway.DML.configException
private void config_new_router_or_host(Host H,
com.renesys.raceway.DML.Configuration hcfg,
java.lang.String default_timeline)
throws com.renesys.raceway.DML.configException
H - the new node to configurehcfg - the node's configurationdefault_timeline - The timeline for this node
com.renesys.raceway.DML.configException - when an error occurs during the configuration
private void configAlgorithms(com.renesys.raceway.DML.Configuration config)
throws com.renesys.raceway.DML.configException
config - The configuration of the net
com.renesys.raceway.DML.configException - when a configuration error occurs
private Algorithm configAlgo(com.renesys.raceway.DML.Configuration cfg)
throws com.renesys.raceway.DML.configException
cfg - The configuration of the new algorithm
com.renesys.raceway.DML.configException - when a configuration error occured.
private void configConnections(com.renesys.raceway.DML.Configuration cfg)
throws com.renesys.raceway.DML.configException
com.renesys.raceway.DML.configException - when a configuration error occured.
private void configNonStaticConnection(com.renesys.raceway.DML.Configuration cfg)
throws com.renesys.raceway.DML.configException
cfg - The configuration file
com.renesys.raceway.DML.configException - when a configuration error occured.
private void configStaticConnection(com.renesys.raceway.DML.Configuration cfg)
throws com.renesys.raceway.DML.configException
cfg - The configuration file
com.renesys.raceway.DML.configException - when a configuration error occured.
private void configureChannel(com.renesys.raceway.DML.Configuration cfg,
java.util.Vector nodes,
OpticalChannel oChannel)
throws com.renesys.raceway.DML.configException
cfg - The configuration of the channel.nodes - The list of nodes on the route.oChannel - The new optical channel to be configured.
com.renesys.raceway.DML.configException - if the channel is invalid.
private OpticalChannelSegment checkSegment(ExtRouter source,
ExtRouter dest,
int port,
int lambda)
throws com.renesys.raceway.DML.configException
source - The source node.dest - The destination node.port - The output port of the source.lambda - The output lambda of the source.
com.renesys.raceway.DML.configException - when a configuration error occured.
public static void configTimeline(com.renesys.raceway.SSF.Entity forEntity,
com.renesys.raceway.DML.Configuration cfg)
The default is to omit all "alignment" attributes, resulting in serial (single timeline) execution.
forEntity - The entity to set upcfg - The entity configuration
private static void configTimeline(com.renesys.raceway.SSF.Entity forEntity,
java.lang.String alignspec)
forEntity - The entity to set upalignspec - the alignment specification.
private void configLinks(com.renesys.raceway.DML.Configuration cfg)
throws com.renesys.raceway.DML.configException
cfg - The DML configuration of the links.
com.renesys.raceway.DML.configException
private void configLinks(com.renesys.raceway.DML.Configuration cfg,
java.lang.String in_nhi,
java.lang.String default_timeline)
throws com.renesys.raceway.DML.configException
cfg - The net configurationin_nhi - The nhi address of the netdefault_timeline - The timeline for all links
com.renesys.raceway.DML.configException
private void config_new_link(link L,
com.renesys.raceway.DML.Configuration lcfg,
java.lang.String default_timeline)
throws com.renesys.raceway.DML.configException
L - the new link to configurelcfg - the link's configurationdefault_timeline - The timeline for this link
com.renesys.raceway.DML.configException - when an error occurs during the configuration
private void configStaticRoutes()
throws com.renesys.raceway.DML.configException
com.renesys.raceway.DML.configException - if an error occurs
public void createTopology(java.lang.String[] argv)
throws com.renesys.raceway.DML.configException,
ProtocolException,
com.renesys.raceway.DML.dmlException
argv - The same parameter as the main function
com.renesys.raceway.DML.configException - If an exception occurs or the configuration
will be calles a second time.
ProtocolException - An exception in a ProtocolSession occured
com.renesys.raceway.DML.dmlException - A DML exception occured.public void start(java.lang.String[] argv)
argv - The same parameter as the main functionpublic java.util.Hashtable getHosts()
public long getFrequency()
public void computeIP()
throws com.renesys.raceway.DML.configException
com.renesys.raceway.DML.configException - If an exception occurs or the configuration
protected void updateIPAdresses()
throws com.renesys.raceway.DML.configException
com.renesys.raceway.DML.configException - If an exception occurs or the configuration
public void addAlgorithm(OpNet net,
com.renesys.raceway.DML.Configuration algoCfg)
throws com.renesys.raceway.DML.configException
net - The net object that contains the topology.algoCfg - The algorithm configuration
com.renesys.raceway.DML.configException - If an exception occurs or the configuration
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||