Add Rwnd and RTT to iperf3 output (when not using JSON)
- Dominant language
- C
- Stars
- 8.8k
- Forks
- 1.5k
- PR merge metrics
- No merged PRs in 30d
Description
# Context
* Version of iperf3: iperf 3.10.1+ (cJSON 1.7.13)
* Hardware: AWS EC2 HVM
* Operating system (and distribution, if any): Linux (Ubuntu 20.04)
# Enhancement Request
* Current behavior
Currently, iperf3 exposes lots of relevant metrics for TCP bandwidth tests when using the `--json` flag. These metrics are got using the tcpinfo data structure provide by the Kernel.
Output example:
```json
{
[...]
"bytes": 125223357,
"bits_per_second": 1001783870.451413,
"retransmits": 11,
"snd_cwnd": 536940,
"snd_wnd": 3145728,
"rtt": 4053,
"rttvar": 109,
"pmtu": 9001,
"omitted": false,
"sender": true
}
```
When not using the `--json` flag, iperf3 shows lot of useful information for troubleshooting/diving deep into bandwidth results over time, including Retr (`retransmits`) and Cwnd (`snd_cwnd`).
```
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 123 MBytes 1.03 Gbits/sec 13 603 KBytes
[ 5] 1.00-2.00 sec 120 MBytes 1.00 Gbits/sec 12 454 KBytes
```
But metrics like `snd_wnd` and `rtt`/`rttvar` are not in the output.
* Desired behavior
Metrics like `snd_wnd` and `rtt`/`rttvar` helps a lot to understand bandwidth behavior (bandwidth drops if wnd zeroes, and modern congestion algorithms like BBR rely a lot on rtt/rttvar). So, I'm proposing to add them in the normal output (without JSON) if they are available.
I was thinking in something like:
```
[ ID] Interval Transfer Bitrate Retr Cwnd Rwnd RTT
[ 5] 0.00-1.00 sec 123 MBytes 1.03 Gbits/sec 13 603 KBytes 3.14 MBytes 4.05 ms (+-0.11 ms)
[ 5] 1.00-2.00 sec 120 MBytes 1.00 Gbits/sec 12 454 KBytes 3.15 MBytes 5.05 ms (+-0.21 ms)
```
Rwnd is a pretty name to `snd_wnd`, RTT is the pretty name for both `rtt` and `rttvar`.
* Implementation notes
Maybe just adding lots of columns will confuse the average users. One alternative is to add a new option flag `--detailed-output` or `--extended-output` that will add the new columns to the output (if `--json` is not set, of course).
I also proposed to pretty print RTT in format `4.05 ms (+-0.11 ms)`, which is good (easy to read) but technically wrong, since `rttvar` is a variance measure and not a max/min interval. One may think that `4.05 ms (var 0.11 ms)` should be the correct way.
Contributor guide
Assessment
This issue has not been assessed yet.