TCP Flow Control and QoS


This section summarizes the flow-control and QoS mechanisms supported by TCP.

TCP Flow Control

TCP flow control is a robust topic that defies precise summarization. TCP implements many flow-control algorithms, and many augmentations have been made to those algorithms over the years. That said, the primary TCP flow-control algorithms include slow start, congestion avoidance, fast retransmit, and fast recovery. These algorithms control the behavior of TCP following initial connection establishment in an effort to avoid congestion and packet loss, and during periods of congestion and packet loss in an effort to reduce further congestion and packet loss.

As previously discussed, the TCP sliding window is the ever-changing receive buffer size that is advertised to a peer TCP node. The most recently advertised value is called the receiver window (RWND). The RWND is complemented by the Congestion Window (CWND), which is a state variable within each TCP node that controls the amount of data that may be transmitted. When congestion is detected in the network, TCP reacts by reducing its rate of transmission. Specifically, the transmitting node reduces its CWND. At any point in time, a TCP node may transmit data up to the Sequence Number that is equal to the lesser of the peer's RWND plus the highest acknowledged Sequence Number or the CWND plus the highest acknowledged Sequence Number. If no congestion is experienced, the RWND value is used. If congestion is experienced, the CWND value is used. Congestion can be detected implicitly via TCP's acknowledgement mechanisms or timeout mechanisms (as applies to dropped packets) or explicitly via ICMP Source-Quench messages or the ECE bit in the TCP header.

When ECN is implemented, TCP nodes convey their support for ECN by setting the two ECN bits in the IP header to 10 or 01. A router may then change these bits to 11 when congestion occurs. Upon receipt, the destination node recognizes that congestion was experienced. The destination node then notifies the source node by setting to 1 the ECE bit in the TCP header of the next transmitted packet. Upon receipt, the source node reduces its CWND and sets the CWR bit to 1 in the TCP header of the next transmitted packet. Thus, the destination TCP node is explicitly notified that the rate of transmission has been reduced. For more information about TCP flow control, readers are encouraged to consult IETF RFCs 792, 793, 896, 1122, 1180, 1323, 1812, 2309, 2525, 2581, 2914, 3042, 3155, 3168, 3390, 3448, 3782, and 4015.

TCP QoS

TCP interacts with the QoS mechanisms implemented by IP. Additionally, TCP provides two explicit QoS mechanisms of its own: the Urgent and Push flags in the TCP header. The Urgent flag indicates whether the Urgent Pointer field is valid. When valid, the Urgent Pointer field indicates the location of the last byte of urgent data in the packet's Data field. The Urgent Pointer field is expressed as an offset from the Sequence Number in the TCP header. No indication is provided for the location of the first byte of urgent data. Likewise, no guidance is provided regarding what constitutes urgent data. An ULP or application decides when to mark data as urgent. The receiving TCP node is not required to take any particular action upon receipt of urgent data, but the general expectation is that some effort will be made to process the urgent data sooner than otherwise would occur if the data were not marked urgent.

As previously discussed, TCP decides when to transmit data received from a ULP. However, a ULP occasionally needs to be sure that data submitted to the source node's TCP byte stream has actually be sent to the destination. This can be accomplished via the push function. A ULP informs TCP that all data previously submitted needs to be "pushed" to the destination ULP by requesting (via the TCP service provider interface) the push function. This causes TCP in the source node to immediately transmit all data in the byte stream and to set the Push flag to one in the final packet. Upon receiving a packet with the Push flag set to 1, TCP in the destination node immediately forwards all data in the byte stream to the required ULPs (subject to the rules for in-order delivery based on the Sequence Number field). For more information about TCP QoS, readers are encouraged to consult IETF RFCs 793 and 1122.




Storage Networking Protocol Fundamentals
Storage Networking Protocol Fundamentals (Vol 2)
ISBN: 1587051605
EAN: 2147483647
Year: 2007
Pages: 196
Authors: James Long

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net