Wiki » History » Version 11

Leonardo Maccari, 11/22/2017 02:56 PM

1 1 Luca Baldesi
h1. Setup
2 1 Luca Baldesi
3 1 Luca Baldesi
h2. Mininet
4 1 Luca Baldesi
5 1 Luca Baldesi
NePA TesT works in conjunction wit Mininet, but it requires advanced features for dealing with fine grained settings for the links.
6 1 Luca Baldesi
To this end we have been developing and releasing a "patched version of Mininet":https://ans.disi.unitn.it/redmine/projects/community-newtork-emulator/repository/mininet
7 1 Luca Baldesi
8 11 Leonardo Maccari
To install it follow the usual instructions for Mininet (tested on Xubuntu 16.04):
9 1 Luca Baldesi
@git clone https://ans.disi.unitn.it/redmine/mininet.git@
10 1 Luca Baldesi
@cd mininet@
11 8 Leonardo Maccari
@./util/install.sh@
12 1 Luca Baldesi
13 1 Luca Baldesi
or build the debian package:
14 1 Luca Baldesi
@git clone https://ans.disi.unitn.it/redmine/mininet.git@
15 1 Luca Baldesi
@cd mininet@
16 10 Leonardo Maccari
17 10 Leonardo Maccari
If necessary install debuild @apt-get install devscripts@
18 10 Leonardo Maccari
19 1 Luca Baldesi
@make deb@
20 1 Luca Baldesi
21 1 Luca Baldesi
You can check if your setup is correct with:
22 1 Luca Baldesi
@#>mn --test pingall@
23 1 Luca Baldesi
24 9 Leonardo Maccari
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/. 
25 9 Leonardo Maccari
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.
26 9 Leonardo Maccari
27 9 Leonardo Maccari
28 5 Michele Segata
h3. Installing and running mininet as local user
29 5 Michele Segata
30 5 Michele Segata
Instead of calling @util/install.sh@ do the following steps
31 5 Michele Segata
32 5 Michele Segata
# Installing prerequirements requires systemwide libraries in any case :(
33 5 Michele Segata
   @sudo apt-get install gcc make socat psmisc xterm ssh iperf iproute telnet \@
34 5 Michele Segata
   @    python-setuptools cgroup-bin ethtool help2man  pyflakes pylint pep8 python-pexpect@
35 5 Michele Segata
# Install mininet python modules
36 5 Michele Segata
   @python setup.py install --user@
37 6 Michele Segata
# Compile mnexec
38 6 Michele Segata
   @make mnexec@
39 5 Michele Segata
# Add mininet folders to your PATH in .bashrc, e.g.:
40 7 Michele Segata
   @export PATH=$PATH:/home/username/path/to/mininet@
41 7 Michele Segata
   @export PATH=$PATH:/home/username/path/to/mininet/bin@
42 7 Michele Segata
# Add PYTHONPATH to your .bashrc to include also your local install directory, e.g.:
43 7 Michele Segata
   @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"@
44 7 Michele Segata
# Run mininet as sudo. You need to ask the sysadmin do edit the /etc/sudoers file like explained below
45 7 Michele Segata
   @sudo python nepa_test.py -f conf/ping.ini -t JSONTest@
46 7 Michele Segata
47 7 Michele Segata
h3. Modify /etc/sudoers
48 7 Michele Segata
49 7 Michele Segata
# Disable the secure path by commenting out
50 7 Michele Segata
   @Defaults       secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"@
51 7 Michele Segata
# Let the user run nepa_test as sudo:
52 7 Michele Segata
   @<USERNAME> ALL=(ALL) /usr/bin/python nepa_test.py *@
53 7 Michele Segata
# Keep env variables when running sudo
54 7 Michele Segata
   @Defaults:<USERNAME> !env_reset,env_delete-=PYTHONPATH,env_delete-=PATH@
55 5 Michele Segata
56 1 Luca Baldesi
h2. NePA TesT
57 1 Luca Baldesi
58 1 Luca Baldesi
Once installed the modified version of Mininet, to setup NePA TesT do the following:
59 1 Luca Baldesi
@git clone https://ans.disi.unitn.it/redmine/wcn_emulator.git@
60 1 Luca Baldesi
@cd wcn_emulator@
61 2 Luca Baldesi
@git submodule init@
62 2 Luca Baldesi
@git submodule update@
63 1 Luca Baldesi
64 1 Luca Baldesi
To run a sample test:
65 4 Luca Baldesi
@#>python nepa_test.py -f conf/ping.ini -t JSONTest@
66 1 Luca Baldesi
67 8 Leonardo Maccari
To run all the tests:
68 8 Leonardo Maccari
@#>python -m pytest@
69 8 Leonardo Maccari
70 3 Michele Segata
h3. Troubleshooting
71 1 Luca Baldesi
72 3 Michele Segata
* *Exception: Could not find a default OpenFlow controller*: from within the mininet source directory run @./util/install -f@ to install OpenFlow
73 8 Leonardo Maccari
* *ImportError: No module named [...]*: be sure to install the required python libraries with @sudo pip install networkx scipy numpy matplotlib psutil pytest@