Commit bb2b95d3 authored by Simon Redman's avatar Simon Redman

Write documentation for topomap_parser

parent 731538d3
This repository contains everything needed to run the segment routing demo on Emulab. More details to come as code is actually written. This repository contains everything needed to run the segment routing demo on Emulab. More details to come as code is actually written.
## Setup
Since the code in this repository is written in Python, there is no need to compile anything, but the environment must first be setup. This only needs to be done once.
1. First, make sure you have the Python 3 virtualenv command installed. In Ubuntu 16.04 and Fedora, the package is called python3-virtualenv.
2. Set up the virtual environment by running the command `virtualenv-3 env` from within the folder containing this repository
3. Populate the virtual environment using the provided list of requirements:
```
source env/bin/activate # Activate the environment
pip install -r requirements.txt # Use pip to install required packages
```
You are now set up!
## Usage
These instructions will be updated as the code is actually written
Before you will be able to run any commands, activate the virtual environment by running `source env/bin/activate`
#### 1. topomap_parser.py
This is both a program which can be run on its own, mostly for testing purposes, and a library which is used by the following programs to parse emulab's topology into [NetJSON](netjson.org) for usage with the NetworkX network graph library.
When used as a library, the most interesting method is `parse_topomap_to_netjson`, which returns a NetJSON-formatted dictionary. When run standalone, the program has built-in help by passing the `--help` flag.
The topology is parsed using the information in `/var/emulab/boot/topomap` to get basic information, and management IP addresses are found using DNS records. In many situations, topomap_parser will only properly work if run on one of the nodes of an experiment.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment