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)
Mar 13 2024, 3:29 AM
Unknown Object (File)
Feb 23 2024, 2:26 PM
Unknown Object (File)
Jan 22 2024, 9:33 PM
Unknown Object (File)
Dec 23 2023, 9:24 AM
Unknown Object (File)
Dec 10 2023, 6:23 PM
Unknown Object (File)
Dec 7 2023, 11:19 PM
Unknown Object (File)
Dec 7 2023, 11:19 PM
Unknown Object (File)
Dec 7 2023, 11:19 PM

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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

usr.bin/netstat/main.c
208 ↗(On Diff #77322)

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
376 ↗(On Diff #77411)

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