ietf-corpus

rfc-1323

TCP Extensions for High Performance

V. Jacobson, R. Braden, D. Borman
date1992-05 streamIETF areatsv wgtcplw statusPROPOSED STANDARD pages37 canonicalhttps://www.rfc-editor.org/rfc/rfc1323 doi10.17487/RFC1323 errataview
This memo presents a set of TCP extensions to improve performance over large bandwidth*delay product paths and to provide reliable operation over very high-speed paths. It defines new TCP options for scaled windows and timestamps, which are designed to provide compatible interworking with TCP's that do not implement the extensions. [STANDARDS-TRACK]

obsoleted by

obsoletes

Extracted elements (27)

design-rationale §1.2

PAWS was chosen over expanding the TCP sequence number field to 64 bits to solve sequence-space wrap-around at high speeds. PAWS reuses the Timestamps option already defined for RTTM, adding no new wire format and operating entirely within a single connection's state.

tcp

design-rationale §1.1

SACK was omitted from RFC 1323 despite being defined in RFC 1072 because important technical issues about format and semantics remained unresolved. SACK was deferred to a separate specification rather than delay the window scaling and timestamps extensions.

tcp

design-rationale §4.2.4

The timestamp check (PAWS, step H1) is recommended to precede header prediction (H2) despite an estimated 5–10% CPU savings from reversing the order. A probabilistic argument that an old duplicate cannot land exactly at the left window edge was not universally accepted, and the performance gain did not justify the hazard.

tcp

design-rationale §2.1

The Window Scale factor is fixed at connection open (SYN) rather than negotiated per-segment. Sending it in every segment was rejected because TCP options on pure ACK segments are not reliably delivered; fixing it at SYN reduces overhead at the cost of preventing mid-connection scale adjustments.

tcp

design-rationale §4.2.2

Timestamp clock frequency was chosen in the range 1 ms–1 sec to satisfy both RTTM (needs resolution comparable to the retransmit timer, tens to hundreds of milliseconds) and PAWS (must tick once per 2**31 bytes; 1 ms clock works up to 8 Tbps). A 1 ms clock wraps its sign bit in 24.8 days, safely exceeding practical MSL values.

tcp

design-rationale §4.2

TS.Recent is shared between RTTM and PAWS rather than maintained as two separate values. This simplification became possible after fixing the timestamp-echo rules (Section 3.4) to correctly handle delayed ACKs and out-of-order/retransmitted segments.

tcp

interoperability-note §2.2

A TCP that is prepared to scale windows should send WSopt even if its own desired scale factor is 1 (shift.cnt=0), to signal readiness for bidirectional scaling. Omitting WSopt from the SYN disables scaling in both directions for the connection.

tcp

interoperability-note §Appendix A

Appendix A recommends a canonical option layout for non-SYN segments (NOP, NOP, TSopt Kind, 10, TSval, TSecr) to achieve 32-bit alignment on RISC architectures, enabling a fast-path 'header prediction' check that treats the option fields as fixed-format header extensions.

tcp

interoperability-note §2.2

The Window field in a SYN or SYN,ACK segment is never scaled, regardless of whether WSopt is negotiated. Window scaling applies exclusively to non-SYN segments, so the initial window advertisement is always interpreted at face value.

tcp

normative-requirement §3.2 MUST

A TCP may send TSopt in other segments only if it received TSopt in the initial SYN for the connection. TSopt in a SYN,ACK must echo back the TSval from the SYN. A TSopt on a non-SYN segment where the option was not negotiated in the SYN must be ignored.

tcp

normative-requirement §4.2.3 MUST

An implementation of PAWS must include a mechanism to invalidate TS.Recent when a connection has been idle for more than 24 days. Without this, a wrapped timestamp clock would cause PAWS to reject all segments on a long-idle connection, freezing it permanently.

tcp

normative-requirement §1.3 MUST

Extension options (WSopt, TSopt) must be sent on non-SYN segments only when a prior SYN/SYN-ACK exchange has confirmed both sides understand the extension. WSopt or TSopt in a SYN,ACK must only be sent if the corresponding option was present in the initial SYN.

tcp

normative-requirement §2.3 SHOULD

If a WSopt is received with shift.cnt exceeding 14, the TCP should log the error but use 14 instead. The maximum window is bounded at 2**30 bytes to ensure that the left edge of the sender's window is always within 2**31 of the right edge of the receiver's window.

