Revision 3cfd0aca

View differences:

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

  
4
--------------------Usage---------------------
5
To run a test you need a configuration file
6
(to be placed in conf/) and the test class code
7
(to be placed in test_code/).
8
Then run
9
$>python wcn_emulator -f <conf_file> -t <test>
10
where <test> identifies a test case in 
11
<conf_file>. 
12
Each test case must specify an implementation
13
of MininetTest through the argoment "testClass"/
14
Each MininetTest class has the runTest method
15
which starts what the test needs and then waits
16
for completion.
17
This waiting can be implemented with self.wait()
18
function which sleeps for the desired amount of
19
time and optionally logs resource usage.
20

  
21
For example:
22
self.wait(self.duration) # will wait till the end
23
self.wait(self.duration, log_resources={'cpu': 
24
	  'cpu_usage'}, 2) # will wait till the 
25
end of the test while sampling every 2 seconds
26
the cpu load and saving the results in a file 
27
called 'cpu_usage'.
28

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

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

  
48
------------Troubleshooting------------------
49
If something fails system may remain unstable.
50
In this case try typing:
51
$> sudo mn -c
52

  
53
----------------How to-----------------------
54
Use a custom delay distribution for the links
55
---------------------------------------------
56
Through network_builder.py is possible to set
57
some parameters of the links, e.g., loss,
58
bandwidth, mean delay, delay jitter and delay
59
distribution.
60
Available delay distributions are placed in
61
/usr/lib/tc/ and the defaults one are normal,
62
pareto, paretonormal and experimental.
63

  
64
Given sample delay values is possible to build
65
a custom distribution and use it in mininet.
66
(http://piao-tech.blogspot.it/2009/10/how-to-
67
create-netem-distribution-tables.html)
68

  
69
1) git clone git://git.kernel.org/pub/scm/\
70
   linux/kernel/git/shemminger/iproute2.git
71
2) compile these netem utilities:
72
   cd iproute2/netem
73
   gcc -o maketable maketable.c -lm
74
   gcc -o stats stats.c -lm
75
3) fill data.txt with samples from the
76
   distribution (in ms), e.g.,
77
   ping -c10 google.com | grep -Eo 'time=[0-9.]+'|\
78
   grep -Eo '[0-9.]+' > data.txt
79
4) build a netem distribution
80
   ./maketable data.txt > mydist.dist
81
5) put mydist.dist in /usr/lib/tc/
82
6) compute mean and standard deviation (sigma)
83
   ./stats data.txt
84
7) use the following configuration parameters:
85
   link_mean_delay = <mean>ms
86
   link_delay_sd = <sigma>ms
87
   link_delay_distribution = mydist 
README.md
1
NePA TesT is a front-end for mininet which
2
setups experiment on a given (networkx) network
3

  
4
Setup
5
=====
6

  
7
NePA TesT requires a patched version of Mininet.
8
Please refer to:
9
[NePA wiki](https://ans.disi.unitn.it/redmine/projects/community-newtork-emulator/wiki)
10
for the detailed setup.
11

  
12
Usage
13
=====
14

  
15
To run a test you need a configuration file
16
(to be placed in conf/) and the test class code
17
(to be placed in test_code/).
18
Then run
19
$>python wcn_emulator -f <conf_file> -t <test>
20
where <test> identifies a test case in 
21
<conf_file>. 
22
Each test case must specify an implementation
23
of MininetTest through the argoment "testClass"/
24
Each MininetTest class has the runTest method
25
which starts what the test needs and then waits
26
for completion.
27
This waiting can be implemented with self.wait()
28
function which sleeps for the desired amount of
29
time and optionally logs resource usage.
30

  
31
For example:
32

  
33
 * self.wait(self.duration) # will wait till the end
34
 * self.wait(self.duration, log_resources={'cpu': 'cpu_usage'}, 2) # will wait till the 
35
end of the test while sampling every 2 seconds
36
the cpu load and saving the results in a file 
37
called 'cpu_usage'.
38

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

  
51
Test
52
====
53

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

  
60
Troubleshooting
61
===============
62

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

  
67
How to
68
======
69

  
70
Use a custom delay distribution for the links
71
---------------------------------------------
72

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

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

  
82
Given sample delay values is possible to build
83
a custom distribution and use it in mininet.
84
The following is an extraction from this [netem article](http://piao-tech.blogspot.it/2009/10/how-to-create-netem-distribution-tables.html).
85

  
86
 1. git clone git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git
87
 2. compile these netem utilities:
88
    cd iproute2/netem
89
    gcc -o maketable maketable.c -lm
90
    gcc -o stats stats.c -lm
91
 3. fill data.txt with samples from the
92
    distribution (in ms), e.g.,
93
    ping -c10 google.com | grep -Eo 'time=[0-9.]+'| grep -Eo '[0-9.]+' > data.txt
94
 4. build a netem distribution
95
    ./maketable data.txt > mydist.dist
96
 5. put mydist.dist in /usr/lib/tc/
97
 6. compute mean and standard deviation (sigma)
98
    ./stats data.txt
99
 7. use the following configuration parameters:
100
    link_mean_delay = <mean>ms
101
    link_delay_sd = <sigma>ms
102
    link_delay_distribution = mydist 

Also available in: Unified diff