TCP MSS and Window Scaling
MSS caps the payload each TCP segment carries, and window scaling multiplies the advertised receive window beyond 64KB so long fat networks can actually be filled with data.
Definition
Maximum Segment Size is the largest amount of payload bytes per segment negotiated at handshake, derived from the path MTU minus headers. Window scaling is a TCP option multiplying the 16-bit window field so bandwidth-delay products of megabytes can be advertised. Together they set how efficiently a connection fills high-capacity, high-latency paths.
Context and scope
Tuned for long-haul bulk transfer, database replication over WAN, VPN tunnels, and any pipeline where throughput sits far below link capacity.
Common misconceptions
- MSS is the same everywhere — it derives from each interface MTU and is clamped by middleboxes and tunnels
- The receive window is capped at 64KB — the scale factor extends it to gigabytes when negotiated
- Throughput problems are bandwidth problems — undersized windows cap throughput far below the physical link
Anti-patterns
- Sending full-MSS segments through a tunnel that adds encapsulation headers and suffering silent fragmentation
- Disabling window scaling on security appliances and silently capping every flow to 64KB windows
- Diagnosing WAN throughput with ping instead of measuring achieved goodput against bandwidth-delay product
Related concepts
Related examples
Authoritative source
https://www.cloudflare.com/learning/cdn/glossary/maximum-segment-size-mss/
What it is
Two handshake parameters dominate bulk throughput. MSS decides the largest data unit per segment, interacting with the path MTU. The window scale factor multiplies what the receive window field can express. Without scaling, a 100-megabit-per-second path with 50 milliseconds RTT cannot be filled, because the required window exceeds the 16-bit limit.
How it works
Each side announces MSS based on its MTU, and middleboxes may rewrite it to force smaller segments. The scale option, sent once in the SYN, shifts the window field by up to 14 bits. Receive buffers must actually be sized to the resulting window or the kernel limits throughput to buffer size over RTT.
When to care
Cross-region backups, replication, and large-object transfers are MSS and window problems in practice. Cloud VMs often ship with conservative buffer sizing; container networking can silently add overhead that forces clamping. Compare goodput against theoretical bandwidth-delay product to spot the gap.
Pitfalls
Encapsulation shrinks effective MSS; if endpoints do not account for tunnel headers, packets fragment or drop black-holed. Some paths drop TCP options entirely, degrading to no scaling. Tuning buffers upward helps only until the sender congestion window or the application write pattern becomes the limiter.