What happens when an IP packet is larger than the network MTU?
Interview preparation resource from Gate Smashers.
If an IP packet is larger than the MTU of the next link, it cannot be forwarded unchanged. In IPv4, it may be fragmented if fragmentation is allowed; if the Don't Fragment (DF) flag is set, the router drops it and typically sends an ICMP message to the source. In IPv6, routers never fragment transit packets: they drop an oversized packet and send an ICMPv6 Packet Too Big message. The sender should then reduce packet size, commonly using Path MTU Discovery and, for TCP, an appropriate MSS.
MTU and oversized packets
The Maximum Transmission Unit (MTU) is the largest IP packet a particular link can carry without fragmentation. Because links along a path can have different MTUs, a packet that fits one link may be too large for a later link.
When a router receives a packet larger than the MTU of its outgoing link, it must fragment it when permitted or discard it and notify the source when possible.
IPv4 behavior
In IPv4, a source or router may fragment an oversized packet into smaller IP fragments when the Don't Fragment (DF) flag is not set. Each fragment is forwarded independently, and the destination host reassembles the original packet.
If DF is set, a router must not fragment the packet. It drops the packet and typically returns an ICMP Destination Unreachable message with the fragmentation-needed indication, allowing the sender to reduce its packet size.
- Cost of fragmentation: Fragments add header overhead, and loss of any fragment prevents successful reassembly of the original packet.
IPv6 behavior
IPv6 routers do not fragment transit packets. If a packet exceeds the outgoing-link MTU, the router discards it and sends an ICMPv6 Packet Too Big message to the source.
The source must send smaller packets. IPv6 allows fragmentation only by the source, using an IPv6 Fragment extension header; the destination performs any required reassembly.
Path MTU Discovery and TCP
Path MTU Discovery (PMTUD) helps a sender determine the largest packet size that can traverse the complete path without fragmentation, using information such as ICMP or ICMPv6 too-big messages.
TCP normally selects a Maximum Segment Size (MSS) intended to keep TCP segments within the expected IP path MTU, reducing the need for fragmentation.
