TCP Options: MSS, Window Scale, SACK, Timestamps, User Timeout, TCP-AO and Fast Open
What each TCP option does and how it's negotiated in the SYN: MSS and why it can differ by direction, window scaling, SACK, timestamps and PAWS, User Timeout, TCP-AO, TCP Fast Open with a real cookie exchange, and how TCP discovers the path MTU, all shown in lab captures.
kvi5hnuCode Sprout team member18 min readOn this page
The fixed TCP header from article 58 was designed in 1981 for links and windows tiny by today's standards. Almost everything TCP has gained since then (big windows, selective acknowledgments, precise RTT measurement, authentication, faster opens) arrived as options: extra fields after the fixed 20 bytes. This article goes through the options you'll meet in real traffic, and then shows how TCP chooses its segment size when the path's MTU (maximum transmission unit, the largest packet a link can carry, article 20) is smaller than expected.
How options are encoded and negotiated
Each option starts with a 1-byte kind. Two kinds are a single byte: kind 0 (End of Option List) and kind 1 (NOP, no operation, used as padding to keep later options aligned). Every other option has a 1-byte length, counting the kind and length bytes, followed by data. The Data Offset field limits options to 40 bytes per segment, which is a real constraint: SACK blocks and timestamps together already use most of it.
The table below lists the options you'll meet most, with their kind numbers, sizes and where they may appear.

