Section 7.8

Supervision timeout

Definition

The supervision timeout of a Bluetooth Low Energy (BLE) §7.1 connection is the longest time a connected device may go without receiving a valid packet from its peer before it declares the connection lost. Each device’s Link Layer §7.6, the part that controls the radio, restarts a timer whenever a valid packet arrives and ends the connection when the timer reaches the timeout §9.34. The central, the device that created the connection, sets the value, a multiple of 10 ms from 100 ms to 32 s.

The idea

A device that loses power, moves out of range or is drowned out by interference sends no farewell. Its peer sees only silence, and silence is ambiguous: a single missing packet is common on a busy radio channel, and a peripheral may be silent on purpose, because peripheral latency lets it skip connection events when it has nothing to send. Declaring loss at the first silent event would break healthy connections; never declaring it would keep dead ones forever. The supervision timeout fixes how long silence must last before it counts as loss.

A telephone call is a fair picture: when the line goes quiet, you say “hello?” a few times and hang up only after some seconds. The picture fails in one respect: each BLE device decides alone and tells nobody, so the two devices can drop the connection at different moments. Until its own timer expires, each device keeps the connection’s state, reports the connection as up and keeps its queued packets, which is why a broken path stays logically connected for a while.

How it works

  1. The timer. Each device runs its own supervision timer, restarted by every valid packet, meaning one with the connection’s access address and a correct CRC §4.32 (cyclic redundancy check, an error-detecting code). Empty packets count, and the Link Layers exchange them at every connection event they both attend, the short meeting that repeats once per connection interval §7.7, even when there is no data.

  2. Establishment. A new connection counts as established when the first packet from the peer arrives. If none arrives within 6 connection events, the connection is lost at once.

  3. Expiry. When the timer reaches the timeout, the Link Layer stops transmitting on the connection and reports the loss to its Host, the upper part of the device that runs the protocols and applications, with the reason Connection Timeout, error code 0x08. It may report slightly early: once the last event before expiry has closed, if the timer will expire before the next event starts. If an event is still in progress when the timer reaches the timeout, the report normally waits until that event closes.

  4. The constraint. The timeout must be longer than 2×(1+L)×I2 \times (1 + L) \times I, where II is the connection interval and LL is the peripheral latency, the number of consecutive events the peripheral may skip. A peripheral that uses its full latency listens only once every L+1L + 1 events, and the factor 2 lets one of those listening opportunities fail without the connection being declared lost.

  5. Orderly ending and changes. A device that wants to end a connection sends a termination message (LL_TERMINATE_IND) with a reason code, such as 0x13, Remote User Terminated Connection, and the peer learns of the end at once; the timeout is the fallback when no such message can arrive. The central can change the timeout during the connection with the procedures that change the connection interval.

Worked example

A central and a peripheral use a connection interval of 30 ms, a peripheral latency of 4 and a supervision timeout of 1 s, sent as the number 100 because 100×10=1000100 \times 10 = 1000 ms. The constraint holds: 2×(1+4)×30=3002 \times (1 + 4) \times 30 = 300 ms, which is less than 1000 ms. With these settings a timeout of 100 ms would be refused, because 100 ms is not longer than 300 ms; the smallest valid value is 310 ms, the first multiple of 10 ms above 300 ms.

The central receives its last valid packet from the peripheral at t=10.000t = 10.000 s. At t=10.010t = 10.010 s the peripheral loses power. The central keeps transmitting at each anchor point, the start of each event, at 10.030 s, 10.060 s and so on, and hears nothing: from 10.030 s to 10.990 s that is (10.990−10.030)/0.030+1=33(10.990 - 10.030) / 0.030 + 1 = 33 silent events. The timer reaches 1 s at 10.000+1.000=11.00010.000 + 1.000 = 11.000 s. The next anchor point, 11.020 s, comes after that, so the central may declare the connection lost as soon as the event at 10.990 s closes, and must do so by 11.000 s. For up to 11.000−10.010=0.99011.000 - 10.010 = 0.990 s after the power failure, the central’s Host still believed the connection was up. A packet that its application queued at 10.500 s waited about 0.5 s and was then discarded.

Had only the radio path failed, for example behind a closing metal door, the peripheral’s own timer would have expired about 1 s after the last valid packet it had received, at a moment that need not match the central’s. Had the door reopened after 0.8 s, the next valid packet would have restarted both timers, and the queued packet would have arrived late instead of being lost.

Stated precisely

