draft-ietf-tcpm-rfc793bis-08.txt   draft-ietf-tcpm-rfc793bis-09.txt 
Internet Engineering Task Force W. Eddy, Ed. Internet Engineering Task Force W. Eddy, Ed.
Internet-Draft MTI Systems Internet-Draft MTI Systems
Obsoletes: 793, 879, 2873, 6093, 6429, March 28, 2018 Obsoletes: 793, 879, 2873, 6093, 6429, March 28, 2018
6528, 6691 (if approved) 6528, 6691 (if approved)
Updates: 5961, 1122 (if approved) Updates: 5961, 1122 (if approved)
Intended status: Standards Track Intended status: Standards Track
Expires: September 29, 2018 Expires: September 29, 2018
Transmission Control Protocol Specification Transmission Control Protocol Specification
draft-ietf-tcpm-rfc793bis-08 draft-ietf-tcpm-rfc793bis-09
Abstract Abstract
This document specifies the Internet's Transmission Control Protocol This document specifies the Internet's Transmission Control Protocol
(TCP). TCP is an important transport layer protocol in the Internet (TCP). TCP is an important transport layer protocol in the Internet
stack, and has continuously evolved over decades of use and growth of stack, and has continuously evolved over decades of use and growth of
the Internet. Over this time, a number of changes have been made to the Internet. Over this time, a number of changes have been made to
TCP as it was specified in RFC 793, though these have only been TCP as it was specified in RFC 793, though these have only been
documented in a piecemeal fashion. This document collects and brings documented in a piecemeal fashion. This document collects and brings
those changes together with the protocol specification from RFC 793. those changes together with the protocol specification from RFC 793.
skipping to change at page 2, line 47 skipping to change at page 2, line 47
than English. than English.
Table of Contents Table of Contents
1. Purpose and Scope . . . . . . . . . . . . . . . . . . . . . . 3 1. Purpose and Scope . . . . . . . . . . . . . . . . . . . . . . 3
2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4 2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4
2.1. Key TCP Concepts . . . . . . . . . . . . . . . . . . . . 5 2.1. Key TCP Concepts . . . . . . . . . . . . . . . . . . . . 5
3. Functional Specification . . . . . . . . . . . . . . . . . . 6 3. Functional Specification . . . . . . . . . . . . . . . . . . 6
3.1. Header Format . . . . . . . . . . . . . . . . . . . . . . 6 3.1. Header Format . . . . . . . . . . . . . . . . . . . . . . 6
3.2. Terminology . . . . . . . . . . . . . . . . . . . . . . . 11 3.2. Terminology . . . . . . . . . . . . . . . . . . . . . . . 11
3.3. Sequence Numbers . . . . . . . . . . . . . . . . . . . . 16 3.3. Sequence Numbers . . . . . . . . . . . . . . . . . . . . 15
3.4. Establishing a connection . . . . . . . . . . . . . . . . 22 3.4. Establishing a connection . . . . . . . . . . . . . . . . 22
4. Closing a Connection . . . . . . . . . . . . . . . . . . . . 29 3.5. Closing a Connection . . . . . . . . . . . . . . . . . . 29
4.1. Half-Closed Connections . . . . . . . . . . . . . . . . . 31 3.5.1. Half-Closed Connections . . . . . . . . . . . . . . . 31
5. Precedence and Security . . . . . . . . . . . . . . . . . . . 32 3.6. Precedence and Security . . . . . . . . . . . . . . . . . 32
6. Segmentation . . . . . . . . . . . . . . . . . . . . . . . . 33 3.7. Segmentation . . . . . . . . . . . . . . . . . . . . . . 33
6.1. Maximum Segment Size Option . . . . . . . . . . . . . . . 34 3.7.1. Maximum Segment Size Option . . . . . . . . . . . . . 34
6.2. Path MTU Discovery . . . . . . . . . . . . . . . . . . . 35 3.7.2. Path MTU Discovery . . . . . . . . . . . . . . . . . 35
6.3. Interfaces with Variable MTU Values . . . . . . . . . . . 36 3.7.3. Interfaces with Variable MTU Values . . . . . . . . . 36
6.4. Nagle Algorithm . . . . . . . . . . . . . . . . . . . . . 36 3.7.4. Nagle Algorithm . . . . . . . . . . . . . . . . . . . 36
6.5. IPv6 Jumbograms . . . . . . . . . . . . . . . . . . . . . 37 3.7.5. IPv6 Jumbograms . . . . . . . . . . . . . . . . . . . 37
7. Data Communication . . . . . . . . . . . . . . . . . . . . . 37 3.8. Data Communication . . . . . . . . . . . . . . . . . . . 37
7.1. Retransmission Timeout . . . . . . . . . . . . . . . . . 38 3.8.1. Retransmission Timeout . . . . . . . . . . . . . . . 38
7.2. TCP Congestion Control . . . . . . . . . . . . . . . . . 38 3.8.2. TCP Congestion Control . . . . . . . . . . . . . . . 38
7.3. TCP Connection Failures . . . . . . . . . . . . . . . . . 38 3.8.3. TCP Connection Failures . . . . . . . . . . . . . . . 38
7.4. TCP Keep-Alives . . . . . . . . . . . . . . . . . . . . . 39 3.8.4. TCP Keep-Alives . . . . . . . . . . . . . . . . . . . 39
7.5. The Communication of Urgent Information . . . . . . . . . 40 3.8.5. The Communication of Urgent Information . . . . . . . 40
7.6. Managing the Window . . . . . . . . . . . . . . . . . . . 41 3.8.6. Managing the Window . . . . . . . . . . . . . . . . . 41
7.6.1. Zero Window Probing . . . . . . . . . . . . . . . . . 42 3.9. Interfaces . . . . . . . . . . . . . . . . . . . . . . . 45
7.6.2. Silly Window Syndrome Avoidance . . . . . . . . . . . 42 3.9.1. User/TCP Interface . . . . . . . . . . . . . . . . . 45
7.6.3. Delayed Acknowledgements - When to Send an ACK 3.9.2. TCP/Lower-Level Interface . . . . . . . . . . . . . . 53
Segment . . . . . . . . . . . . . . . . . . . . . . . 45 3.10. Event Processing . . . . . . . . . . . . . . . . . . . . 56
8. Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . 45 3.11. Glossary . . . . . . . . . . . . . . . . . . . . . . . . 81
8.1. User/TCP Interface . . . . . . . . . . . . . . . . . . . 45 4. Changes from RFC 793 . . . . . . . . . . . . . . . . . . . . 86
8.2. TCP/Lower-Level Interface . . . . . . . . . . . . . . . . 53 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 91
8.2.1. Source Routing . . . . . . . . . . . . . . . . . . . 54 6. Security and Privacy Considerations . . . . . . . . . . . . . 91
8.2.2. ICMP Messages . . . . . . . . . . . . . . . . . . . . 55 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 92
8.2.3. Remote Address Validation . . . . . . . . . . . . . . 56 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 92
8.3. Event Processing . . . . . . . . . . . . . . . . . . . . 56 8.1. Normative References . . . . . . . . . . . . . . . . . . 92
8.4. Glossary . . . . . . . . . . . . . . . . . . . . . . . . 81 8.2. Informative References . . . . . . . . . . . . . . . . . 94
9. Changes from RFC 793 . . . . . . . . . . . . . . . . . . . . 86
10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 91
11. Security and Privacy Considerations . . . . . . . . . . . . . 91
12. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 92
13. References . . . . . . . . . . . . . . . . . . . . . . . . . 92
13.1. Normative References . . . . . . . . . . . . . . . . . . 92
13.2. Informative References . . . . . . . . . . . . . . . . . 94
Appendix A. Other Implementation Notes . . . . . . . . . . . . . 97 Appendix A. Other Implementation Notes . . . . . . . . . . . . . 97
A.1. IP Security Compartment and Precedence . . . . . . . . . 97 A.1. IP Security Compartment and Precedence . . . . . . . . . 97
A.2. Sequence Number Validation . . . . . . . . . . . . . . . 97 A.2. Sequence Number Validation . . . . . . . . . . . . . . . 97
A.3. Nagle Modification . . . . . . . . . . . . . . . . . . . 98 A.3. Nagle Modification . . . . . . . . . . . . . . . . . . . 98
A.4. Low Water Mark . . . . . . . . . . . . . . . . . . . . . 98 A.4. Low Water Mark . . . . . . . . . . . . . . . . . . . . . 98
Appendix B. TCP Requirement Summary . . . . . . . . . . . . . . 98 Appendix B. TCP Requirement Summary . . . . . . . . . . . . . . 98
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 102 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 102
1. Purpose and Scope 1. Purpose and Scope
skipping to change at page 5, line 25 skipping to change at page 5, line 17
interoperability. Similarly, most common TCP implementations today interoperability. Similarly, most common TCP implementations today
include the high-performance extensions in [34], but these are not include the high-performance extensions in [34], but these are not
strictly required or discussed in this document. strictly required or discussed in this document.
TEMPORARY EDITOR'S NOTE: This is an early revision in the process of TEMPORARY EDITOR'S NOTE: This is an early revision in the process of
updating RFC 793. Many planned changes are not yet incorporated. updating RFC 793. Many planned changes are not yet incorporated.
***Please do not use this revision as a basis for any work or ***Please do not use this revision as a basis for any work or
reference.*** reference.***
A list of changes from RFC 793 is contained in Section 9. A list of changes from RFC 793 is contained in Section 4.
TEMPORARY EDITOR'S NOTE: the current revision of this document does TEMPORARY EDITOR'S NOTE: the current revision of this document does
not yet collect all of the changes that will be in the final version. not yet collect all of the changes that will be in the final version.
The set of content changes planned for future revisions is kept in The set of content changes planned for future revisions is kept in
Section 9. Section 4.
2.1. Key TCP Concepts 2.1. Key TCP Concepts
TCP provides a reliable, in-order, byte-stream service to TCP provides a reliable, in-order, byte-stream service to
applications. applications.
The application byte-stream is conveyed over the network via TCP The application byte-stream is conveyed over the network via TCP
segments, with each TCP segment sent as an Internet Protocol (IP) segments, with each TCP segment sent as an Internet Protocol (IP)
datagram. datagram.
skipping to change at page 11, line 35 skipping to change at page 11, line 7
Kind=2 Length=4 Kind=2 Length=4
Maximum Segment Size Option Data: 16 bits Maximum Segment Size Option Data: 16 bits
If this option is present, then it communicates the maximum If this option is present, then it communicates the maximum
receive segment size at the TCP which sends this segment. This receive segment size at the TCP which sends this segment. This
value is limited by the IP reassembly limit. This field may be value is limited by the IP reassembly limit. This field may be
sent in the initial connection request (i.e., in segments with sent in the initial connection request (i.e., in segments with
the SYN control bit set) and must not be sent in other segments. the SYN control bit set) and must not be sent in other segments.
If this option is not used, any segment size is allowed. A more If this option is not used, any segment size is allowed. A more
complete description of this option is in Section 6.1. complete description of this option is in Section 3.7.1.
Padding: variable Padding: variable
The TCP header padding is used to ensure that the TCP header ends The TCP header padding is used to ensure that the TCP header ends
and data begins on a 32 bit boundary. The padding is composed of and data begins on a 32 bit boundary. The padding is composed of
zeros. zeros.
3.2. Terminology 3.2. Terminology
Before we can discuss very much about the operation of the TCP we Before we can discuss very much about the operation of the TCP we
skipping to change at page 29, line 18 skipping to change at page 29, line 18
The receiver of a RST first validates it, then changes state. If the The receiver of a RST first validates it, then changes state. If the
receiver was in the LISTEN state, it ignores it. If the receiver was receiver was in the LISTEN state, it ignores it. If the receiver was
in SYN-RECEIVED state and had previously been in the LISTEN state, in SYN-RECEIVED state and had previously been in the LISTEN state,
then the receiver returns to the LISTEN state, otherwise the receiver then the receiver returns to the LISTEN state, otherwise the receiver
aborts the connection and goes to the CLOSED state. If the receiver aborts the connection and goes to the CLOSED state. If the receiver
was in any other state, it aborts the connection and advises the user was in any other state, it aborts the connection and advises the user
and goes to the CLOSED state. and goes to the CLOSED state.
TCP SHOULD allow a received RST segment to include data. TCP SHOULD allow a received RST segment to include data.
4. Closing a Connection 3.5. Closing a Connection
CLOSE is an operation meaning "I have no more data to send." The CLOSE is an operation meaning "I have no more data to send." The
notion of closing a full-duplex connection is subject to ambiguous notion of closing a full-duplex connection is subject to ambiguous
interpretation, of course, since it may not be obvious how to treat interpretation, of course, since it may not be obvious how to treat
the receiving side of the connection. We have chosen to treat CLOSE the receiving side of the connection. We have chosen to treat CLOSE
in a simplex fashion. The user who CLOSEs may continue to RECEIVE in a simplex fashion. The user who CLOSEs may continue to RECEIVE
until he is told that the other side has CLOSED also. Thus, a until he is told that the other side has CLOSED also. Thus, a
program could initiate several SENDs followed by a CLOSE, and then program could initiate several SENDs followed by a CLOSE, and then
continue to RECEIVE until signaled that a RECEIVE failed because the continue to RECEIVE until signaled that a RECEIVE failed because the
other side has CLOSED. We assume that the TCP will signal a user, other side has CLOSED. We assume that the TCP will signal a user,
skipping to change at page 31, line 33 skipping to change at page 31, line 33
Figure 12 Figure 12
A TCP connection may terminate in two ways: (1) the normal TCP close A TCP connection may terminate in two ways: (1) the normal TCP close
sequence using a FIN handshake, and (2) an "abort" in which one or sequence using a FIN handshake, and (2) an "abort" in which one or
more RST segments are sent and the connection state is immediately more RST segments are sent and the connection state is immediately
discarded. If a TCP connection is closed by the remote site, the discarded. If a TCP connection is closed by the remote site, the
local application MUST be informed whether it closed normally or was local application MUST be informed whether it closed normally or was
aborted. aborted.
4.1. Half-Closed Connections 3.5.1. Half-Closed Connections
The normal TCP close sequence delivers buffered data reliably in both The normal TCP close sequence delivers buffered data reliably in both
directions. Since the two directions of a TCP connection are closed directions. Since the two directions of a TCP connection are closed
independently, it is possible for a connection to be "half closed," independently, it is possible for a connection to be "half closed,"
i.e., closed in only one direction, and a host is permitted to i.e., closed in only one direction, and a host is permitted to
continue sending data in the open direction on a half-closed continue sending data in the open direction on a half-closed
connection. connection.
A host MAY implement a "half-duplex" TCP close sequence, so that an A host MAY implement a "half-duplex" TCP close sequence, so that an
application that has called CLOSE cannot continue to read data from application that has called CLOSE cannot continue to read data from
skipping to change at page 32, line 19 skipping to change at page 32, line 19
(2) returns to TIME-WAIT state if the SYN turns out to be an old (2) returns to TIME-WAIT state if the SYN turns out to be an old
duplicate. duplicate.
When the TCP Timestamp options are available, an improved algorithm When the TCP Timestamp options are available, an improved algorithm
is described in [29] in order to support higher connection is described in [29] in order to support higher connection
establishment rates. This algorithm for reducing TIME-WAIT is a Best establishment rates. This algorithm for reducing TIME-WAIT is a Best
Current Practice that SHOULD be implemented, since timestamp options Current Practice that SHOULD be implemented, since timestamp options
are commonly used, and using them to reduce TIME-WAIT provides are commonly used, and using them to reduce TIME-WAIT provides
benefits for busy Internet servers. benefits for busy Internet servers.
5. Precedence and Security 3.6. Precedence and Security
The IPv4 specification [1] includes a precedence value in the Type of The IPv4 specification [1] includes a precedence value in the Type of
Service field (TOS), that was also modified in [15], and then Service field (TOS), that was also modified in [15], and then
obsoleted by the definition of Differentiated Services (DiffServ) obsoleted by the definition of Differentiated Services (DiffServ)
[6]. In DiffServ the former precedence values are treated as Class [6]. In DiffServ the former precedence values are treated as Class
Selector codepoints, and methods for compatible treatment are Selector codepoints, and methods for compatible treatment are
described in the DiffServ architecture. The RFC 793/1122 TCP described in the DiffServ architecture. The RFC 793/1122 TCP
specification includes logic intending to have connections use the specification includes logic intending to have connections use the
highest precedence requested by either endpoint application, and to highest precedence requested by either endpoint application, and to
keep the precedence consistent throughout a connection. There is an keep the precedence consistent throughout a connection. There is an
skipping to change at page 33, line 8 skipping to change at page 33, line 8
compartment information in treatment of TCP segments. References to compartment information in treatment of TCP segments. References to
the IP "security/compartment" in this document may be relevant for the IP "security/compartment" in this document may be relevant for
Multi-Level Secure (MLS) system implementers, but can be ignored for Multi-Level Secure (MLS) system implementers, but can be ignored for
non-MLS implementations, consistent with running code on the non-MLS implementations, consistent with running code on the
Internet. See Appendix A.1 for further discussion. Note that RFC Internet. See Appendix A.1 for further discussion. Note that RFC
5570 describes some MLS networking scenarios where IPSO, CIPSO, or 5570 describes some MLS networking scenarios where IPSO, CIPSO, or
CALIPSO may be used. In these special cases, TCP implementers should CALIPSO may be used. In these special cases, TCP implementers should
see section 7.3.1 of RFC 5570, and follow the guidance in that see section 7.3.1 of RFC 5570, and follow the guidance in that
document on the relation between IP security. document on the relation between IP security.
6. Segmentation 3.7. Segmentation
The term "segmentation" refers to the activity TCP performs when The term "segmentation" refers to the activity TCP performs when
ingesting a stream of bytes from a sending application and ingesting a stream of bytes from a sending application and
packetizing that stream of bytes into TCP segments. Individual TCP packetizing that stream of bytes into TCP segments. Individual TCP
segments often do not correspond one-for-one to individual send (or segments often do not correspond one-for-one to individual send (or
socket write) calls from the application. Applications may perform socket write) calls from the application. Applications may perform
writes at the granularity of messages in the upper layer protocol, writes at the granularity of messages in the upper layer protocol,
but TCP guarantees no boundary coherence between the TCP segments but TCP guarantees no boundary coherence between the TCP segments
sent and received versus user application data read or write buffer sent and received versus user application data read or write buffer
boundaries. In some specific protocols, such as RDMA using DDP and boundaries. In some specific protocols, such as RDMA using DDP and
skipping to change at page 34, line 19 skipping to change at page 34, line 19
o Enabling "fate sharing" between TCP segments and lower-layer data o Enabling "fate sharing" between TCP segments and lower-layer data
units (e.g. below IP, for links with cell or frame sizes smaller units (e.g. below IP, for links with cell or frame sizes smaller
than the IP MTU). than the IP MTU).
Towards meeting these competing sets of goals, TCP includes several Towards meeting these competing sets of goals, TCP includes several
mechanisms, including the Maximum Segment Size option, Path MTU mechanisms, including the Maximum Segment Size option, Path MTU
Discovery, the Nagle algorithm, and support for IPv6 Jumbograms, as Discovery, the Nagle algorithm, and support for IPv6 Jumbograms, as
discussed in the following subsections. discussed in the following subsections.
6.1. Maximum Segment Size Option 3.7.1. Maximum Segment Size Option
TCP MUST implement both sending and receiving the MSS option. TCP MUST implement both sending and receiving the MSS option.
TCP SHOULD send an MSS option in every SYN segment when its receive TCP SHOULD send an MSS option in every SYN segment when its receive
MSS differs from the default 536 for IPv4 or 1220 for IPv6, and MAY MSS differs from the default 536 for IPv4 or 1220 for IPv6, and MAY
send it always. send it always.
If an MSS option is not received at connection setup, TCP MUST assume If an MSS option is not received at connection setup, TCP MUST assume
a default send MSS of 536 (576-40) for IPv4 or 1220 (1280 - 60) for a default send MSS of 536 (576-40) for IPv4 or 1220 (1280 - 60) for
IPv6. IPv6.
skipping to change at page 35, line 37 skipping to change at page 35, line 37
and MMS_S from the IP layer; see the generic call GET_MAXSIZES in and MMS_S from the IP layer; see the generic call GET_MAXSIZES in
Section 3.4 of RFC 1122. These are defined in terms of their IP MTU Section 3.4 of RFC 1122. These are defined in terms of their IP MTU
equivalents, EMTU_R and EMTU_S [14]. equivalents, EMTU_R and EMTU_S [14].
When TCP is used in a situation where either the IP or TCP headers When TCP is used in a situation where either the IP or TCP headers
are not fixed, the sender must reduce the amount of TCP data in any are not fixed, the sender must reduce the amount of TCP data in any
given packet by the number of octets used by the IP and TCP options. given packet by the number of octets used by the IP and TCP options.
This has been a point of confusion historically, as explained in RFC This has been a point of confusion historically, as explained in RFC
6691, Section 3.1. 6691, Section 3.1.
6.2. Path MTU Discovery 3.7.2. Path MTU Discovery
A TCP implementation may be aware of the MTU on directly connected A TCP implementation may be aware of the MTU on directly connected
links, but will rarely have insight about MTUs across an entire links, but will rarely have insight about MTUs across an entire
network path. For IPv4, RFC 1122 provides an IP-layer recommendation network path. For IPv4, RFC 1122 provides an IP-layer recommendation
on the default effective MTU for sending to be less than or equal to on the default effective MTU for sending to be less than or equal to
576 for destinations not directly connected. For IPv6, this would be 576 for destinations not directly connected. For IPv6, this would be
1280. In all cases, however, implementation of Path MTU Discovery 1280. In all cases, however, implementation of Path MTU Discovery
(PMTUD) and Packetization Layer Path MTU Discovery (PLPMTUD) is (PMTUD) and Packetization Layer Path MTU Discovery (PLPMTUD) is
strongly recommended in order for TCP to improve segmentation strongly recommended in order for TCP to improve segmentation
decisions. Both PMTUD and PLPMTUD help TCP choose segment sizes that decisions. Both PMTUD and PLPMTUD help TCP choose segment sizes that
skipping to change at page 36, line 27 skipping to change at page 36, line 27
included in TCP implementations. included in TCP implementations.
The TCP MSS option specifies an upper bound for the size of packets The TCP MSS option specifies an upper bound for the size of packets
that can be received. Hence, setting the value in the MSS option too that can be received. Hence, setting the value in the MSS option too
small can impact the ability for PMTUD or PLPMTUD to find a larger small can impact the ability for PMTUD or PLPMTUD to find a larger
path MTU. RFC 1191 discusses this implication of many older TCP path MTU. RFC 1191 discusses this implication of many older TCP
implementations setting MSS to 536 for non-local destinations, rather implementations setting MSS to 536 for non-local destinations, rather
than deriving it from the MTUs of connected interfaces as than deriving it from the MTUs of connected interfaces as
recommended. recommended.
6.3. Interfaces with Variable MTU Values 3.7.3. Interfaces with Variable MTU Values
The effective MTU can sometimes vary, as when used with variable The effective MTU can sometimes vary, as when used with variable
compression, e.g., RObust Header Compression (ROHC) [25]. It is compression, e.g., RObust Header Compression (ROHC) [25]. It is
tempting for TCP to want to advertise the largest possible MSS, to tempting for TCP to want to advertise the largest possible MSS, to
support the most efficient use of compressed payloads. support the most efficient use of compressed payloads.
Unfortunately, some compression schemes occasionally need to transmit Unfortunately, some compression schemes occasionally need to transmit
full headers (and thus smaller payloads) to resynchronize state at full headers (and thus smaller payloads) to resynchronize state at
their endpoint compressors/decompressors. If the largest MTU is used their endpoint compressors/decompressors. If the largest MTU is used
to calculate the value to advertise in the MSS option, TCP to calculate the value to advertise in the MSS option, TCP
retransmission may interfere with compressor resynchronization. retransmission may interfere with compressor resynchronization.
As a result, when the effective MTU of an interface varies, TCP As a result, when the effective MTU of an interface varies, TCP
SHOULD use the smallest effective MTU of the interface to calculate SHOULD use the smallest effective MTU of the interface to calculate
the value to advertise in the MSS option. the value to advertise in the MSS option.
6.4. Nagle Algorithm 3.7.4. Nagle Algorithm
The "Nagle algorithm" was described in RFC 896 [13] and was The "Nagle algorithm" was described in RFC 896 [13] and was
recommended in RFC 1122 [14] for mitigation of an early problem of recommended in RFC 1122 [14] for mitigation of an early problem of
too many small packets being generated. It has been implemented in too many small packets being generated. It has been implemented in
most current TCP code bases, sometimes with minor variations (see most current TCP code bases, sometimes with minor variations (see
Appendix A.3). Appendix A.3).
If there is unacknowledged data (i.e., SND.NXT > SND.UNA), then the If there is unacknowledged data (i.e., SND.NXT > SND.UNA), then the
sending TCP buffers all user data (regardless of the PSH bit), until sending TCP buffers all user data (regardless of the PSH bit), until
the outstanding data has been acknowledged or until the TCP can send the outstanding data has been acknowledged or until the TCP can send
a full-sized segment (Eff.snd.MSS bytes). a full-sized segment (Eff.snd.MSS bytes).
A TCP SHOULD implement the Nagle Algorithm to coalesce short A TCP SHOULD implement the Nagle Algorithm to coalesce short
segments. However, there MUST be a way for an application to disable segments. However, there MUST be a way for an application to disable
the Nagle algorithm on an individual connection. In all cases, the Nagle algorithm on an individual connection. In all cases,
sending data is also subject to the limitation imposed by the Slow sending data is also subject to the limitation imposed by the Slow
Start algorithm [24]. Start algorithm [24].
6.5. IPv6 Jumbograms 3.7.5. IPv6 Jumbograms
In order to support TCP over IPv6 jumbograms, implementations need to In order to support TCP over IPv6 jumbograms, implementations need to
be able to send TCP segments larger than the 64KB limit that the MSS be able to send TCP segments larger than the 64KB limit that the MSS
option can convey. RFC 2675 [7] defines that an MSS value of 65,535 option can convey. RFC 2675 [7] defines that an MSS value of 65,535
bytes is to be treated as infinity, and Path MTU Discovery [3] is bytes is to be treated as infinity, and Path MTU Discovery [3] is
used to determine the actual MSS. used to determine the actual MSS.
7. Data Communication 3.8. Data Communication
Once the connection is established data is communicated by the Once the connection is established data is communicated by the
exchange of segments. Because segments may be lost due to errors exchange of segments. Because segments may be lost due to errors
(checksum test failure), or network congestion, TCP uses (checksum test failure), or network congestion, TCP uses
retransmission (after a timeout) to ensure delivery of every segment. retransmission (after a timeout) to ensure delivery of every segment.
Duplicate segments may arrive due to network or TCP retransmission. Duplicate segments may arrive due to network or TCP retransmission.
As discussed in the section on sequence numbers the TCP performs As discussed in the section on sequence numbers the TCP performs
certain tests on the sequence and acknowledgment numbers in the certain tests on the sequence and acknowledgment numbers in the
segments to verify their acceptability. segments to verify their acceptability.
skipping to change at page 38, line 5 skipping to change at page 38, line 5
an acknowledgment it advances SND.UNA. The extent to which the an acknowledgment it advances SND.UNA. The extent to which the
values of these variables differ is a measure of the delay in the values of these variables differ is a measure of the delay in the
communication. The amount by which the variables are advanced is the communication. The amount by which the variables are advanced is the
length of the data and SYN or FIN flags in the segment. Note that length of the data and SYN or FIN flags in the segment. Note that
once in the ESTABLISHED state all segments must carry current once in the ESTABLISHED state all segments must carry current
acknowledgment information. acknowledgment information.
The CLOSE user call implies a push function, as does the FIN control The CLOSE user call implies a push function, as does the FIN control
flag in an incoming segment. flag in an incoming segment.
7.1. Retransmission Timeout 3.8.1. Retransmission Timeout
Because of the variability of the networks that compose an Because of the variability of the networks that compose an
internetwork system and the wide range of uses of TCP connections the internetwork system and the wide range of uses of TCP connections the
retransmission timeout (RTO) must be dynamically determined. retransmission timeout (RTO) must be dynamically determined.
The RTO MUST be computed according to the algorithm in [10], The RTO MUST be computed according to the algorithm in [10],
including Karn's algorithm for taking RTT samples. including Karn's algorithm for taking RTT samples.
RFC 793 contains an early example procedure for computing the RTO. RFC 793 contains an early example procedure for computing the RTO.
This was then replaced by the algorithm described in RFC 1122, and This was then replaced by the algorithm described in RFC 1122, and
subsequently updated in RFC 2988, and then again in RFC 6298. subsequently updated in RFC 2988, and then again in RFC 6298.
If a retransmitted packet is identical to the original packet (which If a retransmitted packet is identical to the original packet (which
implies not only that the data boundaries have not changed, but also implies not only that the data boundaries have not changed, but also
that the window and acknowledgment fields of the header have not that the window and acknowledgment fields of the header have not
changed), then the same IP Identification field MAY be used (see changed), then the same IP Identification field MAY be used (see
Section 3.2.1.5 of RFC 1122). Section 3.2.1.5 of RFC 1122).
7.2. TCP Congestion Control 3.8.2. TCP Congestion Control
RFC 1122 required implementation of Van Jacobson's congestion control RFC 1122 required implementation of Van Jacobson's congestion control
algorithm combining slow start with congestion avoidance. RFC 2581 algorithm combining slow start with congestion avoidance. RFC 2581
provided IETF Standards Track description of this, along with fast provided IETF Standards Track description of this, along with fast
retransmit and fast recovery. RFC 5681 is the current description of retransmit and fast recovery. RFC 5681 is the current description of
these algorithms and is the current standard for TCP congestion these algorithms and is the current standard for TCP congestion
control. control.
A TCP MUST implement RFC 5681. A TCP MUST implement RFC 5681.
Explicit Congestion Notification (ECN) was defined in RFC 3168 and is Explicit Congestion Notification (ECN) was defined in RFC 3168 and is
an IETF Standards Track enhancement that has many benefits [38]. an IETF Standards Track enhancement that has many benefits [38].
A TCP SHOULD implement ECN as described in RFC 3168. A TCP SHOULD implement ECN as described in RFC 3168.
7.3. TCP Connection Failures 3.8.3. TCP Connection Failures
Excessive retransmission of the same segment by TCP indicates some Excessive retransmission of the same segment by TCP indicates some
failure of the remote host or the Internet path. This failure may be failure of the remote host or the Internet path. This failure may be
of short or long duration. The following procedure MUST be used to of short or long duration. The following procedure MUST be used to
handle excessive retransmissions of data segments: handle excessive retransmissions of data segments:
(a) There are two thresholds R1 and R2 measuring the amount of (a) There are two thresholds R1 and R2 measuring the amount of
retransmission that has occurred for the same segment. R1 and R2 retransmission that has occurred for the same segment. R1 and R2
might be measured in time units or as a count of retransmissions. might be measured in time units or as a count of retransmissions.
skipping to change at page 39, line 37 skipping to change at page 39, line 37
an ICMP Port Unreachable. SYN retransmissions MUST be handled in the an ICMP Port Unreachable. SYN retransmissions MUST be handled in the
general way just described for data retransmissions, including general way just described for data retransmissions, including
notification of the application layer. notification of the application layer.
However, the values of R1 and R2 may be different for SYN and data However, the values of R1 and R2 may be different for SYN and data
segments. In particular, R2 for a SYN segment MUST be set large segments. In particular, R2 for a SYN segment MUST be set large
enough to provide retransmission of the segment for at least 3 enough to provide retransmission of the segment for at least 3
minutes. The application can close the connection (i.e., give up on minutes. The application can close the connection (i.e., give up on
the open attempt) sooner, of course. the open attempt) sooner, of course.
7.4. TCP Keep-Alives 3.8.4. TCP Keep-Alives
Implementors MAY include "keep-alives" in their TCP implementations, Implementors MAY include "keep-alives" in their TCP implementations,
although this practice is not universally accepted. If keep-alives although this practice is not universally accepted. If keep-alives
are included, the application MUST be able to turn them on or off for are included, the application MUST be able to turn them on or off for
each TCP connection, and they MUST default to off. each TCP connection, and they MUST default to off.
Keep-alive packets MUST only be sent when no data or acknowledgement Keep-alive packets MUST only be sent when no data or acknowledgement
packets have been received for the connection within an interval. packets have been received for the connection within an interval.
This interval MUST be configurable and MUST default to no less than This interval MUST be configurable and MUST default to no less than
two hours. two hours.
skipping to change at page 40, line 12 skipping to change at page 40, line 12
It is extremely important to remember that ACK segments that contain It is extremely important to remember that ACK segments that contain
no data are not reliably transmitted by TCP. Consequently, if a no data are not reliably transmitted by TCP. Consequently, if a
keep-alive mechanism is implemented it MUST NOT interpret failure to keep-alive mechanism is implemented it MUST NOT interpret failure to
respond to any specific probe as a dead connection. respond to any specific probe as a dead connection.
An implementation SHOULD send a keep-alive segment with no data; An implementation SHOULD send a keep-alive segment with no data;
however, it MAY be configurable to send a keep-alive segment however, it MAY be configurable to send a keep-alive segment
containing one garbage octet, for compatibility with erroneous TCP containing one garbage octet, for compatibility with erroneous TCP
implementations. implementations.
7.5. The Communication of Urgent Information 3.8.5. The Communication of Urgent Information
As a result of implementation differences and middlebox interactions, As a result of implementation differences and middlebox interactions,
new applications SHOULD NOT employ the TCP urgent mechanism. new applications SHOULD NOT employ the TCP urgent mechanism.
However, TCP implementations MUST still include support for the However, TCP implementations MUST still include support for the
urgent mechanism. Details can be found in RFC 6093 [28]. urgent mechanism. Details can be found in RFC 6093 [28].
The objective of the TCP urgent mechanism is to allow the sending The objective of the TCP urgent mechanism is to allow the sending
user to stimulate the receiving user to accept some urgent data and user to stimulate the receiving user to accept some urgent data and
to permit the receiving TCP to indicate to the receiving user when to permit the receiving TCP to indicate to the receiving user when
all the currently known urgent data has been received by the user. all the currently known urgent data has been received by the user.
skipping to change at page 41, line 5 skipping to change at page 41, line 5
A TCP MUST support a sequence of urgent data of any length. [14] A TCP MUST support a sequence of urgent data of any length. [14]
A TCP MUST inform the application layer asynchronously whenever it A TCP MUST inform the application layer asynchronously whenever it
receives an Urgent pointer and there was previously no pending urgent receives an Urgent pointer and there was previously no pending urgent
data, or whenvever the Urgent pointer advances in the data stream. data, or whenvever the Urgent pointer advances in the data stream.
There MUST be a way for the application to learn how much urgent data There MUST be a way for the application to learn how much urgent data
remains to be read from the connection, or at least to determine remains to be read from the connection, or at least to determine
whether or not more urgent data remains to be read. [14] whether or not more urgent data remains to be read. [14]
7.6. Managing the Window 3.8.6. Managing the Window
The window sent in each segment indicates the range of sequence The window sent in each segment indicates the range of sequence
numbers the sender of the window (the data receiver) is currently numbers the sender of the window (the data receiver) is currently
prepared to accept. There is an assumption that this is related to prepared to accept. There is an assumption that this is related to
the currently available data buffer space available for this the currently available data buffer space available for this
connection. connection.
The sending TCP packages the data to be transmitted into segments The sending TCP packages the data to be transmitted into segments
which fit the current window, and may repackage segments on the which fit the current window, and may repackage segments on the
retransmission queue. Such repackaging is not required, but may be retransmission queue. Such repackaging is not required, but may be
skipping to change at page 41, line 45 skipping to change at page 41, line 45
The mechanisms provided allow a TCP to advertise a large window and The mechanisms provided allow a TCP to advertise a large window and
to subsequently advertise a much smaller window without having to subsequently advertise a much smaller window without having
accepted that much data. This, so called "shrinking the window," is accepted that much data. This, so called "shrinking the window," is
strongly discouraged. The robustness principle dictates that TCPs strongly discouraged. The robustness principle dictates that TCPs
will not shrink the window themselves, but will be prepared for such will not shrink the window themselves, but will be prepared for such
behavior on the part of other TCPs. behavior on the part of other TCPs.
A TCP receiver SHOULD NOT shrink the window, i.e., move the right A TCP receiver SHOULD NOT shrink the window, i.e., move the right
window edge to the left. However, a sending TCP MUST be robust window edge to the left. However, a sending TCP MUST be robust
against window shrinking, which may cause the "useable window" (see against window shrinking, which may cause the "useable window" (see
Section 7.6.2.1) to become negative. Section 3.8.6.2.1) to become negative.
If this happens, the sender SHOULD NOT send new data, but SHOULD If this happens, the sender SHOULD NOT send new data, but SHOULD
retransmit normally the old unacknowledged data between SND.UNA and retransmit normally the old unacknowledged data between SND.UNA and
SND.UNA+SND.WND. The sender MAY also retransmit old data beyond SND.UNA+SND.WND. The sender MAY also retransmit old data beyond
SND.UNA+SND.WND, but SHOULD NOT time out the connection if data SND.UNA+SND.WND, but SHOULD NOT time out the connection if data
beyond the right window edge is not acknowledged. If the window beyond the right window edge is not acknowledged. If the window
shrinks to zero, the TCP MUST probe it in the standard way (described shrinks to zero, the TCP MUST probe it in the standard way (described
below). below).
7.6.1. Zero Window Probing 3.8.6.1. Zero Window Probing
The sending TCP must be prepared to accept from the user and send at The sending TCP must be prepared to accept from the user and send at
least one octet of new data even if the send window is zero. The least one octet of new data even if the send window is zero. The
sending TCP must regularly retransmit to the receiving TCP even when sending TCP must regularly retransmit to the receiving TCP even when
the window is zero, in order to "probe" the window. Two minutes is the window is zero, in order to "probe" the window. Two minutes is
recommended for the retransmission interval when the window is zero. recommended for the retransmission interval when the window is zero.
This retransmission is essential to guarantee that when either TCP This retransmission is essential to guarantee that when either TCP
has a zero window the re-opening of the window will be reliably has a zero window the re-opening of the window will be reliably
reported to the other. This is referred to as Zero-Window Probing reported to the other. This is referred to as Zero-Window Probing
(ZWP) in other documents. (ZWP) in other documents.
skipping to change at page 42, line 33 skipping to change at page 42, line 33
response to the probe segments, the sending TCP MUST allow the response to the probe segments, the sending TCP MUST allow the
connection to stay open. This enables TCP to function in scenarios connection to stay open. This enables TCP to function in scenarios
such as the "printer ran out of paper" situation described in such as the "printer ran out of paper" situation described in
Section 4.2.2.17 of RFC1122. The behavior is subject to the Section 4.2.2.17 of RFC1122. The behavior is subject to the
implementation's resource management concerns, as noted in [30]. implementation's resource management concerns, as noted in [30].
When the receiving TCP has a zero window and a segment arrives it When the receiving TCP has a zero window and a segment arrives it
must still send an acknowledgment showing its next expected sequence must still send an acknowledgment showing its next expected sequence
number and current window (zero). number and current window (zero).
7.6.2. Silly Window Syndrome Avoidance 3.8.6.2. Silly Window Syndrome Avoidance
The "Silly Window Syndrome" (SWS) is a stable pattern of small The "Silly Window Syndrome" (SWS) is a stable pattern of small
incremental window movements resulting in extremely poor TCP incremental window movements resulting in extremely poor TCP
performance. Algorithms to avoid SWS are described below for both performance. Algorithms to avoid SWS are described below for both
the sending side and the receiving side. RFC 1122 contains more the sending side and the receiving side. RFC 1122 contains more
detailed discussion of the SWS problem. Note that the Nagle detailed discussion of the SWS problem. Note that the Nagle
algorithm and the sender SWS avoidance algorithm play complementary algorithm and the sender SWS avoidance algorithm play complementary
roles in improving performance. The Nagle algorithm discourages roles in improving performance. The Nagle algorithm discourages
sending tiny segments when the data to be sent increases in small sending tiny segments when the data to be sent increases in small
increments, while the SWS avoidance algorithm discourages small increments, while the SWS avoidance algorithm discourages small
segments resulting from the right window edge advancing in small segments resulting from the right window edge advancing in small
increments. increments.
7.6.2.1. Sender's Algorithm - When to Send Data 3.8.6.2.1. Sender's Algorithm - When to Send Data
A TCP MUST include a SWS avoidance algorithm in the sender. A TCP MUST include a SWS avoidance algorithm in the sender.
A TCP SHOULD implement the Nagle Algorithm to coalesce short A TCP SHOULD implement the Nagle Algorithm to coalesce short
segments. However, there MUST be a way for an application to disable segments. However, there MUST be a way for an application to disable
the Nagle algorithm on an individual connection. In all cases, the Nagle algorithm on an individual connection. In all cases,
sending data is also subject to the limitation imposed by the Slow sending data is also subject to the limitation imposed by the Slow
Start algorithm. Start algorithm.
The sender's SWS avoidance algorithm is more difficult than the The sender's SWS avoidance algorithm is more difficult than the
skipping to change at page 44, line 8 skipping to change at page 44, line 8
[SND.NXT = SND.UNA and] [SND.NXT = SND.UNA and]
min(D.U) >= Fs * Max(SND.WND); min(D.U) >= Fs * Max(SND.WND);
(4) or if data is PUSHed and the override timeout occurs. (4) or if data is PUSHed and the override timeout occurs.
Here Fs is a fraction whose recommended value is 1/2. The override Here Fs is a fraction whose recommended value is 1/2. The override
timeout should be in the range 0.1 - 1.0 seconds. It may be timeout should be in the range 0.1 - 1.0 seconds. It may be
convenient to combine this timer with the timer used to probe zero convenient to combine this timer with the timer used to probe zero
windows (Section Section 7.6.1). windows (Section Section 3.8.6.1).
7.6.2.2. Receiver's Algorithm - When to Send a Window Update 3.8.6.2.2. Receiver's Algorithm - When to Send a Window Update
A TCP MUST include a SWS avoidance algorithm in the receiver. A TCP MUST include a SWS avoidance algorithm in the receiver.
The receiver's SWS avoidance algorithm determines when the right The receiver's SWS avoidance algorithm determines when the right
window edge may be advanced; this is customarily known as "updating window edge may be advanced; this is customarily known as "updating
the window". This algorithm combines with the delayed ACK algorithm the window". This algorithm combines with the delayed ACK algorithm
(see Section 7.6.3) to determine when an ACK segment containing the (see Section 3.8.6.3) to determine when an ACK segment containing the
current window will really be sent to the receiver. current window will really be sent to the receiver.
The solution to receiver SWS is to avoid advancing the right window The solution to receiver SWS is to avoid advancing the right window
edge RCV.NXT+RCV.WND in small increments, even if data is received edge RCV.NXT+RCV.WND in small increments, even if data is received
from the network in small segments. from the network in small segments.
Suppose the total receive buffer space is RCV.BUFF. At any given Suppose the total receive buffer space is RCV.BUFF. At any given
moment, RCV.USER octets of this total may be tied up with data that moment, RCV.USER octets of this total may be tied up with data that
has been received and acknowledged but which the user process has not has been received and acknowledged but which the user process has not
yet consumed. When the connection is quiescent, RCV.WND = RCV.BUFF yet consumed. When the connection is quiescent, RCV.WND = RCV.BUFF
skipping to change at page 45, line 11 skipping to change at page 45, line 11
The suggested SWS avoidance algorithm for the receiver is to keep The suggested SWS avoidance algorithm for the receiver is to keep
RCV.NXT+RCV.WND fixed until the reduction satisfies: RCV.NXT+RCV.WND fixed until the reduction satisfies:
RCV.BUFF - RCV.USER - RCV.WND >= RCV.BUFF - RCV.USER - RCV.WND >=
min( Fr * RCV.BUFF, Eff.snd.MSS ) min( Fr * RCV.BUFF, Eff.snd.MSS )
where Fr is a fraction whose recommended value is 1/2, and where Fr is a fraction whose recommended value is 1/2, and
Eff.snd.MSS is the effective send MSS for the connection (see Eff.snd.MSS is the effective send MSS for the connection (see
Section 6.1). When the inequality is satisfied, RCV.WND is set to Section 3.7.1). When the inequality is satisfied, RCV.WND is set to
RCV.BUFF-RCV.USER. RCV.BUFF-RCV.USER.
Note that the general effect of this algorithm is to advance RCV.WND Note that the general effect of this algorithm is to advance RCV.WND
in increments of Eff.snd.MSS (for realistic receive buffers: in increments of Eff.snd.MSS (for realistic receive buffers:
Eff.snd.MSS < RCV.BUFF/2). Note also that the receiver must use its Eff.snd.MSS < RCV.BUFF/2). Note also that the receiver must use its
own Eff.snd.MSS, assuming it is the same as the sender's. own Eff.snd.MSS, assuming it is the same as the sender's.
7.6.3. Delayed Acknowledgements - When to Send an ACK Segment 3.8.6.3. Delayed Acknowledgements - When to Send an ACK Segment
A host that is receiving a stream of TCP data segments can increase A host that is receiving a stream of TCP data segments can increase
efficiency in both the Internet and the hosts by sending fewer than efficiency in both the Internet and the hosts by sending fewer than
one ACK (acknowledgment) segment per data segment received; this is one ACK (acknowledgment) segment per data segment received; this is
known as a "delayed ACK". known as a "delayed ACK".
A TCP SHOULD implement a delayed ACK, but an ACK should not be A TCP SHOULD implement a delayed ACK, but an ACK should not be
excessively delayed; in particular, the delay MUST be less than 0.5 excessively delayed; in particular, the delay MUST be less than 0.5
seconds, and in a stream of full-sized segments there SHOULD be an seconds, and in a stream of full-sized segments there SHOULD be an
ACK for at least every second segment. Excessive delays on ACK's can ACK for at least every second segment. Excessive delays on ACK's can
disturb the round-trip timing and packet "clocking" algorithms. disturb the round-trip timing and packet "clocking" algorithms.
8. Interfaces 3.9. Interfaces
There are of course two interfaces of concern: the user/TCP interface There are of course two interfaces of concern: the user/TCP interface
and the TCP/lower-level interface. We have a fairly elaborate model and the TCP/lower-level interface. We have a fairly elaborate model
of the user/TCP interface, but the interface to the lower level of the user/TCP interface, but the interface to the lower level
protocol module is left unspecified here, since it will be specified protocol module is left unspecified here, since it will be specified
in detail by the specification of the lower level protocol. For the in detail by the specification of the lower level protocol. For the
case that the lower level is IP we note some of the parameter values case that the lower level is IP we note some of the parameter values
that TCPs might use. that TCPs might use.
8.1. User/TCP Interface 3.9.1. User/TCP Interface
The following functional description of user commands to the TCP is, The following functional description of user commands to the TCP is,
at best, fictional, since every operating system will have different at best, fictional, since every operating system will have different
facilities. Consequently, we must warn readers that different TCP facilities. Consequently, we must warn readers that different TCP
implementations may have different user interfaces. However, all implementations may have different user interfaces. However, all
TCPs must provide a certain minimum set of services to guarantee that TCPs must provide a certain minimum set of services to guarantee that
all TCP implementations can support the same protocol hierarchy. all TCP implementations can support the same protocol hierarchy.
This section specifies the functional interfaces required of all TCP This section specifies the functional interfaces required of all TCP
implementations. implementations.
skipping to change at page 48, line 51 skipping to change at page 48, line 51
might be one way for application data to be included in SYN might be one way for application data to be included in SYN
segments. If the calling process is not authorized to use this segments. If the calling process is not authorized to use this
connection, an error is returned. connection, an error is returned.
If the PUSH flag is set, the data must be transmitted promptly If the PUSH flag is set, the data must be transmitted promptly
to the receiver, and the PUSH bit will be set in the last TCP to the receiver, and the PUSH bit will be set in the last TCP
segment created from the buffer. If the PUSH flag is not set, segment created from the buffer. If the PUSH flag is not set,
the data may be combined with data from subsequent SENDs for the data may be combined with data from subsequent SENDs for
transmission efficiency. Note that when the Nagle algorithm is transmission efficiency. Note that when the Nagle algorithm is
in use, TCP may be buffer the data before sending, without in use, TCP may be buffer the data before sending, without
regard to the PUSH flag (see Section 6.4). regard to the PUSH flag (see Section 3.7.4).
New applications SHOULD NOT set the URGENT flag [28] due to New applications SHOULD NOT set the URGENT flag [28] due to
implementation differences and middlebox issues. implementation differences and middlebox issues.
If the URGENT flag is set, segments sent to the destination TCP If the URGENT flag is set, segments sent to the destination TCP
will have the urgent pointer set. The receiving TCP will will have the urgent pointer set. The receiving TCP will
signal the urgent condition to the receiving process if the signal the urgent condition to the receiving process if the
urgent pointer indicates that data preceding the urgent pointer urgent pointer indicates that data preceding the urgent pointer
has not been consumed by the receiving process. The purpose of has not been consumed by the receiving process. The purpose of
urgent is to stimulate the receiver to process the urgent data urgent is to stimulate the receiver to process the urgent data
skipping to change at page 53, line 18 skipping to change at page 53, line 18
conditions to the application. Generically, we assume this conditions to the application. Generically, we assume this
takes the form of an application-supplied ERROR_REPORT routine takes the form of an application-supplied ERROR_REPORT routine
that may be upcalled asynchronously from the transport layer: that may be upcalled asynchronously from the transport layer:
ERROR_REPORT(local connection name, reason, subreason) ERROR_REPORT(local connection name, reason, subreason)
The precise encoding of the reason and subreason parameters is The precise encoding of the reason and subreason parameters is
not specified here. However, the conditions that are reported not specified here. However, the conditions that are reported
asynchronously to the application MUST include: asynchronously to the application MUST include:
* ICMP error message arrived (see Section 8.2.2) * ICMP error message arrived (see Section 3.9.2.2)
* Excessive retransmissions (see Section 7.3) * Excessive retransmissions (see Section 3.8.3)
* Urgent pointer advance (see Section 7.5). * Urgent pointer advance (see Section 3.8.5).
However, an application program that does not want to receive However, an application program that does not want to receive
such ERROR_REPORT calls SHOULD be able to effectively disable such ERROR_REPORT calls SHOULD be able to effectively disable
these calls. these calls.
Set Differentiated Services Field (IPv4 TOS or IPv6 Traffic Class) Set Differentiated Services Field (IPv4 TOS or IPv6 Traffic Class)
The application layer MUST be able to specify the The application layer MUST be able to specify the
Differentiated Services field for segments that are sent on a Differentiated Services field for segments that are sent on a
connection. The Differentiated Services field includes the connection. The Differentiated Services field includes the
skipping to change at page 53, line 48 skipping to change at page 53, line 48
connection. connection.
The Differentiated Services field will be specified The Differentiated Services field will be specified
independently in each direction on the connection, so that the independently in each direction on the connection, so that the
receiver application will specify the Differentiated Services receiver application will specify the Differentiated Services
field used for ACK segments. field used for ACK segments.
TCP MAY pass the most recently received Differentiated Services TCP MAY pass the most recently received Differentiated Services
field up to the application. field up to the application.
8.2. TCP/Lower-Level Interface 3.9.2. TCP/Lower-Level Interface
The TCP calls on a lower level protocol module to actually send and The TCP calls on a lower level protocol module to actually send and
receive information over a network. The two current standard receive information over a network. The two current standard
Internet Protocol (IP) versions layered below TCP are IPv4 [1] and Internet Protocol (IP) versions layered below TCP are IPv4 [1] and
IPv6 [5]. IPv6 [5].
If the lower level protocol is IPv4 it provides arguments for a type If the lower level protocol is IPv4 it provides arguments for a type
of service (used within the Differentiated Services field) and for a of service (used within the Differentiated Services field) and for a
time to live. TCP uses the following settings for these parameters: time to live. TCP uses the following settings for these parameters:
skipping to change at page 54, line 45 skipping to change at page 54, line 45
Any lower level protocol will have to provide the source address, Any lower level protocol will have to provide the source address,
destination address, and protocol fields, and some way to determine destination address, and protocol fields, and some way to determine
the "TCP length", both to provide the functional equivalent service the "TCP length", both to provide the functional equivalent service
of IP and to be used in the TCP checksum. of IP and to be used in the TCP checksum.
When received options are passed up to TCP from the IP layer, TCP When received options are passed up to TCP from the IP layer, TCP
MUST ignore options that it does not understand. MUST ignore options that it does not understand.
A TCP MAY support the Time Stamp and Record Route options. A TCP MAY support the Time Stamp and Record Route options.
8.2.1. Source Routing 3.9.2.1. Source Routing
If the lower level is IP (or other protocol that provides this If the lower level is IP (or other protocol that provides this
feature) and source routing is used, the interface must allow the feature) and source routing is used, the interface must allow the
route information to be communicated. This is especially important route information to be communicated. This is especially important
so that the source and destination addresses used in the TCP checksum so that the source and destination addresses used in the TCP checksum
be the originating source and ultimate destination. It is also be the originating source and ultimate destination. It is also
important to preserve the return route to answer connection requests. important to preserve the return route to answer connection requests.
An application MUST be able to specify a source route when it An application MUST be able to specify a source route when it
actively opens a TCP connection, and this MUST take precedence over a actively opens a TCP connection, and this MUST take precedence over a
source route received in a datagram. source route received in a datagram.
When a TCP connection is OPENed passively and a packet arrives with a When a TCP connection is OPENed passively and a packet arrives with a
completed IP Source Route option (containing a return route), TCP completed IP Source Route option (containing a return route), TCP
MUST save the return route and use it for all segments sent on this MUST save the return route and use it for all segments sent on this
connection. If a different source route arrives in a later segment, connection. If a different source route arrives in a later segment,
the later definition SHOULD override the earlier one. the later definition SHOULD override the earlier one.
8.2.2. ICMP Messages 3.9.2.2. ICMP Messages
TCP MUST act on an ICMP error message passed up from the IP layer, TCP MUST act on an ICMP error message passed up from the IP layer,
directing it to the connection that created the error. The necessary directing it to the connection that created the error. The necessary
demultiplexing information can be found in the IP header contained demultiplexing information can be found in the IP header contained
within the ICMP message. within the ICMP message.
This applies to ICMPv6 in addition to IPv4 ICMP. This applies to ICMPv6 in addition to IPv4 ICMP.
[22] contains discussion of specific ICMP and ICMPv6 messages [22] contains discussion of specific ICMP and ICMPv6 messages
classified as either "soft" or "hard" errors that may bear different classified as either "soft" or "hard" errors that may bear different
skipping to change at page 56, line 9 skipping to change at page 56, line 9
For ICMP these include Destination Unreachable -- codes 2-4"> For ICMP these include Destination Unreachable -- codes 2-4">
These are hard error conditions, so TCP SHOULD abort the These are hard error conditions, so TCP SHOULD abort the
connection. [22] notes that some implementations do not abort connection. [22] notes that some implementations do not abort
connections when an ICMP hard error is received for a connection connections when an ICMP hard error is received for a connection
that is in any of the synchronized states. that is in any of the synchronized states.
Note that [22] section 4 describes widespread implementation behavior Note that [22] section 4 describes widespread implementation behavior
that treats soft errors as hard errors during connection that treats soft errors as hard errors during connection
establishment. establishment.
8.2.3. Remote Address Validation 3.9.2.3. Remote Address Validation
RFC 1122 requires addresses to be validated in incoming SYN packets: RFC 1122 requires addresses to be validated in incoming SYN packets:
An incoming SYN with an invalid source address must be ignored An incoming SYN with an invalid source address must be ignored
either by TCP or by the IP layer (see Section 3.2.1.3 of [14]). either by TCP or by the IP layer (see Section 3.2.1.3 of [14]).
A TCP implementation MUST silently discard an incoming SYN segment A TCP implementation MUST silently discard an incoming SYN segment
that is addressed to a broadcast or multicast address. that is addressed to a broadcast or multicast address.
This prevents connection state and replies from being erroneously This prevents connection state and replies from being erroneously
generated, and implementers should note that this guidance is generated, and implementers should note that this guidance is
applicable to all incoming segments, not just SYNs, as specifically applicable to all incoming segments, not just SYNs, as specifically
indicated in RFC 1122. indicated in RFC 1122.
8.3. Event Processing 3.10. Event Processing
The processing depicted in this section is an example of one possible The processing depicted in this section is an example of one possible
implementation. Other implementations may have slightly different implementation. Other implementations may have slightly different
processing sequences, but they should differ from those in this processing sequences, but they should differ from those in this
section only in detail, not in substance. section only in detail, not in substance.
The activity of the TCP can be characterized as responding to events. The activity of the TCP can be characterized as responding to events.
The events that occur can be cast into three categories: user calls, The events that occur can be cast into three categories: user calls,
arriving segments, and timeouts. This section describes the arriving segments, and timeouts. This section describes the
processing the TCP does in response to each of the events. In many processing the TCP does in response to each of the events. In many
skipping to change at page 74, line 33 skipping to change at page 74, line 33
If the SYN bit is set in these synchronized states, it If the SYN bit is set in these synchronized states, it
may be either a legitimate new connection attempt (e.g. may be either a legitimate new connection attempt (e.g.
in the case of TIME-WAIT), an error where the connection in the case of TIME-WAIT), an error where the connection
should be reset, or the result of an attack attempt, as should be reset, or the result of an attack attempt, as
described in RFC 5961 [27]. For the TIME-WAIT state, new described in RFC 5961 [27]. For the TIME-WAIT state, new
connections can be accepted if the timestamp option is connections can be accepted if the timestamp option is
used and meets expectations (per [29]). For all other used and meets expectations (per [29]). For all other
caess, RFC 5961 provides a mitigation that SHOULD be caess, RFC 5961 provides a mitigation that SHOULD be
implemented, though there are alternatives (see implemented, though there are alternatives (see
Section 11). RFC 5961 recommends that in these Section 6). RFC 5961 recommends that in these
synchronized states, if the SYN bit is set, irrespective synchronized states, if the SYN bit is set, irrespective
of the sequence number, TCP MUST send a "challenge ACK" of the sequence number, TCP MUST send a "challenge ACK"
to the remote peer: to the remote peer:
<SEQ=SND.NXT><ACK=RCV.NXT><CTL=ACK> <SEQ=SND.NXT><ACK=RCV.NXT><CTL=ACK>
After sending the acknowledgement, TCP MUST drop the After sending the acknowledgement, TCP MUST drop the
unacceptable segment and stop processing further. Note unacceptable segment and stop processing further. Note
that RFC 5961 and Errata ID 4772 contain additional ACK that RFC 5961 and Errata ID 4772 contain additional ACK
throttling notes for an implementation. throttling notes for an implementation.
skipping to change at page 78, line 15 skipping to change at page 78, line 15
Once the TCP takes responsibility for the data it Once the TCP takes responsibility for the data it
advances RCV.NXT over the data accepted, and adjusts advances RCV.NXT over the data accepted, and adjusts
RCV.WND as appropriate to the current buffer RCV.WND as appropriate to the current buffer
availability. The total of RCV.NXT and RCV.WND should availability. The total of RCV.NXT and RCV.WND should
not be reduced. not be reduced.
A TCP MAY send an ACK segment acknowledging RCV.NXT when A TCP MAY send an ACK segment acknowledging RCV.NXT when
a valid segment arrives that is in the window but not at a valid segment arrives that is in the window but not at
the left window edge. the left window edge.
Please note the window management suggestions in section Please note the window management suggestions in
3.7. Section 3.8.
Send an acknowledgment of the form: Send an acknowledgment of the form:
<SEQ=SND.NXT><ACK=RCV.NXT><CTL=ACK> <SEQ=SND.NXT><ACK=RCV.NXT><CTL=ACK>
This acknowledgment should be piggybacked on a segment This acknowledgment should be piggybacked on a segment
being transmitted if possible without incurring undue being transmitted if possible without incurring undue
delay. delay.
CLOSE-WAIT STATE CLOSE-WAIT STATE
skipping to change at page 81, line 5 skipping to change at page 81, line 5
For any state if the retransmission timeout expires on a For any state if the retransmission timeout expires on a
segment in the retransmission queue, send the segment at the segment in the retransmission queue, send the segment at the
front of the retransmission queue again, reinitialize the front of the retransmission queue again, reinitialize the
retransmission timer, and return. retransmission timer, and return.
TIME-WAIT TIMEOUT TIME-WAIT TIMEOUT
If the time-wait timeout expires on a connection delete the If the time-wait timeout expires on a connection delete the
TCB, enter the CLOSED state and return. TCB, enter the CLOSED state and return.
8.4. Glossary 3.11. Glossary
1822 BBN Report 1822, "The Specification of the Interconnection of 1822 BBN Report 1822, "The Specification of the Interconnection of
a Host and an IMP". The specification of interface between a a Host and an IMP". The specification of interface between a
host and the ARPANET. host and the ARPANET.
ACK ACK
A control bit (acknowledge) occupying no sequence space, A control bit (acknowledge) occupying no sequence space,
which indicates that the acknowledgment field of this segment which indicates that the acknowledgment field of this segment
specifies the next sequence number the sender of this segment specifies the next sequence number the sender of this segment
is expecting to receive, hence acknowledging receipt of all is expecting to receive, hence acknowledging receipt of all
skipping to change at page 86, line 41 skipping to change at page 86, line 41
urgent processing as long as there is data to be consumed urgent processing as long as there is data to be consumed
with sequence numbers less than the value indicated in the with sequence numbers less than the value indicated in the
urgent pointer. urgent pointer.
urgent pointer urgent pointer
A control field meaningful only when the URG bit is on. This A control field meaningful only when the URG bit is on. This
field communicates the value of the urgent pointer which field communicates the value of the urgent pointer which
indicates the data octet associated with the sending user's indicates the data octet associated with the sending user's
urgent call. urgent call.
9. Changes from RFC 793 4. Changes from RFC 793
This document obsoletes RFC 793 as well as RFC 6093 and 6528, which This document obsoletes RFC 793 as well as RFC 6093 and 6528, which
updated 793. In all cases, only the normative protocol specification updated 793. In all cases, only the normative protocol specification
and requirements have been incorporated into this document, and the and requirements have been incorporated into this document, and the
informational text with background and rationale has not been carried informational text with background and rationale has not been carried
in. The informational content of those documents is still valuable in. The informational content of those documents is still valuable
in learning about and understanding TCP, and they are valid in learning about and understanding TCP, and they are valid
Informational references, even though their normative content has Informational references, even though their normative content has
been incorporated into this document. been incorporated into this document.
skipping to change at page 91, line 5 skipping to change at page 91, line 5
793 update unless TCPM consensus changes with regard to scope are: 793 update unless TCPM consensus changes with regard to scope are:
1. look at Tony Sabatini suggestion for describing DO field 1. look at Tony Sabatini suggestion for describing DO field
2. per discussion with Joe Touch (TAPS list, 6/20/2015), the 2. per discussion with Joe Touch (TAPS list, 6/20/2015), the
description of the API could be revisited description of the API could be revisited
Early in the process of updating RFC 793, Scott Brim mentioned that Early in the process of updating RFC 793, Scott Brim mentioned that
this should include a PERPASS/privacy review. This may be something this should include a PERPASS/privacy review. This may be something
for the chairs or AD to request during WGLC or IETF LC. for the chairs or AD to request during WGLC or IETF LC.
10. IANA Considerations 5. IANA Considerations
This memo includes no request to IANA. Existing IANA registries for This memo includes no request to IANA. Existing IANA registries for
TCP parameters are sufficient. TCP parameters are sufficient.
TODO: check whether entries pointing to 793 and other documents TODO: check whether entries pointing to 793 and other documents
obsoleted by this one should be updated to point to this one instead. obsoleted by this one should be updated to point to this one instead.
11. Security and Privacy Considerations 6. Security and Privacy Considerations
The TCP design includes only rudimentary security features that The TCP design includes only rudimentary security features that
improve the robustness and reliability of connections and application improve the robustness and reliability of connections and application
data transfer, but there are no built-in capabilities to support any data transfer, but there are no built-in capabilities to support any
form of privacy, authentication, or other typical security functions. form of privacy, authentication, or other typical security functions.
Applications typically utilize lower-layer (e.g. IPsec) and upper- Applications typically utilize lower-layer (e.g. IPsec) and upper-
layer (e.g. TLS) protocols to provide security and privacy for TCP layer (e.g. TLS) protocols to provide security and privacy for TCP
connections and application data carried in TCP. TCP options are connections and application data carried in TCP. TCP options are
available as well, to support some security capabilities. available as well, to support some security capabilities.
skipping to change at page 92, line 14 skipping to change at page 92, line 14
congestion control specifications include mechanisms like Appropriate congestion control specifications include mechanisms like Appropriate
Byte Counting (ABC) that act as mitigations to these attacks. Byte Counting (ABC) that act as mitigations to these attacks.
Other attacks are focused on exhausting the resources of a TCP Other attacks are focused on exhausting the resources of a TCP
server. Examples include SYN flooding [19] or wasting resources on server. Examples include SYN flooding [19] or wasting resources on
non-progressing connections [30]. Operating systems commonly non-progressing connections [30]. Operating systems commonly
implement mitigations for these attacks. Some common defenses also implement mitigations for these attacks. Some common defenses also
utilize proxies, stateful firewalls, and other technologies outside utilize proxies, stateful firewalls, and other technologies outside
of the end-host TCP implementation. of the end-host TCP implementation.
12. Acknowledgements 7. Acknowledgements
This document is largely a revision of RFC 793, which Jon Postel was This document is largely a revision of RFC 793, which Jon Postel was
the editor of. Due to his excellent work, it was able to last for the editor of. Due to his excellent work, it was able to last for
three decades before we felt the need to revise it. three decades before we felt the need to revise it.
Andre Oppermann was a contributor and helped to edit the first Andre Oppermann was a contributor and helped to edit the first
revision of this document. revision of this document.
We are thankful for the assistance of the IETF TCPM working group We are thankful for the assistance of the IETF TCPM working group
chairs: chairs:
skipping to change at page 92, line 44 skipping to change at page 92, line 44
Hagen Paul Pfeifer, Anthony Sabatini, Joe Touch, Reji Varghese, Lloyd Hagen Paul Pfeifer, Anthony Sabatini, Joe Touch, Reji Varghese, Lloyd
Wood, and Alex Zimmermann. Joe Touch provided help in clarifying the Wood, and Alex Zimmermann. Joe Touch provided help in clarifying the
description of segment size parameters and PMTUD/PLPMTUD description of segment size parameters and PMTUD/PLPMTUD
recommendations. recommendations.
This document includes content from errata that were reported by This document includes content from errata that were reported by
(listed chronologically): Yin Shuming, Bob Braden, Morris M. Keesan, (listed chronologically): Yin Shuming, Bob Braden, Morris M. Keesan,
Pei-chun Cheng, Constantin Hagemeier, Vishwas Manral, Mykyta Pei-chun Cheng, Constantin Hagemeier, Vishwas Manral, Mykyta
Yevstifeyev, EungJun Yi, Botong Huang. Yevstifeyev, EungJun Yi, Botong Huang.
13. References 8. References
13.1. Normative References 8.1. Normative References
[1] Postel, J., "Internet Protocol", STD 5, RFC 791, [1] Postel, J., "Internet Protocol", STD 5, RFC 791,
DOI 10.17487/RFC0791, September 1981, DOI 10.17487/RFC0791, September 1981,
<https://www.rfc-editor.org/info/rfc791>. <https://www.rfc-editor.org/info/rfc791>.
[2] Mogul, J. and S. Deering, "Path MTU discovery", RFC 1191, [2] Mogul, J. and S. Deering, "Path MTU discovery", RFC 1191,
DOI 10.17487/RFC1191, November 1990, DOI 10.17487/RFC1191, November 1990,
<https://www.rfc-editor.org/info/rfc1191>. <https://www.rfc-editor.org/info/rfc1191>.
[3] McCann, J., Deering, S., and J. Mogul, "Path MTU Discovery [3] McCann, J., Deering, S., and J. Mogul, "Path MTU Discovery
skipping to change at page 94, line 5 skipping to change at page 94, line 5
[10] Paxson, V., Allman, M., Chu, J., and M. Sargent, [10] Paxson, V., Allman, M., Chu, J., and M. Sargent,
"Computing TCP's Retransmission Timer", RFC 6298, "Computing TCP's Retransmission Timer", RFC 6298,
DOI 10.17487/RFC6298, June 2011, DOI 10.17487/RFC6298, June 2011,
<https://www.rfc-editor.org/info/rfc6298>. <https://www.rfc-editor.org/info/rfc6298>.
[11] Gont, F., "Deprecation of ICMP Source Quench Messages", [11] Gont, F., "Deprecation of ICMP Source Quench Messages",
RFC 6633, DOI 10.17487/RFC6633, May 2012, RFC 6633, DOI 10.17487/RFC6633, May 2012,
<https://www.rfc-editor.org/info/rfc6633>. <https://www.rfc-editor.org/info/rfc6633>.
13.2. Informative References 8.2. Informative References
[12] Postel, J., "Transmission Control Protocol", STD 7, [12] Postel, J., "Transmission Control Protocol", STD 7,
RFC 793, DOI 10.17487/RFC0793, September 1981, RFC 793, DOI 10.17487/RFC0793, September 1981,
<https://www.rfc-editor.org/info/rfc793>. <https://www.rfc-editor.org/info/rfc793>.
[13] Nagle, J., "Congestion Control in IP/TCP Internetworks", [13] Nagle, J., "Congestion Control in IP/TCP Internetworks",
RFC 896, DOI 10.17487/RFC0896, January 1984, RFC 896, DOI 10.17487/RFC0896, January 1984,
<https://www.rfc-editor.org/info/rfc896>. <https://www.rfc-editor.org/info/rfc896>.
[14] Braden, R., Ed., "Requirements for Internet Hosts - [14] Braden, R., Ed., "Requirements for Internet Hosts -
 End of changes. 52 change blocks. 
87 lines changed or deleted 80 lines changed or added

This html diff was produced by rfcdiff 1.46. The latest version is available from http://tools.ietf.org/tools/rfcdiff/