Most options are negotiated in the handshake. A side offers an option in its SYN, and the feature is used only if the other side includes it in its SYN-ACK too. An unknown option must be ignored, which lets new options be deployed gradually. Some middleboxes don't follow that rule and strip or mangle options they don't recognize, which is why new options are slow to spread.
In the lab, the server's link was given an MTU of 1400 bytes, and the client made a connection to it. The SYN and SYN-ACK below differ mainly in MSS; TSval and TSecr are the timestamps covered later in this article:
39202 → 8080 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 SACK_PERM TSval=3371768558 TSecr=0 WS=128
8080 → 39202 [SYN, ACK] Seq=0 Ack=1 Win=64704 Len=0 MSS=1360 SACK_PERM TSval=1056421721 TSecr=3371768558 WS=128
Maximum Segment Size (MSS)
The MSS option says how large a segment (TCP payload only, not headers) the sender of the SYN is willing to receive. A host normally computes it from its interface MTU minus 40 bytes of minimum IPv4 and TCP headers (60 for IPv6): 1500 − 40 = 1460 on Ethernet, as the client sent above. The server's interface had MTU 1400, so it sent MSS 1360.
Three details matter:
- MSS is per direction, not negotiated. The client may send the server at most 1360-byte segments, and the server may send the client up to 1460. Each side honors the other's value.
- The default without the option is small. A host that receives no MSS option must assume 536 bytes for IPv4 and 1220 for IPv6.
- Options take space out of the MSS. With timestamps on every segment (12 bytes with padding), a full-sized segment carries 12 fewer bytes of data. That's why
ssreportsadvmss:1448on a 1500-byte link, not 1460.
The data the server actually sent in this connection, counted by size (number of segments, sender, bytes of data per segment):
14 198.51.100.10 1348
1 198.51.100.10 1128
1 192.0.2.10 3
Fourteen full segments carried 1348 bytes each, and one 1128-byte segment carried the rest of the 20,000-byte reply (14 × 1348 + 1128 = 20,000). Each full segment is the server's 1400-byte MTU minus 20 bytes of IP header, 20 of TCP header and 12 of timestamps: 1400 − 20 − 20 − 12 = 1348. The client's ss view of the connection confirms the values each side is using:
cubic wscale:7,7 rto:222 rtt:21.976/8.512 ato:40 mss:1348 pmtu:1500 rcvmss:1348 advmss:1448 cwnd:10
bytes_sent:3 bytes_acked:4 bytes_received:20001 segs_out:18 segs_in:17 data_segs_out:1 data_segs_in:15 send
4907171bps lastsnd:242 lastrcv:196 lastack:196 pacing_rate 9814280bps delivery_rate 465912bps delivered:2
app_limited busy:23ms rcv_rtt:23 rcv_space:14480 rcv_ssthresh:74577 minrtt:21.809 snd_wnd:64768 rcv_wnd:65920
Here mss:1348 is the size this host sends, rcvmss:1348 is the size it has been receiving, advmss:1448 is what it advertised for itself (its own 1500-byte link), and wscale:7,7 shows both sides' window scale shift counts. Fields such as rto, rtt and cwnd come back in articles 64 and 72; ignore the rest for now.
Window Scale
The header's Window field is 16 bits, so it can't describe more than 65,535 bytes. On a path with a 100 ms RTT, that caps a connection at about 5 Mbit/s no matter how fast the links are (article 70 works the numbers). The Window Scale option, defined in RFC 7323, carries a shift count from 0 to 14. After the handshake, every window value the side sends is multiplied by 2 to that power, so windows can reach about 65,535 × 2¹⁴ = 65,535 × 16,384 ≈ 1.07 billion bytes, about 1 GiB.
Window scaling applies only if both SYNs carry the option, and each side picks its own shift. In the lab, both sides chose 7 (multiply by 128), which Linux selects from its maximum receive buffer. The shift can't change during a connection. The window value in a SYN itself is never scaled.
SACK Permitted and SACK
With cumulative ACKs alone, a receiver can only say "I have everything up to byte N". If one segment out of a window is lost, the sender doesn't learn which later segments arrived. Selective acknowledgment (RFC 2018) fixes this.
- SACK Permitted (kind 4) in both SYNs says both sides understand SACK.
- SACK (kind 5) then appears in ACKs and lists up to four blocks, each a start and end sequence number of data received beyond the cumulative ACK. With timestamps on, only three blocks fit in the 40 bytes.
The DSACK extension (RFC 2883) also uses SACK blocks to report duplicate data, which the simultaneous-open capture in article 59 showed. Article 66 shows SACK recovering losses, and article 67 shows DSACK detecting spurious retransmissions.
Timestamps and PAWS
The Timestamps option (kind 8, RFC 7323) carries two 32-bit values in every segment:
- TSval: the sender's timestamp clock when it sent this segment.
- TSecr (timestamp echo reply): the most recent TSval received from the other side.
Here are the first segments of the lab connection:
192.0.2.10 ··········S· TSval=3371768558 TSecr=0
198.51.100.10 ·······A··S· TSval=1056421721 TSecr=3371768558
192.0.2.10 ·······AP··· TSval=3371768580 TSecr=1056421721
198.51.100.10 ·······A···· TSval=1056421744 TSecr=3371768580
Each side's TSval is its own clock, and each TSecr echoes the other side's latest TSval. When the client's data segment arrives, the server echoes its TSval back. When that echo returns, the client knows exactly which transmission is being acknowledged and how long ago it was sent. The two uses are:
- RTT measurement. A sender can measure an RTT from every ACK, even for retransmitted data, because the echo identifies which transmission is being answered. Article 64 shows this feeding the timeout calculation.
- PAWS (Protection Against Wrapped Sequences). At 10 Gbit/s, the 32-bit sequence space wraps in under 4 seconds (2³² bytes × 8 = 34.4 Gbit, sent in 3.4 s), so an old delayed segment could carry a sequence number that's valid again. With PAWS, a receiver drops any segment whose TSval is older than the latest one it accepted. Timestamps work like an extension of the sequence number.
Linux's timestamp clock ticks once per millisecond. Note the increments above: the client's TSval rose by 24 between its SYN and its data, about 24 ms. Linux also adds a random offset per connection, so TSval reveals nothing about the host's uptime.
Timestamps cost 12 bytes in every segment, including padding. With them turned off on the client, its SYN shrank from 74 bytes on the wire to 66:
66 39212 → 8080 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 SACK_PERM WS=128
66 8080 → 39212 [SYN, ACK] Seq=0 Ack=1 Win=65280 Len=0 MSS=1360 SACK_PERM WS=128
Linux and macOS enable timestamps by default. Windows supports them but doesn't offer them in its own SYNs by default, so connections from Windows clients usually run without them.
User Timeout (UTO)
The User Timeout option (kind 28, RFC 5482) lets one side tell the other how long it's willing to wait for data to be acknowledged before giving up on the connection. It was meant for mobile hosts that might be disconnected for long periods. Few systems send it. Linux doesn't implement the option on the wire. Instead, Linux has a local socket option, TCP_USER_TIMEOUT, which limits how long this host retransmits unacknowledged data before failing the connection. Article 65 measures it.
TCP-AO: authenticating segments
A forged TCP reset can tear down a long-lived connection, which is especially damaging for BGP (Border Gateway Protocol) sessions, the long-lived connections over which networks exchange routes. The old defense, the TCP MD5 signature option (kind 19, RFC 2385), adds a keyed hash built with the old MD5 hash function to every segment. Its replacement, the TCP Authentication Option (TCP-AO, kind 29, RFC 5925), adds stronger algorithms, multiple keys and key rollover without dropping the connection. RFC 5925 formally obsoleted the MD5 option in 2010, but MD5 is still common on BGP sessions today, because both routers must support TCP-AO before a session can switch. New deployments should use TCP-AO where both ends have it.
TCP-AO protects only the TCP header and data from tampering; it doesn't encrypt anything. It's used almost exclusively between routers. Linux has supported it since version 6.7, through setsockopt() calls with TCP_AO_ADD_KEY, but only in kernels built with it. The lab kernel wasn't:
TCP_AO_ADD_KEY: [Errno 92] Protocol not available
For application traffic, use TLS, which encrypts as well as authenticates.
One more option you may see in the SYN of a phone or a recent Linux host is MP_CAPABLE (kind 30), the start of a Multipath TCP connection (MPTCP v1, RFC 8684), which can spread one connection over Wi-Fi and mobile data. Linux has supported it since version 5.6. Article 87 covers it.
TCP Fast Open (TFO)
A normal connection can't deliver data to the server application until the handshake completes, so every new connection costs one round trip before a request is even processed. TCP Fast Open (kind 34, RFC 7413) lets a client that has talked to the server before put data in the SYN, and the server deliver it to the application immediately.
The trick is a cookie. On the first connection, the client's SYN includes an empty Fast Open option, which is a cookie request. The server answers with a cookie, a value derived from the client's IP address and a server secret. On later connections, the client sends the cookie with data in the SYN. The server checks the cookie, which proves the client really is at that address and is not a spoofed SYN flood, and accepts the data.
The lab enabled TFO on both sides (net.ipv4.tcp_fastopen=3) and sent two short requests with sendto(..., MSG_FASTOPEN, ...). Both got answers:
reply: b'ok:GET-TFO'
reply: b'ok:GET-TFO'
The capture at the server (TFO=R is a cookie request, and TFO=C carries a cookie):
1 0.000000 cli → srv TCP 78 44824 → 8080 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 TFO=R
2 0.000068 srv → cli TCP 86 8080 → 44824 [SYN, ACK] Seq=0 Ack=1 Win=64704 Len=0 MSS=1360 TFO=C
3 0.024702 cli → srv TCP 73 44824 → 8080 [PSH, ACK] Seq=1 Ack=1 Win=64256 Len=7
5 0.025422 srv → cli TCP 76 8080 → 44824 [PSH, ACK] Seq=1 Ack=8 Win=64768 Len=10
9 0.408590 cli → srv TCP 93 44838 → 8080 [SYN] Seq=0 Win=64240 Len=7 MSS=1460 TFO=C
10 0.408646 srv → cli TCP 74 8080 → 44838 [SYN, ACK] Seq=0 Ack=8 Win=64704 Len=0 MSS=1360
11 0.408890 srv → cli TCP 76 8080 → 44838 [PSH, ACK] Seq=1 Ack=8 Win=64768 Len=10
The Fast Open options themselves:
192.0.2.10 ··········S· len=0 cookie=(none) (cookie request)
198.51.100.10 ·······A··S· len=0 cookie=7e52a72d2bcec785
192.0.2.10 ··········S· len=7 cookie=7e52a72d2bcec785
- Connection 1 (frames 1 to 5): an ordinary handshake. The client requested a cookie, the server returned one in its SYN-ACK, and the request (7 bytes) went out after the handshake.
- Connection 2 (frames 9 to 11): the SYN carried the cookie and the 7-byte request. The server's SYN-ACK acknowledged it (
Ack=8), and the server sent its reply in the next segment, before the client's handshake ACK even arrived. A full round trip was saved.
TFO has real limits. Data in a SYN may be delivered twice if the SYN is duplicated, so it's safe only for idempotent requests, ones where running them twice has the same effect as running them once, such as reading a page. Some middleboxes drop SYNs with data or unknown options, so Linux falls back to a normal handshake and remembers the failure. And a cookie is a stable identifier of the client, which raises privacy concerns for browsers. In practice, TLS 1.3's 0-RTT mode and QUIC (article 86) now deliver the same saving more widely.
Path MTU discovery with TCP
MSS only describes the two end links. If a smaller link lies in the middle, a full-sized segment won't fit. TCP sets the IP Don't Fragment bit on its segments (IPv6 never fragments in the network at all), so a router that can't forward a packet drops it and returns an ICMP message: Fragmentation Needed (IPv4, type 3 code 4) or Packet Too Big (ICMPv6), with the MTU of its next link. The sender lowers its segment size and resends. This is path MTU discovery (PMTUD).
In the lab, both end hosts had 1500-byte links, and router r1's link toward the client was set to MTU 1400. The server started sending 1448-byte segments. In the capture, TCP 1514 is the frame length: 1448 bytes of data plus 12 of timestamps, 20 of TCP, 20 of IP and 14 of Ethernet header:
6 0.028174 srv → cli TCP 1514 8080 → 51332 [ACK] Seq=1 Ack=3 Win=65280 Len=1448
7 0.028176 srv → cli TCP 1514 8080 → 51332 [PSH, ACK] Seq=1449 Ack=3 Win=65280 Len=1448
8 0.028261 srv → cli TCP 1514 8080 → 51332 [ACK] Seq=2897 Ack=3 Win=65280 Len=1448
...
15 0.028280 srv → cli TCP 1514 8080 → 51332 [PSH, ACK] Seq=13033 Ack=3 Win=65280 Len=1448
16 0.039387 r1 → srv ICMP 590 Destination unreachable (Fragmentation needed)
17 0.039420 srv → cli TCP 1414 [TCP Retransmission] 8080 → 51332 [ACK] Seq=1 Ack=3 Win=65280 Len=1348
18 0.039422 srv → cli TCP 1414 [TCP Out-Of-Order] 8080 → 51332 [PSH, ACK] Seq=1349 Ack=3 Win=65280 Len=1348
19 0.039424 r1 → srv ICMP 590 Destination unreachable (Fragmentation needed)
20 0.039425 r1 → srv ICMP 590 Destination unreachable (Fragmentation needed)
The router's ICMP message, decoded:
Type: 3 (Destination unreachable)
Code: 4 (Fragmentation needed)
MTU of next hop: 1400
The plot below shows the same transfer as sequence number against time: the first flight vanishes, and the resent data follows the ICMP message.

