What is MTU, and what happens when a packet is bigger than it?
MTU is the largest packet a link can carry; Ethernet's is usually 1500 bytes. IPv4 routers may split a bigger packet into fragments, or drop it and send an ICMP message if the Don't Fragment bit is set. IPv6 routers never fragment.
Explain it simply
A lift in a hostel has a weight limit. If your trunk is too heavy, either you carry it up in smaller bags (fragmentation), or the lift operator refuses it and tells you to repack (drop plus ICMP message).
Example
Ethernet MTU 1500 bytes (IP packet size, excluding Ethernet header)
IPv4 header 20
TCP header 20
Largest TCP payload (MSS) = 1500 - 20 - 20 = 1460 bytesSuppose a 4000-byte IPv4 packet meets a link with MTU 1500. Each fragment carries up to 1480 bytes of data (1500 minus a 20-byte header, and 1480 is divisible by 8 as required). That gives 1480 + 1480 + 1020 = 3980 bytes of data, since the original 4000 bytes included a 20-byte header. Three fragments are sent, and only the destination reassembles them.
Modern hosts avoid fragmentation by setting DF and using Path MTU Discovery: a router replies with ICMP "fragmentation needed", and the sender lowers its packet size. VPNs and tunnels add headers, so they often need a lower MTU, such as 1420.
What to say in the interview
"MTU is the maximum packet size on a link, 1500 on Ethernet. TCP's MSS is derived from it, 1460 for IPv4. If a packet is too big, IPv4 can fragment it, or with DF set the router drops it and returns an ICMP message, which is how Path MTU Discovery works. IPv6 leaves fragmentation to the sender."
Common mistakes
- Blocking all ICMP on a firewall, which breaks Path MTU Discovery and causes hangs on large transfers.