SSF.Net
Class Net

java.lang.Object
  |
  +--com.renesys.raceway.SSF.Entity
        |
        +--SSF.Net.Net
All Implemented Interfaces:
com.renesys.raceway.DML.Configurable

public class Net
extends com.renesys.raceway.SSF.Entity
implements com.renesys.raceway.DML.Configurable

Top-level modeling class for a network simulation. One Net 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.


Field Summary
 cidrBlock cidrMap
          Three-way translation table for NHI addresses, CIDR block addresses, and IP addresses.
static long frequency
          Static clock frequency that all simulation components should use for reference, for consistency.
protected static java.lang.String generatorName
           
static com.renesys.raceway.OutOfCore.Heap heap
           
 java.util.Hashtable hosts
          Table mapping NHI addresses (Strings) to Router/Host instances.
static boolean ooc
           
protected static int sharingLevel
           
static int STREAM_PER_DISTRIBUTION
           
static int STREAM_PER_HOST
           
static int STREAM_PER_PROTOCOL
           
static int STREAM_PER_TIMELINE
           
protected static java.lang.String streamName
           
 
Constructor Summary
Net()
           
 
Method Summary
static RandomDistribution accessRandomDistribution(ProtocolSession forProtocol, com.renesys.raceway.DML.Configuration distcfg, java.lang.String requestName)
          Returns a reference to a random distributrution that will be shared by consumers depending the value of .Net.randomstream.reproducibility_level Specification of the RandomDistribution is via a Configuration.
static RandomDistribution accessRandomDistribution(ProtocolSession forProtocol, java.lang.String distName, java.lang.String requestName)
          Returns a reference to a random distributrution 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 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 config(com.renesys.raceway.DML.Configuration cfg)
          Configure a network model.
 void configRandomStreams(com.renesys.raceway.DML.Configuration cfg)
           
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.
 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)
          Command line driver for the Net class.
 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.
static void syntax()
          Dump a summary of command-line syntax to standard error.
static void tmain(java.lang.String[] argv)
           
 void wrapup(java.lang.Runnable finalizer)
           
 
Methods inherited from class com.renesys.raceway.SSF.Entity
alignment, alignTo, coalignedEntities, inChannels, init, joinAll, makeIndependent, now, outChannels, pauseAll, playRole, processes, resetSimulation, resumeAll, startAll, startAll, startClient, startClient, startServer, Vx, Yx
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

frequency

public static long frequency
Static clock frequency that all simulation components should use for reference, for consistency. One tick of the logical clock equals 1/F seconds of simulated time. By default, frequency==10e6; this yields microsecond simulation resolution. To avoid clock underflow, this frequency must be set at least as high as the bit rate on the fastest configured network interface card (NIC).


cidrMap

public cidrBlock cidrMap
Three-way translation table for NHI addresses, CIDR block addresses, and IP addresses.


ooc

public static boolean ooc

heap

public static com.renesys.raceway.OutOfCore.Heap heap

hosts

public java.util.Hashtable hosts
Table mapping NHI addresses (Strings) to Router/Host instances.


STREAM_PER_TIMELINE

public static final int STREAM_PER_TIMELINE
See Also:
Constant Field Values

STREAM_PER_HOST

public static final int STREAM_PER_HOST
See Also:
Constant Field Values

STREAM_PER_PROTOCOL

public static final int STREAM_PER_PROTOCOL
See Also:
Constant Field Values

STREAM_PER_DISTRIBUTION

public static final int STREAM_PER_DISTRIBUTION
See Also:
Constant Field Values

sharingLevel

protected static int sharingLevel

streamName

protected static java.lang.String streamName

generatorName

protected static java.lang.String generatorName
Constructor Detail

Net

public Net()
Method Detail

seconds

public static long seconds(double s)
Static convenience function for computing number of clock ticks in a given number of seconds; simply returns s*frequency. For example, if Net.frequency is 1000 (millisecond resolution), then Net.seconds(0.25) returns 250.


nhi_to_ip

public java.lang.String nhi_to_ip(java.lang.String naddr)
Return the IP address corresponding to the given global NHI address


ip_to_nhi

public java.lang.String ip_to_nhi(java.lang.String ipaddr)
Return the global NHI address corresponding to the given IP address


nhi_to_cidr

public java.lang.String nhi_to_cidr(java.lang.String naddr)
Return the CIDR block address corresponding to the given global NHI address.


syntax

public static void syntax()
Dump a summary of command-line syntax to standard error.


main

public static void main(java.lang.String[] argv)
Command line driver for the Net class.

   Syntax: Net [-check]
               [-dump] 
               [-relax] 
               [-ooc] 
               [-ip a.b.c.d/m] 
               maxtime dmlfile1 [ dmlfile2 [...dmlfileN]]

    -check: schema-check the input DML file(s) first
    -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)


tmain

public static void tmain(java.lang.String[] argv)

wrapup

public void wrapup(java.lang.Runnable finalizer)

config

public void config(com.renesys.raceway.DML.Configuration cfg)
            throws com.renesys.raceway.DML.configException
Configure a network model.

REQUIRED ATTRIBUTES: none

OBSOLETE ATTRIBUTES:

OPTIONAL ATTRIBUTES:

Specified by:
config in interface com.renesys.raceway.DML.Configurable
com.renesys.raceway.DML.configException

configRandomStreams

public void configRandomStreams(com.renesys.raceway.DML.Configuration cfg)
                         throws com.renesys.raceway.DML.configException
com.renesys.raceway.DML.configException

accessRandomDistribution

public static RandomDistribution accessRandomDistribution(ProtocolSession forProtocol,
                                                          com.renesys.raceway.DML.Configuration distcfg,
                                                          java.lang.String requestName)
Returns a reference to a random distributrution that will be shared by consumers depending the value of .Net.randomstream.reproducibility_level Specification of the RandomDistribution is via a Configuration.


accessRandomDistribution

public static RandomDistribution accessRandomDistribution(ProtocolSession forProtocol,
                                                          java.lang.String distName,
                                                          java.lang.String requestName)
Returns a reference to a random distributrution 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. The usage including user-provided distribution parameters may be, from within an instance of a ProtocolSession ('this'):
  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.
  


accessRandomStream

public static 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. If .Net.randomstream is not provided, the default is:
  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();
  


configTimeline

public 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. The values associated with that attribute are resolved globally, so that any two Hosts, Routers etc. that specify the same integer or string value will get the same alignment (and will therefore execute on the same processor). Alignments may also be specified for Net attributes, in which case all hosts, routers, and links within the Net get that alignment by default.

The default is to omit all "alignment" attributes, resulting in serial (single timeline) execution.