IPv4 Fragmentation: Computing Datagram Position and Payload Sequence Numbers

IPv4 Fragmentation: Computing Datagram Position and Payload Sequence Numbers

Verified Sources
Nov 4, 2026

To solve the problem, we use the IPv4 fragmentation semantics from the IPv4 header:

  • [keyword]{def="M bit"="More Fragments flag; when 1, more fragments follow, when 0, this is the last fragment"}
  • [keyword]{def="HLEN (IHL)"="IPv4 Internet Header Length; number of 32-bit words in the header"}
  • [keyword]{def="Fragment Offset"="13-bit value in IPv4 that specifies where this fragment’s payload begins, in units of 8 octets"}
  • [keyword]{def="Total Length"="Total size of the IPv4 datagram (header + payload) in octets"}

Key rules:

  1. Fragment offset is measured in 8-octet blocks (i.e., multiply by 8 to get the payload’s starting byte position relative to the original datagram) 2.
  2. The IPv4 payload begins after the header: header length in octets is 4×IHL4 \times \text{IHL} .
  3. The last byte of the payload is determined from Total Length−Header Length−1\text{Total Length} - \text{Header Length} - 1 when using 0-based payload indexing; for the “sequence numbers of first and last payload bytes,” we convert consistently to byte positions 2.

We’ll now compute the requested quantities (datagram position, first payload byte sequence number, last payload byte sequence number) directly from the given values.

Footnotes

  1. RFC 791 (Internet Protocol) - Defines IPv4 fragmentation, including fragment offset measured in 8-octet units and the More Fragments flag. ↩ ↩2

  2. [IPv4 header length (IHL) and total length meaning] (https://en.wikipedia.org/wiki/IPv4#Header) - Explains IHL as 32-bit words and Total Length as header+payload in octets. ↩ ↩2 ↩3

Compute datagram position and payload byte sequence numbers

  1. 1
    Step 1

    HLEN = 10 means header length = 4×10=404 \times 10 = 40 octets.

  2. 2
    Step 2

    Total length = 400 octets, so payload length = 400−40=360400 - 40 = 360 octets.

  3. 3
    Step 3

    Fragment offset = 300; since it is in 8-octet units, payload start position = 300×8=2400300 \times 8 = 2400 (bytes from the start of the original datagram payload).

  4. 4
    Step 4

    M bit = 0 implies this is the last fragment (no subsequent fragments). This helps confirm the fragment’s end is final, but the numeric end still comes from Total Length.

  5. 5
    Step 5

    First payload byte sequence number = payload start position = 24002400.

  6. 6
    Step 6

    Last payload byte sequence number = 2400+360−1=27592400 + 360 - 1 = 2759.

Final computed values

1) Position of the datagram (fragment payload starting position)

Using IPv4 [keyword]{def="Fragment Offset"="Fragment starting position in units of 8 octets"} rule:
Position=300×8=2400\text{Position} = 300 \times 8 = 2400
So, the fragment’s payload begins at byte 2400 of the original datagram payload stream 2.

2) Sequence number of the first payload byte

The first payload byte of this fragment is exactly at the payload start position:
First payload byte=2400\text{First payload byte} = 2400

3) Sequence number of the last payload byte

Payload length is 360360 octets, so the last byte is:
Last payload byte=2400+360−1=2759\text{Last payload byte} = 2400 + 360 - 1 = 2759

Answer (in bytes relative to original datagram payload start):

  • Datagram position (payload start byte): 24002400
  • First payload byte sequence number: 24002400
  • Last payload byte sequence number: 27592759

Footnotes

  1. RFC 791 (Internet Protocol) - Defines IPv4 fragmentation, including fragment offset measured in 8-octet units and the More Fragments flag. ↩

  2. [IPv4 header length (IHL) and total length meaning] (https://en.wikipedia.org/wiki/IPv4#Header) - Explains IHL as 32-bit words and Total Length as header+payload in octets. ↩

Remember the two multipliers

IPv4 fragmentation uses two important conversions: header size is 4×IHL4\times\text{IHL} octets, while fragment offset is in 8-octet units, i.e., multiply by 88 to get a byte position 2.

Footnotes

  1. RFC 791 (Internet Protocol) - Defines IPv4 fragmentation, including fragment offset measured in 8-octet units and the More Fragments flag. ↩

  2. [IPv4 header length (IHL) and total length meaning] (https://en.wikipedia.org/wiki/IPv4#Header) - Explains IHL as 32-bit words and Total Length as header+payload in octets. ↩

Be careful about the meaning of sequence numbers

The problem’s “sequence numbers of payload bytes” are interpreted as byte indices relative to the original (unfragmented) datagram payload start. With that convention, the last byte is start+payloadLen−1\text{start}+\text{payloadLen}-1.

Fragmentation field → payload positions workflow

Header sizing

Step A

Convert HLEN to bytes: 4×HLEN4\times\text{HLEN} ."

Footnotes

  1. [IPv4 header length (IHL) and total length meaning] (https://en.wikipedia.org/wiki/IPv4#Header) - Explains IHL as 32-bit words and Total Length as header+payload in octets. ↩

Payload sizing

Step B

Compute payload length: TotalLen−HeaderLen\text{TotalLen}-\text{HeaderLen} ."

Footnotes

  1. [IPv4 header length (IHL) and total length meaning] (https://en.wikipedia.org/wiki/IPv4#Header) - Explains IHL as 32-bit words and Total Length as header+payload in octets. ↩

Starting offset

Step C

Convert fragment offset to bytes: FragOff×8\text{FragOff}\times 8 ."

Footnotes

  1. RFC 791 (Internet Protocol) - Defines IPv4 fragmentation, including fragment offset measured in 8-octet units and the More Fragments flag. ↩

First/last payload byte indices

Step D

First = start; Last = start + payloadLen − 1."

Computed byte index range of this IPv4 fragment payload

Relative to the original datagram payload start (byte indices).

Common checks and edge cases

Knowledge Check

Question 1 of 4
Q1Single choice

In IPv4 fragmentation, the fragment offset field indicates the fragment start position in units of:

Knowledge Check

Question 1 of 1
Q1Single choice

Using the values Position = 2400 and payload length = 360, the last payload byte index is: