How to monitor cwnd and ssthresh values for a TCP connection?

I disagree with the answer given by Nemo. Wireshark (as well as dumpcap, tcpdump) are not capable of measuring/logging the cwnd and the ssthresh, as those are not field in the tcp datagrams but are only values that reside inside the kernel as kernel structures. Congestion control data is not transmitted over the wire, only flow control data is.

To monitor those values, either implement get_info and sample the data periodically, or take a look at the tcp_probe kernel module (see: http://www.linuxfoundation.org/collaborate/workgroups/networking/tcptesting)

UPDATE: I've created a patched version of the tcp_probe module that can be used for monitoring the cwnd and ssthread, see https://github.com/Dynalon/tcp_probe_fixed


The ss utility will generate this output for sockets:

# ss -i
State      Recv-Q Send-Q      Local Address:Port          Peer Address:Port   
ESTAB      0      2054000          1.2.3.4:34069          1.2.3.5:ssh     
     htcp wscale:11,11 rto:247 rtt:47/0.75 ato:40 cwnd:1542 ssthresh:742 send 380.1Mbps rcv_rtt:14 rcv_space:64240

You can check the cwnd/ssthresh values from it.

Tags:

Linux

Tcp