IP fragmentation is a process that breaks up IP packets into smaller pieces so they can travel through a network with a frame length that is more diminutive than the original IP packet. This is done in routers, and the head part of the real IP packet is duplicated with small changes to each of the fragments. If 1 of the fragments is excluded, the actual datagram should be fragmented likewise and resent. Let’s take a closer look at how IP fragmentation works!
MAC addresses are unpredictable and may be hazardous. A few firewalls and content controls might reject them, adding complexity to routers that are optimized for fast-speed packet transmission rather than fragment generation and reassembly. Maximum Segment Size messages are used to determine the maximum size of the frame that can be transmitted without being fragmented. For IP-related information read our guide on how to find your IP address.
What is the best definition of IP fragmentation?
If a host ships an IP packet onto the network, it must be smaller than the greatest size permitted by that regional network. Because this is the largest size, it’s dependent on the data link and (MTUs), which are generally exact. A typical Ethernet-based company, institute, or data center network might have a 1500-byte MTU.
Packets that are originally sent through a network with one MTU, however, may need to be transferred across networks (such as wide area networks or virtual private networks) with a more diminutive MTU. If the packet size is greater than the lower MTU, the information in the packet should be fragmented. This indicates that the packet is divided into multiple unique packets that are identical to or more diminutive than the more inferior MTU. This is referred to as Fragmentation, and the information in each piece is subsequently reassembled when it arrives at its destination.
Fragmentation permits for;
- To minimize overheads, the above-mentioned basic transport protocols need to be unaware of the network architecture beneath.
- Without the need and overhead of lower-layer protocols, IP can also be used to connect across variable and divergent network paths and media.
Fragmentation has several drawbacks, the most significant of which is that it must be handled manually. It’s avoided where feasible because of the following reasons:
- When a single piece is lost, the remaining fragments must be resent, and a secure transport layer protocol such as TCP must be used (after all, the sender resends 1 packet before fragmenting occurs again).
- The 1st fragment’s higher-layer headers should only be inspected by firewalls, middle-boxes, and VPN routers that employ these headers to function (i.e., NAT capability).
- Fragmentation can cause out-of-order package delivery, which necessitates.
The IP is a 32-bit number that specifies a network on a computer. An IPv4 address is most often mentioned in decimals, with four 8-bit segments separated by dots. Each 8-bit field denotes a single byte of the IPv4 address.
IPV4 Header fields
Fragmentation and reassembly entail several IP header fields being formed in the fragments. All of your contact information should be specified in the same order. The following is a summary of all of the fields and their sequence, with fragmentation headers highlighted:
The following IP header fields are affected by fragmentation:
- The IMSI identifies the subscriber, which might be verified by the source or destination mobile station. The actual packet’s Protocol field significance is used in this process to distinguish between extra packets (from the exact reference). Because the exact ID must not be utilized when fragmenting packets with the identical source, goal, and protocol, it does not imply that the same ID must be utilized when they have different sources, destinations, or protocols. If this is not made clear, consider the scenario in which 3 packets are transmitted from host A to B and must be divided into 4 fragments:
- This means that, in the 1st packet, four sections will be assigned the exact Title field value.
- The 4 fragments of the 2nd packet will have the exact Identification area value, which will be distinct from that utilized with the shards derived from the first packet.
- The four fragments of the third packet will have the exact Identification area value, which will be distinct from the value used with the fragments produced from the 1st and 2nd packets.
- The value of the Don’t Fragment (DF) flag remains unset. Unlike the actual packet, the 1st, reserved bit of the Flags area (three bits), will be (unset) 0.
- The 3rd bit of the field, More Fragments, will be set to 1 in all but the last fragment, not like the prior packet. Each packet in the last stream includes all bits in this field set to 0, just like the first (unless it was a fragment). If the Don’t Fragment flag was clear in the actual packet, this stops fragmentation and causes packets that need it to be discarded. Send an ICMP error of type 3: ‘Destination Unreachable’, code 4: ‘Fragmentation required, and DF set’ to the sender. For additional information on this, see the following PMTUD section.
- The Fragment Offset (13 bits) indicates the beginning position of the data in the fragment in reference to the beginning of the data in the earliest packet. When the data is reassembled from all of the fragments, this information will be utilized to put everything back together. The offset in this first fragment is zero since the data in this packet begins at the same spot as the information in the real packet (in the start). The offset of the data in the current fragment from the start of the information in the 1st fragment is represented by delta N. In subsequent segments, delta N represents an 8-byte ‘block’ (or octaword) offset. If an 800-byte packet is divided into 2 equivalent fragments with 400 bytes of information each, the first fragment’s offset is 0 and the second one is 50 (400/8). The offset value should be the numeral of 8-byte blocks of data, which implies that the data in the preceding fragment should be a multiple of 8 bytes. The final segment can transmit data that isn’t a multiple of 8 bytes because there will be no subsequent fragment with an offset that should follow the ‘rule.’
Let’s go via an instance of a 1440-byte package that should be routed via a dedicated interface with 576 bytes MTU. Assume the IP packet contains a 20-byte IP header, which is the minimal feasible size. The original packet has 1440 bytes of data. The subsequent fragments are made with fields and sizes as shown below:
- The field of an ID digit has been entered in the Identification area.
- The Don’t Fragment, No-Fragment, and More Fragments flags are all set to 0. The Flags field has a value of 001 in binary: meaning the message is not fragmented.
- The same ID number is used for both the first fragment and this section.
- If the Don’t Fragment bit is not set, if the indicator was reserved, and if there’s a More Fragments Flag of 1 in the Flags field, written as ## That means they’re compatible.
3rd & Final Fragment
- The same ID number was used for the first and second fragments, so both of these fields were left blank.
- The Don’t Fragment flag isn’t set and the More Fragments flag is zero in the Flags field, which is written in binary: 000
- The Fragment Offset field is set to 138 (1104/8), which is translated as 0 0000 1000 1010 in binary.
Setting the Don’t Fragment (DF) flag in a packet to a value of 1 on a node can prevent packets from being fragmented. Containers that should be fragmented but hold the DF bit cleared are ignored. The following PMTUD chapter discusses this in further depth.
The way IP fragmentation works with IPv6 differs significantly from that of IPv4, although the majority of the header fields continue to have the same function. In contrast to IPv4:
- The source host is the only one that can be fragmented, therefore a packet may only be broken down once and it’s not done by routers or other network devices. As a result, the forward fragmentation model of IPv4, in which the original packet is fragmented where required and the data it contained is retained and sent to the target, is reversed.
- It’s as simple as not doing it. There is no DF flag.
Let’s take another look at how to route an IPv6 packet with a 1440-byte payload via an interface with an MTU of 1280 bytes. Let’s accept the least feasible IPv6 title length of 40 bytes, which implies that the actual packet includes 1400 bytes of information. The sizes and fields are as follows:
- This packet, with a UDP Port of 5554 and Data Length of 160, has a Payload Length value of 1240 because the Fragment Header extension header is 8 bytes long. This packet contains 1232 bytes of data, with 168 digits remaining.
- The value of the Next Header field (in the conventional header) is 44. The value of the Next Header field (in the extension header) is 6, signifying that TCP is being used at the transport layer.
- The first fragment has no offset, so the Fragment Offset field is set to zero.
- An ID number has been entered in the Identification field.
2nd & Final Fragment
- Because the Customer-ID and Session-ID values are both 112, the Payload Length field value of 176 indicates that this packet contains 168 bytes of data.
- The value of the Next Header field in an HTTP header (in the normal header) is 44.
- The next-generation extension header’s Last Expected Value (in the extension header) is 6
- The Fragment Offset value is set to 154 (1232/8) in the Fragment Offset field.
- Because there are no more fragments, the game will automatically generate a 0-M flag.
- The Identify field is populated with the same ID number as was used for the first fragment.
Frequently asked questions
What are the disadvantages of IP fragmentation?
- Fragmentation, in general, can cause a slew of issues:
- Chances of Application layer loss.
- Some networks, however, cannot handle fragmented transmissions.
- Spacing may disrupt re-ordering.
- Fragmentation may produce perplexing actions that are hard to find.
What is the use of IP fragmentation?
Fragmentation allows for transport layer protocols to be oblivious of the underlying network architecture, leading to reduced overhead.
We made this IP Fragmentation guide for our valuable readers in order to provide them with information regarding IP fragmentation and its categories. In this guide, we have mentioned some inner details about IP fragmentation actually works in the internet world and which part of the IP address carries what information.