Independent Submission W. Simpson
Request for Comments: 6013 DayDreamer
Category: Experimental January 2011
ISSN: 2070-1721
TCP Cookie Transactions (TCPCT)
Abstract
TCP Cookie Transactions (TCPCT) deter spoofing of connections and
prevent resource exhaustion, eliminating Responder (server) state
during the initial handshake. The Initiator (client) has sole
responsibility for ensuring required delays between connections. The
cookie exchange may carry data, limited to inhibit amplification and
reflection denial of service attacks.
Status of This Memo
This document is not an Internet Standards Track specification; it is
published for examination, experimental implementation, and
evaluation.
This document defines an Experimental Protocol for the Internet
community. This is a contribution to the RFC Series, independently
of any other RFC stream. The RFC Editor has chosen to publish this
document at its discretion and makes no statement about its value for
implementation or deployment. Documents approved for publication by
the RFC Editor are not a candidate for any level of Internet
Standard; see Section 2 of RFC 5741.
Information about the current status of this document, any errata,
and how to provide feedback on it may be obtained at
http://www.rfc-editor.org/info/rfc6013.
Simpson Experimental [Page 1]
RFC 6013 TCP Cookie Transactions January 2011
Copyright Notice
Copyright (c) 2011 IETF Trust and the persons identified as the
document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect
to this document.
This document may not be modified, and derivative works of it may not
be created, except to format it for publication as an RFC or to
translate it into languages other than English.
Simpson Experimental [Page 2]
RFC 6013 TCP Cookie Transactions January 2011
Table of Contents
1. Introduction ....................................................4
1.1. Terminology ................................................4
2. Protocol Overview ...............................................4
2.1. Message Summary (Simplified) ...............................6
2.2. Compatibility and Transparency .............................7
2.3. Fully Loaded Cookies .......................................7
2.4. TCP Header Extension .......................................8
2.5. Option Handling ......................................9
3. Protocol Details ................................................9
3.1. TCP Cookie Option .........................................10
3.2. TCP Cookie-Pair Standard Option ...........................10
3.3. TCP Cookie-less Option ....................................11
3.4. TCP Timestamps Extended Option ............................11
3.5. Cookie Generation .........................................13
4. Cookie Exchange ................................................16
4.1. Initiator ...........................................16
4.2. Responder ..................................17
4.3. Initiator ......................................17
4.4. Responder ...........................................18
4.5. Simultaneous Open .........................................18
5. Accelerated Close ..............................................19
5.1. Initiator Close ...........................................20
5.2. Responder Close ...........................................20
6. Accelerated Open ...............................................21
6.1. Initiator Data ......................................21
6.2. Responder Data .............................22
6.3. Initiator Data .................................23
6.4. Responder Data ......................................24
7. Advisory Reset .................................................24
8. Interactions with Other Options ................................24
8.1. TCP Selective Acknowledgment ..............................25
8.2. TCP Timestamps ............................................25
8.3. TCP Extensions for Transactions ...........................25
8.4. TCP MD5 Signature .........................................25
8.5. TCP Authentication ........................................25
9. History ........................................................26
10. Acknowledgments ...............................................27
11. IESG Considerations ...........................................27
12. Operational Considerations ....................................28
13. Security Considerations .......................................28
Appendix A. Example Headers .......................................30
A.1. Example Options .....................................30
A.2. Example with Sack ..............................31
A.3. Example with 64-bit Timestamps .................32
Normative References ..............................................33
Informative References ............................................34
Simpson Experimental [Page 3]
RFC 6013 TCP Cookie Transactions January 2011
1. Introduction
TCP Cookie Transactions (TCPCT) provide a cryptologically secure
mechanism to guard against simple flooding attacks sent with bogus IP
[RFC791] Sources or TCP [RFC793] Ports. The initial TCP
exchange is vulnerable to forged IP Addresses, predictable Ports, and
discoverable Sequence Numbers [Morris1985] [Gont2009]. (See also
[RFC2827], [RFC3704], and [RFC4953].)
During connection establishment, the cookie (nonce) exchange
negotiates elimination of Responder (server) state. These cookies
are later used to inhibit premature closing of connections, and
reduce retention of state after the connection has terminated.
The cookie pair is much too large to fit with the other recommended
options in the maximal 60 byte TCP header (40 bytes of option space).
A successful option exchange signals availability of the TCP header
extension, adding space for additional options.
Also, implementations may optionally exchange limited amounts of
transaction data during the initial cookie exchange, reducing network
latency and host task context switching.
Finally, implementations may optionally rapidly recycle prior
connections. For otherwise stateless applications, this
transparently facilitates persistent connections and pipelining of
requests over each connection.
Many of these ideas have been previously proposed in one form or
another (see History and Acknowledgments sections). This
specification integrates these improvements into a coherent whole.
Further motivation and rationale were detailed in [MSV2009].
1.1. Terminology
The key words "MAY", "MUST, "MUST NOT", "OPTIONAL", "RECOMMENDED",
"REQUIRED", "SHOULD", and "SHOULD NOT" in this document are to be
interpreted as described in [RFC2119].
byte An 8-bit quantity; also known as "octet" in standardese.
2. Protocol Overview
The TCPCT extensions consist of several simple phases:
1. Each party passes a "cookie" to the other. Due to limited space,
only the most basic options are included.
Simpson Experimental [Page 4]
RFC 6013 TCP Cookie Transactions January 2011
The Cookie option also indicates that optional data is
acceptable. This data MAY be ignored by either party.
A Responder that understands the Cookie option remains stateless.
2. During the remainder of the standard TCP three-way handshake, the
Timestamps and Cookie-Pair options guard the exchange.
Other options present in the original that were successfully
returned in the MUST be included with the
. Additional options MAY also be included as desired.
As there is no Responder state, it has no record of acknowledging
previous data. Any optional data MUST be retransmitted.
Upon verification of the Timestamps and Cookie-Pair, the Responder
creates its Transport Control Block (TCB) [RFC793].
Note that the Responder returns the Cookie-Pair with its initial
data, but subsequent data segments need only the Timestamps.
3. During close (or reset) of the TCP connection, the Timestamps and
Cookie-Pair options guard the exchange.
Upon verification of the Timestamps and Cookie-Pair, the Responder
removes its TCB.
The sequence of messages is summarized in the diagram below.
Simpson Experimental [Page 5]
RFC 6013 TCP Cookie Transactions January 2011
2.1. Message Summary (Simplified)
Initiator Responder
========= =========
->
base options
Timestamps
Cookie
[request data]
<-
base options
Timestamps
Cookie
[response data]
(stateless)
->
full options
Timestamps
Cookie-Pair
[Sack(response)]
data
<-
full options
Timestamps
Cookie-Pair
data
(TCB state created)
<-
Timestamps
data
<-
Timestamps
Cookie-Pair
->
Timestamps
Cookie-Pair
<-
Timestamps
Cookie-Pair
(TCB state removed)
TIME-WAIT
Simpson Experimental [Page 6]
RFC 6013 TCP Cookie Transactions January 2011
2.2. Compatibility and Transparency
It is usually better that data arrive slowly, than not at all.
Many/most unmanaged middleboxes [RFC3234] (such as stateless
firewalls, load balancers, intrusion detection systems, or network
address translators [RFC3022]) cannot carry transport traffic other
than TCP and UDP.
Every TCP implementation MUST ignore without error any TCP option it
does not implement ([RFC1122] section 4.2.2.5). In a study of the
effects of middleboxes on transport protocols [MAF2004], the vast
majority of modern TCP stacks correctly handle unknown TCP options.
But it is still prudent to follow the [RFC793] "general principle of
robustness: be conservative in what you do, be liberal in what you
accept from others."
Therefore, for each of the extensions defined here, an extension
option will be sent in a segment only after the
corresponding option was received in the original segment.
Furthermore, TCP options will be sent on later segments only after an
exchange of options has indicated that both parties understand the
extension (see [RFC1323] [rfc1323bis] and its antecedents).
Unfortunately, not all middleware adheres to these long-standing
requirements. Instead, unknown options are copied to the
. This is indistinguishable from a Monkey in the
Middle (MITM) reflection attack.
2.3. Fully Loaded Cookies
One Kind to aid them all, One Kind to find them,
One Kind to hold them all and in the header bind them.
The cookie exchange provides a singular opportunity to extend TCP
with backward compatibility. Semantics for the option have been
"overloaded" with a baker's dozen of capabilities and facilities.
A. First and foremost, the cookie exchange improves operational
security for vulnerable servers against flooding attacks. The
cookie exchange indicates that the Responder (server) will discard
its initial state. All other semantics are subordinate.
B. Together with Sequence and Timestamp values, Cookie values protect
against insertion and reflection attacks.
C. Cookie values allow applications to detect replay attacks.
Simpson Experimental [Page 7]
RFC 6013 TCP Cookie Transactions January 2011
D. Cookie values MAY be used as an index or nonce for application
security protocols. This facility is beyond the scope of this
specification.
E. The and MAY carry application data. This
feature is entirely optional, and data is not guaranteed to pass
successfully through middleware. Nor are the parties guaranteed
to process this data without changes to the Application Program
Interface (API). Such changes are beyond the scope of this
specification.
F. The size of the cookies precludes most other options in the
standard TCP header space. The cookie exchange negotiates TCP
header extension.
G. The cookie exchange and resulting TCP header extension permit
negotiation of larger 64-bit (or 128-bit) Timestamps for paths
with large bandwidth-delay products.
H. TCP header extension frees some space for additional options.
I. Previously SYN-only options can be updated.
J. The cookie exchange indicates agreement to use accelerated close.
K. The cookie exchange indicates agreement that only the Initiator
(client) handles TIME-WAIT state.
L. The Timestamps and Cookie-Pair combination inhibits third parties
from disrupting communications with and .
M. The Timestamps and Cookie-Pair combination facilitates rapid reuse
of the TCP Source Port with a common destination.
2.4. TCP Header Extension
Once the Cookie option has been successfully exchanged, TCP header
extension is permitted. The Timestamps extended option (defined
below) indicates the presence of the header extension.
Validation of known timestamp values protects against data corruption
by misbehaving middleboxes.
Simpson Experimental [Page 8]
RFC 6013 TCP Cookie Transactions January 2011
2.5. Option Handling
As the Responder retains no TCB state after the initial TCP
exchange, all options present in the original MUST be repeated.
For example, an option defined in the [RFC793] original specification
-- Maximum Segment Size (MSS) -- previously appeared only in a
bearing segment (including ). If present, MSS will be
repeated in the Initiator , together with any additional
options.
Generally, the Initiator MAY propose SYN-only options -- such as MSS
-- anytime both Timestamps and Cookie-Pair options are present.
These options are treated the same as with an original . The
Responder acknowledges using a subsequent segment containing
both Timestamps and Cookie-Pair options (similar to
processing).
This facility allows previously SYN-only options to be updated from
time to time. They take effect upon receipt.
However, segments without data will not be delivered reliably.
Any otherwise SYN-only options sent without data MUST be
retransmitted with successive segments until sent with data (or
), and an is received.
3. Protocol Details
Another solution [RFC5452] describes use of an unpredictable Source
Port. That is RECOMMENDED by this specification. See [RFC6056] for
further information.
An earlier solution [RFC1948] describes an unpredictable Initial
Sequence Number (ISN). That is REQUIRED by this specification.
Support for the (32-bit) TCP Timestamps Option [RFC1323] is REQUIRED.
A TSoffset SHOULD be generated per connection [GO2010]. The Don't
Fragment (DF) bit MUST be set in the IP (v4) header.
The TCP User Timeout Option [RFC5482] is RECOMMENDED.
Only one instance is permitted of any of the Cookie, Cookie-less, or
Cookie-Pair option(s). Segments with duplicative or mutually
exclusive options MUST be silently discarded.
For examples, see Appendix A.
Simpson Experimental [Page 9]
RFC 6013 TCP Cookie Transactions January 2011
3.1. TCP Cookie Option
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Kind | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
~ Cookie ~
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Kind 1 byte: constant 253 (experimental).
Length 1 byte: range 10 to 18 (bytes); limited by remaining
space in the options field. The number MUST be
even; the cookie is a multiple of 16 bits.
Cookie 8 to 16 bytes (Length - 2): an unpredictable value.
Options with invalid Length values MUST be ignored. The minimum
Cookie size is 64 bits. If there is not sufficient space for a
64-bit cookie, this option MUST NOT be used.
The Responder Cookie MUST be the same size as the Initiator Cookie.
The cookie pair is a multiple of 32 bits.
Although the diagram shows a cookie aligned on 32-bit boundaries,
that is not required.
3.2. TCP Cookie-Pair Standard Option
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Kind | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
~ Initiator-Cookie ~
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
~ Responder-Cookie ~
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Kind 1 byte: constant 253 (experimental).
Length 1 byte: range 18 to 34 (bytes). The number MUST be
even; the cookie pair is a multiple of 32 bits.
Initiator-Cookie 8 to 16 bytes, from the original .
Simpson Experimental [Page 10]
RFC 6013 TCP Cookie Transactions January 2011
Responder-Cookie 8 to 16 bytes, from the .
The Cookie-Pair standard option only appears after the Timestamps
extended option (below).
Options with invalid Length values MUST be ignored. As the minimum
Initiator-Cookie size is 64 bits, the minimum cookie pair is 128 bits
(64 bits followed by 64 bits), while the maximum is 256 bits (128
bits followed by 128 bits).
3.3. TCP Cookie-less Option
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Kind | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Kind 1 byte: constant 253 (experimental).
Length 1 byte: constant 2 (bytes). This distinguishes the
option from other Cookie options.
Although no cookie is attached, this indicates that other features of
this specification are available, including TCP header extension,
Accelerated Close, Accelerated Open, and Advisory Reset. This is
intended for use with TCP authentication options, beyond the scope of
this specification.
3.4. TCP Timestamps Extended Option
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Kind | Length | Extend | R | S |
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
| |
~ TS Value ~
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
~ TS Echo Reply ~
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Kind 1 byte: constant 254 (experimental).
Length 1 byte: constant 4 (bytes).
Simpson Experimental [Page 11]
RFC 6013 TCP Cookie Transactions January 2011
Extend 1 byte: range 9 to 255; the data offset (in 32-bit
words) following the standard TCP header. Note this
value MUST include the timestamp pair indicated by
(S)ize.
(R)eserved 5 bits: default zero. Reserved for future use.
(S)ize 3 bits:
1. 32-bit timestamps.
2. 64-bit timestamps.
4. 128-bit timestamps.
Other values are beyond the scope of this
specification.
TS Value 4, 8, or 16 bytes. The current value of the
timestamp for the sender.
TS Echo Reply 4, 8, or 16 bytes. A copy of the most recently
received TS Value.
The full timestamp pair follows the TCP header (indicated by +=+
delimiters) and maintains 32-bit alignment.
This TCP header extension is ignored for sequence number
computations. The Sequence Number of the first byte of segment data
will be the Initial Sequence Number (ISN) plus one (1) for the .
Every TCPCT implementation MUST recognize a Timestamps extended
option. The larger 64-bit (or 128-bit) timestamps only appear in an
extended option.
Segments with invalid Extend values MUST be silently discarded.
Only one instance is permitted of either the (32-bit) Timestamps
standard option or this Timestamps extended option. Segments with
duplicative or mutually exclusive options MUST be silently discarded.
Implementation Notes:
Serendipitous alignment allows simple loads and stores, instead of
slower byte by byte iterations.
Simpson Experimental [Page 12]
RFC 6013 TCP Cookie Transactions January 2011
When the TCP header is aligned on a 32-bit boundary and this is
the only option, the timestamps in the extended header SHOULD be
aligned on a 64-bit boundary. For both 32-bit and 64-bit
timestamps, any data following the extended header will be aligned
on a 64-bit boundary.
However, the 128-bit timestamps are not 128-bit aligned.
3.5. Cookie Generation
The technique by which a party generates a cookie is implementation
dependent. The method chosen must satisfy some basic requirements:
1. The cookie MUST depend on the specific parties. This prevents an
attacker from obtaining a cookie using a real IP address and TCP
port, and then using it to swamp the victim with requests from
randomly chosen IP addresses or ports.
2. It MUST NOT be possible for anyone other than the issuing entity
to generate cookies that will be accepted by that entity. This
implies that the issuing entity will use local secret information
in the generation and subsequent verification of a cookie. It
must not be possible to deduce this secret information from any
particular cookie.
3. The cookie generation and verification methods MUST be fast to
thwart attacks intended to sabotage CPU resources.
A recommended technique is to use a cryptographic hashing function.
An incoming cookie can be verified at any time by regenerating it
locally from values contained in the incoming datagram and the local
secret random value.
3.5.1. Initiator Cookie
The Initiator secret value that affects its cookie SHOULD change for
each new exchange, and is thereafter internally cached per TCB. This
provides improved synchronization and protection against replay
attacks.
An alternative is to cache the cookie instead of the secret value.
Incoming cookies can be compared directly without the computational
cost of regeneration.
Simpson Experimental [Page 13]
RFC 6013 TCP Cookie Transactions January 2011
It is RECOMMENDED that the cookie be calculated over the secret
value, the IP Source and Destination addresses, the TCP Source and
Destination ports, and any (optional) Initiator segment data.
Implementation Notes:
Although the recommendation includes the TCP Source Port, this is
very implementation specific. For example, it might not be
included when the value is constant or unknown.
Likewise, segment data might not be included directly. For
example, a pointer to the data could be included instead, with
care taken to ensure the pointer changes anytime the data changes.
However, it is important that the implementation protect mutually
suspicious users of the same system from generating the same
cookie.
3.5.2. Responder Cookie
The Responder secret value that affects its cookies remains the same
for many different Initiators. However, this secret SHOULD be
changed periodically to limit the time for use of its cookies
(typically each 600 seconds).
The Responder-Cookie calculation MUST include its own TCP Sequence
and Acknowledgment Numbers (after updating values), its own TCP
Timestamps value, and the Initiator-Cookie value. This provides
improved synchronization and protection against replay attacks.
It is RECOMMENDED that the cookie be calculated over the secret
value, the IP Source and Destination addresses, its own TCP
Destination Port (that is, the incoming Source Port), and the
required values (above), followed by the secret value again.
The cookie is not cached per Initiator to avoid saving state during
the initial TCP exchange. On receipt of a TCP , the
Responder regenerates its cookie for validation.
Implementation Notes:
Although the recommendation does not include the TCP Source Port,
this is very implementation specific. It might be successfully
included in some variants.
The Responder Cookie depends on the TCP Sequence and
Acknowledgment Numbers as they will appear for future
verification. The Sequence Number will be the Initial Sequence
Simpson Experimental [Page 14]
RFC 6013 TCP Cookie Transactions January 2011
Number (ISN) plus one (1) for its that will be acknowledged.
The Acknowledgment Number will be the Initial Sequence Number
(ISN) plus one (1) for the that it is now acknowledging.
The (32-bit) TCP Timestamps standard option MAY change to the
larger 64-bit (or 128-bit) extended form; only the least
significant 32 bits are included. The Initiator Timestamp field
value MAY increment during the exchange; it MUST NOT be included.
The secret value is included twice to better protect against pre-
calculated attacks using substitutions for variable length data.
Some examples using this technique are IP-MAC and H-MAC, and it is
likely that existing code could be shared.
The Responder SHOULD designate a (fixed or randomly selected) bit
of its cookie to distinguish each changed secret value. The bit
is set to a (fixed or randomly selected) constant 0 or 1, and
checked upon receipt before further verification. This ensures
that only one verification calculation is necessary (on average)
during Denial of Service (DoS) attacks.
If a Responder Cookie is identical to the Initiator Cookie, the
Responder SHOULD change one or more bits of its cookie to prevent
its accidental appearance as a reflection attack.
3.5.3. Responder Secret Value
Each Responder maintains up to two secret values concurrently for
efficient secret rollover. Each secret value has 4 states:
Generating
Generates new Responder-Cookies, but not yet used for primary
verification. This is a short-term state, typically lasting only
one Round Trip Time (RTT).
Primary
Used both for generation and primary verification.
Retiring
Used for verification, until the first failure that can be
verified by the newer Generating secret. At that time, this
cookie's state is changed to Secondary, and the Generating
cookie's state is changed to Primary. This is a short-term state,
typically lasting only one RTT.
Simpson Experimental [Page 15]
RFC 6013 TCP Cookie Transactions January 2011
Secondary
Used for secondary verification, after primary verification
failures. This state lasts no more than twice the Maximum Segment
Lifetime (2MSL). Then, the secret is discarded.
Implementation Notes:
Care MUST be taken to ensure that any expired secrets are promptly
wiped from memory, and secrets are never saved to external
storage.
The first secret after initialization begins in Primary state.
The system might have shutdown and restarted rapidly during the
previous first secret. Thus, the first secret MUST be partially
time dependent, to ensure that it differs from previous first
secrets, usually by appending a time to lengthen the first secret.
Those that are not the first secret SHOULD NOT include the time.
At the same time, there is no TCP TIME-WAIT requirement before
accepting connections, and there may be pent up demand for a busy
service. Also, there may be outstanding datagrams attempting to
complete an earlier cookie exchange. The first secret is likely
to be the weakest, as no recent entropy has been included.
Therefore, while terminating outstanding exchanges with the first
secret, a new Generating secret SHOULD be created after no more
than one Maximum Segment Lifetime (1MSL). Subsequent secrets
SHOULD be generated at the usual rate (typically 600 seconds).
The implementation SHOULD continually gather additional entropy
from checksums, cookies, timestamps, and packet arrival timing.
4. Cookie Exchange
A successful option exchange signals availability of additional
features.
4.1. Initiator
The Cookie exchange MAY be initiated at any time, limited only by the
frequency of the timestamp clock.
If the TCB exists from a prior (or ongoing) connection, the timestamp
MUST be incremented in the option.
The Initiator generates its unpredictable cookie value, and includes
the Cookie option.
Simpson Experimental [Page 16]
RFC 6013 TCP Cookie Transactions January 2011
During the initial exchange, the Initiator is solely responsible for
retransmission. Although the cookie and sequence have not changed,
each retransmission appears to the Responder as another original
.
Implementation Notes:
Sending the SHOULD NOT affect any existing TCB. This allows
an additional RTT for duplicate or out-of-sequence segments to
drain.
The new TCB information SHOULD be temporarily cached until a valid
matching arrives. Then, any old TCB values are
replaced.
4.2. Responder
Upon receipt of the with a Cookie option, the Responder
determines whether there are sufficient resources to begin another
connection.
If the TCB exists from a prior (or ongoing) connection, the timestamp
MUST be incremented in the option.
Each Sequence Number MUST be randomized [RFC1948].
The Responder generates its unpredictable cookie value, and includes
the Cookie option.
As the Responder retains no TCB state, retransmission timers are not
available. Arrival of an Initiator's retransmission appears to be an
original transmission. There are no differences in processing.
Implementation Notes:
Sending the MUST NOT affect any existing TCB. This
allows an additional RTT for duplicate or out-of-sequence segments
to drain.
This also inhibits third parties from disrupting communications.
4.3. Initiator
Upon receipt of the with a Cookie option, the
Initiator validates its cookie, timestamp, and corresponding
Acknowledgment Number. The existing TCB is updated as necessary.
Simpson Experimental [Page 17]
RFC 6013 TCP Cookie Transactions January 2011
All Initiator options are always retransmitted on this first
, allowing the Responder to validate its cookie and
establish its state.
This segment contains both Timestamps and Cookie-Pair options.
The Initiator sends the Timestamps extended option with an
appropriate Size -- chosen by a configurable parameter, or
automatically based on its analysis of the bandwidth-delay product
discovered through the RTT of its timestamp. When the chosen
Size is greater than 32 bits, the Initiator adds a random prefix to
its own timestamp, and a random prefix to the Responder timestamp
echo reply.
Implementation Notes:
A Responder Cookie identical to the Initiator Cookie MUST be
discarded. This is usually an indication of a Monkey in the
Middle (MITM) reflection attack or a seriously misconfigured
network, and SHOULD be logged.
4.4. Responder
Upon receipt of the with a Cookie-Pair option, the
Responder validates its cookie, timestamp, and corresponding
Acknowledgment Number, and establishes state for the connection. Any
existing TCB is updated as necessary.
This segment contains both Timestamps and Cookie-Pair options.
However, the Responder MAY refuse to negotiate the larger 64-bit (or
128-bit) Timestamps extended option by returning the least
significant bits in a smaller Timestamps extended option.
Implementation Notes:
An that fails to validate MUST be discarded, and SHOULD
be logged.
4.5. Simultaneous Open
TCP allows two parties to simultaneously initiate the connection.
Both parties send and receive an original without an
intervening (see [RFC793] section 3.4 and Figure 8).
Each party receives a Cookie for a