TCP/IP Protocol Suite: Table Of Contents
IP Fragmentation – Q&A
Questions
- What is meant by IP fragmentation?
- Why is an IP datagram fragmented?
- Which RFCs discuss IP fragmentation?
- Is it possible to select an IP datagram size to always avoid
fragmentation?
- Where an IP datagram may get fragmented?
- Where are the IP datagram fragments reassembled?
- How to prevent an IP datagram from being fragmented?
- What happens when a datagram must be fragmented to traverse a
network, but the “don’t fragment” flag in the datagram is set?
- Will all the fragments of a datagram reach the destination
using the same path?
- Will all the fragments of a datagram arrive at the
destination system in the correct order?
- What happens to the original IP datagram when one or more
fragments are lost?
- What is the minimum size of an IP fragment?
- What are the limitations on the size of a fragment?
- How is an IP datagram fragment differentiated from a
non-fragmented IP datagram?
- How are the fragments of a single IP datagram
identified?
- How is the last fragment of an IP datagram identified?
- How is the length of a complete IP datagram calculated from
the received IP fragments?
- How is an IP datagram fragmented?
- How a destination system reassembles the fragments of an IP
datagram?
- What fields are changed in an IP header due to
fragmentation?
- What happens to the IP options field when an IP datagram is
fragmented?
- Which IP options are copied to all the fragments of an IP
datagram?
Answers
- What is meant by IP fragmentation?
- Why is an IP datagram fragmented?
- Which RFCs discuss IP fragmentation?
- Is it possible to select an IP datagram size to always avoid
fragmentation?
- Where an IP datagram may get fragmented?
- Where are the IP datagram fragments reassembled?
- How to prevent an IP datagram from being fragmented?
- What happens when a datagram must be fragmented to traverse a network,
but the “don’t fragment” flag in the datagram is set?
- Will all the fragments of a datagram reach the destination using the
same path?
- Will all the fragments of a datagram arrive at the destination system in
the correct order?
- What happens to the original IP datagram when one or more fragments are
lost?
- What is the minimum size of an IP fragment?
- What are the limitations on the size of a fragment?
- 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?
- How are the fragments of a single IP datagram identified?
- How is the last fragment of an IP datagram identified?
- How is the length of a complete IP datagram calculated from the received
IP fragments?
- How is an IP datagram fragmented?
- 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?
- 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?
- Which IP options are copied to all the fragments of an IP
datagram?
The breaking up of a single IP datagram into two or more IP datagrams of
smaller size is called IP fragmentation.
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.
RFC 791 & RFC 815 discusses about IP datagrams, fragmentation and reassembly.
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.
An IP datagram may get fragmented either at the sending host or at one of the
intermediate routers.
The IP fragments are reassembled only at the destination host.
A IP datagram can be prevented from fragmentation, by setting the “don’t
fragment” flag in the IP header.
The datagram whose “don’t fragment” flag is set is discarded, if it must be
fragmented to traverse a network. Also, a ICMP error message is sent back to
the sender of the datagram.
The different fragments of the same IP datagram can travel in either in the
same path or in different paths to the destination.
The different fragments of a single IP datagram can arrive in any order to the
destination system.
When one or more fragments of an IP datagram are lost, then the entire IP
datagram is discarded after a timeout period.
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 offset is 0.
The size of an IP datagram fragment is limited by
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.
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.
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.
Using the fragment offset field and the length of the last fragment, the length
of a complete IP datagram is calculated.
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 following IP header fields are changed due to IP fragmentation:
Depending on the option, either it is copied to all the fragments or to only
the first fragment.
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.
TCP/IP Protocol Suite: Table Of Contents