Setup

Mininet

NePA TesT works in conjunction wit Mininet, but it requires advanced features for dealing with fine grained settings for the links.
To this end we have been developing and releasing a patched version of Mininet

To install it follow the usual instructions for Mininet (tested on Xubuntu 16.04):
git clone https://ans.disi.unitn.it/redmine/mininet.git
cd mininet
./util/install.sh

or build the debian package:
git clone https://ans.disi.unitn.it/redmine/mininet.git
cd mininet

If necessary install debuild apt-get install devscripts

make deb

if the command fails, check the output for eventually missing dependencies

You can check if your setup is correct with:
#>mn --test pingall

Note that in Fedora, the openswitch-controller package is no longer present, so you have to intall it from source as explained here: https://techandtrains.com/2014/09/13/mininet-and-open-vswitch-on-centos-7/.
Then for some other reason the ovs-switchd daemon is not started anyway, so you have to start it by hand before running your experiments, otherwise the mn script will hang when trying to create switches.

Installing and running mininet as local user

Instead of calling util/install.sh do the following steps

  1. Installing prerequirements requires systemwide libraries in any case :(
    sudo apt-get install gcc make socat psmisc xterm ssh iperf iproute telnet \
    python-setuptools cgroup-bin ethtool help2man pyflakes pylint pep8 python-pexpect
  2. Install mininet python modules
    python setup.py install --user
  3. Compile mnexec
    make mnexec
  4. Add mininet folders to your PATH in .bashrc, e.g.:
    export PATH=$PATH:/home/username/path/to/mininet
    export PATH=$PATH:/home/username/path/to/mininet/bin
  5. Add PYTHONPATH to your .bashrc to include also your local install directory, e.g.:
    export PYTHONPATH="/home/<USERNAME>:/home/<USERNAME>/.local/lib/python2.7/site-packages/mininet-2.2.1-py2.7.egg:/usr/lib/python2.7/dist-packages:/usr/lib/python2.7:/usr/lib/python2.7/plat-x86_64-linux-gnu:/usr/lib/python2.7/lib-tk:/usr/lib/python2.7/lib-old:/usr/lib/python2.7/lib-dynload:/home/<USERNAME>/.local/lib/python2.7/site-packages:/usr/local/lib/python2.7/dist-packages:/usr/lib/python2.7/dist-packages/PILcompat:/usr/lib/python2.7/dist-packages/gtk-2.0:/usr/lib/pymodules/python2.7"
  6. Run mininet as sudo. You need to ask the sysadmin do edit the /etc/sudoers file like explained below
    sudo python nepa_test.py -f conf/ping.ini -t JSONTest

Modify /etc/sudoers

  1. Disable the secure path by commenting out
    Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
  2. Let the user run nepa_test as sudo:
    <USERNAME> ALL=(ALL) /usr/bin/python nepa_test.py *
  3. Keep env variables when running sudo
    Defaults:<USERNAME> !env_reset,env_delete-=PYTHONPATH,env_delete-=PATH

NePA TesT

Once installed the modified version of Mininet, to setup NePA TesT do the following:
git clone https://ans.disi.unitn.it/redmine/wcn_emulator.git
cd wcn_emulator
git submodule init
git submodule update

To run a sample test:
#>python nepa_test.py -f conf/ping.ini -t JSONTest

To run all the tests:
#>python -m pytest

Troubleshooting

  • Exception: Could not find a default OpenFlow controller: from within the mininet source directory run ./util/install -f to install OpenFlow
  • ImportError: No module named [...]: be sure to install python-pip and the required python libraries with sudo pip install networkx scipy numpy matplotlib psutil pytest it seems on ubuntu it easier to install python-tk from apt rathern than pip apt-get install python-tk