6.1 TCP
6.1 TCP
The following sections describe in detail the proposal for the use of ECN in TCP. The proposal is described in essentially the same form in [Floyd94]. We assume that the source TCP uses the standard congestion control algorithms of Slow-start, Fast Retransmit, and Fast Recovery [RFC2581].
The proposal specifies two new flags in the Reserved field of the TCP header. The TCP mechanism for negotiating ECN-capability uses the ECN-Echo flag in the TCP header. Bit 9 in the Reserved field of the TCP header is designated as the ECN-Echo flag. The position of the 6-bit Reserved field in the TCP header is shown in Figure 4 from RFC 793 [RFC793] (reproduced here for completeness). This specification of the ECN field leaves the Reserved field as a 4-bit field using bits 4-7.
To enable the TCP receiver to determine when to stop setting the ECN-Echo flag, we introduce a second new flag in the TCP header, the CWR flag. The CWR flag is assigned to bit 8 in the Reserved field of the TCP header.
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| | | U | A | P | R | S | F |
| Header Length | Reserved | R | C | S | S | Y | I |
| | | G | K | H | T | N | N |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
Figure 3: The old definition of bytes 13 and 14 of the TCP Header
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| | | C | E | U | A | P | R | S | F |
| Header Length | Reserved | W | C | R | C | S | S | Y | I |
| | | R | E | G | K | H | T | N | N |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
Figure 4: The new definition of bytes 13 and 14 of the TCP Header
Thus, ECN uses the ECT and CE flags in the IP header (as shown in Figure 1) for signaling between routers and connection endpoints, and uses the ECN-Echo and CWR flags in the TCP header (as shown in Figure 4) for TCP endpoint to TCP endpoint signaling. The typical sequence of events for ECN-based congestion response for a TCP connection is as follows:
-
The sender sets the ECT codepoint in transmitted packets to indicate that the endpoints of the transport entity are ECN-capable.
-
An ECN-capable router detects incipient congestion and detects that the ECT codepoint is set in a packet it is about to drop. The router chooses to set the CE codepoint in the IP header and forward the packet instead of dropping it.
-
The receiver receives a packet with the CE codepoint set, and sets the ECN-Echo flag in its next TCP ACK sent to the sender.
-
The sender receives the TCP ACK with the ECN-Echo flag set, and responds to congestion as if a packet had been dropped.
-
The sender sets the CWR flag in the TCP header of the next packet sent to the receiver to acknowledge its receipt of and response to the ECN-Echo flag.
The use of ECN by TCP transport entities is negotiated, as is the use of the ECN-Echo and CWR flags, in the following sections in more detail.