Question

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?

Choose one option
Official answer and solution
Official answer
C
From
Official GATE 2015 answer key

Solution

Calculate the fragment sizes and Fragment Offset values according to IPv4 fragmentation standards.

  1. Total data to fragment:
    UDP user data = 8880 bytes.
    UDP header = 8 bytes.
    Total IP payload = 8880+8=8888 bytes8880 + 8 = 8888\text{ bytes}.
  1. Maximum payload per fragment:
    MTU = 1500 bytes.
    IP header = 20 bytes.
    Maximum payload per fragment = 1500−20=1480 bytes1500 - 20 = 1480\text{ bytes}.
    Notice that 1480 is divisible by 8 (1480/8=1851480 / 8 = 185).
  1. Fragment generation:
  • Fragment 1: 1480 bytes, Offset = 0/8=00 / 8 = 0, MF = 1
  • Fragment 2: 1480 bytes, Offset = 1480/8=1851480 / 8 = 185, MF = 1
  • Fragment 3: 1480 bytes, Offset = 2960/8=3702960 / 8 = 370, MF = 1
  • Fragment 4: 1480 bytes, Offset = 4440/8=5554440 / 8 = 555, MF = 1
  • Fragment 5: 1480 bytes, Offset = 5920/8=7405920 / 8 = 740, MF = 1
  • Fragment 6: 1480 bytes, Offset = 7400/8=9257400 / 8 = 925, MF = 1
    Total data in first 6 fragments = 6×1480=8880 bytes6 \times 1480 = 8880\text{ bytes}.
  • Fragment 7 (Last fragment):
    • Payload size = 8888−8880=8 bytes8888 - 8880 = 8\text{ bytes}.
    • Offset = 88808=1110\dfrac{8880}{8} = 1110.
    • MF = 0.

Total fragments = 7, and offset in the last fragment = 1110 (option C).

Final answer

C

Common trap

Forgetting the 8-byte UDP header or expressing the fragment offset in bytes (8880) rather than 8-byte blocks (1110).

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2015 Computer Science and Information Technology (CS) Session 2
Question
62 of 65, printed as CS Q.52
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.