ARR-OTA All articles
Engineering Deep Dive

The Bandwidth You Save Is Somewhere Else: A Cost Model for Delta OTA

ARR-OTA

The appeal and the accounting error

A binary delta promises a smaller download, and at first glance the math seems simple: ship the difference, not the whole firmware image. For a fleet, however, the relevant unit is not bytes saved per release. It is cost per successfully updated device. That cost includes CPU seconds, flash writes, RAM headroom, retry bandwidth, support tickets, and the engineering time required to maintain a patch graph. When those items are omitted, delta OTA looks like a free win. It rarely is.

What the diff engine is doing

Most production delta systems fall into three families. Byte-level differencers such as bsdiff and xdelta3 find common substrings and encode copy and insert instructions. Dictionary-based compressors such as zstd with a previous image as dictionary build a patch from a compressed stream. Block or content-defined chunkers compare fixed or rolling-hash-defined blocks and ship changed chunks. Executable-aware tools can normalize linker layout before diffing.

Each family trades patch size against memory. bsdiff can produce small patches but historically needs substantial working memory relative to image size. xdelta3 is lighter but may leave more bytes on the wire. A dictionary-based patch may be compact yet require the decoder to hold or stream a large dictionary. On a Cortex-M-class target with tens of kilobytes of RAM, the algorithm that wins on a laptop is often the wrong one.

Build reproducibility matters more than the algorithm. If two firmware builds differ in timestamps, build paths, or section ordering, the differencer sees noise and emits a large patch. Stable builds make small deltas; unstable builds make delta systems look ineffective.

The version-skew matrix

A fleet is never on one version. Suppose devices report versions A through F and the target is G. A naive all-pairs matrix needs 21 patches for seven versions. Add another version and the count grows. Storage grows with it, because every patch needs a base image or a verifiable reference to one. Signing and testing grow too: every edge in the graph is a path someone must validate.

Production programs usually do not need all pairs. They need a supported upgrade graph. Common policy is direct patches from the last one or two releases, full images for older versions, and occasional bridge releases that move long-tail devices onto a modern base. The bridge release is not elegant, but it caps the matrix and gives support a finite set of paths.

The matrix also needs truth. A device may claim version D while its flash contains a partially applied patch or a vendor-modified build. Delta application should verify the base image hash before writing, not merely trust a version string.

Where the costs hide

The first hidden cost is compute. Patching an image takes time. On a constrained MCU, that time may be seconds to minutes, during which the device cannot perform its primary function. If the patch runs on battery, the energy cost is real. If it runs on a solar-powered sensor in winter, it may be unavailable.

The second is storage. Atomic update usually requires the running image, the incoming patch, the reconstructed target, and metadata to coexist. A device with 256 KB of flash may not have room for all four. Compression reduces download size but can increase RAM pressure during decompression. Staging in external flash introduces its own failure modes.

The third is flash wear. Every delta application writes the target image. A failed patch that retries writes again. Rollback writes again. On devices that update frequently, delta efficiency on the wire can coexist with unnecessary erase cycles on the die.

The fourth is operational complexity. Every patch needs a base, a signature, a test result, and a rollback story. Every new release multiplies the test matrix. The savings in cellular egress may be consumed by the labor of maintaining a patch graph that only a few devices use.

Failure modes worth designing for

Delta-specific failures include base mismatch, truncated patch, decoder out-of-memory, power loss during reconstruction, and a patch that applies successfully but produces an image that fails attestation. Interrupted updates are common in the field. The device needs a journal, a resume or restart policy, and a guaranteed fallback to a full image. A patch that cannot be safely abandoned is not a patch; it is a trap.

Retries amplify bandwidth. If five percent of a cohort fails and retries three times, the effective bytes per device rise. A full image that succeeds once can be cheaper than a delta that succeeds on the third attempt.

A practical decision rule

Model the total cost per successful update:

C = patch_bytes × egress_price + device_seconds × energy_rate + retry_rate × retry_cost + maintenance_hours / devices_updated.

Use delta when the patch is materially smaller than the full image, the device has verified staging space, the decoder fits the RAM budget, and the supported version graph is small. Use full images when the fleet is highly skewed, the target is deeply constrained, or the operational team cannot test every edge. For metered cellular fleets, the bandwidth threshold can be lower. For Wi-Fi fleets with abundant power, full images may be simpler and more reliable.

Guardrails for fleet scale

Keep a canonical base image registry with hashes. Sign patches and manifests. Cap patch chains. Expire deltas that no supported device can use. Track apply time, retry rate, and fallback rate per model. Run canary cohorts before broad rollout. Most important, measure the outcome that matters: successful updates per engineering hour, not bytes saved per release.

All Articles

Related Articles

The Scheduler Is the Product: Engineering OTA Deployment Windows That Respect Physics and People

The Scheduler Is the Product: Engineering OTA Deployment Windows That Respect Physics and People

The Audit Will Ask for Receipts: Shipping a Signed SBOM With Every Firmware Build

The Audit Will Ask for Receipts: Shipping a Signed SBOM With Every Firmware Build

The Poll That Ate the Fleet: Designing Check-In Intervals That Scale Past a Million Devices

The Poll That Ate the Fleet: Designing Check-In Intervals That Scale Past a Million Devices