Bluetooth Mesh Tutorial | Bluetooth Mesh Network architecture
The bluetooth mesh tutorial covers Bluetooth Mesh Network architecture, terminologies, protocol layers, message types, node types, Link Establishment and Provisioning Process and so on.
Introduction: BLE (Bluetooth Low Energy) standard has been developed to address growing need of IoT (Internet of Things) applications in various domains. Bluetooth mesh is developed on top of BLE stack to extend its use in many to many topology. Using this mesh concept, multiple BLE devices called nodes send and receive messages to other devices within the mesh network. Bluetooth Mesh specifications have been published by Bluetooth SIG in 2017. Bluetooth mesh related documents such as model specification, mesh profile etc. can be downloaded from bluetooth.com website.
BLE device operates in two states viz. advertising or scanning and connection state. BLE mesh nodes utilize advertising/scanning states in order to exchange messages to each other. BLE devices or nodes operate in different roles based on their functionalities. Bluetooth mesh supports maximum of 32,767 nodes and maximum 127 hops for message to travel.
Figure-1 : Mesh Node and its elements
Bluetooth mesh uses managed flooding method to deliver messages from source to destination. To support managed flooding, bluetooth mesh uses TTL (Time to Live), message caching and heartbeat messages. It follows publish-subscribe architecture to exchange messages between the nodes using different addressing mechanism.
Let us understand terminologies used in bluetooth mesh as mentioned in the following table.
|Device||Entity which has capabilities to become part of bluetooth mesh network as provisioned node.|
|Node||A provisioned device in bluetooth mesh is called node. Devices which have joined mesh network are called nodes. When any unprovisioned device gets provisioned, it is referred as node. Based on their functionalities in the mesh, nodes are of different types viz. relay node, low power node, friend node and proxy node.|
|Elements||A node may contain multiple parts which are called as "elements". Example : Light fixture with multiple bulbs. Elements are addressable entities within a device. At least one element is required in a device.|
|States||Elements of a node can be configured in different conditions such as ON and OFF of a light bulb within light fixture etc. These are referred as states.|
|Messages||All the communications between nodes in a bluetooth mesh network is performed using messages. These messages carry control or relay information. They are differentiated using unique operation code (Opcode). messages are split into following categories viz. acknowledged and unacknowleded. The messages are further categorized into GET message, SET message and STATUS message.|
|Addresses||These are used to identify source/destination of the messages. They are used to identify one or more elements in one or more nodes of the mesh network. Addresses are of different types viz. unicast, group address and virtual address.|
|Provisioner||A node which has capabilities to add any new device to the mesh network is called provisioner. This can be smartphone or tablet with BLE mesh capabilities and stack.|
|Provision||Provision is a process which performs authentication and provides very essential informations to the device. The informations include unicast addresses, network key etc. A provisioned node can transmit/receive messages in mesh network.|
|UUID||Universally Unique Identifier, Virtual address represented by label UUID which is 128 bit value. Virtual address is multicast address and it represents multiple elements on one or mode nodes.|
|TTL||Time to Live. It's value indicates maximum number of hops. This field controls how far message can traverse the network. Each time a message is received and relayed by a node or device , TTL value is decremented by 1.|
|Heartbeat message||This message is transmitted periodically. It is used for two functions viz.
1. to determine whether node is active in the mesh or not
2. to determine how far a node is away in the network
The figure-2 depicts life cycle of a node used in bluetooth mesh network. As shown, mesh node initially will be an unprovisioned device. It will have unique UUID at this state and it is said to be ready to enter in the provisioned state. The other two states of a node are unconfigured mesh node and mesh node with configured elements.
Figure-2 : State diagram of a mesh node
Bluetooth Mesh Network Architecture
The figure-3 depicts bluetooth mesh architecture with different types of nodes based on their functionalities. As shown the nodes are relay nodes, low power nodes, friend nodes and proxy nodes. Let us understand roles of these bluetooth mesh nodes.
Figure-3 : Bluetooth mesh architecture
Relay nodes : These nodes re-transmit messages which are received by them to all the other nodes. Hence messages are traversed far in the network which extends the range of bluetooth mesh.
Low power nodes : These are power constraint nodes which stay asleep most of the time. When they wake up, they receive messages from their friend nodes and act accordingly.
Friend nodes : They are not power constaint nodes. They are always ON and listen to broadcast messages and store them to retransmit to low power nodes when they wake up.
Proxy nodes : These nodes implement mesh stack as well as BLE stack. Using GATT feature, these nodes allow non-mesh device to interact indirectly with mesh network.
Provisioner : The node device which is capable to add new devices to the mesh network. Provisioner generates network key, provides IV index and allocate unicast address.
Bluetooth Mesh Protocol Stack
Figure-4 depicts protocol layers of a bluetooth mesh network. It consists of BLE core layer, bearer layer, network layer, lower transport layer, upper transport layer, access layer, foundation model layer and model layer. Let us understand functions performed by each of these layers.
Figure-4 : Bluetooth mesh Stack
➨BLE core specification : This layer requires complete implementation of BLE stack. It uses advertising bearer and GATT bearer.
The advertising bearer allows mesh packet to be transported in advertising data of BLE advertising PDU using mesh message AD Type.
GATT bearer uses proxy protocol to transmit/receive proxy PDUs between two devices over GATT connection.
➨Bearer layer : It defines how network messages are transported between nodes. The two bearers viz. advertising bearer and GATT bearer are used at this layer.
➨Network layer : It defines network PDU format which allows lower transport layer PDUs to be transmitted by bearer layer. This layer performs encryption/decryption and authentication of messages between upper layers and output network interfaces.
➨Lower transport layer : This layer performs segmentation during transmission and reassembly on upper transport PDUs during reception. Lower transport PDU is used to carry upper transport PDUs to another node in the network. It lies between upper transport layer and bearer layer.
➨Upper transport layer : It performs encryption, decryption and authentication of application data. It is developed to offer confidentiality of access layer messages. It also defines how transport control messages are used for management of upper transport layer between nodes.
➨Access layer : It defines how higher layer applications can utilize upper transport layer. It defines application data format, controls encryption/decryption of application data in upper transport layer. It also checks compatibility of received data and application keys for upper transport layer.
➨Foundation model layer : It defines states, messages and models required to configure and manage the bluetooth mesh network.
➨Model layer : It defines models used to standardize operation of common user scenarios. Examples include models for lighting and sensors.
Bluetooth Mesh Link Establishment and Provisioning Process
The most important process in bluetooth mesh system is provisioning process. This process allows new external devices to connect with mesh and becomes nodes. The figure-5 depicts steps involved between unprovisioned new device and provisioner.
Figure-5 : Bluetooth mesh provisioning process
Following are the steps involved in link establishment and provisioning process. After successful completion of the below mentioned steps, unprovisioned device will
become node of the bluetooth mesh network.
• Step-1 : Unprovisioned new device sends out mesh beacon advertisements to become provisioned in the mesh network.
• Step-2 : Provisioner scans the beacons sent out by unprovisioned devices. Based on this, provisioner sends "Provisioning Invite Packet" to the unprovisioned device. The later responds with "Provisioning capabilities PDU packet" containing useful informations such as elements supported, security algorithms etc.
• Step-3 : Symmetric and asymmetric keys (i.e. ECC) are used in bluetooth mesh for security. Public keys are exchanged between provisioner and new device either directly or via out of band (OOB) channel.
• Step-4 : In this step, unprovisioned device is authenticated. It is done by the user by interacting with both provisioner and unprovisioned device.
• Step-5 : In this step, each device derives session key using private and public keys received from the other device. The session key helps to secure connection or to exchange additional provisioning data such as network key, IV index, allocated unicast address etc.
BLE (Bluetooth Low Energy) Links
➤Bluetooth v4.2 versus v5.0 >>
➤Bluetooth v5.0 versus v5.1 >>
➤BLE states and state diagram >>
➤BLE advertising and data channels >>
➤BLE protocol stack architecture >>
➤BLE connection process >>
➤BLE advertising and data packet formats >>