Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

linux

tcp

I wish to ascertain these values when a packet is sent or received over a socket connection. Is there any existing tool which does this?

like image 998
Bruce Avatar asked Jul 09 '11 04:07

Bruce


People also ask

What is TCP CWND?

In TCP, the congestion window (CWND) is one of the factors that determines the number of bytes that can be sent out at any time. The congestion window is maintained by the sender and is a means of stopping a link between the sender and the receiver from becoming overloaded with too much traffic.

Why does congestion occur in TCP?

The typical symptoms of a congestion are: excessive packet delay, packet loss and retransmission. Insufficient link bandwidth, legacy network devices, greedy network applications or poorly designed or configured network infrastructure are among the common causes of congestion.

What is the minimum value of congestion window size?

We can see that during this phase the size of the congestion window increases exponentially, i.e., the congestion window is initialized to one packet; after one round-trip time (RTT) the window size is increased to two packets; after two RTTs the window is increased to four packets; after three RTTs the window is ...


1 Answers

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

like image 107
Dynalon Avatar answered Oct 18 '22 08:10

Dynalon