Install

This guide is for installing nmeta2 on Ubuntu OS.

Pre-Work

Ensure packages are up-to-date

sudo apt-get update
sudo apt-get upgrade

Install Python pip

sudo apt-get install python-pip

Install git

Install git and git-flow for software version control:

sudo apt-get install git git-flow

Install Ryu OpenFlow Controller

Ryu is the OpenFlow Software-Defined Networking (SDN) controller application that handles communications with the switch:

sudo pip install ryu

Install Packages Required by nmeta

Install pytest

Pytest is used to run unit tests:

sudo apt-get install python-pytest

Install YAML

Install Python YAML (“YAML Ain’t Markup Language”) for parsing config and policy files:

sudo apt-get install python-yaml

Install simplejson

sudo pip install simplejson

Install mock

sudo pip install -U mock

Install MongoDB

MongoDB is the database used by nmeta2. Install MongoDB as per their instructions :

Import the MongoDB public GPG Key:

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

Create a list file for MongoDB:

echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list

Reload local package database:

sudo apt-get update

Install MongoDB:

sudo apt-get install -y mongodb-org

Add pymongo for a Python API into MongoDB:

sudo apt-get install build-essential python-dev
sudo pip install pymongo

Turn on smallfiles to cope with small file system size:

sudo vi /etc/mongod.conf

Add this to the storage section of the config:

mmapv1:
  smallFiles: true

Start MongoDB (if required) with:

sudo service mongod start

Install nmeta2

Clone nmeta2

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

Run nmeta2

cd
cd ryu
PYTHONPATH=. ./bin/ryu-manager ../nmeta2/nmeta2/nmeta2.py

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:

# Run nmeta:
alias nm2="cd; cd ryu; PYTHONPATH=. ./bin/ryu-manager ../nmeta2/nmeta2/nmeta2.py --log-config-file ~/nmeta2/nmeta2/ryu_logging.conf"
#
# Test nmeta:
alias nm2t="cd ~/nmeta2/test/; py.test"