Scenario: A smart home deployment monitors 50 temperature sensors. You need to compare bandwidth consumption between traditional HTTP polling, basic CoAP Observe, and conditional CoAP Observe (with 0.5°C change threshold).
Given:
- Monitoring period: 24 hours
- Actual temperature changes: 6 per day per sensor (HVAC cycling)
- HTTP polling interval: 30 seconds
- CoAP message size: 22 bytes (4B header + 2B token + 8B options + 8B payload)
- HTTP transaction size: 165 bytes (request + response headers + payload)
- Temperature resolution: 0.1°C
- Notification threshold: 0.5°C change
Step 1: Calculate HTTP polling bandwidth
Polls per sensor per day: (24 hours × 3600 sec) / 30 sec = 2,880 polls
Total polls: 50 sensors × 2,880 = 144,000 polls/day
Bandwidth per sensor: 2,880 polls × 165 bytes = 475,200 bytes = 464.1 KB
Total bandwidth: 50 × 475,200 = 23,760,000 bytes = 22.66 MB/day
Step 2: Calculate basic CoAP Observe bandwidth
Initial registration: 1 message per sensor
Notifications: 6 per day per sensor (all temp changes reported)
Messages per sensor: 1 + 6 = 7 messages/day
Total messages: 50 × 7 = 350 messages/day
Bandwidth per sensor: 7 × 22 bytes = 154 bytes
Total bandwidth: 50 × 154 = 7,700 bytes = 7.52 KB/day
Reduction vs HTTP: (22.66 MB - 7.52 KB) / 22.66 MB = 99.97%
Step 3: Calculate conditional CoAP Observe (0.5°C threshold)
Temperature drift per change: ±0.1°C to ±2.0°C
Average change magnitude: 0.8°C
Changes exceeding 0.5°C threshold: 4 out of 6 (67%)
Notifications per sensor: 4 significant changes/day
Messages per sensor: 1 registration + 4 notifications = 5/day
Total messages: 50 × 5 = 250 messages/day
Bandwidth per sensor: 5 × 22 bytes = 110 bytes
Total bandwidth: 50 × 110 = 5,500 bytes = 5.37 KB/day
Additional reduction: (7.52 KB - 5.37 KB) / 7.52 KB = 28.6%
Step 4: Calculate monthly and annual costs (cellular data)
Cellular data cost: $10 per GB
HTTP polling:
Monthly: 22.66 MB/day × 30 = 679.8 MB = 0.68 GB
Annual cost: 0.68 GB/month × 12 × $10 = $81.60
Basic CoAP Observe:
Monthly: 7.52 KB/day × 30 = 225.6 KB = 0.00022 GB
Annual cost: 0.00022 GB/month × 12 × $10 = $0.03
Conditional CoAP Observe:
Monthly: 5.37 KB/day × 30 = 161.1 KB = 0.00016 GB
Annual cost: 0.00016 GB/month × 12 × $10 = $0.02
Result Summary:
| HTTP Polling |
144,000 |
22.66 MB |
$81.60 |
Baseline |
| Basic Observe |
350 |
7.52 KB |
$0.03 |
99.97% reduction |
| Conditional Observe |
250 |
5.37 KB |
$0.02 |
99.98% reduction |
Key Insights:
- CoAP Observe achieves 99.97% bandwidth reduction by eliminating 143,650 unnecessary polls per day
- Conditional observe adds another 28.6% savings by suppressing insignificant changes (±0.3°C fluctuations)
- For 50-sensor deployment, annual savings = $81.58 (switching from HTTP to conditional observe)
- For 10,000-sensor deployment, annual savings = $163,160
Recommendation: Always implement conditional observe with application-specific thresholds (0.5°C for temperature, 5% for humidity, etc.) to maximize efficiency while preserving data quality.