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?
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.
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.
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 ...
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With