Definition
The connection interval is the fixed time between the starts of two consecutive connection events of a Bluetooth Low Energy (BLE) §7.1 connection. A connection event is a short burst of packet exchanges on one radio channel; between events, neither device transmits on that connection, so both can switch off their radios. The central, the device that created the connection, chooses the interval and can change it later. In the range defined since BLE’s first version, the interval is a multiple of 1.25 ms from 7.5 ms to 4 s.
The idea
A battery-powered sensor cannot keep its receiver on, yet it must not miss messages. The solution is an appointment schedule: the two devices agree on a rhythm, meet on the radio only at the agreed moments, and sleep in between. The connection interval is the period of that rhythm. A short interval gives fast responses and costs energy; a long one saves energy and makes every message wait longer.
A bus timetable is a good picture. With a bus every 30 minutes, a passenger who arrives just after a departure waits almost 30 minutes, however fast they walked. A packet produced just after a connection event has ended likewise waits almost a whole interval, however fast the software was. The picture differs in two ways: one event can carry several packets and stays open while either side has more to send, and a peripheral that uses peripheral latency, explained below, may skip departures.
How it works
Setting. The central’s Host, the upper part of the device that runs the protocols and applications, gives its Link Layer §7.6, the lower part that runs the radio protocol, a range of acceptable intervals. The Link Layer picks a value and sends it in the connection request (
CONNECT_IND), together with the peripheral latency and the supervision timeout §7.8.Each event. An event starts at an anchor point, when the central transmits its first packet of the event. With the default frame spacing, the peripheral answers 150 s after the central’s packet ends and the two alternate with 150 s gaps. Controllers that support the Frame Space Update procedure can agree on other spacings. Each packet carries a more-data bit, which its sender sets when it has more to send. The event ends when neither side has set that bit, when an expected packet does not arrive, or after two consecutive packets fail their error check; the central also leaves the required gap before the next anchor point (150 s by default). Both devices compute the data channel for each event from the same selection algorithm §14.1 and channel map. It can select a channel again.
Waiting. Data handed to the Link Layer while no event is open waits in a queue for the next event. A peripheral transmits only in reply to the central, so its data also waits for the central’s next packet.
Peripheral latency is the number of consecutive events the peripheral may skip when it has nothing to send. It saves the peripheral energy, but data from the central to the peripheral can then wait up to (peripheral latency + 1) intervals, because the central cannot know when the peripheral will next listen.
Changing it. Only the central decides. It sends the new values with an instant, the number of the event from which they apply, so both devices switch together. The peripheral can ask for other values through the Link Layer’s Connection Parameters Request procedure, or through a request on the signaling channel of L2CAP §7.15 (Logical Link Control and Adaptation Protocol), the layer that carries Host messages. The central may accept, adjust or refuse.
Allowed values. The baseline connection interval is a whole number from 6 to 3200 multiplied by 1.25 ms. The endpoints are ms and ms. Bluetooth Core 6.2 added an optional Shorter Connection Intervals feature. A controller supporting it must support multiples of 1.25 ms starting at 1.25 ms. It can also support other points on a finer, 125-s grid. The shortest interval on that grid is 375 s. Using it requires both controllers to support that particular interval and the chosen packet exchanges to fit.
Worked example
Waiting caused by the schedule. Take a 30 ms interval, sent as because . An event starts at 0 ms and is over by 0.4 ms. A packet handed down at 0.5 ms waits for the anchor point at 30 ms, which is ms. One handed down at 29 ms waits ms. If packets arrive uniformly during the closed part of this interval, the waiting times range from almost zero to 29.6 ms. Their average is ms. From the central to a peripheral with a peripheral latency of 4, the scheduling wait can approach ms when the peripheral skips four events.
How much one event carries. Assume the 2-megabit radio mode (2 million bits per second), an encrypted connection, and one side sending packets with the largest payload, 251 bytes, while the other answers with empty packets. A full packet is a 2-byte preamble, a 4-byte access address, a 2-byte header, the 251-byte payload, a 4-byte MIC (message integrity §1.9 check) and a 3-byte CRC §4.32 (cyclic redundancy check): bytes, or 2128 bits, which at 2 bits per microsecond take s. An empty packet has no payload and no MIC: 11 bytes, or 88 bits, which take 44 s. One exchange with its two gaps takes s.
With a 7.5 ms interval, the last reply of exchanges ends s after the anchor point and must end by s, so and : five full packets fit. If each payload carries one write or notification of ATT §7.9 (Attribute Protocol), 4 bytes go to the L2CAP header and 3 to the ATT header, leaving bytes of application data. Five packets carry bytes per 7.5 ms, which is bytes per second, about 1.30 million bits per second. With a 30 ms interval, , so 21 packets carry bytes per event, about 170,800 bytes per second. That is about the same amount of data, if the Link Layer lets one event fill the interval, but with a wait of up to 30 ms instead of 7.5 ms.
Stated precisely
Let be the connection interval and the first anchor point; the anchor points are for on the central’s clock. A packet that becomes ready at time while no event is open is first sent at the earliest anchor point , provided that the receiver listens at every event and that event has room. Its wait then satisfies . In a model where the only opportunity to send is at an anchor, arrivals spread uniformly over a full interval have mean wait . If an event stays open for a fixed duration and we consider only arrivals spread uniformly during the closed part, the mean wait to the next anchor is . From the central to a peripheral with peripheral latency , the bound is . Each lost packet usually adds one more interval, because a missing packet ends the event.
To count complete exchanges, start the clock when the central begins its first packet. Let be the duration of each central packet and that of each peripheral reply. Let be the gap from the end of a central packet to the start of its reply, and the gap from that reply to the next central packet. Both default to 150 s. The Frame Space Update procedure can set these two gaps separately. In exchanges there are gaps before replies but only gaps between a reply and the next central packet. To fit the exchanges in one interval, also reserve , the minimum time from the end of the event to the next anchor, which defaults to 150 s. For the radio mode and packet sizes in use the timing test is
Limits and common mistakes
The interval is not processing time. A packet’s total delay is the wait for the schedule, plus its queueing delay §14.38 behind other packets, plus resends, plus processing at both ends; a faster processor shortens only the last part.
The interval is not the gap between packets. Several packets share one event, so the interval limits response time §9.32 more than it limits the amount of data moved.
Ready times are often not random. A device that answers a request usually has its answer ready just after the event that delivered the request has ended, so the answer waits for the next event, and a request with its answer at the application level often takes about one interval or more.
A requested interval is only a request. The central decides, phones and computers acting as central apply their own limits, and the values a peripheral publishes in its Peripheral Preferred Connection Parameters characteristic are advice.
The data rate also depends on the largest payload the two Link Layers have agreed (27 bytes unless both agree to more, up to 251), on the radio mode, on how long the Link Layer lets one event run, and on how many packets the software keeps queued.
Questions answered
Can an application packet wait almost a full interval before transmission?
Yes. On a Bluetooth Low Energy (BLE) connection, a packet produced just after a connection event has ended must wait for the next event, which starts one connection interval after the previous one started, so the wait can approach a full interval: almost 30 ms with a 30 ms interval. The radio schedule sets this wait. If the anchor is the only opportunity to send, arrivals spread evenly over the whole interval wait half an interval on average.
The wait can even exceed one interval: when the next event is full, when a lost packet must be sent again at a later event, or when data travels from the central, the device that created the connection, to a peripheral that uses peripheral latency, the number of events it may skip when it has nothing to send. With a latency of , that wait can reach intervals.
Related entries: Response time versus execution time (§9.32), MTU and fragmentation (§7.14), Throughput versus goodput (§7.39), Link Layer (§7.6), Supervision timeout (§7.8). Further reading: [93].