Fragmentation in Network Layer (original) (raw)

Last Updated : 11 Oct, 2025

In computer networks, data is sent in small units called packets or datagrams. Sometimes, these datagrams are too large to pass through a network with a smaller size limit. To handle this, the datagram is broken into smaller parts is called fragmentation.

Need for Fragmentation

When a large datagram is created by the source computer, it may need to travel through multiple networks to reach the destination. Each of these networks might support different maximum packet sizes. This leads to the need for fragmentation.

**Note: Although sending large datagrams is better for efficiency (because headers are not repeated), it’s not always possible due to the reasons below:

Reasons for Fragmentation

Datagram-Header-Format_

Header Format

The fields that are related to fragmentation and reassembly of an IPv4 datagram are:

**Identification

**Flags

**Fragment Offset

**Example: Let’s say a large datagram has 4000 bytes of data. These bytes are numbered from 0 to 3999. Now, suppose this datagram is too large for the network and needs to be broken into 3 fragments.

Here’s how the fragmentation will happen:

**First Fragment

**Second Fragment

**Third Fragment

original_datagram

Fragmentation Example

Fragmentation of Datagram

When data travels through a network, it is placed into a unit called a datagram. Every network, whether a Local Area Network (LAN) or a Wide Area Network (WAN), has a limit on the maximum size of data it can handle at a time. This limit is known as the Maximum Transmission Unit (MTU).

**Fragmentation Process:

**At Each Router:

**Why Fragmentation May Happen Multiple Times:

Reassembly of Fragments

It takes place only at the destination and not at routers since packets take an independent path(datagram packet switching), so all may not meet at a router and hence a need of fragmentation may arise again. The fragments may arrive out of order also.

mf

Reassembly of Fragments

**Algorithm:

  1. Destination should identify that datagram is fragmented from MF, Fragment offset field.
  2. Destination should identify all fragments belonging to same datagram from Identification field.
  3. Identify the 1st fragment(offset = 0).
  4. Identify subsequent fragments using header length, fragment offset.
  5. Repeat until MF = 0.

**Efficiency:

**Efficiency (e) = useful/total = (Data without header)/(Data with header)
**Throughput = e * B { where B is bottleneck bandwidth }

**Example: An IP router with a Maximum Transmission Unit (MTU) of 200 bytes has received an IP packet of size 520 bytes with an IP header of length 20 bytes. The values of the relevant fields in the IP header.

**Explanation: Since MTU is 200 bytes and 20 bytes is header size so, the maximum length of data = 180 bytes but it can't be represented in fragment offset since it is not divisible by 8 so, the maximum length of data feasible = 176 bytes.

Problems Caused by IP Fragmentation