Skip to content

RFC 7252 Tier 1 compliance: critical options, NSTART#36

Merged
cvik merged 6 commits intomainfrom
tier1-rfc7252-compliance
Mar 15, 2026
Merged

RFC 7252 Tier 1 compliance: critical options, NSTART#36
cvik merged 6 commits intomainfrom
tier1-rfc7252-compliance

Conversation

@cvik
Copy link
Owner

@cvik cvik commented Mar 15, 2026

Summary

  • 1.1 Critical option rejection (§5.4.1): Server returns 4.02 Bad Option for unrecognized critical (odd-numbered) options. Both plain CoAP and DTLS paths. Configurable via Config.recognized_options for app-specific extensions.
  • 1.3 NSTART enforcement (§4.7): Client limits outstanding CONs to 1 for unconfirmed peers. Full pipelining resumes after first response. Guards submit() and observe().
  • 1.5 Option order validation (§5.4.6): Documented as structurally enforced by CoAP delta encoding — no code change needed.

Test plan

  • 5 server tests: CON/NON unknown critical → 4.02, known critical passes, elective passes, recognized_options whitelist
  • 3 client tests: NSTART rejection before confirm, confirm via poll, confirm via call
  • Existing test suite passes (including fixed "multiple concurrent submits")
  • Benchmark regression check — no regressions

Christoffer Vikström added 6 commits March 15, 2026 17:03
Server checks all packet options after parse, before handler dispatch.
Critical (odd-numbered) options not in coapz.OptionKind or
Config.recognized_options return 4.02 Bad Option. Both plain CoAP
and DTLS paths covered. Response cached for CON dedup.
Client tracks peer_confirmed flag, set on first response via poll(),
waitForResponse(), or routeObserve(). submit() returns NstartExceeded
when unconfirmed and count_active >= nstart. Full pipelining resumes
after first successful exchange.
@cvik cvik merged commit d9459e5 into main Mar 15, 2026
1 check passed
@cvik cvik deleted the tier1-rfc7252-compliance branch March 15, 2026 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant