Full name: Bluetooth Low Energy (BLE) Controller and Host.
Definition
The Controller and the Host are the two parts into which the Bluetooth Core Specification divides a Bluetooth Low Energy (BLE) §7.1 device. The Controller is the lower part: the radio and the Link Layer §7.6, which send, receive, time, acknowledge and encrypt packets. The Host is the upper part: the protocols that give packet contents meaning, such as attribute access and pairing §7.17. The specification defines the interface between them, the Host Controller Interface (HCI) §7.5. The two parts may run on one processor or on separate chips.
The idea
The two parts differ most in their deadlines. When a packet arrives in a connection, the receiving device starts its reply 150 microseconds after the packet ends, and the reply must already say whether the packet arrived intact. Deadlines this short need dedicated hardware or the highest-priority code on the chip. The Host’s work, such as finding which data item a request names, can wait milliseconds. Splitting the two lets each part be built for its own deadlines. It also lets a Host from one supplier, such as the Bluetooth software in a phone’s operating system, drive a Controller chip from another supplier.
The split also fixes an order. A received packet passes through the Controller first, then through the layers of the Host, and only then reaches the application. A check placed at one point can stop only what happens after that point. An application function that refuses a malicious write runs after the Controller has received, checked and stored the packet, and after the Host has parsed it. A defect in any of those earlier steps is out of that function’s reach.
How it works
What each part contains:
Controller: the Physical layer, which is the radio, and the Link Layer, which handles advertising and scanning §7.3, connection setup, the timing of every connection event (each regular meeting of two connected devices), the choice of channel, acknowledgment and resending of lost packets, and encryption with a key that the Host supplies.
Host: L2CAP §7.15 (Logical Link Control and Adaptation Protocol), which divides one connection into numbered channels and rejoins long messages; ATT §7.9 (Attribute Protocol), which reads and writes numbered data items called attributes; GATT §7.10 (Generic Attribute Profile), which groups attributes into services and characteristics; the Security Manager, which runs pairing with the Security Manager Protocol (SMP) §7.19; and GAP (Generic Access Profile), which defines roles and the procedures for discovery and connection.
The path of a received packet, in the order it happens:
Radio and Link Layer: receive the bits, check that the packet belongs to this connection, and check its 24-bit CRC §4.32 (cyclic redundancy check). A damaged packet is dropped without an acknowledgment, so the sender sends it again.
Link Layer: if the link is encrypted and the packet is not empty, decrypt it and check its 4-byte MIC (message integrity §1.9 check), the value that reveals a change to what the packet carries; a MIC failure ends the connection.
Link Layer: read the 2-bit field that says what the packet carries. Link Layer control packets, used for example to change the connection parameters or to start encryption, are handled entirely inside the Controller and never reach the Host. Packets that carry data go on.
HCI: the Controller places the data in a buffer and passes it to the Host as an HCI data packet.
L2CAP: rejoin fragments, read the 4-byte header, and pass the message to the protocol that owns its channel, for example channel
0x0004to ATT and0x0006to the Security Manager.ATT and GATT: read the operation and the attribute handle (the number that names the attribute), check the attribute’s access rules, for example that the link is encrypted, and call the application’s function for that attribute.
Application: decide what the value means and whether to act on it.
At each step the input can be rejected, and by then every earlier step has already spent memory and processor time on it.
Placement in hardware. In a two-chip design, such as most phones, the Controller is a separate chip with its own processor and memory, joined to the main processor by a serial link that carries HCI. In a single-chip design, common in small sensors, one microcontroller §6.1 runs both parts: the Controller’s time-critical code usually runs in the highest-priority interrupt handlers §6.12, and both parts share one memory. Chip suppliers sometimes provide the Controller as compiled code without source, which is hard to inspect or change.
Worked example
A device has a defective Controller. It copies each received payload into a 27-byte buffer, the default maximum payload of a connection, using the length that the packet itself states, without comparing that length with 27. The application has a function, called for every write to its settings, that refuses writes from unknown peers.
An attacker in radio range, connected to the device, sends a Link Layer packet whose header claims a 200-byte payload. On the radio mode that sends 1 million bits per second, 200 payload bytes plus 10 bytes of framing take microseconds to send.
The Controller copies 200 bytes into the 27-byte buffer and so writes bytes past its end, over whatever data follows the buffer in memory.
If the packet’s 2-bit type field marks it as a Link Layer control packet, it never leaves the Controller. If the field marks it as data, it reaches the Host only after step 2.
Either way, the application’s function runs after step 2, at the earliest, so it cannot prevent the overflow. The repair belongs in the Controller: compare the stated length with 27 before copying. The application’s check keeps its value for what it covers: it still refuses a well-formed write from an unknown peer before the setting changes. Defects of this kind have occurred in real products. The SweynTooth vulnerabilities, published in 2020 [274], included Link Layer length overflows and other malformed-packet defects in the BLE software of several chip suppliers, with which a peer in radio range could crash or freeze affected devices.
Stated precisely
Let be a check and an effect, such as reserving memory, writing memory, changing state or transmitting. Check prevents effect for an input exactly when every execution path from the arrival of that input to passes through first, and rejects the input. This requirement is called complete mediation §1.16. In a BLE device, every receive path runs in a fixed order: radio, Link Layer, HCI (or the function calls that replace it on some single chips), L2CAP, the protocol that owns the channel, then the application. A check in the Host, or in an application function that the Host calls, can therefore prevent only effects that the Host or the application performs after that check. It can prevent no effect of the Controller, and no effect of a Host layer that runs before it. The content of Link Layer control packets never reaches the Host at all; at most an HCI event reports their outcome.
The specification fixes the responsibilities and the interface between the parts, not their isolation. Two conditions decide whether a defect in one part can harm the other: whether the parts share memory, and whether the processor enforces different access rights for them, for example with a memory protection unit §6.8 (MPU), hardware that limits which memory regions the running code may access. On a single chip with neither, the Host and the Controller are in effect one program, and a memory-corruption defect in either can change the other’s data.
Limits and common mistakes
Host and Controller are Bluetooth terms here. The Host is not a host computer, and the Controller is not a microcontroller. A USB Bluetooth adapter plugged into a laptop is a Controller, and the laptop’s operating system runs the Host.
A Host sees only what the Controller passes up. Damaged packets, resent packets and Link Layer control packets stay inside the Controller, so a detector that watches only Host events misses attacks carried out with them. Some research systems therefore detect attacks inside the Controller; OASIS §21.2, for example, adds intrusion detection to the Controller’s firmware.
The Host can move some checks down. It can give the Controller a filter accept list of peer device addresses, and the Controller then ignores advertisements and connection requests from other addresses before the Host sees them. A device address can be copied, so the list reduces exposure to unknown devices but authenticates no one.
Refusing a request in the Host does not undo its cost: the airtime §18.2.19, buffers and processor time spent before the refusal are gone. Host checks therefore cannot stop a flood of well-formed packets from occupying the Controller, a denial of service §1.28 at a lower layer.
The interface does not make either part distrust the other. The Host usually believes every event the Controller reports, the Controller carries out every valid command the Host sends, and in a two-chip design the encryption keys that the Host gives the Controller cross the wires between the chips.
Questions answered
Can a Host callback §14.22 prevent a malformed packet already processed by the Controller?
No. A Host callback runs after the Controller has received, checked, buffered and passed on the packet, so it cannot prevent anything the Controller has already done, including a crash or memory corruption that the malformed packet caused. In Bluetooth Low Energy (BLE), every received packet passes first through the Controller (the radio and the Link Layer), then across the Host Controller Interface (HCI), then through the Host’s protocol layers, and only then to a callback, a function that the Host calls to hand an event to the application. Some packets, the Link Layer control packets, never reach the Host at all.
The callback can still prevent later effects: it can refuse to apply a value, to change a setting or to reply. Protecting the Controller’s own handling of packets needs a check inside the Controller, such as a length check before copying, or a corrected Controller.
Related entries: Host Controller Interface (HCI) (§7.5), Link Layer (§7.6), Complete mediation (§1.16), Reference monitor (§1.17), Memory protection unit (MPU) (§6.8), OASIS: placing an IDS inside a BLE controller (§21.2). Further reading: [19, 92, 93, 274].