Question
In an IPv4 datagram, the M bit is 0, the value of HLEN is 10, the value of total length is 400 and the fragment offset value is 300. The position of the datagram, the sequence numbers of the first and the last bytes of the payload, respectively are
Official answer and solution
- Official answer
- C
- From
- Official GATE 2013 answer key
Solution
Extract IPv4 header length, total length, fragment offset, and M bit to deduce the fragment position and payload byte sequence numbers.
Let us extract the IPv4 header fields:
- bit (More Fragments): . This indicates that this datagram is not followed by any more fragments. Because the fragment offset is non-zero (), this is the Last fragment.
- Header Length (HLEN): . The actual header size in bytes is .
- Total Length: .
- Payload Length:
- Fragment Offset: The fragment offset is given as 300 (measured in units of 8 bytes). Therefore, the first byte of the payload in the original unfragmented datagram has byte sequence number:
- Last byte sequence number:
Therefore, the datagram is the last fragment, and the first and last byte numbers of the payload are 2400 and 2759, respectively.
C
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2013 Computer Science and Information Technology (CS)
- Question
- 37 of 65, printed as CS Q.37
- 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.