Walk the CoAP Uri-Path Options

Walk the CoAP Uri-Path Options

Try Press Step at offset 8 to split B7 and see the first option’s delta and value length.

Walk the CoAP Uri-Path options

Byte trace

Request octets in wire order

Offsets are byte positions counted from the start of the datagram, starting at zero.

Offset 0 · Fixed header already readToken already read
Offset 8 · First option
B7
  1. 73
  2. 65
  3. 6E
  4. 73
  5. 6F
  6. 72
  7. 73
7 bytes · sensors
Offset 16 · Next option
04
  1. 74
  2. 65
  3. 6D
  4. 70
4 bytes · temp
Offset 21 End of datagram
Read cursor
B7 at offset 8
Previous option number
0
Path segments
Empty

Find the start of the options

Start immediately after the token. CoAP starts the option-number total at zero.

Observe The option readout rises from 0 to 11 at B7, the cursor advances to 04 at offset 16 after sensors, and the path display ends with /sensors/temp.
Explain B7 adds delta 11 to the starting option number and gives a length of 7 bytes for sensors. Header 04 adds delta 0, keeping the same path option for the 4-byte temp segment.

Technical boundaries. The trace starts after the fixed header and token have already been read. It follows one datagram with two path options and ends at offset 21. This datagram reaches its end without a payload marker or payload.

Back to the chapter