All ten 1448-byte segments of the first flight were dropped. As soon as the first ICMP message arrived, the server resent the lost data in 1348-byte segments (1400 − 20 − 20 − 12) and kept using that size. It also cached the discovered MTU for the destination:
192.0.2.10 via 198.51.100.1 dev eth0 src 198.51.100.10 uid 0
cache expires 599sec mtu 1400
The cache entry expires after 10 minutes, after which Linux tries the larger size again in case the path has changed. Here is every data segment the server sent, by size:
1 segments of 1036 bytes
5 segments of 1348 (retransmission) bytes
38 segments of 1348 bytes
10 segments of 1448 bytes
5 segments of 200 (retransmission) bytes
The ten lost 1448-byte segments (14,480 bytes) were resent in 1348-byte pieces, two old segments at a time: 2 × 1448 = 2896 = 1348 + 1348 + 200, which is where the five 200-byte retransmissions come from. tshark labeled some of the resent full-size segments "out-of-order" instead of "retransmission", so they're counted in the 38. The cost was one round trip for the first flight. That's the good case. The bad case is when the ICMP message never arrives, because a firewall drops ICMP: the big segments vanish silently, and the connection hangs after the handshake. That's a PMTUD black hole, and article 47 covers how to detect it and the modern fix, Packetization Layer PMTUD (PLPMTUD, RFC 4821 and RFC 8899), which probes with real segments instead of trusting ICMP. Linux's TCP implements it with net.ipv4.tcp_mtu_probing (0 = off by default, 1 = turn on after a black hole is detected, 2 = always).
Common questions
Is the MSS negotiated to the smaller of the two values?
No. Each side announces the largest segment it wants to receive, and the other side honors it. The two directions can use different limits: in the lab, the client announced 1460 and the server 1360. A sender is also limited by its own interface MTU, which is why the server, on its 1400-byte link, still sent only 1348-byte segments even though the client would have accepted more.
Can options be added after the handshake?
Options like SACK blocks and timestamps appear on every segment, but only if they were agreed in the handshake. MSS, window scale, SACK Permitted and Fast Open cookies can appear only in SYN segments.
Should I turn off timestamps to save 12 bytes?
Usually not. Timestamps give better RTT estimates and protect fast connections against wrapped sequence numbers. The overhead is under 1% for full-sized segments.
Why do I see wscale:7,7 in ss?
These are the window scale shift counts: first the one the peer sent (applied to windows it advertises), then this host's own. 7 means window values are multiplied by 128.
Does TCP Fast Open work with HTTPS?
It can carry the TLS ClientHello in the SYN, saving one round trip. It's rarely used that way on the public Internet, though, because of middlebox problems and privacy concerns. QUIC achieves 1-RTT and 0-RTT setup without needing TCP changes.
Why does my capture show segments bigger than the MSS?
Segmentation offload. The kernel hands the network card one large buffer (TSO, TCP segmentation offload, done by the card, or GSO, generic segmentation offload, done in software), and the card or driver splits it into MSS-sized segments. A capture on the sending host sees the large buffer. Similarly, a receiver may merge segments (GRO, generic receive offload) before the capture point. The lab turned offload off on the server to show the real sizes.
What happens if a SYN carries an option the server doesn't know?
The server ignores it and doesn't echo it in the SYN-ACK, so the client knows the feature is off. Problems arise only when a middlebox drops or rewrites such SYNs.
Summary
- Options follow the fixed header: kind, length and data, up to 40 bytes in total. Most are agreed in the SYN and SYN-ACK.
- MSS announces the largest segment a side will receive, per direction. Options such as timestamps reduce the data per segment: 1348 bytes on a 1400-byte MTU in the lab.
- Window Scale multiplies window values by 2 to the power 0 to 14, allowing windows of about 1 GiB.
- SACK lists blocks of out-of-order data received. Timestamps give per-segment RTT samples and PAWS protection.
- User Timeout is rarely sent, while Linux's
TCP_USER_TIMEOUTis a local setting. TCP-AO authenticates segments, mainly between routers. - TCP Fast Open uses a cookie so data in the SYN can be delivered immediately: in the lab, the second request was answered before the handshake finished.
- Path MTU discovery lowers the segment size when a router reports a smaller MTU. In the lab, one ICMP message cut segments from 1448 to 1348 bytes.
Practice questions
1. A host on a link with MTU 9000 (jumbo frames) sends an IPv4 SYN. What MSS does it normally announce?
Answer
9000 − 20 (IPv4 header) − 20 (TCP header) = 8960 bytes.
2. A SYN carries Window Scale with shift 9, but the SYN-ACK carries no Window Scale option. How are window values interpreted afterwards?
Answer
Without scaling in either direction. Window scaling is used only if both SYNs carry the option. Both sides use unscaled 16-bit windows, limiting each to 65,535 bytes.
3. Why can't four SACK blocks fit in a segment that also carries timestamps?
Answer
Options are limited to 40 bytes. Timestamps take 10 bytes plus 2 bytes of NOP padding, leaving 28. A SACK option with n blocks takes 2 + 8n bytes, so only 3 blocks (26 bytes) fit, not 4 (34 bytes).
4. How do timestamps make RTT measurement possible for a retransmitted segment?
Answer
The retransmission carries a new TSval. The ACK echoes that TSval in TSecr, so the sender knows the ACK answers the retransmission, not the original, and can compute the RTT from the time that TSval was sent. Without timestamps, the ACK is ambiguous, and Karn's algorithm says not to use it (article 64).
5. In the TFO capture, the server's second SYN-ACK had Ack=8. What does that acknowledge?
Answer
The SYN (one sequence number) plus 7 bytes of data carried in the SYN: 0 + 1 + 7 = 8. The server accepted the request data before the handshake completed.
6. A user can open a website's front page, but larger pages hang forever after the connection opens. ICMP is blocked by a firewall on the path. What's the likely cause, and two fixes?
Answer
A path MTU black hole: full-sized segments are dropped at a smaller link, and the ICMP message that would tell the sender is blocked. Fixes include allowing ICMP "fragmentation needed" or "packet too big" through the firewall, clamping the MSS on the router at the small link, or enabling packetization-layer PMTUD (tcp_mtu_probing) on the sender.
Previous: Opening and Closing TCP Connections: The Three-Way Handshake, FIN and Half-Close

