├── .coveragerc ├── .flake8.cython ├── .gitignore ├── .travis.yml ├── .travis └── install.sh ├── LICENSE.txt ├── Makefile ├── README.md ├── Vagrant_README.md ├── Vagrantfile ├── cleanup_build.sh ├── docs ├── Makefile ├── make.bat └── source │ ├── api.rst │ ├── conf.py │ ├── dev.rst │ ├── faq.rst │ ├── gstarted.rst │ ├── guide.rst │ ├── images │ └── sol-logo.svg │ ├── index.rst │ ├── network.rst │ ├── opt.rst │ └── paths.rst ├── old_examples ├── MaxFlow.py ├── MaxFlowWithONOS.py ├── ServiceChaining.py ├── TrafficEngineering.py └── data │ ├── tm │ ├── Abilene.tm │ ├── Geant2012.tm │ └── Quest.tm │ └── topologies │ ├── Abilene.graphml │ ├── Geant2012.graphml │ └── Quest.graphml ├── requirements.txt ├── resources └── json │ └── topology_schema.json ├── server └── server.py ├── setup.cfg ├── setup.py ├── src └── sol │ ├── __init__.pxd │ ├── __init__.py │ ├── opt │ ├── __init__.pxd │ ├── __init__.py │ ├── app.pxd │ ├── app.pyx │ ├── composer.pxd │ ├── composer.pyx │ ├── funcs.pyx │ ├── gurobiwrapper.pxd │ ├── gurobiwrapper.pyx │ ├── quickstart.py │ ├── solution.py │ ├── varnames.pxd │ └── varnames.pyx │ ├── path │ ├── __init__.pxd │ ├── __init__.py │ ├── generate.pxd │ ├── generate.pyx │ ├── paths.pxd │ ├── paths.pyx │ ├── predicates.pxd │ ├── predicates.pyx │ ├── select.pxd │ └── select.pyx │ ├── sdn │ └── onos_wrapper.py │ ├── topology │ ├── __init__.pxd │ ├── __init__.py │ ├── generators.py │ ├── provisioning.pxd │ ├── provisioning.pyx │ ├── topologynx.pxd │ ├── topologynx.pyx │ ├── traffic.pxd │ └── traffic.pyx │ └── utils │ ├── __init__.py │ ├── const.py │ ├── exceptions.py │ ├── logger.py │ ├── ph.pxd │ └── ph.pyx ├── tests └── sol │ ├── composition │ └── composition_test.py │ ├── opt │ └── opt_test.py │ ├── path │ ├── generation_test.py │ ├── path_test.py │ ├── pptc_test.py │ └── simple_selection_test.py │ ├── topology │ ├── generators_test.py │ ├── topology_test.py │ └── traffic_test.py │ └── utils │ └── helper_test.py └── watch.sh /.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | plugins = Cython.Coverage 3 | 4 | -------------------------------------------------------------------------------- /.flake8.cython: -------------------------------------------------------------------------------- 1 | [flake8] 2 | filename = *.pyx,*.px* 3 | exclude = .eggs,*.egg,build 4 | ignore = E999,E225,E227,E402,E127,E226,E501 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Pycharm settings 2 | .idea 3 | 4 | # Python cache & build 5 | *.pyc 6 | sol.egg-info 7 | build 8 | .cache 9 | 10 | # Sphinx output 11 | docs/build 12 | 13 | # Testing files 14 | .coverage 15 | 16 | # Log files 17 | *.log 18 | 19 | # Other dev files 20 | .vagrant 21 | *.c 22 | *.so 23 | .hypothesis 24 | .ipynb_checkpoints 25 | excludes.txt 26 | upload.sh 27 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | python: 3 | - "3.6" 4 | install: 5 | - .travis/install.sh 6 | script: 7 | # Disabling flake8 for now, because there are so many thing to fix 8 | # - flake8 9 | # - flake8 --config .flake8.cython 10 | # Ignoring tests that rely on Gurobi, for now 11 | - py.test tests/ --ignore tests/sol/opt --ignore tests/sol/composition 12 | cache: pip 13 | -------------------------------------------------------------------------------- /.travis/install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e -x 3 | 4 | # Install TMgen from source 5 | git clone https://github.com/progwriter/TMgen.git 6 | pushd TMgen 7 | pip install -r requirements.txt 8 | pip install -e . 9 | popd 10 | 11 | pip install -r requirements.txt 12 | pip install pytest flake8 13 | pip install -e . -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Victor Heorhiadi 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. -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all 2 | all: 3 | python setup.py build_ext --inplace 4 | 5 | .PHONY: clean 6 | clean: 7 | rm -rf ./build 8 | find . -name '*.c' -exec rm {} \; 9 | find . -name '*.so' -exec rm {} \; 10 | find . \( -name '__pycache__' -type d \) -prune -exec rm -rf {} \; 11 | 12 | .PHONY: watch 13 | watch: 14 | bash watch.sh 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | SOL: SDN Optimization Layer 2 | =========================== 3 | 4 | SOL is a library that lets you rapidly prototype *network management applications* that require constructing an **optimization**. 5 | It is designed to work well with Software Defined Networking (SDN) as it makes use of the global view of the network to 6 | compute a globally optimal (or near-optimal) solution. 7 | 8 | This repository contains the implementation of both the SOL libary, 9 | and its extension **Chopin**, which allows intent-driven composition of multiple 10 | SDN applications. 11 | 12 | Why optimizations? 13 | ------------------ 14 | 15 | Optimization is incredibly common in the networking domain. Classic problems such as shortest path routing and maxflow 16 | can all be expressed as [linear programs](https://en.wikipedia.org/wiki/Linear_programming) and solved efficiently. 17 | 18 | Traffic engineering, middebox management, and other types of load balancing can also be expressed using optimizations. 19 | 20 | Key features 21 | ------------ 22 | 23 | - Fast prototyping of optimizations for network management 24 | - Composition of multiple optimization applications using different fairness modes 25 | - Flexible resource computation logic 26 | - Integrations with [ONOS](http://onosproject.org/) SDN controller 27 | - Novel optimization capabilities, reusable across different applications, 28 | (e.g., reconfiguration minimization) 29 | 30 | Integrations 31 | ------------ 32 | 33 | SOL is desgined to be modular and could potentially integrate with multiple SDN controllers. 34 | This library contains the core optimization logic. It can be used on its own to quickly prototype applications, 35 | compose multiple optimizations and examine resulting solutions. 36 | 37 | A rough view of the SOL library and integrations is as follows: 38 | 39 | - [SOL library](https://github.com/progwriter/SOL) (this repository) 40 | - [ONOS integration](https://github.com/progwriter/sol-onos) Allows use of the SOL library from the 41 | [ONOS](http://onosproject.org/) controller 42 | - [TMgen library](https://github.com/progwriter/tmgen) A helper library for generating and manipulating traffic matrices. 43 | 44 | Disclaimer 45 | ---------- 46 | SOL is a research project under development. Some APIs, integrations and documentation/links are subject to 47 | change. 48 | 49 | Original papers 50 | --------------- 51 | 52 | * [SOL](http://cs.unc.edu/~victor/papers/sol.pdf) 53 | * Chopin (to appear in CoNEXT'2018) 54 | 55 | 56 | Python documentation 57 | -------------------- 58 | 59 | Available at [Read the Docs]. 60 | 61 | [Read the Docs]: http://sol.readthedocs.io/ 62 | -------------------------------------------------------------------------------- /Vagrant_README.md: -------------------------------------------------------------------------------- 1 | # How to set up a SOL VM using Vagrant 2 | 3 | 1. Run `vagrant up` in this directory 4 | 2. After vagrant completes, run `vagrant ssh` to make sure you can access the VM 5 | and see onos and gurobi folders in the home folder 6 | 3. Go to gurobi.com, make an account and request an academic license. You will get a license key 7 | 4. On the VM, run `grbgetkey ` 8 | 5. `cd /sol` and make sure you see all the SOL files 9 | 6. Install SOL in dev mode using `pip install -e .` (Or simply `pip install .` to avoid the dev mode) 10 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | # This script was adopted from https://github.com/illotum/vagrant-mininet/ 5 | 6 | $init = <