Wiki » History » Version 13

Leonardo Maccari, 11/22/2017 03:18 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 12 Leonardo Maccari
if the command fails, check the output for eventually missing dependencies
22 12 Leonardo Maccari
23 1 Luca Baldesi
You can check if your setup is correct with:
24 1 Luca Baldesi
@#>mn --test pingall@
25 1 Luca Baldesi
26 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/. 
27 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.
28 9 Leonardo Maccari
29 9 Leonardo Maccari
30 5 Michele Segata
h3. Installing and running mininet as local user
31 5 Michele Segata
32 5 Michele Segata
Instead of calling @util/install.sh@ do the following steps
33 5 Michele Segata
34 5 Michele Segata
# Installing prerequirements requires systemwide libraries in any case :(
35 5 Michele Segata
   @sudo apt-get install gcc make socat psmisc xterm ssh iperf iproute telnet \@
36 5 Michele Segata
   @    python-setuptools cgroup-bin ethtool help2man  pyflakes pylint pep8 python-pexpect@
37 5 Michele Segata
# Install mininet python modules
38 5 Michele Segata
   @python setup.py install --user@
39 6 Michele Segata
# Compile mnexec
40 6 Michele Segata
   @make mnexec@
41 5 Michele Segata
# Add mininet folders to your PATH in .bashrc, e.g.:
42 7 Michele Segata
   @export PATH=$PATH:/home/username/path/to/mininet@
43 7 Michele Segata
   @export PATH=$PATH:/home/username/path/to/mininet/bin@
44 7 Michele Segata
# Add PYTHONPATH to your .bashrc to include also your local install directory, e.g.:
45 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"@
46 7 Michele Segata
# Run mininet as sudo. You need to ask the sysadmin do edit the /etc/sudoers file like explained below
47 7 Michele Segata
   @sudo python nepa_test.py -f conf/ping.ini -t JSONTest@
48 7 Michele Segata
49 7 Michele Segata
h3. Modify /etc/sudoers
50 7 Michele Segata
51 7 Michele Segata
# Disable the secure path by commenting out
52 7 Michele Segata
   @Defaults       secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"@
53 7 Michele Segata
# Let the user run nepa_test as sudo:
54 7 Michele Segata
   @<USERNAME> ALL=(ALL) /usr/bin/python nepa_test.py *@
55 7 Michele Segata
# Keep env variables when running sudo
56 7 Michele Segata
   @Defaults:<USERNAME> !env_reset,env_delete-=PYTHONPATH,env_delete-=PATH@
57 5 Michele Segata
58 1 Luca Baldesi
h2. NePA TesT
59 1 Luca Baldesi
60 1 Luca Baldesi
Once installed the modified version of Mininet, to setup NePA TesT do the following:
61 1 Luca Baldesi
@git clone https://ans.disi.unitn.it/redmine/wcn_emulator.git@
62 1 Luca Baldesi
@cd wcn_emulator@
63 2 Luca Baldesi
@git submodule init@
64 2 Luca Baldesi
@git submodule update@
65 1 Luca Baldesi
66 1 Luca Baldesi
To run a sample test:
67 4 Luca Baldesi
@#>python nepa_test.py -f conf/ping.ini -t JSONTest@
68 1 Luca Baldesi
69 8 Leonardo Maccari
To run all the tests:
70 8 Leonardo Maccari
@#>python -m pytest@
71 8 Leonardo Maccari
72 3 Michele Segata
h3. Troubleshooting
73 1 Luca Baldesi
74 3 Michele Segata
* *Exception: Could not find a default OpenFlow controller*: from within the mininet source directory run @./util/install -f@ to install OpenFlow
75 13 Leonardo Maccari
* *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@