Every lower-layer technology used to transport IPv6 datagrams has some limitation regarding the packet size. It is called MTU (Maximum Transmission Unit). If the IPv6 datagram is longer than the MTU, its data must be divided up and inserted into set of smaller IPv6 datagrams, called fragments. These fragments are than transported individually and assembled by the receiver to create the original datagram. This is fragmentation.
Every fragment is an IPv6 datagram carrying part of the original data. It is equipped by a Fragment extension header containing three important data fields:
- Identification is unique for every original datagram. It is used to detect fragments of the same datagram (they are holding identical identification values).
- Offset is the position of data carried by current fragment in the original datagram.
- More fragments flag announces if this fragment is the last one or if another fragment follows.
The receiving node collects the fragments and uses Identification values to group the corresponding fragments. Thanks to the Offsets it is able to put them in the correct order. When it sees that the data part is complete and there are no more fragments left (it receives the fragment identifying that no more fragments follow), it is able to reconstruct the original datagram.
The main benefit of fragmentation is that it allows the transportation of datagrams which are larger than the what the lower-layer technology can transport. The main drawback is the performance penalty. The datagram assembly at the receiver’s side is a complicated procedure requiring some buffers to collect the fragments, some timers (to limit the reassembly time and free buffers from obsolete fragments) and so on. It lowers the reliability of the datagram connection because if one single fragment is lost, whole original datagram is doomed.
Because of this, fragmentation is often seen as an undesirable entity. By contrast to IPv4 (which is quite willing to fragment) IPv6 tries to minimise it by means of some restrictions and requirements:
- Minimum allowed MTU on IPv6 supporting links is 1280 Bytes (1500 Bytes is recommended). It decreases the need for fragmentation.
- Only the sender is allowed to fragment a datagram. If some intermediate node needs to forward it through a line with insufficient MTU, it must drop the datagram and send an ICMP message to the sender announcing the datagram drop and the MTU which inflicted it.
- Every node has to watch the path MTU for all its addressees to keep the communication as efficient as possible.
Path MTU is the minimal MTU along the route between the sender and destination of the datagram. This is the largest datagram size deliverable along the given route. Datagrams of this size should be sent if possible, because they are the most efficient (lowest overhead/data ratio).
Path MTU is based on ICMP messages announcing datagram drops due to the insufficient MTU size. The algorithm to calculate it is simple: the MTU of outgoing link is used as the first estimation. The sender tries to send a datagram of this size and if it obtains an ICMP message reporting smaller MTU, is decreases the value and tries again until the destination address is reached.
From a theoretical point of view the path MTU is flawed because the routing is dynamic, so the paths are changing and every next datagram can be delivered through a different route. In practice however, the routing changes are not so frequent. If the path MTU drops due to a routing change, the sender is informed immediately by obtaining ICMP error message and so it lowers the path MTU value.
