draft-ietf-tcpm-rfc793bis-16.txt   draft-ietf-tcpm-rfc793bis-17.txt 
Internet Engineering Task Force W. Eddy, Ed. Internet Engineering Task Force W. Eddy, Ed.
Internet-Draft MTI Systems Internet-Draft MTI Systems
Obsoletes: 793, 879, 2873, 6093, 6429, March 24, 2020 Obsoletes: 793, 879, 2873, 6093, 6429, July 7, 2020
6528, 6691 (if approved) 6528, 6691 (if approved)
Updates: 5961, 1122 (if approved) Updates: 5961, 1122 (if approved)
Intended status: Standards Track Intended status: Standards Track
Expires: September 25, 2020 Expires: January 8, 2021
Transmission Control Protocol Specification Transmission Control Protocol Specification
draft-ietf-tcpm-rfc793bis-16 draft-ietf-tcpm-rfc793bis-17
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 1, line 36 skipping to change at page 1, line 36
document dealing with TCP requirements. It updates RFC 5961 due to a document dealing with TCP requirements. It updates RFC 5961 due to a
small clarification in reset handling while in the SYN-RECEIVED small clarification in reset handling while in the SYN-RECEIVED
state. state.
RFC EDITOR NOTE: If approved for publication as an RFC, this should RFC EDITOR NOTE: If approved for publication as an RFC, this should
be marked additionally as "STD: 7" and replace RFC 793 in that role. be marked additionally as "STD: 7" and replace RFC 793 in that role.
Requirements Language Requirements Language
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
document are to be interpreted as described in RFC 2119 [4]. "OPTIONAL" in this document are to be interpreted as described in BCP
14 [4][11] when, and only when, they appear in all capitals, as shown
here.
Status of This Memo Status of This Memo
This Internet-Draft is submitted in full conformance with the This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79. provisions of BCP 78 and BCP 79.
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 September 25, 2020. This Internet-Draft will expire on January 8, 2021.
Copyright Notice Copyright Notice
Copyright (c) 2020 IETF Trust and the persons identified as the Copyright (c) 2020 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 25 skipping to change at page 3, line 25
3.7.4. TCP Keep-Alives . . . . . . . . . . . . . . . . . . . 39 3.7.4. TCP Keep-Alives . . . . . . . . . . . . . . . . . . . 39
3.7.5. The Communication of Urgent Information . . . . . . . 40 3.7.5. The Communication of Urgent Information . . . . . . . 40
3.7.6. Managing the Window . . . . . . . . . . . . . . . . . 41 3.7.6. Managing the Window . . . . . . . . . . . . . . . . . 41
3.8. Interfaces . . . . . . . . . . . . . . . . . . . . . . . 46 3.8. Interfaces . . . . . . . . . . . . . . . . . . . . . . . 46
3.8.1. User/TCP Interface . . . . . . . . . . . . . . . . . 46 3.8.1. User/TCP Interface . . . . . . . . . . . . . . . . . 46
3.8.2. TCP/Lower-Level Interface . . . . . . . . . . . . . . 55 3.8.2. TCP/Lower-Level Interface . . . . . . . . . . . . . . 55
3.9. Event Processing . . . . . . . . . . . . . . . . . . . . 57 3.9. Event Processing . . . . . . . . . . . . . . . . . . . . 57
3.10. Glossary . . . . . . . . . . . . . . . . . . . . . . . . 82 3.10. Glossary . . . . . . . . . . . . . . . . . . . . . . . . 82
4. Changes from RFC 793 . . . . . . . . . . . . . . . . . . . . 87 4. Changes from RFC 793 . . . . . . . . . . . . . . . . . . . . 87
5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 92 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 92
6. Security and Privacy Considerations . . . . . . . . . . . . . 92 6. Security and Privacy Considerations . . . . . . . . . . . . . 93
7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 93 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 94
8. References . . . . . . . . . . . . . . . . . . . . . . . . . 94 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 95
8.1. Normative References . . . . . . . . . . . . . . . . . . 94 8.1. Normative References . . . . . . . . . . . . . . . . . . 95
8.2. Informative References . . . . . . . . . . . . . . . . . 95 8.2. Informative References . . . . . . . . . . . . . . . . . 96
Appendix A. Other Implementation Notes . . . . . . . . . . . . . 99 Appendix A. Other Implementation Notes . . . . . . . . . . . . . 100
A.1. IP Security Compartment and Precedence . . . . . . . . . 100 A.1. IP Security Compartment and Precedence . . . . . . . . . 100
A.1.1. Precedence . . . . . . . . . . . . . . . . . . . . . 100 A.1.1. Precedence . . . . . . . . . . . . . . . . . . . . . 100
A.1.2. MLS Systems . . . . . . . . . . . . . . . . . . . . . 101 A.1.2. MLS Systems . . . . . . . . . . . . . . . . . . . . . 101
A.2. Sequence Number Validation . . . . . . . . . . . . . . . 101 A.2. Sequence Number Validation . . . . . . . . . . . . . . . 101
A.3. Nagle Modification . . . . . . . . . . . . . . . . . . . 101 A.3. Nagle Modification . . . . . . . . . . . . . . . . . . . 102
A.4. Low Water Mark Settings . . . . . . . . . . . . . . . . . 102 A.4. Low Water Mark Settings . . . . . . . . . . . . . . . . . 102
Appendix B. TCP Requirement Summary . . . . . . . . . . . . . . 102 Appendix B. TCP Requirement Summary . . . . . . . . . . . . . . 102
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 106 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 106
1. Purpose and Scope 1. Purpose and Scope
In 1981, RFC 793 [12] was released, documenting the Transmission In 1981, RFC 793 [13] 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.
For several decades, RFC 793 plus a number of other documents have For several decades, RFC 793 plus a number of other documents have
combined to serve as the specification for TCP [41]. Over time, a combined to serve as the specification for TCP [42]. Over time, a
number of errata have been identified on RFC 793, as well as number of errata have been identified on RFC 793, as well as
deficiencies in security, performance, and other aspects. The number deficiencies in security, performance, and other aspects. The number
of enhancements has grown over time across many separate documents. of enhancements has grown over time across many separate documents.
These were never accumulated together into an update to the base These were never accumulated together into an update to the base
specification. specification.
The purpose of this document is to bring together all of the IETF The purpose of this document is to bring together all of the IETF
Standards Track changes that have been made to the basic TCP Standards Track changes that have been made to the basic TCP
functional specification and unify them into an update of the RFC 793 functional specification and unify them into an update of the RFC 793
protocol specification. Some companion documents are referenced for protocol specification. Some companion documents are referenced for
skipping to change at page 5, line 5 skipping to change at page 5, line 5
This document describes the basic functionality expected in modern This document describes the basic functionality expected in modern
implementations of TCP, and replaces the protocol specification in implementations of TCP, and replaces the protocol specification in
RFC 793. It does not replicate or attempt to update the introduction RFC 793. It does not replicate or attempt to update the introduction
and philosophy content in RFC 793 (sections 1 and 2 of that and philosophy content in RFC 793 (sections 1 and 2 of that
document). Other documents are referenced to provide explanation of document). Other documents are referenced to provide explanation of
the theory of operation, rationale, and detailed discussion of design the theory of operation, rationale, and detailed discussion of design
decisions. This document only focuses on the normative behavior of decisions. This document only focuses on the normative behavior of
the protocol. the protocol.
The "TCP Roadmap" [41] provides a more extensive guide to the RFCs The "TCP Roadmap" [42] provides a more extensive guide to the RFCs
that define TCP and describe various important algorithms. The TCP that define TCP and describe various important algorithms. The TCP
Roadmap contains sections on strongly encouraged enhancements that Roadmap contains sections on strongly encouraged enhancements that
improve performance and other aspects of TCP beyond the basic improve performance and other aspects of TCP beyond the basic
operation specified in this document. As one example, implementing operation specified in this document. As one example, implementing
congestion control (e.g. [28]) is a TCP requirement, but is a complex congestion control (e.g. [29]) is a TCP requirement, but is a complex
topic on its own, and not described in detail in this document, as topic on its own, and not described in detail in this document, as
there are many options and possibilities that do not impact basic there are many options and possibilities that do not impact basic
interoperability. Similarly, most common TCP implementations today interoperability. Similarly, most common TCP implementations today
include the high-performance extensions in [39], but these are not include the high-performance extensions in [40], but these are not
strictly required or discussed in this document. strictly required or discussed in this document.
A list of changes from RFC 793 is contained in Section 4. A list of changes from RFC 793 is contained in Section 4.
Each use of RFC 2119 keywords in the document is individually labeled Each use of RFC 2119 keywords in the document is individually labeled
and referenced in Appendix B that summarizes implementation and referenced in Appendix B that summarizes implementation
requirements. Sentences using "MUST" are labeled as "MUST-X" with X requirements. Sentences using "MUST" are labeled as "MUST-X" with X
being a numeric identifier enabling the requirement to be located being a numeric identifier enabling the requirement to be located
easily when referenced from Appendix B. Similarly, sentences using easily when referenced from Appendix B. Similarly, sentences using
"SHOULD" are labeled with "SHLD-X", "MAY" with "MAY-X", and "SHOULD" are labeled with "SHLD-X", "MAY" with "MAY-X", and
skipping to change at page 6, line 9 skipping to change at page 6, line 9
liveness detection capability. liveness detection capability.
Data flow is supported bidirectionally over TCP connections, though Data flow is supported bidirectionally over TCP connections, though
applications are free to send data only unidirectionally, if they so applications are free to send data only unidirectionally, if they so
choose. choose.
TCP uses port numbers to identify application services and to TCP uses port numbers to identify application services and to
multiplex multiple flows between hosts. multiplex multiple flows between hosts.
A more detailed description of TCP's features compared to other A more detailed description of TCP's features compared to other
transport protocols can be found in Section 3.1 of [44]. Further transport protocols can be found in Section 3.1 of [45]. Further
description of the motivations for developing TCP and its role in the description of the motivations for developing TCP and its role in the
Internet stack can be found in Section 2 of [12] and earlier versions Internet stack can be found in Section 2 of [13] and earlier versions
of the TCP specification. of the TCP specification.
3. Functional Specification 3. Functional Specification
3.1. Header Format 3.1. Header Format
TCP segments are sent as internet datagrams. The Internet Protocol TCP segments are sent as internet datagrams. The Internet Protocol
(IP) header carries several information fields, including the source (IP) header carries several information fields, including the source
and destination host addresses [1] [11]. A TCP header follows the and destination host addresses [1] [12]. A TCP header follows the
Internet header, supplying information specific to the TCP protocol. Internet header, supplying information specific to the TCP protocol.
This division allows for the existence of host level protocols other This division allows for the existence of host level protocols other
than TCP. In early development of the Internet suite of protocols, than TCP. In early development of the Internet suite of protocols,
the IP header fields had been a part of TCP. the IP header fields had been a part of TCP.
0 1 2 3 0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Source Port | Destination Port | | Source Port | Destination Port |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
skipping to change at page 7, line 46 skipping to change at page 7, line 46
ECE: ECN-Echo (see [8]) ECE: ECN-Echo (see [8])
URG: Urgent Pointer field significant URG: Urgent Pointer field significant
ACK: Acknowledgment field significant ACK: Acknowledgment field significant
PSH: Push Function (see the Send Call description in PSH: Push Function (see the Send Call description in
Section 3.8.1) Section 3.8.1)
RST: Reset the connection RST: Reset the connection
SYN: Synchronize sequence numbers SYN: Synchronize sequence numbers
FIN: No more data from sender FIN: No more data from sender
The control bits are also know as "flags". Assignment is managed The control bits are also know as "flags". Assignment is managed
by IANA from the "TCP Header Flags" registry [48]. by IANA from the "TCP Header Flags" registry [49].
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 that the sender of this segment is willing to acknowledgment field that 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 (MUST-1). It is RECOMMENDED that implementations will now work (MUST-1). It is RECOMMENDED that implementations will
skipping to change at page 9, line 10 skipping to change at page 9, line 10
zero: bits set to zero zero: bits set to zero
PTCL: the protocol number from the IP header PTCL: the protocol number from the IP header
TCP Length: the TCP header length plus the data length in octets TCP Length: the TCP header length plus the data length in octets
(this is not an explicitly transmitted quantity, but is (this is not an explicitly transmitted quantity, but is
computed), and it does not count the 12 octets of the pseudo computed), and it does not count the 12 octets of the pseudo
header. header.
For IPv6, the pseudo header is contained in section 8.1 of RFC 8200 For IPv6, the pseudo header is contained in section 8.1 of RFC 8200
[11], and contains the IPv6 Source Address and Destination Address, [12], 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
(MUST-2) and the receiver MUST check it (MUST-3). (MUST-2) and the receiver MUST check it (MUST-3).
Urgent Pointer: 16 bits Urgent Pointer: 16 bits
skipping to change at page 9, line 47 skipping to change at page 9, line 47
Case 2: An octet of option-kind, an octet of option-length, and Case 2: An octet of option-kind, an octet of option-length, and
the actual option-data octets. the actual option-data octets.
The option-length counts the two octets of option-kind and option- The option-length counts the two octets of option-kind and option-
length as well as the option-data octets. length as well as the option-data octets.
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 [47], The list of all currently defined options is managed by IANA [48],
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 usages [38]. multiple concurrent usages [39].
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 (MUST-4) (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.
skipping to change at page 11, line 25 skipping to change at page 11, line 25
If this option is present, then it communicates the maximum If this option is present, then it communicates the maximum
receive segment size at the TCP endpoint that sends this receive segment size at the TCP endpoint that sends this
segment. This value is limited by the IP reassembly limit. segment. This value is limited by the IP reassembly limit.
This field may be sent in the initial connection request (i.e., This field may be sent in the initial connection request (i.e.,
in segments with the SYN control bit set) and MUST NOT be sent in segments with the SYN control bit set) and MUST NOT be sent
in other segments (MUST-65). If this option is not used, any in other segments (MUST-65). If this option is not used, any
segment size is allowed. A more complete description of this segment size is allowed. A more complete description of this
option is in Section 3.6.1. option is in Section 3.6.1.
Experimental TCP option values are defined in [21], and [38] Experimental TCP option values are defined in [22], and [39]
describes the current recommended usage for these experimental describes the current recommended usage for these experimental
values. values.
Note: There is ongoing work to extend the space available for Note: There is ongoing work to extend the space available for
TCP options, such as [52]. TCP options, such as [53].
Padding: variable Padding: variable
The TCP header padding is used to ensure that the TCP header ends The TCP header padding is used to ensure that the TCP header ends
and data begins on a 32 bit boundary. The padding is composed of and data begins on a 32 bit boundary. The padding is composed of
zeros. zeros.
3.2. Terminology Overview 3.2. Terminology Overview
This section includes an overview of key terms needed to understand This section includes an overview of key terms needed to understand
skipping to change at page 19, line 20 skipping to change at page 19, line 20
created, an initial sequence number (ISN) generator is employed that created, an initial sequence number (ISN) generator is employed that
selects a new 32 bit ISN. There are security issues that result if selects a new 32 bit ISN. There are security issues that result if
an off-path attacker is able to predict or guess ISN values. an off-path attacker is able to predict or guess ISN values.
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 6528 [35] and This recommended algorithm is further described in RFC 6528 [36] and
builds on the basic clock-driven algorithm from RFC 793. builds on the basic clock-driven algorithm from RFC 793.
A TCP implementation MUST use a clock-driven selection of initial A TCP implementation MUST use a clock-driven selection of initial
sequence numbers (MUST-8), and SHOULD generate its Initial Sequence sequence numbers (MUST-8), and SHOULD generate its Initial Sequence
Numbers with the expression: 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")
(SHLD-1). F() MUST NOT be computable from the outside (MUST-9), or (SHLD-1). F() MUST NOT be computable from the outside (MUST-9), or
an attacker could still guess at sequence numbers from the ISN used an attacker could still guess at sequence numbers from the ISN used
for some other connection. The PRF could be implemented as a for some other connection. The PRF could be implemented as a
cryptographic hash of the concatenation of the TCP connection cryptographic hash of the concatenation of the TCP connection
parameters and some secret data. For discussion of the selection of parameters and some secret data. For discussion of the selection of
a specific hash algorithm and management of the secret key data, a specific hash algorithm and management of the secret key data,
please see Section 3 of [35]. please see Section 3 of [36].
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 peer, and the initial receive sequence number the data sending TCP peer, and the initial receive sequence number
(IRS) is learned during the connection establishing procedure. (IRS) is learned during the connection establishing procedure.
For a connection to be established or initialized, the two TCP peers For a connection to be established or initialized, the two TCP peers
must synchronize on each other's initial sequence numbers. This is must synchronize on each other's initial sequence numbers. This is
done in an exchange of connection establishing segments carrying a done in an exchange of connection establishing segments carrying a
control bit called "SYN" (for synchronize) and the initial sequence control bit called "SYN" (for synchronize) and the initial sequence
skipping to change at page 20, line 25 skipping to change at page 20, line 25
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 TCP implementations may tied to a global clock in the network, and TCP implementations may
have different mechanisms for picking the ISN's. The receiver of the have different mechanisms for picking the ISN's. The receiver of the
first SYN has no way of knowing whether the segment was an old first SYN has no way of knowing whether the segment was an old
delayed one or not, unless it remembers the last sequence number used delayed one or not, unless it remembers the last sequence number used
on the connection (which is not always possible), and so it must ask on the connection (which is not always possible), and so it must ask
the sender to verify this SYN. The three way handshake and the the sender to verify this SYN. The three way handshake and the
advantages of a clock-driven scheme are discussed in [54]. advantages of a clock-driven scheme are discussed in [55].
Knowing When to Keep Quiet Knowing When to Keep Quiet
A theoretical problem exists where data could be corrupted due to A theoretical problem exists where data could be corrupted due to
confusion between old segments in the network and new ones after a confusion between old segments in the network and new ones after a
host reboots, if the same port numbers and sequence space are reused. host reboots, if the same port numbers and sequence space are reused.
The "Quiet Time" concept discussed below addresses this and the The "Quiet Time" concept discussed below addresses this and the
discussion of it is included for situations where it might be discussion of it is included for situations where it might be
relevant, although it is not felt to be necessary in most current relevant, although it is not felt to be necessary in most current
implementations. The problem have been more relevant earlier in the implementations. The problem have been more relevant earlier in the
skipping to change at page 25, line 36 skipping to change at page 25, line 36
2. SYN-SENT --> <SEQ=100><CTL=SYN> ... 2. SYN-SENT --> <SEQ=100><CTL=SYN> ...
3. (duplicate) ... <SEQ=90><CTL=SYN> --> SYN-RECEIVED 3. (duplicate) ... <SEQ=90><CTL=SYN> --> SYN-RECEIVED
4. SYN-SENT <-- <SEQ=300><ACK=91><CTL=SYN,ACK> <-- SYN-RECEIVED 4. SYN-SENT <-- <SEQ=300><ACK=91><CTL=SYN,ACK> <-- SYN-RECEIVED
5. SYN-SENT --> <SEQ=91><CTL=RST> --> LISTEN 5. SYN-SENT --> <SEQ=91><CTL=RST> --> LISTEN
6. ... <SEQ=100><CTL=SYN> --> SYN-RECEIVED 6. ... <SEQ=100><CTL=SYN> --> SYN-RECEIVED
7. SYN-SENT <-- <SEQ=400><ACK=101><CTL=SYN,ACK> <-- SYN-RECEIVED 7. ESTABLISHED <-- <SEQ=400><ACK=101><CTL=SYN,ACK> <-- SYN-RECEIVED
8. ESTABLISHED --> <SEQ=101><ACK=401><CTL=ACK> --> ESTABLISHED 8. ESTABLISHED --> <SEQ=101><ACK=401><CTL=ACK> --> ESTABLISHED
Figure 7: Recovery from Old Duplicate SYN Figure 7: Recovery from Old Duplicate SYN
As a simple example of recovery from old duplicates, consider As a simple example of recovery from old duplicates, consider
Figure 7. At line 3, an old duplicate SYN arrives at TCP Peer B. Figure 7. At line 3, an old duplicate SYN arrives at TCP Peer B.
TCP Peer B cannot tell that this is an old duplicate, so it responds TCP Peer B cannot tell that this is an old duplicate, so it responds
normally (line 4). TCP Peer A detects that the ACK field is normally (line 4). TCP Peer A detects that the ACK field is
incorrect and returns a RST (reset) with its SEQ field selected to incorrect and returns a RST (reset) with its SEQ field selected to
skipping to change at page 32, line 19 skipping to change at page 32, line 19
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 (MAY-1). If such a host issues a CLOSE call while the connection (MAY-1). If such a host issues a CLOSE call while
received data is still pending in the TCP connection, or if new data received data is still pending in the TCP connection, or if new data
is received after CLOSE is called, its TCP implementation SHOULD send is received after CLOSE is called, its TCP implementation SHOULD send
a RST to show that data was lost (SHLD-3). See [17] section 2.17 for a RST to show that data was lost (SHLD-3). See [18] section 2.17 for
discussion. 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) (MUST-13). state for a time 2xMSL (Maximum Segment Lifetime) (MUST-13).
However, it MAY accept a new SYN from the remote TCP endpoint to However, it MAY accept a new SYN from the remote TCP endpoint to
reopen the connection directly from TIME-WAIT state (MAY-2), if it: 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 [33] in order to support higher connection is described in [34] 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 (SHLD-4). benefits for busy Internet servers (SHLD-4).
3.6. Segmentation 3.6. Segmentation
The term "segmentation" refers to the activity TCP performs when The term "segmentation" refers to the activity TCP performs when
ingesting a stream of bytes from a sending application and ingesting a stream of bytes from a sending application and
packetizing that stream of bytes into TCP segments. Individual TCP packetizing that stream of bytes into TCP segments. Individual TCP
segments often do not correspond one-for-one to individual send (or segments often do not correspond one-for-one to individual send (or
socket write) calls from the application. Applications may perform socket write) calls from the application. Applications may perform
writes at the granularity of messages in the upper layer protocol, writes at the granularity of messages in the upper layer protocol,
but TCP guarantees no boundary coherence between the TCP segments but TCP guarantees no boundary coherence between the TCP segments
sent and received versus user application data read or write buffer sent and received versus user application data read or write buffer
boundaries. In some specific protocols, such as RDMA using DDP and boundaries. In some specific protocols, such as RDMA using DDP and
MPA [25], there are performance optimizations possible when the MPA [26], there are performance optimizations possible when the
relation between TCP segments and application data units can be relation between TCP segments and application data units can be
controlled, and MPA includes a specific mechanism for detecting and controlled, and MPA includes a specific mechanism for detecting and
verifying this relationship between TCP segments and application verifying this relationship between TCP segments and application
message data strcutures, but this is specific to applications like message data strcutures, but this is specific to applications like
RDMA. In general, multiple goals influence the sizing of TCP RDMA. In general, multiple goals influence the sizing of TCP
segments created by a TCP implementation. segments created by a TCP implementation.
Goals driving the sending of larger segments include: Goals driving the sending of larger segments include:
o Reducing the number of packets in flight within the network. o Reducing the number of packets in flight within the network.
skipping to change at page 34, line 21 skipping to change at page 34, line 21
when its receive MSS differs from the default 536 for IPv4 or 1220 when its receive MSS differs from the default 536 for IPv4 or 1220
for IPv6 (SHLD-5), and MAY send it always (MAY-3). for IPv6 (SHLD-5), and MAY send it always (MAY-3).
If an MSS option is not received at connection setup, TCP If an MSS option is not received at connection setup, TCP
implementations MUST assume a default send MSS of 536 (576-40) for implementations MUST assume a default send MSS of 536 (576-40) for
IPv4 or 1220 (1280 - 60) for IPv6 (MUST-15). IPv4 or 1220 (1280 - 60) for IPv6 (MUST-15).
The maximum size of a segment that TCP endpoint really sends, the The maximum size of a segment that TCP endpoint really sends, the
"effective send MSS," MUST be the smaller (MUST-16) of the send MSS "effective send MSS," MUST be the smaller (MUST-16) of the send MSS
(that reflects the available reassembly buffer size at the remote (that reflects the available reassembly buffer size at the remote
host, the EMTU_R [14]) and the largest transmission size permitted by host, the EMTU_R [15]) and the largest transmission size permitted by
the IP layer (EMTU_S [14]): the IP layer (EMTU_S [15]):
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 35, line 5 skipping to change at page 35, line 5
o IPoptionsize is the size of any IP options associated with a TCP o IPoptionsize is the size of any IP options associated with a TCP
connection. Note that some options may not be included on all connection. Note that some options may not be included on all
packets, but that for each segment sent, the sender should adjust packets, but that for each segment sent, the sender should adjust
the data length accordingly, within the Eff.snd.MSS. the data length accordingly, within the Eff.snd.MSS.
The MSS value to be sent in an MSS option should be equal to the The MSS value to be sent in an MSS option should be equal to the
effective MTU minus the fixed IP and TCP headers. By ignoring both effective MTU minus the fixed IP and TCP headers. By ignoring both
IP and TCP options when calculating the value for the MSS option, if IP and TCP options when calculating the value for the MSS option, if
there are any IP or TCP options to be sent in a packet, then the there are any IP or TCP options to be sent in a packet, then the
sender must decrease the size of the TCP data accordingly. RFC 6691 sender must decrease the size of the TCP data accordingly. RFC 6691
[36] discusses this in greater detail. [37] discusses this in greater detail.
The MSS value to be sent in an MSS option must be less than or equal The MSS value to be sent in an MSS option must be less than or equal
to: to:
MMS_R - 20 MMS_R - 20
where MMS_R is the maximum size for a transport-layer message that where MMS_R is the maximum size for a transport-layer message that
can be received (and reassembled at the IP layer) (MUST-67). TCP can be received (and reassembled at the IP layer) (MUST-67). TCP
obtains MMS_R and MMS_S from the IP layer; see the generic call obtains MMS_R and MMS_S from the IP layer; see the generic call
GET_MAXSIZES in Section 3.4 of RFC 1122. These are defined in terms GET_MAXSIZES in Section 3.4 of RFC 1122. These are defined in terms
of their IP MTU equivalents, EMTU_R and EMTU_S [14]. of their IP MTU equivalents, EMTU_R and EMTU_S [15].
When TCP is used in a situation where either the IP or TCP headers When TCP is used in a situation where either the IP or TCP headers
are not fixed, the sender must reduce the amount of TCP data in any are not fixed, the sender must reduce the amount of TCP data in any
given packet by the number of octets used by the IP and TCP options. given packet by the number of octets used by the IP and TCP options.
This has been a point of confusion historically, as explained in RFC This has been a point of confusion historically, as explained in RFC
6691, Section 3.1. 6691, Section 3.1.
3.6.2. Path MTU Discovery 3.6.2. Path MTU Discovery
A TCP implementation may be aware of the MTU on directly connected A TCP implementation may be aware of the MTU on directly connected
skipping to change at page 35, line 45 skipping to change at page 35, line 45
avoid both on-path (for IPv4) and source fragmentation (IPv4 and avoid both on-path (for IPv4) and source fragmentation (IPv4 and
IPv6). IPv6).
PMTUD for IPv4 [2] or IPv6 [3] is implemented in conjunction between PMTUD for IPv4 [2] or IPv6 [3] is implemented in conjunction between
TCP, IP, and ICMP protocols. It relies both on avoiding source TCP, IP, and ICMP protocols. It relies both on avoiding source
fragmentation and setting the IPv4 DF (don't fragment) flag, the fragmentation and setting the IPv4 DF (don't fragment) flag, the
latter to inhibit on-path fragmentation. It relies on ICMP errors latter to inhibit on-path fragmentation. It relies on ICMP errors
from routers along the path, whenever a segment is too large to from routers along the path, whenever a segment is too large to
traverse a link. Several adjustments to a TCP implementation with traverse a link. Several adjustments to a TCP implementation with
PMTUD are described in RFC 2923 in order to deal with problems PMTUD are described in RFC 2923 in order to deal with problems
experienced in practice [7]. PLPMTUD [22] is a Standards Track experienced in practice [7]. PLPMTUD [23] is a Standards Track
improvement to PMTUD that relaxes the requirement for ICMP support improvement to PMTUD that relaxes the requirement for ICMP support
across a path, and improves performance in cases where ICMP is not across a path, and improves performance in cases where ICMP is not
consistently conveyed, but still tries to avoid source fragmentation. consistently conveyed, but still tries to avoid source fragmentation.
The mechanisms in all four of these RFCs are recommended to be The mechanisms in all four of these RFCs are recommended to be
included in TCP implementations. included in TCP implementations.
The TCP MSS option specifies an upper bound for the size of packets The TCP MSS option specifies an upper bound for the size of packets
that can be received. Hence, setting the value in the MSS option too that can be received. Hence, setting the value in the MSS option too
small can impact the ability for PMTUD or PLPMTUD to find a larger small can impact the ability for PMTUD or PLPMTUD to find a larger
path MTU. RFC 1191 discusses this implication of many older TCP path MTU. RFC 1191 discusses this implication of many older TCP
implementations setting MSS to 536 for non-local destinations, rather implementations setting MSS to 536 for non-local destinations, rather
than deriving it from the MTUs of connected interfaces as than deriving it from the MTUs of connected interfaces as
recommended. recommended.
3.6.3. Interfaces with Variable MTU Values 3.6.3. Interfaces with Variable MTU Values
The effective MTU can sometimes vary, as when used with variable The effective MTU can sometimes vary, as when used with variable
compression, e.g., RObust Header Compression (ROHC) [29]. It is compression, e.g., RObust Header Compression (ROHC) [30]. It is
tempting for a TCP implementation to want to advertise the largest tempting for a TCP implementation to want to advertise the largest
possible MSS, to support the most efficient use of compressed possible MSS, to support the most efficient use of compressed
payloads. Unfortunately, some compression schemes occasionally need payloads. Unfortunately, some compression schemes occasionally need
to transmit full headers (and thus smaller payloads) to resynchronize to transmit full headers (and thus smaller payloads) to resynchronize
state at their endpoint compressors/decompressors. If the largest state at their endpoint compressors/decompressors. If the largest
MTU is used to calculate the value to advertise in the MSS option, MTU is used to calculate the value to advertise in the MSS option,
TCP retransmission may interfere with compressor resynchronization. TCP retransmission may interfere with compressor resynchronization.
As a result, when the effective MTU of an interface varies packet-to- As a result, when the effective MTU of an interface varies packet-to-
packet, TCP implementations SHOULD use the smallest effective MTU of packet, TCP implementations SHOULD use the smallest effective MTU of
the interface to calculate the value to advertise in the MSS option the interface to calculate the value to advertise in the MSS option
(SHLD-6). (SHLD-6).
3.6.4. Nagle Algorithm 3.6.4. Nagle Algorithm
The "Nagle algorithm" was described in RFC 896 [13] and was The "Nagle algorithm" was described in RFC 896 [14] and was
recommended in RFC 1122 [14] for mitigation of an early problem of recommended in RFC 1122 [15] 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 endpoint buffers all user data (regardless of the PSH sending TCP endpoint buffers all user data (regardless of the PSH
bit), until the outstanding data has been acknowledged or until the bit), until the outstanding data has been acknowledged or until the
TCP endpoint can send a full-sized segment (Eff.snd.MSS bytes). TCP endpoint can send a full-sized segment (Eff.snd.MSS bytes).
A TCP implementation SHOULD implement the Nagle Algorithm to coalesce A TCP implementation SHOULD implement the Nagle Algorithm to coalesce
short segments (SHLD-7). However, there MUST be a way for an short segments (SHLD-7). However, there MUST be a way for an
application to disable the Nagle algorithm on an individual application to disable the Nagle algorithm on an individual
connection (MUST-17). In all cases, sending data is also subject to connection (MUST-17). In all cases, sending data is also subject to
the limitation imposed by the Slow Start algorithm [28]. the limitation imposed by the Slow Start algorithm [29].
3.6.5. IPv6 Jumbograms 3.6.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 [6] defines that an MSS value of 65,535 option can convey. RFC 2675 [6] 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.
The Jumbo Payload option need not be implemented or understood by The Jumbo Payload option need not be implemented or understood by
IPv6 nodes that do not support attachment to links with a MTU greater IPv6 nodes that do not support attachment to links with a MTU greater
than 65,575 [6], and the present IPv6 Node Requiements does not than 65,575 [6], and the present IPv6 Node Requiements does not
include support for Jumbograms [46]. include support for Jumbograms [47].
3.7. Data Communication 3.7. Data Communication
Once the connection is established data is communicated by the Once the connection is established data is communicated by the
exchange of segments. Because segments may be lost due to errors exchange of segments. Because segments may be lost due to errors
(checksum test failure), or network congestion, TCP uses (checksum test failure), or network congestion, TCP uses
retransmission to ensure delivery of every segment. Duplicate retransmission to ensure delivery of every segment. Duplicate
segments may arrive due to network or TCP retransmission. As segments may arrive due to network or TCP retransmission. As
discussed in the section on sequence numbers the TCP implementation discussed in the section on sequence numbers the TCP implementation
performs certain tests on the sequence and acknowledgment numbers in performs certain tests on the sequence and acknowledgment numbers in
skipping to change at page 38, line 24 skipping to change at page 38, line 24
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.
RFC 1122 allows that if a retransmitted packet is identical to the RFC 1122 allows that if a retransmitted packet is identical to the
original packet (which implies not only that the data boundaries have original packet (which implies not only that the data boundaries have
not changed, but also that none of the headers have changed), then not changed, but also that none of the headers have changed), then
the same IPv4 Identification field MAY be used (see Section 3.2.1.5 the same IPv4 Identification field MAY be used (see Section 3.2.1.5
of RFC 1122) (MAY-4). The same IP identification field may be reused of RFC 1122) (MAY-4). The same IP identification field may be reused
anyways, since it is only meaningful when a datagram is fragmented anyways, since it is only meaningful when a datagram is fragmented
[37]. TCP implementations should not rely on or typically interact [38]. TCP implementations should not rely on or typically interact
with this IPv4 header field in any way. It is not a reasonable way with this IPv4 header field in any way. It is not a reasonable way
to either indicate duplicate sent segments, nor to identify duplicate to either indicate duplicate sent segments, nor to identify duplicate
received segments. received segments.
3.7.2. TCP Congestion Control 3.7.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 endpoint MUST implement RFC 5681 (MUST-19). A TCP endpoint 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 [43]. an IETF Standards Track enhancement that has many benefits [44].
A TCP endpoint SHOULD implement ECN as described in RFC 3168 (SHLD- A TCP endpoint SHOULD implement ECN as described in RFC 3168 (SHLD-
8). 8).
3.7.3. TCP Connection Failures 3.7.3. TCP Connection Failures
Excessive retransmission of the same segment by a TCP endpoint Excessive retransmission of the same segment by a TCP endpoint
indicates some failure of the remote host or the Internet path. This indicates some failure of the remote host or the Internet path. This
failure may be of short or long duration. The following procedure failure may be of short or long duration. The following procedure
MUST be used to handle excessive retransmissions of data segments MUST be used to handle excessive retransmissions of data segments
(MUST-20): (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 [15]
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 (MUST-21) be able to set the value for R2 (d) An application MUST (MUST-21) be able to set the value for R2
for a particular connection. For example, an interactive for a particular connection. For example, an interactive
application might set R2 to "infinity," giving the user control application might set R2 to "infinity," giving the user control
over when to disconnect. over when to disconnect.
skipping to change at page 40, line 28 skipping to change at page 40, line 28
An implementation SHOULD send a keep-alive segment with no data An implementation SHOULD send a keep-alive segment with no data
(SHLD-12); however, it MAY be configurable to send a keep-alive (SHLD-12); however, it MAY be configurable to send a keep-alive
segment containing one garbage octet (MAY-6), for compatibility with segment containing one garbage octet (MAY-6), for compatibility with
erroneous TCP implementations. erroneous TCP implementations.
3.7.5. The Communication of Urgent Information 3.7.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 (SHLD- new applications SHOULD NOT employ the TCP urgent mechanism (SHLD-
13). However, TCP implementations MUST still include support for the 13). However, TCP implementations MUST still include support for the
urgent mechanism (MUST-30). Details can be found in RFC 6093 [32]. urgent mechanism (MUST-30). Details can be found in RFC 6093 [33].
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 endpoint to indicate to the receiving to permit the receiving TCP endpoint to indicate to the receiving
user when all the currently known urgent data has been received by user when all the currently known urgent data has been received by
the user. 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 endpoint, the receive sequence number (RCV.NXT) at the receiving TCP endpoint,
skipping to change at page 41, line 11 skipping to change at page 41, line 11
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 implementation MUST support a sequence of urgent data of any A TCP implementation MUST support a sequence of urgent data of any
length (MUST-31). [14] length (MUST-31). [15]
The urgent pointer MUST point to the sequence number of the octet The urgent pointer MUST point to the sequence number of the octet
following the urgent data (MUST-62). following the urgent data (MUST-62).
A TCP implementation MUST (MUST-32) inform the application layer A TCP implementation MUST (MUST-32) inform the application layer
asynchronously whenever it receives an Urgent pointer and there was asynchronously whenever it receives an Urgent pointer and there was
previously no pending urgent data, or whenvever the Urgent pointer previously no pending urgent data, or whenvever the Urgent pointer
advances in the data stream. There MUST (MUST-33) be a way for the advances in the data stream. There MUST (MUST-33) be a way for the
application to learn how much urgent data remains to be read from the application to learn how much urgent data remains to be read from the
connection, or at least to determine whether or not more urgent data connection, or at least to determine whether or not more urgent data
remains to be read. [14] remains to be read. [15]
3.7.6. Managing the Window 3.7.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 endpoint packages the data to be transmitted into The sending TCP endpoint packages the data to be transmitted into
skipping to change at page 42, line 8 skipping to change at page 42, line 8
Indicating a large window encourages transmissions. If more data Indicating a large window encourages transmissions. If more data
arrives than can be accepted, it will be discarded. This will result arrives than can be accepted, it will be discarded. This will result
in excessive retransmissions, adding unnecessarily to the load on the in excessive retransmissions, adding unnecessarily to the load on the
network and the TCP endpoints. Indicating a small window may network and the TCP endpoints. Indicating a small window may
restrict the transmission of data to the point of introducing a round restrict the transmission of data to the point of introducing a round
trip delay between each new segment transmitted. trip delay between each new segment transmitted.
The mechanisms provided allow a TCP endpoint to advertise a large The mechanisms provided allow a TCP endpoint to advertise a large
window and to subsequently advertise a much smaller window without window and to subsequently advertise a much smaller window without
having accepted that much data. This, so called "shrinking the having accepted that much data. This, so called "shrinking the
window," is strongly discouraged. The robustness principle [14] window," is strongly discouraged. The robustness principle [15]
dictates that TCP peers will not shrink the window themselves, but dictates that TCP peers will not shrink the window themselves, but
will be prepared for such behavior on the part of other TCP peers. will be prepared for such behavior on the part of other TCP peers.
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 (SHLD-14). However, a sending TCP peer MUST window edge to the left (SHLD-14). However, a sending TCP peer MUST
be robust against window shrinking, which may cause the "useable be robust against window shrinking, which may cause the "useable
window" (see Section 3.7.6.2.1) to become negative (MUST-34). window" (see Section 3.7.6.2.1) to become negative (MUST-34).
If this happens, the sender SHOULD NOT send new data (SHLD-15), but If this happens, the sender SHOULD NOT send new data (SHLD-15), but
SHOULD retransmit normally the old unacknowledged data between SHOULD retransmit normally the old unacknowledged data between
skipping to change at page 42, line 47 skipping to change at page 42, line 47
Probing of zero (offered) windows MUST be supported (MUST-36). Probing of zero (offered) windows MUST be supported (MUST-36).
A TCP implementation MAY keep its offered receive window closed A TCP implementation MAY keep its offered receive window closed
indefinitely (MAY-8). As long as the receiving TCP peer continues to indefinitely (MAY-8). As long as the receiving TCP peer continues to
send acknowledgments in response to the probe segments, the sending send acknowledgments in response to the probe segments, the sending
TCP peer MUST allow the connection to stay open (MUST-37). This TCP peer MUST allow the connection to stay open (MUST-37). This
enables TCP to function in scenarios such as the "printer ran out of enables TCP to function in scenarios such as the "printer ran out of
paper" situation described in Section 4.2.2.17 of RFC1122. The paper" situation described in Section 4.2.2.17 of RFC1122. The
behavior is subject to the implementation's resource management behavior is subject to the implementation's resource management
concerns, as noted in [34]. concerns, as noted in [35].
When the receiving TCP peer has a zero window and a segment arrives When the receiving TCP peer has a zero window and a segment arrives
it must still send an acknowledgment showing its next expected it must still send an acknowledgment showing its next expected
sequence number and current window (zero). sequence number and current window (zero).
The transmitting host SHOULD send the first zero-window probe when a The transmitting host SHOULD send the first zero-window probe when a
zero window has existed for the retransmission timeout period (SHLD- zero window has existed for the retransmission timeout period (SHLD-
29) (see Section 3.7.1), and SHOULD increase exponentially the 29) (see Section 3.7.1), and SHOULD increase exponentially the
interval between successive probes (SHLD-30). interval between successive probes (SHLD-30).
skipping to change at page 45, line 49 skipping to change at page 45, line 49
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 endpoint SHOULD implement a delayed ACK (SHLD-18), but an ACK A TCP endpoint SHOULD implement a delayed ACK (SHLD-18), but an ACK
should not be excessively delayed; in particular, the delay MUST be should not be excessively delayed; in particular, the delay MUST be
less than 0.5 seconds (MUST-40), and in a stream of full-sized less than 0.5 seconds (MUST-40), and in a stream of full-sized
segments there SHOULD be an ACK for at least every second segment segments there SHOULD be an ACK for at least every second segment
(SHLD-19). Excessive delays on ACK's can disturb the round-trip (SHLD-19). Excessive delays on ACK's can disturb the round-trip
timing and packet "clocking" algorithms. More complete discussion of timing and packet "clocking" algorithms. More complete discussion of
delayed ACK behavior is in Section 4.2 of RFC 5681 [28], including delayed ACK behavior is in Section 4.2 of RFC 5681 [29], including
rules for streams of segments that are not full-sized. Note that rules for streams of segments that are not full-sized. Note that
there are several current practices that further lead to a reduced there are several current practices that further lead to a reduced
number of ACKs, including generic receive offload (GRO), ACK number of ACKs, including generic receive offload (GRO), ACK
compression, and ACK decimation [19]. compression, and ACK decimation [20].
3.8. Interfaces 3.8. 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 TCP implementations might use. that TCP implementations might use.
skipping to change at page 46, line 30 skipping to change at page 46, line 30
The following functional description of user commands to the TCP The following functional description of user commands to the TCP
implementation is, at best, fictional, since every operating system implementation is, at best, fictional, since every operating system
will have different facilities. Consequently, we must warn readers will have different facilities. Consequently, we must warn readers
that different TCP implementations may have different user that different TCP implementations may have different user
interfaces. However, all TCP implementations must provide a certain interfaces. However, all TCP implementations must provide a certain
minimum set of services to guarantee that all TCP implementations can minimum set of services to guarantee that all TCP implementations can
support the same protocol hierarchy. This section specifies the support the same protocol hierarchy. This section specifies the
functional interfaces required of all TCP implementations. functional interfaces required of all TCP implementations.
Section 3.1 of [45] also identifies primitives provided by TCP, and Section 3.1 of [46] also identifies primitives provided by TCP, and
could be used as an additional reference for implementers. could be used as an additional reference for implementers.
TCP User Commands TCP User Commands
The following sections functionally characterize a USER/TCP The following sections functionally characterize a USER/TCP
interface. The notation used is similar to most procedure or interface. The notation used is similar to most procedure or
function calls in high level languages, but this usage is not function calls in high level languages, but this usage is not
meant to rule out trap type service calls. meant to rule out trap type service calls.
The user commands described below specify the basic functions the The user commands described below specify the basic functions the
skipping to change at page 47, line 31 skipping to change at page 47, line 31
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 (MUST-41). previously created connection record (MUST-41).
A TCP implementation that supports multiple concurrent users A TCP implementation that supports multiple concurrent
MUST provide an OPEN call that will functionally allow an connections MUST provide an OPEN call that will functionally
application to LISTEN on a port while a connection block with allow an application to LISTEN on a port while a connection
the same local port is in SYN-SENT or SYN-RECEIVED state (MUST- block with the same local port is in SYN-SENT or SYN-RECEIVED
42). state (MUST-42).
On an active OPEN command, the TCP endpoint will begin the On an active OPEN command, the TCP endpoint will begin the
procedure to synchronize (i.e., establish) the connection at procedure to synchronize (i.e., establish) the connection at
once. 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
endpoint will abort the connection. The present global default endpoint will abort the connection. The present global default
is five minutes. is five minutes.
skipping to change at page 49, line 49 skipping to change at page 49, line 49
buffer the data before sending, without regard to the PUSH flag buffer the data before sending, without regard to the PUSH flag
(see Section 3.6.4). (see Section 3.6.4).
An application program is logically required to set the PUSH An application program is logically required to set the PUSH
flag in a SEND call whenever it needs to force delivery of the flag in a SEND call whenever it needs to force delivery of the
data to avoid a communication deadlock. However, a TCP data to avoid a communication deadlock. However, a TCP
implementation SHOULD send a maximum-sized segment whenever implementation SHOULD send a maximum-sized segment whenever
possible (SHLD-28), to improve performance (see possible (SHLD-28), to improve performance (see
Section 3.7.6.2.1). Section 3.7.6.2.1).
New applications SHOULD NOT set the URGENT flag [32] due to New applications SHOULD NOT set the URGENT flag [33] due to
implementation differences and middlebox issues (SHLD-13). 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
peer will have the urgent pointer set. The receiving TCP peer peer will have the urgent pointer set. The receiving TCP peer
will signal the urgent condition to the receiving process if will signal the urgent condition to the receiving process if
the urgent pointer indicates that data preceding the urgent the urgent pointer indicates that data preceding the urgent
pointer has not been consumed by the receiving process. The pointer has not been consumed by the receiving process. The
purpose of urgent is to stimulate the receiver to process the purpose of urgent is to stimulate the receiver to process the
urgent data and to indicate to the receiver when all the urgent data and to indicate to the receiver when all the
currently known urgent data has been received. The number of currently known urgent data has been received. The number of
skipping to change at page 55, line 15 skipping to change at page 55, line 15
field used for ACK segments. field used for ACK segments.
TCP implementations MAY pass the most recently received TCP implementations MAY pass the most recently received
Differentiated Services field up to the application (MAY-9). Differentiated Services field up to the application (MAY-9).
3.8.2. TCP/Lower-Level Interface 3.8.2. TCP/Lower-Level Interface
The TCP endpoint calls on a lower level protocol module to actually The TCP endpoint calls on a lower level protocol module to actually
send and receive information over a network. The two current send and receive information over a network. The two current
standard Internet Protocol (IP) versions layered below TCP are IPv4 standard Internet Protocol (IP) versions layered below TCP are IPv4
[1] and IPv6 [11]. [1] and IPv6 [12].
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
skipping to change at page 55, line 41 skipping to change at page 55, line 41
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) [42]. Generally, an application SHOULD NOT 5.1, 5.3, and 6) [43]. 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 (SHLD-23). 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
implementations MUST ignore options that it does not understand implementations MUST ignore options that it does not understand
skipping to change at page 56, line 41 skipping to change at page 56, line 41
3.8.2.2. ICMP Messages 3.8.2.2. ICMP Messages
TCP implementations MUST act on an ICMP error message passed up from TCP implementations MUST act on an ICMP error message passed up from
the IP layer, directing it to the connection that created the error the IP layer, directing it to the connection that created the error
(MUST-54). The necessary demultiplexing information can be found in (MUST-54). The necessary demultiplexing information can be found in
the IP header contained within the ICMP message. the IP header contained within the ICMP message.
This applies to ICMPv6 in addition to IPv4 ICMP. This applies to ICMPv6 in addition to IPv4 ICMP.
[26] contains discussion of specific ICMP and ICMPv6 messages [27] 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 implementations MUST silently discard any received ICMP Source TCP implementations MUST silently discard any received ICMP Source
Quench messages (MUST-55). See [10] for discussion. Quench messages (MUST-55). See [10] 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,
skipping to change at page 57, line 14 skipping to change at page 57, line 14
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 implementations MUST NOT abort the connection (MUST-56), and it TCP implementations MUST NOT abort the connection (MUST-56), and it
SHOULD make the information available to the application (SHLD-25). SHOULD make the 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 implementations SHOULD These are hard error conditions, so TCP implementations SHOULD
abort the connection (SHLD-26). [26] notes that some abort the connection (SHLD-26). [27] notes that some
implementations do not abort connections when an ICMP hard error is implementations do not abort connections when an ICMP hard error is
received for a connection that is in any of the synchronized received for a connection that is in any of the synchronized
states. states.
Note that [26] section 4 describes widespread implementation behavior Note that [27] 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.8.2.3. Remote Address Validation 3.8.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 (MUST-63) (see Section 3.2.1.3 of either by TCP or by the IP layer (MUST-63) (see Section 3.2.1.3 of
[14]). [15]).
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 (MUST-57). 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.9. Event Processing 3.9. Event Processing
skipping to change at page 70, line 5 skipping to change at page 70, line 5
acceptable. Some deployed TCP code has used the check acceptable. Some deployed TCP code has used the check
SEG.ACK == SND.NXT (using "==" rather than "=<", but this SEG.ACK == SND.NXT (using "==" rather than "=<", but this
is not appropriate when the stack is capable of sending is not appropriate when the stack is capable of sending
data on the SYN, because the TCP peer may not accept and data on the SYN, because the TCP peer may not accept and
acknowledge all of the data on the SYN. acknowledge all of the data on the SYN.
second check the RST bit second check the RST bit
If the RST bit is set If the RST bit is set
A potential blind reset attack is described in RFC 5961 A potential blind reset attack is described in RFC 5961
[31], with the mitigation that a TCP implementation [32], with the mitigation that a TCP implementation
SHOULD first check that the sequence number exactly SHOULD first check that the sequence number exactly
matches RCV.NXT prior to executing the action in the next matches RCV.NXT prior to executing the action in the next
paragraph. paragraph.
If the ACK was acceptable then signal the user "error: If the ACK was acceptable then signal the user "error:
connection reset", drop the segment, enter CLOSED state, connection reset", drop the segment, enter CLOSED state,
delete TCB, and return. Otherwise (no ACK) drop the delete TCB, and return. Otherwise (no ACK) drop the
segment and return. segment and return.
third check the security third check the security
skipping to change at page 71, line 21 skipping to change at page 71, line 21
If there are other controls or text in the segment, queue If there are other controls or text in the segment, queue
them for processing after the ESTABLISHED state has been them for processing after the ESTABLISHED state has been
reached, return. reached, return.
Note that it is legal to send and receive application data Note that it is legal to send and receive application data
on SYN segments (this is the "text in the segment" mentioned on SYN segments (this is the "text in the segment" mentioned
above. There has been significant misinformation and above. There has been significant misinformation and
misunderstanding of this topic historically. Some firewalls misunderstanding of this topic historically. Some firewalls
and security devices consider this suspicious. However, the and security devices consider this suspicious. However, the
capability was used in T/TCP [16] and is used in TCP Fast capability was used in T/TCP [17] and is used in TCP Fast
Open (TFO) [40], so is important for implementations and Open (TFO) [41], so is important for implementations and
network devices to permit. network devices to permit.
fifth, if neither of the SYN or RST bits is set then drop the fifth, if neither of the SYN or RST bits is set then drop the
segment and return. segment and return.
Otherwise, Otherwise,
first check sequence number first check sequence number
SYN-RECEIVED STATE SYN-RECEIVED STATE
skipping to change at page 72, line 38 skipping to change at page 72, line 38
If an incoming segment is not acceptable, an acknowledgment If an incoming segment is not acceptable, an acknowledgment
should be sent in reply (unless the RST bit is set, if so should be sent in reply (unless the RST bit is set, if so
drop the segment and return): drop the segment and return):
<SEQ=SND.NXT><ACK=RCV.NXT><CTL=ACK> <SEQ=SND.NXT><ACK=RCV.NXT><CTL=ACK>
After sending the acknowledgment, drop the unacceptable After sending the acknowledgment, drop the unacceptable
segment and return. segment and return.
Note that for the TIME-WAIT state, there is an improved Note that for the TIME-WAIT state, there is an improved
algorithm described in [33] for handling incoming SYN algorithm described in [34] for handling incoming SYN
segments, that utilizes timestamps rather than relying on segments, that utilizes timestamps rather than relying on
the sequence number check described here. When the improved the sequence number check described here. When the improved
algorithm is implemented, the logic above is not applicable algorithm is implemented, the logic above is not applicable
for incoming SYN segments with timestamp options, received for incoming SYN segments with timestamp options, received
on a connection in the TIME-WAIT state. on a connection in the TIME-WAIT state.
In the following it is assumed that the segment is the In the following it is assumed that the segment is the
idealized segment that begins at RCV.NXT and does not exceed idealized segment that begins at RCV.NXT and does not exceed
the window. One could tailor actual segments to fit this the window. One could tailor actual segments to fit this
assumption by trimming off any portions that lie outside the assumption by trimming off any portions that lie outside the
skipping to change at page 75, line 26 skipping to change at page 75, line 26
FIN-WAIT STATE-2 FIN-WAIT STATE-2
CLOSE-WAIT STATE CLOSE-WAIT STATE
CLOSING STATE CLOSING STATE
LAST-ACK STATE LAST-ACK STATE
TIME-WAIT STATE TIME-WAIT STATE
If the SYN bit is set in these synchronized states, it If the SYN bit is set in these synchronized states, it
may be either a legitimate new connection attempt (e.g. may be either a legitimate new connection attempt (e.g.
in the case of TIME-WAIT), an error where the connection in the case of TIME-WAIT), an error where the connection
should be reset, or the result of an attack attempt, as should be reset, or the result of an attack attempt, as
described in RFC 5961 [31]. For the TIME-WAIT state, new described in RFC 5961 [32]. For the TIME-WAIT state, new
connections can be accepted if the timestamp option is connections can be accepted if the timestamp option is
used and meets expectations (per [33]). For all other used and meets expectations (per [34]). For all other
caess, RFC 5961 provides a mitigation that SHOULD be caess, RFC 5961 provides a mitigation that SHOULD be
implemented, though there are alternatives (see implemented, though there are alternatives (see
Section 6). RFC 5961 recommends that in these Section 6). RFC 5961 recommends that in these
synchronized states, if the SYN bit is set, irrespective synchronized states, if the SYN bit is set, irrespective
of the sequence number, TCP endpoints MUST send a of the sequence number, TCP endpoints MUST send a
"challenge ACK" to the remote peer: "challenge ACK" to the remote peer:
<SEQ=SND.NXT><ACK=RCV.NXT><CTL=ACK> <SEQ=SND.NXT><ACK=RCV.NXT><CTL=ACK>
After sending the acknowledgement, TCP implementations After sending the acknowledgement, TCP implementations
skipping to change at page 83, line 8 skipping to change at page 83, line 8
internet datagram internet datagram
The unit of data exchanged between an internet module and the The unit of data exchanged between an internet module and the
higher level protocol together with the internet header. higher level protocol together with the internet header.
internet fragment internet fragment
A portion of the data of an internet datagram with an A portion of the data of an internet datagram with an
internet header. internet header.
IP IP
Internet Protocol. See [1] and [11]. Internet Protocol. See [1] and [12].
IRS IRS
The Initial Receive Sequence number. The first sequence The Initial Receive Sequence number. The first sequence
number used by the sender on a connection. number used by the sender on a connection.
ISN ISN
The Initial Sequence Number. The first sequence number used The Initial Sequence Number. The first sequence number used
on a connection, (either ISS or IRS). Selected in a way that on a connection, (either ISS or IRS). Selected in a way that
is unique within a given period of time and is unpredictable is unique within a given period of time and is unpredictable
to attackers. to attackers.
skipping to change at page 87, line 29 skipping to change at page 87, line 29
Informational references, even though their normative content has Informational references, even though their normative content has
been incorporated into this document. been incorporated into this document.
The main body of this document was adapted from RFC 793's Section 3, The main body of this document was adapted from RFC 793's Section 3,
titled "FUNCTIONAL SPECIFICATION", with an attempt to keep formatting titled "FUNCTIONAL SPECIFICATION", with an attempt to keep formatting
and layout as close as possible. and layout as close as possible.
The collection of applicable RFC Errata that have been reported and The collection of applicable RFC Errata that have been reported and
either accepted or held for an update to RFC 793 were incorporated either accepted or held for an update to RFC 793 were incorporated
(Errata IDs: 573, 574, 700, 701, 1283, 1561, 1562, 1564, 1565, 1571, (Errata IDs: 573, 574, 700, 701, 1283, 1561, 1562, 1564, 1565, 1571,
1572, 2296, 2297, 2298, 2748, 2749, 2934, 3213, 3300, 3301). Some 1572, 2296, 2297, 2298, 2748, 2749, 2934, 3213, 3300, 3301, 6222).
errata were not applicable due to other changes (Errata IDs: 572, Some errata were not applicable due to other changes (Errata IDs:
575, 1569, 3305, 3602). 572, 575, 1569, 3305, 3602).
Changes to the specification of the Urgent Pointer described in RFC Changes to the specification of the Urgent Pointer described in RFC
1122 and 6093 were incorporated. See RFC 6093 for detailed 1122 and 6093 were incorporated. See RFC 6093 for detailed
discussion of why these changes were necessary. discussion of why these changes were necessary.
The discussion of the RTO from RFC 793 was updated to refer to RFC The discussion of the RTO from RFC 793 was updated to refer to RFC
6298. The RFC 1122 text on the RTO originally replaced the 793 text, 6298. The RFC 1122 text on the RTO originally replaced the 793 text,
however, RFC 2988 should have updated 1122, and has subsequently been however, RFC 2988 should have updated 1122, and has subsequently been
obsoleted by 6298. obsoleted by 6298.
skipping to change at page 91, line 49 skipping to change at page 91, line 49
additional reviews and follow-up on some of Gorry Fairhurst's additional reviews and follow-up on some of Gorry Fairhurst's
comments from revision 14. comments from revision 14.
Some other suggested changes that will not be incorporated in this Some other suggested changes that will not be incorporated in this
793 update unless TCPM consensus changes with regard to scope are: 793 update unless TCPM consensus changes with regard to scope are:
1. Tony Sabatini's suggestion for describing DO field 1. Tony Sabatini's suggestion for describing DO field
2. Per discussion with Joe Touch (TAPS list, 6/20/2015), the 2. Per discussion with Joe Touch (TAPS list, 6/20/2015), the
description of the API could be revisited description of the API could be revisited
The -17 revision includes errata 6222 from Charles Deng, update to
the key words boilerplate, updated description of the header flags
registry changes, and clarification about connections rather than
users in the discussion of OPEN calls.
Early in the process of updating RFC 793, Scott Brim mentioned that Early in the process of updating RFC 793, Scott Brim mentioned that
this should include a PERPASS/privacy review. This may be something this should include a PERPASS/privacy review. This may be something
for the chairs or AD to request during WGLC or IETF LC. for the chairs or AD to request during WGLC or IETF LC.
5. IANA Considerations 5. IANA Considerations
In the "Transmission Control Protocol (TCP) Header Flags" registry, In the "Transmission Control Protocol (TCP) Header Flags" registry,
IANA is asked to assign values indicated below. RFC 3168 originally IANA is asked to make several changes described in this section
IANA should add a column for "Assignment Notes".
IANA should assign values indicated below. RFC 3168 originally
created this registry, but only populated it with the new bits created this registry, but only populated it with the new bits
defined in RFC 3168, not these earlier bits that had been described defined in RFC 3168, not these earlier bits that had been described
in RFC 793 and earlier documents. in RFC 793 and earlier documents. Bit 7 has since also been updated
by RFC 8311.
TCP Header Flags TCP Header Flags
Bit Name Reference Bit Name Reference Assignment Notes
--- ---- --------- --- ---- --------- ----------------
10 Urgent Pointer field significant (URG) (this document) 4 Reserved (this document)
11 Acknowledgment field significant (ACK) (this document) 5 Reserved (this document)
12 Push Function (PSH) (this document) 6 Reserved (this document)
13 Reset the connection (RST) (this document) 7 Reserved [RFC8311] Previously used by Historic [RFC3540] as NS (Nonce Sum)
14 Synchronize sequence numbers (SYN) (this document) 8 CWR (Congestion Window Reduced) [RFC3168]
15 No more data from sender (FIN) (this document) 9 ECE (ECN-Echo) [RFC3168]
10 Urgent Pointer field significant (URG) (this document)
11 Acknowledgment field significant (ACK) (this document)
12 Push Function (PSH) (this document)
13 Reset the connection (RST) (this document)
14 Synchronize sequence numbers (SYN) (this document)
15 No more data from sender (FIN) (this document)
This TCP Header Flags registry should also be moved to a sub-registry This TCP Header Flags registry should also be moved to a sub-registry
under the global "Transmission Control Protocol (TCP) Parameters under the global "Transmission Control Protocol (TCP) Parameters
registry (https://www.iana.org/assignments/tcp-parameters/tcp- registry (https://www.iana.org/assignments/tcp-parameters/tcp-
parameters.xhtml). parameters.xhtml).
The registry's Registration Procedure should remain Standards Action,
but the Reference can be updated to this document, and the Note
removed.
6. Security and Privacy Considerations 6. Security and Privacy Considerations
The TCP design includes only rudimentary security features that The TCP design includes only rudimentary security features that
improve the robustness and reliability of connections and application improve the robustness and reliability of connections and application
data transfer, but there are no built-in cryptographic capabilities data transfer, but there are no built-in cryptographic capabilities
to support any form of privacy, authentication, or other typical to support any form of privacy, authentication, or other typical
security functions. Non-cryptographic enhancements (e.g. [31]) have security functions. Non-cryptographic enhancements (e.g. [32]) have
been developed to improve robustness of TCP connections to particular been developed to improve robustness of TCP connections to particular
types of attacks, but the applicability and protections of non- types of attacks, but the applicability and protections of non-
cryptographic enhancements are limited (e.g. see section 1.1 of cryptographic enhancements are limited (e.g. see section 1.1 of
[31]). Applications typically utilize lower-layer (e.g. IPsec) and [32]). Applications typically utilize lower-layer (e.g. IPsec) and
upper-layer (e.g. TLS) protocols to provide security and privacy for upper-layer (e.g. TLS) protocols to provide security and privacy for
TCP connections and application data carried in TCP. Methods based TCP connections and application data carried in TCP. Methods based
on TCP options have been developed as well, to support some security on TCP options have been developed as well, to support some security
capabilities. capabilities.
In order to fully protect TCP connections (including their control In order to fully protect TCP connections (including their control
flags) IPsec or the TCP Authentication Option (TCP-AO) [30] are the flags) IPsec or the TCP Authentication Option (TCP-AO) [31] are the
only current effective methods. Other methods discussed in this only current effective methods. Other methods discussed in this
section may protect the payload, but either only a subset of the section may protect the payload, but either only a subset of the
fields (e.g. tcpcrypt) or none at all (e.g. TLS). Other security fields (e.g. tcpcrypt) or none at all (e.g. TLS). Other security
features that have been added to TCP (e.g. ISN generation, sequence features that have been added to TCP (e.g. ISN generation, sequence
number checks, etc.) are only capable of partially hindering attacks. number checks, etc.) are only capable of partially hindering attacks.
Applications using long-lived TCP flows have been vulnerable to Applications using long-lived TCP flows have been vulnerable to
attacks that exploit the processing of control flags described in attacks that exploit the processing of control flags described in
earlier TCP specifications [24]. TCP-MD5 was a commonly implemented earlier TCP specifications [25]. TCP-MD5 was a commonly implemented
TCP option to support authentication for some of these connections, TCP option to support authentication for some of these connections,
but had flaws and is now deprecated. TCP-AO provides a capability to but had flaws and is now deprecated. TCP-AO provides a capability to
protect long-lived TCP connections from attacks, and has superior protect long-lived TCP connections from attacks, and has superior
properties to TCP-MD5. It does not provide any privacy for properties to TCP-MD5. It does not provide any privacy for
application data, nor for the TCP headers. application data, nor for the TCP headers.
The "tcpcrypt" [51] Experimental extension to TCP provides the The "tcpcrypt" [52] Experimental extension to TCP provides the
ability to cryptographically protect connection data. Metadata ability to cryptographically protect connection data. Metadata
aspects of the TCP flow are still visible, but the application stream aspects of the TCP flow are still visible, but the application stream
is well-protected. Within the TCP header, only the urgent pointer is well-protected. Within the TCP header, only the urgent pointer
and FIN flag are protected through tcpcrypt. and FIN flag are protected through tcpcrypt.
The TCP Roadmap [41] includes notes about several RFCs related to TCP The TCP Roadmap [42] includes notes about several RFCs related to TCP
security. Many of the enhancements provided by these RFCs have been security. Many of the enhancements provided by these RFCs have been
integrated into the present document, including ISN generation, integrated into the present document, including ISN generation,
mitigating blind in-window attacks, and improving handling of soft mitigating blind in-window attacks, and improving handling of soft
errors and ICMP packets. These are all discussed in greater detail errors and ICMP packets. These are all discussed in greater detail
in the referenced RFCs that originally described the changes needed in the referenced RFCs that originally described the changes needed
to earlier TCP specifications. Additionally, see RFC 6093 [32] for to earlier TCP specifications. Additionally, see RFC 6093 [33] for
discussion of security considerations related to the urgent pointer discussion of security considerations related to the urgent pointer
field, that has been deprecated. field, that has been deprecated.
Since TCP is often used for bulk transfer flows, some attacks are Since TCP is often used for bulk transfer flows, some attacks are
possible that abuse the TCP congestion control logic. An example is possible that abuse the TCP congestion control logic. An example is
"ACK-division" attacks. Updates that have been made to the TCP "ACK-division" attacks. Updates that have been made to the TCP
congestion control specifications include mechanisms like Appropriate congestion control specifications include mechanisms like Appropriate
Byte Counting (ABC) [20] that act as mitigations to these attacks. Byte Counting (ABC) [21] that act as mitigations to these attacks.
Other attacks are focused on exhausting the resources of a TCP Other attacks are focused on exhausting the resources of a TCP
server. Examples include SYN flooding [23] or wasting resources on server. Examples include SYN flooding [24] or wasting resources on
non-progressing connections [34]. Operating systems commonly non-progressing connections [35]. Operating systems commonly
implement mitigations for these attacks. Some common defenses also implement mitigations for these attacks. Some common defenses also
utilize proxies, stateful firewalls, and other technologies outside utilize proxies, stateful firewalls, and other technologies outside
of the end-host TCP implementation. of the end-host TCP implementation.
7. Acknowledgements 7. Acknowledgements
This document is largely a revision of RFC 793, which Jon Postel was This document is largely a revision of RFC 793, which Jon Postel was
the editor of. Due to his excellent work, it was able to last for the editor of. Due to his excellent work, it was able to last for
three decades before we felt the need to revise it. three decades before we felt the need to revise it.
skipping to change at page 94, line 19 skipping to change at page 94, line 41
Yoshifumi Nishida Yoshifumi Nishida
Pasi Sarolahti Pasi Sarolahti
Michael Tuexen Michael Tuexen
During the discussions of this work on the TCPM mailing list and in During the discussions of this work on the TCPM mailing list and in
working group meetings, helpful comments, critiques, and reviews were working group meetings, helpful comments, critiques, and reviews were
received from (listed alphabetically): David Borman, Mohamed received from (listed alphabetically): David Borman, Mohamed
Boucadair, Bob Briscoe, Neal Cardwell, Yuchung Cheng, Martin Duke, Boucadair, Bob Briscoe, Neal Cardwell, Yuchung Cheng, Martin Duke,
Ted Faber, Gorry Fairhurst, Fernando Gont, Rodney Grimes, Mike Kosek, Ted Faber, Gorry Fairhurst, Fernando Gont, Rodney Grimes, Mike Kosek,
Kevin Lahey, Kevin Mason, Matt Mathis, Jonathan Morton, Tommy Pauly, Kevin Lahey, Kevin Mason, Matt Mathis, Jonathan Morton, Tommy Pauly,
Hagen Paul Pfeifer, Anthony Sabatini, Michael Scharf, Greg Skinner, Tom Petch, Hagen Paul Pfeifer, Anthony Sabatini, Michael Scharf, Greg
Joe Touch, Michael Tuexen, Reji Varghese, Tim Wicinski, Lloyd Wood, Skinner, Joe Touch, Michael Tuexen, Reji Varghese, Tim Wicinski,
and Alex Zimmermann. Joe Touch provided additional help in Lloyd Wood, and Alex Zimmermann. Joe Touch provided additional help
clarifying the description of segment size parameters and PMTUD/ in clarifying the description of segment size parameters and PMTUD/
PLPMTUD recommendations. PLPMTUD recommendations.
This document includes content from errata that were reported by This document includes content from errata that were reported by
(listed chronologically): Yin Shuming, Bob Braden, Morris M. Keesan, (listed chronologically): Yin Shuming, Bob Braden, Morris M. Keesan,
Pei-chun Cheng, Constantin Hagemeier, Vishwas Manral, Mykyta Pei-chun Cheng, Constantin Hagemeier, Vishwas Manral, Mykyta
Yevstifeyev, EungJun Yi, Botong Huang. Yevstifeyev, EungJun Yi, Botong Huang, Charles Deng.
8. References 8. References
8.1. Normative References 8.1. Normative References
[1] Postel, J., "Internet Protocol", STD 5, RFC 791, [1] Postel, J., "Internet Protocol", STD 5, RFC 791,
DOI 10.17487/RFC0791, September 1981, DOI 10.17487/RFC0791, September 1981,
<https://www.rfc-editor.org/info/rfc791>. <https://www.rfc-editor.org/info/rfc791>.
[2] Mogul, J. and S. Deering, "Path MTU discovery", RFC 1191, [2] Mogul, J. and S. Deering, "Path MTU discovery", RFC 1191,
skipping to change at page 95, line 33 skipping to change at page 96, line 5
[9] Paxson, V., Allman, M., Chu, J., and M. Sargent, [9] Paxson, V., Allman, M., Chu, J., and M. Sargent,
"Computing TCP's Retransmission Timer", RFC 6298, "Computing TCP's Retransmission Timer", RFC 6298,
DOI 10.17487/RFC6298, June 2011, DOI 10.17487/RFC6298, June 2011,
<https://www.rfc-editor.org/info/rfc6298>. <https://www.rfc-editor.org/info/rfc6298>.
[10] Gont, F., "Deprecation of ICMP Source Quench Messages", [10] Gont, F., "Deprecation of ICMP Source Quench Messages",
RFC 6633, DOI 10.17487/RFC6633, May 2012, RFC 6633, DOI 10.17487/RFC6633, May 2012,
<https://www.rfc-editor.org/info/rfc6633>. <https://www.rfc-editor.org/info/rfc6633>.
[11] Deering, S. and R. Hinden, "Internet Protocol, Version 6 [11] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
May 2017, <https://www.rfc-editor.org/info/rfc8174>.
[12] Deering, S. and R. Hinden, "Internet Protocol, Version 6
(IPv6) Specification", STD 86, RFC 8200, (IPv6) Specification", STD 86, RFC 8200,
DOI 10.17487/RFC8200, July 2017, DOI 10.17487/RFC8200, July 2017,
<https://www.rfc-editor.org/info/rfc8200>. <https://www.rfc-editor.org/info/rfc8200>.
8.2. Informative References 8.2. Informative References
[12] Postel, J., "Transmission Control Protocol", STD 7, [13] Postel, J., "Transmission Control Protocol", STD 7,
RFC 793, DOI 10.17487/RFC0793, September 1981, RFC 793, DOI 10.17487/RFC0793, September 1981,
<https://www.rfc-editor.org/info/rfc793>. <https://www.rfc-editor.org/info/rfc793>.
[13] Nagle, J., "Congestion Control in IP/TCP Internetworks", [14] Nagle, J., "Congestion Control in IP/TCP Internetworks",
RFC 896, DOI 10.17487/RFC0896, January 1984, RFC 896, DOI 10.17487/RFC0896, January 1984,
<https://www.rfc-editor.org/info/rfc896>. <https://www.rfc-editor.org/info/rfc896>.
[14] Braden, R., Ed., "Requirements for Internet Hosts - [15] Braden, R., Ed., "Requirements for Internet Hosts -
Communication Layers", STD 3, RFC 1122, Communication Layers", STD 3, RFC 1122,
DOI 10.17487/RFC1122, October 1989, DOI 10.17487/RFC1122, October 1989,
<https://www.rfc-editor.org/info/rfc1122>. <https://www.rfc-editor.org/info/rfc1122>.
[15] Almquist, P., "Type of Service in the Internet Protocol [16] Almquist, P., "Type of Service in the Internet Protocol
Suite", RFC 1349, DOI 10.17487/RFC1349, July 1992, Suite", RFC 1349, DOI 10.17487/RFC1349, July 1992,
<https://www.rfc-editor.org/info/rfc1349>. <https://www.rfc-editor.org/info/rfc1349>.
[16] Braden, R., "T/TCP -- TCP Extensions for Transactions [17] Braden, R., "T/TCP -- TCP Extensions for Transactions
Functional Specification", RFC 1644, DOI 10.17487/RFC1644, Functional Specification", RFC 1644, DOI 10.17487/RFC1644,
July 1994, <https://www.rfc-editor.org/info/rfc1644>. July 1994, <https://www.rfc-editor.org/info/rfc1644>.
[17] Paxson, V., Allman, M., Dawson, S., Fenner, W., Griner, [18] Paxson, V., Allman, M., Dawson, S., Fenner, W., Griner,
J., Heavens, I., Lahey, K., Semke, J., and B. Volz, "Known J., Heavens, I., Lahey, K., Semke, J., and B. Volz, "Known
TCP Implementation Problems", RFC 2525, TCP Implementation Problems", RFC 2525,
DOI 10.17487/RFC2525, March 1999, DOI 10.17487/RFC2525, March 1999,
<https://www.rfc-editor.org/info/rfc2525>. <https://www.rfc-editor.org/info/rfc2525>.
[18] Xiao, X., Hannan, A., Paxson, V., and E. Crabbe, "TCP [19] Xiao, X., Hannan, A., Paxson, V., and E. Crabbe, "TCP
Processing of the IPv4 Precedence Field", RFC 2873, Processing of the IPv4 Precedence Field", RFC 2873,
DOI 10.17487/RFC2873, June 2000, DOI 10.17487/RFC2873, June 2000,
<https://www.rfc-editor.org/info/rfc2873>. <https://www.rfc-editor.org/info/rfc2873>.
[19] Balakrishnan, H., Padmanabhan, V., Fairhurst, G., and M. [20] Balakrishnan, H., Padmanabhan, V., Fairhurst, G., and M.
Sooriyabandara, "TCP Performance Implications of Network Sooriyabandara, "TCP Performance Implications of Network
Path Asymmetry", BCP 69, RFC 3449, DOI 10.17487/RFC3449, Path Asymmetry", BCP 69, RFC 3449, DOI 10.17487/RFC3449,
December 2002, <https://www.rfc-editor.org/info/rfc3449>. December 2002, <https://www.rfc-editor.org/info/rfc3449>.
[20] Allman, M., "TCP Congestion Control with Appropriate Byte [21] Allman, M., "TCP Congestion Control with Appropriate Byte
Counting (ABC)", RFC 3465, DOI 10.17487/RFC3465, February Counting (ABC)", RFC 3465, DOI 10.17487/RFC3465, February
2003, <https://www.rfc-editor.org/info/rfc3465>. 2003, <https://www.rfc-editor.org/info/rfc3465>.
[21] Fenner, B., "Experimental Values In IPv4, IPv6, ICMPv4, [22] Fenner, B., "Experimental Values In IPv4, IPv6, ICMPv4,
ICMPv6, UDP, and TCP Headers", RFC 4727, ICMPv6, UDP, and TCP Headers", RFC 4727,
DOI 10.17487/RFC4727, November 2006, DOI 10.17487/RFC4727, November 2006,
<https://www.rfc-editor.org/info/rfc4727>. <https://www.rfc-editor.org/info/rfc4727>.
[22] Mathis, M. and J. Heffner, "Packetization Layer Path MTU [23] Mathis, M. and J. Heffner, "Packetization Layer Path MTU
Discovery", RFC 4821, DOI 10.17487/RFC4821, March 2007, Discovery", RFC 4821, DOI 10.17487/RFC4821, March 2007,
<https://www.rfc-editor.org/info/rfc4821>. <https://www.rfc-editor.org/info/rfc4821>.
[23] Eddy, W., "TCP SYN Flooding Attacks and Common [24] Eddy, W., "TCP SYN Flooding Attacks and Common
Mitigations", RFC 4987, DOI 10.17487/RFC4987, August 2007, Mitigations", RFC 4987, DOI 10.17487/RFC4987, August 2007,
<https://www.rfc-editor.org/info/rfc4987>. <https://www.rfc-editor.org/info/rfc4987>.
[24] Touch, J., "Defending TCP Against Spoofing Attacks", [25] Touch, J., "Defending TCP Against Spoofing Attacks",
RFC 4953, DOI 10.17487/RFC4953, July 2007, RFC 4953, DOI 10.17487/RFC4953, July 2007,
<https://www.rfc-editor.org/info/rfc4953>. <https://www.rfc-editor.org/info/rfc4953>.
[25] Culley, P., Elzur, U., Recio, R., Bailey, S., and J. [26] Culley, P., Elzur, U., Recio, R., Bailey, S., and J.
Carrier, "Marker PDU Aligned Framing for TCP Carrier, "Marker PDU Aligned Framing for TCP
Specification", RFC 5044, DOI 10.17487/RFC5044, October Specification", RFC 5044, DOI 10.17487/RFC5044, October
2007, <https://www.rfc-editor.org/info/rfc5044>. 2007, <https://www.rfc-editor.org/info/rfc5044>.
[26] Gont, F., "TCP's Reaction to Soft Errors", RFC 5461, [27] Gont, F., "TCP's Reaction to Soft Errors", RFC 5461,
DOI 10.17487/RFC5461, February 2009, DOI 10.17487/RFC5461, February 2009,
<https://www.rfc-editor.org/info/rfc5461>. <https://www.rfc-editor.org/info/rfc5461>.
[27] StJohns, M., Atkinson, R., and G. Thomas, "Common [28] StJohns, M., Atkinson, R., and G. Thomas, "Common
Architecture Label IPv6 Security Option (CALIPSO)", Architecture Label IPv6 Security Option (CALIPSO)",
RFC 5570, DOI 10.17487/RFC5570, July 2009, RFC 5570, DOI 10.17487/RFC5570, July 2009,
<https://www.rfc-editor.org/info/rfc5570>. <https://www.rfc-editor.org/info/rfc5570>.
[28] Allman, M., Paxson, V., and E. Blanton, "TCP Congestion [29] Allman, M., Paxson, V., and E. Blanton, "TCP Congestion
Control", RFC 5681, DOI 10.17487/RFC5681, September 2009, Control", RFC 5681, DOI 10.17487/RFC5681, September 2009,
<https://www.rfc-editor.org/info/rfc5681>. <https://www.rfc-editor.org/info/rfc5681>.
[29] Sandlund, K., Pelletier, G., and L-E. Jonsson, "The RObust [30] Sandlund, K., Pelletier, G., and L-E. Jonsson, "The RObust
Header Compression (ROHC) Framework", RFC 5795, Header Compression (ROHC) Framework", RFC 5795,
DOI 10.17487/RFC5795, March 2010, DOI 10.17487/RFC5795, March 2010,
<https://www.rfc-editor.org/info/rfc5795>. <https://www.rfc-editor.org/info/rfc5795>.
[30] Touch, J., Mankin, A., and R. Bonica, "The TCP [31] Touch, J., Mankin, A., and R. Bonica, "The TCP
Authentication Option", RFC 5925, DOI 10.17487/RFC5925, Authentication Option", RFC 5925, DOI 10.17487/RFC5925,
June 2010, <https://www.rfc-editor.org/info/rfc5925>. June 2010, <https://www.rfc-editor.org/info/rfc5925>.
[31] Ramaiah, A., Stewart, R., and M. Dalal, "Improving TCP's [32] Ramaiah, A., Stewart, R., and M. Dalal, "Improving TCP's
Robustness to Blind In-Window Attacks", RFC 5961, Robustness to Blind In-Window Attacks", RFC 5961,
DOI 10.17487/RFC5961, August 2010, DOI 10.17487/RFC5961, August 2010,
<https://www.rfc-editor.org/info/rfc5961>. <https://www.rfc-editor.org/info/rfc5961>.
[32] Gont, F. and A. Yourtchenko, "On the Implementation of the [33] Gont, F. and A. Yourtchenko, "On the Implementation of the
TCP Urgent Mechanism", RFC 6093, DOI 10.17487/RFC6093, TCP Urgent Mechanism", RFC 6093, DOI 10.17487/RFC6093,
January 2011, <https://www.rfc-editor.org/info/rfc6093>. January 2011, <https://www.rfc-editor.org/info/rfc6093>.
[33] Gont, F., "Reducing the TIME-WAIT State Using TCP [34] Gont, F., "Reducing the TIME-WAIT State Using TCP
Timestamps", BCP 159, RFC 6191, DOI 10.17487/RFC6191, Timestamps", BCP 159, RFC 6191, DOI 10.17487/RFC6191,
April 2011, <https://www.rfc-editor.org/info/rfc6191>. April 2011, <https://www.rfc-editor.org/info/rfc6191>.
[34] Bashyam, M., Jethanandani, M., and A. Ramaiah, "TCP Sender [35] Bashyam, M., Jethanandani, M., and A. Ramaiah, "TCP Sender
Clarification for Persist Condition", RFC 6429, Clarification for Persist Condition", RFC 6429,
DOI 10.17487/RFC6429, December 2011, DOI 10.17487/RFC6429, December 2011,
<https://www.rfc-editor.org/info/rfc6429>. <https://www.rfc-editor.org/info/rfc6429>.
[35] Gont, F. and S. Bellovin, "Defending against Sequence [36] Gont, F. and S. Bellovin, "Defending against Sequence
Number Attacks", RFC 6528, DOI 10.17487/RFC6528, February Number Attacks", RFC 6528, DOI 10.17487/RFC6528, February
2012, <https://www.rfc-editor.org/info/rfc6528>. 2012, <https://www.rfc-editor.org/info/rfc6528>.
[36] Borman, D., "TCP Options and Maximum Segment Size (MSS)", [37] Borman, D., "TCP Options and Maximum Segment Size (MSS)",
RFC 6691, DOI 10.17487/RFC6691, July 2012, RFC 6691, DOI 10.17487/RFC6691, July 2012,
<https://www.rfc-editor.org/info/rfc6691>. <https://www.rfc-editor.org/info/rfc6691>.
[37] Touch, J., "Updated Specification of the IPv4 ID Field", [38] Touch, J., "Updated Specification of the IPv4 ID Field",
RFC 6864, DOI 10.17487/RFC6864, February 2013, RFC 6864, DOI 10.17487/RFC6864, February 2013,
<https://www.rfc-editor.org/info/rfc6864>. <https://www.rfc-editor.org/info/rfc6864>.
[38] Touch, J., "Shared Use of Experimental TCP Options", [39] Touch, J., "Shared Use of Experimental TCP Options",
RFC 6994, DOI 10.17487/RFC6994, August 2013, RFC 6994, DOI 10.17487/RFC6994, August 2013,
<https://www.rfc-editor.org/info/rfc6994>. <https://www.rfc-editor.org/info/rfc6994>.
[39] Borman, D., Braden, B., Jacobson, V., and R. [40] Borman, D., Braden, B., Jacobson, V., and R.
Scheffenegger, Ed., "TCP Extensions for High Performance", Scheffenegger, Ed., "TCP Extensions for High Performance",
RFC 7323, DOI 10.17487/RFC7323, September 2014, RFC 7323, DOI 10.17487/RFC7323, September 2014,
<https://www.rfc-editor.org/info/rfc7323>. <https://www.rfc-editor.org/info/rfc7323>.
[40] Cheng, Y., Chu, J., Radhakrishnan, S., and A. Jain, "TCP [41] Cheng, Y., Chu, J., Radhakrishnan, S., and A. Jain, "TCP
Fast Open", RFC 7413, DOI 10.17487/RFC7413, December 2014, Fast Open", RFC 7413, DOI 10.17487/RFC7413, December 2014,
<https://www.rfc-editor.org/info/rfc7413>. <https://www.rfc-editor.org/info/rfc7413>.
[41] Duke, M., Braden, R., Eddy, W., Blanton, E., and A. [42] Duke, M., Braden, R., Eddy, W., Blanton, E., and A.
Zimmermann, "A Roadmap for Transmission Control Protocol Zimmermann, "A Roadmap for Transmission Control Protocol
(TCP) Specification Documents", RFC 7414, (TCP) Specification Documents", RFC 7414,
DOI 10.17487/RFC7414, February 2015, DOI 10.17487/RFC7414, February 2015,
<https://www.rfc-editor.org/info/rfc7414>. <https://www.rfc-editor.org/info/rfc7414>.
[42] Black, D., Ed. and P. Jones, "Differentiated Services [43] Black, D., Ed. and P. Jones, "Differentiated Services
(Diffserv) and Real-Time Communication", RFC 7657, (Diffserv) and Real-Time Communication", RFC 7657,
DOI 10.17487/RFC7657, November 2015, DOI 10.17487/RFC7657, November 2015,
<https://www.rfc-editor.org/info/rfc7657>. <https://www.rfc-editor.org/info/rfc7657>.
[43] Fairhurst, G. and M. Welzl, "The Benefits of Using [44] Fairhurst, G. and M. Welzl, "The Benefits of Using
Explicit Congestion Notification (ECN)", RFC 8087, Explicit Congestion Notification (ECN)", RFC 8087,
DOI 10.17487/RFC8087, March 2017, DOI 10.17487/RFC8087, March 2017,
<https://www.rfc-editor.org/info/rfc8087>. <https://www.rfc-editor.org/info/rfc8087>.
[44] Fairhurst, G., Ed., Trammell, B., Ed., and M. Kuehlewind, [45] Fairhurst, G., Ed., Trammell, B., Ed., and M. Kuehlewind,
Ed., "Services Provided by IETF Transport Protocols and Ed., "Services Provided by IETF Transport Protocols and
Congestion Control Mechanisms", RFC 8095, Congestion Control Mechanisms", RFC 8095,
DOI 10.17487/RFC8095, March 2017, DOI 10.17487/RFC8095, March 2017,
<https://www.rfc-editor.org/info/rfc8095>. <https://www.rfc-editor.org/info/rfc8095>.
[45] Welzl, M., Tuexen, M., and N. Khademi, "On the Usage of [46] Welzl, M., Tuexen, M., and N. Khademi, "On the Usage of
Transport Features Provided by IETF Transport Protocols", Transport Features Provided by IETF Transport Protocols",
RFC 8303, DOI 10.17487/RFC8303, February 2018, RFC 8303, DOI 10.17487/RFC8303, February 2018,
<https://www.rfc-editor.org/info/rfc8303>. <https://www.rfc-editor.org/info/rfc8303>.
[46] Chown, T., Loughney, J., and T. Winters, "IPv6 Node [47] Chown, T., Loughney, J., and T. Winters, "IPv6 Node
Requirements", BCP 220, RFC 8504, DOI 10.17487/RFC8504, Requirements", BCP 220, RFC 8504, DOI 10.17487/RFC8504,
January 2019, <https://www.rfc-editor.org/info/rfc8504>. January 2019, <https://www.rfc-editor.org/info/rfc8504>.
[47] IANA, "Transmission Control Protocol (TCP) Parameters, [48] IANA, "Transmission Control Protocol (TCP) Parameters,
https://www.iana.org/assignments/tcp-parameters/tcp- https://www.iana.org/assignments/tcp-parameters/tcp-
parameters.xhtml", 2019. parameters.xhtml", 2019.
[48] IANA, "Transmission Control Protocol (TCP) Header Flags, [49] IANA, "Transmission Control Protocol (TCP) Header Flags,
https://www.iana.org/assignments/tcp-header-flags/tcp- https://www.iana.org/assignments/tcp-header-flags/tcp-
header-flags.xhtml", 2019. header-flags.xhtml", 2019.
[49] Gont, F., "Processing of IP Security/Compartment and [50] Gont, F., "Processing of IP Security/Compartment and
Precedence Information by TCP", draft-gont-tcpm-tcp- Precedence Information by TCP", draft-gont-tcpm-tcp-
seccomp-prec-00 (work in progress), March 2012. seccomp-prec-00 (work in progress), March 2012.
[50] Gont, F. and D. Borman, "On the Validation of TCP Sequence [51] Gont, F. and D. Borman, "On the Validation of TCP Sequence
Numbers", draft-gont-tcpm-tcp-seq-validation-02 (work in Numbers", draft-gont-tcpm-tcp-seq-validation-02 (work in
progress), March 2015. progress), March 2015.
[51] Bittau, A., Giffin, D., Handley, M., Mazieres, D., Slack, [52] 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.
[52] Touch, J. and W. Eddy, "TCP Extended Data Offset Option", [53] Touch, J. and W. Eddy, "TCP Extended Data Offset Option",
draft-ietf-tcpm-tcp-edo-10 (work in progress), July 2018. draft-ietf-tcpm-tcp-edo-10 (work in progress), July 2018.
[53] Minshall, G., "A Proposed Modification to Nagle's [54] 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.
[54] Dalal, Y. and C. Sunshine, "Connection Management in [55] Dalal, Y. and C. Sunshine, "Connection Management in
Transport Protocols", Computer Networks Vol. 2, No. 6, pp. Transport Protocols", Computer Networks Vol. 2, No. 6, pp.
454-473, December 1978. 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
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 [16], and then obsoleted by the definition of Differentiated Services
(DiffServ) [5]. Setting and conveying TOS between the network layer, (DiffServ) [5]. Setting and conveying TOS between the network layer,
TCP implementation, and applications is obsolete, and replaced by TCP implementation, and applications is obsolete, and replaced by
DiffServ in the current TCP specification. DiffServ in the current TCP specification.
RFC 793 requires checking the IP security compartment and precedence RFC 793 requires checking the IP security compartment and precedence
on incoming TCP segments for consistency within a connection, and on incoming TCP segments for consistency within a connection, and
with application requests. Each of these aspects of IP have become with application requests. Each of these aspects of IP have become
outdated, without specific updates to RFC 793. The issues with outdated, without specific updates to RFC 793. The issues with
precedence were fixed by [18], which is Standards Track, and so this precedence were fixed by [19], which is Standards Track, and so this
present TCP specification includes those changes. However, the state present TCP specification includes those changes. However, the state
of IP security options that may be used by MLS systems is not as of IP security options that may be used by MLS systems is not as
clean. clean.
Reseting connections when incoming packets do not meet expected Reseting connections when incoming packets do not meet expected
security compartment or precedence expectations has been recognized security compartment or precedence expectations has been recognized
as a possible attack vector [49], and there has been discussion about as a possible attack vector [50], and there has been discussion about
ammending the TCP specification to prevent connections from being ammending the TCP specification to prevent connections from being
aborted due to non-matching IP security compartment and DiffServ aborted due to non-matching IP security compartment and DiffServ
codepoint values. codepoint values.
A.1.1. Precedence A.1.1. Precedence
In DiffServ the former precedence values are treated as Class In DiffServ the former precedence values are treated as Class
Selector codepoints, and methods for compatible treatment are Selector codepoints, and methods for compatible treatment are
described in the DiffServ architecture. The RFC 793/1122 TCP described in the DiffServ architecture. The RFC 793/1122 TCP
specification includes logic intending to have connections use the specification includes logic intending to have connections use the
highest precedence requested by either endpoint application, and to highest precedence requested by either endpoint application, and to
keep the precedence consistent throughout a connection. This logic keep the precedence consistent throughout a connection. This logic
from the obsolete TOS is not applicable for DiffServ, and should not from the obsolete TOS is not applicable for DiffServ, and should not
be included in TCP implementations, though changes to DiffServ values be included in TCP implementations, though changes to DiffServ values
within a connection are discouraged. For discussion of this, see RFC within a connection are discouraged. For discussion of this, see RFC
7657 (sec 5.1, 5.3, and 6) [42]. 7657 (sec 5.1, 5.3, and 6) [43].
The obsoleted TOS processing rules in TCP assumed bidirectional (or The obsoleted TOS processing rules in TCP assumed bidirectional (or
symmetric) precedence values used on a connection, but the DiffServ symmetric) precedence values used on a connection, but the DiffServ
architecture is asymmetric. Problems with the old TCP logic in this architecture is asymmetric. Problems with the old TCP logic in this
regard were described in [18] and the solution described is to ignore regard were described in [19] and the solution described is to ignore
IP precedence in TCP. Since RFC 2873 is a Standards Track document IP precedence in TCP. Since RFC 2873 is a Standards Track document
(although not marked as updating RFC 793), current implementations (although not marked as updating RFC 793), current implementations
are expected to be robust to these conditions. Note that the are expected to be robust to these conditions. Note that the
DiffServ field value used in each direction is a part of the DiffServ field value used in each direction is a part of the
interface between TCP and the network layer, and values in use can be interface between TCP and the network layer, and values in use can be
indicated both ways between TCP and the application. indicated both ways between TCP and the application.
A.1.2. MLS Systems A.1.2. MLS Systems
The IP security option (IPSO) and compartment defined in [1] was The IP security option (IPSO) and compartment defined in [1] was
refined in RFC 1038 that was later obsoleted by RFC 1108. The refined in RFC 1038 that was later obsoleted by RFC 1108. The
Commercial IP Security Option (CIPSO) is defined in FIPS-188, and is Commercial IP Security Option (CIPSO) is defined in FIPS-188, and is
supported by some vendors and operating systems. RFC 1108 is now supported by some vendors and operating systems. RFC 1108 is now
Historic, though RFC 791 itself has not been updated to remove the IP Historic, though RFC 791 itself has not been updated to remove the IP
security option. For IPv6, a similar option (CALIPSO) has been security option. For IPv6, a similar option (CALIPSO) has been
defined [27]. RFC 793 includes logic that includes the IP security/ defined [28]. RFC 793 includes logic that includes the IP security/
compartment information in treatment of TCP segments. References to compartment information in treatment of TCP segments. References to
the IP "security/compartment" in this document may be relevant for the IP "security/compartment" in this document may be relevant for
Multi-Level Secure (MLS) system implementers, but can be ignored for Multi-Level Secure (MLS) system implementers, but can be ignored for
non-MLS implementations, consistent with running code on the non-MLS implementations, consistent with running code on the
Internet. See Appendix A.1 for further discussion. Note that RFC Internet. See Appendix A.1 for further discussion. Note that RFC
5570 describes some MLS networking scenarios where IPSO, CIPSO, or 5570 describes some MLS networking scenarios where IPSO, CIPSO, or
CALIPSO may be used. In these special cases, TCP implementers should CALIPSO may be used. In these special cases, TCP implementers should
see section 7.3.1 of RFC 5570, and follow the guidance in that see section 7.3.1 of RFC 5570, and follow the guidance in that
document. document.
A.2. Sequence Number Validation A.2. Sequence Number Validation
There are cases where the TCP sequence number validation rules can There are cases where the TCP sequence number validation rules can
prevent ACK fields from being processed. This can result in prevent ACK fields from being processed. This can result in
connection issues, as described in [50], which includes descriptions connection issues, as described in [51], which includes descriptions
of potential problems in conditions of simultaneous open, self- of potential problems in conditions of simultaneous open, self-
connects, simultaneous close, and simultaneous window probes. The connects, simultaneous close, and simultaneous window probes. The
document also describes potential changes to the TCP specification to document also describes potential changes to the TCP specification to
mitigate the issue by expanding the acceptable sequence numbers. mitigate the issue by expanding the acceptable sequence numbers.
In Internet usage of TCP, these conditions are rarely occuring. In Internet usage of TCP, these conditions are rarely occuring.
Common operating systems include different alternative mitigations, Common operating systems include different alternative mitigations,
and the standard has not been updated yet to codify one of them, but and the standard has not been updated yet to codify one of them, but
implementers should consider the problems described in [50]. implementers should consider the problems described in [51].
A.3. Nagle Modification A.3. Nagle Modification
In common operating systems, both the Nagle algorithm and delayed In common operating systems, both the Nagle algorithm and delayed
acknowledgements are implemented and enabled by default. TCP is used acknowledgements are implemented and enabled by default. TCP is used
by many applications that have a request-response style of by many applications that have a request-response style of
communication, where the combination of the Nagle algorithm and communication, where the combination of the Nagle algorithm and
delayed acknowledgements can result in poor application performance. delayed acknowledgements can result in poor application performance.
A modification to the Nagle algorithm is described in [53] that A modification to the Nagle algorithm is described in [54] that
improves the situation for these applications. improves the situation for these applications.
This modification is implemented in some common operating systems, This modification is implemented in some common operating systems,
and does not impact TCP interoperability. Additionally, many and does not impact TCP interoperability. Additionally, many
applications simply disable Nagle, since this is generally supported applications simply disable Nagle, since this is generally supported
by a socket option. The TCP standard has not been updated to include by a socket option. The TCP standard has not been updated to include
this Nagle modification, but implementers may find it beneficial to this Nagle modification, but implementers may find it beneficial to
consider. consider.
A.4. Low Water Mark Settings A.4. Low Water Mark Settings
 End of changes. 132 change blocks. 
156 lines changed or deleted 182 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/