Host A sends a UDP datagram containing 8880 bytes of user data to host B over…

2015

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

  1. A.

    6 and 925

  2. B.

    6 and 7400

  3. C.

    7 and 1110

  4. D.

    7 and 8880

Attempted by 189 students.

Show answer & explanation

Correct answer: C

Key idea: fragmentation splits the IP payload (which includes the UDP header) into pieces that fit the MTU, and the fragment offset is measured in 8-byte units.

  • Compute IP payload size: user data 8880 bytes + UDP header 8 bytes = 8888 bytes.

  • Maximum IP payload per fragment = MTU 1500 − IP header 20 = 1480 bytes. This is a multiple of 8, so each non-last fragment can carry 1480 bytes.

  • Number of fragments = ceil(8888 / 1480) = ceil(6.004) = 7 fragments in total.

  • Size carried by the last fragment: after six fragments of up to 1480 bytes, the last fragment carries the remaining 8 bytes of IP payload (these are user data bytes; the UDP header was only in the first fragment).

  • Offset field for the last fragment: offsets are in 8-byte units. Bytes before the last fragment = total IP payload (8888) − last fragment payload (8) = 8880 bytes. Offset = 8880 / 8 = 1110.

Final answer: 7 IP fragments will be transmitted, and the offset field in the last fragment is 1110.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Gate Guidance By Sanchit Sir