CoAP · Study deck
CoAP Observe: Efficiency and Lifecycle
A NAT may forget an idle observer before the next sensor change.
Broker Bex is your guide for this deck.

After studying this chapter
Learning objectives
You will be able to:
- Explain: The Error:: Server registers Observe subscriptions but never removes them when clients crash or restart, leading to "ghost observers" that consume memory and network bandwidth sending notifications to unreachable clients.
- Explain: Maintenance dashboard needs real-time updates when vibration exceeds thresholds (normal: <2.5 mm/s, warning: 2.5-4.5 mm/s, critical: >4.5 mm/s).
- Explain: Exercise 2: Bandwidth Calculation: A smart building has 200 temperature sensors, each observed by 3 clients (dashboard, HVAC controller, alarm system).
- Explain: Estimated notifications per hour (assuming 2 significant changes per sensor per hour).
Major section
Worked Example: Industrial Vibration Monitoring with Observe
Server-side rate limiting prevents notification floods.
- Maintenance dashboard needs real-time updates when vibration exceeds thresholds (normal: <2.5 mm/s, warning: 2.5-4.5 mm/s, critical: >4.5 mm/s).
Major section
Common Mistake: Forgetting to Handle Observer Cleanup After Client Crashes
The Error:: Server registers Observe subscriptions but never removes them when clients crash or restart, leading to "ghost observers" that consume memory and network bandwidth sending notifications to unreachable clients.
- The server continues sending notifications to the old token, which are now unrecognized and trigger RST responses.
Major section
Checkpoint: Failure Modes
You now know unknown tokens after a restart should trigger RST cleanup rather than silent drops.
- You now know UDP NAT mappings can expire after 30-60 seconds, so quiet Observe streams may need keep-alives.
- You now know Max-Age, RST handling, and CON retry failure are three cleanup tools for ghost observers.
Major section
Hands-On Practice
Exercise 2: Bandwidth Calculation: A smart building has 200 temperature sensors, each observed by 3 clients (dashboard, HVAC controller, alarm system).
- Sensors report every time temperature changes by 0.5°C.
- Estimated notifications per hour (assuming 2 significant changes per sensor per hour).
- NAT timeout is 45 seconds.
- Server has 1,000 active observers.
Major section
Checkpoint: Evidence Before Selection
You now know the chapter's 100-observer example can show 99% bandwidth reduction when changes are infrequent.
- You now know MQTT becomes the better comparison when subscriber counts or continuous streams outgrow direct server push.
Deck summary
Key takeaways
Server-side rate limiting prevents notification floods.
- The Error:: Server registers Observe subscriptions but never removes them when clients crash or restart, leading to "ghost observers" that consume memory and network bandwidth sending notifications to unreachable clients.
- You now know unknown tokens after a restart should trigger RST cleanup rather than silent drops.
- Exercise 2: Bandwidth Calculation: A smart building has 200 temperature sensors, each observed by 3 clients (dashboard, HVAC controller, alarm system).
- You now know the chapter's 100-observer example can show 99% bandwidth reduction when changes are infrequent.
Retrieval practice
Recall check 1 of 2

Broker Bex says: answer from memory, then check your reasoning.
Q1A CoAP client behind NAT registered for temperature updates. After 2 minutes of no notifications, the next server notification fails to reach the client. What happened and what's the best solution?
Show answer
Answer: B Correct!
Q2A smart thermostat app wants to receive temperature updates whenever the value changes, without polling. Which CoAP feature enables this?
Show answer
Answer: C Correct!
Retrieval practice
Recall check 2 of 2

Broker Bex says: answer from memory, then check your reasoning.
Q3Place each Observe responsibility where it lives so you can keep a sensor view fresh and remove stale observer state after failures.
Show answer
Answer: A Place each Observe responsibility where it lives so you can keep a sensor view fresh and remove stale observer state after failures.
Print reference
Answers
Answer key.
- B · Correct!
- C · Correct!
- A · Place each Observe responsibility where it lives so you can keep a sensor view fresh and remove stale observer state after failures.