A 4x Advantage That Is Really a Modeling Choice
Ada re-derives this chapter’s own numbers step by step, at full precision
ADA · CALCULATION AUDIT
A 4x Advantage That Is Really a Modeling Choice
The chapter’s battery panel compares a 24-byte CoAP reading against a 97-byte HTTP one on the same 225 mAh CR2032 cell, and lands on a headline: CoAP runs ~4x longer, about 36,621 days (100.3 years) versus 9,061 days (24.8 years) on a radio-only model. A 4x battery claim drawn from a byte-count difference is worth tracing end to end. This audit asks what that 4x really rests on — a genuine efficiency law, or a modeling choice about which bytes you count?
Companion to the chapter Lab: CoAP Implementation — every number here comes from that chapter.
Ada: The battery panel above lands on “CoAP runs ~4x longer.” I want to verify the chain from bytes to days, then be honest about where that 4x actually comes from.
Message sizes and transmit time at 250 kbps:
- CoAP:
24 bytes,24 x 8 / 250000 = 0.768 ms - HTTP:
97 bytes,97 x 8 / 250000 = 3.104 ms
Energy per reading at 20 mA (dividing by 3,600,000 to reach milliamp-hours, which lands in the nanoamp-hour range for a sub-millisecond radio burst):
- CoAP:
20 x 0.768 / 3,600,000 = 4.27 nAh - HTTP:
20 x 3.104 / 3,600,000 = 17.24 nAh
Across a day at one reading per minute (1440 readings), on a 225 mAh (225,000,000 nAh) cell:
- CoAP:
4.27 x 1440 = 6144 nAh/day, so225,000,000 / 6144 = 36,621 days - HTTP:
17.24 x 1440 = 24832 nAh/day, so225,000,000 / 24832 = 9,061 days
The battery ratio is 36,621 / 9,061 = 4.04, and it equals the byte ratio 97 / 24 = 4.04. Every factor except message size cancels, so the whole result was fixed the moment the byte counts were chosen. And notice which bytes made HTTP 97: no TCP handshake is modeled here. Count the connection setup — as a fuller model would — and HTTP balloons past 400 bytes and the advantage grows well beyond 4x. (Both lifetimes assume radio transmission is the only draw modeled — real CR2032 shelf life and MCU sleep current would dominate long before either number is reached.)
The design meaning is that the specific multiplier — 4x here, larger elsewhere — is a modeling choice about which overhead you count, while the robust, model-independent result is the proportionality itself: radio energy tracks bytes on the wire, so the honest claim is “fewer bytes, proportionally longer battery,” not a fixed headline number.
Every number above is taken from the chapter’s own material and re-derived step by step.