Delta Updates
Delta updates can reduce the amount of data transferred and the time required to install a new version by reusing locally available parts of the old version of a system. This is especially useful for devices on metered or bandwidth-constrained connections. Delta updates are particularly effective when there are frequent updates with small changes. According to our benchmarks, they can reduce the amount of data transferred by up to 90%.
Rugix is the only open-source OTA solution that ships with ready-made support for both dynamic and static delta updates.
Dynamic vs. Static
There are two ways to compute the delta between an old and a new version, and Rugix Ctrl supports both.
Dynamic delta updates let Rugix Ctrl decide on the device which parts of the new bundle it already has locally and which it still needs to download. Under the hood, this is HTTP range queries against the bundle, driven by the block index that every Rugix bundle carries. The server only needs to support range requests. Almost every HTTP server does, including S3-compatible object stores. Nothing has to be pre-computed.
Static delta updates rely on a pre-computed patch between two specific versions. rugix-bundler delta OLD NEW PATCH produces a patch bundle that the device installs in place of the full bundle. Static deltas can be roughly twice as efficient as dynamic ones for the same update, but the operational cost is real: you have to compute deltas for every relevant version pair and route the right patch to the right device.
Cost Savings Calculator
Estimate annual download costs for your image size, update schedule, and fleet. The calculator uses two-year download-size models, with correction factors for block-based diffing from our newer benchmarks.
Dynamic Delta Updates
When you install an update via HTTP, the server supports range queries, and the bundle and system contain the necessary block indices, Rugix Ctrl adaptively downloads only the parts of the update that it does not already have, e.g., within the currently booted system partition.1 Rugix Ctrl also reuses chunks of files in its store, such as container images of apps.
Server Requirements
Any HTTP server that supports byte-range requests works. This includes virtually every standard HTTP server, all S3-compatible object stores, and most CDNs. No special infrastructure is required.
Concurrent Fetching
Rugix Ctrl 1.4 combines adjacent missing blocks into larger HTTP ranges, reuses connections, and fetches several ranges concurrently. Downloads overlap with payload verification, decompression, and writes. This reduces waiting on network round trips and is enabled by default for existing block-encoded bundles. See the delta update benchmarks for measured installation times and network traffic.
Slot Indices
Rugix Ctrl always retains the verified block index of installed slot data when the bundle provides it. This applies to block and file slots in full and incremental system updates and prepares the installed data for later dynamic delta updates. Existing matching indices are always used to reuse local blocks.
To also reuse data from slots that do not yet have a matching index, enable computation of missing indices in the Rugix Ctrl configuration:
[install]
auto-index = trueWhen installing a full system update, Rugix Ctrl reads the required chunking and hashing parameters from each payload’s block index and computes any missing matching indices for existing source slots before transferring payload data. This lets the first update after enabling the option reuse local data, including factory-installed data.
The option is disabled by default and applies only to full system updates. Incremental updates retain indices for regular slot payloads but do not compute missing source indices. Update bundles built with Rugix Bakery include block indices using casync-64 and sha512-256 by default.
For background on what block indices are and how they work, see Update Bundles reference: Block Encoding.
Static Delta Updates
A static delta is a patch bundle, computed ahead of time from the old and new update bundles with Rugix Bundler’s delta subcommand:
rugix-bundler delta OLD NEW PATCH
If you are using Rugix Bakery, you can use ./run-bakery bundler delta instead.
By default, Rugix Bundler will compute a patch for the system and boot slots, respectively. As the boot partition is usually modified by Rugix, the delta for the boot slot is computed against the system slot of the old version. If you want to compute patches for other slots, use the --slot option to provide a list of slots. You can use the syntax new:old to compute a patch for the new slot of the new version against the old slot of the old version.
For app bundles, Rugix Bundler also computes patches for app-file payloads with the same app and path in both bundles.
Slots must be immutable for static delta updates to work.
Static delta payloads do not provide a block index for the reconstructed slot data, so Rugix Ctrl does not save an index after applying the patch. With install.auto-index enabled, a missing index can be computed when that slot is used as a source during a full system update.
Rugix Bundler will include a hash of the old slot data in the patch bundle. This hash is used by Rugix Ctrl when installing the update to determine whether the required source for applying the patch is actually installed. In addition, it also includes a hash of the new slot data which is used to check the integrity of the new version after installing it.
Targeting
You can either track versions yourself (outside Rugix) to target updates for specific versions, or you can query Rugix’s slot database through rugix-ctrl system info to get information about what is installed to determine which update to use.
Limitations
Static delta updates currently only work after the first update has been installed, as this is when the slot database is populated. There is currently no built-in way to initialize the slot database prior to the first update.
Update Simulator
To estimate the impact of different delta update techniques on your specific update scenarios, use the simulator built into Rugix Bundler. For details about the different techniques, see our blog post on Efficient Delta Updates:
rugix-bundler simulator
Footnotes
-
Block reuse is best-effort: a block is taken from a slot only if it still matches the index. If a slot has changed since its index was created, the changed blocks are downloaded from the server instead, so the update still succeeds, just with less bandwidth saved. A read-only system partition maximizes reuse and is recommended in any case; Rugix Ctrl’s state management makes one easy. ↩