SoonyangZhang / coord-sim

Lightweight flow-level simulator for inter-node service coordination. Useful for testing coordination algorithms, which scale & place service components and decide flow scheduling.

Home Page:https://coordination-simulation.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status

Simulation: Inter-node service coordination and flow scheduling

Simulate flow-level, inter-node network coordination including scaling and placement of services and scheduling/balancing traffic between them.

Features:

  • Simulate any given network topology with arbitrary node and link capacities and link delays
  • Simulate any given network service consisting of linearly chained SFs/VNFs
  • VNFs can specify arbitrary resource consumption as function of their load using Python modules. Also VNF delay can be specified individually and may be normally distributed.
  • Simulate network traffic in the form of flow arrivals at various ingress nodes with varying arrival rate, flow length, volume, etc according to stochastic distributions
  • Simple and clear interface to run algorithms for scaling, placement, and scheduling/load balancing of these incoming flows across the nodes in the network. Coordination within each node is out of scope.
  • Interface allows easy integration with OpenAI Gym to enable training and evaluating reinforcement learning algorithms
  • Collection of metrics like successful/dropped flows, end-to-end delay, resource consumption, etc over time. Easily extensible.
  • Discrete event simulation to evaluate coordination over time with SimPy
  • Graceful adjustment of placements: When VNFs are removed from a placement by an algorithm. Currently processing flows are allowed to finish processing before the VNF is completely removed (see PR #78 and #81).

Citing this work

If you are using this work in whole or in part in your project, please cite it as follows:

@inproceedings{schneider2020coordination,
	author = {Schneider, Stefan and Khalili, Ramin and Manzoor, Adnan and Qarawlus, Haydar and Uthe, Sven and Karl, Holger and Hecker, Artur},
	booktitle = {ACM SIGCOMM NetAI Workshop 2020 (SIGCOMM NetAI ’20)},
	pages = {1--8},
	title = {Self-Driving Coordination of Massively Scaled Services Using Deep Reinforcement Learning},
	year = {2020},
	note = {under review}
}

Note: For the source code originally implemented and submitted to ACM SIGCOMM NetAI 2020, refer to the corresponding release or branch. The master branch will be continuously improved and extended.

Setup

Requires Python 3.6. Install with (ideally using virtualenv):

pip install -r requirements.txt

Usage

Type coord-sim -h for help using the simulator. For now, this should print

$ coord-sim -h
usage: coord-sim [-h] -d DURATION -sf SF [-sfr SFR] -n NETWORK -c CONFIG
                 [-t TRACE] [-s SEED]

Coordination-Simulation tool

optional arguments:
  -h, --help            show this help message and exit
  -d DURATION, --duration DURATION
                        The duration of the simulation (simulates
                        milliseconds).
  -sf SF, --sf SF       VNF file which contains the SFCs and their respective
                        SFs and their properties.
  -sfr SFR, --sfr SFR   Path which contains the SF resource consumption
                        functions.
  -n NETWORK, --network NETWORK
                        The GraphML network file that specifies the nodes and
                        edges of the network.
  -c CONFIG, --config CONFIG
                        Path to the simulator config file.
  -t TRACE, --trace TRACE
                        Provide a CSV trace file to configure the traffic the
                        simulator is generating.
  -s SEED, --seed SEED  Random seed

You can use the following command as an example (run from the root project folder)

coord-sim -d 20 -n params/networks/triangle.graphml -sf params/services/abc.yaml -sfr params/services/resource_functions -c params/config/sim_config.yaml

This will run a simulation on a provided GraphML network file and a YAML placement file for a duration of 20 timesteps.

Dynamic SF resource consumption

By default, all SFs have a node resource consumption, which exactly equals the aggregated traffic that they have to handle.

It is possible to specify arbitrary other resource consumption models simply by implementing a python module with a function resource_function(load) (see examples here).

To use these modules, they need to be referenced in the service file:

sf_list:
  a:
    processing_delay_mean: 5.0
    processing_delay_stdev: 0.0
    resource_function_id: A

And the path to the folder with the Python modules needs to be passed via the -sfr argument.

See PR RealVNF#78 for details.

Egress nodes

  • A node can be set to be a Egress node in the NodeType attribute of the network file
  • If some nodes are set as Egress then only the simulator will randomly choose one of them as the Egress node for each flow in the network
  • If some nodes are set to be Egress then once the flow is processed we check if for the flow, current node == egress node . If Yes then we depart , otherwise we forward the flow to the egress_node using the shortest_path routing.
  • Todo: Ideally the coordination algorithms should keep the path(Ingress to Egress) of the flow in view while creating the schedule/placement.

See PR 137 for details.

Tests

# style check
flake8 src

# tests
nose2

Acknowledgement

This project has received funding from German Federal Ministry of Education and Research (BMBF) through Software Campus grant 01IS17046 (RealVNF).

About

Lightweight flow-level simulator for inter-node service coordination. Useful for testing coordination algorithms, which scale & place service components and decide flow scheduling.

https://coordination-simulation.readthedocs.io/


Languages

Language:Python 100.0%