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
/
iperf3m_chain_ns_udp.py
106 lines (93 loc) · 3.74 KB
/
iperf3m_chain_ns_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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import lib.collection as collection
from collections import OrderedDict
class iperf3m_chain_ns_udp(collection.Collection):
constants = {
'iperf_name': 'iperf3m',
'protocol': 'udp',
'topology': 'ns_chain',
'disable_offloading': False,
'zerocopy': False,
'affinity': False,
}
variables = OrderedDict([
('chain_len', (2, 3, 5, 10, 20)),
('parallelism', (1, 4, 6, 8, 12)),
('packet_size', (65507, 32739, 36)),
('use_ovs', (False, True)),
('ovs_ns_links', ('port', 'veth')),
])
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, 21)
y_axes = ['throughput', 'packetput', 'cpu']
x_title = 'number of namespaces'
filters = {
'rightsize': lambda r: r['packet_size'] != 32739,
'paper-8': lambda r: r['packet_size'] != 32739 or r['parallelism'] != 8 or (r['use_ovs'] and r['ovs_ns_links'] == 'veth'),
'paper-6': lambda r: r['packet_size'] != 32739 or r['parallelism'] != 6 or (r['use_ovs'] and r['ovs_ns_links'] == 'veth'),
'paper-8_veth': lambda r: r['packet_size'] != 32739 or r['parallelism'] != 8 or r['use_ovs'],
'paper-parallelism': lambda r: r['packet_size'] != 32739 or r['parallelism'] > 8 or (r['use_ovs'] and r['ovs_ns_links'] == 'veth'),
}
def get_link_label(self, r):
link_label = 'veth'
if r['use_ovs']:
link_label = 'ovs-{ovs_ns_links}'.format(**r)
return link_label
def analysis_row_label_fn(self, r):
link_label = self.get_link_label(r)
if link_label == 'ovs-port':
link_label = 'OvS'
return "{parallelism} UDP flows over {}".format(link_label, **r)
def analysis_grouping_fn(self, r):
return (r['packet_size'],)
def plot_style_fn(self, r, group_id):
if self.is_filter_selected('paper-6') or self.is_filter_selected('paper-8') or self.is_filter_selected('paper-8_veth'):
colors = {
'veth': 'red',
'ovs-port': 'black',
'ovs-veth': 'gray',
}
return {
'color': colors[self.get_link_label(r)],
}
colors = {
1: 'black',
4: 'green',
6: 'red',
8: 'orange',
12: 'blue',
}
linestyles = {
'veth': '-',
'ovs-port': '--',
'ovs-veth': ':',
}
marker = ''
if r['packet_size'] == 65507:
marker = 's'
elif r['packet_size'] == 36:
marker = '^'
return {
'color': colors[r['parallelism']],
'linestyle': linestyles[self.get_link_label(r)],
'marker': marker,
}
def plot_hook(self, ax, row_id, y_ax, x_values, y_values, y_error, style):
if y_ax.__class__.__name__ != 'ThroughputAx':
return True
kwargs = style.copy()
kwargs['linestyle'] = '--'
import numpy as np
fit_x_values = np.linspace(min(x_values), max(x_values))
# hardcoded values, will fix.
kwargs['color'] = 'blue'
ax.plot(fit_x_values, (pow(0.8648108107, (fit_x_values - 2))) * 100.46 * 1000000000, **kwargs) # first-second point
kwargs['color'] = '#00FF00'
ax.plot(fit_x_values, (pow(0.9381988499, (fit_x_values - 2))) * 100.46 * 1000000000, **kwargs) # first-last point
kwargs['color'] = 'purple'
ax.plot(fit_x_values, (pow(0.9062157058, (fit_x_values - 2))) * 100.46 * 1000000000, **kwargs) # average of first-nth points
return True
if __name__ == '__main__':
iperf3m_chain_ns_udp().parse_shell_arguments()