Skip to content

Simulator for circuit-switched networks written in Python (Opaque WDM is a particular use case)

License

Notifications You must be signed in to change notification settings

carlosnatalino/python-simple-opaque-wdm-simulator

Repository files navigation

Simple Opaque WDM Simulator

Simple simulator implemented in Python 3.7 for simulating opaque WDM networks, e.g, optical networks containing wavelength conversion at each noce. This means that the lightpaths do not need to enforce the wavelength continuity constraint. For more info, see this paper. The simulator implements the basic funcionalities, and allows you to add more complex features for your particular purposes. The simulator offers multi-threading for running multiple configurations using a pool of threads. Graph manipulation is implemented using the NetworkX 2.x library.

Example of topology

Dependencies:

This code was validated using Python 3.7. The software has the following dependencies:

Code organization and features:

The following algorithms are implemented:

  • Shortest available path (SAP): selects the shortest available out of k paths.
  • Load balancing (LB): selects the path with the lowest load, i.e., the path with the lowest maximum link load.

The following files are available:

  • core: File containing the main classes composing the simulation.
    • Environment: This class models a particular instance of the simulation scenario, including simulation queue, clock and statistics gathering.
    • Service: This class models the service request, which later becomes a connection if accomodated in the network.
    • Event: This class models an event to be added to the simulator's event queue.
    • run_simulation(env: Environment): function that executes the simulation loop for a particular environment instance.
  • events: File containing the events that can happen during the simulation.
    • arrival(env: Environment, service: Service): function that is called when a new service request arrives.
    • departure(env: Environment, service: Service): function that is called when the resources associated with a service should be released, i.e., the service has reached its holding time.
  • graph: File containing helper functions that read topologies from SNDlib format and converts it into NetworkX graphs. Also has some helper functions for path computation.
  • plots: File containing helper functions to plot the simulation progress and the final results.
  • policies: File containing the routing algorithms to be used by the simulator.
    • RoutingPolicy: Abstract class to be inherited by any algorithm implemented, containing the method route().
    • ShortestAvaiablePath: Selects the route that has the shortest among the list of k shortest paths.
    • LoadBalancing: Selects the route that has the lowest resources usage at the most loaded link.
  • run: File containing the main script of the simulation. Run python run.py --help to get a list of arguments that can be passed.
  • notebook: File containing a Jupyter notebook where the final binary results file is read and results are plotted. Also show how to plot topologies using the NetworkX module.

Running the simulator

At the correct Python environment (with the dependencies installed), run:

python run.py

to launch the simulator with the standard configuration. At the end, you will have the following plot within the folder results/data:

Final results

The run.py has a help function to assist you making particular configurations. Launch

python run.py --help

to access it.

Post-processing the results

The code in this notebook shows how to read the data saved from a simulation run and plot the results.

Citing this software

This software was developed as part of the following research paper:

C. N. da Silva, L. Wosinska, S. Spadaro, J. C. W. A. Costa, C. R. L. Frances and P. Monti, "Restoration in optical cloud networks with relocation and services differentiation," in IEEE/OSA Journal of Optical Communications and Networking, vol. 8, no. 2, pp. 100-111, Feb. 2016. DOI: 10.1364/JOCN.8.000100. Open access

BibTeX entry:

@ARTICLE{Natalino:2016:jocn,
    author={C. N. {da Silva} and L. {Wosinska} and S. {Spadaro} and J. C. W. A. {Costa} and C. R. L. {Frances} and P. {Monti}},
    journal={IEEE/OSA Journal of Optical Communications and Networking},
    title={Restoration in optical cloud networks with relocation and services differentiation},
    year={2016},
    volume={8},
    number={2},
    pages={100-111},
    doi={10.1364/JOCN.8.000100},
    ISSN={1943-0620},
    month={Feb},
    }

About

Simulator for circuit-switched networks written in Python (Opaque WDM is a particular use case)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published