draft-ietf-tcpm-rfc793bis-07.txt   draft-ietf-tcpm-rfc793bis-08.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, 6093, 6429, 6528, November 12, 2017 Obsoletes: 793, 879, 2873, 6093, 6429, March 28, 2018
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: May 16, 2018 Expires: September 29, 2018
Transmission Control Protocol Specification Transmission Control Protocol Specification
draft-ietf-tcpm-rfc793bis-07 draft-ietf-tcpm-rfc793bis-08
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.
This document obsoletes RFC 793, as well as 879, 6093, 6429, 6528, This document obsoletes RFC 793, as well as 879, 2873, 6093, 6429,
and 6691. It updates RFC 1122, and should be considered as a 6528, and 6691 that updated parts of RFC 793. It updates RFC 1122,
replacement for the portions of that document dealing with TCP and should be considered as a replacement for the portions of that
requirements. It updates RFC 5961 due to a small clarification in document dealing with TCP requirements. It updates RFC 5961 due to a
reset handling while in the SYN-RECEIVED state. (TODO: double-check small clarification in reset handling while in the SYN-RECEIVED
this list for all actual RFCs when finished) 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", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in RFC 2119 [4]. document are to be interpreted as described in RFC 2119 [4].
skipping to change at page 2, line 10 skipping to change at page 2, line 10
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on May 16, 2018. This Internet-Draft will expire on September 29, 2018.
Copyright Notice Copyright Notice
Copyright (c) 2017 IETF Trust and the persons identified as the Copyright (c) 2018 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(https://trustee.ietf.org/license-info) in effect on the date of (https://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
skipping to change at page 2, line 43 skipping to change at page 2, line 43
the copyright in such materials, this document may not be modified the copyright in such materials, this document may not be modified
outside the IETF Standards Process, and derivative works of it may outside the IETF Standards Process, and derivative works of it may
not be created outside the IETF Standards Process, except to format not be created outside the IETF Standards Process, except to format
it for publication as an RFC or to translate it into languages other it for publication as an RFC or to translate it into languages other
than English. than English.
Table of Contents Table of Contents
1. Purpose and Scope . . . . . . . . . . . . . . . . . . . . . . 3 1. Purpose and Scope . . . . . . . . . . . . . . . . . . . . . . 3
2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4 2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4
3. Functional Specification . . . . . . . . . . . . . . . . . . 5 2.1. Key TCP Concepts . . . . . . . . . . . . . . . . . . . . 5
3.1. Header Format . . . . . . . . . . . . . . . . . . . . . . 5 3. Functional Specification . . . . . . . . . . . . . . . . . . 6
3.2. Terminology . . . . . . . . . . . . . . . . . . . . . . . 10 3.1. Header Format . . . . . . . . . . . . . . . . . . . . . . 6
3.3. Sequence Numbers . . . . . . . . . . . . . . . . . . . . 15 3.2. Terminology . . . . . . . . . . . . . . . . . . . . . . . 11
3.4. Establishing a connection . . . . . . . . . . . . . . . . 21 3.3. Sequence Numbers . . . . . . . . . . . . . . . . . . . . 16
3.4.1. Remote Address Validation . . . . . . . . . . . . . . 28 3.4. Establishing a connection . . . . . . . . . . . . . . . . 22
3.5. Closing a Connection . . . . . . . . . . . . . . . . . . 28 4. Closing a Connection . . . . . . . . . . . . . . . . . . . . 29
3.5.1. Half-Closed Connections . . . . . . . . . . . . . . . 31 4.1. Half-Closed Connections . . . . . . . . . . . . . . . . . 31
3.6. Precedence and Security . . . . . . . . . . . . . . . . . 31 5. Precedence and Security . . . . . . . . . . . . . . . . . . . 32
3.7. Segmentation . . . . . . . . . . . . . . . . . . . . . . 32 6. Segmentation . . . . . . . . . . . . . . . . . . . . . . . . 33
3.7.1. Maximum Segment Size Option . . . . . . . . . . . . . 33 6.1. Maximum Segment Size Option . . . . . . . . . . . . . . . 34
3.7.2. Path MTU Discovery . . . . . . . . . . . . . . . . . 35 6.2. Path MTU Discovery . . . . . . . . . . . . . . . . . . . 35
3.7.3. Interfaces with Variable MTU Values . . . . . . . . . 35 6.3. Interfaces with Variable MTU Values . . . . . . . . . . . 36
3.7.4. Nagle Algorithm . . . . . . . . . . . . . . . . . . . 36 6.4. Nagle Algorithm . . . . . . . . . . . . . . . . . . . . . 36
3.7.5. IPv6 Jumbograms . . . . . . . . . . . . . . . . . . . 36 6.5. IPv6 Jumbograms . . . . . . . . . . . . . . . . . . . . . 37
3.8. Data Communication . . . . . . . . . . . . . . . . . . . 36 7. Data Communication . . . . . . . . . . . . . . . . . . . . . 37
3.8.1. Retransmission Timeout . . . . . . . . . . . . . . . 37 7.1. Retransmission Timeout . . . . . . . . . . . . . . . . . 38
3.8.2. TCP Congestion Control . . . . . . . . . . . . . . . 37 7.2. TCP Congestion Control . . . . . . . . . . . . . . . . . 38
3.8.3. TCP Connection Failures . . . . . . . . . . . . . . . 38 7.3. TCP Connection Failures . . . . . . . . . . . . . . . . . 38
3.8.4. TCP Keep-Alives . . . . . . . . . . . . . . . . . . . 39 7.4. TCP Keep-Alives . . . . . . . . . . . . . . . . . . . . . 39
3.8.5. The Communication of Urgent Information . . . . . . . 39 7.5. The Communication of Urgent Information . . . . . . . . . 40
3.8.6. Managing the Window . . . . . . . . . . . . . . . . . 40 7.6. Managing the Window . . . . . . . . . . . . . . . . . . . 41
3.9. Interfaces . . . . . . . . . . . . . . . . . . . . . . . 45 7.6.1. Zero Window Probing . . . . . . . . . . . . . . . . . 42
3.9.1. User/TCP Interface . . . . . . . . . . . . . . . . . 45 7.6.2. Silly Window Syndrome Avoidance . . . . . . . . . . . 42
3.9.2. TCP/Lower-Level Interface . . . . . . . . . . . . . . 53 7.6.3. Delayed Acknowledgements - When to Send an ACK
3.10. Event Processing . . . . . . . . . . . . . . . . . . . . 55 Segment . . . . . . . . . . . . . . . . . . . . . . . 45
3.11. Glossary . . . . . . . . . . . . . . . . . . . . . . . . 81 8. Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . 45
4. Changes from RFC 793 . . . . . . . . . . . . . . . . . . . . 87 8.1. User/TCP Interface . . . . . . . . . . . . . . . . . . . 45
5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 90 8.2. TCP/Lower-Level Interface . . . . . . . . . . . . . . . . 53
6. Security and Privacy Considerations . . . . . . . . . . . . . 91 8.2.1. Source Routing . . . . . . . . . . . . . . . . . . . 54
7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 92 8.2.2. ICMP Messages . . . . . . . . . . . . . . . . . . . . 55
8. References . . . . . . . . . . . . . . . . . . . . . . . . . 92 8.2.3. Remote Address Validation . . . . . . . . . . . . . . 56
8.1. Normative References . . . . . . . . . . . . . . . . . . 92 8.3. Event Processing . . . . . . . . . . . . . . . . . . . . 56
8.2. Informative References . . . . . . . . . . . . . . . . . 94 8.4. Glossary . . . . . . . . . . . . . . . . . . . . . . . . 81
Appendix A. Other Implementation Notes . . . . . . . . . . . . . 96 9. Changes from RFC 793 . . . . . . . . . . . . . . . . . . . . 86
A.1. IP Security Compartment and Precedence . . . . . . . . . 96 10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 91
11. Security and Privacy Considerations . . . . . . . . . . . . . 91
12. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 92
13. References . . . . . . . . . . . . . . . . . . . . . . . . . 92
13.1. Normative References . . . . . . . . . . . . . . . . . . 92
13.2. Informative References . . . . . . . . . . . . . . . . . 94
Appendix A. Other Implementation Notes . . . . . . . . . . . . . 97
A.1. IP Security Compartment and Precedence . . . . . . . . . 97
A.2. Sequence Number Validation . . . . . . . . . . . . . . . 97 A.2. Sequence Number Validation . . . . . . . . . . . . . . . 97
A.3. Nagle Modification . . . . . . . . . . . . . . . . . . . 97 A.3. Nagle Modification . . . . . . . . . . . . . . . . . . . 98
A.4. Low Water Mark . . . . . . . . . . . . . . . . . . . . . 97 A.4. Low Water Mark . . . . . . . . . . . . . . . . . . . . . 98
Appendix B. TCP Requirement Summary . . . . . . . . . . . . . . 98 Appendix B. TCP Requirement Summary . . . . . . . . . . . . . . 98
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 101 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 102
1. Purpose and Scope 1. Purpose and Scope
In 1981, RFC 793 [12] was released, documenting the Transmission In 1981, RFC 793 [12] was released, documenting the Transmission
Control Protocol (TCP), and replacing earlier specifications for TCP Control Protocol (TCP), and replacing earlier specifications for TCP
that had been published in the past. that had been published in the past.
Since then, TCP has been implemented many times, and has been used as Since then, TCP has been implemented many times, and has been used as
a transport protocol for numerous applications on the Internet. a transport protocol for numerous applications on the Internet.
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 [33]. Over time, a combined to serve as the specification for TCP [36]. 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. A number deficiencies in security, performance, and other aspects. A number
of enhancements has grown and been documented separately. These were of enhancements has grown and been documented separately. These were
never accumulated together into an update to the base specification. never accumulated together into an update to the base 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
important algorithms that TCP uses (e.g. for congestion control), but important algorithms that TCP uses (e.g. for congestion control), but
skipping to change at page 4, line 48 skipping to change at page 5, line 7
repair losses. repair losses.
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 examples and RFC 793. It does not replicate or attempt to update the examples and
other discussion in RFC 793. Other documents are referenced to other discussion in RFC 793. Other documents are referenced to
provide explanation of the theory of operation, rationale, and provide explanation of the theory of operation, rationale, and
detailed discussion of design decisions. This document only focuses detailed discussion of design decisions. This document only focuses
on the normative behavior of the protocol. on the normative behavior of the protocol.
The "TCP Roadmap" [33] provides a more extensive guide to the RFCs The "TCP Roadmap" [36] 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. [21]) is a TCP requirement, but is a complex congestion control (e.g. [24]) 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 [31], but these are not include the high-performance extensions in [34], but these are not
strictly required or discussed in this document. strictly required or discussed in this document.
TEMPORARY EDITOR'S NOTE: This is an early revision in the process of TEMPORARY EDITOR'S NOTE: This is an early revision in the process of
updating RFC 793. Many planned changes are not yet incorporated. updating RFC 793. Many planned changes are not yet incorporated.
***Please do not use this revision as a basis for any work or ***Please do not use this revision as a basis for any work or
reference.*** reference.***
A list of changes from RFC 793 is contained in Section 4. A list of changes from RFC 793 is contained in Section 9.
TEMPORARY EDITOR'S NOTE: the current revision of this document does TEMPORARY EDITOR'S NOTE: the current revision of this document does
not yet collect all of the changes that will be in the final version. not yet collect all of the changes that will be in the final version.
The set of content changes planned for future revisions is kept in The set of content changes planned for future revisions is kept in
Section 4. Section 9.
2.1. Key TCP Concepts
TCP provides a reliable, in-order, byte-stream service to
applications.
The application byte-stream is conveyed over the network via TCP
segments, with each TCP segment sent as an Internet Protocol (IP)
datagram.
TCP reliability consists of detecting packet losses (via sequence
numbers) and errors (via per-segment checksums), as well as
correction of losses and errors via retransmission.
TCP supports unicast delivery of data. Anycast applications exist
that successfully use TCP without modifications, though there is some
risk of instability due to rerouting.
TCP is connection-oriented, though does not inherently include a
liveness detection capability.
Data flow is supported bidirectionally over TCP connections, though
applications are free to flow data only unidirectionally, if they so
choose.
TCP uses port numbers to identify application services and to
multiplex multiple flows between hosts.
A more detailed description of TCP's features compared to other
transport protocols can be found in Section 3.1 of [39]. Further
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
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] [5]. A TCP header follows the and destination host addresses [1] [5]. 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. (Editorial TODO - this last sentence makes sense in 793 than TCP. In early development of the Internet suite of protocols,
context, but may be a candidate to remove here? ... additionally, the IP header fields had been a part of TCP.
Section 2 of 793 is not includeed here, but some parts may be useful,
to quickly define basic concepts of ports, bytestream service, etc.
at high-level before delving into protocol details?)
TCP Header Format TCP Header Format
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 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Sequence Number | | Sequence Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Acknowledgment Number | | Acknowledgment Number |
skipping to change at page 7, line 11 skipping to change at page 8, line 11
receive. Once a connection is established this is always sent. receive. Once a connection is established this is always sent.
Data Offset: 4 bits Data Offset: 4 bits
The number of 32 bit words in the TCP Header. This indicates where The number of 32 bit words in the TCP Header. This indicates where
the data begins. The TCP header (even one including options) is an the data begins. The TCP header (even one including options) is an
integral number of 32 bits long. integral number of 32 bits long.
Rsrvd - Reserved: 4 bits Rsrvd - Reserved: 4 bits
Reserved for future use. Must be zero in generated segments and Reserved for future use. Must be zero in generated segments and
must be ignored in received segments. TODO -- no RFC reference for must be ignored in received segments, if corresponding future
this sentence ... do we want this change or should we keep the features are unimplemented by the sending or receiving host.
prior 793 description which is only "Must be zero." ... need to
discuss on TCPM list
Control Bits: 8 bits (from left to right): Control Bits: 8 bits (from left to right):
CWR: Congestion Window Reduced (see [9]) CWR: Congestion Window Reduced (see [9])
ECE: ECN-Echo (see [9]) ECE: ECN-Echo (see [9])
URG: Urgent Pointer field significant URG: Urgent Pointer field significant
ACK: Acknowledgment field significant ACK: Acknowledgment field significant
PSH: Push Function PSH: Push Function
RST: Reset the connection RST: Reset the connection
SYN: Synchronize sequence numbers SYN: Synchronize sequence numbers
skipping to change at page 9, line 15 skipping to change at page 10, line 15
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 [35], The list of all currently defined options is managed by IANA [40],
and each option is defined in other RFCs, as indicated there. That and each option is defined in other RFCs, as indicated there. That
set includes experimental options that can be extended to support set includes experimental options that can be extended to support
multiple concurrent uses [30]. multiple concurrent uses [33].
A given TCP implementation can support any currently defined A given TCP implementation can support any currently defined
options, but the following options MUST be supported (kind options, but the following options MUST be supported (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 10, line 35 skipping to change at page 11, line 35
Kind=2 Length=4 Kind=2 Length=4
Maximum Segment Size Option Data: 16 bits Maximum Segment Size Option Data: 16 bits
If this option is present, then it communicates the maximum If this option is present, then it communicates the maximum
receive segment size at the TCP which sends this segment. This receive segment size at the TCP which sends this segment. This
value is limited by the IP reassembly limit. This field may be value is limited by the IP reassembly limit. This field may be
sent in the initial connection request (i.e., in segments with sent in the initial connection request (i.e., in segments with
the SYN control bit set) and must not be sent in other segments. the SYN control bit set) and must not be sent in other segments.
If this option is not used, any segment size is allowed. A more If this option is not used, any segment size is allowed. A more
complete description of this option is in Section 3.7.1. complete description of this option is in Section 6.1.
Padding: variable Padding: variable
The TCP header padding is used to ensure that the TCP header ends The TCP header padding is used to ensure that the TCP header ends
and data begins on a 32 bit boundary. The padding is composed of and data begins on a 32 bit boundary. The padding is composed of
zeros. zeros.
3.2. Terminology 3.2. Terminology
Before we can discuss very much about the operation of the TCP we Before we can discuss very much about the operation of the TCP we
need to introduce some detailed terminology. The maintenance of a need to introduce some detailed terminology. The maintenance of a
TCP connection requires the remembering of several variables. We TCP connection requires the remembering of several variables. We
conceive of these variables being stored in a connection record conceive of these variables being stored in a connection record
called a Transmission Control Block or TCB. Among the variables called a Transmission Control Block or TCB. Among the variables
stored in the TCB are the local and remote socket numbers, the stored in the TCB are the local and remote socket numbers, the IP
security and precedence of the connection, pointers to the user's security level and compartment of the connection, pointers to the
send and receive buffers, pointers to the retransmit queue and to the user's send and receive buffers, pointers to the retransmit queue and
current segment. In addition several variables relating to the send to the current segment. In addition several variables relating to
and receive sequence numbers are stored in the TCB. the send and receive sequence numbers are stored in the TCB.
Send Sequence Variables Send Sequence Variables
SND.UNA - send unacknowledged SND.UNA - send unacknowledged
SND.NXT - send next SND.NXT - send next
SND.WND - send window SND.WND - send window
SND.UP - send urgent pointer SND.UP - send urgent pointer
SND.WL1 - segment sequence number used for last window update SND.WL1 - segment sequence number used for last window update
SND.WL2 - segment acknowledgment number used for last window SND.WL2 - segment acknowledgment number used for last window
update update
skipping to change at page 12, line 33 skipping to change at page 13, line 33
There are also some variables used frequently in the discussion that There are also some variables used frequently in the discussion that
take their values from the fields of the current segment. take their values from the fields of the current segment.
Current Segment Variables Current Segment Variables
SEG.SEQ - segment sequence number SEG.SEQ - segment sequence number
SEG.ACK - segment acknowledgment number SEG.ACK - segment acknowledgment number
SEG.LEN - segment length SEG.LEN - segment length
SEG.WND - segment window SEG.WND - segment window
SEG.UP - segment urgent pointer SEG.UP - segment urgent pointer
SEG.PRC - segment precedence value
A connection progresses through a series of states during its A connection progresses through a series of states during its
lifetime. The states are: LISTEN, SYN-SENT, SYN-RECEIVED, lifetime. The states are: LISTEN, SYN-SENT, SYN-RECEIVED,
ESTABLISHED, FIN-WAIT-1, FIN-WAIT-2, CLOSE-WAIT, CLOSING, LAST-ACK, ESTABLISHED, FIN-WAIT-1, FIN-WAIT-2, CLOSE-WAIT, CLOSING, LAST-ACK,
TIME-WAIT, and the fictional state CLOSED. CLOSED is fictional TIME-WAIT, and the fictional state CLOSED. CLOSED is fictional
because it represents the state when there is no TCB, and therefore, because it represents the state when there is no TCB, and therefore,
no connection. Briefly the meanings of the states are: no connection. Briefly the meanings of the states are:
LISTEN - represents waiting for a connection request from any LISTEN - represents waiting for a connection request from any
remote TCP and port. remote TCP and port.
skipping to change at page 18, line 38 skipping to change at page 19, line 38
ISN = M + F(localip, localport, remoteip, remoteport, secretkey) ISN = M + F(localip, localport, remoteip, remoteport, secretkey)
where M is the 4 microsecond timer, and F() is a pseudorandom where M is the 4 microsecond timer, and F() is a pseudorandom
function (PRF) of the connection's identifying parameters ("localip, function (PRF) of the connection's identifying parameters ("localip,
localport, remoteip, remoteport") and a secret key ("secretkey"). localport, remoteip, remoteport") and a secret key ("secretkey").
F() MUST NOT be computable from the outside, or an attacker could F() MUST NOT be computable from the outside, or an attacker could
still guess at sequence numbers from the ISN used for some other still guess at sequence numbers from the ISN used for some other
connection. The PRF could be implemented as a cryptographic has of connection. The PRF could be implemented as a cryptographic has of
the concatenation of the TCP connection parameters and some secret the concatenation of the TCP connection parameters and some secret
data. For discussion of the selection of a specific hash algorithm data. For discussion of the selection of a specific hash algorithm
and management of the secret key data, please see Section 3 of [28]. and management of the secret key data, please see Section 3 of [31].
For each connection there is a send sequence number and a receive For each connection there is a send sequence number and a receive
sequence number. The initial send sequence number (ISS) is chosen by sequence number. The initial send sequence number (ISS) is chosen by
the data sending TCP, and the initial receive sequence number (IRS) the data sending TCP, and the initial receive sequence number (IRS)
is learned during the connection establishing procedure. is learned during the connection establishing procedure.
For a connection to be established or initialized, the two TCPs must For a connection to be established or initialized, the two TCPs must
synchronize on each other's initial sequence numbers. This is done synchronize on each other's initial sequence numbers. This is done
in an exchange of connection establishing segments carrying a control in an exchange of connection establishing segments carrying a control
bit called "SYN" (for synchronize) and the initial sequence numbers. bit called "SYN" (for synchronize) and the initial sequence numbers.
skipping to change at page 27, line 28 skipping to change at page 28, line 28
of the sequence number and segment length of the incoming segment. of the sequence number and segment length of the incoming segment.
The connection remains in the CLOSED state. The connection remains in the CLOSED state.
2. If the connection is in any non-synchronized state (LISTEN, 2. If the connection is in any non-synchronized state (LISTEN,
SYN-SENT, SYN-RECEIVED), and the incoming segment acknowledges SYN-SENT, SYN-RECEIVED), and the incoming segment acknowledges
something not yet sent (the segment carries an unacceptable ACK), something not yet sent (the segment carries an unacceptable ACK),
or if an incoming segment has a security level or compartment or if an incoming segment has a security level or compartment
which does not exactly match the level and compartment requested which does not exactly match the level and compartment requested
for the connection, a reset is sent. for the connection, a reset is sent.
If our SYN has not been acknowledged and the precedence level of
the incoming segment is higher than the precedence level requested
then either raise the local precedence level (if allowed by the
user and the system) or send a reset; or if the precedence level
of the incoming segment is lower than the precedence level
requested then continue as if the precedence matched exactly (if
the remote TCP cannot raise the precedence level to match ours
this will be detected in the next segment it sends, and the
connection will be terminated then). If our SYN has been
acknowledged (perhaps in this incoming segment) the precedence
level of the incoming segment must match the local precedence
level exactly, if it does not a reset must be sent.
If the incoming segment has an ACK field, the reset takes its If the incoming segment has an ACK field, the reset takes its
sequence number from the ACK field of the segment, otherwise the sequence number from the ACK field of the segment, otherwise the
reset has sequence number zero and the ACK field is set to the sum reset has sequence number zero and the ACK field is set to the sum
of the sequence number and segment length of the incoming segment. of the sequence number and segment length of the incoming segment.
The connection remains in the same state. The connection remains in the same state.
3. If the connection is in a synchronized state (ESTABLISHED, 3. If the connection is in a synchronized state (ESTABLISHED,
FIN-WAIT-1, FIN-WAIT-2, CLOSE-WAIT, CLOSING, LAST-ACK, TIME-WAIT), FIN-WAIT-1, FIN-WAIT-2, CLOSE-WAIT, CLOSING, LAST-ACK, TIME-WAIT),
any unacceptable segment (out of window sequence number or any unacceptable segment (out of window sequence number or
unacceptable acknowledgment number) must elicit only an empty unacceptable acknowledgment number) must elicit only an empty
acknowledgment segment containing the current send-sequence number acknowledgment segment containing the current send-sequence number
and an acknowledgment indicating the next sequence number expected and an acknowledgment indicating the next sequence number expected
to be received, and the connection remains in the same state. to be received, and the connection remains in the same state.
If an incoming segment has a security level, or compartment, or If an incoming segment has a security level, or compartment which
precedence which does not exactly match the level, and does not exactly match the level and compartment requested for the
compartment, and precedence requested for the connection,a reset connection, a reset is sent and the connection goes to the CLOSED
is sent and the connection goes to the CLOSED state. The reset state. The reset takes its sequence number from the ACK field of
takes its sequence number from the ACK field of the incoming the incoming segment.
segment.
Reset Processing Reset Processing
In all states except SYN-SENT, all reset (RST) segments are validated In all states except SYN-SENT, all reset (RST) segments are validated
by checking their SEQ-fields. A reset is valid if its sequence by checking their SEQ-fields. A reset is valid if its sequence
number is in the window. In the SYN-SENT state (a RST received in number is in the window. In the SYN-SENT state (a RST received in
response to an initial SYN), the RST is acceptable if the ACK field response to an initial SYN), the RST is acceptable if the ACK field
acknowledges the SYN. acknowledges the SYN.
The receiver of a RST first validates it, then changes state. If the The receiver of a RST first validates it, then changes state. If the
receiver was in the LISTEN state, it ignores it. If the receiver was receiver was in the LISTEN state, it ignores it. If the receiver was
in SYN-RECEIVED state and had previously been in the LISTEN state, in SYN-RECEIVED state and had previously been in the LISTEN state,
then the receiver returns to the LISTEN state, otherwise the receiver then the receiver returns to the LISTEN state, otherwise the receiver
aborts the connection and goes to the CLOSED state. If the receiver aborts the connection and goes to the CLOSED state. If the receiver
was in any other state, it aborts the connection and advises the user was in any other state, it aborts the connection and advises the user
and goes to the CLOSED state. and goes to the CLOSED state.
TCP SHOULD allow a received RST segment to include data. TCP SHOULD allow a received RST segment to include data.
3.4.1. Remote Address Validation 4. Closing a Connection
TODO - figure out if this section would fit better elsewhere, for
instance in the more detailed description of the OPEN call later on
A TCP implementation MUST reject as an error a local OPEN call for an
invalid remote IP address (e.g., a broadcast or multicast address).
An incoming SYN with an invalid source address must be ignored either
by TCP or by the IP layer (see Section 3.2.1.3 of [14]).
A TCP implementation MUST silently discard an incoming SYN segment
that is addressed to a broadcast or multicast address.
3.5. Closing a Connection
CLOSE is an operation meaning "I have no more data to send." The CLOSE is an operation meaning "I have no more data to send." The
notion of closing a full-duplex connection is subject to ambiguous notion of closing a full-duplex connection is subject to ambiguous
interpretation, of course, since it may not be obvious how to treat interpretation, of course, since it may not be obvious how to treat
the receiving side of the connection. We have chosen to treat CLOSE the receiving side of the connection. We have chosen to treat CLOSE
in a simplex fashion. The user who CLOSEs may continue to RECEIVE in a simplex fashion. The user who CLOSEs may continue to RECEIVE
until he is told that the other side has CLOSED also. Thus, a until he is told that the other side has CLOSED also. Thus, a
program could initiate several SENDs followed by a CLOSE, and then program could initiate several SENDs followed by a CLOSE, and then
continue to RECEIVE until signaled that a RECEIVE failed because the continue to RECEIVE until signaled that a RECEIVE failed because the
other side has CLOSED. We assume that the TCP will signal a user, other side has CLOSED. We assume that the TCP will signal a user,
skipping to change at page 31, line 9 skipping to change at page 31, line 33
Figure 12 Figure 12
A TCP connection may terminate in two ways: (1) the normal TCP close A TCP connection may terminate in two ways: (1) the normal TCP close
sequence using a FIN handshake, and (2) an "abort" in which one or sequence using a FIN handshake, and (2) an "abort" in which one or
more RST segments are sent and the connection state is immediately more RST segments are sent and the connection state is immediately
discarded. If a TCP connection is closed by the remote site, the discarded. If a TCP connection is closed by the remote site, the
local application MUST be informed whether it closed normally or was local application MUST be informed whether it closed normally or was
aborted. aborted.
3.5.1. Half-Closed Connections 4.1. Half-Closed Connections
The normal TCP close sequence delivers buffered data reliably in both The normal TCP close sequence delivers buffered data reliably in both
directions. Since the two directions of a TCP connection are closed directions. Since the two directions of a TCP connection are closed
independently, it is possible for a connection to be "half closed," independently, it is possible for a connection to be "half closed,"
i.e., closed in only one direction, and a host is permitted to i.e., closed in only one direction, and a host is permitted to
continue sending data in the open direction on a half-closed continue sending data in the open direction on a half-closed
connection. connection.
A host MAY implement a "half-duplex" TCP close sequence, so that an A host MAY implement a "half-duplex" TCP close sequence, so that an
application that has called CLOSE cannot continue to read data from application that has called CLOSE cannot continue to read data from
skipping to change at page 31, line 37 skipping to change at page 32, line 13
directly from TIME-WAIT state, if it: directly from TIME-WAIT state, 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 [26] in order to support higher connection is described in [29] in order to support higher connection
establishment rates. This algorithm for reducing TIME-WAIT is a Best establishment rates. This algorithm for reducing TIME-WAIT is a Best
Current Practice that SHOULD be implemented, since timestamp options Current Practice that SHOULD be implemented, since timestamp options
are commonly used, and using them to reduce TIME-WAIT provides are commonly used, and using them to reduce TIME-WAIT provides
benefits for busy Internet servers. benefits for busy Internet servers.
3.6. Precedence and Security 5. Precedence and Security
TODO - talk to TCPM about what to do about precedence and security
compartment throughout the document ... security compartment material
for IPv4 may be fine nearly as-is, but precedence was a subset of
what DSCP includes and it's not clear that running code actually does
what 793 says about precedence anyways, especially since now as a
DSCP it doesn't make sense to do greater-than comparisons on, nor to
reset connections if it changes.
The intent is that connection be allowed only between ports operating
with exactly the same security and compartment values and at the
higher of the precedence level requested by the two ports.
The precedence and security parameters used in TCP are exactly those
defined in the Internet Protocol (IP) [1]. Throughout this TCP
specification the term "security/compartment" is intended to indicate
the security parameters used in IP including security, compartment,
user group, and handling restriction.
A connection attempt with mismatched security/compartment values or a
lower precedence value must be rejected by sending a reset.
Rejecting a connection due to too low a precedence only occurs after
an acknowledgment of the SYN has been received.
Note that TCP modules which operate only at the default value of The IPv4 specification [1] includes a precedence value in the Type of
precedence will still have to check the precedence of incoming Service field (TOS), that was also modified in [15], and then
segments and possibly raise the precedence level they use on the obsoleted by the definition of Differentiated Services (DiffServ)
connection. [6]. In DiffServ the former precedence values are treated as Class
Selector codepoints, and methods for compatible treatment are
described in the DiffServ architecture. The RFC 793/1122 TCP
specification includes logic intending to have connections use the
highest precedence requested by either endpoint application, and to
keep the precedence consistent throughout a connection. There is an
assumption of bidirectional/symmetric precedence values, however, the
DiffServ architecture is asymmetric. Problems were described in [17]
and the solution described is to ignore IP precedence in TCP. Since
RFC 2873 is a Standards Track document (although not marked as
updating RFC 793), these checks are no longer a part of the TCP
standard defined in this document, though the DiffServ field value is
still is a part of the interface between TCP and the network layer,
and values can be indicated both ways between TCP and the
application.
The security parameters may be used even in a non-secure environment The IP security option (IPSO) and compartment defined in [1] was
(the values would indicate unclassified data), thus hosts in non- refined in RFC 1038 that was later obsoleted by RFC 1108. The
secure environments must be prepared to receive the security Commercial IP Security Option (CIPSO) is defined in FIPS-188, and is
parameters, though they need not send them. supported by some vendors and operating systems. RFC 1108 is now
Historic, though RFC 791 itself has not been updated to remove the IP
security option. For IPv6, a similar option (CALIPSO) has been
defined [23]. RFC 793 includes logic that includes the IP security/
compartment information in treatment of TCP segments. References to
the IP "security/compartment" in this document may be relevant for
Multi-Level Secure (MLS) system implementers, but can be ignored for
non-MLS implementations, consistent with running code on the
Internet. See Appendix A.1 for further discussion. Note that RFC
5570 describes some MLS networking scenarios where IPSO, CIPSO, or
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
document on the relation between IP security.
3.7. Segmentation 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 [19], there are performance optimizations possible when the MPA [21], 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 33, line 39 skipping to change at page 34, line 19
o Enabling "fate sharing" between TCP segments and lower-layer data o Enabling "fate sharing" between TCP segments and lower-layer data
units (e.g. below IP, for links with cell or frame sizes smaller units (e.g. below IP, for links with cell or frame sizes smaller
than the IP MTU). than the IP MTU).
Towards meeting these competing sets of goals, TCP includes several Towards meeting these competing sets of goals, TCP includes several
mechanisms, including the Maximum Segment Size option, Path MTU mechanisms, including the Maximum Segment Size option, Path MTU
Discovery, the Nagle algorithm, and support for IPv6 Jumbograms, as Discovery, the Nagle algorithm, and support for IPv6 Jumbograms, as
discussed in the following subsections. discussed in the following subsections.
3.7.1. Maximum Segment Size Option 6.1. Maximum Segment Size Option
TCP MUST implement both sending and receiving the MSS option. TCP MUST implement both sending and receiving the MSS option.
TCP SHOULD send an MSS option in every SYN segment when its receive TCP SHOULD send an MSS option in every SYN segment when its receive
MSS differs from the default 536 for IPv4 or 1220 for IPv6, and MAY MSS differs from the default 536 for IPv4 or 1220 for IPv6, and MAY
send it always. send it always.
If an MSS option is not received at connection setup, TCP MUST assume If an MSS option is not received at connection setup, TCP MUST assume
a default send MSS of 536 (576-40) for IPv4 or 1220 (1280 - 60) for a default send MSS of 536 (576-40) for IPv4 or 1220 (1280 - 60) for
IPv6. IPv6.
skipping to change at page 34, line 38 skipping to change at page 35, line 18
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
[29] discusses this in greater detail. [32] 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). TCP obtains MMS_R can be received (and reassembled at the IP layer). TCP obtains MMS_R
and MMS_S from the IP layer; see the generic call GET_MAXSIZES in and MMS_S from the IP layer; see the generic call GET_MAXSIZES in
Section 3.4 of RFC 1122. These are defined in terms of their IP MTU Section 3.4 of RFC 1122. These are defined in terms of their IP MTU
equivalents, EMTU_R and EMTU_S [14]. equivalents, EMTU_R and EMTU_S [14].
When TCP is used in a situation where either the IP or TCP headers When TCP is used in a situation where either the IP or TCP headers
are not fixed, the sender must reduce the amount of TCP data in any are not fixed, the sender must reduce the amount of TCP data in any
given packet by the number of octets used by the IP and TCP options. given packet by the number of octets used by the IP and TCP options.
This has been a point of confusion historically, as explained in RFC This has been a point of confusion historically, as explained in RFC
6691, Section 3.1. 6691, Section 3.1.
3.7.2. Path MTU Discovery 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
links, but will rarely have insight about MTUs across an entire links, but will rarely have insight about MTUs across an entire
network path. For IPv4, RFC 1122 provides an IP-layer recommendation network path. For IPv4, RFC 1122 provides an IP-layer recommendation
on the default effective MTU for sending to be less than or equal to on the default effective MTU for sending to be less than or equal to
576 for destinations not directly connected. For IPv6, this would be 576 for destinations not directly connected. For IPv6, this would be
1280. In all cases, however, implementation of Path MTU Discovery 1280. In all cases, however, implementation of Path MTU Discovery
(PMTUD) and Packetization Layer Path MTU Discovery (PLPMTUD) is (PMTUD) and Packetization Layer Path MTU Discovery (PLPMTUD) is
strongly recommended in order for TCP to improve segmentation strongly recommended in order for TCP to improve segmentation
decisions. Both PMTUD and PLPMTUD help TCP choose segment sizes that decisions. Both PMTUD and PLPMTUD help TCP choose segment sizes that
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 [8]. PLPMTUD [16] is a Standards Track experienced in practice [8]. PLPMTUD [18] 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.7.3. Interfaces with Variable MTU Values 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) [22]. It is compression, e.g., RObust Header Compression (ROHC) [25]. It is
tempting for TCP to want to advertise the largest possible MSS, to tempting for TCP to want to advertise the largest possible MSS, to
support the most efficient use of compressed payloads. support the most efficient use of compressed payloads.
Unfortunately, some compression schemes occasionally need to transmit Unfortunately, some compression schemes occasionally need to transmit
full headers (and thus smaller payloads) to resynchronize state at full headers (and thus smaller payloads) to resynchronize state at
their endpoint compressors/decompressors. If the largest MTU is used their endpoint compressors/decompressors. If the largest MTU is used
to calculate the value to advertise in the MSS option, TCP to calculate the value to advertise in the MSS option, TCP
retransmission may interfere with compressor resynchronization. retransmission may interfere with compressor resynchronization.
As a result, when the effective MTU of an interface varies, TCP As a result, when the effective MTU of an interface varies, TCP
SHOULD use the smallest effective MTU of the interface to calculate SHOULD use the smallest effective MTU of the interface to calculate
the value to advertise in the MSS option. the value to advertise in the MSS option.
skipping to change at page 36, line 15 skipping to change at page 36, line 43
Unfortunately, some compression schemes occasionally need to transmit Unfortunately, some compression schemes occasionally need to transmit
full headers (and thus smaller payloads) to resynchronize state at full headers (and thus smaller payloads) to resynchronize state at
their endpoint compressors/decompressors. If the largest MTU is used their endpoint compressors/decompressors. If the largest MTU is used
to calculate the value to advertise in the MSS option, TCP to calculate the value to advertise in the MSS option, TCP
retransmission may interfere with compressor resynchronization. retransmission may interfere with compressor resynchronization.
As a result, when the effective MTU of an interface varies, TCP As a result, when the effective MTU of an interface varies, TCP
SHOULD use the smallest effective MTU of the interface to calculate SHOULD use the smallest effective MTU of the interface to calculate
the value to advertise in the MSS option. the value to advertise in the MSS option.
3.7.4. Nagle Algorithm 6.4. Nagle Algorithm
The "Nagle algorithm" was described in RFC 896 [13] and was The "Nagle algorithm" was described in RFC 896 [13] and was
recommended in RFC 1122 [14] for mitigation of an early problem of recommended in RFC 1122 [14] for mitigation of an early problem of
too many small packets being generated. It has been implemented in too many small packets being generated. It has been implemented in
most current TCP code bases, sometimes with minor variations. most current TCP code bases, sometimes with minor variations (see
Appendix A.3).
If there is unacknowledged data (i.e., SND.NXT > SND.UNA), then the If there is unacknowledged data (i.e., SND.NXT > SND.UNA), then the
sending TCP buffers all user data (regardless of the PSH bit), until sending TCP buffers all user data (regardless of the PSH bit), until
the outstanding data has been acknowledged or until the TCP can send the outstanding data has been acknowledged or until the TCP can send
a full-sized segment (Eff.snd.MSS bytes). a full-sized segment (Eff.snd.MSS bytes).
TODO - see if SEND description later should be updated to reflect
this
A TCP SHOULD implement the Nagle Algorithm to coalesce short A TCP SHOULD implement the Nagle Algorithm to coalesce short
segments. However, there MUST be a way for an application to disable segments. However, there MUST be a way for an application to disable
the Nagle algorithm on an individual connection. In all cases, the Nagle algorithm on an individual connection. In all cases,
sending data is also subject to the limitation imposed by the Slow sending data is also subject to the limitation imposed by the Slow
Start algorithm [21]. Start algorithm [24].
3.7.5. IPv6 Jumbograms 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 [7] defines that an MSS value of 65,535 option can convey. RFC 2675 [7] defines that an MSS value of 65,535
bytes is to be treated as infinity, and Path MTU Discovery [3] is bytes is to be treated as infinity, and Path MTU Discovery [3] is
used to determine the actual MSS. used to determine the actual MSS.
3.8. Data Communication 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 (after a timeout) to ensure delivery of every segment. retransmission (after a timeout) to ensure delivery of every segment.
Duplicate segments may arrive due to network or TCP retransmission. Duplicate segments may arrive due to network or TCP retransmission.
As discussed in the section on sequence numbers the TCP performs As discussed in the section on sequence numbers the TCP performs
certain tests on the sequence and acknowledgment numbers in the certain tests on the sequence and acknowledgment numbers in the
segments to verify their acceptability. segments to verify their acceptability.
skipping to change at page 37, line 27 skipping to change at page 38, line 5
an acknowledgment it advances SND.UNA. The extent to which the an acknowledgment it advances SND.UNA. The extent to which the
values of these variables differ is a measure of the delay in the values of these variables differ is a measure of the delay in the
communication. The amount by which the variables are advanced is the communication. The amount by which the variables are advanced is the
length of the data and SYN or FIN flags in the segment. Note that length of the data and SYN or FIN flags in the segment. Note that
once in the ESTABLISHED state all segments must carry current once in the ESTABLISHED state all segments must carry current
acknowledgment information. acknowledgment information.
The CLOSE user call implies a push function, as does the FIN control The CLOSE user call implies a push function, as does the FIN control
flag in an incoming segment. flag in an incoming segment.
3.8.1. Retransmission Timeout 7.1. Retransmission Timeout
Because of the variability of the networks that compose an Because of the variability of the networks that compose an
internetwork system and the wide range of uses of TCP connections the internetwork system and the wide range of uses of TCP connections the
retransmission timeout (RTO) must be dynamically determined. retransmission timeout (RTO) must be dynamically determined.
The RTO MUST be computed according to the algorithm in [10], The RTO MUST be computed according to the algorithm in [10],
including Karn's algorithm for taking RTT samples. including Karn's algorithm for taking RTT samples.
RFC 793 contains an early example procedure for computing the RTO. RFC 793 contains an early example procedure for computing the RTO.
This was then replaced by the algorithm described in RFC 1122, and This was then replaced by the algorithm described in RFC 1122, and
subsequently updated in RFC 2988, and then again in RFC 6298. subsequently updated in RFC 2988, and then again in RFC 6298.
If a retransmitted packet is identical to the original packet (which If a retransmitted packet is identical to the original packet (which
implies not only that the data boundaries have not changed, but also implies not only that the data boundaries have not changed, but also
that the window and acknowledgment fields of the header have not that the window and acknowledgment fields of the header have not
changed), then the same IP Identification field MAY be used (see changed), then the same IP Identification field MAY be used (see
Section 3.2.1.5 of RFC 1122). Section 3.2.1.5 of RFC 1122).
3.8.2. TCP Congestion Control 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 MUST implement RFC 5681. A TCP MUST implement RFC 5681.
Explicit Congestion Notification (ECN) was defined in RFC 3168 and is Explicit Congestion Notification (ECN) was defined in RFC 3168 and is
an IETF Standards Track enhancement that has many benefits [34]. an IETF Standards Track enhancement that has many benefits [38].
A TCP SHOULD implement ECN as described in RFC 3168. A TCP SHOULD implement ECN as described in RFC 3168.
3.8.3. TCP Connection Failures 7.3. TCP Connection Failures
Excessive retransmission of the same segment by TCP indicates some Excessive retransmission of the same segment by TCP indicates some
failure of the remote host or the Internet path. This failure may be failure of the remote host or the Internet path. This failure may be
of short or long duration. The following procedure MUST be used to of short or long duration. The following procedure MUST be used to
handle excessive retransmissions of data segments: handle excessive retransmissions of data segments:
(a) There are two thresholds R1 and R2 measuring the amount of (a) There are two thresholds R1 and R2 measuring the amount of
retransmission that has occurred for the same segment. R1 and R2 retransmission that has occurred for the same segment. R1 and R2
might be measured in time units or as a count of retransmissions. might be measured in time units or as a count of retransmissions.
skipping to change at page 38, line 40 skipping to change at page 39, line 17
(c) When the number of transmissions of the same segment reaches a (c) When the number of transmissions of the same segment reaches a
threshold R2 greater than R1, close the connection. threshold R2 greater than R1, close the connection.
(d) An application MUST be able to set the value for R2 for a (d) An application MUST be able to set the value for R2 for a
particular connection. For example, an interactive application particular connection. For example, an interactive application
might set R2 to "infinity," giving the user control over when to might set R2 to "infinity," giving the user control over when to
disconnect. disconnect.
(d) TCP SHOULD inform the application of the delivery problem (d) TCP SHOULD inform the application of the delivery problem
(unless such information has been disabled by the application; see (unless such information has been disabled by the application; see
RFC1122 Section 4.2.4.1 - TODO update to error reporting Asynchronous Reports section), when R1 is reached and before R2.
description in this document), when R1 is reached and before R2.
This will allow a remote login (User Telnet) application program This will allow a remote login (User Telnet) application program
to inform the user, for example. to inform the user, for example.
The value of R1 SHOULD correspond to at least 3 retransmissions, at The value of R1 SHOULD correspond to at least 3 retransmissions, at
the current RTO. The value of R2 SHOULD correspond to at least 100 the current RTO. The value of R2 SHOULD correspond to at least 100
seconds. seconds.
An attempt to open a TCP connection could fail with excessive An attempt to open a TCP connection could fail with excessive
retransmissions of the SYN segment or by receipt of a RST segment or retransmissions of the SYN segment or by receipt of a RST segment or
an ICMP Port Unreachable. SYN retransmissions MUST be handled in the an ICMP Port Unreachable. SYN retransmissions MUST be handled in the
general way just described for data retransmissions, including general way just described for data retransmissions, including
notification of the application layer. notification of the application layer.
However, the values of R1 and R2 may be different for SYN and data However, the values of R1 and R2 may be different for SYN and data
segments. In particular, R2 for a SYN segment MUST be set large segments. In particular, R2 for a SYN segment MUST be set large
enough to provide retransmission of the segment for at least 3 enough to provide retransmission of the segment for at least 3
minutes. The application can close the connection (i.e., give up on minutes. The application can close the connection (i.e., give up on
the open attempt) sooner, of course. the open attempt) sooner, of course.
3.8.4. TCP Keep-Alives 7.4. TCP Keep-Alives
Implementors MAY include "keep-alives" in their TCP implementations, Implementors MAY include "keep-alives" in their TCP implementations,
although this practice is not universally accepted. If keep-alives although this practice is not universally accepted. If keep-alives
are included, the application MUST be able to turn them on or off for are included, the application MUST be able to turn them on or off for
each TCP connection, and they MUST default to off. each TCP connection, and they MUST default to off.
Keep-alive packets MUST only be sent when no data or acknowledgement Keep-alive packets MUST only be sent when no data or acknowledgement
packets have been received for the connection within an interval. packets have been received for the connection within an interval.
This interval MUST be configurable and MUST default to no less than This interval MUST be configurable and MUST default to no less than
two hours. two hours.
skipping to change at page 39, line 35 skipping to change at page 40, line 12
It is extremely important to remember that ACK segments that contain It is extremely important to remember that ACK segments that contain
no data are not reliably transmitted by TCP. Consequently, if a no data are not reliably transmitted by TCP. Consequently, if a
keep-alive mechanism is implemented it MUST NOT interpret failure to keep-alive mechanism is implemented it MUST NOT interpret failure to
respond to any specific probe as a dead connection. respond to any specific probe as a dead connection.
An implementation SHOULD send a keep-alive segment with no data; An implementation SHOULD send a keep-alive segment with no data;
however, it MAY be configurable to send a keep-alive segment however, it MAY be configurable to send a keep-alive segment
containing one garbage octet, for compatibility with erroneous TCP containing one garbage octet, for compatibility with erroneous TCP
implementations. implementations.
3.8.5. The Communication of Urgent Information 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. new applications SHOULD NOT employ the TCP urgent mechanism.
However, TCP implementations MUST still include support for the However, TCP implementations MUST still include support for the
urgent mechanism. Details can be found in RFC 6093 [25]. urgent mechanism. Details can be found in RFC 6093 [28].
The objective of the TCP urgent mechanism is to allow the sending The objective of the TCP urgent mechanism is to allow the sending
user to stimulate the receiving user to accept some urgent data and user to stimulate the receiving user to accept some urgent data and
to permit the receiving TCP to indicate to the receiving user when to permit the receiving TCP to indicate to the receiving user when
all the currently known urgent data has been received by the user. all the currently known urgent data has been received by the user.
This mechanism permits a point in the data stream to be designated as This mechanism permits a point in the data stream to be designated as
the end of urgent information. Whenever this point is in advance of the end of urgent information. Whenever this point is in advance of
the receive sequence number (RCV.NXT) at the receiving TCP, that TCP the receive sequence number (RCV.NXT) at the receiving TCP, that TCP
must tell the user to go into "urgent mode"; when the receive must tell the user to go into "urgent mode"; when the receive
skipping to change at page 40, line 28 skipping to change at page 41, line 5
A TCP MUST support a sequence of urgent data of any length. [14] A TCP MUST support a sequence of urgent data of any length. [14]
A TCP MUST inform the application layer asynchronously whenever it A TCP MUST inform the application layer asynchronously whenever it
receives an Urgent pointer and there was previously no pending urgent receives an Urgent pointer and there was previously no pending urgent
data, or whenvever the Urgent pointer advances in the data stream. data, or whenvever the Urgent pointer advances in the data stream.
There MUST be a way for the application to learn how much urgent data There MUST be a way for the application to learn how much urgent data
remains to be read from the connection, or at least to determine remains to be read from the connection, or at least to determine
whether or not more urgent data remains to be read. [14] whether or not more urgent data remains to be read. [14]
3.8.6. Managing the Window 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 packages the data to be transmitted into segments The sending TCP packages the data to be transmitted into segments
which fit the current window, and may repackage segments on the which fit the current window, and may repackage segments on the
retransmission queue. Such repackaging is not required, but may be retransmission queue. Such repackaging is not required, but may be
skipping to change at page 41, line 22 skipping to change at page 41, line 45
The mechanisms provided allow a TCP to advertise a large window and The mechanisms provided allow a TCP to advertise a large window and
to subsequently advertise a much smaller window without having to subsequently advertise a much smaller window without having
accepted that much data. This, so called "shrinking the window," is accepted that much data. This, so called "shrinking the window," is
strongly discouraged. The robustness principle dictates that TCPs strongly discouraged. The robustness principle dictates that TCPs
will not shrink the window themselves, but will be prepared for such will not shrink the window themselves, but will be prepared for such
behavior on the part of other TCPs. behavior on the part of other TCPs.
A TCP receiver SHOULD NOT shrink the window, i.e., move the right A TCP receiver SHOULD NOT shrink the window, i.e., move the right
window edge to the left. However, a sending TCP MUST be robust window edge to the left. However, a sending TCP MUST be robust
against window shrinking, which may cause the "useable window" (see against window shrinking, which may cause the "useable window" (see
Section 3.8.6.2.1) to become negative. Section 7.6.2.1) to become negative.
If this happens, the sender SHOULD NOT send new data, but SHOULD If this happens, the sender SHOULD NOT send new data, but SHOULD
retransmit normally the old unacknowledged data between SND.UNA and retransmit normally the old unacknowledged data between SND.UNA and
SND.UNA+SND.WND. The sender MAY also retransmit old data beyond SND.UNA+SND.WND. The sender MAY also retransmit old data beyond
SND.UNA+SND.WND, but SHOULD NOT time out the connection if data SND.UNA+SND.WND, but SHOULD NOT time out the connection if data
beyond the right window edge is not acknowledged. If the window beyond the right window edge is not acknowledged. If the window
shrinks to zero, the TCP MUST probe it in the standard way (described shrinks to zero, the TCP MUST probe it in the standard way (described
below). below).
3.8.6.1. Zero Window Probing 7.6.1. Zero Window Probing
The sending TCP must be prepared to accept from the user and send at The sending TCP must be prepared to accept from the user and send at
least one octet of new data even if the send window is zero. The least one octet of new data even if the send window is zero. The
sending TCP must regularly retransmit to the receiving TCP even when sending TCP must regularly retransmit to the receiving TCP even when
the window is zero, in order to "probe" the window. Two minutes is the window is zero, in order to "probe" the window. Two minutes is
recommended for the retransmission interval when the window is zero. recommended for the retransmission interval when the window is zero.
This retransmission is essential to guarantee that when either TCP This retransmission is essential to guarantee that when either TCP
has a zero window the re-opening of the window will be reliably has a zero window the re-opening of the window will be reliably
reported to the other. This is referred to as Zero-Window Probing reported to the other. This is referred to as Zero-Window Probing
(ZWP) in other documents. (ZWP) in other documents.
Probing of zero (offered) windows MUST be supported. Probing of zero (offered) windows MUST be supported.
A TCP MAY keep its offered receive window closed indefinitely. As A TCP MAY keep its offered receive window closed indefinitely. As
long as the receiving TCP continues to send acknowledgments in long as the receiving TCP continues to send acknowledgments in
response to the probe segments, the sending TCP MUST allow the response to the probe segments, the sending TCP MUST allow the
connection to stay open. This enables TCP to function in scenarios connection to stay open. This enables TCP to function in scenarios
such as the "printer ran out of paper" situation described in such as the "printer ran out of paper" situation described in
Section 4.2.2.17 of RFC1122. The behavior is subject to the Section 4.2.2.17 of RFC1122. The behavior is subject to the
implementation's resource management concerns, as noted in [27]. implementation's resource management concerns, as noted in [30].
When the receiving TCP has a zero window and a segment arrives it When the receiving TCP has a zero window and a segment arrives it
must still send an acknowledgment showing its next expected sequence must still send an acknowledgment showing its next expected sequence
number and current window (zero). number and current window (zero).
3.8.6.2. Silly Window Syndrome Avoidance 7.6.2. Silly Window Syndrome Avoidance
The "Silly Window Syndrome" (SWS) is a stable pattern of small The "Silly Window Syndrome" (SWS) is a stable pattern of small
incremental window movements resulting in extremely poor TCP incremental window movements resulting in extremely poor TCP
performance. Algorithms to avoid SWS are described below for both performance. Algorithms to avoid SWS are described below for both
the sending side and the receiving side. RFC 1122 contains more the sending side and the receiving side. RFC 1122 contains more
detailed discussion of the SWS problem. Note that the Nagle detailed discussion of the SWS problem. Note that the Nagle
algorithm and the sender SWS avoidance algorithm play complementary algorithm and the sender SWS avoidance algorithm play complementary
roles in improving performance. The Nagle algorithm discourages roles in improving performance. The Nagle algorithm discourages
sending tiny segments when the data to be sent increases in small sending tiny segments when the data to be sent increases in small
increments, while the SWS avoidance algorithm discourages small increments, while the SWS avoidance algorithm discourages small
segments resulting from the right window edge advancing in small segments resulting from the right window edge advancing in small
increments. increments.
3.8.6.2.1. Sender's Algorithm - When to Send Data 7.6.2.1. Sender's Algorithm - When to Send Data
A TCP MUST include a SWS avoidance algorithm in the sender. A TCP MUST include a SWS avoidance algorithm in the sender.
A TCP SHOULD implement the Nagle Algorithm to coalesce short A TCP SHOULD implement the Nagle Algorithm to coalesce short
segments. However, there MUST be a way for an application to disable segments. However, there MUST be a way for an application to disable
the Nagle algorithm on an individual connection. In all cases, the Nagle algorithm on an individual connection. In all cases,
sending data is also subject to the limitation imposed by the Slow sending data is also subject to the limitation imposed by the Slow
Start algorithm. Start algorithm.
The sender's SWS avoidance algorithm is more difficult than the The sender's SWS avoidance algorithm is more difficult than the
skipping to change at page 43, line 28 skipping to change at page 44, line 8
[SND.NXT = SND.UNA and] [SND.NXT = SND.UNA and]
min(D.U) >= Fs * Max(SND.WND); min(D.U) >= Fs * Max(SND.WND);
(4) or if data is PUSHed and the override timeout occurs. (4) or if data is PUSHed and the override timeout occurs.
Here Fs is a fraction whose recommended value is 1/2. The override Here Fs is a fraction whose recommended value is 1/2. The override
timeout should be in the range 0.1 - 1.0 seconds. It may be timeout should be in the range 0.1 - 1.0 seconds. It may be
convenient to combine this timer with the timer used to probe zero convenient to combine this timer with the timer used to probe zero
windows (Section Section 3.8.6.1). windows (Section Section 7.6.1).
3.8.6.2.2. Receiver's Algorithm - When to Send a Window Update 7.6.2.2. Receiver's Algorithm - When to Send a Window Update
A TCP MUST include a SWS avoidance algorithm in the receiver. A TCP MUST include a SWS avoidance algorithm in the receiver.
The receiver's SWS avoidance algorithm determines when the right The receiver's SWS avoidance algorithm determines when the right
window edge may be advanced; this is customarily known as "updating window edge may be advanced; this is customarily known as "updating
the window". This algorithm combines with the delayed ACK algorithm the window". This algorithm combines with the delayed ACK algorithm
(see Section 3.8.6.3) to determine when an ACK segment containing the (see Section 7.6.3) to determine when an ACK segment containing the
current window will really be sent to the receiver. current window will really be sent to the receiver.
The solution to receiver SWS is to avoid advancing the right window The solution to receiver SWS is to avoid advancing the right window
edge RCV.NXT+RCV.WND in small increments, even if data is received edge RCV.NXT+RCV.WND in small increments, even if data is received
from the network in small segments. from the network in small segments.
Suppose the total receive buffer space is RCV.BUFF. At any given Suppose the total receive buffer space is RCV.BUFF. At any given
moment, RCV.USER octets of this total may be tied up with data that moment, RCV.USER octets of this total may be tied up with data that
has been received and acknowledged but which the user process has not has been received and acknowledged but which the user process has not
yet consumed. When the connection is quiescent, RCV.WND = RCV.BUFF yet consumed. When the connection is quiescent, RCV.WND = RCV.BUFF
skipping to change at page 44, line 27 skipping to change at page 45, line 11
The suggested SWS avoidance algorithm for the receiver is to keep The suggested SWS avoidance algorithm for the receiver is to keep
RCV.NXT+RCV.WND fixed until the reduction satisfies: RCV.NXT+RCV.WND fixed until the reduction satisfies:
RCV.BUFF - RCV.USER - RCV.WND >= RCV.BUFF - RCV.USER - RCV.WND >=
min( Fr * RCV.BUFF, Eff.snd.MSS ) min( Fr * RCV.BUFF, Eff.snd.MSS )
where Fr is a fraction whose recommended value is 1/2, and where Fr is a fraction whose recommended value is 1/2, and
Eff.snd.MSS is the effective send MSS for the connection (see Eff.snd.MSS is the effective send MSS for the connection (see
Section 3.7.1). When the inequality is satisfied, RCV.WND is set to Section 6.1). When the inequality is satisfied, RCV.WND is set to
RCV.BUFF-RCV.USER. RCV.BUFF-RCV.USER.
Note that the general effect of this algorithm is to advance RCV.WND Note that the general effect of this algorithm is to advance RCV.WND
in increments of Eff.snd.MSS (for realistic receive buffers: in increments of Eff.snd.MSS (for realistic receive buffers:
Eff.snd.MSS < RCV.BUFF/2). Note also that the receiver must use its Eff.snd.MSS < RCV.BUFF/2). Note also that the receiver must use its
own Eff.snd.MSS, assuming it is the same as the sender's. own Eff.snd.MSS, assuming it is the same as the sender's.
3.8.6.3. Delayed Acknowledgements - When to Send an ACK Segment 7.6.3. Delayed Acknowledgements - When to Send an ACK Segment
A host that is receiving a stream of TCP data segments can increase A host that is receiving a stream of TCP data segments can increase
efficiency in both the Internet and the hosts by sending fewer than efficiency in both the Internet and the hosts by sending fewer than
one ACK (acknowledgment) segment per data segment received; this is one ACK (acknowledgment) segment per data segment received; this is
known as a "delayed ACK". known as a "delayed ACK".
A TCP SHOULD implement a delayed ACK, but an ACK should not be A TCP SHOULD implement a delayed ACK, but an ACK should not be
excessively delayed; in particular, the delay MUST be less than 0.5 excessively delayed; in particular, the delay MUST be less than 0.5
seconds, and in a stream of full-sized segments there SHOULD be an seconds, and in a stream of full-sized segments there SHOULD be an
ACK for at least every second segment. Excessive delays on ACK's can ACK for at least every second segment. Excessive delays on ACK's can
disturb the round-trip timing and packet "clocking" algorithms. disturb the round-trip timing and packet "clocking" algorithms.
3.9. Interfaces 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 TCPs might use. that TCPs might use.
3.9.1. User/TCP Interface 8.1. User/TCP Interface
The following functional description of user commands to the TCP is, The following functional description of user commands to the TCP is,
at best, fictional, since every operating system will have different at best, fictional, since every operating system will have different
facilities. Consequently, we must warn readers that different TCP facilities. Consequently, we must warn readers that different TCP
implementations may have different user interfaces. However, all implementations may have different user interfaces. However, all
TCPs must provide a certain minimum set of services to guarantee that TCPs must provide a certain minimum set of services to guarantee that
all TCP implementations can support the same protocol hierarchy. all TCP implementations can support the same protocol hierarchy.
This section specifies the functional interfaces required of all TCP This section specifies the functional interfaces required of all TCP
implementations. implementations.
skipping to change at page 46, line 4 skipping to change at page 46, line 32
not only accept commands, but must also return information to the not only accept commands, but must also return information to the
processes it serves. The latter consists of: processes it serves. The latter consists of:
(a) general information about a connection (e.g., interrupts, (a) general information about a connection (e.g., interrupts,
remote close, binding of unspecified foreign socket). remote close, binding of unspecified foreign socket).
(b) replies to specific user commands indicating success or (b) replies to specific user commands indicating success or
various types of failure. various types of failure.
Open Open
Format: OPEN (local port, foreign socket, active/passive [, Format: OPEN (local port, foreign socket, active/passive [,
timeout] [, precedence] [, security/compartment] [local IP timeout] [, DiffServ field] [, security/compartment] [local IP
address,] [, options]) -> local connection name address,] [, options]) -> local connection name
We assume that the local TCP is aware of the identity of the We assume that the local TCP is aware of the identity of the
processes it serves and will check the authority of the process processes it serves and will check the authority of the process
to use the connection specified. Depending upon the to use the connection specified. Depending upon the
implementation of the TCP, the local network and TCP implementation of the TCP, the local network and TCP
identifiers for the source address will either be supplied by identifiers for the source address will either be supplied by
the TCP or the lower level protocol (e.g., IP). These the TCP or the lower level protocol (e.g., IP). These
considerations are the result of concern about security, to the considerations are the result of concern about security, to the
extent that no TCP be able to masquerade as another one, and so extent that no TCP be able to masquerade as another one, and so
skipping to change at page 46, line 49 skipping to change at page 47, line 30
synchronize (i.e., establish) the connection at once. synchronize (i.e., establish) the connection at once.
The timeout, if present, permits the caller to set up a timeout The timeout, if present, permits the caller to set up a timeout
for all data submitted to TCP. If data is not successfully for all data submitted to TCP. If data is not successfully
delivered to the destination within the timeout period, the TCP delivered to the destination within the timeout period, the TCP
will abort the connection. The present global default is five will abort the connection. The present global default is five
minutes. minutes.
The TCP or some component of the operating system will verify The TCP or some component of the operating system will verify
the users authority to open a connection with the specified the users authority to open a connection with the specified
precedence or security/compartment. The absence of precedence DiffServ field value or security/compartment. The absence of a
or security/compartment specification in the OPEN call DiffServ field value or security/compartment specification in
indicates the default values must be used. the OPEN call indicates the default values must be used.
TCP will accept incoming requests as matching only if the TCP will accept incoming requests as matching only if the
security/compartment information is exactly the same and only security/compartment information is exactly the same as that
if the precedence is equal to or higher than the precedence
requested in the OPEN call. requested in the OPEN call.
The precedence for the connection is the higher of the values The DiffServ field value indicated by the user only impacts
requested in the OPEN call and received from the incoming outgoing packets, may be altered en route through the network,
request, and fixed at that value for the life of the and has no direct bearing or relation to received packets.
connection.Implementers may want to give the user control of
this precedence negotiation. For example, the user might be
allowed to specify that the precedence must be exactly matched,
or that any attempt to raise the precedence be confirmed by the
user.
A local connection name will be returned to the user by the A local connection name will be returned to the user by the
TCP. The local connection name can then be used as a short TCP. The local connection name can then be used as a short
hand term for the connection defined by the <local socket, hand term for the connection defined by the <local socket,
foreign socket> pair. foreign socket> pair.
The optional "local IP address" parameter MUST be supported to The optional "local IP address" parameter MUST be supported to
allow the specification of the local IP address. This enables allow the specification of the local IP address. This enables
applications that need to select the local IP address used when applications that need to select the local IP address used when
multihoming is present. multihoming is present.
A passive OPEN call with a specified "local IP address" A passive OPEN call with a specified "local IP address"
parameter will await an incoming connection request to that parameter will await an incoming connection request to that
address. If the parameter is unspecified, a passive OPEN will address. If the parameter is unspecified, a passive OPEN will
await an incoming connection request to any local IP address, await an incoming connection request to any local IP address,
and then bind the local IP address of the connection to the and then bind the local IP address of the connection to the
particular address that is used. particular address that is used.
For an active OPEN call, a specified "local IP address" For an active OPEN call, a specified "local IP address"
parameter MUST be used for opening the connection. If the parameter MUST be used for opening the connection. If the
parameter is unspecified, the TCP will choose an appropriate parameter is unspecified, the host will choose an appropriate
local IP address (see RFC 1122 section 3.3.4.2). local IP address (see RFC 1122 section 3.3.4.2).
TODO - the previous and next paragraphs are mildly in conflict.
Previous paragraph says that the TCP chooses an address, but
next paragraph says that it asks IP to choose ... need to make
this consistent
If an application on a multihomed host does not specify the If an application on a multihomed host does not specify the
local IP address when actively opening a TCP connection, then local IP address when actively opening a TCP connection, then
the TCP MUST ask the IP layer to select a local IP address the TCP MUST ask the IP layer to select a local IP address
before sending the (first) SYN. See the function GET_SRCADDR() before sending the (first) SYN. See the function GET_SRCADDR()
in Section 3.4 of RFC 1122. in Section 3.4 of RFC 1122.
At all other times, a previous segment has either been sent or At all other times, a previous segment has either been sent or
received on this connection, and TCP MUST use the same local received on this connection, and TCP MUST use the same local
address is used that was used in those previous segments. address is used that was used in those previous segments.
A TCP implementation MUST reject as an error a local OPEN call
for an invalid remote IP address (e.g., a broadcast or
multicast address).
Send Send
Format: SEND (local connection name, buffer address, byte Format: SEND (local connection name, buffer address, byte
count, PUSH flag, URGENT flag [,timeout]) count, PUSH flag, URGENT flag [,timeout])
This call causes the data contained in the indicated user This call causes the data contained in the indicated user
buffer to be sent on the indicated connection. If the buffer to be sent on the indicated connection. If the
connection has not been opened, the SEND is considered an connection has not been opened, the SEND is considered an
error. Some implementations may allow users to SEND first; in error. Some implementations may allow users to SEND first; in
which case, an automatic OPEN would be done. For example, this which case, an automatic OPEN would be done. For example, this
might be one way for application data to be included in SYN might be one way for application data to be included in SYN
segments. If the calling process is not authorized to use this segments. If the calling process is not authorized to use this
connection, an error is returned. connection, an error is returned.
If the PUSH flag is set, the data must be transmitted promptly If the PUSH flag is set, the data must be transmitted promptly
to the receiver, and the PUSH bit will be set in the last TCP to the receiver, and the PUSH bit will be set in the last TCP
segment created from the buffer. If the PUSH flag is not set, segment created from the buffer. If the PUSH flag is not set,
the data may be combined with data from subsequent SENDs for the data may be combined with data from subsequent SENDs for
transmission efficiency. transmission efficiency. Note that when the Nagle algorithm is
in use, TCP may be buffer the data before sending, without
regard to the PUSH flag (see Section 6.4).
New applications SHOULD NOT set the URGENT flag [25] due to New applications SHOULD NOT set the URGENT flag [28] due to
implementation differences and middlebox issues. implementation differences and middlebox issues.
If the URGENT flag is set, segments sent to the destination TCP If the URGENT flag is set, segments sent to the destination TCP
will have the urgent pointer set. The receiving TCP will will have the urgent pointer set. The receiving TCP will
signal the urgent condition to the receiving process if the signal the urgent condition to the receiving process if the
urgent pointer indicates that data preceding the urgent pointer urgent pointer indicates that data preceding the urgent pointer
has not been consumed by the receiving process. The purpose of has not been consumed by the receiving process. The purpose of
urgent is to stimulate the receiver to process the urgent data urgent is to stimulate the receiver to process the urgent data
and to indicate to the receiver when all the currently known and to indicate to the receiver when all the currently known
urgent data has been received. The number of times the sending urgent data has been received. The number of times the sending
skipping to change at page 51, line 47 skipping to change at page 52, line 22
local socket, local socket,
foreign socket, foreign socket,
local connection name, local connection name,
receive window, receive window,
send window, send window,
connection state, connection state,
number of buffers awaiting acknowledgment, number of buffers awaiting acknowledgment,
number of buffers pending receipt, number of buffers pending receipt,
urgent state, urgent state,
precedence, DiffServ field value,
security/compartment, security/compartment,
and transmission timeout. and transmission timeout.
Depending on the state of the connection, or on the Depending on the state of the connection, or on the
implementation itself, some of this information may not be implementation itself, some of this information may not be
available or meaningful. If the calling process is not available or meaningful. If the calling process is not
authorized to use this connection, an error is returned. This authorized to use this connection, an error is returned. This
prevents unauthorized processes from gaining information about prevents unauthorized processes from gaining information about
a connection. a connection.
skipping to change at page 52, line 32 skipping to change at page 53, line 5
Flush Flush
Some TCP implementations have included a FLUSH call, which will Some TCP implementations have included a FLUSH call, which will
empty the TCP send queue of any data for which the user has empty the TCP send queue of any data for which the user has
issued SEND calls but which is still to the right of the issued SEND calls but which is still to the right of the
current send window. That is, it flushes as much queued send current send window. That is, it flushes as much queued send
data as possible without losing sequence number data as possible without losing sequence number
synchronization. synchronization.
Asynchronous Reports
There MUST be a mechanism for reporting soft TCP error
conditions to the application. Generically, we assume this
takes the form of an application-supplied ERROR_REPORT routine
that may be upcalled asynchronously from the transport layer:
ERROR_REPORT(local connection name, reason, subreason)
The precise encoding of the reason and subreason parameters is
not specified here. However, the conditions that are reported
asynchronously to the application MUST include:
* ICMP error message arrived (see Section 8.2.2)
* Excessive retransmissions (see Section 7.3)
* Urgent pointer advance (see Section 7.5).
However, an application program that does not want to receive
such ERROR_REPORT calls SHOULD be able to effectively disable
these calls.
Set Differentiated Services Field (IPv4 TOS or IPv6 Traffic Class) Set Differentiated Services Field (IPv4 TOS or IPv6 Traffic Class)
The application layer MUST be able to specify the The application layer MUST be able to specify the
Differentiated Services field for segments that are sent on a Differentiated Services field for segments that are sent on a
connection. The Differentiated Services field includes the connection. The Differentiated Services field includes the
6-bit Differentiated Services Code Point (DSCP) value. It is 6-bit Differentiated Services Code Point (DSCP) value. It is
not required, but the application SHOULD be able to change the not required, but the application SHOULD be able to change the
Differentiated Services field during the connection lifetime. Differentiated Services field during the connection lifetime.
TCP SHOULD pass the current Differentiated Services field value TCP SHOULD pass the current Differentiated Services field value
without change to the IP layer, when it sends segments on the without change to the IP layer, when it sends segments on the
connection. connection.
The Differentiated Services field will be specified The Differentiated Services field will be specified
independently in each direction on the connection, so that the independently in each direction on the connection, so that the
receiver application will specify the Differentiated Services receiver application will specify the Differentiated Services
field used for ACK segments. field used for ACK segments.
TCP MAY pass the most recently received Differentiated Services TCP MAY pass the most recently received Differentiated Services
field up to the application. field up to the application.
TCP-to-User Messages 8.2. TCP/Lower-Level Interface
It is assumed that the operating system environment provides a
means for the TCP to asynchronously signal the user program.
When the TCP does signal a user program, certain information is
passed to the user. Often in the specification the information
will be an error message. In other cases there will be
information relating to the completion of processing a SEND or
RECEIVE or other user call.
The following information is provided:
Local Connection Name Always
Response String Always
Buffer Address Send & Receive
Byte count (counts bytes received) Receive
Push flag Receive
Urgent flag Receive
3.9.2. TCP/Lower-Level Interface
The TCP calls on a lower level protocol module to actually send and The TCP calls on a lower level protocol module to actually send and
receive information over a network. The two current standard receive information over a network. The two current standard
Internet Protocol (IP) versions layered below TCP are IPv4 [1] and Internet Protocol (IP) versions layered below TCP are IPv4 [1] and
IPv6 [5]. IPv6 [5].
If the lower level protocol is IPv4 it provides arguments for a type If the lower level protocol is IPv4 it provides arguments for a type
of service (used within the Differentiated Services field) and for a of service (used within the Differentiated Services field) and for a
time to live. TCP uses the following settings for these parameters: time to live. TCP uses the following settings for these parameters:
Type of Service = Precedence: given by user, Delay: normal, DiffServ field: The IP header value for the DiffServ field is
Throughput: normal, Reliability: normal; or binary XXX00000, where given by the user. This includes the bits of the DiffServ Code
XXX are the three bits determining precedence, e.g. 000 means Point (DSCP).
routine precedence. TODO - this is pretty much wrong with regard
to DiffServ, I think we should just say that the user can specify
diffserv field (superset of DSCP) and mostly leave it at that, but
will check with TCPM. It may also be worth noting that 1122
permits DSCP to change during a connection (section 4.2.4.2) but
the API might not allow it, and the application doesn't know about
individual TCP segments anyways, so this could only be done on a
"coarse" granularity at best. David Black noted that 7657 (sec
5.1, 5.3, and 6) discuss this. Summary from Joe Touch is that it
generally SHOULD NOT be changed, but the RFC series currently
seems to be lacking any mention of when it might be appropriate to
change (it's SHOUND NOT and not MUST NOT).
Time to Live (TTL): The TTL value used to send TCP segments MUST Time to Live (TTL): The TTL value used to send TCP segments MUST
be configurable. be configurable.
Note that RFC 793 specified one minute (60 seconds) as a Note that RFC 793 specified one minute (60 seconds) as a
constant for the TTL, because the assumed maximum segment constant for the TTL, because the assumed maximum segment
lifetime was two minutes. This was intended to explicitly ask lifetime was two minutes. This was intended to explicitly ask
that a segment be destroyed if it cannot be delivered by the that a segment be destroyed if it cannot be delivered by the
internet system within one minute. RFC 1122 changed this internet system within one minute. RFC 1122 changed this
specification to require that the TTL be configurable. specification to require that the TTL be configurable.
Note that the DiffServ field is permitted to change during a
connection (section 4.2.4.2 of RFC 1122). However, the
application interface might not support this ability, and the
application does not have knowledge about individual TCP
segments, so this can only be done on a coarse granularity, at
best. This limitation is further discussed in RFC 7657 (sec
5.1, 5.3, and 6) [37]. Generally, an application SHOULD NOT
change the DiffServ field value during the course of a
connection.
Any lower level protocol will have to provide the source address, Any lower level protocol will have to provide the source address,
destination address, and protocol fields, and some way to determine destination address, and protocol fields, and some way to determine
the "TCP length", both to provide the functional equivalent service the "TCP length", both to provide the functional equivalent service
of IP and to be used in the TCP checksum. of IP and to be used in the TCP checksum.
When received options are passed up to TCP from the IP layer, TCP When received options are passed up to TCP from the IP layer, TCP
MUST ignore options that it does not understand. MUST ignore options that it does not understand.
A TCP MAY support the Time Stamp and Record Route options. A TCP MAY support the Time Stamp and Record Route options.
3.9.2.1. Source Routing 8.2.1. Source Routing
If the lower level is IP (or other protocol that provides this If the lower level is IP (or other protocol that provides this
feature) and source routing is used, the interface must allow the feature) and source routing is used, the interface must allow the
route information to be communicated. This is especially important route information to be communicated. This is especially important
so that the source and destination addresses used in the TCP checksum so that the source and destination addresses used in the TCP checksum
be the originating source and ultimate destination. It is also be the originating source and ultimate destination. It is also
important to preserve the return route to answer connection requests. important to preserve the return route to answer connection requests.
An application MUST be able to specify a source route when it An application MUST be able to specify a source route when it
actively opens a TCP connection, and this MUST take precedence over a actively opens a TCP connection, and this MUST take precedence over a
source route received in a datagram. source route received in a datagram.
When a TCP connection is OPENed passively and a packet arrives with a When a TCP connection is OPENed passively and a packet arrives with a
completed IP Source Route option (containing a return route), TCP completed IP Source Route option (containing a return route), TCP
MUST save the return route and use it for all segments sent on this MUST save the return route and use it for all segments sent on this
connection. If a different source route arrives in a later segment, connection. If a different source route arrives in a later segment,
the later definition SHOULD override the earlier one. the later definition SHOULD override the earlier one.
3.9.2.2. ICMP Messages 8.2.2. ICMP Messages
TCP MUST act on an ICMP error message passed up from the IP layer, TCP MUST act on an ICMP error message passed up from the IP layer,
directing it to the connection that created the error. The necessary directing it to the connection that created the error. The necessary
demultiplexing information can be found in the IP header contained demultiplexing information can be found in the IP header contained
within the ICMP message. within the ICMP message.
This applies to ICMPv6 in addition to IPv4 ICMP. This applies to ICMPv6 in addition to IPv4 ICMP.
[20] contains discussion of specific ICMP and ICMPv6 messages [22] contains discussion of specific ICMP and ICMPv6 messages
classified as either "soft" or "hard" errors that may bear different classified as either "soft" or "hard" errors that may bear different
responses. Treatment for classes of ICMP messages is described responses. Treatment for classes of ICMP messages is described
below: below:
Source Quench Source Quench
TCP MUST silently discard any received ICMP Source Quench messages. TCP MUST silently discard any received ICMP Source Quench messages.
See [11] for discussion. See [11] for discussion.
Soft Errors Soft Errors
For ICMP these include: Destination Unreachable -- codes 0, 1, 5, For ICMP these include: Destination Unreachable -- codes 0, 1, 5,
Time Exceeded -- codes 0, 1, and Parameter Problem. Time Exceeded -- codes 0, 1, and Parameter Problem.
For ICMPv6 these include: Destination Unreachable -- codes 0 and 3, For ICMPv6 these include: Destination Unreachable -- codes 0 and 3,
Time Exceeded -- codes 0, 1, and Parameter Problem -- codes 0, 1, 2 Time Exceeded -- codes 0, 1, and Parameter Problem -- codes 0, 1, 2
Since these Unreachable messages indicate soft error conditions, Since these Unreachable messages indicate soft error conditions,
TCP MUST NOT abort the connection, and it SHOULD make the TCP MUST NOT abort the connection, and it SHOULD make the
information available to the application. information available to the application.
Hard Errors Hard Errors
For ICMP these include Destination Unreachable -- codes 2-4"> For ICMP these include Destination Unreachable -- codes 2-4">
These are hard error conditions, so TCP SHOULD abort the These are hard error conditions, so TCP SHOULD abort the
connection. [20] notes that some implementations do not abort connection. [22] notes that some implementations do not abort
connections when an ICMP hard error is received for a connection connections when an ICMP hard error is received for a connection
that is in any of the synchronized states. that is in any of the synchronized states.
Note that [20] section 4 describes widespread implementation behavior Note that [22] section 4 describes widespread implementation behavior
that treats soft errors as hard errors during connection that treats soft errors as hard errors during connection
establishment. establishment.
3.10. Event Processing 8.2.3. Remote Address Validation
RFC 1122 requires addresses to be validated in incoming SYN packets:
An incoming SYN with an invalid source address must be ignored
either by TCP or by the IP layer (see Section 3.2.1.3 of [14]).
A TCP implementation MUST silently discard an incoming SYN segment
that is addressed to a broadcast or multicast address.
This prevents connection state and replies from being erroneously
generated, and implementers should note that this guidance is
applicable to all incoming segments, not just SYNs, as specifically
indicated in RFC 1122.
8.3. Event Processing
The processing depicted in this section is an example of one possible The processing depicted in this section is an example of one possible
implementation. Other implementations may have slightly different implementation. Other implementations may have slightly different
processing sequences, but they should differ from those in this processing sequences, but they should differ from those in this
section only in detail, not in substance. section only in detail, not in substance.
The activity of the TCP can be characterized as responding to events. The activity of the TCP can be characterized as responding to events.
The events that occur can be cast into three categories: user calls, The events that occur can be cast into three categories: user calls,
arriving segments, and timeouts. This section describes the arriving segments, and timeouts. This section describes the
processing the TCP does in response to each of the events. In many processing the TCP does in response to each of the events. In many
skipping to change at page 57, line 11 skipping to change at page 58, line 11
Note that if no state change is mentioned the TCP stays in the same Note that if no state change is mentioned the TCP stays in the same
state. state.
OPEN Call OPEN Call
CLOSED STATE (i.e., TCB does not exist) CLOSED STATE (i.e., TCB does not exist)
Create a new transmission control block (TCB) to hold Create a new transmission control block (TCB) to hold
connection state information. Fill in local socket identifier, connection state information. Fill in local socket identifier,
foreign socket, precedence, security/compartment, and user foreign socket, DiffServ field, security/compartment, and user
timeout information. Note that some parts of the foreign timeout information. Note that some parts of the foreign
socket may be unspecified in a passive OPEN and are to be socket may be unspecified in a passive OPEN and are to be
filled in by the parameters of the incoming SYN segment. filled in by the parameters of the incoming SYN segment.
Verify the security and precedence requested are allowed for Verify the security and DiffServ value requested are allowed
this user, if not return "error: precedence not allowed" or for this user, if not return "error: precedence not allowed" or
"error: security/compartment not allowed." If passive enter "error: security/compartment not allowed." If passive enter
the LISTEN state and return. If active and the foreign socket the LISTEN state and return. If active and the foreign socket
is unspecified, return "error: foreign socket unspecified"; if is unspecified, return "error: foreign socket unspecified"; if
active and the foreign socket is specified, issue a SYN active and the foreign socket is specified, issue a SYN
segment. An initial send sequence number (ISS) is selected. A segment. An initial send sequence number (ISS) is selected. A
SYN segment of the form <SEQ=ISS><CTL=SYN> is sent. Set SYN segment of the form <SEQ=ISS><CTL=SYN> is sent. Set
SND.UNA to ISS, SND.NXT to ISS+1, enter SYN-SENT state, and SND.UNA to ISS, SND.NXT to ISS+1, enter SYN-SENT state, and
return. return.
If the caller does not have access to the local socket If the caller does not have access to the local socket
skipping to change at page 67, line 5 skipping to change at page 68, line 5
third check for a SYN third check for a SYN
If the SYN bit is set, check the security. If the security/ If the SYN bit is set, check the security. If the security/
compartment on the incoming segment does not exactly match compartment on the incoming segment does not exactly match
the security/compartment in the TCB then send a reset and the security/compartment in the TCB then send a reset and
return. return.
<SEQ=0><ACK=SEG.SEQ+SEG.LEN><CTL=RST,ACK> <SEQ=0><ACK=SEG.SEQ+SEG.LEN><CTL=RST,ACK>
If the SEG.PRC is greater than the TCB.PRC then if allowed
by the user and the system set TCB.PRC<-SEG.PRC, if not
allowed send a reset and return.
<SEQ=0><ACK=SEG.SEQ+SEG.LEN><CTL=RST,ACK>
If the SEG.PRC is less than the TCB.PRC then continue.
Set RCV.NXT to SEG.SEQ+1, IRS is set to SEG.SEQ and any Set RCV.NXT to SEG.SEQ+1, IRS is set to SEG.SEQ and any
other control or text should be queued for processing later. other control or text should be queued for processing later.
ISS should be selected and a SYN segment sent of the form: ISS should be selected and a SYN segment sent of the form:
<SEQ=ISS><ACK=RCV.NXT><CTL=SYN,ACK> <SEQ=ISS><ACK=RCV.NXT><CTL=SYN,ACK>
SND.NXT is set to ISS+1 and SND.UNA to ISS. The connection SND.NXT is set to ISS+1 and SND.UNA to ISS. The connection
state should be changed to SYN-RECEIVED. Note that any state should be changed to SYN-RECEIVED. Note that any
other incoming control or data (combined with SYN) will be other incoming control or data (combined with SYN) will be
processed in the SYN-RECEIVED state, but processing of SYN processed in the SYN-RECEIVED state, but processing of SYN
skipping to change at page 68, line 6 skipping to change at page 68, line 45
If SEG.ACK =< ISS, or SEG.ACK > SND.NXT, send a reset If SEG.ACK =< ISS, or SEG.ACK > SND.NXT, send a reset
(unless the RST bit is set, if so drop the segment and (unless the RST bit is set, if so drop the segment and
return) return)
<SEQ=SEG.ACK><CTL=RST> <SEQ=SEG.ACK><CTL=RST>
and discard the segment. Return. and discard the segment. Return.
If SND.UNA < SEG.ACK =< SND.NXT then the ACK is If SND.UNA < SEG.ACK =< SND.NXT then the ACK is
acceptable. (TODO: in processing Errata ID 3300, it was acceptable. Some deployed TCP code has used the check
noted that some stacks in the wild that do not send data SEG.ACK == SND.NEXT (using "==" rather than "=<", but
on the SYN are just checking that SEG.ACK == SND.NXT ... this is not appropriate when the stack is capable of
think about whether anything should be said about that sending data on the SYN, because the peer TCP may not
here) accept and 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
[24], with the mitigation that a TCP implementation [27], 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 and precedence third check the security
If the security/compartment in the segment does not exactly If the security/compartment in the segment does not exactly
match the security/compartment in the TCB, send a reset match the security/compartment in the TCB, send a reset
If there is an ACK If there is an ACK
<SEQ=SEG.ACK><CTL=RST> <SEQ=SEG.ACK><CTL=RST>
Otherwise Otherwise
<SEQ=0><ACK=SEG.SEQ+SEG.LEN><CTL=RST,ACK> <SEQ=0><ACK=SEG.SEQ+SEG.LEN><CTL=RST,ACK>
If there is an ACK
The precedence in the segment must match the precedence
in the TCB, if not, send a reset
<SEQ=SEG.ACK><CTL=RST>
If there is no ACK
If the precedence in the segment is higher than the
precedence in the TCB then if allowed by the user and the
system raise the precedence in the TCB to that in the
segment, if not allowed to raise the prec then send a
reset.
<SEQ=0><ACK=SEG.SEQ+SEG.LEN><CTL=RST,ACK>
If the precedence in the segment is lower than the
precedence in the TCB continue.
If a reset was sent, discard the segment and return. If a reset was sent, discard the segment and return.
fourth check the SYN bit fourth check the SYN bit
This step should be reached only if the ACK is ok, or there This step should be reached only if the ACK is ok, or there
is no ACK, and it the segment did not contain a RST. is no ACK, and it the segment did not contain a RST.
If the SYN bit is on and the security/compartment and If the SYN bit is on and the security/compartment is
precedence are acceptable then, RCV.NXT is set to SEG.SEQ+1, acceptable then, RCV.NXT is set to SEG.SEQ+1, IRS is set to
IRS is set to SEG.SEQ. SND.UNA should be advanced to equal SEG.SEQ. SND.UNA should be advanced to equal SEG.ACK (if
SEG.ACK (if there is an ACK), and any segments on the there is an ACK), and any segments on the retransmission
retransmission queue which are thereby acknowledged should queue which are thereby acknowledged should be removed.
be removed.
If SND.UNA > ISS (our SYN has been ACKed), change the If SND.UNA > ISS (our SYN has been ACKed), change the
connection state to ESTABLISHED, form an ACK segment connection state to ESTABLISHED, form an ACK segment
<SEQ=SND.NXT><ACK=RCV.NXT><CTL=ACK> <SEQ=SND.NXT><ACK=RCV.NXT><CTL=ACK>
and send it. Data or controls which were queued for and send it. Data or controls which were queued for
transmission may be included. If there are other controls transmission may be included. If there are other controls
or text in the segment then continue processing at the sixth or text in the segment then continue processing at the sixth
step below where the URG bit is checked, otherwise return. step below where the URG bit is checked, otherwise return.
skipping to change at page 70, line 7 skipping to change at page 70, line 24
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 [15] and is used in TCP Fast capability was used in T/TCP [16] and is used in TCP Fast
Open (TFO) [32], so is important for implementations and Open (TFO) [35], 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 70, line 33 skipping to change at page 70, line 50
CLOSING STATE CLOSING STATE
LAST-ACK STATE LAST-ACK STATE
TIME-WAIT STATE TIME-WAIT STATE
Segments are processed in sequence. Initial tests on Segments are processed in sequence. Initial tests on
arrival are used to discard old duplicates, but further arrival are used to discard old duplicates, but further
processing is done in SEG.SEQ order. If a segment's processing is done in SEG.SEQ order. If a segment's
contents straddle the boundary between old and new, only the contents straddle the boundary between old and new, only the
new parts should be processed. new parts should be processed.
In general, the processing of received segments MUST be
implemented to aggregate ACK segments whenever possible.
For example, if the TCP is processing a series of queued
segments, it MUST process them all before sending any ACK
segments.
There are four cases for the acceptability test for an There are four cases for the acceptability test for an
incoming segment: incoming segment:
Segment Receive Test Segment Receive Test
Length Window Length Window
------- ------- ------------------------------------------- ------- ------- -------------------------------------------
0 0 SEG.SEQ = RCV.NXT 0 0 SEG.SEQ = RCV.NXT
0 >0 RCV.NXT =< SEG.SEQ < RCV.NXT+RCV.WND 0 >0 RCV.NXT =< SEG.SEQ < RCV.NXT+RCV.WND
>0 0 not acceptable >0 0 not acceptable
>0 >0 RCV.NXT =< SEG.SEQ < RCV.NXT+RCV.WND >0 >0 RCV.NXT =< SEG.SEQ < RCV.NXT+RCV.WND
or RCV.NXT =< SEG.SEQ+SEG.LEN-1 < RCV.NXT+RCV.WND or RCV.NXT =< SEG.SEQ+SEG.LEN-1 < RCV.NXT+RCV.WND
In implementing sequence number validation as described
here, please note Appendix A.2.
If the RCV.WND is zero, no segments will be acceptable, but If the RCV.WND is zero, no segments will be acceptable, but
special allowance should be made to accept valid ACKs, URGs special allowance should be made to accept valid ACKs, URGs
and RSTs. and RSTs.
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 [26] for handling incoming SYN algorithm described in [29] 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
window (including SYN and FIN), and only processing further window (including SYN and FIN), and only processing further
if the segment then begins at RCV.NXT. Segments with higher if the segment then begins at RCV.NXT. Segments with higher
beginning sequence numbers should be held for later beginning sequence numbers should be held for later
processing. processing.
In general, the processing of received segments MUST be
implemented to aggregate ACK segments whenever possible.
For example, if the TCP is processing a series of queued
segments, it MUST process them all before sending any ACK
segments. (TODO - see if there's a better place for this
paragraph - taken from RFC1122)
second check the RST bit, second check the RST bit,
RFC 5961 section 3 describes a potential blind reset attack RFC 5961 section 3 describes a potential blind reset attack
and optional mitigation approach that SHOULD be implemented. and optional mitigation approach that SHOULD be implemented.
For stacks implementing RFC 5961, the three checks below For stacks implementing RFC 5961, the three checks below
apply, otherwise processesing for these states is indicated apply, otherwise processesing for these states is indicated
further below. further below.
1) If the RST bit is set and the sequence number is 1) If the RST bit is set and the sequence number is
outside the current receive window, silently drop the outside the current receive window, silently drop the
skipping to change at page 73, line 4 skipping to change at page 73, line 21
If the RST bit is set then, any outstanding RECEIVEs and If the RST bit is set then, any outstanding RECEIVEs and
SEND should receive "reset" responses. All segment SEND should receive "reset" responses. All segment
queues should be flushed. Users should also receive an queues should be flushed. Users should also receive an
unsolicited general "connection reset" signal. Enter the unsolicited general "connection reset" signal. Enter the
CLOSED state, delete the TCB, and return. CLOSED state, delete the TCB, and return.
CLOSING STATE CLOSING STATE
LAST-ACK STATE LAST-ACK STATE
TIME-WAIT TIME-WAIT
If the RST bit is set then, enter the CLOSED state, If the RST bit is set then, enter the CLOSED state,
delete the TCB, and return. delete the TCB, and return.
third check security and precedence third check security
SYN-RECEIVED SYN-RECEIVED
If the security/compartment and precedence in the segment If the security/compartment in the segment does not
do not exactly match the security/compartment and exactly match the security/compartment in the TCB then
precedence in the TCB then send a reset, and return. send a reset, and return.
ESTABLISHED ESTABLISHED
FIN-WAIT-1 FIN-WAIT-1
FIN-WAIT-2 FIN-WAIT-2
CLOSE-WAIT CLOSE-WAIT
CLOSING CLOSING
LAST-ACK LAST-ACK
TIME-WAIT TIME-WAIT
If the security/compartment and precedence in the segment If the security/compartment in the segment does not
do not exactly match the security/compartment and exactly match the security/compartment in the TCB then
precedence in the TCB then send a reset, any outstanding send a reset, any outstanding RECEIVEs and SEND should
RECEIVEs and SEND should receive "reset" responses. All receive "reset" responses. All segment queues should be
segment queues should be flushed. Users should also flushed. Users should also receive an unsolicited
receive an unsolicited general "connection reset" signal. general "connection reset" signal. Enter the CLOSED
Enter the CLOSED state, delete the TCB, and return. state, delete the TCB, and return.
Note this check is placed following the sequence check to Note this check is placed following the sequence check to
prevent a segment from an old connection between these ports prevent a segment from an old connection between these ports
with a different security or precedence from causing an with a different security from causing an abort of the
abort of the current connection. current connection.
fourth, check the SYN bit, fourth, check the SYN bit,
SYN-RECEIVED SYN-RECEIVED
If the connection was initiated with a passive OPEN, then If the connection was initiated with a passive OPEN, then
return this connection to the LISTEN state and return. return this connection to the LISTEN state and return.
Otherwise, handle per the directions for synchronized Otherwise, handle per the directions for synchronized
states below. states below.
skipping to change at page 74, line 10 skipping to change at page 74, line 28
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 [24]. For the TIME-WAIT state, new described in RFC 5961 [27]. For the TIME-WAIT state, new
connections can be accepted if the timestamp option is connections can be accepted if the timestamp option is
used and meets expectations (per [26]). For all other used and meets expectations (per [29]). For all other
caess, RFC 5961 provides a mitigation that SHOULD be caess, RFC 5961 provides a mitigation that SHOULD be
implemented, though there are alternatives (see implemented, though there are alternatives (see
Section 6). RFC 5961 recommends that in these Section 11). RFC 5961 recommends that in these
synchronized states, if the SYN bit is set, irrespective synchronized states, if the SYN bit is set, irrespective
of the sequence number, TCP MUST send a "challenge ACK" of the sequence number, TCP MUST send a "challenge ACK"
to the remote peer: to the remote peer:
<SEQ=SND.NXT><ACK=RCV.NXT><CTL=ACK> <SEQ=SND.NXT><ACK=RCV.NXT><CTL=ACK>
After sending the acknowledgement, TCP MUST drop the After sending the acknowledgement, TCP MUST drop the
unacceptable segment and stop processing further. Note unacceptable segment and stop processing further. Note
that RFC 5961 and Errata ID 4772 contain additional ACK that RFC 5961 and Errata ID 4772 contain additional ACK
throttling notes for an implementation. throttling notes for an implementation.
skipping to change at page 81, line 5 skipping to change at page 81, line 5
For any state if the retransmission timeout expires on a For any state if the retransmission timeout expires on a
segment in the retransmission queue, send the segment at the segment in the retransmission queue, send the segment at the
front of the retransmission queue again, reinitialize the front of the retransmission queue again, reinitialize the
retransmission timer, and return. retransmission timer, and return.
TIME-WAIT TIMEOUT TIME-WAIT TIMEOUT
If the time-wait timeout expires on a connection delete the If the time-wait timeout expires on a connection delete the
TCB, enter the CLOSED state and return. TCB, enter the CLOSED state and return.
3.11. Glossary 8.4. Glossary
1822 BBN Report 1822, "The Specification of the Interconnection of 1822 BBN Report 1822, "The Specification of the Interconnection of
a Host and an IMP". The specification of interface between a a Host and an IMP". The specification of interface between a
host and the ARPANET. host and the ARPANET.
ACK ACK
A control bit (acknowledge) occupying no sequence space, A control bit (acknowledge) occupying no sequence space,
which indicates that the acknowledgment field of this segment which indicates that the acknowledgment field of this segment
specifies the next sequence number the sender of this segment specifies the next sequence number the sender of this segment
is expecting to receive, hence acknowledging receipt of all is expecting to receive, hence acknowledging receipt of all
skipping to change at page 83, line 24 skipping to change at page 83, line 24
MSL MSL
Maximum Segment Lifetime, the time a TCP segment can exist in Maximum Segment Lifetime, the time a TCP segment can exist in
the internetwork system. Arbitrarily defined to be 2 the internetwork system. Arbitrarily defined to be 2
minutes. minutes.
octet octet
An eight bit byte. An eight bit byte.
Options Options
An Option field may contain several options, and each option An Option field may contain several options, and each option
may be several octets in length. The options are used may be several octets in length.
primarily in testing situations; for example, to carry
timestamps. Both the Internet Protocol and TCP provide for
options fields. -- TODO not primarily testing anymore!
packet packet
A package of data with a header which may or may not be A package of data with a header which may or may not be
logically complete. More often a physical packaging than a logically complete. More often a physical packaging than a
logical packaging of data. logical packaging of data.
port port
The portion of a socket that specifies which logical input or The portion of a socket that specifies which logical input or
output channel of a process is associated with the data. output channel of a process is associated with the data.
skipping to change at page 84, line 39 skipping to change at page 84, line 36
RTP RTP
Real Time Protocol: A host-to-host protocol for communication Real Time Protocol: A host-to-host protocol for communication
of time critical information. of time critical information.
SEG.ACK SEG.ACK
segment acknowledgment segment acknowledgment
SEG.LEN SEG.LEN
segment length segment length
SEG.PRC
segment precedence value
SEG.SEQ SEG.SEQ
segment sequence segment sequence
SEG.UP SEG.UP
segment urgent pointer field segment urgent pointer field
SEG.WND SEG.WND
segment window field segment window field
segment segment
skipping to change at page 86, line 20 skipping to change at page 86, line 14
SYN SYN
A control bit in the incoming segment, occupying one sequence A control bit in the incoming segment, occupying one sequence
number, used at the initiation of a connection, to indicate number, used at the initiation of a connection, to indicate
where the sequence numbering will start. where the sequence numbering will start.
TCB TCB
Transmission control block, the data structure that records Transmission control block, the data structure that records
the state of a connection. the state of a connection.
TCB.PRC
The precedence of the connection.
TCP TCP
Transmission Control Protocol: A host-to-host protocol for Transmission Control Protocol: A host-to-host protocol for
reliable communication in internetwork environments. reliable communication in internetwork environments.
TOS TOS
Type of Service, an IPv4 field, that currently carries the Type of Service, an IPv4 field, that currently carries the
Differentiated Services field [6] containing the Differentiated Services field [6] containing the
Differentiated Services Code Point (DSCP) value and two Differentiated Services Code Point (DSCP) value and two
unused bits. unused bits.
skipping to change at page 87, line 5 skipping to change at page 86, line 41
urgent processing as long as there is data to be consumed urgent processing as long as there is data to be consumed
with sequence numbers less than the value indicated in the with sequence numbers less than the value indicated in the
urgent pointer. urgent pointer.
urgent pointer urgent pointer
A control field meaningful only when the URG bit is on. This A control field meaningful only when the URG bit is on. This
field communicates the value of the urgent pointer which field communicates the value of the urgent pointer which
indicates the data octet associated with the sending user's indicates the data octet associated with the sending user's
urgent call. urgent call.
4. Changes from RFC 793 9. Changes from RFC 793
This document obsoletes RFC 793 as well as RFC 6093 and 6528, which This document obsoletes RFC 793 as well as RFC 6093 and 6528, which
updated 793. In all cases, only the normative protocol specification updated 793. In all cases, only the normative protocol specification
and requirements have been incorporated into this document, and the and requirements have been incorporated into this document, and the
informational text with background and rationale has not been carried informational text with background and rationale has not been carried
in. The informational content of those documents is still valuable in. The informational content of those documents is still valuable
in learning about and understanding TCP, and they are valid in learning about and understanding TCP, and they are valid
Informational references, even though their normative content has Informational references, even though their normative content has
been incorporated into this document. been incorporated into this document.
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). Some
errata were not applicable due to other changes (Errata IDs: 572, errata were not applicable due to other changes (Errata IDs: 572,
575, 1569, 3602). TODO: 3305 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 89, line 6 skipping to change at page 88, line 44
Errata ID 1572: Reported by Constantin Hagemeier Errata ID 1572: Reported by Constantin Hagemeier
Errata ID 2296: Reported by Vishwas Manral Errata ID 2296: Reported by Vishwas Manral
Errata ID 2297: Reported by Vishwas Manral Errata ID 2297: Reported by Vishwas Manral
Errata ID 2298: Reported by Vishwas Manral Errata ID 2298: Reported by Vishwas Manral
Errata ID 2748: Reported by Mykyta Yevstifeyev Errata ID 2748: Reported by Mykyta Yevstifeyev
Errata ID 2749: Reported by Mykyta Yevstifeyev Errata ID 2749: Reported by Mykyta Yevstifeyev
Errata ID 2934: Reported by Constantin Hagemeier Errata ID 2934: Reported by Constantin Hagemeier
Errata ID 3213: Reported by EugnJun Yi Errata ID 3213: Reported by EugnJun Yi
Errata ID 3300: Reported by Botong Huang Errata ID 3300: Reported by Botong Huang
Errata ID 3301: Reported by Botong Huang Errata ID 3301: Reported by Botong Huang
Errata ID 3305: Reported by Botong Huang
Note: Some verified errata were not used in this update, as they Note: Some verified errata were not used in this update, as they
relate to sections of RFC 793 elided from this document. These relate to sections of RFC 793 elided from this document. These
include Errata ID 572, 575, and 1569. include Errata ID 572, 575, and 1569.
Note: Errata ID 3602 was not applied in this revision as it is Note: Errata ID 3602 was not applied in this revision as it is
duplicative of the 1122 corrections. duplicative of the 1122 corrections.
There is an errata 3305 currently reported that need to be
verified, held, or rejected by the ADs; it is addressing the same
issue as draft-gont-tcpm-tcp-seq-validation and was not attempted
to be applied to this document.
Not related to RFC 793 content, this revision also makes small tweaks Not related to RFC 793 content, this revision also makes small tweaks
to the introductory text, fixes indentation of the pseudoheader to the introductory text, fixes indentation of the pseudoheader
diagram, and notes that the Security Considerations should also diagram, and notes that the Security Considerations should also
include privacy, when this section is written. include privacy, when this section is written.
The -03 revision of draft-eddy-rfc793bis revises all discussion of The -03 revision of draft-eddy-rfc793bis revises all discussion of
the urgent pointer in order to comply with RFC 6093, 1122, and 1011. the urgent pointer in order to comply with RFC 6093, 1122, and 1011.
Since 1122 held requirements on the urgent pointer, the full list of Since 1122 held requirements on the urgent pointer, the full list of
requirements was brought into an appendix of this document, so that requirements was brought into an appendix of this document, so that
skipping to change at page 90, line 35 skipping to change at page 90, line 21
and the IANA TCP parameters registry as a reference. It includes and the IANA TCP parameters registry as a reference. It includes
references to RFC 5961 in appropriate places. The references to TOS references to RFC 5961 in appropriate places. The references to TOS
were changed to DiffServ field, based on reflecting RFC 2474 as well were changed to DiffServ field, based on reflecting RFC 2474 as well
as the IPv6 presence of traffic class (carrying DiffServ field) as the IPv6 presence of traffic class (carrying DiffServ field)
rather than TOS. rather than TOS.
The -07 revision includes reference to RFC 6191, updated security The -07 revision includes reference to RFC 6191, updated security
considerations, discussion of additional implementation considerations, discussion of additional implementation
considerations, and clarification of data on the SYN. considerations, and clarification of data on the SYN.
The -08 revision includes changes based on:
describing treatment of reserved bits (following TCPM mailing list
thread from July 2014 on "793bis item - reserved bit behavior"
addition a brief TCP key concepts section to make up for not
including the outdated section 2 of RFC 793
changed "TCP" to "host" to resolve conflict between 1122 wording
on whether TCP or the network layer chooses an address when
multihomed
fixed/updated definition of options in glossary
moved note on aggregating ACKs from 1122 to a more appropriate
location
resolved notes on IP precedence and security/compartment
added implementation note on sequence number validation
added note that PUSH does not apply when Nagle is active
added 1122 content on asynchronous reports to replace 793 section
on TCP to user messages
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. look at Tony Sabatini suggestion for describing DO field 1. look at Tony Sabatini suggestion for describing DO field
2. clearly specify treatment of reserved bits (see TCPM thread on 2. per discussion with Joe Touch (TAPS list, 6/20/2015), the
EDO draft April 25, 2014) -- TODO - an attempt at this is
actually in -06, but needs to be confirmed by TCPM explicitly
since there is no RFC reference
3. 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
5. IANA Considerations Early in the process of updating RFC 793, Scott Brim mentioned that
this should include a PERPASS/privacy review. This may be something
for the chairs or AD to request during WGLC or IETF LC.
10. IANA Considerations
This memo includes no request to IANA. Existing IANA registries for This memo includes no request to IANA. Existing IANA registries for
TCP parameters are sufficient. TCP parameters are sufficient.
TODO: check whether entries pointing to 793 and other documents TODO: check whether entries pointing to 793 and other documents
obsoleted by this one should be updated to point to this one instead. obsoleted by this one should be updated to point to this one instead.
6. Security and Privacy Considerations 11. Security and Privacy Considerations
The TCP design includes only rudimentary security features that The TCP design includes only rudimentary security features that
improve the robustness and reliability of connections and application improve the robustness and reliability of connections and application
data transfer, but there are no built-in capabilities to support any data transfer, but there are no built-in capabilities to support any
form of privacy, authentication, or other typical security functions. form of privacy, authentication, or other typical security functions.
Applications typically utilize lower-layer (e.g. IPsec) and upper- Applications typically utilize lower-layer (e.g. IPsec) and upper-
layer (e.g. TLS) protocols to provide security and privacy for TCP layer (e.g. TLS) protocols to provide security and privacy for TCP
connections and application data carried in TCP. TCP options are connections and application data carried in TCP. TCP options are
available as well, to support some security capabilities. available as well, to support some security capabilities.
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 [18]. TCP-MD5 was a commonly implemented earlier TCP specifications [20]. 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. The TCP Authentication Option but had flaws and is now deprecated. The TCP Authentication Option
(TCP AO) [23] provides a capability to protect long-lived TCP (TCP AO) [26] provides a capability to protect long-lived TCP
connections from attacks, and has superior properties to TCP-MD5. It connections from attacks, and has superior properties to TCP-MD5. It
does not provide any privacy for application data, nor for the TCP does not provide any privacy for application data, nor for the TCP
headers. headers.
The "tcpcrypt" [38]Experimental extension to TCP provides the ability The "tcpcrypt" [43]Experimental extension to TCP provides the ability
to cryptographically protect connection data. Metadata aspects of to cryptographically protect connection data. Metadata aspects of
the TCP flow are still visible, but the application stream is well- the TCP flow are still visible, but the application stream is well-
protected. Within the TCP header, only the urgent pointer and FIN protected. Within the TCP header, only the urgent pointer and FIN
flag are protected through tcpcrypt. flag are protected through tcpcrypt.
The TCP Roadmap [33] includes notes about several RFCs related to TCP The TCP Roadmap [36] 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 [25] for to earlier TCP specifications. Additionally, see RFC 6093 [28] 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) that act as mitigations to these attacks. Byte Counting (ABC) that act as mitigations to these attacks.
Other attacks are focused on exhausting the resources of a TCP Other attacks are focused on exhausting the resources of a TCP
server. Examples include SYN flooding [17] or wasting resources on server. Examples include SYN flooding [19] or wasting resources on
non-progressing connections [27]. Operating systems commonly non-progressing connections [30]. Operating systems commonly
implement mitigations for these attacks. Some common defenses also implement mitigations for these attacks. Some common defenses also
utilize proxies, stateful firewalls, and other technologies outside utilize proxies, stateful firewalls, and other technologies outside
of the end-host TCP implementation. of the end-host TCP implementation.
TODO Editor's Note: Scott Brim mentioned that this should include a 12. Acknowledgements
PERPASS/privacy review ... Is this relevant anymore? Is it something
for the chairs or AD to request during WGLC or IETF LC?
7. Acknowledgements
This document is largely a revision of RFC 793, which Jon Postel was This document is largely a revision of RFC 793, which Jon Postel was
the editor of. Due to his excellent work, it was able to last for the editor of. Due to his excellent work, it was able to last for
three decades before we felt the need to revise it. three decades before we felt the need to revise it.
Andre Oppermann was a contributor and helped to edit the first Andre Oppermann was a contributor and helped to edit the first
revision of this document. revision of this document.
We are thankful for the assistance of the IETF TCPM working group We are thankful for the assistance of the IETF TCPM working group
chairs: chairs:
skipping to change at page 92, line 43 skipping to change at page 92, line 44
Hagen Paul Pfeifer, Anthony Sabatini, Joe Touch, Reji Varghese, Lloyd Hagen Paul Pfeifer, Anthony Sabatini, Joe Touch, Reji Varghese, Lloyd
Wood, and Alex Zimmermann. Joe Touch provided help in clarifying the Wood, and Alex Zimmermann. Joe Touch provided help in clarifying the
description of segment size parameters and PMTUD/PLPMTUD description of segment size parameters and PMTUD/PLPMTUD
recommendations. recommendations.
This document includes content from errata that were reported by This document includes content from errata that were reported by
(listed chronologically): Yin Shuming, Bob Braden, Morris M. Keesan, (listed chronologically): Yin Shuming, Bob Braden, Morris M. Keesan,
Pei-chun Cheng, Constantin Hagemeier, Vishwas Manral, Mykyta Pei-chun Cheng, Constantin Hagemeier, Vishwas Manral, Mykyta
Yevstifeyev, EungJun Yi, Botong Huang. Yevstifeyev, EungJun Yi, Botong Huang.
8. References 13. References
8.1. Normative References 13.1. Normative References
[1] Postel, J., "Internet Protocol", STD 5, RFC 791, [1] Postel, J., "Internet Protocol", STD 5, RFC 791,
DOI 10.17487/RFC0791, September 1981, DOI 10.17487/RFC0791, September 1981,
<https://www.rfc-editor.org/info/rfc791>. <https://www.rfc-editor.org/info/rfc791>.
[2] Mogul, J. and S. Deering, "Path MTU discovery", RFC 1191, [2] Mogul, J. and S. Deering, "Path MTU discovery", RFC 1191,
DOI 10.17487/RFC1191, November 1990, DOI 10.17487/RFC1191, November 1990,
<https://www.rfc-editor.org/info/rfc1191>. <https://www.rfc-editor.org/info/rfc1191>.
[3] McCann, J., Deering, S., and J. Mogul, "Path MTU Discovery [3] McCann, J., Deering, S., and J. Mogul, "Path MTU Discovery
skipping to change at page 94, line 5 skipping to change at page 94, line 5
[10] Paxson, V., Allman, M., Chu, J., and M. Sargent, [10] Paxson, V., Allman, M., Chu, J., and M. Sargent,
"Computing TCP's Retransmission Timer", RFC 6298, "Computing TCP's Retransmission Timer", RFC 6298,
DOI 10.17487/RFC6298, June 2011, DOI 10.17487/RFC6298, June 2011,
<https://www.rfc-editor.org/info/rfc6298>. <https://www.rfc-editor.org/info/rfc6298>.
[11] Gont, F., "Deprecation of ICMP Source Quench Messages", [11] Gont, F., "Deprecation of ICMP Source Quench Messages",
RFC 6633, DOI 10.17487/RFC6633, May 2012, RFC 6633, DOI 10.17487/RFC6633, May 2012,
<https://www.rfc-editor.org/info/rfc6633>. <https://www.rfc-editor.org/info/rfc6633>.
8.2. Informative References 13.2. Informative References
[12] Postel, J., "Transmission Control Protocol", STD 7, [12] Postel, J., "Transmission Control Protocol", STD 7,
RFC 793, DOI 10.17487/RFC0793, September 1981, RFC 793, DOI 10.17487/RFC0793, September 1981,
<https://www.rfc-editor.org/info/rfc793>. <https://www.rfc-editor.org/info/rfc793>.
[13] Nagle, J., "Congestion Control in IP/TCP Internetworks", [13] Nagle, J., "Congestion Control in IP/TCP Internetworks",
RFC 896, DOI 10.17487/RFC0896, January 1984, RFC 896, DOI 10.17487/RFC0896, January 1984,
<https://www.rfc-editor.org/info/rfc896>. <https://www.rfc-editor.org/info/rfc896>.
[14] Braden, R., Ed., "Requirements for Internet Hosts - [14] Braden, R., Ed., "Requirements for Internet Hosts -
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] Braden, R., "T/TCP -- TCP Extensions for Transactions [15] Almquist, P., "Type of Service in the Internet Protocol
Suite", RFC 1349, DOI 10.17487/RFC1349, July 1992,
<https://www.rfc-editor.org/info/rfc1349>.
[16] 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>.
[16] Mathis, M. and J. Heffner, "Packetization Layer Path MTU [17] Xiao, X., Hannan, A., Paxson, V., and E. Crabbe, "TCP
Processing of the IPv4 Precedence Field", RFC 2873,
DOI 10.17487/RFC2873, June 2000,
<https://www.rfc-editor.org/info/rfc2873>.
[18] 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>.
[17] Eddy, W., "TCP SYN Flooding Attacks and Common [19] 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>.
[18] Touch, J., "Defending TCP Against Spoofing Attacks", [20] 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>.
[19] Culley, P., Elzur, U., Recio, R., Bailey, S., and J. [21] 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>.
[20] Gont, F., "TCP's Reaction to Soft Errors", RFC 5461, [22] 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>.
[21] Allman, M., Paxson, V., and E. Blanton, "TCP Congestion [23] StJohns, M., Atkinson, R., and G. Thomas, "Common
Architecture Label IPv6 Security Option (CALIPSO)",
RFC 5570, DOI 10.17487/RFC5570, July 2009,
<https://www.rfc-editor.org/info/rfc5570>.
[24] 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>.
[22] Sandlund, K., Pelletier, G., and L-E. Jonsson, "The RObust [25] 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>.
[23] Touch, J., Mankin, A., and R. Bonica, "The TCP [26] 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>.
[24] Ramaiah, A., Stewart, R., and M. Dalal, "Improving TCP's [27] 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>.
[25] Gont, F. and A. Yourtchenko, "On the Implementation of the [28] 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>.
[26] Gont, F., "Reducing the TIME-WAIT State Using TCP [29] 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>.
[27] Bashyam, M., Jethanandani, M., and A. Ramaiah, "TCP Sender [30] 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>.
[28] Gont, F. and S. Bellovin, "Defending against Sequence [31] 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>.
[29] Borman, D., "TCP Options and Maximum Segment Size (MSS)", [32] 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>.
[30] Touch, J., "Shared Use of Experimental TCP Options", [33] 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>.
[31] Borman, D., Braden, B., Jacobson, V., and R. [34] 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>.
[32] Cheng, Y., Chu, J., Radhakrishnan, S., and A. Jain, "TCP [35] 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>.
[33] Duke, M., Braden, R., Eddy, W., Blanton, E., and A. [36] 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>.
[34] Fairhurst, G. and M. Welzl, "The Benefits of Using [37] Black, D., Ed. and P. Jones, "Differentiated Services
(Diffserv) and Real-Time Communication", RFC 7657,
DOI 10.17487/RFC7657, November 2015,
<https://www.rfc-editor.org/info/rfc7657>.
[38] 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>.
[35] IANA, "Transmission Control Protocol (TCP) Parameters, [39] Fairhurst, G., Ed., Trammell, B., Ed., and M. Kuehlewind,
Ed., "Services Provided by IETF Transport Protocols and
Congestion Control Mechanisms", RFC 8095,
DOI 10.17487/RFC8095, March 2017,
<https://www.rfc-editor.org/info/rfc8095>.
[40] IANA, "Transmission Control Protocol (TCP) Parameters,
https://www.iana.org/assignments/tcp-parameters/ https://www.iana.org/assignments/tcp-parameters/
tcp-parameters.xhtml", 2017. tcp-parameters.xhtml", 2017.
[36] Gont, F., "Processing of IP Security/Compartment and [41] 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.
[37] Gont, F. and D. Borman, "On the Validation of TCP Sequence [42] 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.
[38] Bittau, A., Giffin, D., Handley, M., Mazieres, D., Slack, [43] 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.
[39] Minshall, G., "A Proposed Modification to Nagle's [44] 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.
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 TCP standard requires checking the IP security compartment and RFC 793 requires checking the IP security compartment and precedence
precedence on incoming TCP segments for consistency within a on incoming TCP segments for consistency within a connection, and
connection. with application requests. Each of these aspects of IP have become
outdated, without specific updates to RFC 793. The issues with
precedence were fixed by [17] which is Standards Track, and so this
present TCP specification includes those changes. However, the state
of IP security options that may be used by MLS systems is not as
clean.
In common Internet usage of TCP, the IP security compartment is not Implementers of MLS systems that use IP security options (e.g. IPSO,
used. IP precedence has been deprecated with the introduction of CIPSO, or CALIPSO) should implement any additional logic appropriate
DiffServ many years ago. for their requirements.
Reseting connections when incoming packets do not meet expected Reseting connections when incoming packets do not meet expected
security compartment and precedence expectations has been recognized security compartment or precedence expectations has been recognized
as a possible attack vector [36], and the document advises ammending as a possible attack vector [41], and there has been discussion about
the TCP specification to prevent connections from being aborted due ammending the TCP specification to prevent connections from being
to non-matching IP security compartment and DiffServ codepoint aborted due to non-matching IP security compartment and DiffServ
values. codepoint values.
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 [37], which includes descriptions connection issues, as described in [42], 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 [37]. implementers should consider the problems described in [42].
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 [39] that A modification to the Nagle algorithm is described in [44] 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 A.4. Low Water Mark
 End of changes. 164 change blocks. 
396 lines changed or deleted 420 lines changed or added

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