tcp

normative-requirement §4.2.1 MUST

PAWS rule R1: if SEG.TSval < TS.Recent and TS.Recent is valid, treat the segment as not acceptable—send an ACK per RFC-793 page 69 and drop the segment. The ACK is necessary to preserve TCP's half-open connection detection.

tcp, security

normative-requirement §4.2 RECOMMENDED

RST segments should NOT carry timestamps and should be accepted regardless of their timestamp value. Old duplicate RSTs are exceedingly unlikely, and their connection-cleanup function must take precedence over timestamp validation.

tcp

normative-requirement §4.2.2 MUST

The timestamp clock must be monotone non-decreasing; the sender's clock must guarantee that each new timestamp value equals or exceeds the previous one. Implementations may achieve this via hardware clock, counter interrupt, or an offset-adjusted software clock.

tcp

normative-requirement §4.2.2 MUST

The timestamp clock must tick at least once per 2**31 bytes sent (not too slow) and its recycling period must exceed MSL seconds (not too fast, maximum one tick per 59 ns for 255 s MSL). The recommended clock frequency is 1 ms to 1 sec per tick.

tcp

normative-requirement §3.3 MUST

TSecr must be zero when the ACK bit is not set. A TSecr value received in a segment is used to update the averaged RTT estimate only if the segment acknowledges new data (advances the left edge of the send window), preventing RTT inflation from one-way data flow pauses.

tcp, congestion

normative-requirement §2.2 MUST

WSopt MUST be sent only in SYN segments, and both sides must include it in their SYN to enable scaling in either direction. If either side omits WSopt, both Snd.Wind.Scale and Rcv.Wind.Scale are set to zero and scaling is disabled.

tcp

protocol-element §4.2

PAWS (Protect Against Wrapped Sequence numbers) uses TSopt to reject old duplicate segments within a connection. A segment is discarded if SEG.TSval < TS.Recent (modular 32-bit comparison), treating the timestamp as a logical extension of the high-order sequence number bits.

tcp, security

protocol-element §3.3

RTTM (Round Trip Time Measurement) uses TSopt: the sender stamps each segment with TSval, the receiver reflects it in TSecr, and the sender computes RTT as my.TSclock - SEG.TSecr. This enables per-ACK RTT sampling at negligible cost, solving the aliasing problem on large windows.

tcp, congestion

protocol-element §3.4

Two per-connection state variables are shared by RTTM and PAWS: TS.Recent holds the timestamp to echo in TSecr, and Last.ACK.sent holds the ACK field from the last sent segment. TS.Recent is updated from an incoming segment when SEG.SEQ <= Last.ACK.sent.

tcp

protocol-element §2.3

Window scaling extends the effective TCP window to 32 bits by negotiating a shift count in SYN segments. On reception, SEG.WND is left-shifted by Snd.Wind.Scale to obtain TrueWindow; on transmission, RCV.WND is right-shifted by Rcv.Wind.Scale. All local window calculations (including the congestion window) use 32-bit quantities.

tcp, congestion

security-consideration §Security Considerations

The RFC explicitly states that security issues are not discussed in this memo. No security analysis of the Window Scale or Timestamps extensions (e.g., timestamp-based fingerprinting, PAWS reset attacks) is provided.

tcp, security

state-machine §4.2.1

PAWS algorithm R1–R5 defines processing of all arriving segments on a synchronized connection: (R1) reject if SEG.TSval < TS.Recent and TS.Recent valid; (R2) reject if outside window; (R3) update TS.Recent if SEG.SEQ <= Last.ACK.sent; (R4) accept if in-sequence; (R5) queue as out-of-sequence. Timestamp is checked only on initial arrival, not on deferred delivery.

tcp, security

wire-format §3.2

The Timestamps option (TSopt) is 10 bytes: Kind=8, Length=10, a 4-byte TSval (sender's current timestamp clock), and a 4-byte TSecr (echo of the remote's last TSval). TSecr is only valid when the ACK bit is set; otherwise its value must be zero.

tcp

wire-format §2.2

The Window Scale option (WSopt) is 3 bytes: Kind=3, Length=3, and a single 'shift.cnt' byte encoding the base-2 logarithm of the scale factor. The scale factor is limited to a power of two and may range from 0 to 14.

tcp