How To

About

The ONS is a simulator of discrete events able to simulate the dynamic traffic in WDM and EON networks.

Prerequisite: JVM 7 (Java Virtual Machine)

If you wish to use the ONS, please quote it using the following example:

@Misc{ONS,
Title = {{ONS} – Optical Network Simulator},

Author = {Lucas R. Costa and André C. Drummond},
HowPublished = {\url{//ons-simulator.com}},
Year = {2020}
}

How to compile

  • Download the base code
  • Open your favorite IDE such as  NetBeans or Eclipse (make sure to download from the website)
  • Create a new project with existing sources
  • Create the project folder
  • Add the ONS Source folder
  • Build the project using the JAR file. For this you must set the Main.java and press Build Main Project
  • Make sure the xml file for simulation is located in the project folder

How to execute

you@computer:~$ java -jar ONS.jar
Usage: EONSim -f <simulation_file> -s <seed> [-trace] [-ra <raClass>] [ [-l <load>] or [-L <minload maxload step>] ] [-verbose | -table | -json]

The required parameters are:

  • simulation_file: the xml file which contains the parameters for the simulation;
  • seed: This is a number in the range [1-25] that defines 25 different internally chosen seed sets to maximize the quality of the random sequences used. To generate confidence interval results in the same simulation, it is necessary to run with different seed sets.
 

The optional parameters are:

  • trace: define how the trace file is generated;
  • ra: set a different routing algorithm from the ONS RA Classes instead of the pre-established;
  • load: change the loadwork in the simulation; 
  • minload maxload step: allows the automation of several executions of one same simulation for loads in range of an established interval [minload, maxload] or in increments [step];
  • verbose: set the way the on-screen message generation will work;
  • table: set if the result will be shown in a table;
  • json: set if the result will be generated as a json output file

Execution examples

you@computer:~$ java -jar ONS.jar nsfnet.xml 1 > out.txt

In this example, the simulator will perform the simulation described in the file ”nsfnet.xml” using the first seed group. 

The load is unique and is defined in the XML file.

you@computer:~$ java -jar ONS.jar nsfnet.xml 1 -trace – verbose > out.txt

In this example, the simulator will record all data in a trace file (named in XML) and print complete simulation information.

you@computer:~$ java -jar ONS.jar nsfnet.xml 2 100 200 20 > out.txt

In this example, the simulator will perform the simulation described in the ”nsfnet.xml” file using the second seed group for a load range in Erlang ranging from 100 to 200, with increments of 20, ie 6 times the simulation. Described in the file with the loads [100, 120, 140, 160, 180, 200].

All results will be written to a file named “out.txt”

Output

If you run a simple simulation, in the end it will print standard output with some statistics. Such as:

  • Band Lock Rate (BBR)
  • Blocking Rate by Class Of Service (COS)
  • Number of optical paths (LPs) established in the network
  • Average percentage of transmitters available throughout the simulation
  • Number of transmitters per request (when considering data aggregation techniques)
  • Traffic (grooming) – A transmitter can travel more than a request
  • Average virtual hops per request
  • Average physical hops per request
 

For the EON scenario the following metrics are added:

  • Average percentage of spectrum available throughout the simulation
  • Average percentage of use by modulation
 

Throughout the simulation all actions are recorded in a trace file if the trace flag has been triggered. The simulator will record the following data:

  • Arrivals and departures of events
  • Optical path creation or removal
  • Accept or block call

 

Output example

Example output from a standard simulation in the WDM network scenario

BR: 17.401%
BBR: 19.819853%
Called Blocked by COS (%)
BP-0 13.872051%
BP-1 17961311%
BP-2 23.277143%

LPs: 52831
Available Transponders: 35.11159896850586%
Transponders per request: 0.6396082277025146
Virtual Hops per request: 1.0
Physical Hops per request: 2.2926790881245536

Example output from a standard simulation in the EON network scenario

BR: 4.4059997%
BBR: 5.2949085%
Called Blocked by COS (%)
BP-0 3.804479%
BP-1 5.0312014%
BP-2 5.875493%

LPs: 83503
Available Transponders: 18.150667190551758%
Transponders per request: 0.878110080551875
Virtual Hops per request: 1.0
Physical Hops per request: 2.561959745094328
Spectrum Available: 78.775%
BPSK Modulation used: 18.195753%
QPSK Modulation used: 45.88458%
8QAM Modulation used: 26.916399%
16QAM Modulation used: 9.003269%

Trace example

flow-arrived 0.01943150511955905 0 6 9 10000 0 1
lightpath-created 0 6 9 24_0 26_0 34_0 31_0
flow-accepted – 0 6 9 10000 0 1 0
flow-arrived 0.028230462306205267 1 11 7 10000 0 1
lightpath-created 1 11 7 38_0 35_0 27_0
flow-accepted – 1 11 7 10000 0 1 1
flow-arrived 0.049388013572842365 2 5 2 10000 0 1
lightpath-created 2 5 2 11_0
flow-accepted – 2 5 2 10000 0 1 2
flow-arrived 0.06355296782039067 3 13 12 10000 0 1
lightpath-created 3 13 12 33_0 30_0
flow-accepted – 3 13 12 10000 0 1 3
flow-arrived 0.06975521562545164 4 2 6 10000 0 1
lightpath-created 4 2 6 10_0 17_0 18_0
flow-accepted – 4 2 6 10000 0 1 4
flow-arrived 0.07339832232143151 5 2 0 10000 0 1
lightpath-created 5 2 0 3_0
flow-accepted – 5 2 0 10000 0 1 5
flow-arrived 0.07363968525302261 6 7 5 10000 0 1
lightpath-created 6 7 5 25_0 19_0 16_0
flow-accepted – 6 7 5 10000 0 1 6
flow-arrived 0.08197054287260293 7 4 13 10000 0 1
lightpath-created 7 4 13 18_1 24_1 26_1 36_1
flow-accepted – 7 4 13 10000 0 1 7
flow-departed 0.08282859807576376 4 – – – – –
lightpath-removed 4 2 6 10_0 17_0 18_0

XML sample for WDM simulations

<?xml version=”1.0″ encoding=”UTF-8″?>

<wdmsim version=”1.0″>
<ra module=”MyRWA”/>

<trace file=”trace.tr”/>
<!–rate in Mbps 1000Mbps = 1Gbps | ‘cos’ represents the number of service classes–>
<traffic calls=”100000″ load=”100″ cos=”1″ max-rate=”10000″>
<!–‘cos’ here starts with ‘0’–>
<calls holding-time=”1″ rate=”1000″ cos=”0″ weight=”1″/>
<calls holding-time=”1″ rate=”2000″ cos=”0″ weight=”1″/>
<calls holding-time=”1″ rate=”4000″ cos=”0″ weight=”1″/>
<calls holding-time=”1″ rate=”8000″ cos=”0″ weight=”1″/>
<calls holding-time=”1″ rate=”10000″ cos=”0″ weight=”1″/>
</traffic>

<virtual-topology name=”NSFNet”>
</virtual-topology>

<physical-topology name=”NSFNet” wavelengths=”16″>
<nodes>
<node id=”0″ grooming-in-ports=”32″ grooming-out-ports=”32″ wlconverters=”0″ wlconversion-range=”0″/>
<node id=”1″ grooming-in-ports=”32″ grooming-out-ports=”32″ wlconverters=”0″ wlconversion-range=”0″/>
<node id=”2″ grooming-in-ports=”32″ grooming-out-ports=”32″ wlconverters=”0″ wlconversion-range=”0″/>
<node id=”3″ grooming-in-ports=”32″ grooming-out-ports=”32″ wlconverters=”0″ wlconversion-range=”0″/>
<node id=”4″ grooming-in-ports=”32″ grooming-out-ports=”32″ wlconverters=”0″ wlconversion-range=”0″/>
<node id=”5″ grooming-in-ports=”32″ grooming-out-ports=”32″ wlconverters=”0″ wlconversion-range=”0″/>
<node id=”6″ grooming-in-ports=”32″ grooming-out-ports=”32″ wlconverters=”0″ wlconversion-range=”0″/>
<node id=”7″ grooming-in-ports=”32″ grooming-out-ports=”32″ wlconverters=”0″ wlconversion-range=”0″/>
<node id=”8″ grooming-in-ports=”32″ grooming-out-ports=”32″ wlconverters=”0″ wlconversion-range=”0″/>
<node id=”9″ grooming-in-ports=”32″ grooming-out-ports=”32″ wlconverters=”0″ wlconversion-range=”0″/>
<node id=”10″ grooming-in-ports=”32″ grooming-out-ports=”32″ wlconverters=”0″ wlconversion-range=”0″/>
<node id=”11″ grooming-in-ports=”32″ grooming-out-ports=”32″ wlconverters=”0″ wlconversion-range=”0″/>
<node id=”12″ grooming-in-ports=”32″ grooming-out-ports=”32″ wlconverters=”0″ wlconversion-range=”0″/>
<node id=”13″ grooming-in-ports=”32″ grooming-out-ports=”32″ wlconverters=”0″ wlconversion-range=”0″/>
</nodes>
<!– Link weigth = distance in Km
Link delay = 1ms for 200Km –>
<links>
<link id=”0″ source=”0″ destination=”1″ delay=”3.75″ bandwidth=”10000″ weight=”750″/>
<link id=”1″ source=”1″ destination=”0″ delay=”3.75″ bandwidth=”10000″ weight=”750″/>
<link id=”2″ source=”0″ destination=”2″ delay=”3.75″ bandwidth=”10000″ weight=”750″/>
<link id=”3″ source=”2″ destination=”0″ delay=”3.75″ bandwidth=”10000″ weight=”750″/>
<link id=”4″ source=”0″ destination=”3″ delay=”6.5″ bandwidth=”10000″ weight=”1300″/>
<link id=”5″ source=”3″ destination=”0″ delay=”6.5″ bandwidth=”10000″ weight=”1300″/>
<link id=”6″ source=”1″ destination=”2″ delay=”6″ bandwidth=”10000″ weight=”1200″/>
<link id=”7″ source=”2″ destination=”1″ delay=”6″ bandwidth=”10000″ weight=”1200″/>
<link id=”8″ source=”1″ destination=”7″ delay=”15″ bandwidth=”10000″ weight=”3000″/>
<link id=”9″ source=”7″ destination=”1″ delay=”15″ bandwidth=”10000″ weight=”3000″/>
<link id=”10″ source=”2″ destination=”5″ delay=”7.5″ bandwidth=”10000″ weight=”1500″/>
<link id=”11″ source=”5″ destination=”2″ delay=”7.5″ bandwidth=”10000″ weight=”1500″/>
<link id=”12″ source=”3″ destination=”4″ delay=”3″ bandwidth=”10000″ weight=”600″/>
<link id=”13″ source=”4″ destination=”3″ delay=”3″ bandwidth=”10000″ weight=”600″/>
<link id=”14″ source=”3″ destination=”9″ delay=”15″ bandwidth=”10000″ weight=”3000″/>
<link id=”15″ source=”9″ destination=”3″ delay=”15″ bandwidth=”10000″ weight=”3000″/>
<link id=”16″ source=”4″ destination=”5″ delay=”3.75″ bandwidth=”10000″ weight=”750″/>
<link id=”17″ source=”5″ destination=”4″ delay=”3.75″ bandwidth=”10000″ weight=”750″/>
<link id=”18″ source=”4″ destination=”6″ delay=”3″ bandwidth=”10000″ weight=”600″/>
<link id=”19″ source=”6″ destination=”4″ delay=”3″ bandwidth=”10000″ weight=”600″/>
<link id=”20″ source=”5″ destination=”8″ delay=”7.5″ bandwidth=”10000″ weight=”1500″/>
<link id=”21″ source=”8″ destination=”5″ delay=”7.5″ bandwidth=”10000″ weight=”1500″/>
<link id=”22″ source=”5″ destination=”11″ delay=”15″ bandwidth=”10000″ weight=”3000″/>
<link id=”23″ source=”11″ destination=”5″ delay=”15″ bandwidth=”10000″ weight=”3000″/>
<link id=”24″ source=”6″ destination=”7″ delay=”3″ bandwidth=”10000″ weight=”600″/>
<link id=”25″ source=”7″ destination=”6″ delay=”3″ bandwidth=”10000″ weight=”600″/>
<link id=”26″ source=”7″ destination=”10″ delay=”3″ bandwidth=”10000″ weight=”600″/>
<link id=”27″ source=”10″ destination=”7″ delay=”3″ bandwidth=”10000″ weight=”600″/>
<link id=”28″ source=”8″ destination=”10″ delay=”5.25″ bandwidth=”10000″ weight=”1050″/>
<link id=”29″ source=”10″ destination=”8″ delay=”5.25″ bandwidth=”10000″ weight=”1050″/>
<link id=”30″ source=”9″ destination=”12″ delay=”3″ bandwidth=”10000″ weight=”600″/>
<link id=”31″ source=”12″ destination=”9″ delay=”3″ bandwidth=”10000″ weight=”600″/>
<link id=”32″ source=”9″ destination=”13″ delay=”6″ bandwidth=”10000″ weight=”1200″/>
<link id=”33″ source=”13″ destination=”9″ delay=”6″ bandwidth=”10000″ weight=”1200″/>
<link id=”34″ source=”10″ destination=”12″ delay=”3.75″ bandwidth=”10000″ weight=”750″/>
<link id=”35″ source=”12″ destination=”10″ delay=”3.75″ bandwidth=”10000″ weight=”750″/>
<link id=”36″ source=”10″ destination=”13″ delay=”6″ bandwidth=”10000″ weight=”1200″/>
<link id=”37″ source=”13″ destination=”10″ delay=”6″ bandwidth=”10000″ weight=”1200″/>
<link id=”38″ source=”11″ destination=”12″ delay=”6″ bandwidth=”10000″ weight=”1200″/>
<link id=”39″ source=”12″ destination=”11″ delay=”6″ bandwidth=”10000″ weight=”1200″/>
</links>
</physical-topology>
</wdmsim>

XML sample for EON simulations

<?xml version=”1.0″ encoding=”UTF-8″?>

<eonsim version=”0.2″>
<ra module=”MyRMLSA”/>

<trace file=”trace.tr”/>
<!–rate in Mbps 1000Mbps = 1Gbps | ‘cos’ represents the number of service classes–>
<traffic calls=”100000″ load=”100″ cos=”1″ statisticStart=”0″>
<!–‘cos’ here starts with ‘0’–>
<calls holding-time=”1″ rate=”10000″ cos=”0″ weight=”1″/>
<calls holding-time=”1″ rate=”15000″ cos=”0″ weight=”1″/>
<calls holding-time=”1″ rate=”20000″ cos=”0″ weight=”1″/>
<calls holding-time=”1″ rate=”25000″ cos=”0″ weight=”1″/>
<calls holding-time=”1″ rate=”30000″ cos=”0″ weight=”1″/>
<calls holding-time=”1″ rate=”35000″ cos=”0″ weight=”1″/>
<calls holding-time=”1″ rate=”40000″ cos=”0″ weight=”1″/>
<calls holding-time=”1″ rate=”45000″ cos=”0″ weight=”1″/>
<calls holding-time=”1″ rate=”50000″ cos=”0″ weight=”1″/>
</traffic>

<virtual-topology name=”NSFNet”>
</virtual-topology>

<physical-topology name=”NSFNet”>
<nodes modulations=”BPSK, QPSK, 8QAM, 16QAM” capacity=”10″>
<node id=”0″ grooming-in-ports=”15″ grooming-out-ports=”15″ />
<node id=”1″ grooming-in-ports=”15″ grooming-out-ports=”15″ />
<node id=”2″ grooming-in-ports=”15″ grooming-out-ports=”15″ />
<node id=”3″ grooming-in-ports=”15″ grooming-out-ports=”15″ />
<node id=”4″ grooming-in-ports=”15″ grooming-out-ports=”15″ />
<node id=”5″ grooming-in-ports=”15″ grooming-out-ports=”15″ />
<node id=”6″ grooming-in-ports=”15″ grooming-out-ports=”15″ />
<node id=”7″ grooming-in-ports=”15″ grooming-out-ports=”15″ />
<node id=”8″ grooming-in-ports=”15″ grooming-out-ports=”15″ />
<node id=”9″ grooming-in-ports=”15″ grooming-out-ports=”15″ />
<node id=”10″ grooming-in-ports=”15″ grooming-out-ports=”15″ />
<node id=”11″ grooming-in-ports=”15″ grooming-out-ports=”15″ />
<node id=”12″ grooming-in-ports=”15″ grooming-out-ports=”15″ />
<node id=”13″ grooming-in-ports=”15″ grooming-out-ports=”15″ />
</nodes>
<!– Link weigth = distance in Km
Link delay = 1ms for 200Km
The ‘slot-size’ is in MHz –>
<links slots=”200″ guardband=”2″ slot-size=”12500″>
<link id=”0″ source=”0″ destination=”1″ delay=”3.75″ weight=”750″/>
<link id=”1″ source=”1″ destination=”0″ delay=”3.75″ weight=”750″/>
<link id=”2″ source=”0″ destination=”2″ delay=”3.75″ weight=”750″/>
<link id=”3″ source=”2″ destination=”0″ delay=”3.75″ weight=”750″/>
<link id=”4″ source=”0″ destination=”3″ delay=”6.5″ weight=”1300″/>
<link id=”5″ source=”3″ destination=”0″ delay=”6.5″ weight=”1300″/>
<link id=”6″ source=”1″ destination=”2″ delay=”6″ weight=”1200″/>
<link id=”7″ source=”2″ destination=”1″ delay=”6″ weight=”1200″/>
<link id=”8″ source=”1″ destination=”7″ delay=”15″ weight=”3000″/>
<link id=”9″ source=”7″ destination=”1″ delay=”15″ weight=”3000″/>
<link id=”10″ source=”2″ destination=”5″ delay=”7.5″ weight=”1500″/>
<link id=”11″ source=”5″ destination=”2″ delay=”7.5″ weight=”1500″/>
<link id=”12″ source=”3″ destination=”4″ delay=”3″ weight=”600″/>
<link id=”13″ source=”4″ destination=”3″ delay=”3″ weight=”600″/>
<link id=”14″ source=”3″ destination=”9″ delay=”15″ weight=”3000″/>
<link id=”15″ source=”9″ destination=”3″ delay=”15″ weight=”3000″/>
<link id=”16″ source=”4″ destination=”5″ delay=”3.75″ weight=”750″/>
<link id=”17″ source=”5″ destination=”4″ delay=”3.75″ weight=”750″/>
<link id=”18″ source=”4″ destination=”6″ delay=”3″ weight=”600″/>
<link id=”19″ source=”6″ destination=”4″ delay=”3″ weight=”600″/>
<link id=”20″ source=”5″ destination=”8″ delay=”7.5″ weight=”1500″/>
<link id=”21″ source=”8″ destination=”5″ delay=”7.5″ weight=”1500″/>
<link id=”22″ source=”5″ destination=”11″ delay=”15″ weight=”3000″/>
<link id=”23″ source=”11″ destination=”5″ delay=”15″ weight=”3000″/>
<link id=”24″ source=”6″ destination=”7″ delay=”3″ weight=”600″/>
<link id=”25″ source=”7″ destination=”6″ delay=”3″ weight=”600″/>
<link id=”26″ source=”7″ destination=”10″ delay=”3″ weight=”600″/>
<link id=”27″ source=”10″ destination=”7″ delay=”3″ weight=”600″/>
<link id=”28″ source=”8″ destination=”10″ delay=”5.25″ weight=”1050″/>
<link id=”29″ source=”10″ destination=”8″ delay=”5.25″ weight=”1050″/>
<link id=”30″ source=”9″ destination=”12″ delay=”3″ weight=”600″/>
<link id=”31″ source=”12″ destination=”9″ delay=”3″ weight=”600″/>
<link id=”32″ source=”9″ destination=”13″ delay=”6″ weight=”1200″/>
<link id=”33″ source=”13″ destination=”9″ delay=”6″ weight=”1200″/>
<link id=”34″ source=”10″ destination=”12″ delay=”3.75″ weight=”750″/>
<link id=”35″ source=”12″ destination=”10″ delay=”3.75″ weight=”750″/>
<link id=”36″ source=”10″ destination=”13″ delay=”6″ weight=”1200″/>
<link id=”37″ source=”13″ destination=”10″ delay=”6″ weight=”1200″/>
<link id=”38″ source=”11″ destination=”12″ delay=”6″ weight=”1200″/>
<link id=”39″ source=”12″ destination=”11″ delay=”6″ weight=”1200″/>
</links>
</physical-topology>
</eonsim>

Routing Algorithms Interface

These are the methods that RWA / RSA / RMLSA algorithms must implement:

  • public void simulationInterface(ControlPlaneForRA cp) : This method is responsible for providing access to all relevant simulation information, including information about physical and virtual topologies. In addition, it provides a feedback interface to the control plan.
  • public void flowArrival(Flow flow)Whenever a new call arrives on the network the control plan executes this method, informing the algorithm of the arrival of a new event and providing all relevant information about this new call.
  • public void flowDeparture(long id): Whenever a call comes from the network, this method is called.

Your new algorithm will be able to interact with the control plane through a specific interface that provides some key methods.

public interface ControlPlaneForRA {
public boolean acceptFlow(long id, LightPath[] lightpaths);
public boolean blockFlow(long id);
public boolean rerouteFlow(long id, LightPath[] lightpaths);
public Flow getFlow(long id);
public Path getPath(Flow flow);
public int getLightpathFlowCount(long id);
public Map<Flow, Path> getMappedFlows();
public PhysicalTopology getPT();
public VirtualTopology getVT();
public WDMLightPath createCandidateWDMLightPath(int src, int dst, int[] links, int[] wavelengths);
public EONLightPath createCandidateEONLightPath(int src, int dst, int[] links, int firstSlot, int lastSlot, int modulation);
}

On each call, your algorithm can either accept (via the acceptFlow method) or block (via the blockFlow method) this call. In addition, the algorithm can call the other methods to aid in its procedures.

For details, see JavaDoc