14  Packet Protocol Overhead

Byte Budgets, Encapsulation Layers, Payload Share, and Review Records

fundamentals
packet
protocol
overhead

14.1 In 60 Seconds

Every packet carries two kinds of bytes: the payload you actually care about, and the overhead the network needs to deliver it, such as addresses, ports, framing, and error checks. Protocol overhead is mostly fixed per packet, so it barely matters for large transfers but dominates the tiny messages that constrained IoT devices send. Understanding the byte budget is what separates an efficient sensor fleet from one that wastes most of its airtime and energy on packaging.

14.2 Start With the Story

Start with a message crossing a link where the receiver must know where the packet starts, what each field means, and whether any byte was corrupted. The core idea in Packet Protocol Overhead is simple: packet and format design is about boundaries, field meaning, compactness, checks, and the evidence that the receiver can parse the payload safely. This page focuses that idea on Packet-structure protocol overhead, encapsulation layers, payload share, batching trade-offs, and a repeatable byte-budget review workflow. In everyday IoT, JSON, CBOR, Protobuf, custom binary, framing bytes, CRCs, and overhead budgets are practical choices with reliability and debugging costs. Start simple: draw the packet as fields, mark the payload and checks, then justify the format only after the parse path is clear.

14.3 The Packaging Can Outweigh the Contents

Imagine mailing a single small key in a large box with bubble wrap, an address label, a return label, and a tracking slip. The packaging and paperwork can easily weigh more than the key itself. A network packet is the same: the payload is the key, and the headers are the box, the labels, and the tracking. For a large shipment the packaging is a rounding error, but for one tiny item it is most of what you pay to send.

The important idea is that overhead is roughly constant per packet. Sending more useful data per packet spreads that fixed cost across more payload, while sending tiny payloads pays the same packaging cost over and over.

If you only need the intuition, this layer is enough: each packet has fixed overhead for addressing, framing, and control. Small IoT payloads suffer proportionally more overhead, so efficiency comes from sending fewer, fuller packets rather than many tiny ones.

Payload share is the simple way to see this: it is the fraction of transmitted bytes that is actual data. A payload share of ninety percent means the network is mostly carrying your data. A payload share of twenty percent means you are mostly paying to move headers.

Suppose a water-meter node reports an 8-byte timestamp and pulse count in a UDP/IPv4 datagram. Before link framing, UDP and IPv4 add 28 bytes, so the packet carries 8 useful bytes out of 36 total bytes: about 22 percent payload share. If the node sends eight readings together, the useful payload becomes 64 bytes while the same UDP/IPv4 header is still 28 bytes, so the share rises to about 70 percent before link framing. That improvement is not compression; it is fixed-cost amortization. The limit is freshness and frame size: a leak alarm may need immediate delivery, while a routine hourly total can wait and batch safely.

Protocol overhead comparison for a 10-byte IoT payload showing BLE at 23 bytes total, LoRaWAN at 27 bytes, UDP over IPv4 at 38 bytes, and TCP over IPv4 at 50 bytes, with payload and header portions stacked.
A 10-byte payload can be most of a BLE packet but only one fifth of a TCP/IPv4 packet; choose the stack and batch size from the useful-byte share, not from protocol names alone.

flowchart TD
  A["Small sensor payload"] --> B["Add app, transport, network, and link overhead"]
  B --> C["Compute payload share"]
  C --> D{"Share too low?"}
  D -- "yes" --> E["Batch readings or choose a lighter stack"]
  D -- "no" --> F["Keep the current packet shape"]
  E --> G{"Still fits the link frame?"}
  G -- "yes" --> H["Use the improved budget"]
  G -- "no" --> I["Reduce batch size to avoid fragmentation"]

The One-Minute View

Overhead is fixed per packet

Addressing, framing, and control bytes are added to every packet regardless of how small the payload is.

Small payloads pay the most

When the payload is tiny, the fixed header can be larger than the data itself, wasting bandwidth and energy.

Fuller packets are cheaper

Carrying more data per packet, or choosing a lighter protocol, raises the share of bytes that are useful.

