CoAP · Study deck

CoAP Security: CON and NON Trade-Offs

CoAP is a compact request and response protocol.

Broker Bex is your guide for this deck.

security
Broker Bex, the module guide, in a scene from this chapter.
iotclass.org

After studying this chapter

Learning objectives

Choose delivery and security from the route, endpoints, and device sleep cycle.

  • Separate message delivery from confidentiality.
  • Map exposure of payload, path, and timing.
  • Place DTLS and OSCORE endpoints on the route.
  • Include deep-sleep handshake or resumption cost in the energy test.
iotclass.org

Major section

Start With the Decision

CoAP is a compact request and response protocol.

  • A confirmable CoAP message asks for an acknowledgement and is retransmitted if none arrives before the timeout.

A non-confirmable message does not ask CoAP to acknowledge or retry it.

iotclass.org

Major section

Worked Example: Hospital Wearable Device DTLS Configuration

Each device uses CoAP to report readings every 30 seconds to a centralized gateway.

  • The hospital needs to protect patient data in transit.
  • Illustrative message-energy comparison (CR2032 coin cell, 220 mAh, 3 V nominal):: The radio and cipher costs below are model inputs, not standard CoAP or DTLS values.

Key terms

Battery-life figures
Battery-life figures are upper bounds that omit idle current, sensing, self-discharge, voltage sag, and retransmissions.
iotclass.org

Major section

Decision Framework: CoAP Security Configuration Selection

Name both security endpoints and identify where the gateway can read content.

  • DTLS between device and gateway protects that transport hop.
  • The gateway can read the CoAP message on that hop.
  • OSCORE protects selected content only between configured endpoints.
  • Device-to-cloud OSCORE requires the device and cloud as endpoints.
iotclass.org

Major section

Common Mistake: Reusing DTLS Session Across Deep Sleep Cycles

The Error: Configuring battery-powered IoT devices to establish a DTLS session once, then sleep/wake multiple times expecting the session to remain valid.

  • However, DTLS sessions have state (sequence numbers, cipher state) that's lost when the device power-cycles RAM.
  • When ESP32 deep sleeps, RAM is powered off.

Key terms

If DTLS
If DTLS is required, implement session resumption with RTC-persisted state.
iotclass.org

Major section

Summary

CoAP security decisions depend on the device, transport, and deployment model.

  • DTLS, OSCORE, credentials, gateways, and provisioning all need to be matched to battery budget, multicast needs, and operational update paths.

CoAP security decisions depend on the device, transport, and deployment model. DTLS, OSCORE, credentials, gateways, and provisioning all need to be matched to battery budget, multicast needs, and operational update paths.

iotclass.org

Deck summary

Key takeaways

Security protection ends at its configured endpoints.

  • DTLS device-to-gateway ends at the gateway; the gateway can read device content.
  • Gateway-to-cloud OSCORE protects selected content on that segment.
  • Device-to-cloud OSCORE requires device and cloud endpoints.
iotclass.org

Retrieval practice

Recall check 1 of 2

Broker Bex says: answer from memory, then check your reasoning.

Q1The hospital wearable example compares payload encryption with DTLS. Which protection gap motivates its choice?

AEliminating the energy cost of protection
BTreating readable gateway data as public information
CProtecting more than the application payload
DReplacing the need to manage device keys
Show answer

Answer: C The example’s reasoning favors transport protection including the associated sensitive metadata.

Q2A CoAP design must preserve protected message content through proxies. Which listed mechanism addresses that boundary?

APlain CoAP without a message-security layer across proxies.
BOSCORE object security protecting content end to end.
CDTLS-PSK alone, which terminates at a transport proxy.
DA DTLS certificate choice alone as cross-proxy content protection.
Show answer

Answer: B The comparison identifies object security as surviving proxies for end-to-end protection.

iotclass.org

Retrieval practice

Recall check 2 of 2

Broker Bex says: answer from memory, then check your reasoning.

Q3What protects selected CoAP content end to end across intermediaries?

ACoAP Application Layer
BDTLS (Hop-by-Hop Security)
CUDP Transport
DOSCORE (End-to-End Security)
Show answer

Answer: D OSCORE protects selected CoAP message content end to end across intermediaries.

iotclass.org

Print reference

Answers

Answer key.

  1. C · The example’s reasoning favors transport protection including the associated sensitive metadata.
  2. B · The comparison identifies object security as surviving proxies for end-to-end protection.
  3. D · OSCORE protects selected CoAP message content end to end across intermediaries.
iotclass.org
Q1: C — protect more than payload in the hospital example. Q2: B — OSCORE protects selected CoAP content between its endpoints, including across proxies that do not terminate those endpoints. Q3: Show the full four-layer and endpoint diagram from slide 10: UDP transport; DTLS between configured hop endpoints; OSCORE between configured object-security endpoints; application above. Mark where content is readable. Reveal after five seconds per question; retain the complete print key.