Why 89% Fewer Bytes Is Only 74% Less Airtime

Ada re-derives this chapter’s own numbers step by step, at full precision

foundations
math-foundations
calculation-audit
http-web
Ada ADA · CALCULATION AUDIT

Why 89% Fewer Bytes Is Only 74% Less Airtime

A battery-powered soil moisture sensor wakes every 6 hours, sends a 15-byte reading to a gateway 50 meters away over IEEE 802.15.4 at 250 kbps, and must run 2 years on a 1000 mAh battery. The chapter puts CoAP’s 26-byte message against MQTT’s 239-byte message and reports a total-radio-time saving of 6 ms versus 23 ms — 74% less radio time, once MQTT’s ~180-byte TCP handshake is counted in. This audit asks the question those two figures invite: why is the 89% byte reduction only a 74% airtime reduction, and which number should size the battery?

Companion to the chapter REST API Worked Examples — every number here comes from that chapter.

Ada: The protocol comparison in this chapter reports two different reduction figures for the same CoAP-versus-MQTT choice, and both are right. On an IEEE 802.15.4 link at 250 kbps, serialization airtime is exactly proportional to bytes, so let me separate the pure payload airtime from the total radio time.

  • CoAP message: 26 bytes x 8 bits / 250,000 bps = 0.000832 s = 0.832 ms.
  • MQTT message: 239 bytes x 8 bits / 250,000 bps = 0.007648 s = 7.648 ms.
  • Serialization saving: (7.648 - 0.832) / 7.648 = 0.8912 = 89.1%, identical to the byte reduction (239 - 26) / 239 = 0.8912, because airtime is linear in bytes.
  • Yet the chapter’s total-radio-time figures are 6 ms and 23 ms, a saving of only (23 - 6) / 23 = 73.9%. The gap is the fixed per-transmission cost both protocols pay: CSMA/CA backoff on CoAP, and the 180 x 8 / 250,000 = 5.76 ms TCP handshake plus backoff on MQTT.

The audit conclusion is bounded: the byte diet is real and linear, but a fixed airtime floor — backoff, handshake, receive windows — dilutes the headline advantage, and the smaller the payload the more that floor dominates. Trust the 74% total-radio figure, not the 89% serialization figure, when sizing a battery.

Every number above is taken from the chapter’s own material and re-derived step by step.