This repository has been archived by the owner on Jun 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathiperf3m_chain_ns_qdisc_udp.py
68 lines (56 loc) · 2.11 KB
/
iperf3m_chain_ns_qdisc_udp.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
import lib.collection as collection
from collections import OrderedDict
import re
class iperf3m_chain_ns_qdisc_udp(collection.Collection):
constants = {
'iperf_name': 'iperf3m',
'protocol': 'udp',
'disable_offloading': False,
'zerocopy': False,
'affinity': False,
'packet_size': 32739,
'use_ovs': False,
'ovs_ns_links': 'veth',
}
variables = OrderedDict([
('chain_len', (2, 3, 5, 10)),
('topology', ('ns_chain', 'ns_chain_qdisc_netem', 'ns_chain_qdisc_htb', 'ns_chain_qdisc_netem_tera', 'ns_chain_qdisc_htb_tera')),
('parallelism', (1, 4, 6, 8, 12)),
])
def generation_skip_fn(self, settings):
if not settings['use_ovs'] and settings['ovs_ns_links'] == 'port':
return True
x_axis = 'chain_len'
x_limits = (1.5, 10.5)
y_axes = ['throughput', 'packetput', 'cpu']
x_title = 'number of namespaces'
filters = {
'paper': lambda r: r['topology'] != 'ns_chain_qdisc_htb_tera' or r['parallelism'] > 8,
}
def get_link_label(self, r):
link_label = 'direct-veth'
if r['use_ovs']:
link_label = 'ovs-{ovs_ns_links}'.format(**r)
return link_label
def analysis_row_label_fn(self, r):
qdisc_label = 'pfifo_fast'
if r['topology'].startswith('ns_chain_qdisc_'):
qdisc_label = re.sub('^ns_chain_qdisc_', '', r['topology']).replace('_', ' ')
return "{parallelism} UDP flows, {}{}".format(qdisc_label, ', no offloading' if r['disable_offloading'] else '', **r)
def analysis_grouping_fn(self, r):
topo_names = list(self.variables['topology'])
return (topo_names.index(r['topology']),)
def plot_style_fn(self, r, group_id):
colors = {
1: 'black',
4: 'green',
6: 'red',
8: 'orange',
12: 'blue',
}
return {
'linestyle': '--' if r['iptables_type'] == 'stateless' else '-',
'color': colors[r['parallelism']],
}
if __name__ == '__main__':
iperf3m_chain_ns_qdisc_udp().parse_shell_arguments()