Fragmentation
The IP-level datagram must be encapsulated in a lower network level packet to travel in the network. The ideal case could be considered to be that in which a network header is added to the datagram and is sent through the same network. In the real case, the size of the packet of the network can vary greatly and can be smaller than the size of the IP datagram, so it is necessary to fragment the IP datagram in several pieces to send it through the network. This is where it is necessary to introduce the concept of maximum transfer unit (MTU), which is the maximum size of a packet that can be transferred by a specific network. To approach this problem, the size of the IP datagram could have been limited to the smallest MTU of the networks, but this system would be highly inefficient in networks where a larger sized packet were admitted. Really, the solution consists in, on the one hand, choosing a suitable packet size, and, on the other, designing how to divide the datagram in fragments when it is necessary. The gateways undertake this fragmentation, and the rules for the fragmentation are as follows: • The size of the resulting fragments must be a multiple of an octet so that the data displacement records, offset, within the datagram are done correctly. • The sizes of the fragments are freely chosen (i.e., the initial size does not have an influence and the resulting fragments can be of differing lengths). • The gateways must accept datagrams with a greater size than that of the network they are connected to. This is so larger datagrams can be admitted to the network, although they must be fragmented to travel in it. • The hosts and gateways must handle datagrams larger than 576 octets. Each fragment has the same format as the original datagram, which means that the fragments generated will have a header that is the same as the original datagram, except for a series of differences explained next. The data of each fragment will be made up of fragments of the original datagram’s data. The size of each fragment will be limited by the MTU of the network where they are going to be sent. We will now look at the differences between the header of the original datagram and those of its fragments. If we consider that the original datagram has been divided into N fragments, the first N−1 fragments will have the MF flag set to 1 and the fragment N will have this flag set to 0, indicating that there are no more fragments. The fragment offset field is used to indicate, when the datagram is a fragment, which position in the original datagram the data are located. The fragmentation is always done in multiples of eight bytes, which is the elemental unit of fragmentation. Thanks to this, the field requires only 13 bits instead of the 16 that would be necessary if bytes were counted. Of the 3 bits saved, two are used in the DF and MF flags and the third is not used. Note that the entity that must reassemble the datagram would have no way of knowing its total length if it were not for the last fragment with its fragment offset and total length fields, which permit it to know the total length of the datagram. In both cases, the identification field, along with the datagram source address, allow the gateway/destination to know which arriving fragments belong to which datagrams. At this stage we ask the following question: Who must reassemble the fragmented datagram? There are two options: The first is that the first gateway receives the fragments at the next routing point of the Internet; the second option is that the reassembly is done by the destination host of the original datagram. The disadvantages of the second option, which is implemented in practice, are first that the fragments can cross networks with a greater MTU without taking advantage of its capacity to transmit larger sized packets. Second, it is obvious that if one fragment of a datagram is lost, the whole datagram is lost. In spite of this, the system works well and has the advantage that the intermediate gateways do not need to store and reassemble packets, which means the gateways are simpler and require less capacity. Finally, there is another interesting aspect to deal with related to the way the MF bit is propagated if it is necessary to further fragment the datagram’s fragments. It is done in a very simple way. For all of the fragments with the MF bit at 1, all its fragments have this bit set at 1. On the contrary, when a fragment is received with the MF bit at 0, this bit is set at 1 for all the fragments except the last one, which is set to 0.Once the fragments arrive at a destination address, they must be reassembled. For this, the IP software must have a system implemented such that: • It enables the rapid insertion of the fragment in the group. As the fragment offset field of the fragments refers to the original datagram, space can easily be reserved for each fragment. • It must have an efficient test of the whole datagram. • It must quickly eliminate the stored fragments if they surpass the maximum time of reassembly. If at a particular moment the fragment storage capacity is exceeded, all of the fragments are discarded. This is done because one lost fragment makes it impossible to obtain the whole datagram; in this way, space is liberated for other datagrams to be reassembled.
656 times read
|