Definition
A confirmation window is the period during which a change applied on trial can be made permanent by a confirmation, as in a commit-confirmed update §8.23. It is defined by the event that opens it, its length, the clock that measures it, and the action taken when it closes without a confirmation, normally a return to the previous state. A complete definition also says what a restart does to an open window. The length is a chosen policy value, not a measurement of how long confirmations take.
The idea
A device starts new firmware on trial and must receive a confirmation within 60 seconds. Sixty seconds from when: from the moment the update was committed, or from the moment the new firmware started to run? If starting takes 20 seconds, the two answers differ by a third of the window. And what happens if the new firmware crashes after 30 seconds and the device restarts? A timer kept only in RAM is lost at the restart. If the new firmware simply opens a fresh 60-second window each time it starts, firmware that crashes every 30 seconds never reaches a deadline, and the device repeats start, crash and restart without end. That cycle is called a boot loop, or reboot loop.
The window is the rule that turns “no confirmation yet” into a decision. It is only as sound as its edges: when it opens, how its time is counted, what closes it, and which events, such as a restart, end it early. Each edge must be chosen so that every failure eventually closes the window and leads to the previous state.
The same idea appears outside firmware. Matter, a connectivity standard for smart-home devices, uses a window called the fail-safe timer when a device is set up: the device doing the setup starts it with the ArmFailSafe command and a length in seconds, and if the CommissioningComplete command does not arrive before the timer expires, the new device discards the configuration changes made under it.
How it works
Six choices define a window.
Opening event. Common choices are the commit of the trial version and the moment the trial version starts to run. Opening at the start of running gives the tester the whole window. Opening at the commit counts the restart time against the window, which also limits how long the restart may take.
Length. A policy value: long enough for a correct confirmation, with a margin for slow networks, and short enough that a bad change does not stay long. NETCONF (Network Configuration Protocol) defaults to 600 seconds, and the Junos operating system of Juniper Networks to 10 minutes.
Clock. A monotonic clock §9.35, one that never runs backwards and does not change when someone sets the time of day, measures the window. A wall clock §9.36, the time of day, can jump when it is corrected, which can end a window early or stretch it. The uptime of a device, its time since the last start, returns to zero at every reset.
Decision point. A confirmation and the expiry can arrive almost together. One indivisible step decides between them, for example a change of state from trial to confirmed or to reverting under one lock, which lets only one piece of code change the state at a time: the first change wins, and the reply to the confirming party says which won. The design also states whether a confirmation processed exactly at the deadline counts.
Expiry action. Usually a return to the previous state. The return must itself be safe against a crash, and it must stop everything the trial version started; a return that only stops a timer while the trial code keeps running is not a return. For firmware, restarting into the previous version does both.
Reset rule. What a restart during the window does.
The reset rule has three sound forms.
A restart counts as failure. The trial ends at the first restart before confirmation, and the device starts the previous version. NETCONF requires this for its confirmed commits: if the device restarts before the timeout §9.34 expires, the server must restore the configuration from before the confirmed commit. MCUboot, an open-source bootloader §6.30 for microcontrollers §6.1, behaves the same way in its test mode, so its window lasts until the next reset.
A limited number of tries. The bootloader, the program that runs first after every reset, keeps a count of remaining tries in persistent storage and lowers it before each trial start, so that a crash during the trial cannot skip the lowering. When the count reaches zero without a confirmation, the bootloader starts the previous version. Android’s A/B updates §8.10, which keep two copies of the system in storage areas called slots, keep such a count for each slot, and the U-Boot bootloader has a boot counter with a limit (
bootcountandbootlimit).A deadline that survives restarts. The device stores the deadline and measures it with a clock that keeps running through a reset, such as a real-time clock §6.19 with its own battery.
Opening a fresh full window at every start, with nothing stored, is not a sound form: a version that crashes sooner than the window length restarts forever.
A watchdog timer §6.16, a hardware timer that resets a device whose software stops responding, turns a hang into a restart. The reset rule then also catches a trial version that freezes instead of crashing. Without a watchdog timer, a frozen trial version may also stop the code that would have noticed the expiry.
Worked example
Firmware is committed on trial at 0 s. Starting takes 4 s, so the new firmware runs from 4 s. The window length is s.
Window opened at the commit: the deadline is s, which leaves the firmware s for its tests.
Window opened at the start of running: the deadline is s, which leaves the firmware the full 60 s.
Both choices are valid. They make different promises, and the design must say which one it makes.
Now suppose the new firmware crashes 30 s after each start. Each restart takes 4 s, so one cycle of starting and running lasts s.
A fresh window at every start, nothing stored. Every run ends after 30 s, before its 60 s are up, so no deadline is ever reached. The firmware starts at 4 s, crashes at 34 s, starts again at 38 s, crashes at 68 s, and so on. This is a boot loop.
A restart counts as failure. The firmware crashes at 34 s. At the next start the bootloader finds an unconfirmed trial and starts the previous firmware, which runs from s.
Three tries. The bootloader lowers the count before each trial start: at 0 s from 3 to 2, at 34 s from 2 to 1, and at 68 s from 1 to 0. The third trial run starts at s and crashes at s. At that start the count is 0, so the bootloader starts the previous firmware, which runs from s. The new firmware ran s in total.
At the boundary: with the window opened at the start of running, the deadline is 64 s. Under the rule “accepted only if processed strictly before the deadline”, a confirmation processed at 63.99 s is accepted and one processed at 64.00 s is rejected. If the clock counts in steps of 10 ms, it cannot order two events that fall in the same step, so the decision point, not the clock, decides between them.
Stated precisely
Let be the number of trial starts the reset rule allows, with when a restart counts as failure. Number the trial runs . Let be the time at which the window of run opens, and the window length, both measured by one clock that neither stops nor jumps during the run. The contract has two parts.
The trial version becomes permanent exactly when the decision point processes a valid confirmation for it at a time with in some run .
Otherwise the expiry action starts at the first time in the current run, or at the start that follows a restart during run , whichever comes first.
When each run’s window opens at the start of the run, a trial that is never confirmed ends within seconds of the first trial start, plus the time the expiry action takes, where is the longest start-up time in seconds. In the example, , and give s, and the observed 102 s is within it. The bound assumes that the try count is durable and lowered before each trial start, that a hang becomes a restart or an expiry, which needs a watchdog timer or a timer the trial version cannot stop, that the clock is monotonic within each run, and that the expiry action is itself safe against a crash.
Limits and common mistakes
The length is a policy value, not a measured bound. Sixty seconds says how long the device waits, not how long a correct confirmation takes. Choose it from measured confirmation times plus a margin; a window shorter than a slow but correct confirmation reverts good updates.
The window decides only when a confirmation must arrive. What a confirmation must show is treated in the Commit-confirmed update entry.
A device switched off during the window shows how the reset rules differ. If a restart counts as failure, it returns to the previous version when switched on. If the deadline is stored and measured by a battery-backed clock, the window has expired by then. If only tries are counted, the trial continues. Each answer is defensible, and the design must state one.
The previous version can fail too. If it also crashes, the device loops on the previous version, and a last-resort recovery mode, such as a bootloader that waits for a new image, is needed.
An attacker who can delay or block confirmations can make every trial expire. That keeps the device on its previous version, which is safe, but it prevents updates from becoming permanent.
Questions answered
When does the timer start, and what happens across reset?
The timer starts at whatever event the design names, and the design must name one; the usual choices are the moment the trial version is committed and the moment it starts to run. A confirmation window is the period in which a change on trial can be made permanent by a confirmation before the system returns to the previous state. Starting the timer when the trial version starts to run gives the tester the whole window; starting it at the commit also counts the restart time.
Across a reset, a timer held only in RAM is lost, so the design chooses one of three rules. It can treat a reset during the trial as a failure and start the previous version; NETCONF (Network Configuration Protocol) requires this for its confirmed commits. It can allow a fixed number of trial starts, counted in persistent storage and lowered before each start. Or it can store the deadline and measure it with a clock that keeps running through the reset. Opening a fresh full window after every reset without storing anything is wrong: a version that crashes sooner than the window length restarts forever, in a boot loop, and is never reverted.
Related entries: Commit-confirmed update (§8.23), Monotonic clock (§9.35), Counter wraparound (§6.21), Counter quantization (§11.35), Watchdog timer (§6.16), A/B update (§8.10), Deadline versus timeout (§9.34), Clock domain (§13.29).