Search code examples
tcpip

TCP - Difference between congestion window and receive window


I try to understand the difference between the congestion window and the receive window.

As I understand it, the receiver window is a buffer where the receiver can get the packets. The same is true for the congestion window which tells us the bounds of the receiver's abilities, the window changes according to lost packets, etc.

What is the difference between them?


Solution

  • To give a short answer: The receive window is managed by the receiver, who sends out window sizes to the sender. The window sizes announce the number of bytes still free in the receiver buffer, i.e. the number of bytes the sender can still send without needing an acknowledgement from the receiver.

    The congestion window is a sender-imposed window that was implemented to avoid overrunning some routers in the middle of the network path. The sender, with each segment sent, increases the congestion window slightly, i.e. the sender will allow itself more outstanding sent data. But if the sender detects packet loss, it will cut the window in half. The rationale behind this is that the sender assumes that packet loss has occurred because of a buffer overflow somewhere (which is almost always true), so the sender wants to keep less data "in flight" to avoid further packet loss in the future.

    For more, start here: https://en.wikipedia.org/wiki/Slow-start