For a 10-Byte Payload, the Topic Is the Message
Ada re-derives this chapter’s own numbers step by step, at full precision
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.
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.