What

  • MTU
    • Maximum Transmission Unit
    • maximum payload length
    • defined in datalink layer (layer 2)
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
  • MSS
    • Maximum (TCP) Segment Size
    • Used in TCP
    • MTU - (TCP header + IP header) = MSS

image.png

Why MTU

  • Why: frame can not be infinitely large (hard to buffer, process and determine timeout, high loss penalty).
  • Larger MTU is associated with reduced overhead. Smaller MTU values can reduce network delay.
    • Large MTU: packet carries more payload, while protocol overheads, such as headers or underlying per-packet delays, remain fixed. Overall lower overhead.
    • Small MTU: improved network Congestion Control in layer 2, because it is less likely to retransmit.
  • Why 1500: historical reason / tradeoff / compatibility issue with middle-box.
    • What if packet size > 1500: mostly dropped
    • When will packet size > 1500: in VPN or overlay network such as VXLan

How

  • How TCP (layer 4) knows the size of MTU (layer 2)
  • How to guarantee the packet size is no larger than MTU
    • breaks packets into smaller pieces
      • For TCP (layer 4): MSS Announcement
      • For UDP (layer 4): It doesn’t care, packet size is handled by the protocol (such as QUIC, DNS). Leaky abstraction.
      • For IP (layer 2): Fragmentation (generally a bad thing)