Why 89% Fewer Bytes Is Only 74% Less Airtime

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.

See the relationship before changing it

The figure reads from left to right. The blue card is message size. The middle card applies this page's rule. The green card is serialization airtime. Walk the arrows once: set the input, apply the rule, then read the result with its unit.

The retained audit below checks several chapter fixtures. This model keeps those stated values fixed and changes only message size, so the numeric fixture does not switch without explanation.

Message size changes serialization airtime An input card leads through the rule airtime = bytes x 8 / 250,000 bit/s x 1,000 to the serialization airtime result. INPUT PAGE INPUT APPLY THE RULE predict calculate check units OUTPUT RESULT
Walk the arrows. At a fixed radio rate, every added byte adds the same serialization time.

Derive the baseline in four named moves

  1. 1

    Name the input. The chapter baseline is 26 bytes.

  2. 2

    Name the relationship. airtime = bytes x 8 / 250,000 bit/s x 1,000

  3. 3

    Substitute with units. 26 x 8 / 250,000 x 1,000 = 0.832 ms

  4. 4

    Read the result. Keep the unit beside the value. Use it only inside the technical boundary on this page.

Predict, then change message size

Try Predict the direction of airtime = bytes x 8 / 250,000 bit/s x 1,000. Test another message size, then compare serialization airtime.

26 bytes
Chapter baseline
Serialization airtime

Observe At a fixed radio rate, every added byte adds the same serialization time. Reset message size to 26 and compare serialization airtime.

Explain At a fixed radio rate, every added byte adds the same serialization time.

Check yourself

What should you do before trusting a moved-control result?
Answer: Predict its direction, apply the shown relationship, keep the units, and reset to the worked baseline.
What does this small model leave out?
Answer: Only message size moves here. Field effects named in the technical boundary stay fixed.
TryRecompute CoAP message: 26 bytes x 8 bits / 250,000 bps = 0.000832 s = 0.832 ms.
ObserveTrack MQTT message: 239 bytes x 8 bits / 250,000 bps = 0.007648 s = 7.648 ms.
ExplainExplain why shrinking 239 bytes to 26 bytes cuts raw airtime by 89% but fixed radio overhead limits the stated total-time saving to 74%.

Ready: use the stated baseline inputs, then compare each displayed result.

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.

Technical boundaries. This airtime comparison deliberately does not simulate variable CSMA backoff, retries, fading, or PHY-rate changes. It converts fixed 26-byte CoAP and 239-byte MQTT messages at 250 kbps, then compares the chapter's stated total radio times.