Wiki » History » Version 7

Michele Segata, 02/02/2017 11:50 AM

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