3 ms·
TCP overhead does indeed increase as MTU decreases, but not because "TCP needs to keep track of packets" -- TCP in fact keeps track of bytes, not packets. Th
by drewg123 8y ago
TCP overhead does indeed increase as MTU decreases, but not because "TCP needs to keep track of packets" -- TCP in fact keeps track of bytes, not packets. The reason that overhead is larger for smaller MTUs is simply because of the extra per-packet overheads (looking up connections, allocating memory for ethernet/ip packet headers, (uncontended) locking, repeated function calls to L3/L2 network layers and network drivers, etc).
The fact that TCP tracks bytes rather than packets enables hardware offloads like TSO/LSO (TCP Segmentation Offload, known by some as TCP Large Send) and LRO (Large Receive Offload). TSO allows TCP to treat the effective MTU as large on the transmit side, and to send a single large packet (up to 64K everywhere but windows LSOv2) down to the network card, which then segments it into 1500 byte chunks.
Similarly, on the receive side, LRO can make a small MTU appear large to TCP by transparently merging adjacent TCP segments into one much larger packet which is then passed to TCP. This can be done in hardware or software. Linux calls this GRO.