esnet / esnet/iperf

BBR congestion control reports as CUBIC on FreeBSD

Open
#1,740 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
8.8k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

# Context

* Version of iperf3: iperf 3.17.1 (cJSON 1.7.15)
* Hardware: amd64
* Operating system: FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC
* Other relevant information: iperf3 was installed from FreeBSD packages

# Bug Report

## Steps to reproduce

use FreeBSD
enable the BBR TCP congestion control algorithm as described in [`tcp_bbr(4)`](https://man.freebsd.org/cgi/man.cgi?query=tcp_bbr)
execute `iperf3` with `--debug`
read the line beginning with `Congestion algorithm is`

## Expected behavior

```
Congestion algorithm is bbr
```

## Actual behavior

```
Congestion algorithm is cubic
```

## Possible Solution

> BBR is conceptually a CC, but in FreeBSD it is NOT implemented as a CC module. It is a TCP stack.

https://lists.freebsd.org/pipermail/freebsd-current/2020-April/075930.html

Here is some test code that demonstrates what I expect is the root of the confusion.

```c
#include
#include
#include
#include
#include
#include
#include

int
main(int argc, char **argv) {
char buf[256];
socklen_t len;

int s = socket(PF_INET, SOCK_STREAM, 6);
if (s < 0) err(1, "socket");

len = sizeof(buf);
if (getsockopt(s, IPPROTO_TCP, TCP_CONGESTION, buf, &len)) err(1, "getsockopt");
printf("tcp_congestion: %s\n", buf);

len = sizeof(buf);
if (getsockopt(s, IPPROTO_TCP, TCP_FUNCTION_BLK, buf, &len)) err(1, "getsockopt");
printf("tcp_function_blk: %s\n", buf);

close(s);
return 0;
}
```

output:

```
root@bert # ./getsockopt-tcp-function-blk
tcp_congestion: cubic
tcp_function_blk: bbr
```

This is only a minor bug, though it has caused confusion when dealing with other engineers who take the output from iperf as gospel.

Thank you for your work on iperf.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.