What is TCP window scaling and large receive offload?
Answer
The original TCP header uses a 16-bit receive window field — maximum 65,535 bytes. On high-bandwidth, high-latency links (high BDP — Bandwidth-Delay Product), this limits throughput severely. Example: 100 Gbps link, 100ms RTT — optimal window is 100 Gbps × 0.1s = 10 GB, far exceeding the 64 KB limit. TCP Window Scaling (RFC 1323) adds a scaling factor (0-14) negotiated during the 3-way handshake, allowing windows up to 1 GB (65535 × 2^14). Enabled by default in modern OS. Large Receive Offload (LRO) and Generic Receive Offload (GRO) are NIC and OS features that aggregate multiple incoming TCP segments into a single larger packet before passing to the kernel — reducing CPU overhead for high-throughput workloads. TCP Segmentation Offload (TSO) allows the OS to send large segments; the NIC splits them into MTU-sized pieces — reducing CPU cycles. These optimizations are critical for achieving 10/40/100 Gbps network throughput on servers without saturating CPUs.