Skip to content
Mining Network Specifications from Network Configurations
Python Java Shell
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
batfish_interface
config2spec
evaluation
scenarios
test
.gitignore
README.md
helper.py
requirements.txt
run_c2s.py
setup.py

README.md

Config2Spec: Mining Network Specifications from Network Configurations

This repository contains the code of the Config2Spec project: A system to automatically learn a network's specification from its configuration.

Config2Spec has been published at USENIX NSDI'20.

The system relies on Batfish and Minesweeper.

Installation Guide

  1. Clone this repository

  2. Build Batfish and Minesweeper Follow the steps described here

  3. Create a virtualenv with all requirements

    $ virtualenv -p python3 c2s_env
    $ source c2s_env/bin/activate
    $ pip install -r requirements.txt
  4. Install Config2Spec

    $ pip install -e .

Run Config2Spec

A set of configurations of a network is called scenario. We provide a few sample scenarios in this repository. With the exception of Internet2, the configs have been synthesized using NetComplete.

If you want to analyze your own configuration, just follow the same structure: Create a new directory for the scenario and within that create a directory called configs that contains all the configuration files to be analyzed. Also, make sure that the configuration files have a .cfg file ending.

The run_c2s.py script contains the full pipeline as described in the paper.

You can run it the following way:

$ python run_c2s.py <scenario path> <backend path> <temp batfish path> -mf <max failures>

Arguments

  • scenario path - The path to the directory containing the scenario (e.g., /home/user/config2spec/scenarios/bics).

  • backend path - The path to the .jar of the Batfish backend (e.g., /home/user/batfish/projects/backend/target/backend-bundle-0.36.0.jar).

  • temp batfish path - The path to an directory where batfish can store some temporary data.

  • max failures - An int specifying the maximum number of failures the specification should include (e.g., for up to 1 failure set -mf 1).

Example

$ python run_c2s.py scenarios/bics ~/batfish-73946b2f1bdea5f1146e4db4f2586e071da752df/projects/backend/target/backend-bundle-0.36.0.jar ~/tmp -mf 1
You can’t perform that action at this time.