Statistics
| Branch: | Revision:

wcn_emulator @ master

Name Size Revision Age Author Comment
  Test b3699a1f almost 2 years Leonardo Maccari fixes cpuresources test adds a dummy process t...
  conf 2a8b9496 over 2 years Michele Segata add test case for default routes parameter
  data 35f26ee1 over 2 years Michele Segata add missing edge file for pingTest
  test_code 3d13980e almost 2 years Luca Baldesi refactor logsys add specific test case for all...
.gitignore 34 Bytes 16125e83 over 2 years Luca Baldesi add python-mode files to gitignore
.gitmodules 0 Bytes b1497c9f over 2 years Luca Baldesi remove community graph subgitmodule. Add graph_...
README.md 3.52 KB e165e09f about 2 years Michele Segata add documentation of attachto.sh
attachto.sh 291 Bytes 2bca6b26 about 2 years Michele Segata add script to attach to the kernel namespace of...
graph_utils.py 2.61 KB f4919c7b almost 2 years Leonardo Maccari fix on new networkx libs
inherit_config_parser.py 3.09 KB ffeac781 over 2 years Luca Baldesi add module for configuration inheritance and co...
logsys.py 1.98 KB 3d13980e almost 2 years Luca Baldesi refactor logsys add specific test case for all...
nepa_test.py 6.19 KB 3b4a2869 almost 2 years Leonardo Maccari fixes error() bug imports correct library in n...
network_builder.py 8.64 KB 2fd1c362 almost 2 years Leonardo Maccari renames shortest path param changes setShortes...
parameters_parser.py 4.4 KB f26348de about 5 years Leonardo Maccari fixed bug in optional params
test_generic.py 3.45 KB 655ca2a3 about 2 years Lorenzo Ghiro bugfix: stop resource_logging only if previousl...

Latest revisions

# Date Author Comment
3b4a2869 11/23/2017 04:08 PM Leonardo Maccari

fixes error() bug

imports correct library in nepa_test.py

b3699a1f 11/23/2017 03:57 PM Leonardo Maccari

fixes cpuresources test

adds a dummy process to have cpu usage always higher than 0

4d09d93c 11/23/2017 03:44 PM Leonardo Maccari

introduces seed parameter (-s)

seed parameter sets the random generator seed

2fd1c362 11/23/2017 03:39 PM Leonardo Maccari

renames shortest path param

changes setShortestRoutes to setShortestPaths, keeps the old value for compatibility

2961ade5 11/23/2017 02:53 PM Luca Baldesi

add matplotlib module import for input graph drawing at startup

3d13980e 11/23/2017 02:52 PM Luca Baldesi

refactor logsys

add specific test case for all the supported monitored resources of logsys

f4919c7b 11/15/2017 04:47 PM Leonardo Maccari

fix on new networkx libs

655ca2a3 10/11/2017 07:58 PM Lorenzo Ghiro

bugfix: stop resource_logging only if previously started

2cfb77a3 10/11/2017 08:43 AM Michele Segata

merge stable feature attach-to-host

36a53d80 10/11/2017 08:42 AM Michele Segata

merge stable feature process-utils

View all revisions | View revisions

README


NePA TesT is a front-end for mininet which setups experiment on a given (networkx) network

Setup

NePA TesT requires a patched version of Mininet. Please refer to: NePA wiki for the detailed setup.

Usage

To run a test you need a configuration file (to be placed in conf/) and the test class code (to be placed in testcode/). Then run $>python wcnemulator -f -t where identifies a test case in . Each test case must specify an implementation of MininetTest through the argoment "testClass"/ Each MininetTest class has the runTest method which starts what the test needs and then waits for completion. This waiting can be implemented with self.wait() function which sleeps for the desired amount of time and optionally logs resource usage.

For example:

  • self.wait(self.duration) # will wait till the end
  • self.wait(self.duration, logresources={'cpu': 'cpuusage'}, 2) # will wait till the end of the test while sampling every 2 seconds the cpu load and saving the results in a file called 'cpu_usage'.

Other than 'cpu', also 'net' and 'mem' can be logged; 'mem' makes NePA TesT logging the amount of available RAM (free or released) and the amount of swap memory used; 'net' makes instead logging both the fraction of received packets over sent packets and the fraction of received bytes over sent bytes since the beginning of the test. It is important to always specify the destination file of the logs (even the same for all the resources).

Test

NePA TesT stores test files in the Test folder. Tests follows the pytest approach, to run them simply install the pytest module and run $>python -m pytest in the root folder

Troubleshooting

If something fails system may remain unstable. In this case try typing: $> sudo mn -c

How to

Use a custom delay distribution for the links

Through network_builder.py is possible to set some parameters of the links, e.g., loss, bandwidth, mean delay, delay jitter and delay distribution.

Available delay distributions are placed in /usr/lib/tc/ and the defaults one are normal, pareto, paretonormal and experimental.

Given sample delay values is possible to build a custom distribution and use it in mininet. The following is an extraction from this netem article.

  1. git clone git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git
  2. compile these netem utilities: cd iproute2/netem gcc -o maketable maketable.c -lm gcc -o stats stats.c -lm
  3. fill data.txt with samples from the distribution (in ms), e.g., ping -c10 google.com | grep -Eo 'time=[0-9.]+'| grep -Eo '[0-9.]+' > data.txt
  4. build a netem distribution ./maketable data.txt > mydist.dist
  5. put mydist.dist in /usr/lib/tc/
  6. compute mean and standard deviation (sigma) ./stats data.txt
  7. use the following configuration parameters: linkmeandelay = ms linkdelaysd = ms linkdelaydistribution = mydist

Attach to a host with bash without using CLI

By using the attachto.sh script you can attach to an experiment host via a bash on the isolated network namespace of the host. To do so, run

attachto.sh <hostname>

where hostname is something like h0_0. At this point if, for example, you type ifconfig you will only see the interfaces of h0_0.

Also available in: Atom