Let TsT_s be the supervision timeout, II the connection interval, LL the peripheral latency, and SS the subrate factor: when the optional connection subrating feature is active, the devices use only every SSth connection event, and otherwise S=1S = 1. The specification requires TsT_s to be a multiple of 10 ms with 100 ms≤Ts≤32 s100 \text{ ms} \le T_s \le 32 \text{ s} and Ts>2×(1+L)×S×I.T_s > 2 \times (1 + L) \times S \times I.

Let tvt_v be the time at which a device last received a valid packet. If no valid packet arrives afterwards, the timer reaches TsT_s at time tv+Tst_v + T_s; call this moment the nominal expiry. The device must declare the connection lost by the nominal expiry or, if a connection event is in progress at that moment, by the close of that event. It may declare the loss earlier, once the most recent event has closed, if the next anchor point, the start of the next connection event, comes after the nominal expiry. Anchor points are II apart, including those of events that the devices skip, and every event closes before the next anchor point, so the declaration comes less than II before the nominal expiry at the earliest and less than II after it at the latest. For a break at time tb≥tvt_b \ge t_v, let D=tv+Ts−tbD = t_v + T_s - t_b be the delay from the break to the nominal expiry; then D≤TsD \le T_s. Let mm be the longest gap, counted in intervals, between two valid packets on a working link. If no packet was lost before the break, then tb−tv<mIt_b - t_v < mI, and so D>Ts−mID > T_s - mI. The delay from the break to the declaration is therefore more than Ts−(m+1)IT_s - (m + 1)I and less than Ts+IT_s + I. In the example, m=L+1=5m = L + 1 = 5 and I=30I = 30 ms, so 1000−150=850 ms<D≤1000 ms1000 - 150 = 850 \text{ ms} < D \le 1000 \text{ ms}, with D=990D = 990 ms. The declaration comes more than 1000−6×30=8201000 - 6 \times 30 = 820 ms and less than 1000+30=10301000 + 30 = 1030 ms after the break: about 980 ms if the central reports early, once the event at 10.990 s closes, and 990 ms if it reports at the nominal expiry.

Limits and common mistakes

Expiry is evidence of silence only. It does not tell interference, power failure, a peer that moved away, a crashed peer and deliberate jamming apart.

Losing the connection does not settle the fate of the last operation. Suppose the central sent a write, the peer’s Link Layer received and acknowledged it, and the acknowledgment was lost. The central sees the connection drop without an answer, while the peer may have carried out the write. After reconnecting, the application must find out what happened, for example by reading the state back, or must make its operations safe to repeat, the property called idempotency §8.31.

A live link does not mean a live application. The Link Layer answers every connection event, with an empty packet if necessary, for as long as the Link Layer itself runs, even if the application above it has stopped responding. The supervision timeout then never fires, so application liveness needs its own check, such as a periodic application-level message.

Choosing the value is a trade-off. A short timeout detects loss quickly but drops connections during brief interference. A long one rides out interference but keeps a dead connection, with the memory and connection slot it holds, for longer, and delays reconnection.

The two devices do not agree on the moment of loss. One may already be advertising or reconnecting while the other still treats the old connection as open. Some losses are one-sided by design: a device that receives an encrypted packet failing its integrity §1.9 check considers the connection lost at once without telling the peer, and the peer learns of the loss only through its own supervision timeout.

An application’s own timeout is separate. An application that waits 200 ms for an answer gives up long before a 1 s supervision timeout ends the link, and giving up does not mean that the peer did not act.

Questions answered

Why can a broken physical path remain logically connected for a while?

A broken physical path remains logically connected for a while because no message announces the break, so each device can notice it only as silence, and a Bluetooth Low Energy (BLE) device counts silence as loss only after the supervision timeout: the agreed longest time, from 100 ms to 32 s, that a device may go without receiving a valid packet from its peer. The timeout is deliberately longer than a few missed connection events, because brief interference, and the planned silence of a peripheral that skips events to save energy, are common and must not end a healthy connection; the specification requires the timeout to exceed twice the longest planned silence.

Until its own timer expires, each device keeps the connection’s state, reports the connection as up, and keeps its queued packets. The two devices detect the loss independently, often at different moments, and the timeout reveals nothing about the cause of the break or about whether the last messages were acted on.

Related entries: Deadline versus timeout (§9.34), Connection-slot exhaustion (§7.35), Retransmission and duplicate delivery (§7.36), Connection interval (§7.7). Further reading: [93].