Section 8.23

Commit-confirmed update

Definition

A commit-confirmed update is a change that a system applies on trial and keeps only if an authorized party confirms it before a deadline. The confirmation is a separate message or action that arrives after the change is in use. If no confirmation arrives in time, the system automatically returns to the state it had before the change. The scheme recovers from changes that cut off management: such a change also blocks the confirmation, so the system reverts by itself.

The idea

An administrator changes the packet filter of a router at a remote site, the rules that decide which network traffic the router lets through, working over a network connection to the router. The new rules contain a mistake that blocks the administrator’s own connection. The router keeps running the broken rules, nobody can reach it to undo them, and someone must travel to the site. With a commit-confirmed update, the router applies the rules on trial and starts a timer. If the administrator can still reach the router, the administrator confirms, and the rules stay. If the rules locked the administrator out, no confirmation arrives, the timer runs out, and the router restores the previous rules.

The core idea is to let the absence of a confirmation count as evidence of failure. The confirmation travels over the path that the change could break, so its arrival shows that the path still works, and its absence at the deadline shows that something went wrong, even when the system cannot tell what. A dead man’s switch on a train works the same way: the driver must keep operating a control, and when that stops, the train brakes. The analogy stops at what is proven. The switch shows that the driver is present, not that the driver is driving well. A confirmation likewise shows only what the confirming party actually tested.

How it works

A commit-confirmed update runs in six steps.

  1. Keep the fallback. The current state stays intact as the state to return to.

  2. Apply on trial. The system puts the candidate, the new state, into use and records that it is on trial. If the trial must survive a restart, as for firmware, that record is durable, meaning certain to survive a loss of power.

  3. Open the confirmation window §8.24. A timer, or a count of permitted restarts, starts; the Confirmation window entry treats its rules.

  4. Test. The confirming party, which can be a person, a management server or the new software itself, checks that the candidate still does what must not break.

  5. Confirm. The confirming party sends a confirmation that names this candidate. The system checks that it is authentic and current, then durably records the candidate as permanent.

  6. Revert otherwise. If the window closes without a valid confirmation, or the trial is canceled, the system restores the fallback state.

NETCONF (Network Configuration Protocol), the IETF protocol for configuring network devices defined in RFC 6241, calls this a confirmed commit. A client sends a commit operation with the confirmed parameter. The server applies the new configuration and must revert it unless a confirming commit, a commit without confirmed, arrives within the timeout §9.34: 600 seconds unless the client sets confirm-timeout. A further confirmed commit before expiry resets the timer. The server also reverts if the session, the client connection, that issued the confirmed commit ends before the confirmation, and if the device restarts before the timeout expires. The persist parameter changes the session rule: it attaches a token, a value the client chooses, to the trial, the trial survives the end of its session, and the confirming commit may come from any session that presents the same token as persist-id. The cancel-commit operation reverts at once.

Juniper Networks’ Junos operating system offers the same feature as the command commit confirmed. Juniper’s documentation presents it as a way to verify that a configuration change works and does not prevent access to the router. Unless the administrator enters commit or commit check within 10 minutes, or within a number of minutes given with the command, the router automatically rolls back to the previous configuration.

Firmware updates use the same pattern with a restart in the middle. An A/B update §8.10 keeps the old and the new firmware image, the complete program, in two separate storage areas called slots. The bootloader §6.30, the program that runs first after every reset and chooses what to start, starts the new image on trial, and the new image confirms itself by writing a flag in its slot’s record once its own tests pass. MCUboot, an open-source bootloader for microcontrollers §6.1, in its test mode returns to the previous image at the next reset if the new image has not written its confirmation by then.

A confirmation is worth exactly what it shows. A sound confirmation meets four conditions.

  1. It names the candidate. It carries the candidate’s identity, such as a version number or a cryptographic hash §5.1 of its bytes, or it is bound to one trial by a token. A confirmation meant for version 7 then cannot make version 8 permanent, and a delayed confirmation cannot confirm a later trial.

  2. It comes from an authorized party and is fresh. A forged confirmation could make a broken or malicious candidate permanent. A recorded confirmation sent again later, a replay attack §1.26, could confirm a trial it was never meant for.

  3. It follows a test, made on the new state, of the property that must not break. The test runs after the candidate is in use and goes through the candidate’s rules, not around them. If the property is that the device can still be managed, the test opens a new management connection under the new rules.

  4. It is recorded durably in one step. A loss of power cannot leave the permanent mark half written, so a restart finds the candidate either on trial or confirmed, never between.