More in TCP/IP Course
Quiz: TCP/IP Delicate Details
Twenty-five questions on the details that catch out experienced engineers: sequence numbers for SYN and FIN, TIME_WAIT versus tcp_fin_timeout, Karn's algorithm, socket buffer doubling, even and odd ephemeral ports, IPv6 checksums and fragmentation, negative DNS caching, and capture filter traps.
Quiz: TCP/IP Interview Questions
Thirty-three networking questions of the kind asked in developer, SRE and network engineering interviews: what happens when you load a URL, TCP versus UDP, handshakes, closing and TIME_WAIT, subnetting, NAT, DNS, MTU problems, congestion, TLS and QUIC, and debugging slow or failing connections.
Quiz: TCP/IP Course Final Exam (All Parts)
The final exam for the TCP/IP course: thirty questions across all fourteen parts, from packets and addressing through Ethernet, ARP, IP, DHCP, NAT, ICMP, UDP, DNS, TCP connections, reliability, congestion control, security, QUIC and troubleshooting.
Quiz: Modern Transports and Troubleshooting (TCP/IP Part 14)
Review modern transports and troubleshooting: QUIC packets, handshakes, 0-RTT, streams and connection migration, HTTP/3, Multipath TCP, SCTP multihoming, and a layered method for diagnosing real network faults.
Discussion
Sign in to ask a question or share what you learned.