Install

This guide is for installing on Ubuntu 16.04.2 LTS

Pre-Work

Ensure packages are up-to-date

sudo apt-get update
sudo apt-get upgrade

Install Debian Packages

The following command installs these packages:

  • pip (Python package manager)
  • git (version control system)
  • git flow (branching model for Git)
  • python-pytest (used to run unit tests)
  • python-yaml (YAML parser for Python)
sudo apt-get install python-pip git git-flow python-pytest python-yaml

Install Python Packages

Ensure pip (Python package manager) is latest version:

pip install --upgrade pip

Nmeta requires Python version 2.7.x, does not run on Python 3.x (yet)

The following command installs these Python packages:

  • Ryu (OpenFlow Software-Defined Networking (SDN) controller application that handles communications with the switch)
  • dpkt (library is used to parse and build packets)
  • mock (Testing library)
  • Requests (HTTP library)
  • simplejson (JSON encoder and decoder)
  • eve (REST API framework)
  • coloredlogs (Add colour to log entries in terminal output)
  • voluptuous (data validation library)
pip2.7 install ryu dpkt mock requests simplejson eve coloredlogs voluptuous --user

Install MongoDB

MongoDB is the database used by nmeta. Install MongoDB as per their instructions (Note: Ubuntu 16.04 specific)

Import the MongoDB public GPG Key:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6

Create a list file for MongoDB:

echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list

Reload local package database:

sudo apt-get update

Install MongoDB:

sudo apt-get install -y mongodb-org

Set MongoDB to autostart:

systemctl enable mongod.service

Start MongoDB (if required) with:

sudo service mongod start

Install nmeta

Clone nmeta

cd
git clone https://github.com/mattjhayes/nmeta.git

Test nmeta

Tests should all pass:

cd ~/nmeta/tests/; py.test

Run nmeta

Run nmeta in a terminal window:

ryu-manager ~/nmeta/nmeta/nmeta.py

Run the external API (necessary for WebUI) in a separate terminal window:

~/nmeta/nmeta/api_external.py

Test WebUI

In a browser on the same machine that nmeta is installed on, navigate to:

http://localhost:8081/webUI/index.html

Configure Switches

Next, we need OpenFlow switches configured to Ryu/nmeta as their controller and app.

Configure OpenFlow

Switches will need to be configured to use Ryu/nmeta as their controller. The configuration details will differ depending on the type of switch.

Here is an example configuration for Open vSwitch to use a controller at IP address 172.16.0.3 on TCP port 6633:

sudo ovs-vsctl set-controller br0 tcp:172.16.0.3:6633

You will need to work out setting that are appropriate for your topology and switches.

Configure QoS Queues

To run Quality of Service (QoS), switches will need to be configured with QoS queues.

See the documentation for your switch(es) for how to configure QoS queues.

Be aware that using a queue number that is not configured on the switch may result in the switch dropping the packet.

Aliases

Aliases can be used to make it easier to run common commands. To add the aliases, edit the .bash_aliases file in your home directory:

cd
sudo vi .bash_aliases

Paste in the following:

# Test nmeta:
alias nmt='cd ~/nmeta/tests/; py.test'
#
# Run nmeta:
alias nm="ryu-manager ~/nmeta/nmeta/nmeta.py"
#
# Run nmeta external API:
alias nma='~/nmeta/nmeta/api_external.py'
#
# Retrieve Packet-In rate via external API:
alias nma_pi_rate='curl http://localhost:8081/v1/infrastructure/controllers/pi_rate/ | python -m json.tool'