├── .github
└── workflows
│ └── python-app.yml
├── .gitignore
├── .idea
├── .gitignore
├── NFVdeep.iml
├── inspectionProfiles
│ ├── Project_Default.xml
│ └── profiles_settings.xml
├── modules.xml
└── vcs.xml
├── LICENSE
├── README.md
├── data
├── Cogentco.graphml
├── abilene--D-B-M-N-C-A-N-N.gml
├── abilene.gpickle
├── cogentco.gpickle
├── debug_overlay.gpickle
├── debug_requests_1.json
├── debug_requests_2.json
├── graphtest.gpickle
├── reward_test_overlay.gpickle
├── simple_graph.gpickle
└── test.gpickle
├── environment.yml
├── evaluation.py
├── figures
├── dynamic.svg
├── dynamic_static.svg
└── latency.svg
├── graph_generator.py
├── nfvdeep
├── agent
│ ├── baselines.py
│ └── logging.py
├── environment
│ ├── arrival.py
│ ├── env.py
│ ├── network.py
│ └── sfv.py
├── spaces
│ ├── A2C_space.json
│ └── PPO_space.json
└── tuning.py
├── requirements.txt
├── results
├── abilene
│ ├── dynamic
│ │ └── default
│ │ │ ├── default_ppo.csv
│ │ │ ├── firstfit.csv
│ │ │ ├── monitor.csv
│ │ │ ├── requests.json
│ │ │ └── tune.csv
│ └── static
│ │ ├── default
│ │ ├── default_ppo.csv
│ │ ├── firstfit.csv
│ │ ├── requests.json
│ │ └── tune.csv
│ │ ├── latency_experiments
│ │ ├── medium
│ │ │ ├── default_ppo.csv
│ │ │ ├── firstfit.csv
│ │ │ ├── requests.json
│ │ │ └── tune.csv
│ │ ├── relaxed
│ │ │ ├── default_ppo.csv
│ │ │ ├── firstfit.csv
│ │ │ ├── requests.json
│ │ │ └── tune.csv
│ │ └── tight
│ │ │ ├── default_ppo.csv
│ │ │ ├── firstfit.csv
│ │ │ ├── requests.json
│ │ │ └── tune.csv
│ │ └── load_experiments
│ │ ├── high_load
│ │ ├── default_ppo.csv
│ │ ├── firstfit.csv
│ │ ├── requests.json
│ │ └── tune.csv
│ │ ├── low_load
│ │ ├── default_ppo.csv
│ │ ├── firstfit.csv
│ │ ├── requests.json
│ │ └── tune.csv
│ │ └── medium_load
│ │ ├── default_ppo.csv
│ │ ├── firstfit.csv
│ │ ├── requests.json
│ │ └── tune.csv
└── abilene_v2
│ ├── dynamic
│ └── default
│ │ ├── default_ppo.csv
│ │ ├── firstfit.csv
│ │ ├── random.csv
│ │ ├── requests.json
│ │ └── tune.csv
│ └── static
│ ├── default
│ ├── default_ppo.csv
│ ├── firstfit.csv
│ ├── random.csv
│ ├── requests.json
│ └── tune.csv
│ ├── latency_experiments
│ ├── medium
│ │ ├── default_ppo.csv
│ │ ├── firstfit.csv
│ │ ├── random.csv
│ │ ├── requests.json
│ │ └── tune.csv
│ ├── relaxed
│ │ ├── default_ppo.csv
│ │ ├── firstfit.csv
│ │ ├── random.csv
│ │ ├── requests.json
│ │ └── tune.csv
│ └── tight
│ │ ├── default_ppo.csv
│ │ ├── firstfit.csv
│ │ ├── random.csv
│ │ ├── requests.json
│ │ └── tune.csv
│ └── load_experiments
│ ├── high_load
│ ├── default_ppo.csv
│ ├── firstfit.csv
│ ├── random.csv
│ ├── requests.json
│ └── tune.csv
│ ├── low_load
│ ├── default_ppo.csv
│ ├── firstfit.csv
│ ├── random.csv
│ ├── requests.json
│ └── tune.csv
│ └── medium_load
│ ├── default_ppo.csv
│ ├── firstfit.csv
│ ├── random.csv
│ ├── requests.json
│ └── tune.csv
├── script.py
├── tests
├── network_requirements.txt
└── test_env.py
└── tune.py
/.github/workflows/python-app.yml:
--------------------------------------------------------------------------------
1 | # This workflow will install Python dependencies, run tests and lint with a single version of Python
2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3 |
4 | name: Python application
5 |
6 | on:
7 | push:
8 | branches: [ main ]
9 | pull_request:
10 | branches: [ main ]
11 |
12 | jobs:
13 | build:
14 | runs-on: ubuntu-latest
15 |
16 | container:
17 | image: continuumio/miniconda3:latest
18 |
19 |
20 | steps:
21 | - uses: actions/checkout@v2
22 | - name: Set up Python 3.8
23 | uses: actions/setup-python@v2
24 | with:
25 | python-version: 3.8
26 | - name: Install dependencies
27 | run: |
28 | conda update --all
29 | conda install -c conda-forge --file tests/network_requirements.txt
30 | conda install flake8 pytest
31 | - name: Lint with flake
32 | run: |
33 | # stop the build if there are Python syntax errors or undefined names
34 | flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
35 | # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
36 | flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
37 | - name: Test with pytest
38 | run: |
39 | export PYTHONPATH=nfvdeep
40 | pytest
41 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Byte-compiled / optimized / DLL files
2 | __pycache__/
3 | *.py[cod]
4 | *$py.class
5 | *.vscode
6 |
7 | # C extensions
8 | *.so
9 |
10 | # Distribution / packaging
11 | .Python
12 | build/
13 | develop-eggs/
14 | dist/
15 | downloads/
16 | eggs/
17 | .eggs/
18 | lib/
19 | lib64/
20 | parts/
21 | sdist/
22 | var/
23 | wheels/
24 | pip-wheel-metadata/
25 | share/python-wheels/
26 | *.egg-info/
27 | .installed.cfg
28 | *.egg
29 | MANIFEST
30 |
31 | # PyInstaller
32 | # Usually these files are written by a python script from a template
33 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
34 | *.manifest
35 | *.spec
36 |
37 | # Installer logs
38 | pip-log.txt
39 | pip-delete-this-directory.txt
40 |
41 | # Unit test / coverage reports
42 | htmlcov/
43 | .tox/
44 | .nox/
45 | .coverage
46 | .coverage.*
47 | .cache
48 | nosetests.xml
49 | coverage.xml
50 | *.cover
51 | *.py,cover
52 | .hypothesis/
53 | .pytest_cache/
54 |
55 | # Translations
56 | *.mo
57 | *.pot
58 |
59 | # Django stuff:
60 | *.log
61 | local_settings.py
62 | db.sqlite3
63 | db.sqlite3-journal
64 |
65 | # Flask stuff:
66 | instance/
67 | .webassets-cache
68 |
69 | # Scrapy stuff:
70 | .scrapy
71 |
72 | # Sphinx documentation
73 | docs/_build/
74 |
75 | # PyBuilder
76 | target/
77 |
78 | # Jupyter Notebook
79 | .ipynb_checkpoints
80 |
81 | # IPython
82 | profile_default/
83 | ipython_config.py
84 |
85 | # pyenv
86 | .python-version
87 |
88 | # pipenv
89 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
90 | # However, in case of collaboration, if having platform-specific dependencies or dependencies
91 | # having no cross-platform support, pipenv may install dependencies that don't work, or not
92 | # install all needed dependencies.
93 | #Pipfile.lock
94 |
95 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow
96 | __pypackages__/
97 |
98 | # Celery stuff
99 | celerybeat-schedule
100 | celerybeat.pid
101 |
102 | # SageMath parsed files
103 | *.sage.py
104 |
105 | # Environments
106 | .env
107 | .venv
108 | env/
109 | venv/
110 | ENV/
111 | env.bak/
112 | venv.bak/
113 |
114 | # Spyder project settings
115 | .spyderproject
116 | .spyproject
117 |
118 | # Rope project settings
119 | .ropeproject
120 |
121 | # mkdocs documentation
122 | /site
123 |
124 | # mypy
125 | .mypy_cache/
126 | .dmypy.json
127 | dmypy.json
128 |
129 | # Pyre type checker
130 | .pyre/
131 |
132 | # ignore agent logs of Tensorboard
133 | .logs/
134 |
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/.idea/NFVdeep.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 CN-UPB
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 
2 |
3 | # NFVdeep
4 | Deep Reinforcement Learning for Online Orchestration of Service Function Chains
5 |
6 | *Disclaimer:* This is an unofficial implementation, trying to reproduce the deep reinforcement learning approach described in the [NFVdeep paper by Xiao et al.](https://dl.acm.org/doi/abs/10.1145/3326285.3329056) as part of a graduate student project.
7 | While the implemented agent did learn over time, we were not able to reproduce the same results stated in the paper.
8 |
9 | **Advisor**: [Stefan Schneider](https://github.com/stefanbschneider)
10 |
11 | **Developers**: [Nils Rudminat](https://github.com/NilsLuca), [Stefan Werner](https://github.com/stwerner97)
12 |
13 | ## Setup
14 | Assuming an Anaconda (version 4.8.4) distribution has already been installed on an Ubuntu 18.04 machine, the environment can simply be cloned via `conda env create -f environment.yml`. Depending on your system's setup, the installation of additional packages for ``RayTune`` and the applied `Tensorflow` version might be necessary.
15 |
16 | ## Experiments
17 | The `script.py` file serves as an interface to running either baseline or DRL agents on the NFVdeep environment with their default parameterization, i.e. whithout employing hyperparamter optimization. Here, you can specify the overlay topology and the network's resources, as well as properties of the arrival process. For instance, we may train an stable-baseline's `PPO` DRL agent on the `abilene` network with incoming requests arising from a Poisson process by executing:
18 | ```console
19 | python script.py
20 | --agent PPO
21 | --overlay /abilene.gpickle
22 | --requests /requests.json
23 | --output