Worked example

A device accepts management connections on one network port. At 0 s an administrator applies new packet-filter rules on trial with a 600-second window, so the deadline is 0+600=6000 + 600 = 600 s. The device’s packet filter is stateful: it lets packets of connections that were open before the change pass without checking them against the new rules. The new rules contain a mistake that rejects every new management connection.

A weak confirmation. At 120 s the administrator confirms through the connection that was opened before the change. That connection still works, because the stateful filter exempts it. The device makes the rules permanent, with 600−120=480600 - 120 = 480 s of the window unused. The next day the old connection has closed, every new connection is rejected, and nobody can reach the device. The confirmation proved only that an old connection survived.

A sound confirmation. At 60 s the administrator opens a second, new connection, and the device rejects it. The administrator does not confirm. The device restores the previous rules at 600 s, or at once if the administrator cancels the trial. After the mistake is corrected and a new trial starts, a new connection that succeeds under the new rules is the evidence that justifies confirming.

Stated precisely

Let cc be the candidate, ff the fallback state, ss the time at which cc comes into use, and WW the window length, both measured by one clock. Let PP be the declared property: a condition on the running system that the update must not break, such as accepting a new authenticated management connection. The contract has two parts.

The confirming party sends the confirmation only after observing PP on the running cc. The conclusion “cc is permanent, and PP held for cc” then rests on three assumptions: the test exercised PP through the rules of cc after time ss; a confirmation cannot be forged or replayed; and restoring ff is itself safe against a crash. The contract says nothing about whether PP still holds later, or about any property other than PP.

Limits and common mistakes

A confirmation proves the tested property, at the tested time, for the tested client. A configuration can be reachable and still unsafe, or reachable only from the client that tested it.

A confirmation written by the new software about itself proves little if it is written early. Firmware that confirms itself as soon as it starts cannot detect a fault in code that runs later, such as the code that receives the next update. Self-confirmation belongs after the checks that matter; the Reachability after update §8.35 entry treats the most important one.

Reverting can undo changes made by others. RFC 6241 warns that on a configuration shared by several sessions, a revert can remove other sessions’ changes unless the configuration is locked during the trial.

Confirmation and the refusal of old versions must be coordinated. A device that raises its stored version floor, the lowest version it accepts, before the candidate is confirmed has made its own fallback impossible; the Rollback versus anti-rollback §8.26 entry treats this conflict.

An attacker who can delay or block the confirmation can force a revert. Reverting is the safe direction, but it means such an attacker can stop changes from becoming permanent.

The window length is a trade-off. A long window keeps a bad change in place longer; a short one reverts good changes whose confirmation is slow.

Questions answered

What exactly must a confirmation prove about the new state?

A confirmation must prove that the exact candidate now on trial has the declared property that the update must not break, observed after the candidate came into use and through the candidate’s own rules. In a commit-confirmed update, the confirmation is the message or action that makes a change on trial permanent; without it, the system returns to its previous state when a deadline passes. For a change that could cut off management, the property is usually that a new authenticated management connection succeeds under the new rules. For firmware, it is usually that the new image has passed its self-tests and can receive the next update.

Three further conditions make the proof count. The confirmation names the candidate, by version number, cryptographic hash or trial token, so that it cannot confirm a different version. It comes from an authorized party and is fresh, so that it is neither forged nor an old confirmation sent again. And the system records it durably in one step. A confirmation sent over a connection opened before the change, or written by firmware before its risky parts have run, proves less than it appears to. No confirmation proves that the new state is correct in every respect or will keep working; it proves only what was tested.

Related entries: Confirmation window (§8.24), Last-known-good state (§8.25), Reachability after update (§8.35), Rollback versus anti-rollback (§8.26), A/B update (§8.10), Staging versus commit versus activation (§8.22). Further reading: [22].