Back to the 2016 paper

Module 3: Network Layer & Routing

20167m

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. Find the position of the datagram, the sequence numbers of the first and the last bytes of the payload respectively.

Worked SolutionAI Assisted

IPv4 Fragment: Position and Payload Byte Numbers

Given: M bit = 0, HLEN = 10, Total Length = 400, Fragment Offset = 300.

Step 1: Header size

HLEN is counted in 32-bit (4-byte) words:

Header size=HLEN×4=10×4=40 bytes\text{Header size} = \text{HLEN} \times 4 = 10 \times 4 = 40\ \text{bytes}

Step 2: Payload carried by this fragment

Payload=Total Length−Header=400−40=360 bytes\text{Payload} = \text{Total Length} - \text{Header} = 400 - 40 = 360\ \text{bytes}

Step 3: Position of the fragment in the original datagram

The Fragment Offset field is expressed in units of 8 bytes:

start offset=300×8=2400 bytes\text{start offset} = 300 \times 8 = 2400\ \text{bytes}

So the payload of this datagram begins at byte 2400 of the original datagram's data field.

Step 4: Interpretation of M = 0

M = 0 (no more fragments) means this is the last fragment of the original datagram.

Step 5: Sequence numbers of the first and last payload bytes

Counting bytes from 0 at the start of the original data field:

first byte=2400\text{first byte} = 2400

last byte=2400+360−1=2759\text{last byte} = 2400 + 360 - 1 = 2759

Hence the original datagram's payload was 2759+1=27602759 + 1 = 2760 bytes long (bytes 0 to 2759), and this fragment covers bytes 2400 to 2759. (If numbered from 1, the answers are 2401 and 2760.)

Final answer: position = last fragment starting at byte offset 300×8=2400300 \times 8 = 2400; payload sequence numbers: first byte = 2400, last byte = 2759 (0-based).

Similar questions

Free AppAndroid App

Coursify Android App

Generate AI courses, take quick quizzes between classes, and master complex engineering concepts on the go.