When evaluating the performance of an application, it is useful to understand how the internal flow control mechanisms in Transmission Control Protocol (TCP) regulate data transmission. These internal mechanisms can account for unexpected application performance, such as performance gradually increasing over the initial moments of a connection even though network utilization and characteristics of the conversation between sender and receiver have remained constant.
The TCP receive window technologies implement flow control for the receiving side of a connection, limiting how much data can come to the receiver at any one point in time. For more information on working with these technologies, see TCP Receive Window Size and Window Scaling. The TCP slow start and congestion avoidance algorithms implement flow control for the sending side of a connection, limiting the amount of data sent out on the connection.
Slow Start Algorithm
When a connection is established, TCP starts slowly at first so as to assess the bandwidth of the connection and to avoid overflowing the receiving host or any other devices or links in the connection path. Instead of immediately sending enough data to fill the receiver's receive window during the initial phases of communication, or after the connection has been idle for some time, the sender transmits a conservative amount of data and gradually increases it as the server discovers more about the communications path's performance. Thus, the sender implements a slow start.
In this process, the send window is set to two TCP segments, and if those segments are acknowledged, the window is incremented to three segments. If those are acknowledged, the window size is incremented again, and so on until the amount of data being sent per burst reaches the size of the receive window on the remote host.
At that point, the slow start algorithm is no longer in use, and the receiver now governs flow control. If at some point the sender must retransmit a segment, the sender once again performs flow control by using the congestion avoidance algorithm.
Congestion Avoidance Algorithm
Even with the use of the slow start algorithm, congestion can still occur on a connection at any time during transmission. If this happens, as shown by the need to retransmit data, the TCP stack acts under the assumption that network congestion is the cause.
In this situation, TCP uses a combination of the slow start and congestion avoidance algorithms to reset the send window size temporarily. On Windows Server 2003 and Windows XP, the congestion avoidance algorithm resets the receive window to half the size of the send window at the point when congestion occurred. TCP then enlarges the receive window back to the currently advertised size more slowly than it would increase if only the slow start algorithm were employed.
Slow start and congestion avoidance are described in RFC 2581: TCP Congestion Control.
See Also
Windows TCP Implementation Features