#What is meant by IP fragmentation?
The breaking up of a single IP datagram into two or more IP datagrams of smaller size is called IP fragmentation.
#Why is an IP datagram fragmented?
Every transmission medium has a limit on the maximum size of a frame (MTU) it can transmit. As IP datagrams are encapsulated in frames, the size of IP datagram is also restricted. If the size of An IP datagram is greater than this limit, then it must be fragmented.
#Which RFCs discuss IP fragmentation?
RFC 791 & RFC 815 discusses about IP datagrams, fragmentation and reassembly.
#Is it possible to select an IP datagram size to always avoid fragmentation?
It is not possible to select a particular IP datagram size to always avoid fragmentation, as the MTU for different transmission It is possible, though, for a given path to choose a size that will not lead to fragmentation. This is called Path MTU Discovery and is discussed in the RFC 1191. The TCP transport protocol tries to avoid fragmentation using the Maximum Segment Size (MSS) option.
#Where an IP datagram may get fragmented?
An IP datagram may get fragmented either at the sending host or at one of the intermediate routers.
#Where are the IP datagram fragments reassembled?
The IP fragments are reassembled only at the destination host.
#How to prevent an IP datagram from being fragmented?
A IP datagram can be prevented from fragmentation, by setting the "don't fragment" flag in the IP header.
#What happens when a datagram must be fragmented to traverse a network, but the "don't fragment" flag in the datagram is set?
The datagram whose "don't fragment" flag is set is discarded, if it must be fragmented to traverse a network. Also, an ICMP error message is sent back to the sender of the datagram.
#Will all the fragments of a datagram reach the destination using the same path?
The different fragments of the same IP datagram can travel in either in the same path or in different paths to the destination.
#Will all the fragments of a datagram arrive at the destination system in the correct order?
The different fragments of a single IP datagram can arrive in any order to the destination system.
#What happens to the original IP datagram when one or more fragments are lost?
When one or more fragments of an IP datagram are lost, then the entire IP datagram is discarded after a timeout period.
#What is the minimum size of an IP fragment?
The minimum size of an IP fragment is the minimum size of an IP header plus eight data bytes. Most firewall-type devices will drop an initial IP fragment (offset 0) that does not contain enough data to hold the transport headers. In other words, the IP fragment normally need 20 octets of data in addition to the IP header in order to get through a firewall if the offset is 0.
#What are the limitations on the size of a fragment?
The size of an IP datagram fragment is limited by
The amount of remaining data in the original IP datagram
The MTU of the network and
Must be a multiple of 8, except for the final fragment.
#How is an IP datagram fragment differentiated from a non-fragmented IP datagram?
A complete IP datagram is differentiated from an IP fragment using the offset field and the "more fragments" flags. For a non-fragmented IP datagram, the fragment offset will be zero and the "more fragments" flag will be set to zero.
#How are the fragments of a single IP datagram identified?
The "identification" field in the IP header is used to identify the fragments of a single IP datagram. The value of this field is set by the originating system. It is unique for that source-destination pair and protocol for the duration in which the datagram will be active.
#How is the last fragment of an IP datagram identified?
The last fragment of an IP datagram is identified using the "more fragments" flag. The "more fragment" flag is set to zero for the last fragment.
#How is the length of a complete IP datagram calculated from the received IP fragments?
Using the fragment offset field and the length of the last fragment, the length of a complete IP datagram is calculated.
#How is an IP datagram fragmented?
In the following example, an IP datagram is fragmented into two. This same algorithm can be used to fragment the datagram into 'n' fragments.
The IP layer creates two new IP datagrams, whose length satisfies the requirements of the network in which the original datagram is going to be sent.
The IP header from the original IP datagram is copied to the two new datagrams.
The data in the original IP datagram is divided into two on an 8 byte boundary. The number of 8 byte blocks in the first portion is called Number of Fragment Blocks (NFB).
The first portion of the data is placed in the first new IP datagram.
The length field in the first new IP datagram is set to the length of the first datagram.
The fragment offset field in the first IP datagram is set to the value of that field in the original datagram.
The "more fragments" field in the first IP datagram is set to one.
The second portion of the data is placed in the second new IP datagram.
The length field in the second new IP datagram is set to the length of the second datagram.
The "more fragments" field in the second IP datagram is set to the same value as the original IP datagram.
The fragment offset field in the second IP datagram is set to the value of that field in the original datagram plus NFB.
#How a destination system reassembles the fragments of an IP datagram?
When a host receives an IP fragment, it stores the fragment in a reassembly buffer based on its fragment offset field.
Once all the fragments of the original IP datagram are received, the datagram is processed.
Upon receiving the first fragment, a reassembly timer is started.
If the reassembly timer expires before all the fragments are received, the datagram is discarded.
#What fields are changed in an IP header due to fragmentation?
The following IP header fields are changed due to IP fragmentation:
Total Length
Header Length
More Fragments Flag
Fragment Offset
Header Checksum
Options
#What happens to the IP options field when an IP datagram is fragmented?
Depending on the option, either it is copied to all the fragments or to only the first fragment.
#Which IP options are copied to all the fragments of an IP datagram?
If the most significant bit in the option type is set (i.e. value one), then that option is copied to all the fragments. If it is not set (i.e. value zero), it is copied only to the first fragment.
1. What is IP fragmentation?
IP fragmentation is the process of breaking a large IP packet into smaller pieces (fragments) so it can travel across networks with smaller Maximum Transmission Units (MTU).
2. Why do we need fragmentation?
Because different networks/devices have different MTU sizes (e.g., Ethernet = 1500 bytes). If a packet is larger than the MTU, it must be split into smaller fragments to pass through.
3. Which layer handles fragmentation?
4. What fields in the IP header are used for fragmentation?
In IPv4:
-
Identification → unique ID to reassemble fragments.
-
Flags → tells if more fragments follow (MF
bit) or if fragmentation is allowed (DF
bit).
-
Fragment Offset → position of the fragment in the original packet.
5. How is reassembly done?
-
Reassembly is always done at the destination host, not intermediate routers.
-
Fragments are collected using the Identification field and ordered using the Fragment Offset.
6. What is the ‘DF’ (Don’t Fragment) bit?
7. What is Path MTU Discovery (PMTUD)?
-
A method to find the smallest MTU on the path between two hosts.
-
Works by sending packets with DF bit set and adjusting packet size based on ICMP feedback.
-
Prevents fragmentation by sending packets that already fit the MTU.
8. Why is fragmentation considered inefficient?
-
Causes performance issues (reassembly overhead).
-
If one fragment is lost, the entire packet must be retransmitted.
-
Increases processing load on routers and destination hosts.
9. How does IPv6 handle fragmentation differently?
-
IPv6 routers do not fragment packets.
-
Only the source host can fragment, using a Fragmentation Extension Header.
-
If a packet is too big, routers drop it and send an ICMPv6 “Packet Too Big” message to the sender.
10. Can TCP avoid fragmentation?
Yes TCP uses MSS (Maximum Segment Size) negotiation during connection setup to ensure segments fit within the MTU, reducing the chance of IP fragmentation.
Quick Recap for Interviews:
-
IPv4: Source & Routers can fragment; destination reassembles.
-
IPv6: Only source can fragment (routers drop and notify).
-
DF bit & PMTUD help avoid fragmentation.
-
Fragmentation is costly; better to avoid using MSS/PMTUD.
ReplyDeleteThank you for giving this opportunity,Your site is very useful for every one.
Regards:
SarkariResults
I am glad that it helped you :)
ReplyDelete