draft-ietf-tcpm-rfc793bis-10.txt   draft-ietf-tcpm-rfc793bis-11.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, July 1, 2018 Obsoletes: 793, 879, 2873, 6093, 6429, October 22, 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: January 2, 2019 Expires: April 25, 2019
Transmission Control Protocol Specification Transmission Control Protocol Specification
draft-ietf-tcpm-rfc793bis-10 draft-ietf-tcpm-rfc793bis-11
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 10 skipping to change at page 2, line 10
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on January 2, 2019. This Internet-Draft will expire on April 25, 2019.
Copyright Notice Copyright Notice
Copyright (c) 2018 IETF Trust and the persons identified as the Copyright (c) 2018 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(https://trustee.ietf.org/license-info) in effect on the date of (https://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
skipping to change at page 3, line 20 skipping to change at page 3, line 20
3.8.1. Retransmission Timeout . . . . . . . . . . . . . . . 38 3.8.1. Retransmission Timeout . . . . . . . . . . . . . . . 38
3.8.2. TCP Congestion Control . . . . . . . . . . . . . . . 38 3.8.2. TCP Congestion Control . . . . . . . . . . . . . . . 38
3.8.3. TCP Connection Failures . . . . . . . . . . . . . . . 39 3.8.3. TCP Connection Failures . . . . . . . . . . . . . . . 39
3.8.4. TCP Keep-Alives . . . . . . . . . . . . . . . . . . . 40 3.8.4. TCP Keep-Alives . . . . . . . . . . . . . . . . . . . 40
3.8.5. The Communication of Urgent Information . . . . . . . 40 3.8.5. The Communication of Urgent Information . . . . . . . 40
3.8.6. Managing the Window . . . . . . . . . . . . . . . . . 41 3.8.6. Managing the Window . . . . . . . . . . . . . . . . . 41
3.9. Interfaces . . . . . . . . . . . . . . . . . . . . . . . 45 3.9. Interfaces . . . . . . . . . . . . . . . . . . . . . . . 45
3.9.1. User/TCP Interface . . . . . . . . . . . . . . . . . 46 3.9.1. User/TCP Interface . . . . . . . . . . . . . . . . . 46
3.9.2. TCP/Lower-Level Interface . . . . . . . . . . . . . . 54 3.9.2. TCP/Lower-Level Interface . . . . . . . . . . . . . . 54
3.10. Event Processing . . . . . . . . . . . . . . . . . . . . 56 3.10. Event Processing . . . . . . . . . . . . . . . . . . . . 56
3.11. Glossary . . . . . . . . . . . . . . . . . . . . . . . . 81 3.11. Glossary . . . . . . . . . . . . . . . . . . . . . . . . 82
4. Changes from RFC 793 . . . . . . . . . . . . . . . . . . . . 86 4. Changes from RFC 793 . . . . . . . . . . . . . . . . . . . . 87
5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 91 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 92
6. Security and Privacy Considerations . . . . . . . . . . . . . 91 6. Security and Privacy Considerations . . . . . . . . . . . . . 92
7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 92 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 93
8. References . . . . . . . . . . . . . . . . . . . . . . . . . 93 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 94
8.1. Normative References . . . . . . . . . . . . . . . . . . 93 8.1. Normative References . . . . . . . . . . . . . . . . . . 94
8.2. Informative References . . . . . . . . . . . . . . . . . 94 8.2. Informative References . . . . . . . . . . . . . . . . . 95
Appendix A. Other Implementation Notes . . . . . . . . . . . . . 97 Appendix A. Other Implementation Notes . . . . . . . . . . . . . 98
A.1. IP Security Compartment and Precedence . . . . . . . . . 97 A.1. IP Security Compartment and Precedence . . . . . . . . . 99
A.2. Sequence Number Validation . . . . . . . . . . . . . . . 98 A.2. Sequence Number Validation . . . . . . . . . . . . . . . 99
A.3. Nagle Modification . . . . . . . . . . . . . . . . . . . 98 A.3. Nagle Modification . . . . . . . . . . . . . . . . . . . 99
A.4. Low Water Mark . . . . . . . . . . . . . . . . . . . . . 99 A.4. Low Water Mark . . . . . . . . . . . . . . . . . . . . . 100
Appendix B. TCP Requirement Summary . . . . . . . . . . . . . . 99 Appendix B. TCP Requirement Summary . . . . . . . . . . . . . . 100
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 102 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 104
1. Purpose and Scope 1. Purpose and Scope
In 1981, RFC 793 [12] was released, documenting the Transmission In 1981, RFC 793 [12] was released, documenting the Transmission
Control Protocol (TCP), and replacing earlier specifications for TCP Control Protocol (TCP), and replacing earlier specifications for TCP
that had been published in the past. that had been published in the past.
Since then, TCP has been implemented many times, and has been used as Since then, TCP has been implemented many times, and has been used as
a transport protocol for numerous applications on the Internet. a transport protocol for numerous applications on the Internet.
skipping to change at page 8, line 7 skipping to change at page 8, line 7
FIN: No more data from sender FIN: No more data from sender
Window: 16 bits Window: 16 bits
The number of data octets beginning with the one indicated in the The number of data octets beginning with the one indicated in the
acknowledgment field which the sender of this segment is willing to acknowledgment field which the sender of this segment is willing to
accept. accept.
The window size MUST be treated as an unsigned number, or else The window size MUST be treated as an unsigned number, or else
large window sizes will appear like negative windows and TCP will large window sizes will appear like negative windows and TCP will
now work. It is RECOMMENDED that implementations will reserve now work (MUST-1). It is RECOMMENDED that implementations will
32-bit fields for the send and receive window sizes in the reserve 32-bit fields for the send and receive window sizes in the
connection record and do all window computations with 32 bits. connection record and do all window computations with 32 bits (REC-
1).
Checksum: 16 bits Checksum: 16 bits
The checksum field is the 16 bit one's complement of the one's The checksum field is the 16 bit one's complement of the one's
complement sum of all 16 bit words in the header and text. If a complement sum of all 16 bit words in the header and text. If a
segment contains an odd number of header and text octets to be segment contains an odd number of header and text octets to be
checksummed, the last octet is padded on the right with zeros to checksummed, the last octet is padded on the right with zeros to
form a 16 bit word for checksum purposes. The pad is not form a 16 bit word for checksum purposes. The pad is not
transmitted as part of the segment. While computing the checksum, transmitted as part of the segment. While computing the checksum,
the checksum field itself is replaced with zeros. the checksum field itself is replaced with zeros.
skipping to change at page 9, line 6 skipping to change at page 9, line 6
For IPv6, the pseudo header is contained in section 8.1 of RFC 2460 For IPv6, the pseudo header is contained in section 8.1 of RFC 2460
[5], and contains the IPv6 Source Address and Destination Address, [5], and contains the IPv6 Source Address and Destination Address,
an Upper Layer Packet Length (a 32-bit value otherwise equivalent an Upper Layer Packet Length (a 32-bit value otherwise equivalent
to TCP Length in the IPv4 pseudo header), three bytes of zero- to TCP Length in the IPv4 pseudo header), three bytes of zero-
padding, and a Next Header value (differing from the IPv6 header padding, and a Next Header value (differing from the IPv6 header
value in the case of extension headers present in between IPv6 and value in the case of extension headers present in between IPv6 and
TCP). TCP).
The TCP checksum is never optional. The sender MUST generate it The TCP checksum is never optional. The sender MUST generate it
and the receiver MUST check it. (MUST-2) and the receiver MUST check it (MUST-3).
Urgent Pointer: 16 bits Urgent Pointer: 16 bits
This field communicates the current value of the urgent pointer as This field communicates the current value of the urgent pointer as
a positive offset from the sequence number in this segment. The a positive offset from the sequence number in this segment. The
urgent pointer points to the sequence number of the octet following urgent pointer points to the sequence number of the octet following
the urgent data. This field is only be interpreted in segments the urgent data. This field is only be interpreted in segments
with the URG control bit set. with the URG control bit set.
Options: variable Options: variable
skipping to change at page 9, line 41 skipping to change at page 9, line 41
Note that the list of options may be shorter than the data offset Note that the list of options may be shorter than the data offset
field might imply. The content of the header beyond the End-of- field might imply. The content of the header beyond the End-of-
Option option must be header padding (i.e., zero). Option option must be header padding (i.e., zero).
The list of all currently defined options is managed by IANA [41], The list of all currently defined options is managed by IANA [41],
and each option is defined in other RFCs, as indicated there. That and each option is defined in other RFCs, as indicated there. That
set includes experimental options that can be extended to support set includes experimental options that can be extended to support
multiple concurrent uses [34]. multiple concurrent uses [34].
A given TCP implementation can support any currently defined A given TCP implementation can support any currently defined
options, but the following options MUST be supported (kind options, but the following options MUST be supported (MUST-4) (kind
indicated in octal): indicated in octal):
Kind Length Meaning Kind Length Meaning
---- ------ ------- ---- ------ -------
0 - End of option list. 0 - End of option list.
1 - No-Operation. 1 - No-Operation.
2 4 Maximum Segment Size. 2 4 Maximum Segment Size.
A TCP MUST be able to receive a TCP option in any segment. A TCP MUST be able to receive a TCP option in any segment (MUST-5).
A TCP MUST ignore without error any TCP option it does not A TCP MUST (MUST-6) ignore without error any TCP option it does not
implement, assuming that the option has a length field (all TCP implement, assuming that the option has a length field (all TCP
options except End of option list and No-Operation have length options except End of option list and No-Operation have length
fields). TCP MUST be prepared to handle an illegal option length fields). TCP MUST be prepared to handle an illegal option length
(e.g., zero) without crashing; a suggested procedure is to reset (e.g., zero) without crashing; a suggested procedure is to reset
the connection and log the reason. the connection and log the reason (MUST-7).
Specific Option Definitions Specific Option Definitions
End of Option List End of Option List
+--------+ +--------+
|00000000| |00000000|
+--------+ +--------+
Kind=0 Kind=0
skipping to change at page 18, line 41 skipping to change at page 18, line 41
The recommended ISN generator is based on the combination of a The recommended ISN generator is based on the combination of a
(possibly fictitious) 32 bit clock whose low order bit is incremented (possibly fictitious) 32 bit clock whose low order bit is incremented
roughly every 4 microseconds, and a pseudorandom hash function (PRF). roughly every 4 microseconds, and a pseudorandom hash function (PRF).
The clock component is intended to insure that with a Maximum Segment The clock component is intended to insure that with a Maximum Segment
Lifetime (MSL), generated ISNs will be unique, since it cycles Lifetime (MSL), generated ISNs will be unique, since it cycles
approximately every 4.55 hours, which is much longer than the MSL. approximately every 4.55 hours, which is much longer than the MSL.
This recommended algorithm is further described in RFC 1948 and This recommended algorithm is further described in RFC 1948 and
builds on the basic clock-driven algorithm from RFC 793. builds on the basic clock-driven algorithm from RFC 793.
A TCP MUST use a clock-driven selection of initial sequence numbers, A TCP MUST use a clock-driven selection of initial sequence numbers
and SHOULD generate its Initial Sequence Numbers with the expression: (MUST-8), and SHOULD generate its Initial Sequence Numbers with the
expression:
ISN = M + F(localip, localport, remoteip, remoteport, secretkey) ISN = M + F(localip, localport, remoteip, remoteport, secretkey)
where M is the 4 microsecond timer, and F() is a pseudorandom where M is the 4 microsecond timer, and F() is a pseudorandom
function (PRF) of the connection's identifying parameters ("localip, function (PRF) of the connection's identifying parameters ("localip,
localport, remoteip, remoteport") and a secret key ("secretkey"). localport, remoteip, remoteport") and a secret key ("secretkey")
F() MUST NOT be computable from the outside, or an attacker could (SHLD-1). F() MUST NOT be computable from the outside (MUST-9), or
still guess at sequence numbers from the ISN used for some other an attacker could still guess at sequence numbers from the ISN used
connection. The PRF could be implemented as a cryptographic has of for some other connection. The PRF could be implemented as a
the concatenation of the TCP connection parameters and some secret cryptographic has of the concatenation of the TCP connection
data. For discussion of the selection of a specific hash algorithm parameters and some secret data. For discussion of the selection of
and management of the secret key data, please see Section 3 of [32]. a specific hash algorithm and management of the secret key data,
please see Section 3 of [32].
For each connection there is a send sequence number and a receive For each connection there is a send sequence number and a receive
sequence number. The initial send sequence number (ISS) is chosen by sequence number. The initial send sequence number (ISS) is chosen by
the data sending TCP, and the initial receive sequence number (IRS) the data sending TCP, and the initial receive sequence number (IRS)
is learned during the connection establishing procedure. is learned during the connection establishing procedure.
For a connection to be established or initialized, the two TCPs must For a connection to be established or initialized, the two TCPs must
synchronize on each other's initial sequence numbers. This is done synchronize on each other's initial sequence numbers. This is done
in an exchange of connection establishing segments carrying a control in an exchange of connection establishing segments carrying a control
bit called "SYN" (for synchronize) and the initial sequence numbers. bit called "SYN" (for synchronize) and the initial sequence numbers.
skipping to change at page 19, line 42 skipping to change at page 19, line 44
Because steps 2 and 3 can be combined in a single message this is Because steps 2 and 3 can be combined in a single message this is
called the three way (or three message) handshake. called the three way (or three message) handshake.
A three way handshake is necessary because sequence numbers are not A three way handshake is necessary because sequence numbers are not
tied to a global clock in the network, and TCPs may have different tied to a global clock in the network, and TCPs may have different
mechanisms for picking the ISN's. The receiver of the first SYN has mechanisms for picking the ISN's. The receiver of the first SYN has
no way of knowing whether the segment was an old delayed one or not, no way of knowing whether the segment was an old delayed one or not,
unless it remembers the last sequence number used on the connection unless it remembers the last sequence number used on the connection
(which is not always possible), and so it must ask the sender to (which is not always possible), and so it must ask the sender to
verify this SYN. The three way handshake and the advantages of a verify this SYN. The three way handshake and the advantages of a
clock-driven scheme are discussed in [3]. clock-driven scheme are discussed in [46].
Knowing When to Keep Quiet Knowing When to Keep Quiet
To be sure that a TCP does not create a segment that carries a To be sure that a TCP does not create a segment that carries a
sequence number which may be duplicated by an old segment remaining sequence number which may be duplicated by an old segment remaining
in the network, the TCP must keep quiet for an MSL before assigning in the network, the TCP must keep quiet for an MSL before assigning
any sequence numbers upon starting up or recovering from a crash in any sequence numbers upon starting up or recovering from a crash in
which memory of sequence numbers in use was lost. For this which memory of sequence numbers in use was lost. For this
specification the MSL is taken to be 2 minutes. This is an specification the MSL is taken to be 2 minutes. This is an
engineering choice, and may be changed if experience indicates it is engineering choice, and may be changed if experience indicates it is
skipping to change at page 24, line 25 skipping to change at page 24, line 25
5. SYN-RECEIVED --> <SEQ=100><ACK=301><CTL=SYN,ACK> ... 5. SYN-RECEIVED --> <SEQ=100><ACK=301><CTL=SYN,ACK> ...
6. ESTABLISHED <-- <SEQ=300><ACK=101><CTL=SYN,ACK> <-- SYN-RECEIVED 6. ESTABLISHED <-- <SEQ=300><ACK=101><CTL=SYN,ACK> <-- SYN-RECEIVED
7. ... <SEQ=100><ACK=301><CTL=SYN,ACK> --> ESTABLISHED 7. ... <SEQ=100><ACK=301><CTL=SYN,ACK> --> ESTABLISHED
Simultaneous Connection Synchronization Simultaneous Connection Synchronization
Figure 6 Figure 6
A TCP MUST support simultaneous open attempts. A TCP MUST support simultaneous open attempts (MUST-10).
Note that a TCP implementation MUST keep track of whether a Note that a TCP implementation MUST keep track of whether a
connection has reached SYN-RECEIVED state as the result of a passive connection has reached SYN-RECEIVED state as the result of a passive
OPEN or an active OPEN. OPEN or an active OPEN (MUST-11).
The principle reason for the three-way handshake is to prevent old The principle reason for the three-way handshake is to prevent old
duplicate connection initiations from causing confusion. To deal duplicate connection initiations from causing confusion. To deal
with this, a special control message, reset, has been devised. If with this, a special control message, reset, has been devised. If
the receiving TCP is in a non-synchronized state (i.e., SYN-SENT, the receiving TCP is in a non-synchronized state (i.e., SYN-SENT,
SYN-RECEIVED), it returns to LISTEN on receiving an acceptable reset. SYN-RECEIVED), it returns to LISTEN on receiving an acceptable reset.
If the TCP is in one of the synchronized states (ESTABLISHED, FIN- If the TCP is in one of the synchronized states (ESTABLISHED, FIN-
WAIT-1, FIN-WAIT-2, CLOSE-WAIT, CLOSING, LAST-ACK, TIME-WAIT), it WAIT-1, FIN-WAIT-2, CLOSE-WAIT, CLOSING, LAST-ACK, TIME-WAIT), it
aborts the connection and informs its user. We discuss this latter aborts the connection and informs its user. We discuss this latter
case under "half-open" connections below. case under "half-open" connections below.
skipping to change at page 29, line 16 skipping to change at page 29, line 16
acknowledges the SYN. acknowledges the SYN.
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 (SHLD-2).
3.5. 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
skipping to change at page 31, line 32 skipping to change at page 31, line 32
Simultaneous Close Sequence Simultaneous Close Sequence
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 the local TCP connection is closed by the remote side discarded. If the local TCP connection is closed by the remote side
due to a FIN or RST received from the remote side, then the local due to a FIN or RST received from the remote side, then the local
application MUST be informed whether it closed normally or was application MUST be informed whether it closed normally or was
aborted. aborted (MUST-12).
3.5.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
the connection. If such a host issues a CLOSE call while received the connection (MAY-1). If such a host issues a CLOSE call while
data is still pending in TCP, or if new data is received after CLOSE received data is still pending in TCP, or if new data is received
is called, its TCP SHOULD send a RST to show that data was lost. See after CLOSE is called, its TCP SHOULD send a RST to show that data
[17] section 2.17 for discussion. was lost (SHLD-3). See [17] section 2.17 for discussion.
When a connection is closed actively, it MUST linger in TIME-WAIT When a connection is closed actively, it MUST linger in TIME-WAIT
state for a time 2xMSL (Maximum Segment Lifetime). However, it MAY state for a time 2xMSL (Maximum Segment Lifetime) (MUST-13).
accept a new SYN from the remote TCP to reopen the connection
directly from TIME-WAIT state, if it: However, it MAY accept a new SYN from the remote TCP to reopen the
connection directly from TIME-WAIT state (MAY-2), if it:
(1) assigns its initial sequence number for the new connection to (1) assigns its initial sequence number for the new connection to
be larger than the largest sequence number it used on the previous be larger than the largest sequence number it used on the previous
connection incarnation, and connection incarnation, and
(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 [30] in order to support higher connection is described in [30] 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 (SHLD-4).
3.6. Precedence and Security 3.6. Precedence and Security
The IPv4 specification [1] includes a precedence value in the (now The IPv4 specification [1] includes a precedence value in the (now
obsoleted) Type of Service field (TOS) field. It was modified in obsoleted) Type of Service field (TOS) field. It was modified in
[15], and then obsoleted by the definition of Differentiated Services [15], and then obsoleted by the definition of Differentiated Services
(DiffServ) [6]. Setting and conveying TOS between the network layer, (DiffServ) [6]. Setting and conveying TOS between the network layer,
TCP, and applications is obsolete, and replaced by DiffServ in the TCP, and applications is obsolete, and replaced by DiffServ in the
current TCP specification. current TCP specification.
skipping to change at page 34, line 32 skipping to change at page 34, line 32
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.
3.7.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 (MUST-
14).
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 (SHLD-5),
send it always. and MAY send it always (MAY-3).
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 (MUST-15).
The maximum size of a segment that TCP really sends, the "effective The maximum size of a segment that TCP really sends, the "effective
send MSS," MUST be the smaller of the send MSS (which reflects the send MSS," MUST be the smaller (MUST-16) of the send MSS (which
available reassembly buffer size at the remote host, the EMTU_R [14]) reflects the available reassembly buffer size at the remote host, the
and the largest transmission size permitted by the IP layer (EMTU_S EMTU_R [14]) and the largest transmission size permitted by the IP
[14]): layer (EMTU_S [14]):
Eff.snd.MSS = Eff.snd.MSS =
min(SendMSS+20, MMS_S) - TCPhdrsize - IPoptionsize min(SendMSS+20, MMS_S) - TCPhdrsize - IPoptionsize
where: where:
o SendMSS is the MSS value received from the remote host, or the o SendMSS is the MSS value received from the remote host, or the
default 536 for IPv4 or 1220 for IPv6, if no MSS option is default 536 for IPv4 or 1220 for IPv6, if no MSS option is
received. received.
skipping to change at page 37, line 7 skipping to change at page 37, line 7
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 (SHLD-6).
3.7.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
segments. However, there MUST be a way for an application to disable (SHLD-7). 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 (MUST-17). In all
sending data is also subject to the limitation imposed by the Slow cases, sending data is also subject to the limitation imposed by the
Start algorithm [25]. Slow Start algorithm [25].
3.7.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.
3.8. Data Communication 3.8. Data Communication
skipping to change at page 38, line 25 skipping to change at page 38, line 25
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.
3.8.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 (MUST-18).
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) (MAY-4).
3.8.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 (MUST-19).
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 [39]. an IETF Standards Track enhancement that has many benefits [39].
A TCP SHOULD implement ECN as described in RFC 3168. A TCP SHOULD implement ECN as described in RFC 3168 (SHLD-8).
3.8.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 (MUST-20):
(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.
(b) When the number of transmissions of the same segment reaches (b) When the number of transmissions of the same segment reaches
or exceeds threshold R1, pass negative advice (see [14] or exceeds threshold R1, pass negative advice (see [14]
Section 3.3.1.4) to the IP layer, to trigger dead-gateway Section 3.3.1.4) to the IP layer, to trigger dead-gateway
diagnosis. diagnosis.
(c) When the number of transmissions of the same segment reaches a (c) When the number of transmissions of the same segment reaches a
threshold R2 greater than R1, close the connection. threshold R2 greater than R1, close the connection.
(d) An application MUST be able to set the value for R2 for a (d) An application MUST (MUST-21) be able to set the value for R2
particular connection. For example, an interactive application for a particular connection. For example, an interactive
might set R2 to "infinity," giving the user control over when to application might set R2 to "infinity," giving the user control
disconnect. over when to disconnect.
(d) TCP SHOULD inform the application of the delivery problem (d) TCP SHOULD inform the application of the delivery problem
(unless such information has been disabled by the application; see (unless such information has been disabled by the application; see
Asynchronous Reports section), when R1 is reached and before R2. Asynchronous Reports section), when R1 is reached and before R2
This will allow a remote login (User Telnet) application program (SHLD-9). This will allow a remote login (User Telnet)
to inform the user, for example. application program to inform the user, for example.
The value of R1 SHOULD correspond to at least 3 retransmissions, at The value of R1 SHOULD correspond to at least 3 retransmissions, at
the current RTO. The value of R2 SHOULD correspond to at least 100 the current RTO (SHLD-10). The value of R2 SHOULD correspond to at
seconds. least 100 seconds (SHLD-11).
An attempt to open a TCP connection could fail with excessive An attempt to open a TCP connection could fail with excessive
retransmissions of the SYN segment or by receipt of a RST segment or retransmissions of the SYN segment or by receipt of a RST segment or
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.
3.8.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 (MAY-5), although this practice is not universally accepted. If
are included, the application MUST be able to turn them on or off for keep-alives are included, the application MUST be able to turn them
each TCP connection, and they MUST default to off. on or off for each TCP connection (MUST-24), and they MUST default to
off (MUST-25).
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 (MUST-26). This interval MUST be configurable (MUST-27) and MUST
two hours. default to no less than two hours (MUST-28).
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 (MUST-29).
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 (SHLD-12); however, it MAY be configurable to send a keep-alive
containing one garbage octet, for compatibility with erroneous TCP segment containing one garbage octet (MAY-6), for compatibility with
implementations. erroneous TCP implementations.
3.8.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 (SHLD-
However, TCP implementations MUST still include support for the 13). However, TCP implementations MUST still include support for the
urgent mechanism. Details can be found in RFC 6093 [29]. urgent mechanism (MUST-30). Details can be found in RFC 6093 [29].
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.
This mechanism permits a point in the data stream to be designated as This mechanism permits a point in the data stream to be designated as
the end of urgent information. Whenever this point is in advance of the end of urgent information. Whenever this point is in advance of
the receive sequence number (RCV.NXT) at the receiving TCP, that TCP the receive sequence number (RCV.NXT) at the receiving TCP, that TCP
must tell the user to go into "urgent mode"; when the receive must tell the user to go into "urgent mode"; when the receive
skipping to change at page 41, line 10 skipping to change at page 41, line 12
transmitted. The URG control flag indicates that the urgent field is transmitted. The URG control flag indicates that the urgent field is
meaningful and must be added to the segment sequence number to yield meaningful and must be added to the segment sequence number to yield
the urgent pointer. The absence of this flag indicates that there is the urgent pointer. The absence of this flag indicates that there is
no urgent data outstanding. no urgent data outstanding.
To send an urgent indication the user must also send at least one To send an urgent indication the user must also send at least one
data octet. If the sending user also indicates a push, timely data octet. If the sending user also indicates a push, timely
delivery of the urgent information to the destination process is delivery of the urgent information to the destination process is
enhanced. enhanced.
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 (MUST-31).
[14]
A TCP MUST inform the application layer asynchronously whenever it A TCP MUST (MUST-32) inform the application layer asynchronously
receives an Urgent pointer and there was previously no pending urgent whenever it receives an Urgent pointer and there was previously no
data, or whenvever the Urgent pointer advances in the data stream. pending urgent data, or whenvever the Urgent pointer advances in the
There MUST be a way for the application to learn how much urgent data data stream. There MUST (MUST-33) be a way for the application to
remains to be read from the connection, or at least to determine learn how much urgent data remains to be read from the connection, or
whether or not more urgent data remains to be read. [14] at least to determine whether or not more urgent data remains to be
read. [14]
3.8.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
skipping to change at page 42, line 8 skipping to change at page 42, line 13
between each new segment transmitted. between each new segment transmitted.
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 (SHLD-14). However, a sending TCP MUST be
against window shrinking, which may cause the "useable window" (see robust against window shrinking, which may cause the "useable window"
Section 3.8.6.2.1) to become negative. (see Section 3.8.6.2.1) to become negative (MUST-34).
If this happens, the sender SHOULD NOT send new data, but SHOULD If this happens, the sender SHOULD NOT send new data (SHLD-15), but
retransmit normally the old unacknowledged data between SND.UNA and SHOULD retransmit normally the old unacknowledged data between
SND.UNA+SND.WND. The sender MAY also retransmit old data beyond SND.UNA and SND.UNA+SND.WND (SHLD-16). The sender MAY also
SND.UNA+SND.WND, but SHOULD NOT time out the connection if data retransmit old data beyond SND.UNA+SND.WND (MAY-7), but SHOULD NOT
beyond the right window edge is not acknowledged. If the window time out the connection if data beyond the right window edge is not
shrinks to zero, the TCP MUST probe it in the standard way (described acknowledged (SHLD-17). If the window shrinks to zero, the TCP MUST
below). probe it in the standard way (described below) (MUST-35).
3.8.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.
Probing of zero (offered) windows MUST be supported. Probing of zero (offered) windows MUST be supported (MUST-36).
A TCP MAY keep its offered receive window closed indefinitely. As A TCP MAY keep its offered receive window closed indefinitely (MAY-
long as the receiving TCP continues to send acknowledgments in 8). As long as the receiving TCP continues to send acknowledgments
response to the probe segments, the sending TCP MUST allow the in 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 (MUST-37). This enables TCP to function in
such as the "printer ran out of paper" situation described in scenarios such as the "printer ran out of paper" situation described
Section 4.2.2.17 of RFC1122. The behavior is subject to the in Section 4.2.2.17 of RFC1122. The behavior is subject to the
implementation's resource management concerns, as noted in [31]. implementation's resource management concerns, as noted in [31].
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).
3.8.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
skipping to change at page 43, line 14 skipping to change at page 43, line 21
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.
3.8.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 (MUST-38).
A TCP SHOULD implement the Nagle Algorithm to coalesce short A TCP SHOULD implement the Nagle Algorithm to coalesce short segments
segments. However, there MUST be a way for an application to disable (SHLD-7). 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 (MUST-17). In all
sending data is also subject to the limitation imposed by the Slow cases, sending data is also subject to the limitation imposed by the
Start algorithm. Slow Start algorithm.
The sender's SWS avoidance algorithm is more difficult than the The sender's SWS avoidance algorithm is more difficult than the
receivers's, because the sender does not know (directly) the receivers's, because the sender does not know (directly) the
receiver's total buffer space RCV.BUFF. An approach which has been receiver's total buffer space RCV.BUFF. An approach which has been
found to work well is for the sender to calculate Max(SND.WND), the found to work well is for the sender to calculate Max(SND.WND), the
maximum send window it has seen so far on the connection, and to use maximum send window it has seen so far on the connection, and to use
this value as an estimate of RCV.BUFF. Unfortunately, this can only this value as an estimate of RCV.BUFF. Unfortunately, this can only
be an estimate; the receiver may at any time reduce the size of be an estimate; the receiver may at any time reduce the size of
RCV.BUFF. To avoid a resulting deadlock, it is necessary to have a RCV.BUFF. To avoid a resulting deadlock, it is necessary to have a
timeout to force transmission of data, overriding the SWS avoidance timeout to force transmission of data, overriding the SWS avoidance
skipping to change at page 44, line 23 skipping to change at page 44, line 28
(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 3.8.6.1). windows (Section Section 3.8.6.1).
3.8.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 (MUST-
39).
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 3.8.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.
skipping to change at page 45, line 40 skipping to change at page 45, line 40
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.
3.8.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 (SHLD-18), but an ACK should not
excessively delayed; in particular, the delay MUST be less than 0.5 be excessively delayed; in particular, the delay MUST be less than
seconds, and in a stream of full-sized segments there SHOULD be an 0.5 seconds (MUST-40), and in a stream of full-sized segments there
ACK for at least every second segment. Excessive delays on ACK's can SHOULD be an ACK for at least every second segment (SHLD-19).
disturb the round-trip timing and packet "clocking" algorithms. Excessive delays on ACK's can disturb the round-trip timing and
packet "clocking" algorithms.
3.9. 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.
skipping to change at page 47, line 27 skipping to change at page 47, line 27
have either a fully specified foreign socket to wait for a have either a fully specified foreign socket to wait for a
particular connection or an unspecified foreign socket to wait particular connection or an unspecified foreign socket to wait
for any call. A fully specified passive call can be made for any call. A fully specified passive call can be made
active by the subsequent execution of a SEND. active by the subsequent execution of a SEND.
A transmission control block (TCB) is created and partially A transmission control block (TCB) is created and partially
filled in with data from the OPEN command parameters. filled in with data from the OPEN command parameters.
Every passive OPEN call either creates a new connection record Every passive OPEN call either creates a new connection record
in LISTEN state, or it returns an error; it MUST NOT affect any in LISTEN state, or it returns an error; it MUST NOT affect any
previously created connection record. previously created connection record (MUST-41).
A TCP that supports multiple concurrent users MUST provide an A TCP that supports multiple concurrent users MUST provide an
OPEN call that will functionally allow an application to LISTEN OPEN call that will functionally allow an application to LISTEN
on a port while a connection block with the same local port is on a port while a connection block with the same local port is
in SYN-SENT or SYN-RECEIVED state. in SYN-SENT or SYN-RECEIVED state (MUST-42).
On an active OPEN command, the TCP will begin the procedure to On an active OPEN command, the TCP will begin the procedure to
synchronize (i.e., establish) the connection at once. synchronize (i.e., establish) the connection at once.
The timeout, if present, permits the caller to set up a timeout The timeout, if present, permits the caller to set up a timeout
for all data submitted to TCP. If data is not successfully for all data submitted to TCP. If data is not successfully
delivered to the destination within the timeout period, the TCP delivered to the destination within the timeout period, the TCP
will abort the connection. The present global default is five will abort the connection. The present global default is five
minutes. minutes.
skipping to change at page 48, line 17 skipping to change at page 48, line 17
and has no direct bearing or relation to received packets. and has no direct bearing or relation to received packets.
A local connection name will be returned to the user by the A local connection name will be returned to the user by the
TCP. The local connection name can then be used as a short TCP. The local connection name can then be used as a short
hand term for the connection defined by the <local socket, hand term for the connection defined by the <local socket,
foreign socket> pair. foreign socket> pair.
The optional "local IP address" parameter MUST be supported to The optional "local IP address" parameter MUST be supported to
allow the specification of the local IP address. This enables allow the specification of the local IP address. This enables
applications that need to select the local IP address used when applications that need to select the local IP address used when
multihoming is present. multihoming is present (MUST-43).
A passive OPEN call with a specified "local IP address" A passive OPEN call with a specified "local IP address"
parameter will await an incoming connection request to that parameter will await an incoming connection request to that
address. If the parameter is unspecified, a passive OPEN will address. If the parameter is unspecified, a passive OPEN will
await an incoming connection request to any local IP address, await an incoming connection request to any local IP address,
and then bind the local IP address of the connection to the and then bind the local IP address of the connection to the
particular address that is used. particular address that is used.
For an active OPEN call, a specified "local IP address" For an active OPEN call, a specified "local IP address"
parameter MUST be used for opening the connection. If the parameter MUST be used for opening the connection (MUST-43).
parameter is unspecified, the host will choose an appropriate If the parameter is unspecified, the host will choose an
local IP address (see RFC 1122 section 3.3.4.2). appropriate local IP address (see RFC 1122 section
3.3.4.2).Editor's note: should this replace the paragraph with
MUST-43 two paragraphs above? These seem to be duplicative of
one another (first from 793, then from 1122)? TBD
If an application on a multihomed host does not specify the If an application on a multihomed host does not specify the
local IP address when actively opening a TCP connection, then local IP address when actively opening a TCP connection, then
the TCP MUST ask the IP layer to select a local IP address the TCP MUST ask the IP layer to select a local IP address
before sending the (first) SYN. See the function GET_SRCADDR() before sending the (first) SYN (MUST-44). See the function
in Section 3.4 of RFC 1122. GET_SRCADDR() in Section 3.4 of RFC 1122.
At all other times, a previous segment has either been sent or At all other times, a previous segment has either been sent or
received on this connection, and TCP MUST use the same local received on this connection, and TCP MUST use the same local
address is used that was used in those previous segments. address is used that was used in those previous segments (MUST-
45).
A TCP implementation MUST reject as an error a local OPEN call A TCP implementation MUST reject as an error a local OPEN call
for an invalid remote IP address (e.g., a broadcast or for an invalid remote IP address (e.g., a broadcast or
multicast address). multicast address) (MUST-46).
Send Send
Format: SEND (local connection name, buffer address, byte Format: SEND (local connection name, buffer address, byte
count, PUSH flag, URGENT flag [,timeout]) count, PUSH flag, URGENT flag [,timeout])
This call causes the data contained in the indicated user This call causes the data contained in the indicated user
buffer to be sent on the indicated connection. If the buffer to be sent on the indicated connection. If the
connection has not been opened, the SEND is considered an connection has not been opened, the SEND is considered an
error. Some implementations may allow users to SEND first; in error. Some implementations may allow users to SEND first; in
which case, an automatic OPEN would be done. For example, this which case, an automatic OPEN would be done. For example, this
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
skipping to change at page 49, line 19 skipping to change at page 49, line 22
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 buffer the data before sending, without regard in use, TCP may buffer the data before sending, without regard
to the PUSH flag (see Section 3.7.4). to the PUSH flag (see Section 3.7.4).
New applications SHOULD NOT set the URGENT flag [29] due to New applications SHOULD NOT set the URGENT flag [29] due to
implementation differences and middlebox issues. implementation differences and middlebox issues (SHLD-13).
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
and to indicate to the receiver when all the currently known and to indicate to the receiver when all the currently known
urgent data has been received. The number of times the sending urgent data has been received. The number of times the sending
user's TCP signals urgent will not necessarily be equal to the user's TCP signals urgent will not necessarily be equal to the
skipping to change at page 53, line 18 skipping to change at page 53, line 20
indications for each outstanding SEND or RECEIVE, or may simply indications for each outstanding SEND or RECEIVE, or may simply
receive an ABORT-acknowledgment. receive an ABORT-acknowledgment.
Flush Flush
Some TCP implementations have included a FLUSH call, which will Some TCP implementations have included a FLUSH call, which will
empty the TCP send queue of any data for which the user has empty the TCP send queue of any data for which the user has
issued SEND calls but which is still to the right of the issued SEND calls but which is still to the right of the
current send window. That is, it flushes as much queued send current send window. That is, it flushes as much queued send
data as possible without losing sequence number data as possible without losing sequence number
synchronization. synchronization. The FLUSH call MAY be implemented (MAY-14).
Asynchronous Reports Asynchronous Reports
There MUST be a mechanism for reporting soft TCP error There MUST be a mechanism for reporting soft TCP error
conditions to the application. Generically, we assume this conditions to the application (MUST-47). Generically, we
takes the form of an application-supplied ERROR_REPORT routine assume this takes the form of an application-supplied
that may be upcalled asynchronously from the transport layer: ERROR_REPORT routine 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 3.9.2.2) * ICMP error message arrived (see Section 3.9.2.2) (MUST-
TBD)
* Excessive retransmissions (see Section 3.8.3) * Excessive retransmissions (see Section 3.8.3) (MUST-TBD)
* Urgent pointer advance (see Section 3.8.5). * Urgent pointer advance (see Section 3.8.5) (MUST-32).
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 (SHLD-20).
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 (MUST-48). The Differentiated Services field
6-bit Differentiated Services Code Point (DSCP) value. It is includes the 6-bit Differentiated Services Code Point (DSCP)
not required, but the application SHOULD be able to change the value. It is not required, but the application SHOULD be able
Differentiated Services field during the connection lifetime. to change the Differentiated Services field during the
TCP SHOULD pass the current Differentiated Services field value connection lifetime (SHLD-21). TCP SHOULD pass the current
without change to the IP layer, when it sends segments on the Differentiated Services field value without change to the IP
connection. layer, when it sends segments on the connection (SHLD-22).
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 (MAY-9).
3.9.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:
DiffServ field: The IP header value for the DiffServ field is DiffServ field: The IP header value for the DiffServ field is
given by the user. This includes the bits of the DiffServ Code given by the user. This includes the bits of the DiffServ Code
Point (DSCP). Point (DSCP).
Time to Live (TTL): The TTL value used to send TCP segments MUST Time to Live (TTL): The TTL value used to send TCP segments MUST
be configurable. be configurable (MUST-49).
Note that RFC 793 specified one minute (60 seconds) as a Note that RFC 793 specified one minute (60 seconds) as a
constant for the TTL, because the assumed maximum segment constant for the TTL, because the assumed maximum segment
lifetime was two minutes. This was intended to explicitly ask lifetime was two minutes. This was intended to explicitly ask
that a segment be destroyed if it cannot be delivered by the that a segment be destroyed if it cannot be delivered by the
internet system within one minute. RFC 1122 changed this internet system within one minute. RFC 1122 changed this
specification to require that the TTL be configurable. specification to require that the TTL be configurable.
Note that the DiffServ field is permitted to change during a Note that the DiffServ field is permitted to change during a
connection (section 4.2.4.2 of RFC 1122). However, the connection (section 4.2.4.2 of RFC 1122). However, the
application interface might not support this ability, and the application interface might not support this ability, and the
application does not have knowledge about individual TCP application does not have knowledge about individual TCP
segments, so this can only be done on a coarse granularity, at segments, so this can only be done on a coarse granularity, at
best. This limitation is further discussed in RFC 7657 (sec best. This limitation is further discussed in RFC 7657 (sec
5.1, 5.3, and 6) [38]. Generally, an application SHOULD NOT 5.1, 5.3, and 6) [38]. Generally, an application SHOULD NOT
change the DiffServ field value during the course of a change the DiffServ field value during the course of a
connection. connection (SHLD-23).
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 (MUST-50).
A TCP MAY support the Time Stamp and Record Route options. A TCP MAY support the Time Stamp (MAY-10) and Record Route (MAY-11)
options.
3.9.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 (MUST-51), and this MUST take
source route received in a datagram. precedence over a source route received in a datagram (MUST-52).
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 (MUST-53). If a different source route arrives in a later
the later definition SHOULD override the earlier one. segment, the later definition SHOULD override the earlier one (SHLD-
24).
3.9.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 (MUST-54). The
demultiplexing information can be found in the IP header contained necessary demultiplexing information can be found in the IP header
within the ICMP message. contained within the ICMP message.
This applies to ICMPv6 in addition to IPv4 ICMP. This applies to ICMPv6 in addition to IPv4 ICMP.
[23] contains discussion of specific ICMP and ICMPv6 messages [23] 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
responses. Treatment for classes of ICMP messages is described responses. Treatment for classes of ICMP messages is described
below: below:
Source Quench Source Quench
TCP MUST silently discard any received ICMP Source Quench messages. TCP MUST silently discard any received ICMP Source Quench messages
See [11] for discussion. (MUST-55). See [11] for discussion.
Soft Errors Soft Errors
For ICMP these include: Destination Unreachable -- codes 0, 1, 5, For ICMP these include: Destination Unreachable -- codes 0, 1, 5,
Time Exceeded -- codes 0, 1, and Parameter Problem. Time Exceeded -- codes 0, 1, and Parameter Problem.
For ICMPv6 these include: Destination Unreachable -- codes 0 and 3, For ICMPv6 these include: Destination Unreachable -- codes 0 and 3,
Time Exceeded -- codes 0, 1, and Parameter Problem -- codes 0, 1, 2 Time Exceeded -- codes 0, 1, and Parameter Problem -- codes 0, 1, 2
Since these Unreachable messages indicate soft error conditions, Since these Unreachable messages indicate soft error conditions,
TCP MUST NOT abort the connection, and it SHOULD make the TCP MUST NOT abort the connection (MUST-56), and it SHOULD make the
information available to the application. information available to the application (SHLD-25).
Hard Errors Hard Errors
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
connection. [23] notes that some implementations do not abort (SHLD-26). [23] 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 [23] section 4 describes widespread implementation behavior Note that [23] 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.
3.9.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 (MUST-57).
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.
3.10. 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
skipping to change at page 70, line 51 skipping to change at page 71, line 51
LAST-ACK STATE LAST-ACK STATE
TIME-WAIT STATE TIME-WAIT STATE
Segments are processed in sequence. Initial tests on Segments are processed in sequence. Initial tests on
arrival are used to discard old duplicates, but further arrival are used to discard old duplicates, but further
processing is done in SEG.SEQ order. If a segment's processing is done in SEG.SEQ order. If a segment's
contents straddle the boundary between old and new, only the contents straddle the boundary between old and new, only the
new parts should be processed. new parts should be processed.
In general, the processing of received segments MUST be In general, the processing of received segments MUST be
implemented to aggregate ACK segments whenever possible. implemented to aggregate ACK segments whenever possible
For example, if the TCP is processing a series of queued (MUST-58). For example, if the TCP is processing a series
segments, it MUST process them all before sending any ACK of queued segments, it MUST process them all before sending
segments. any ACK segments (MUST-59).
There are four cases for the acceptability test for an There are four cases for the acceptability test for an
incoming segment: incoming segment:
Segment Receive Test Segment Receive Test
Length Window Length Window
------- ------- ------------------------------------------- ------- ------- -------------------------------------------
0 0 SEG.SEQ = RCV.NXT 0 0 SEG.SEQ = RCV.NXT
skipping to change at page 75, line 19 skipping to change at page 76, line 19
(sequence number check). (sequence number check).
fifth check the ACK field, fifth check the ACK field,
if the ACK bit is off drop the segment and return if the ACK bit is off drop the segment and return
if the ACK bit is on if the ACK bit is on
RFC 5961 section 5 describes a potential blind data RFC 5961 section 5 describes a potential blind data
injection attack, and mitigation that implementations MAY injection attack, and mitigation that implementations MAY
choose to include. TCP stacks that implement RFC 5961 choose to include (MAY-12). TCP stacks that implement
MUST add an input check that the ACK value is acceptable RFC 5961 MUST add an input check that the ACK value is
only if it is in the range of ((SND.UNA - MAX.SND.WND) =< acceptable only if it is in the range of ((SND.UNA -
SEG.ACK =< SND.NXT). All incoming segments whose ACK MAX.SND.WND) =< SEG.ACK =< SND.NXT). All incoming
value doesn't satisfy the above condition MUST be segments whose ACK value doesn't satisfy the above
discarded and an ACK sent back. The new state variable condition MUST be discarded and an ACK sent back. The
MAX.SND.WND is defined as the largest window that the new state variable MAX.SND.WND is defined as the largest
local sender has ever received from its peer (subject to window that the local sender has ever received from its
window scaling) or may be hard-coded to a maximum peer (subject to window scaling) or may be hard-coded to
permissible window value. When the ACK value is a maximum permissible window value. When the ACK value
acceptable, the processing per-state below applies: is acceptable, the processing per-state below applies:
SYN-RECEIVED STATE SYN-RECEIVED STATE
If SND.UNA < SEG.ACK =< SND.NXT then enter ESTABLISHED If SND.UNA < SEG.ACK =< SND.NXT then enter ESTABLISHED
state and continue processing with variables below set state and continue processing with variables below set
to: to:
SND.WND <- SEG.WND SND.WND <- SEG.WND
SND.WL1 <- SEG.SEQ SND.WL1 <- SEG.SEQ
SND.WL2 <- SEG.ACK SND.WL2 <- SEG.ACK
skipping to change at page 78, line 13 skipping to change at page 79, line 13
data. data.
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 (MAY-13).
Please note the window management suggestions in Please note the window management suggestions in
Section 3.8. 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
skipping to change at page 97, line 37 skipping to change at page 98, line 37
[44] Bittau, A., Giffin, D., Handley, M., Mazieres, D., Slack, [44] Bittau, A., Giffin, D., Handley, M., Mazieres, D., Slack,
Q., and E. Smith, "Cryptographic protection of TCP Streams Q., and E. Smith, "Cryptographic protection of TCP Streams
(tcpcrypt)", draft-ietf-tcpinc-tcpcrypt-09 (work in (tcpcrypt)", draft-ietf-tcpinc-tcpcrypt-09 (work in
progress), November 2017. progress), November 2017.
[45] Minshall, G., "A Proposed Modification to Nagle's [45] Minshall, G., "A Proposed Modification to Nagle's
Algorithm", draft-minshall-nagle-01 (work in progress), Algorithm", draft-minshall-nagle-01 (work in progress),
June 1999. June 1999.
[46] Dalal, Y. and C. Sunshine, "Connection Management in
Transport Protocols", Computer Networks Vol. 2, No. 6, pp.
454-473, December 1978.
Appendix A. Other Implementation Notes Appendix A. Other Implementation Notes
This section includes additional notes and references on TCP This section includes additional notes and references on TCP
implementation decisions that are currently not a part of the RFC implementation decisions that are currently not a part of the RFC
series or included within the TCP standard. These items can be series or included within the TCP standard. These items can be
considered by implementers, but there was not yet a consensus to considered by implementers, but there was not yet a consensus to
include them in the standard. include them in the standard.
A.1. IP Security Compartment and Precedence A.1. IP Security Compartment and Precedence
skipping to change at page 99, line 24 skipping to change at page 100, line 31
sending TCP application to help avoid creating large amounts of sending TCP application to help avoid creating large amounts of
buffered data (and corresponding latency). This is useful for buffered data (and corresponding latency). This is useful for
applications that are multiplexing data from multiple upper level applications that are multiplexing data from multiple upper level
streams onto a connection, especially when streams may be a mix of streams onto a connection, especially when streams may be a mix of
interactive/realtime and bulk data transfer. interactive/realtime and bulk data transfer.
Appendix B. TCP Requirement Summary Appendix B. TCP Requirement Summary
This section is adapted from RFC 1122. This section is adapted from RFC 1122.
TODO: this needs to be seriously redone, to use 793bis section TODO: This needs to be worked on a little bit still, to fix the
numbers instead of 1122 ones, the RFC1122 heading should be removed, remaining TBDs. Through this, it became clear that content on PUSH
and all 1122 requirements need to be reflected in 793bis text. needs to be included from 793/1122 still.
TODO: NOTE that PMTUD+PLPMTUD is not included in this table of TODO: NOTE that PMTUD+PLPMTUD is not included in this table of
recommendations. recommendations.
| | | | |S| | | | | | |S| |
| | | | |H| |F | | | | |H| |F
| | | | |O|M|o | | | | |O|M|o
| | |S| |U|U|o | | |S| |U|U|o
| | |H| |L|S|t | | |H| |L|S|t
| |M|O| |D|T|n | |M|O| |D|T|n
| |U|U|M| | |o | |U|U|M| | |o
| |S|L|A|N|N|t | |S|L|A|N|N|t
|RFC1122 |T|D|Y|O|O|t | |T|D|Y|O|O|t
FEATURE |SECTION | | | |T|T|e FEATURE | ReqID | | | |T|T|e
-------------------------------------------------|--------|-|-|-|-|-|-- -------------------------------------------------|--------|-|-|-|-|-|--
| | | | | | | | | | | | | |
Push flag | | | | | | | Push flag | | | | | | |
Aggregate or queue un-pushed data |4.2.2.2 | | |x| | | Aggregate or queue un-pushed data | TBD | | |x| | |
Sender collapse successive PSH flags |4.2.2.2 | |x| | | | Sender collapse successive PSH flags | TBD | |x| | | |
SEND call can specify PUSH |4.2.2.2 | | |x| | | SEND call can specify PUSH | TBD | | |x| | |
If cannot: sender buffer indefinitely |4.2.2.2 | | | | |x| If cannot: sender buffer indefinitely | TBD | | | | |x|
If cannot: PSH last segment |4.2.2.2 |x| | | | | If cannot: PSH last segment | TBD |x| | | | |
Notify receiving ALP of PSH |4.2.2.2 | | |x| | |1 Notify receiving ALP of PSH | TBD | | |x| | |1
Send max size segment when possible |4.2.2.2 | |x| | | | Send max size segment when possible | TBD | |x| | | |
| | | | | | | | | | | | | |
Window | | | | | | | Window | | | | | | |
Treat as unsigned number |4.2.2.3 |x| | | | | Treat as unsigned number | MUST-1 |x| | | | |
Handle as 32-bit number |4.2.2.3 | |x| | | | Handle as 32-bit number | REC-1 | |x| | | |
Shrink window from right |4.2.2.16| | | |x| | Shrink window from right | SHLD-14| | | |x| |
Robust against shrinking window |4.2.2.16|x| | | | | - Send new data when window shrinks | SHLD-15| | | |x| |
Receiver's window closed indefinitely |4.2.2.17| | |x| | | - Retransmit old unacked data within window | SHLD-16| |x| | | |
Sender probe zero window |4.2.2.17|x| | | | | - Time out conn for data past right edge | SHLD-17| | | |x| |
First probe after RTO |4.2.2.17| |x| | | | Robust against shrinking window | MUST-34|x| | | | |
Exponential backoff |4.2.2.17| |x| | | | Receiver's window closed indefinitely | MAY-8 | | |x| | |
Allow window stay zero indefinitely |4.2.2.17|x| | | | | Use standard probing logic | MUST-35|x| | | | |
Sender timeout OK conn with zero wind |4.2.2.17| | | | |x| Sender probe zero window | MUST-36|x| | | | |
First probe after RTO | TBD | |x| | | |
Exponential backoff | TBD | |x| | | |
Allow window stay zero indefinitely | MUST-37|x| | | | |
Sender timeout OK conn with zero wind | TBD | | | | |x|
Retransmit old data beyond SND.UNA+SND.WND | MAY-7 | | |x| | |
| | | | | | | | | | | | | |
Urgent Data | | | | | | | Urgent Data | | | | | | |
Pointer indicates first non-urgent octet |4.2.2.4 |x| | | | | Include support for urgent pointer | MUST-30|x| | | | |
Arbitrary length urgent data sequence |4.2.2.4 |x| | | | | Pointer indicates first non-urgent octet | TBD |x| | | | |
Inform ALP asynchronously of urgent data |4.2.2.4 |x| | | | |1 Arbitrary length urgent data sequence | MUST-31|x| | | | |
ALP can learn if/how much urgent data Q'd |4.2.2.4 |x| | | | |1 Inform ALP asynchronously of urgent data | MUST-32|x| | | | |1
ALP can learn if/how much urgent data Q'd | MUST-33|x| | | | |1
ALP employ the urgent mechanism | SHLD-13| | | |x| |
| | | | | | | | | | | | | |
TCP Options | | | | | | | TCP Options | | | | | | |
Receive TCP option in any segment |4.2.2.5 |x| | | | | Support the mandatory option set | MUST-4 |x| | | | |
Ignore unsupported options |4.2.2.5 |x| | | | | Receive TCP option in any segment | MUST-5 |x| | | | |
Cope with illegal option length |4.2.2.5 |x| | | | | Ignore unsupported options | MUST-6 |x| | | | |
Implement sending & receiving MSS option |4.2.2.6 |x| | | | | Cope with illegal option length | MUST-7 |x| | | | |
IPv4 Send MSS option unless 536 |4.2.2.6 | |x| | | | Implement sending & receiving MSS option | MUST-14|x| | | | |
IPv6 Send MSS option unless 1220 | N/A | |x| | | | IPv4 Send MSS option unless 536 | SHLD-5 | |x| | | |
Send MSS option always |4.2.2.6 | | |x| | | IPv6 Send MSS option unless 1220 | SHLD-5 | |x| | | |
IPv4 Send-MSS default is 536 |4.2.2.6 |x| | | | | Send MSS option always | MAY-3 | | |x| | |
IPv6 Send-MSS default is 1220 | N/A |x| | | | | IPv4 Send-MSS default is 536 | MUST-15|x| | | | |
Calculate effective send seg size |4.2.2.6 |x| | | | | IPv6 Send-MSS default is 1220 | MUST-15|x| | | | |
MSS accounts for varying MTU | N/A | |x| | | | Calculate effective send seg size | MUST-16|x| | | | |
MSS accounts for varying MTU | SHLD-6 | |x| | | |
| | | | | | | | | | | | | |
TCP Checksums | | | | | | | TCP Checksums | | | | | | |
Sender compute checksum |4.2.2.7 |x| | | | | Sender compute checksum | MUST-2 |x| | | | |
Receiver check checksum |4.2.2.7 |x| | | | | Receiver check checksum | MUST-3 |x| | | | |
| | | | | | | | | | | | | |
ISN Selection | | | | | | | ISN Selection | | | | | | |
Include a clock-driven ISN generator component |4.2.2.9 |x| | | | | Include a clock-driven ISN generator component | MUST-8 |x| | | | |
Secure ISN generator with a PRF component | N/A | |x| | | | Secure ISN generator with a PRF component | SHLD-1 | |x| | | |
PRF computable from outside the host | MUST-9 | | | | |x|
| | | | | | | | | | | | | |
Opening Connections | | | | | | | Opening Connections | | | | | | |
Support simultaneous open attempts |4.2.2.10|x| | | | | Support simultaneous open attempts | MUST-10|x| | | | |
SYN-RECEIVED remembers last state |4.2.2.11|x| | | | | SYN-RECEIVED remembers last state | MUST-11|x| | | | |
Passive Open call interfere with others |4.2.2.18| | | | |x| Passive Open call interfere with others | MUST-41| | | | |x|
Function: simultan. LISTENs for same port |4.2.2.18|x| | | | | Function: simultan. LISTENs for same port | MUST-42|x| | | | |
Ask IP for src address for SYN if necc. |4.2.3.7 |x| | | | | Ask IP for src address for SYN if necc. | MUST-44|x| | | | |
Otherwise, use local addr of conn. |4.2.3.7 |x| | | | | Otherwise, use local addr of conn. | MUST-45|x| | | | |
OPEN to broadcast/multicast IP Address |4.2.3.14| | | | |x| OPEN to broadcast/multicast IP Address | MUST-46| | | | |x|
Silently discard seg to bcast/mcast addr |4.2.3.14|x| | | | | Silently discard seg to bcast/mcast addr | TBD |x| | | | |
| | | | | | | | | | | | | |
Closing Connections | | | | | | | Closing Connections | | | | | | |
RST can contain data |4.2.2.12| |x| | | | RST can contain data | SHLD-2 | |x| | | |
Inform application of aborted conn |4.2.2.13|x| | | | | Inform application of aborted conn | MUST-12|x| | | | |
Half-duplex close connections |4.2.2.13| | |x| | | Half-duplex close connections | MAY-1 | | |x| | |
Send RST to indicate data lost |4.2.2.13| |x| | | | Send RST to indicate data lost | SHLD-3 | |x| | | |
In TIME-WAIT state for 2MSL seconds |4.2.2.13|x| | | | | In TIME-WAIT state for 2MSL seconds | MUST-13|x| | | | |
Accept SYN from TIME-WAIT state |4.2.2.13| | |x| | | Accept SYN from TIME-WAIT state | MAY-2 | | |x| | |
Use Timestamps to reduce TIME-WAIT | TODO | | | | | | Use Timestamps to reduce TIME-WAIT | SHLD-4 | |x| | | |
| | | | | | | | | | | | | |
Retransmissions | | | | | | | Retransmissions | | | | | | |
Jacobson Slow Start algorithm |4.2.2.15|x| | | | | Implement RFC 5681 | MUST-19|x| | | | |
Jacobson Congestion-Avoidance algorithm |4.2.2.15|x| | | | | Retransmit with same IP ident | MAY-4 | | |x| | |
Retransmit with same IP ident |4.2.2.15| | |x| | | Karn's algorithm | MUST-18|x| | | | |
Karn's algorithm |4.2.3.1 |x| | | | |
Jacobson's RTO estimation alg. |4.2.3.1 |x| | | | |
Exponential backoff |4.2.3.1 |x| | | | |
SYN RTO calc same as data |4.2.3.1 | |x| | | |
Recommended initial values and bounds |4.2.3.1 | |x| | | |
| | | | | | | | | | | | | |
Generating ACK's: | | | | | | | Generating ACK's: | | | | | | |
Queue out-of-order segments |4.2.2.20| |x| | | | Aggregate whenever possible | MUST-58|x| | | | |
Process all Q'd before send ACK |4.2.2.20|x| | | | | Queue out-of-order segments | TBD | |x| | | |
Send ACK for out-of-order segment |4.2.2.21| | |x| | | Process all Q'd before send ACK | MUST-59|x| | | | |
Delayed ACK's |4.2.3.2 | |x| | | | Send ACK for out-of-order segment | MAY-13 | | |x| | |
Delay < 0.5 seconds |4.2.3.2 |x| | | | | Delayed ACK's | SHLD-18| |x| | | |
Every 2nd full-sized segment ACK'd |4.2.3.2 |x| | | | | Delay < 0.5 seconds | MUST-40|x| | | | |
Receiver SWS-Avoidance Algorithm |4.2.3.3 |x| | | | | Every 2nd full-sized segment ACK'd | SHLD-19|x| | | | |
Receiver SWS-Avoidance Algorithm | MUST-39|x| | | | |
| | | | | | | | | | | | | |
Sending data | | | | | | | Sending data | | | | | | |
Configurable TTL |4.2.2.19|x| | | | | Configurable TTL | MUST-49|x| | | | |
Sender SWS-Avoidance Algorithm |4.2.3.4 |x| | | | | Sender SWS-Avoidance Algorithm | MUST-38|x| | | | |
Nagle algorithm |4.2.3.4 | |x| | | | Nagle algorithm | SHLD-7 | |x| | | |
Application can disable Nagle algorithm |4.2.3.4 |x| | | | | Application can disable Nagle algorithm | MUST-17|x| | | | |
| | | | | | | | | | | | | |
Connection Failures: | | | | | | | Connection Failures: | | | | | | |
Negative advice to IP on R1 retxs |4.2.3.5 |x| | | | | Negative advice to IP on R1 retxs | MUST-20|x| | | | |
Close connection on R2 retxs |4.2.3.5 |x| | | | | Close connection on R2 retxs | MUST-20|x| | | | |
ALP can set R2 |4.2.3.5 |x| | | | |1 ALP can set R2 | MUST-21|x| | | | |1
Inform ALP of R1<=retxs<R2 |4.2.3.5 | |x| | | |1 Inform ALP of R1<=retxs<R2 | SHLD-9 | |x| | | |1
Recommended values for R1, R2 |4.2.3.5 | |x| | | | Recommended value for R1 | SHLD-10| |x| | | |
Same mechanism for SYNs |4.2.3.5 |x| | | | | Recommended value for R2 | SHLD-11| |x| | | |
R2 at least 3 minutes for SYN |4.2.3.5 |x| | | | | Same mechanism for SYNs | MUST-22|x| | | | |
R2 at least 3 minutes for SYN | MUST-23|x| | | | |
| | | | | | | | | | | | | |
Send Keep-alive Packets: |4.2.3.6 | | |x| | | Send Keep-alive Packets: | MAY-5 | | |x| | |
- Application can request |4.2.3.6 |x| | | | | - Application can request | MUST-24|x| | | | |
- Default is "off" |4.2.3.6 |x| | | | | - Default is "off" | MUST-25|x| | | | |
- Only send if idle for interval |4.2.3.6 |x| | | | | - Only send if idle for interval | MUST-26|x| | | | |
- Interval configurable |4.2.3.6 |x| | | | | - Interval configurable | MUST-27|x| | | | |
- Default at least 2 hrs. |4.2.3.6 |x| | | | | - Default at least 2 hrs. | MUST-28|x| | | | |
- Tolerant of lost ACK's |4.2.3.6 |x| | | | | - Tolerant of lost ACK's | MUST-29|x| | | | |
- Send with no data | SHLD-12| |x| | | |
- Configurable to send garbage octet | MAY-6 | | |x| | |
| | | | | | | | | | | | | |
IP Options | | | | | | | IP Options | | | | | | |
Ignore options TCP doesn't understand |4.2.3.8 |x| | | | | Ignore options TCP doesn't understand | MUST-50|x| | | | |
Time Stamp support |4.2.3.8 | | |x| | | Time Stamp support | MAY-10 | | |x| | |
Record Route support |4.2.3.8 | | |x| | | Record Route support | MAY-11 | | |x| | |
Source Route: | | | | | | | Source Route: | | | | | | |
ALP can specify |4.2.3.8 |x| | | | |1 ALP can specify | MUST-51|x| | | | |1
Overrides src rt in datagram |4.2.3.8 |x| | | | | Overrides src rt in datagram | MUST-52|x| | | | |
Build return route from src rt |4.2.3.8 |x| | | | | Build return route from src rt | MUST-53|x| | | | |
Later src route overrides |4.2.3.8 | |x| | | | Later src route overrides | SHLD-24| |x| | | |
| | | | | | | | | | | | | |
Receiving ICMP Messages from IP |4.2.3.9 |x| | | | | Receiving ICMP Messages from IP | MUST-54|x| | | | |
Dest. Unreach (0,1,5) => inform ALP |4.2.3.9 | |x| | | | Dest. Unreach (0,1,5) => inform ALP | SHLD-25| |x| | | |
Dest. Unreach (0,1,5) => abort conn |4.2.3.9 | | | | |x| Dest. Unreach (0,1,5) => abort conn | MUST-56| | | | |x|
Dest. Unreach (2-4) => abort conn |4.2.3.9 | |x| | | | Dest. Unreach (2-4) => abort conn | SHLD-26| |x| | | |
Source Quench => silent discard |4.2.3.9 | |x| | | | Source Quench => silent discard | MUST-55|x| | | | |
Time Exceeded => tell ALP, don't abort |4.2.3.9 | |x| | | | Time Exceeded => tell ALP, don't abort | MUST-56| | | | |x|
Param Problem => tell ALP, don't abort |4.2.3.9 | |x| | | | Param Problem => tell ALP, don't abort | MUST-56| | | | |x|
| | | | | | | | | | | | | |
Address Validation | | | | | | | Address Validation | | | | | | |
Reject OPEN call to invalid IP address |4.2.3.10|x| | | | | Reject OPEN call to invalid IP address | MUST-46|x| | | | |
Reject SYN from invalid IP address |4.2.3.10|x| | | | | Reject SYN from invalid IP address | TBD |x| | | | |
Silently discard SYN to bcast/mcast addr |4.2.3.10|x| | | | | Silently discard SYN to bcast/mcast addr | MUST-57|x| | | | |
| | | | | | | | | | | | | |
TCP/ALP Interface Services | | | | | | | TCP/ALP Interface Services | | | | | | |
Error Report mechanism |4.2.4.1 |x| | | | | Error Report mechanism | MUST-47|x| | | | |
ALP can disable Error Report Routine |4.2.4.1 | |x| | | | ALP can disable Error Report Routine | SHLD-20| |x| | | |
ALP can specify DiffServ field for sending |4.2.4.2 |x| | | | | ALP can specify DiffServ field for sending | MUST-48|x| | | | |
Passed unchanged to IP |4.2.4.2 | |x| | | | Passed unchanged to IP | SHLD-22| |x| | | |
ALP can change DiffServ field during connection|4.2.4.2 | |x| | | | ALP can change DiffServ field during connection| SHLD-21| |x| | | |
Pass received DiffServ field up to ALP |4.2.4.2 | | |x| | | ALP generally changing DiffServ during conn. | SHLD-23| | | |x| |
FLUSH call |4.2.4.3 | | |x| | | Pass received DiffServ field up to ALP | MAY-9 | | |x| | |
Optional local IP addr parm. in OPEN |4.2.4.4 |x| | | | | FLUSH call | MAY-14 | | |x| | |
Optional local IP addr parm. in OPEN | TBD |x| | | | |
| | | | | | |
RFC 5961 Support: | | | | | | |
Implement data injection protection | MAY-12 | | |x| | |
| | | | | | |
Explicit Congestion Notification: | | | | | | |
Support ECN | SHLD-8 | |x| | | |
-------------------------------------------------|--------|-|-|-|-|-|-- -------------------------------------------------|--------|-|-|-|-|-|--
FOOTNOTES: (1) "ALP" means Application-Layer program. FOOTNOTES: (1) "ALP" means Application-Layer program.
Author's Address Author's Address
Wesley M. Eddy (editor) Wesley M. Eddy (editor)
MTI Systems MTI Systems
US US
 End of changes. 104 change blocks. 
306 lines changed or deleted 340 lines changed or added

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