Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Add pointer to SIGMETRICS 2019 paper (Gordon); formatting changes

...

TCP flow control and window size adjustment is mainly based on two key
mechanism: Slow Start and Additive Increase/Multiplicative Decrease (AIMD),
  also known as Congestion Avoidance.
(RFC 793 and RFC 5681)

Slow Start

...

Once congestion is detected (through timeout and/or duplicate ACKs),
the data rate is reduced in order to let the network recover.

Slow Start uses an exponential increase in window size and thus also
in data rate. Congestion Avoidance uses a linear growth function
(additive increase). This is achieved by introducing - in addition to
the cwnd window - a slow start threshold (=ssthresh=).

As long as cwnd is less than ssthresh , Slow Start applies. Once
Once ssthresh is reached, cwnd is increased by at most one segment per
RTT. The cwnd window continues to open with this linear rate until
a congestion event is detected.

When congestion is detected, ssthresh is set to half the cwnd (or to be strictly accurate, half the "Flight Size". This distinction is important if the implementation lets cwnd grow beyond rwnd (the receiver's declared window)).
cwnd is either set to 1 if congestion was signalled by a timeout,
forcing the sender to enter Slow Start, or to ssthresh if
congestion was signalled by duplicate ACKs and the Fast Recovery
Recovery algorithm has terminated. In either case, once the sender enters
Congestion Avoidance, its rate has been reduced to half the value at
the time of congestion. This multiplicative decrease causes the
the cwnd to close exponentially with each detected loss event.

...

In Fast Retransmit, the arrival of three duplicate ACKs is
interpreted as packet loss, and retransmission starts before the
retransmission timer (RTO) expires.

The missing segment will be retransmitted immediately without going
through the normal retransmission queue processing. This improves
performance by eliminating delays that would suspend effective data
flow on the link.

Fast Recovery

Fast Recovery is used to react quickly to a single packet loss. In
Fast recovery, the receipt of 3 duplicate ACKs, while being taken to
mean a loss of a segment, does not result in a full Slow Start. This
is because obviously later segments got through, and hence congestion
is not stopping everything. In fast recovery, ssthresh is set to half
of the current send window size, the missing segment is retransmitted
(Fast Retransmit) and cwnd is set to ssthresh plus three
segments. Each additional duplicate ACK indicates that one segment
has left the network at the receiver and cwnd is increased by one
segment to allow the transmission of another segment if allowed by the
new cwnd . When an ACK is received for new data, cwmd is reset to
the ssthresh , and TCP enters congestion avoidance mode.

...

– Main.UlrichSchmid - 07 Jun 2005
-- Main.SimonLeinen - 27 Jan 2006 - 23 20 Jun 20112020