Skip to content
Official PYQ · 2015

GATE CS 2015 Set 2 Q52 — Fragmentation and IP Addressing, IPv4, CIDR

Explain with AI

Host A\text{Host A} sends a UDP\text{UDP} datagram containing 8880 bytes8880\text{ bytes} of user data to host B\text{host B} over an Ethernet LAN.\text{Ethernet LAN}. Ethernet frames may carry data up to 1500 bytes (i.e. MTU = 1500 bytes).1500\text{ bytes (i.e. MTU = 1500 bytes)}. Size of UDP\text{UDP} header is 8 bytes8\text{ bytes} and size of IP\text{IP} header is 20 bytes.20\text{ bytes}. There is no option field in IP\text{IP} header. How many total number of IP\text{IP} fragments will be transmitted and what will be the contents of offset field in the last fragment?

Choose one option
View worked solution

Answer: C

To find the total number of IP fragments and the offset of the last fragment, we can break down the calculation into the following steps:

1. Calculate the Total IP Payload

The IP packet encapsulates the entire UDP datagram (UDP header + UDP user data):

  • UDP User Data=8880 bytes\text{UDP User Data} = 8880 \text{ bytes}
  • UDP Header=8 bytes\text{UDP Header} = 8 \text{ bytes}
  • Total IP Payload=8880+8=8888 bytes\text{Total IP Payload} = 8880 + 8 = 8888 \text{ bytes}

2. Determine Maximum Payload per IP Fragment

The Maximum Transmission Unit (MTU) of the Ethernet LAN is 1500 bytes1500 \text{ bytes}. Each fragment must include its own IP header (20 bytes20 \text{ bytes}):

Maximum Payload per Fragment=MTU−IP Header=1500−20=1480 bytes\text{Maximum Payload per Fragment} = \text{MTU} - \text{IP Header} = 1500 - 20 = 1480 \text{ bytes}

Since the fragment offset field in the IP header is measured in units of 8 bytes8 \text{ bytes}, the payload size of all fragments (except the last one) must be a multiple of 88.

Checking if 14801480 is divisible by 88:

14808=185(which is an integer)\frac{1480}{8} = 185 \quad (\text{which is an integer})

Thus, the maximum payload size per fragment is indeed 1480 bytes1480 \text{ bytes}.

3. Calculate the Number of Fragments

We divide the total IP payload by the maximum payload size per fragment:

Number of fragments=⌈88881480⌉=⌈6.0054⌉=7\text{Number of fragments} = \left\lceil \frac{8888}{1480} \right\rceil = \lceil 6.0054 \rceil = 7

The distribution of payload across the 77 fragments is as follows:

  • Fragments 1 to 6: Each carries 1480 bytes1480 \text{ bytes} of payload.
  • Fragment 7 (Last): Carries the remaining payload: 8888−(6×1480)=8 bytes8888 - (6 \times 1480) = 8 \text{ bytes}.

4. Calculate the Offset of the Last Fragment

The fragment offset represents the number of payload bytes sent before the current fragment, divided by 88:

  • Payload bytes sent before the 7th7^{\text{th}} fragment =6×1480=8880 bytes= 6 \times 1480 = 8880 \text{ bytes}
  • Offset of the 7th7^{\text{th}} fragment =88808=1110= \frac{8880}{8} = 1110

Therefore, the total number of fragments is 77 and the offset of the last fragment is 11101110.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Fragmentation and IP Addressing, IPv4, CIDR questions