CS FundamentalsVery hardProduct company interview · GATE level

A router receives an IPv4 fragment with header length field 5, total length 1196, fragment offset 294 and the More Fragments bit set. Numbering the original datagram's payload bytes from 0, which bytes does this fragment carry, and what fragment-offset value will the next fragment of the same datagram have?

  1. A. Bytes 2352 to 3547; next offset 444
  2. B. Bytes 294 to 1469; next offset 1470
  3. C. Bytes 2352 to 3527; next offset 441
  4. D. Bytes 2352 to 3527; next offset 442

Correct answer: C. Bytes 2352 to 3527; next offset 441

Header = 5 x 4 = 20 bytes, so the payload is 1196 - 20 = 1176 bytes. The offset is in units of 8 bytes: first byte = 294 x 8 = 2352, last byte = 2352 + 1176 - 1 = 3527. The next fragment starts at byte 3528, i.e. offset 3528/8 = 441. Treating the offset as a byte count gives 294 to 1469; using the total length 1196 as the payload gives 3547; 442 is an off-by-one, since 1176/8 = 147 exactly and 294 + 147 = 441.

More Computer Networks questions

Exams that ask this topic