-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
79 lines (70 loc) · 3.75 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/usr/bin/python
import os
import sys
#params = {
# 'bw': -1, # input bottleneck bw in Mbit/sec; required
# 'rtt': -1, # RTT in ms; required
# 'buf': -1, # input bottleneck buffer in packets; required
# 'loss': 0, # input bottleneck loss rate in percent; optional
# 'interval': 0, # interval between flow starts, in secs; optional
# 'dur': -1, # length of test in secs: required
# 'outdir': '', # output directory for results
# 'qdisc': '', # qdisc at downstream bottleneck (empty for FIFO)
# 'cmd': '', # command to run (e.g. set sysctl values)
# 'pcap': 0, # bytes per packet to capture; 0 for no tracing
#}
def bdp_pkts(bw, rtt, bdp_of_buf):
return int(bw*1000*1000*rtt/1000.0 / (1514 * 8) * bdp_of_buf)
default = {
'bw': 100, # input bottleneck bw in Mbit/sec; required
'rtt': 50, # RTT in ms of client; required
'rtt2': 100, # RTT in ms of client2; optional
'buf': bdp_pkts(100, 50, 1), # input bottleneck buffer in packets; required
'loss': 0, # input bottleneck loss rate in percent; optional
'interval': 0, # interval between flow starts, in secs; optional
'dur': 60, # length of test in secs: required
'outdir': 'out', # output directory for results
'qdisc': '', # qdisc at downstream bottleneck (empty for FIFO)
'cmd': '', # command to run (e.g. set sysctl values)
'pcap': 0, # bytes per packet to capture; 0 for no tracing
}
random_loss = {
'bw': 1000, # input bottleneck bw in Mbit/sec; required
'rtt': 100, # RTT in ms; required
'rtt2': 0, # RTT in ms of client2; optional
'buf': bdp_pkts(1000, 100, 1), # input bottleneck buffer in packets; required
'loss': 0.1, # input bottleneck loss rate in percent; optional
'interval': 0, # interval between flow starts, in secs; optional
'dur': 60, # length of test in secs: required
'outdir': 'out', # output directory for results
'qdisc': '', # qdisc at downstream bottleneck (empty for FIFO)
'cmd': '', # command to run (e.g. set sysctl values)
'pcap': 0, # bytes per packet to capture; 0 for no tracing
}
bufferbloat = {
'bw': 50, # input bottleneck bw in Mbit/sec; required
'rtt': 30, # RTT in ms; required
'rtt2': 0, # RTT in ms of client2; optional
'buf': bdp_pkts(50, 30, 8), # input bottleneck buffer in packets; required
'loss': 0, # input bottleneck loss rate in percent; optional
'interval': 0, # interval between flow starts, in secs; optional
'dur': 120, # length of test in secs: required
'outdir': 'out', # output directory for results
'qdisc': '', # qdisc at downstream bottleneck (empty for FIFO)
'cmd': '', # command to run (e.g. set sysctl values)
'pcap': 0, # bytes per packet to capture; 0 for no tracing
}
shallow = {
'bw': 1000, # input bottleneck bw in Mbit/sec; required
'rtt': 100, # RTT in ms; required
'rtt2': 0, # RTT in ms of client2; optional
'buf': bdp_pkts(1000, 100, 0.02), # input bottleneck buffer in packets; required
'loss': 0, # input bottleneck loss rate in percent; optional
'interval': 0, # interval between flow starts, in secs; optional
'dur': 200, # length of test in secs: required
'outdir': 'out', # output directory for results
'qdisc': '', # qdisc at downstream bottleneck (empty for FIFO)
'cmd': '', # command to run (e.g. set sysctl values)
'pcap': 0, # bytes per packet to capture; 0 for no tracing
}
params = default