The IP protocol family was designed to use a wide variety of transmission links. The maximum IP packet length is 65000 bytes.
Most transmission links enforce a smaller maximum packet length limit, called the maximum transmission unit (MTU), which varies
with the type of the transmission link. The design of IP accommodates link packet length limits by allowing intermediate routers
to fragment IP packets as necessary for their outgoing links. The final destination of an IP packet is responsible for reassembling
its fragments as necessary.
All TCP sessions are bounded by a limit on the number of bytes that can be transported in a single packet, and this limit
is known as the maximum segment size (MSS). TCP breaks up packets into chunks in a transmit queue before passing packets down
to the IP layer. A smaller MSS may not be fragmented at an IP device along the path to the destination device, but smaller
packets increase the amount of bandwidth needed to transport the packets. The maximum TCP packet length is determined by both
the MTU of the outbound interface on the source device and the MSS announced by the destination device during the TCP setup
process.
Path MTU discovery (PMTUD) was developed as a solution to the problem of finding the optimal TCP packet length. PMTUD is an
optimization (detailed in RFC 1191) wherein a TCP connection attempts to send the longest packets that will not be fragmented
along the path from source to destination. It does this by using a flag, don’t fragment (DF), in the IP packet. This flag
is supposed to alter the behavior of an intermediate router that cannot send the packet across a link because it is too long.
Normally the flag is off, and the router should fragment the packet and send the fragments. If a router tries to forward an
IP datagram, with the DF bit set, to a link that has a lower MTU than the size of the packet, the router will drop the packet
and return an ICMP Destination Unreachable message to the source of this IP datagram, with the code indicating "fragmentation
needed and DF set." When the source device receives the ICMP message, it will lower the send MSS, and when TCP retransmits
the segment, it will use the smaller segment size.