The Overhead the Byte Count Misses
The Overhead the Byte Count Misses
Ada re-derives this chapter’s own numbers step by step, at full precision
ADA · CALCULATION AUDIT
The Overhead the Byte Count Misses
A soil sensor that reports just once a day over MQTT QoS 1 with a 60-second keepalive still exchanges 1,440 keepalive pings a day, holding the session warm for a single payload. Carry a 4-byte reading over CoAP, UDP, IPv4, and Ethernet and the frame swells to 50 bytes, of which 46 — a full 92% — is pure overhead. This audit asks whether protocol choice for a sleepy, infrequent reporter is really about the application data, or about the fixed per-session and per-packet costs the byte count never sees.
Companion to the chapter CoAP and MQTT Tradeoffs — every number here comes from that chapter.
Choose Calculate for 1 daily sensor report with a 60 s MQTT keepalive, then compare the CoAP exchange.
The session ledger reaches 1440 keepalive pings per day before carrying that single payload.
A persistent TCP session pays fixed keepalive and connection-state costs independent of payload frequency, whereas connectionless CoAP pays around each exchange.
See the relationship before changing it
The figure reads from left to right. The blue input is keepalive interval. The middle card names the page’s rule. The green output is pings per day. The arrow matters: change the input, apply the rule once, then read the result with its unit.
Derive the baseline in four named moves
- 1
Name the input. The chapter baseline is 60 s.
- 2
Name the relationship. pings/day = 86,400 s/day / interval
- 3
Substitute with units. 86,400 s/day / 60 s = 1,440 pings/day
- 4
Read the result. Keep the unit beside the value, then use the result only inside the technical boundary below.
Predict, then change keepalive interval
Try Predict how pings per day responds when keepalive interval moves. Calculate keepalive interval; compare pings per day with that prediction.
Observe Return to 60 s. Recheck pings per day with keepalive interval at its chapter value.
Explain A longer interval cuts upkeep, but it also delays detection of a dead connection.
Check yourself
What should you do before trusting a moved-slider result?
What does this small model leave out?
Technical boundaries
For the transport comparison, excluded from this fixed arithmetic are TCP connection setup, TLS or DTLS handshakes, retransmissions, congestion, broker processing, or radio-state transitions.
Ada: The packet-overhead panel earlier already priced CoAP against MQTT byte for byte. But this chapter makes two other numeric claims the byte count never sees — a once-a-day MQTT sensor still sends “1,440 pings per day,” and a tiny CoAP payload can be “92% overhead.” Both are fixed costs that do not shrink with the message, so let me check them.
Take the daily soil sensor on MQTT QoS 1 with a 60-second keepalive. The connection must be kept warm even when there is nothing to report:
- Keepalive pings per day:
86400 s / 60 s = 1440. - Ratio of upkeep to payload:
1440 : 1against a single daily data message.
Now the full-stack overhead of a 4-byte reading (“25.3”) carried by CoAP over UDP, IPv4, and Ethernet:
- Frame total:
4 (payload) + 4 (CoAP) + 8 (UDP) + 20 (IPv4) + 14 (Ethernet) = 50bytes. - Overhead:
50 - 4 = 46bytes, so46 / 50 = 0.92, i.e. 92%.
The design meaning is that both costs are fixed per session or per packet and are paid regardless of how little data moves. A device reporting once a day would spend 1,440 keepalive exchanges holding a TCP session open for one payload — which is exactly why the chapter steers a sleepy, infrequent reporter toward connectionless CoAP CON, where the exchange is one request and one ACK with no session to maintain. The 92% figure makes the same point at the packet level: when the payload is only a few bytes, protocol choice is about minimising unavoidable fixed overhead, not about the application data itself.
Every number above is taken from the chapter’s own material and re-derived step by step.