bbperf 0.0.3__tar.gz → 0.0.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {bbperf-0.0.3 → bbperf-0.0.5}/DEPLOY.txt +3 -0
- {bbperf-0.0.3 → bbperf-0.0.5}/PKG-INFO +36 -19
- bbperf-0.0.5/README.md +131 -0
- {bbperf-0.0.3 → bbperf-0.0.5}/pyproject.toml +1 -1
- {bbperf-0.0.3 → bbperf-0.0.5}/src/bbperf/bbperf.py +6 -5
- {bbperf-0.0.3 → bbperf-0.0.5}/src/bbperf/client.py +2 -2
- {bbperf-0.0.3 → bbperf-0.0.5}/src/bbperf/control_receiver_thread.py +2 -2
- {bbperf-0.0.3 → bbperf-0.0.5}/src/bbperf/data_receiver_thread.py +3 -2
- {bbperf-0.0.3 → bbperf-0.0.5}/src/bbperf/data_sender_thread.py +11 -18
- bbperf-0.0.5/src/bbperf/json_output_class.py +98 -0
- {bbperf-0.0.3 → bbperf-0.0.5}/src/bbperf/output.py +18 -23
- {bbperf-0.0.3 → bbperf-0.0.5}/src/bbperf/tcp_control_connection_class.py +2 -2
- {bbperf-0.0.3 → bbperf-0.0.5}/src/bbperf/udp_rate_manager_class.py +1 -1
- {bbperf-0.0.3 → bbperf-0.0.5}/src/bbperf/util.py +5 -53
- bbperf-0.0.5/tests/run_test.sh +25 -0
- bbperf-0.0.3/README.md +0 -114
- bbperf-0.0.3/src/bbperf/json_output_class.py +0 -69
- bbperf-0.0.3/tests/run_test.sh +0 -52
- {bbperf-0.0.3 → bbperf-0.0.5}/.gitignore +0 -0
- {bbperf-0.0.3 → bbperf-0.0.5}/LICENSE +0 -0
- {bbperf-0.0.3 → bbperf-0.0.5}/src/bbperf/.gitignore +0 -0
- {bbperf-0.0.3 → bbperf-0.0.5}/src/bbperf/__init__.py +0 -0
- {bbperf-0.0.3 → bbperf-0.0.5}/src/bbperf/calibration.py +0 -0
- {bbperf-0.0.3 → bbperf-0.0.5}/src/bbperf/const.py +0 -0
- {bbperf-0.0.3 → bbperf-0.0.5}/src/bbperf/data_udp_ping_sender_thread.py +0 -0
- {bbperf-0.0.3 → bbperf-0.0.5}/src/bbperf/exceptions.py +0 -0
- {bbperf-0.0.3 → bbperf-0.0.5}/src/bbperf/graph.py +0 -0
- {bbperf-0.0.3 → bbperf-0.0.5}/src/bbperf/server.py +0 -0
- {bbperf-0.0.3 → bbperf-0.0.5}/src/bbperf/tcp-graph.gp +0 -0
- {bbperf-0.0.3 → bbperf-0.0.5}/src/bbperf/udp-graph.gp +0 -0
|
@@ -12,9 +12,12 @@ Create tar.gz and whl files in dist directory:
|
|
|
12
12
|
cd /path/to/bbperf/git/repo/dir <-- the directory with the pyproject.toml file
|
|
13
13
|
|
|
14
14
|
vim pyproject.toml <-- increment the version number
|
|
15
|
+
git add pyproject.toml
|
|
16
|
+
git commit -m 'version 0.0.2'
|
|
15
17
|
|
|
16
18
|
git tag -a v0.0.2 -m 'version 0.0.2'
|
|
17
19
|
|
|
20
|
+
git push origin
|
|
18
21
|
git push origin --tags
|
|
19
22
|
|
|
20
23
|
python3 -m build
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bbperf
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.5
|
|
4
4
|
Summary: An end-to-end performance and bufferbloat measurement tool
|
|
5
5
|
Project-URL: Homepage, https://github.com/cloudflare/bbperf
|
|
6
6
|
Project-URL: Issues, https://github.com/cloudflare/bbperf/issues
|
|
@@ -18,32 +18,41 @@ Description-Content-Type: text/markdown
|
|
|
18
18
|
|
|
19
19
|
<p align="center"><strong>bbperf</strong> <em>- An end-to-end performance and bufferbloat measurement tool</em></p>
|
|
20
20
|
|
|
21
|
-
`bbperf` measures
|
|
21
|
+
`bbperf` measures what matters most.
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
* Throughput
|
|
25
|
-
* Bandwidth Delay Product (BDP)
|
|
26
|
-
* Usage of buffers between the endpoints
|
|
27
|
-
* Bufferbloat (when the usage of buffers is excessive)
|
|
28
|
-
|
|
29
|
-
For UDP, it also measures:
|
|
23
|
+
Traditional network performance measurement tools collect metrics such as latency and throughput regardless of the conditions that exist during the collection period. While valuable for many uses, that approach can miss reporting the actual performance that real user payloads experience on production networks. This tool only reports performance metrics when the flow is operating at "max buffer usage". Max buffer usage is when the active flow has filled any and all buffers that exist along the packet path between the endpoints.
|
|
30
24
|
|
|
31
|
-
|
|
32
|
-
* Packet loss rates
|
|
25
|
+
User payload is used to measure latency and throughput. This accounts for the performance impact of transparent proxies, transparent tunnels, transparent firewalls, and all the other things that are not visible to the endpoints. It also simplifies the interpretation of retransmissions on user performance, which is non-intuitive at best. This is because some retransmissions are due to the real loss of user payload while many are not. In this tool, the loss of user payload will show up in the latency and throughput metrics, i.e. higher latencies and lower throughput.
|
|
33
26
|
|
|
34
|
-
Features
|
|
27
|
+
Features:
|
|
35
28
|
|
|
36
29
|
* Latency, both unloaded and loaded, is measured by the same flow that is under test.
|
|
37
30
|
|
|
38
31
|
Other tools will commonly measure latency using a different flow or different protocol. One of the reasons why using different protocols and/or different flows is not desirable is because fair queuing will cause the latency of those other flows to be much lower (better) than the flow that matters.
|
|
39
32
|
|
|
33
|
+
* Throughput
|
|
34
|
+
|
|
35
|
+
Both sender and receiver rates are collected, but the receiver rate (a.k.a. goodput) is the important one.
|
|
36
|
+
|
|
40
37
|
* Bufferbloat is calculated
|
|
41
38
|
|
|
42
39
|
It is often assumed that TCP receive buffers are the only source of bufferbloat. While that is common, it misses many other locations where bufferbloat may occur. This tool reports the effects of all sources of bufferbloat, not just TCP receive buffers.
|
|
43
40
|
|
|
44
|
-
|
|
41
|
+
`bbperf` calculates both the BDP (bandwidth delay product) and the total amount of buffer actually used. The difference between those two is reported as "excess buffer usage". A small number for this metric is normal and expected, but a large number, relative to BDP, is bufferbloat. Bufferbloat also appears as a large difference between unloaded and loaded latency.
|
|
42
|
+
|
|
43
|
+
* Both TCP and UDP are supported
|
|
44
|
+
|
|
45
|
+
Both benchmark tests will wait until it has reached "max buffer usage" before collecting metrics data. For TCP, it will wait for the sending and receiving rates to match. For UDP, the sending rate will be automatically adjusted to be just above the maximum packet rate without dropping packets before starting its metrics collection.
|
|
45
46
|
|
|
46
|
-
*
|
|
47
|
+
* `bbperf` measures the performance of data flow in one direction only.
|
|
48
|
+
|
|
49
|
+
Network routing can be asymmetric, bottleneck links are asymmetric, bufferbloat is asymmetric, all of which means that performance is asymmetric. `bbperf` allows us to see the asymmetry.
|
|
50
|
+
|
|
51
|
+
Data flow in `bbperf` is one way. The direction of data flow is from the client host to the server host (unless the `-R` option is specified). That is the direction being measured, and is what is reported in the metrics.
|
|
52
|
+
|
|
53
|
+
Latency is measured round trip, but the return traffic (from the data receiver back to the data sender) is low-volume and should not contribute any bufferbloat-related latency to the measurement. This cannot be guaranteed, in the same way that it cannot be guaranteed that the unloaded latency measurement does not contain any bufferbloat-induced latency. But it does ensure that no bufferbloat-induced latency is cause by `bbperf`s own flow.
|
|
54
|
+
|
|
55
|
+
* Automatic generation of graphs
|
|
47
56
|
|
|
48
57
|
### Usage
|
|
49
58
|
|
|
@@ -67,13 +76,14 @@ The direction of data flow is from the client to the server. That is reversed w
|
|
|
67
76
|
|
|
68
77
|
```
|
|
69
78
|
$ bbperf.py --help
|
|
70
|
-
usage: bbperf.py [-h] [-v] [-s] [-c SERVER_IP] [-p SERVER_PORT] [-R] [-t SECONDS] [-u] [-
|
|
79
|
+
usage: bbperf.py [-h] [-v] [-q] [-s] [-c SERVER_IP] [-p SERVER_PORT] [-R] [-t SECONDS] [-u] [-g] [-k] [-J JSON_FILE]
|
|
71
80
|
|
|
72
81
|
bbperf: end to end performance and bufferbloat measurement tool
|
|
73
82
|
|
|
74
83
|
options:
|
|
75
84
|
-h, --help show this help message and exit
|
|
76
|
-
-v, --verbosity increase output verbosity
|
|
85
|
+
-v, --verbosity increase output verbosity (can be repeated)
|
|
86
|
+
-q, --quiet decrease output verbosity (can be repeated)
|
|
77
87
|
-s, --server run in server mode
|
|
78
88
|
-c, --client SERVER_IP
|
|
79
89
|
run in client mode
|
|
@@ -82,9 +92,7 @@ options:
|
|
|
82
92
|
-R, --reverse data flow in download direction (server to client)
|
|
83
93
|
-t, --time SECONDS duration of run in seconds
|
|
84
94
|
-u, --udp run in UDP mode (default: TCP mode)
|
|
85
|
-
-
|
|
86
|
-
n[kmgKMG] | n[kmgKMG]pps, optional for both TCP and UDP
|
|
87
|
-
-g, --graph generate graph (requires gnuplot)
|
|
95
|
+
-g, --graph generate graph (requires gnuplot on the client host)
|
|
88
96
|
-k, --keep keep data file
|
|
89
97
|
-J, --json-file JSON_FILE
|
|
90
98
|
JSON output file
|
|
@@ -107,6 +115,15 @@ Output from `bbperf` includes the following information:
|
|
|
107
115
|
drop% percentage of packets dropped (UDP only)
|
|
108
116
|
```
|
|
109
117
|
|
|
118
|
+
Output to standard out is controlled via the `--verbosity` and `--quiet` options as follows:
|
|
119
|
+
```
|
|
120
|
+
-qq nothing to stdout except errors
|
|
121
|
+
-q run summary in json format
|
|
122
|
+
(neither option) progress update once per second plus run summary in json format (default)
|
|
123
|
+
-v progress update once per 0.1 seconds, additional output, and run summary in json format
|
|
124
|
+
-vv debugging info useful for developers only
|
|
125
|
+
```
|
|
126
|
+
|
|
110
127
|
### Installation
|
|
111
128
|
|
|
112
129
|
`bbperf` is available via PyPI repository (pypi.org) and can be installed using pip.
|
bbperf-0.0.5/README.md
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
<p align="center"><strong>bbperf</strong> <em>- An end-to-end performance and bufferbloat measurement tool</em></p>
|
|
2
|
+
|
|
3
|
+
`bbperf` measures what matters most.
|
|
4
|
+
|
|
5
|
+
Traditional network performance measurement tools collect metrics such as latency and throughput regardless of the conditions that exist during the collection period. While valuable for many uses, that approach can miss reporting the actual performance that real user payloads experience on production networks. This tool only reports performance metrics when the flow is operating at "max buffer usage". Max buffer usage is when the active flow has filled any and all buffers that exist along the packet path between the endpoints.
|
|
6
|
+
|
|
7
|
+
User payload is used to measure latency and throughput. This accounts for the performance impact of transparent proxies, transparent tunnels, transparent firewalls, and all the other things that are not visible to the endpoints. It also simplifies the interpretation of retransmissions on user performance, which is non-intuitive at best. This is because some retransmissions are due to the real loss of user payload while many are not. In this tool, the loss of user payload will show up in the latency and throughput metrics, i.e. higher latencies and lower throughput.
|
|
8
|
+
|
|
9
|
+
Features:
|
|
10
|
+
|
|
11
|
+
* Latency, both unloaded and loaded, is measured by the same flow that is under test.
|
|
12
|
+
|
|
13
|
+
Other tools will commonly measure latency using a different flow or different protocol. One of the reasons why using different protocols and/or different flows is not desirable is because fair queuing will cause the latency of those other flows to be much lower (better) than the flow that matters.
|
|
14
|
+
|
|
15
|
+
* Throughput
|
|
16
|
+
|
|
17
|
+
Both sender and receiver rates are collected, but the receiver rate (a.k.a. goodput) is the important one.
|
|
18
|
+
|
|
19
|
+
* Bufferbloat is calculated
|
|
20
|
+
|
|
21
|
+
It is often assumed that TCP receive buffers are the only source of bufferbloat. While that is common, it misses many other locations where bufferbloat may occur. This tool reports the effects of all sources of bufferbloat, not just TCP receive buffers.
|
|
22
|
+
|
|
23
|
+
`bbperf` calculates both the BDP (bandwidth delay product) and the total amount of buffer actually used. The difference between those two is reported as "excess buffer usage". A small number for this metric is normal and expected, but a large number, relative to BDP, is bufferbloat. Bufferbloat also appears as a large difference between unloaded and loaded latency.
|
|
24
|
+
|
|
25
|
+
* Both TCP and UDP are supported
|
|
26
|
+
|
|
27
|
+
Both benchmark tests will wait until it has reached "max buffer usage" before collecting metrics data. For TCP, it will wait for the sending and receiving rates to match. For UDP, the sending rate will be automatically adjusted to be just above the maximum packet rate without dropping packets before starting its metrics collection.
|
|
28
|
+
|
|
29
|
+
* `bbperf` measures the performance of data flow in one direction only.
|
|
30
|
+
|
|
31
|
+
Network routing can be asymmetric, bottleneck links are asymmetric, bufferbloat is asymmetric, all of which means that performance is asymmetric. `bbperf` allows us to see the asymmetry.
|
|
32
|
+
|
|
33
|
+
Data flow in `bbperf` is one way. The direction of data flow is from the client host to the server host (unless the `-R` option is specified). That is the direction being measured, and is what is reported in the metrics.
|
|
34
|
+
|
|
35
|
+
Latency is measured round trip, but the return traffic (from the data receiver back to the data sender) is low-volume and should not contribute any bufferbloat-related latency to the measurement. This cannot be guaranteed, in the same way that it cannot be guaranteed that the unloaded latency measurement does not contain any bufferbloat-induced latency. But it does ensure that no bufferbloat-induced latency is cause by `bbperf`s own flow.
|
|
36
|
+
|
|
37
|
+
* Automatic generation of graphs
|
|
38
|
+
|
|
39
|
+
### Usage
|
|
40
|
+
|
|
41
|
+
To run a test:
|
|
42
|
+
|
|
43
|
+
1. Start the server on one host
|
|
44
|
+
```
|
|
45
|
+
$ bbperf.py -s
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
2. Run the client on another host
|
|
49
|
+
```
|
|
50
|
+
$ bbperf.py -c <ip address of server> [additional options as desired]
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
`bbperf` will use port 5301 between the client and server (by default).
|
|
54
|
+
|
|
55
|
+
The first 5 seconds performs a calibration, during which it captures the unloaded latency between endpoints.
|
|
56
|
+
|
|
57
|
+
The direction of data flow is from the client to the server. That is reversed when the "-R" option is specified.
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
$ bbperf.py --help
|
|
61
|
+
usage: bbperf.py [-h] [-v] [-q] [-s] [-c SERVER_IP] [-p SERVER_PORT] [-R] [-t SECONDS] [-u] [-g] [-k] [-J JSON_FILE]
|
|
62
|
+
|
|
63
|
+
bbperf: end to end performance and bufferbloat measurement tool
|
|
64
|
+
|
|
65
|
+
options:
|
|
66
|
+
-h, --help show this help message and exit
|
|
67
|
+
-v, --verbosity increase output verbosity (can be repeated)
|
|
68
|
+
-q, --quiet decrease output verbosity (can be repeated)
|
|
69
|
+
-s, --server run in server mode
|
|
70
|
+
-c, --client SERVER_IP
|
|
71
|
+
run in client mode
|
|
72
|
+
-p, --port SERVER_PORT
|
|
73
|
+
server port (default: 5301)
|
|
74
|
+
-R, --reverse data flow in download direction (server to client)
|
|
75
|
+
-t, --time SECONDS duration of run in seconds
|
|
76
|
+
-u, --udp run in UDP mode (default: TCP mode)
|
|
77
|
+
-g, --graph generate graph (requires gnuplot on the client host)
|
|
78
|
+
-k, --keep keep data file
|
|
79
|
+
-J, --json-file JSON_FILE
|
|
80
|
+
JSON output file
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Output from `bbperf` includes the following information:
|
|
84
|
+
```
|
|
85
|
+
sent_time time when a packet was sent
|
|
86
|
+
recv_time time when a packet was received
|
|
87
|
+
sender_pps packets per second sent
|
|
88
|
+
sender_Mbps bits per second sent
|
|
89
|
+
receiver_pps packets per second received
|
|
90
|
+
receiver_Mbps bits per second received
|
|
91
|
+
unloaded_rtt_ms unloaded RTT in milliseconds (determined during calibration)
|
|
92
|
+
rtt_ms RTT in milliseconds
|
|
93
|
+
BDP_bytes Calculated BDP in bytes
|
|
94
|
+
buffered_bytes Actual bytes in flight
|
|
95
|
+
bloat Ratio of buffered bytes to BDP
|
|
96
|
+
pkts_dropped number of packets dropped (UDP only)
|
|
97
|
+
drop% percentage of packets dropped (UDP only)
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Output to standard out is controlled via the `--verbosity` and `--quiet` options as follows:
|
|
101
|
+
```
|
|
102
|
+
-qq nothing to stdout except errors
|
|
103
|
+
-q run summary in json format
|
|
104
|
+
(neither option) progress update once per second plus run summary in json format (default)
|
|
105
|
+
-v progress update once per 0.1 seconds, additional output, and run summary in json format
|
|
106
|
+
-vv debugging info useful for developers only
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Installation
|
|
110
|
+
|
|
111
|
+
`bbperf` is available via PyPI repository (pypi.org) and can be installed using pip.
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
python3 -m venv bbperf-venv
|
|
115
|
+
. bbperf-venv/bin/active
|
|
116
|
+
pip install bbperf
|
|
117
|
+
|
|
118
|
+
bbperf.py [options]
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
In the event python3 is not already installed on the host:
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
apt-get install python3 python3-pip (Debian/Ubuntu)
|
|
125
|
+
dnf install python3 python3-pip (Fedora/RHEL)
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
Copyright (c) 2024 Cloudflare, Inc.<br/>
|
|
130
|
+
Licensed under the Apache 2.0 license found in the LICENSE file or at https://www.apache.org/licenses/LICENSE-2.0
|
|
131
|
+
|
|
@@ -17,7 +17,12 @@ def mainline():
|
|
|
17
17
|
parser.add_argument("-v", "--verbosity",
|
|
18
18
|
action="count",
|
|
19
19
|
default=0,
|
|
20
|
-
help="increase output verbosity")
|
|
20
|
+
help="increase output verbosity (can be repeated)")
|
|
21
|
+
|
|
22
|
+
parser.add_argument("-q", "--quiet",
|
|
23
|
+
action="count",
|
|
24
|
+
default=0,
|
|
25
|
+
help="decrease output verbosity (can be repeated)")
|
|
21
26
|
|
|
22
27
|
parser.add_argument("-s", "--server",
|
|
23
28
|
action="store_true",
|
|
@@ -51,10 +56,6 @@ def mainline():
|
|
|
51
56
|
default=False,
|
|
52
57
|
help="run in UDP mode (default: TCP mode)")
|
|
53
58
|
|
|
54
|
-
parser.add_argument("-b", "--bandwidth",
|
|
55
|
-
default=None,
|
|
56
|
-
help="n[kmgKMG] | n[kmgKMG]pps, optional for both TCP and UDP")
|
|
57
|
-
|
|
58
59
|
parser.add_argument("-g", "--graph",
|
|
59
60
|
action="store_true",
|
|
60
61
|
default=False,
|
|
@@ -214,11 +214,11 @@ def client_mainline(args):
|
|
|
214
214
|
graphdatafilename = output.get_graph_data_file_name()
|
|
215
215
|
rawdatafilename = output.get_raw_data_file_name()
|
|
216
216
|
|
|
217
|
-
if args.graph:
|
|
217
|
+
if args.graph and not args.quiet:
|
|
218
218
|
graph.create_graph(args, graphdatafilename)
|
|
219
219
|
print("created graph: {}".format(graphdatafilename + ".png"))
|
|
220
220
|
|
|
221
|
-
if args.keep:
|
|
221
|
+
if args.keep and not args.quiet:
|
|
222
222
|
print("keeping graph data file: {}".format(graphdatafilename))
|
|
223
223
|
print("keeping raw data file: {}".format(rawdatafilename))
|
|
224
224
|
else:
|
|
@@ -41,7 +41,7 @@ def run_recv_term_queue(args, stdout_queue, control_conn, results_queue, shared_
|
|
|
41
41
|
results_queue.put(new_str)
|
|
42
42
|
|
|
43
43
|
# udp autorate
|
|
44
|
-
if args.udp
|
|
44
|
+
if args.udp:
|
|
45
45
|
udp_rate_manager.update(new_str)
|
|
46
46
|
|
|
47
47
|
control_conn.close()
|
|
@@ -84,7 +84,7 @@ def run_recv_term_send(args, stdout_queue, control_conn, shared_udp_sending_rate
|
|
|
84
84
|
control_conn.send(new_str.encode())
|
|
85
85
|
|
|
86
86
|
# udp autorate
|
|
87
|
-
if args.udp
|
|
87
|
+
if args.udp:
|
|
88
88
|
udp_rate_manager.update(new_str)
|
|
89
89
|
|
|
90
90
|
control_conn.close()
|
|
@@ -7,7 +7,7 @@ import socket
|
|
|
7
7
|
from . import const
|
|
8
8
|
from . import util
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
# args are client args
|
|
11
11
|
def run(args, stdout_queue, control_conn, data_sock, peer_addr):
|
|
12
12
|
|
|
13
13
|
if args.verbosity:
|
|
@@ -45,7 +45,8 @@ def run(args, stdout_queue, control_conn, data_sock, peer_addr):
|
|
|
45
45
|
if peer_addr_for_udp is None:
|
|
46
46
|
# first packet is received
|
|
47
47
|
peer_addr_for_udp = pkt_from_addr
|
|
48
|
-
|
|
48
|
+
if not args.quiet:
|
|
49
|
+
print("peer address: {}".format(peer_addr_for_udp))
|
|
49
50
|
else:
|
|
50
51
|
raise Exception("ERROR: datagram from wrong peer address")
|
|
51
52
|
|
|
@@ -29,17 +29,10 @@ def run(args, stdout_queue, data_sock, peer_addr, shared_udp_sending_rate_pps):
|
|
|
29
29
|
stdout_queue.put("data sender: peer address: {}".format(peer_addr_for_udp))
|
|
30
30
|
break
|
|
31
31
|
|
|
32
|
-
#
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
bandwidth_is_pps, bandwidth_val_int = util.convert_bandwidth_str_to_int(args.bandwidth)
|
|
37
|
-
else:
|
|
38
|
-
# must be UDP with no bandwidth specified, so use UDP autorate
|
|
39
|
-
bandwidth_is_pps = True
|
|
40
|
-
bandwidth_val_int = shared_udp_sending_rate_pps.value
|
|
41
|
-
|
|
42
|
-
batch_size, delay_between_batches = util.convert_bandwidth_spec_to_batch_info(args, bandwidth_is_pps, bandwidth_val_int)
|
|
32
|
+
# udp autorate
|
|
33
|
+
if args.udp:
|
|
34
|
+
udp_pps = shared_udp_sending_rate_pps.value
|
|
35
|
+
batch_size, delay_between_batches = util.convert_udp_pps_to_batch_info(udp_pps)
|
|
43
36
|
|
|
44
37
|
# start sending
|
|
45
38
|
|
|
@@ -139,7 +132,7 @@ def run(args, stdout_queue, data_sock, peer_addr, shared_udp_sending_rate_pps):
|
|
|
139
132
|
interval_send_count = accum_send_count
|
|
140
133
|
interval_bytes_sent = accum_bytes_sent
|
|
141
134
|
|
|
142
|
-
if args.verbosity
|
|
135
|
+
if args.verbosity > 1:
|
|
143
136
|
print("data_sender: a {} {} {} {} {} {} b".format(
|
|
144
137
|
record_type, curr_time_sec, interval_time_sec, interval_send_count, interval_bytes_sent, total_send_counter)
|
|
145
138
|
)
|
|
@@ -149,11 +142,10 @@ def run(args, stdout_queue, data_sock, peer_addr, shared_udp_sending_rate_pps):
|
|
|
149
142
|
accum_send_count = 0
|
|
150
143
|
accum_bytes_sent = 0
|
|
151
144
|
|
|
152
|
-
# update udp
|
|
153
|
-
if args.udp
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
batch_size, delay_between_batches = util.convert_bandwidth_spec_to_batch_info(args, bandwidth_is_pps, bandwidth_val_int)
|
|
145
|
+
# update udp autorate
|
|
146
|
+
if args.udp:
|
|
147
|
+
udp_pps = shared_udp_sending_rate_pps.value
|
|
148
|
+
batch_size, delay_between_batches = util.convert_udp_pps_to_batch_info(udp_pps)
|
|
157
149
|
|
|
158
150
|
# send very slowly at first to establish unloaded latency
|
|
159
151
|
if not is_calibrated:
|
|
@@ -167,7 +159,8 @@ def run(args, stdout_queue, data_sock, peer_addr, shared_udp_sending_rate_pps):
|
|
|
167
159
|
if curr_time_sec > end_time:
|
|
168
160
|
break
|
|
169
161
|
|
|
170
|
-
|
|
162
|
+
# pause between udp batches if necessary
|
|
163
|
+
if args.udp:
|
|
171
164
|
current_batch_counter += 1
|
|
172
165
|
if current_batch_counter >= batch_size:
|
|
173
166
|
this_delay = delay_between_batches - (curr_time_sec - current_batch_start_time)
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
|
|
2
|
+
import json
|
|
3
|
+
import numpy
|
|
4
|
+
|
|
5
|
+
class JsonOutputClass:
|
|
6
|
+
|
|
7
|
+
def __init__(self, args):
|
|
8
|
+
self.args = args
|
|
9
|
+
self.output_dict = {}
|
|
10
|
+
self.output_dict["entries"] = []
|
|
11
|
+
self.unloaded_rtt_ms = None
|
|
12
|
+
|
|
13
|
+
if self.args.json_file:
|
|
14
|
+
self.json_output_file = open(self.args.json_file, 'w')
|
|
15
|
+
|
|
16
|
+
def set_unloaded_rtt_ms(self, rtt_ms):
|
|
17
|
+
self.unloaded_rtt_ms = rtt_ms
|
|
18
|
+
|
|
19
|
+
def add_entry(self, entry):
|
|
20
|
+
self.output_dict["entries"].append(entry)
|
|
21
|
+
|
|
22
|
+
def create_aggregate_stats(self):
|
|
23
|
+
loaded_rtt_ms_list = []
|
|
24
|
+
receiver_throughput_rate_mbps_list = []
|
|
25
|
+
excess_buffered_bytes_list = []
|
|
26
|
+
receiver_pps_list = []
|
|
27
|
+
pkt_loss_percent_list = []
|
|
28
|
+
|
|
29
|
+
for entry in self.output_dict["entries"]:
|
|
30
|
+
|
|
31
|
+
sender_throughput_rate_mbps = entry["sender_throughput_rate_mbps"]
|
|
32
|
+
receiver_throughput_rate_mbps = entry["receiver_throughput_rate_mbps"]
|
|
33
|
+
throughput_rate_ratio = abs(sender_throughput_rate_mbps - receiver_throughput_rate_mbps) / receiver_throughput_rate_mbps
|
|
34
|
+
|
|
35
|
+
# only add entries that capture then flow when it is at max bloat potential
|
|
36
|
+
if ( (self.args.udp and entry["pkt_loss_percent"] > 0) or
|
|
37
|
+
((not self.args.udp) and throughput_rate_ratio < 0.03) and (receiver_throughput_rate_mbps > 1.0) ):
|
|
38
|
+
|
|
39
|
+
loaded_rtt_ms_list.append(entry["loaded_rtt_ms"])
|
|
40
|
+
receiver_throughput_rate_mbps_list.append(entry["receiver_throughput_rate_mbps"])
|
|
41
|
+
excess_buffered_bytes_list.append(entry["excess_buffered_bytes"])
|
|
42
|
+
receiver_pps_list.append(entry["receiver_pps"])
|
|
43
|
+
pkt_loss_percent_list.append(entry["pkt_loss_percent"])
|
|
44
|
+
|
|
45
|
+
num_samples = len(loaded_rtt_ms_list)
|
|
46
|
+
if num_samples < 10:
|
|
47
|
+
if not self.args.quiet:
|
|
48
|
+
print("WARNING: not enough valid samples for summary statistics: {} samples. Increase the duration of the run using the '-t' option.".format(num_samples))
|
|
49
|
+
return
|
|
50
|
+
|
|
51
|
+
summary_dict = self.output_dict["summary"] = {}
|
|
52
|
+
|
|
53
|
+
summary_dict["num_samples"] = num_samples
|
|
54
|
+
|
|
55
|
+
summary_dict["unloaded_rtt_ms"] = self.unloaded_rtt_ms
|
|
56
|
+
|
|
57
|
+
p50, p90, p99 = numpy.percentile(loaded_rtt_ms_list, [50, 90, 99])
|
|
58
|
+
summary_dict["loaded_rtt_ms"] = {}
|
|
59
|
+
summary_dict["loaded_rtt_ms"]["p50"] = p50
|
|
60
|
+
summary_dict["loaded_rtt_ms"]["p90"] = p90
|
|
61
|
+
summary_dict["loaded_rtt_ms"]["p99"] = p99
|
|
62
|
+
|
|
63
|
+
p50, p90, p99 = numpy.percentile(receiver_throughput_rate_mbps_list, [50, 90, 99])
|
|
64
|
+
summary_dict["receiver_throughput_rate_mbps"] = {}
|
|
65
|
+
summary_dict["receiver_throughput_rate_mbps"]["p50"] = p50
|
|
66
|
+
summary_dict["receiver_throughput_rate_mbps"]["p90"] = p90
|
|
67
|
+
summary_dict["receiver_throughput_rate_mbps"]["p99"] = p99
|
|
68
|
+
|
|
69
|
+
p50, p90, p99 = numpy.percentile(excess_buffered_bytes_list, [50, 90, 99])
|
|
70
|
+
summary_dict["excess_buffered_bytes"] = {}
|
|
71
|
+
summary_dict["excess_buffered_bytes"]["p50"] = p50
|
|
72
|
+
summary_dict["excess_buffered_bytes"]["p90"] = p90
|
|
73
|
+
summary_dict["excess_buffered_bytes"]["p99"] = p99
|
|
74
|
+
|
|
75
|
+
p50, p90, p99 = numpy.percentile(receiver_pps_list, [50, 90, 99])
|
|
76
|
+
summary_dict["receiver_pps"] = {}
|
|
77
|
+
summary_dict["receiver_pps"]["p50"] = p50
|
|
78
|
+
summary_dict["receiver_pps"]["p90"] = p90
|
|
79
|
+
summary_dict["receiver_pps"]["p99"] = p99
|
|
80
|
+
|
|
81
|
+
p50, p90, p99 = numpy.percentile(pkt_loss_percent_list, [50, 90, 99])
|
|
82
|
+
summary_dict["pkt_loss_percent"] = {}
|
|
83
|
+
summary_dict["pkt_loss_percent"]["p50"] = p50
|
|
84
|
+
summary_dict["pkt_loss_percent"]["p90"] = p90
|
|
85
|
+
summary_dict["pkt_loss_percent"]["p99"] = p99
|
|
86
|
+
|
|
87
|
+
def write_output(self):
|
|
88
|
+
self.create_aggregate_stats()
|
|
89
|
+
|
|
90
|
+
# write to stdout
|
|
91
|
+
if (self.args.quiet < 2) and ("summary" in self.output_dict):
|
|
92
|
+
str_out = json.dumps(self.output_dict["summary"], indent=4)
|
|
93
|
+
print(str_out)
|
|
94
|
+
|
|
95
|
+
# write to file if requested
|
|
96
|
+
if self.args.json_file:
|
|
97
|
+
json.dump(self.output_dict, self.json_output_file, indent=4)
|
|
98
|
+
self.json_output_file.close()
|
|
@@ -43,13 +43,7 @@ def init(args0):
|
|
|
43
43
|
tmpfile1 = tempfile.NamedTemporaryFile(prefix=tmp_graph_filename_prefix, delete=False)
|
|
44
44
|
tmpfile2 = tempfile.NamedTemporaryFile(prefix=tmp_raw_filename_prefix, delete=False)
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
if args.json_file:
|
|
48
|
-
try:
|
|
49
|
-
json_output = JsonOutputClass(args)
|
|
50
|
-
except Exception as e:
|
|
51
|
-
print("ERROR creating json output: {} {}".format(type(e), str(e)))
|
|
52
|
-
json_output = None
|
|
46
|
+
json_output = JsonOutputClass(args)
|
|
53
47
|
|
|
54
48
|
|
|
55
49
|
def get_graph_data_file_name():
|
|
@@ -62,8 +56,7 @@ def term():
|
|
|
62
56
|
tmpfile1.close()
|
|
63
57
|
tmpfile2.close()
|
|
64
58
|
|
|
65
|
-
|
|
66
|
-
json_output.write_output_file()
|
|
59
|
+
json_output.write_output()
|
|
67
60
|
|
|
68
61
|
|
|
69
62
|
def delete_data_files():
|
|
@@ -117,8 +110,7 @@ def print_output(s1):
|
|
|
117
110
|
unloaded_rtt_sec = calibration.get_unloaded_latency_rtt_sec()
|
|
118
111
|
unloaded_rtt_ms = unloaded_rtt_sec * 1000
|
|
119
112
|
|
|
120
|
-
|
|
121
|
-
json_output.set_unloaded_rtt_ms(unloaded_rtt_ms)
|
|
113
|
+
json_output.set_unloaded_rtt_ms(unloaded_rtt_ms)
|
|
122
114
|
|
|
123
115
|
bdp_bytes = int( r_record["receiver_interval_rate_bytes_per_sec"] * unloaded_rtt_sec )
|
|
124
116
|
|
|
@@ -164,20 +156,23 @@ def print_output(s1):
|
|
|
164
156
|
write_graph_data_to_file(lineout)
|
|
165
157
|
|
|
166
158
|
# add to JSON output
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
159
|
+
excess = r_record["buffered_bytes"] - bdp_bytes
|
|
160
|
+
if excess < 0:
|
|
161
|
+
excess = 0
|
|
162
|
+
new_entry = {
|
|
163
|
+
"sent_time_sec": r_record["r_pkt_sent_time_sec"],
|
|
164
|
+
"loaded_rtt_ms": r_record["rtt_ms"],
|
|
165
|
+
"sender_throughput_rate_mbps": r_record["sender_interval_rate_mbps"],
|
|
166
|
+
"receiver_throughput_rate_mbps": r_record["receiver_interval_rate_mbps"],
|
|
167
|
+
"excess_buffered_bytes": excess,
|
|
168
|
+
"receiver_pps": r_record["receiver_pps"],
|
|
169
|
+
"pkt_loss_percent": dropped_this_interval_percent
|
|
170
|
+
}
|
|
171
|
+
json_output.add_entry(new_entry)
|
|
177
172
|
|
|
178
173
|
# write to stdout at the rate of one line per second
|
|
179
174
|
# each stdout line will be a 0.1s snapshot
|
|
180
|
-
if (curr_time > (last_line_to_stdout_time + const.STDOUT_INTERVAL_SEC)) or args.verbosity:
|
|
175
|
+
if ((curr_time > (last_line_to_stdout_time + const.STDOUT_INTERVAL_SEC)) and not args.quiet) or args.verbosity:
|
|
181
176
|
if print_header2:
|
|
182
177
|
print(" sent_time recv_time sender_pps sender_Mbps receiver_pps receiver_Mbps unloaded_rtt_ms rtt_ms BDP_bytes buffered_bytes bloat pkts_dropped drop%")
|
|
183
178
|
print_header2 = False
|
|
@@ -208,7 +203,7 @@ def print_output(s1):
|
|
|
208
203
|
else:
|
|
209
204
|
calibration.update_rtt_sec(r_record["rtt_sec"])
|
|
210
205
|
|
|
211
|
-
if curr_time > (last_line_to_stdout_time + const.STDOUT_INTERVAL_SEC):
|
|
206
|
+
if ((curr_time > (last_line_to_stdout_time + const.STDOUT_INTERVAL_SEC)) and not args.quiet) or args.verbosity:
|
|
212
207
|
if print_header1:
|
|
213
208
|
print("calibrating")
|
|
214
209
|
print(" sent_time recv_time rtt_ms")
|
|
@@ -45,7 +45,7 @@ class TcpControlConnectionClass:
|
|
|
45
45
|
num_bytes_sent
|
|
46
46
|
))
|
|
47
47
|
|
|
48
|
-
if self.args and self.args.verbosity
|
|
48
|
+
if self.args and self.args.verbosity > 1:
|
|
49
49
|
print("control connection: send: {}".format(payload_bytes.decode()))
|
|
50
50
|
|
|
51
51
|
|
|
@@ -73,7 +73,7 @@ class TcpControlConnectionClass:
|
|
|
73
73
|
if len(recv_bytes) == 0:
|
|
74
74
|
raise PeerDisconnectedException()
|
|
75
75
|
|
|
76
|
-
if self.args and self.args.verbosity
|
|
76
|
+
if self.args and self.args.verbosity > 1:
|
|
77
77
|
print("control connection: recv: {}".format(recv_bytes.decode()))
|
|
78
78
|
|
|
79
79
|
return recv_bytes
|
|
@@ -44,7 +44,7 @@ class UdpRateManagerClass:
|
|
|
44
44
|
# do not bother with tiny changes
|
|
45
45
|
return
|
|
46
46
|
|
|
47
|
-
if self.args.verbosity
|
|
47
|
+
if self.args.verbosity > 1:
|
|
48
48
|
print("UdpRateManager: update: receiver pps {} old rate {} new rate {}".format(
|
|
49
49
|
r_record["receiver_pps"],
|
|
50
50
|
self.shared_udp_sending_rate_pps.value,
|
|
@@ -26,63 +26,15 @@ def validate_args(args):
|
|
|
26
26
|
if args.time < 10:
|
|
27
27
|
raise Exception("ERROR: time must be at least 10 seconds")
|
|
28
28
|
|
|
29
|
+
if args.verbosity and args.quiet:
|
|
30
|
+
raise Exception("ERROR: cannot specify both verbosity and quiet")
|
|
29
31
|
|
|
30
|
-
def convert_bandwidth_str_to_int(arg_str):
|
|
31
|
-
# input string:
|
|
32
|
-
# n[kmgKMG] | n[kmgKMG]pps
|
|
33
32
|
|
|
34
|
-
|
|
35
|
-
if idx > -1:
|
|
36
|
-
# found, so pps
|
|
37
|
-
is_pps = True
|
|
38
|
-
human_num_str = arg_str[:idx]
|
|
39
|
-
else:
|
|
40
|
-
# bps
|
|
41
|
-
is_pps = False
|
|
42
|
-
human_num_str = arg_str
|
|
43
|
-
|
|
44
|
-
last_char = human_num_str[-1:]
|
|
45
|
-
|
|
46
|
-
if last_char in [ "k", "K" ]:
|
|
47
|
-
ret_val = int(human_num_str[0:-1]) * (10 ** 3)
|
|
48
|
-
|
|
49
|
-
elif last_char in [ "m", "M" ]:
|
|
50
|
-
ret_val = int(human_num_str[0:-1]) * (10 ** 6)
|
|
51
|
-
|
|
52
|
-
elif last_char in [ "g", "G" ]:
|
|
53
|
-
ret_val = int(human_num_str[0:-1]) * (10 ** 9)
|
|
54
|
-
|
|
55
|
-
else:
|
|
56
|
-
ret_val = int(human_num_str)
|
|
57
|
-
|
|
58
|
-
return is_pps, ret_val
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
def convert_bandwidth_spec_to_batch_info(args, bandwidth_is_pps, bandwidth_val_int):
|
|
62
|
-
|
|
63
|
-
if args.udp:
|
|
64
|
-
if bandwidth_is_pps:
|
|
65
|
-
packets_per_sec = bandwidth_val_int
|
|
66
|
-
sends_per_sec = packets_per_sec
|
|
67
|
-
else:
|
|
68
|
-
# udp/bps
|
|
69
|
-
packets_per_sec = (bandwidth_val_int / 8.0) / len(const.PAYLOAD_1K)
|
|
70
|
-
sends_per_sec = packets_per_sec
|
|
71
|
-
|
|
72
|
-
batch_size = const.RATE_LIMITED_BATCH_SIZE_PKTS_UDP_PKTS
|
|
73
|
-
|
|
74
|
-
else:
|
|
75
|
-
# tcp
|
|
76
|
-
if bandwidth_is_pps:
|
|
77
|
-
packets_per_sec = bandwidth_val_int
|
|
78
|
-
sends_per_sec = bandwidth_val_int / ( len(const.PAYLOAD_4K) / 1400.0 )
|
|
79
|
-
else:
|
|
80
|
-
packets_per_sec = (bandwidth_val_int / 8.0) / 1400.0
|
|
81
|
-
sends_per_sec = packets_per_sec / ( len(const.PAYLOAD_4K) / 1400.0 )
|
|
33
|
+
def convert_udp_pps_to_batch_info(packets_per_sec):
|
|
82
34
|
|
|
83
|
-
|
|
35
|
+
batch_size = const.RATE_LIMITED_BATCH_SIZE_PKTS_UDP_PKTS
|
|
84
36
|
|
|
85
|
-
batches_per_sec =
|
|
37
|
+
batches_per_sec = packets_per_sec / batch_size
|
|
86
38
|
|
|
87
39
|
if batches_per_sec < 1:
|
|
88
40
|
batches_per_sec = 1
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Copyright (c) 2024 Cloudflare, Inc.
|
|
4
|
+
# Licensed under the Apache 2.0 license found in the LICENSE file or at https://www.apache.org/licenses/LICENSE-2.0
|
|
5
|
+
|
|
6
|
+
SERVER_ADDR=127.0.0.1
|
|
7
|
+
|
|
8
|
+
DURATION=10
|
|
9
|
+
|
|
10
|
+
OPTARGS=""
|
|
11
|
+
#OPTARGS="-k -g"
|
|
12
|
+
|
|
13
|
+
set -x
|
|
14
|
+
|
|
15
|
+
bbperf -c $SERVER_ADDR -t $DURATION $EXTRAARGS
|
|
16
|
+
|
|
17
|
+
bbperf -c $SERVER_ADDR -t $DURATION $EXTRAARGS -R
|
|
18
|
+
|
|
19
|
+
bbperf -c $SERVER_ADDR -t $DURATION $EXTRAARGS -u -t 20
|
|
20
|
+
|
|
21
|
+
bbperf -c $SERVER_ADDR -t $DURATION $EXTRAARGS -u -R -t 20
|
|
22
|
+
|
|
23
|
+
bbperf -c $SERVER_ADDR -t $DURATION $EXTRAARGS -J /tmp/foo578439759837.out
|
|
24
|
+
rm /tmp/foo578439759837.out
|
|
25
|
+
|
bbperf-0.0.3/README.md
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
<p align="center"><strong>bbperf</strong> <em>- An end-to-end performance and bufferbloat measurement tool</em></p>
|
|
2
|
-
|
|
3
|
-
`bbperf` measures the following for both TCP and UDP:
|
|
4
|
-
|
|
5
|
-
* End-to-end latency, both unloaded and loaded
|
|
6
|
-
* Throughput
|
|
7
|
-
* Bandwidth Delay Product (BDP)
|
|
8
|
-
* Usage of buffers between the endpoints
|
|
9
|
-
* Bufferbloat (when the usage of buffers is excessive)
|
|
10
|
-
|
|
11
|
-
For UDP, it also measures:
|
|
12
|
-
|
|
13
|
-
* Packet rates
|
|
14
|
-
* Packet loss rates
|
|
15
|
-
|
|
16
|
-
Features that distinguish this tool from existing tools include:
|
|
17
|
-
|
|
18
|
-
* Latency, both unloaded and loaded, is measured by the same flow that is under test.
|
|
19
|
-
|
|
20
|
-
Other tools will commonly measure latency using a different flow or different protocol. One of the reasons why using different protocols and/or different flows is not desirable is because fair queuing will cause the latency of those other flows to be much lower (better) than the flow that matters.
|
|
21
|
-
|
|
22
|
-
* Bufferbloat is calculated
|
|
23
|
-
|
|
24
|
-
It is often assumed that TCP receive buffers are the only source of bufferbloat. While that is common, it misses many other locations where bufferbloat may occur. This tool reports the effects of all sources of bufferbloat, not just TCP receive buffers.
|
|
25
|
-
|
|
26
|
-
* Automatic generation of graphs
|
|
27
|
-
|
|
28
|
-
* The UDP option will automatically adjust the sending rate to just above the goodput rate so that any bufferbloat issues are measured. This feature is enabled by default. Simply omit the `-b/--bandwidth` option when running a `-u/--udp` test.
|
|
29
|
-
|
|
30
|
-
### Usage
|
|
31
|
-
|
|
32
|
-
To run a test:
|
|
33
|
-
|
|
34
|
-
1. Start the server on one host
|
|
35
|
-
```
|
|
36
|
-
$ bbperf.py -s
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
2. Run the client on another host
|
|
40
|
-
```
|
|
41
|
-
$ bbperf.py -c <ip address of server> [additional options as desired]
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
`bbperf` will use port 5301 between the client and server (by default).
|
|
45
|
-
|
|
46
|
-
The first 5 seconds performs a calibration, during which it captures the unloaded latency between endpoints.
|
|
47
|
-
|
|
48
|
-
The direction of data flow is from the client to the server. That is reversed when the "-R" option is specified.
|
|
49
|
-
|
|
50
|
-
```
|
|
51
|
-
$ bbperf.py --help
|
|
52
|
-
usage: bbperf.py [-h] [-v] [-s] [-c SERVER_IP] [-p SERVER_PORT] [-R] [-t SECONDS] [-u] [-b BANDWIDTH] [-g] [-k] [-J JSON_FILE]
|
|
53
|
-
|
|
54
|
-
bbperf: end to end performance and bufferbloat measurement tool
|
|
55
|
-
|
|
56
|
-
options:
|
|
57
|
-
-h, --help show this help message and exit
|
|
58
|
-
-v, --verbosity increase output verbosity
|
|
59
|
-
-s, --server run in server mode
|
|
60
|
-
-c, --client SERVER_IP
|
|
61
|
-
run in client mode
|
|
62
|
-
-p, --port SERVER_PORT
|
|
63
|
-
server port (default: 5301)
|
|
64
|
-
-R, --reverse data flow in download direction (server to client)
|
|
65
|
-
-t, --time SECONDS duration of run in seconds
|
|
66
|
-
-u, --udp run in UDP mode (default: TCP mode)
|
|
67
|
-
-b, --bandwidth BANDWIDTH
|
|
68
|
-
n[kmgKMG] | n[kmgKMG]pps, optional for both TCP and UDP
|
|
69
|
-
-g, --graph generate graph (requires gnuplot)
|
|
70
|
-
-k, --keep keep data file
|
|
71
|
-
-J, --json-file JSON_FILE
|
|
72
|
-
JSON output file
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
Output from `bbperf` includes the following information:
|
|
76
|
-
```
|
|
77
|
-
sent_time time when a packet was sent
|
|
78
|
-
recv_time time when a packet was received
|
|
79
|
-
sender_pps packets per second sent
|
|
80
|
-
sender_Mbps bits per second sent
|
|
81
|
-
receiver_pps packets per second received
|
|
82
|
-
receiver_Mbps bits per second received
|
|
83
|
-
unloaded_rtt_ms unloaded RTT in milliseconds (determined during calibration)
|
|
84
|
-
rtt_ms RTT in milliseconds
|
|
85
|
-
BDP_bytes Calculated BDP in bytes
|
|
86
|
-
buffered_bytes Actual bytes in flight
|
|
87
|
-
bloat Ratio of buffered bytes to BDP
|
|
88
|
-
pkts_dropped number of packets dropped (UDP only)
|
|
89
|
-
drop% percentage of packets dropped (UDP only)
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
### Installation
|
|
93
|
-
|
|
94
|
-
`bbperf` is available via PyPI repository (pypi.org) and can be installed using pip.
|
|
95
|
-
|
|
96
|
-
```
|
|
97
|
-
python3 -m venv bbperf-venv
|
|
98
|
-
. bbperf-venv/bin/active
|
|
99
|
-
pip install bbperf
|
|
100
|
-
|
|
101
|
-
bbperf.py [options]
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
In the event python3 is not already installed on the host:
|
|
105
|
-
|
|
106
|
-
```
|
|
107
|
-
apt-get install python3 python3-pip (Debian/Ubuntu)
|
|
108
|
-
dnf install python3 python3-pip (Fedora/RHEL)
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
---
|
|
112
|
-
Copyright (c) 2024 Cloudflare, Inc.<br/>
|
|
113
|
-
Licensed under the Apache 2.0 license found in the LICENSE file or at https://www.apache.org/licenses/LICENSE-2.0
|
|
114
|
-
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import json
|
|
3
|
-
import numpy
|
|
4
|
-
|
|
5
|
-
class JsonOutputClass:
|
|
6
|
-
|
|
7
|
-
def __init__(self, args):
|
|
8
|
-
self.args = args
|
|
9
|
-
|
|
10
|
-
self.json_output_file = open(args.json_file, 'w')
|
|
11
|
-
|
|
12
|
-
self.output_dict = {}
|
|
13
|
-
self.output_dict["entries"] = []
|
|
14
|
-
|
|
15
|
-
def set_unloaded_rtt_ms(self, rtt_ms):
|
|
16
|
-
if "unloaded_rtt_ms" not in self.output_dict:
|
|
17
|
-
self.output_dict["unloaded_rtt_ms"] = rtt_ms
|
|
18
|
-
|
|
19
|
-
def add_entry(self, entry):
|
|
20
|
-
self.output_dict["entries"].append(entry)
|
|
21
|
-
|
|
22
|
-
def create_aggregate_stats(self):
|
|
23
|
-
loaded_rtt_ms_list = []
|
|
24
|
-
receiver_throughput_rate_mbps_list = []
|
|
25
|
-
excess_buffered_bytes_list = []
|
|
26
|
-
receiver_pps_list = []
|
|
27
|
-
pkt_loss_percent_list = []
|
|
28
|
-
|
|
29
|
-
for entry in self.output_dict["entries"]:
|
|
30
|
-
loaded_rtt_ms_list.append(entry["loaded_rtt_ms"])
|
|
31
|
-
receiver_throughput_rate_mbps_list.append(entry["receiver_throughput_rate_mbps"])
|
|
32
|
-
excess_buffered_bytes_list.append(entry["excess_buffered_bytes"])
|
|
33
|
-
receiver_pps_list.append(entry["receiver_pps"])
|
|
34
|
-
pkt_loss_percent_list.append(entry["pkt_loss_percent"])
|
|
35
|
-
|
|
36
|
-
p50, p90, p99 = numpy.percentile(loaded_rtt_ms_list, [50, 90, 99])
|
|
37
|
-
self.output_dict["loaded_rtt_ms"] = {}
|
|
38
|
-
self.output_dict["loaded_rtt_ms"]["p50"] = p50
|
|
39
|
-
self.output_dict["loaded_rtt_ms"]["p90"] = p90
|
|
40
|
-
self.output_dict["loaded_rtt_ms"]["p99"] = p99
|
|
41
|
-
|
|
42
|
-
p50, p90, p99 = numpy.percentile(receiver_throughput_rate_mbps_list, [50, 90, 99])
|
|
43
|
-
self.output_dict["receiver_throughput_rate_mbps"] = {}
|
|
44
|
-
self.output_dict["receiver_throughput_rate_mbps"]["p50"] = p50
|
|
45
|
-
self.output_dict["receiver_throughput_rate_mbps"]["p90"] = p90
|
|
46
|
-
self.output_dict["receiver_throughput_rate_mbps"]["p99"] = p99
|
|
47
|
-
|
|
48
|
-
p50, p90, p99 = numpy.percentile(excess_buffered_bytes_list, [50, 90, 99])
|
|
49
|
-
self.output_dict["excess_buffered_bytes"] = {}
|
|
50
|
-
self.output_dict["excess_buffered_bytes"]["p50"] = p50
|
|
51
|
-
self.output_dict["excess_buffered_bytes"]["p90"] = p90
|
|
52
|
-
self.output_dict["excess_buffered_bytes"]["p99"] = p99
|
|
53
|
-
|
|
54
|
-
p50, p90, p99 = numpy.percentile(receiver_pps_list, [50, 90, 99])
|
|
55
|
-
self.output_dict["receiver_pps"] = {}
|
|
56
|
-
self.output_dict["receiver_pps"]["p50"] = p50
|
|
57
|
-
self.output_dict["receiver_pps"]["p90"] = p90
|
|
58
|
-
self.output_dict["receiver_pps"]["p99"] = p99
|
|
59
|
-
|
|
60
|
-
p50, p90, p99 = numpy.percentile(pkt_loss_percent_list, [50, 90, 99])
|
|
61
|
-
self.output_dict["pkt_loss_percent"] = {}
|
|
62
|
-
self.output_dict["pkt_loss_percent"]["p50"] = p50
|
|
63
|
-
self.output_dict["pkt_loss_percent"]["p90"] = p90
|
|
64
|
-
self.output_dict["pkt_loss_percent"]["p99"] = p99
|
|
65
|
-
|
|
66
|
-
def write_output_file(self):
|
|
67
|
-
self.create_aggregate_stats()
|
|
68
|
-
json.dump(self.output_dict, self.json_output_file, indent=4)
|
|
69
|
-
self.json_output_file.close()
|
bbperf-0.0.3/tests/run_test.sh
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# Copyright (c) 2024 Cloudflare, Inc.
|
|
4
|
-
# Licensed under the Apache 2.0 license found in the LICENSE file or at https://www.apache.org/licenses/LICENSE-2.0
|
|
5
|
-
|
|
6
|
-
SERVER_ADDR=127.0.0.1
|
|
7
|
-
|
|
8
|
-
DURATION=10
|
|
9
|
-
|
|
10
|
-
OPTARGS=""
|
|
11
|
-
#OPTARGS="-k -g"
|
|
12
|
-
|
|
13
|
-
set -x
|
|
14
|
-
|
|
15
|
-
bbperf -c $SERVER_ADDR -t $DURATION $EXTRAARGS
|
|
16
|
-
|
|
17
|
-
bbperf -c $SERVER_ADDR -t $DURATION $EXTRAARGS -R
|
|
18
|
-
|
|
19
|
-
bbperf -c $SERVER_ADDR -t $DURATION $EXTRAARGS -J /tmp/foo578439759837.out
|
|
20
|
-
rm /tmp/foo578439759837.out
|
|
21
|
-
|
|
22
|
-
bbperf -c $SERVER_ADDR -t $DURATION $EXTRAARGS -R -J /tmp/foo578439759837.out
|
|
23
|
-
rm /tmp/foo578439759837.out
|
|
24
|
-
|
|
25
|
-
bbperf -c $SERVER_ADDR -t $DURATION $EXTRAARGS -u
|
|
26
|
-
|
|
27
|
-
bbperf -c $SERVER_ADDR -t $DURATION $EXTRAARGS -u -R
|
|
28
|
-
|
|
29
|
-
bbperf -c $SERVER_ADDR -t $DURATION $EXTRAARGS -b 5M
|
|
30
|
-
|
|
31
|
-
bbperf -c $SERVER_ADDR -t $DURATION $EXTRAARGS -b 5M -R
|
|
32
|
-
|
|
33
|
-
bbperf -c $SERVER_ADDR -t $DURATION $EXTRAARGS -b 5Kpps
|
|
34
|
-
|
|
35
|
-
bbperf -c $SERVER_ADDR -t $DURATION $EXTRAARGS -b 5Kpps -R
|
|
36
|
-
|
|
37
|
-
bbperf -c $SERVER_ADDR -t $DURATION $EXTRAARGS -b 20Kpps
|
|
38
|
-
|
|
39
|
-
bbperf -c $SERVER_ADDR -t $DURATION $EXTRAARGS -b 20Kpps -R
|
|
40
|
-
|
|
41
|
-
bbperf -c $SERVER_ADDR -t $DURATION $EXTRAARGS -b 5M -u
|
|
42
|
-
|
|
43
|
-
bbperf -c $SERVER_ADDR -t $DURATION $EXTRAARGS -b 5M -u -R
|
|
44
|
-
|
|
45
|
-
bbperf -c $SERVER_ADDR -t $DURATION $EXTRAARGS -b 5Kpps -u
|
|
46
|
-
|
|
47
|
-
bbperf -c $SERVER_ADDR -t $DURATION $EXTRAARGS -b 5Kpps -u -R
|
|
48
|
-
|
|
49
|
-
bbperf -c $SERVER_ADDR -t $DURATION $EXTRAARGS -b 20Kpps -u
|
|
50
|
-
|
|
51
|
-
bbperf -c $SERVER_ADDR -t $DURATION $EXTRAARGS -b 20Kpps -u -R
|
|
52
|
-
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|