Page MenuHomeFreeBSD

Extend netstat to display TCP stack and detailed congestion state
ClosedPublic

Authored by rscheff on Sep 21 2020, 9:03 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 19, 12:11 AM
Unknown Object (File)
Wed, Dec 11, 5:53 AM
Unknown Object (File)
Tue, Dec 10, 12:50 PM
Unknown Object (File)
Sat, Dec 7, 10:25 AM
Unknown Object (File)
Fri, Nov 29, 11:04 AM
Unknown Object (File)
Sat, Nov 23, 7:34 PM
Unknown Object (File)
Nov 22 2024, 7:26 AM
Unknown Object (File)
Nov 19 2024, 9:14 AM

Details

Summary

Upstreaming the "-c" option used to show detailed per-connection
congestion control state for TCP sessions.

This is one summary patch, which adds the relevant variables into
xtcpcb. As previous "spare" space is used, these changes are ABI
compatible (an older version of netstat will simply not show
the newly available data from newer kernels, and a newer version
of netstat will only show zeroed data querying older kernels.

Test Plan

Verify that "netstat -c" shows cwnd, ssthresh, maxseg and ecn/ace,
while "netstat -C" shows the CC-algo (e.g. newreno, reno,...) and
the TCP stack in use (e.g. FreeBSD, RACK, BBR).

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 33755
Build 30978: arc lint + arc unit

Event Timeline

usr.bin/netstat/main.c
208–209

Other lines use show instead of Show. Change for consistency?

  • address uppercase oversight in comment

Not sure about showing the TCP stack name and the TCP congestion under the same flag. The TCP congestion control name scales to other transports, the TCP stack name doesn't.

Wouldn't the numbers fit also under -x?

  • move stack name output to -c option

Not sure about showing the TCP stack name and the TCP congestion under the same flag. The TCP congestion control name scales to other transports, the TCP stack name doesn't.

Wouldn't the numbers fit also under -x?

Move the stack name to "-c".

-x is cluttered as it is;

I'm even thinking about limiting the column width for Stack and cc_algo, based on the maximum name length currently in use? If all you have is "rack", no need to reserve 16 character-wide columns, or?

  • adjust column width to maximum string length
usr.bin/netstat/inet.c
351

Discussed with @tuexen; will move the output of session-specific info to the -C flag below after the algo, and -c will only show the TCP specific Stack, when needed.

  • move cc-specific variables output to -C
  • update man page accordingly
This revision is now accepted and ready to land.Oct 8 2020, 2:26 PM