Beginner Examples

  • A 1-megabyte file transfer barely notices a few dozen header bytes per packet, because the payload dwarfs the overhead.
  • A sensor sending a 4-byte reading can spend far more bytes on headers than on the reading itself.
  • Sending ten readings in one packet pays the header cost once instead of ten times.

Payload Share Knowledge Check

If this gives you the principle, you can stop here. Continue to Practitioner when you need to add up a real byte budget and decide how to improve it.

14.4 Apply It: Add Up the Byte Budget

A byte-budget review lists the protocol layers wrapped around your payload, sums their headers, and computes the payload share. If the share is low, you change the design before you scale the fleet, not after.

Walkthrough: A Byte-Budget Review

  1. List the encapsulation layers. Identify which application, transport, network, and link protocols wrap the payload.
  2. Sum the header bytes. Add each layer’s header, and any trailer such as a frame check sequence.
  3. Compute payload share. Divide the payload size by the total transmitted size.
  4. Compare to the link budget. Check whether the total fits the link’s frame size and the device’s energy and airtime budget.
  5. Decide an action. If the share is poor, batch readings, use a lighter protocol, or compact the payload, then re-check.

Encapsulation: Headers Stack Up

The payload is wrapped layer by layer, and each layer adds its own header. The sizes below are the defining minimum header sizes for these named protocols; options and addresses can make some of them larger.

Layer
Example
Header Size
What It Carries
Application
CoAP / MQTT
CoAP 4 bytes; MQTT from 2 bytes
Message type, IDs, and topic or resource path.
Transport
UDP / TCP
UDP 8 bytes; TCP from 20 bytes
Source and destination ports, and a checksum.
Network
IPv4 / IPv6
IPv4 from 20 bytes; IPv6 40 bytes
Source and destination addresses and routing fields.
Link
Ethernet
14-byte header plus 4-byte FCS
Local addresses, frame type, and an error check.

Worked Example: A 12-Byte Reading Over UDP/IPv4

A node sends a 12-byte reading as a UDP datagram over IPv4. The transport and network headers alone are 8 + 20 = 28 bytes, before any link framing. The payload share is therefore low:

payload = 12 bytes
header  = 8 (UDP) + 20 (IPv4) = 28 bytes
total   = 12 + 28 = 40 bytes
payload share = 12 / 40 = 30%

Seventy percent of the transmitted bytes are packaging. Batching ten readings into one datagram changes the picture sharply: 120 payload bytes against the same 28-byte header gives a payload share of about 120 / 148 = 81%. The fixed header was paid once instead of ten times.

The arithmetic is small enough to audit directly. The optional panel below works only with numbers already used in this chapter, so another reviewer can reproduce the byte-budget decision without trusting a calculator.

Improving the Budget

Batch readings

Combine several samples into one packet so the per-packet header is amortized across more data.

Use a lighter protocol

For constrained nodes, a compact application protocol over UDP avoids the larger control overhead of heavier stacks.

Compact the payload

A smaller payload helps, but watch the ratio: shrinking an already tiny payload makes the overhead share worse, not better.

Batching Knowledge Check

If you can total a byte budget and pick an action, you can stop here. Continue to Under the Hood for the efficiency math and the link limits behind the decision.

14.6 Summary

  • Every packet carries fixed overhead for addressing, framing, and control, plus the useful payload.
  • Because overhead is roughly fixed per packet, small IoT payloads suffer proportionally more overhead than large transfers.
  • Payload share, P divided by P plus H, measures how much of the transmitted data is actually useful.
  • Headers stack through encapsulation: application, transport, network, and link each add their own bytes, and link layers may add a trailer too.
  • Batching readings amortizes the fixed header across more payload, trading efficiency against latency and loss exposure.
  • The link’s maximum frame size caps batching; exceeding it forces fragmentation, which reintroduces overhead.
Key Takeaway

Protocol overhead is the packaging around your data, and it is paid per packet. Measure the full encapsulation stack, compute the payload share, and send fewer, fuller packets up to the link frame limit to keep useful bytes ahead of packaging bytes.

14.7 See Also

Packet Anatomy

See the header, payload, and trailer regions that make up the bytes you are budgeting.

Packet Framing

Learn how frames mark their own boundaries, which is part of the link-layer overhead.

Packet Error Detection

Understand the checksums and frame checks that trade a few overhead bytes for integrity.