A 4x Advantage That Is Really a Modeling Choice

A 4x Advantage That Is Really a Modeling Choice

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

foundations
math-foundations
calculation-audit
coap
Ada 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.

Try

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. Calculate this case.

Observe

A 4x battery claim drawn from a byte-count difference is worth tracing end to end. Check shows this.

Explain

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. Check confirms it.

See the relationship before changing it

The figure reads from left to right. The blue input is compared message size. The middle card names the page’s rule. The green output is energy ratio versus 24-byte coap. The arrow matters: change the input, apply the rule once, then read the result with its unit.

Compared Message Size changes energy ratio versus 24-byte coap A three-part teaching diagram connects compared message size, the rule ratio = compared bytes / 24 bytes, and energy ratio versus 24-byte coap. INPUT Compared message size APPLY THE RULE predict calculate check units OUTPUT RESULT
Walk the arrow. With every other term fixed, the byte ratio is the energy ratio.

Derive the baseline in four named moves

  1. 1

    Name the input. The chapter baseline is 97 bytes.

  2. 2

    Name the relationship. ratio = compared bytes / 24 bytes

  3. 3

    Substitute with units. 97 / 24 = 4.04 times

  4. 4

    Read the result. Keep the unit beside the value, then use the result only inside the technical boundary below.

Predict, then change compared message size

Try Predict how energy ratio versus 24-byte coap responds when compared message size moves. Calculate compared message size; compare energy ratio versus 24-byte coap with that prediction.

97 bytes
Chapter baseline
Energy ratio versus 24-byte CoAP

Observe Return to 97 bytes. Recheck energy ratio versus 24-byte coap with compared message size at its chapter value.

Explain With every other term fixed, the byte ratio is the energy ratio.

Check yourself

What should you do before trusting a moved-slider result?
Answer: Predict its direction, apply the displayed relationship, keep the units, and compare the reset value with the chapter’s worked baseline.
What does this small model leave out?
Answer: Only compared message size moves here. The energy ratio versus 24-byte coap calculation excludes field effects listed below.

Technical boundaries

Outside the fixed “A 4x Advantage That Is Really a Modeling Choice” arithmetic are link-layer overhead, retransmissions, security handshakes, socket setup, radio tail time, or platform-specific serialization cost; “A 4x Advantage That Is Really a Modeling Choice” therefore reports only its named fixtures.

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, so 225,000,000 / 6144 = 36,621 days
  • HTTP: 17.24 x 1440 = 24832 nAh/day, so 225,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.