Follow the CoAP Option Cursor

Follow the CoAP Option Cursor

Try Press Step once to decode b7 from offset 8 and follow the cursor to the next option header.

Track the boundary and the option number

Wire format

UDP request

Fixed header
04410127d334
Token
4a15b26c37d4
Uri-Path · sensors
8b79731065116e1273136f14721573
Uri-Path · temp
160417741865196d2070

Cursor → b7 at offset 8

Start at the first option

Token Length is 4 bytes.

Cumulative option number: 0.

Use the header's token length to reach the first option, then start the option number at zero.

Observe In the request, the cursor moves from offset 8 to 16 as the option number becomes 11, then reaches datagram end. In the response, it reaches ff at offset 10 with option number 12.
Explain The request stays at option 11 for temp because its decoded delta is 0. The response’s ff starts the payload because it occurs at the next option boundary after Content-Format.

Technical boundaries. The byte strip follows one UDP request and one response with direct option deltas and lengths. Extension-byte and format-error rules appear in the final summary, outside the worked datagrams. The inset with FF inside an option value is a separate schematic that illustrates why byte position matters.

Back to the chapter