-
Notifications
You must be signed in to change notification settings - Fork 0
/
mix.cue
189 lines (181 loc) · 4.31 KB
/
mix.cue
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
// SPDX-License-Identifier: GPL-3.0
// Copyright 2024 Pete Heist
package sce
// _mix tests a mix of flows: CUBIC, CUBIC-SCE, isochronous UDP and
// unresponsive UDP.
_mix: {
// variables
_name: string & !=""
_rate: int
_rtt: int
_qdisc: string & !=""
_duration: int
// constants
_rate: 100 // tied to udp-flood interval
ID: {
name: _name
rate: "\(_rate)mbit"
rtt: "\(_rtt)ms"
qdisc: _qdisc
}
Path: "{{.name}}/{{.rate}}_{{.rtt}}_{{.qdisc}}_"
Serial: [
_rig.setup,
_server,
_client,
]
// After lists the report stages to run after Test
After: [
{Analyze: {}},
{Encode: {
File: ["*.pcap"]
Extension: ".xz"
Destructive: true
}},
{ChartsTimeSeries: {
To: ["timeseries.html"]
FlowLabel: _flowLabel
Options: {
title: "Flow Mix (CUBIC, CUBIC-SCE, isochronous UDP, unresponsive UDP), \(_rate)Mbps, \(_rtt)ms RTT, \(_qdisc)"
series: {
"0": {
color: _dark2[0]
lineWidth: 1.5
}
"1": {
targetAxisIndex: 1
lineWidth: 0
pointSize: 0.5
color: _dark2[1]
}
"2": {
color: _dark2[2]
lineWidth: 1.5
}
"3": {
targetAxisIndex: 1
lineWidth: 0
pointSize: 0.5
color: _dark2[3]
}
"4": {
targetAxisIndex: 1
lineWidth: 0
pointSize: 0.5
color: _dark2[4]
}
"5": {
targetAxisIndex: 1
lineWidth: 0
pointSize: 0.5
color: _dark2[5]
}
}
vAxes: {
"0": {
title: "Delivery Rate (Mbps)"
viewWindow: max: _rate * 1.1
}
"1": {
title: "TCP RTT (ms)"
viewWindow: max: 1000
scaleType: "log"
}
}
}
}},
]
// rig defines the dumbbell Test setup
_rig: _dumbbell & {
serverAddr: "\(right.addr):777"
htbQuantum: int | *1514
left: post: _modprobe_cca + [
"sysctl -w net.ipv4.tcp_ecn=1",
"sysctl -w net.ipv4.tcp_wmem=\"4096 131072 160000000\"",
]
mid: post: [
//"tc qdisc add dev mid.r root handle 1: htb default 1",
//"tc class add dev mid.r parent 1: classid 1:1 htb rate \(_rate)mbit quantum \(htbQuantum)",
//"tc qdisc add dev mid.r parent 1:1 \(_qdisc)",
"tc qdisc add dev mid.r root \(_qdisc) bandwidth \(_rate)mbit",
"tc qdisc add dev mid.l root netem delay \(_rtt/2)ms limit 1000000",
"ip link add dev imid.l type ifb",
"tc qdisc add dev imid.l root handle 1: netem delay \(_rtt/2)ms limit 1000000",
"tc qdisc add dev mid.l handle ffff: ingress",
"ip link set dev imid.l up",
"tc filter add dev mid.l parent ffff: protocol all prio 10 u32 match u32 0 0 flowid 1:1 action mirred egress redirect dev imid.l",
]
right: post: [
"sysctl -w net.ipv4.tcp_sce=1",
"sysctl -w net.ipv4.tcp_rmem=\"4096 131072 240000000\"",
]
}
// server runs the server and captures packets on the right node
_server: {
Child: {
Node: _rig.right.node
Serial: [
_tcpdump & {_iface: "right.l"},
{StreamServer: {ListenAddr: _rig.serverAddr}},
{PacketServer: {ListenAddr: _rig.serverAddr}},
{Sleep: "1s"},
]
}
}
// client runs the client and captures packets on the left node
_client: {
Child: {
Node: _rig.left.node
Serial: [
_tcpdump & {_iface: "left.r"},
{Sleep: "1s"},
{Parallel: [
{StreamClient: {
Addr: _rig.serverAddr
Upload: {
Flow: "cubic"
CCA: "cubic"
Duration: "\(_duration)s"
TCPInfoInterval: _tcpInfoInterval
}
}},
{StreamClient: {
Addr: _rig.serverAddr
Upload: {
Flow: "cubic-sce"
CCA: "cubic-sce"
Duration: "\(_duration)s"
TCPInfoInterval: _tcpInfoInterval
}
}},
{PacketClient: {
Addr: _rig.serverAddr
Flow: "udp-iso"
Sender: [
{Unresponsive: {
Echo: true
Wait: ["20ms"]
Length: [160]
Duration: "\(_duration)s"
}},
]
}},
{Serial: [
{Sleep: "\(_duration/3)s"},
{PacketClient: {
Addr: _rig.serverAddr
Flow: "udp-flood"
Sender: [
{Unresponsive: {
Wait: ["100us"]
Length: [1472]
Duration: "10s"
}},
]
}},
]},
]},
]
}
}
}