Bluetooth 5 stack
Bluetooth has three basic components: a hardware controller, host software, and application profiles. Bluetooth devices come in single and dual-mode versions, which means they either support only the BLE stack or they support classic mode and BLE simultaneously. In the following figure, one can see the separation between the controller and host at the Host Controller Interface (HCI) level. Bluetooth allows for one or more controllers to be associated with a single host.
The stack consists of layers, or protocols and profiles:
- Protocols: Horizontal tiers and layers representing functional blocks. The following diagram represents a stack of protocols.
- Profiles: Represent vertical functions that use protocols. Profiles will be detailed in a later section, but cover generic attribute profiles and generic access profiles.
The following figure represents a comprehensive architectural diagram of the Bluetooth stack. Including BR/EDR and BLE modes as well as AMP mode.
There are essentially three Bluetooth modes of operation shown in the preceding figure (each requiring a different PHY):
- Low Energy (LE) mode: This uses the 2.4 GHz ISM band and employs FHSS for interference protection. The PHY differs from BR/EDR and AMP radios by modulation, coding, and data rates. LE operates at 1 Msym/s at a bit rate of 1 Mbps. Bluetooth 5 allows for multiple configurable data rates of 125 Kbps, 500 Kbps, 1 Mbps, and 2 Mbps (more on this later).
- Basic Rate/Enhanced Data Rate mode (BR/EDR): This uses a different radio than LE and AMP but operates in the ISM 2.4 GHz band. Basic radio operation is rated at 1 Msym/s and supports a bit rate of 1 Mbps. EDR sustains a data rate of 2 or 3 Mbps. This radio uses FHSS for interference protection.
- Alternative MAC/PHY (AMP): This is an optional feature that uses 802.11 for high-speed transport up to 24 Mbps. This mode requires both the master and slave device to support AMP. This is a secondary physical controller, yet requires the system to have a BR/EDR controller to establish initial connection and negotiation.
We will now detail the function of each element of the stack. We start with the common blocks of BR/EDR and LE then list details for AMP. In all three cases, we will start with the physical layer and move up the stack towards the application layer.
Core architectural blocks:
- Controller level:
- BR/EDR PHY (controller block): Responsible for transmitting and receiving packets through a physical channel on 79 channels.
- LE PHY: Low energy physical interface responsible for managing 40 channels and frequency hopping.
- Link controller: Encodes and decodes Bluetooth packets from the data payload.
- Baseband resource manager: Responsible for all access to the radio from any source. Manages the scheduling of physical channels and negotiates access contracts with all entities to ensure QoS parameters are met.
- Link manager: Creates, modifies, and releases logical links and updates parameters related to physical links between devices. It is reused for BR/EDR and LE modes using different protocols.
- Device manager: Block in the controller baseband level that controls the general behavior of Bluetooth. Responsible for all operations not related to data transmission, including making devices discoverable or connectable, connecting to devices, and scanning for devices.
- Host Controller Interface (HCI): This is a separation between the host and the silicon controller in layer four of the network stack. It exposes interfaces to allow a host to add, remove, manage, and discover devices on the piconet.
- Host level:
- L2CAP: This is the logical link control and adaptation protocol. It is used to multiplex logical connections between two different devices using higher level protocols than the physical layer. It can segment and reassemble packets.
- Channel manager: Responsible for creating, managing, and closing L2CAP channels. A master will use the L2CAP protocol to communicate to a slave channel manager.
- Resource manager: Responsible for managing the ordering of submission of fragments to the baseband level. Helps ensure the quality of service conformance.
- Security Manager Protocol (SMP): Also known as security manager protocol. This block is responsible for generating keys, qualifying keys, and storing keys.
- Service Discovery Protocol (SDP): Discovers services offered on other devices by UUID.
- Audio: An optional efficient streaming audio playback profile.
- RFCOMM: This block is responsible for RS-232 emulation and interfacing and is used for supporting telephony functionality.
- Attribute protocol (ATT): A wire application protocol used mainly in BLE (but can apply to BR/EDR). Optimized to run on BLE low power battery-based hardware. ATT is tightly coupled to GATT.
- Generic Attribute Profile (GATT): This block represents the functionality of the attribute server and, optionally, the attribute client. The profile describes the services used in the attribute server. Every BLE device must have a GATT profile. Principally, if not exclusively, used for BLE but could be used on a vanilla BR/EDR device.
- Generic Access Profile (GAP): Controls connections and advertising states. Allows a device to be visible to the outside world and forms the basis of all other profiles.
- AMP-specific stack:
- AMP (PHY): Physical layer responsible for transmission and reception of data packets up to 24 Mbps.
- AMP MAC: This is the media access control layer as defined in the IEEE 802 reference layer model. It provides address methods for the device.
- AMP PAL: Layer interfacing the AMP MAC with the host system (L2CAP and AMP manager). This block translates commands from the host into specific MAC primitives and vice versa.
- AMP manager: Uses L2CAP to communicate with a peer AMP manager on a remote device. Discovers remote AMP devices and determines their availability.