Wiki » History » Version 9

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