IP Fragmentation

Under UDP, the physical network layer will usually impose a upper limit on the size of the frame that it is able to transmit. So whenever the IP layer receives a data packet to send, it will first check on which interface the datagram is being sent on then queries the interface to find the MTU. IP layer then compares the MTU with the actual size of the datagram and will perform fragmentation if it’s required. This can take place at either the original host or on an intermediate router if needed.

So what happens when an IP packet is fragmented? Well firstly you should remember that it won’t be reassembled until it reaches it’s destination. This process is performed by the IP layer on the destination device, which is designed to make the process invisible to the transport layer (TCP and UDP). This is the case although there is obviously some degradation in speed obviously. All the information required for this process is maintained in the IP header.

This helps detects data which is misent, for example missing or incorrectly routed. For example once whilst troubleshooting an issue like this, I found a router setup with a host of incorrect static routes. Important parts of data where being routed through to a French server via a VPN connection like this. It was only identified when users couldn’t watch the BBC iPlayer because they were recorded as being from a French address – see here for details.

So what fields are used from the IP header to assist in the fragmentation process? Well the IP header contains a unique value for each IP datagram which is transmitted by the sender this is known as the ‘identification’ field. The ‘flags’ field is used to identify the fragmentation by using one bit to indicate there are ‘more fragments’. This bit is always turned on except for the final fragment so it is used to identify the end. Also one of the bits in the ‘flags’ field is called the ‘don’t fragment’ bit. If this is turned on then IP will not fragment the datagram at all.

It’s important to remember that when an IP datagram is fragmented, each individual fragment becomes it’s own packet. This means that each has it’s own IP header and is routed completely independently of any other packets. Therefore it is entirely possible for the fragments to arrive at their destination in completely the wrong order. This is why the various fields in the header are so important, they ensure there is enough information to reassemble the fragments in the correct order.

John Coates, Expert on Residential VPN Services, Haber Press and Publishing, 2012