GithubHelp home page GithubHelp logo

zhangxin-wz / python-simple-opaque-wdm-simulator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from carlosnatalino/python-simple-opaque-wdm-simulator

1.0 0.0 0.0 247 KB

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

License: MIT License

Python 24.06% Jupyter Notebook 75.94%

python-simple-opaque-wdm-simulator's Introduction

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},
    }

python-simple-opaque-wdm-simulator's People

Contributors

carlosnatalino avatar igormaraujo avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.