IAE Academy

GATE 2025 CS2 Q.23: solution and answer

GATE 2025 · CS2Q.23 · 1 mark · MCQ

Consider a network that uses Ethernet and IPv4. Assume that IPv4 headers do not use any options field. Each Ethernet frame can carry a maximum of 1500 bytes in its data field. A UDP segment is transmitted. The payload (data) in the UDP segment is 7488 bytes.

Which ONE of the following choices has the CORRECT total number of fragments transmitted and the size of the last fragment including IPv4 header?

  1. (A)

    5 fragments, 1488 bytes

  2. (B)

    6 fragments, 88 bytes

  3. (C)

    6 fragments, 108 bytes

  4. (D)

    6 fragments, 116 bytes

See the question in the paper

Answer and solution

ANSWER

6 fragments are sent, and the last fragment is 116 bytes including the IPv4 header (option D).

Official answer: DSource: Official answer key, GATE 2025 CS2 (IIT Roorkee)

  1. A UDP segment has an 8-byte header, so the IP datagram's data (the UDP segment) is bytes.

  2. The Ethernet data field carries at most 1500 bytes, so the MTU is 1500 bytes. With a 20-byte IPv4 header (no options), each fragment can carry at most bytes of data.

  3. Fragment data (except in the last fragment) must be a multiple of 8 bytes. Since , a full fragment carries exactly 1480 bytes.

  4. Number of fragments .

  5. The first five fragments carry bytes of data.

  6. The last fragment carries bytes of data.

  7. Its size including the IPv4 header is bytes.

  8. So there are 6 fragments and the last one is 116 bytes, which is option D.

KEY IDEA

The UDP header is part of the data that IP fragments. Each fragment holds the MTU minus the 20-byte IP header, rounded down to a multiple of 8 bytes. The last fragment holds the remainder plus a fresh 20-byte header.

WATCH OUT FOR

Forgetting the 8-byte UDP header and fragmenting only 7488 bytes. That gives a last fragment of 88 + 20 = 108 bytes (option C). Another slip is to divide by 1500 and forget that every fragment carries its own IP header.

From the GATE 2025 CS2 paper. Every question of this paper · Download the full paper · All 20 IPv4 questions, with notes

More IPv4 questions