For a 10-Byte Payload, the Topic Is the Message

For a 10-Byte Payload, the Topic Is the Message

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

foundations
math-foundations
calculation-audit
mqtt
Ada ADA · CALCULATION AUDIT

For a 10-Byte Payload, the Topic Is the Message

Every MQTT message here carries a 4-byte header and a 10-byte payload, plus its full topic string. Swap a 42-byte verbose topic for an 8-byte short one and each message drops by 34 bytes — larger than the payload itself — which across 1000 sensors at 100 messages a day adds up to 1.16 GB a year. This audit follows the per-message formula to show why, for a 10-byte payload, the topic is the message.

Companion to the chapter MQTT Packet and Broker Features — every number here comes from that chapter.

See the relationship before changing it

The figure reads from left to right. The blue card is topic bytes removed. The middle card applies the page rule. The green card is fleet-year saving. Walk the arrows once: set the input, apply the rule, then read the result with its unit.

Topic bytes removed changes fleet-year saving An input card leads through the rule saving = 1,000 x 100 x 365 x bytes / 1,073,741,824 to the fleet-year saving result. INPUT PAGE INPUT APPLY THE RULE predict calculate check units OUTPUT RESULT
Walk the arrows. A naming choice repeats across every device and every message in the fleet.

Derive the baseline in four named moves

  1. 1

    Name the input. The chapter baseline is 34 bytes/message.

  2. 2

    Name the relationship. saving = 1,000 x 100 x 365 x bytes / 1,073,741,824

  3. 3

    Substitute with units. 1,000 x 100 x 365 x 34 / 1,073,741,824 = 1.16 GiB

  4. 4

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

Predict, then change topic bytes removed

Try Predict the direction of saving = 1,000 x 100 x 365 x bytes / 1,073,741,824. Test another topic bytes removed, then compare fleet-year saving.

34 bytes/message
Chapter baseline
Fleet-year saving

Observe A naming choice repeats across every device and every message in the fleet. Reset topic bytes removed to 34 and compare fleet-year saving.

Explain A naming choice repeats across every device and every message in the fleet.

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 topic bytes removed moves here. Field effects named in the technical boundary stay fixed.
TryRecompute Saving per message: Slong - Sshort = (4 + Tlong + 10) - (4 + Tshort + 10) = Tlong - Tshort = 34 bytes.
ObserveTrack Across a fleet-year: 1000 devices x 100 msgs/day x 365 days x 34 bytes = 1,241,000,000 bytes.
ExplainExplain In binary units: 1,241,000,000 / (1024 x 1024 x 1024) = 1.156 GiB, matching the chapter's 1.16 GB.

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

Ada: The callout above prices topic length in bandwidth. I want to show why the saving is so large by looking at what the per-message formula keeps and what it cancels. Every message costs S_msg = S_fixed + S_topic + S_payload, with S_fixed = 4 bytes and S_payload = 10 bytes fixed on both the long and short designs.

Because the header and payload are identical on both sides, they cancel exactly when you subtract, and the entire per-message saving is the difference in topic length. The chapter’s verbose and abbreviated topics differ by 34 bytes, so:

  • Saving per message: S_long - S_short = (4 + T_long + 10) - (4 + T_short + 10) = T_long - T_short = 34 bytes
  • Across a fleet-year: 1000 devices x 100 msgs/day x 365 days x 34 bytes = 1,241,000,000 bytes
  • In binary units: 1,241,000,000 / (1024 x 1024 x 1024) = 1.156 GiB, matching the chapter’s 1.16 GB

Here is the part worth keeping: that 34-byte topic difference is 34 / 10 = 3.4x the entire 10-byte payload. For small telemetry the topic string is the largest single field on the wire, so a naming convention is not cosmetic. It is a bandwidth, energy, and airtime decision that scales linearly with every device and every message the fleet will ever send.

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

Technical boundaries. This byte ledger deliberately does not simulate TCP segmentation, TLS records, broker queues, or topic-alias negotiation. It compares the fixed MQTT topic and payload lengths using the packet fields stated in the chapter.