Bluetooth technology has been around for quite some time now. In 2010 the Bluetooth SIG introduces the Bluetooth Low Energy (BLE) to address the growth in the use cases of the Internet of Things (IOT) including medical devices, sensors and wearables. However, BLE lacks the capability of supporting a many to many topology (Mesh). So, what is Bluetooth mesh?
In Bluetooth mesh, multiple BLE devices can send messages to each other and the other devices within a network. In this article, we will cover the basics you need to know to understand how Bluetooth mesh works. Before delving deeper, let’s first look at some points you need to remember.
- According to the Bluetooth SIG, the Bluetooth mesh standard had a lower case “m” in the word “mesh”.
- Bluetooth mesh is not part of the Bluetooth standard. It is defined in its own separate specification.
- Bluetooth mesh utilizes many concepts of BLE and builds on top of BLE.
- BLE devices operate in two main states. Advertising/scanning or connection state. Bluetooth mesh only utilizes the advertising/scanning states. This means that devices in a Bluetooth mesh don’t connect like the traditional BLE devices. These devices use advertising packets to relay information to other devices. The other devices receive the advertising packets through scanning.
- Bluetooth mesh supports all versions of BLE.
- The maximum number of nodes within a Bluetooth mesh network is 32,767 nodes
- The maximum hops a message can travel within a Bluetooth mesh network is 127 hops.
Quick Navigation
What is Bluetooth Mesh?
Released in 2017, Bluetooth mesh aims to increase the range of Bluetooth networks and improve industrial applications that use BLE. Before Bluetooth mesh, Bluetooth supported two different topologies.
One to One: This is when only two Bluetooth Low Energy devices are supported.
One to Many: This is when Bluetooth Low Energy devices operate in the Broadcast state as in Beacons.
Bluetooth mesh is a new topology in BLE devices. Devices can now operate in a many to many topology referred to as a mesh. Here, devices can connect with multiple devices within a network.
In a mesh network topology, nodes connect directly and non-hierarchically to as many nodes as possible. Every node participates in the relay of information. This results in dynamic distribution of workloads especially if a few nodes fail.
Benefits of a Mesh Network
A mesh network has two main benefits
- Extended range
Because nodes can send messages to nodes further away, it allows a network to extend it range and reach.
- Self-healing Capabilities
If a node fails in a mesh network, the other nodes can still participate and send messages to one another. This is referred to as self-healing.
Bluetooth mesh vs. Other Mesh Networks
Other mesh networks include Thread, Zigbee, and Z-Wave. Some important differences between these networks include:
- Bluetooth mesh does not use the Internet Protocol (IP) but builds on top of BLE.
- Unlike the other protocols which use routing techniques, Bluetooth mesh uses a managed flooding technique.
- Bluetooth mesh is still new in the market compared to the other protocols.
- Bluetooth mesh is mainly used for lighting applications
Now that you understand what Bluetooth mesh is, let’s look at some important Bluetooth mesh concepts.
Bluetooth Mesh Concepts
You need to learn the following concepts to understand how Bluetooth mesh operates.
Nodes
A node refers to a device that has joined a Bluetooth mesh network. If a device is not part of a network, it is called an un-provisioned device. Once it is provisioned to join the mesh network, it becomes a node.
Elements
A node contains multiple parts which can be controlled independently. For example, you can have multiple lights in a light fixture which can be turned on and off independently. A part of a single node that can be controlled independently is called an element.
States
Elements can be presented in different state values. For instance, on and off are states of a bulb within a light fixture. Changing from one state to another is called a state transition. This can occur instantly or over time, after what is called a state period. When an element changes its state, it can change its behavior.
States can be bound to each other. This means that a change in one state causes a change in the other. Two or more states can be bound to each other. For example, a light dimmer is likely to have an on/off state. If the level changes to zero, it will transition to off. If it changes from zero to a non-zero value, it transitions to on
Properties
Properties add context to state values. An example is defining measurement of temperature as either indoor or outdoor temperature. There are two types of properties
- Manufacturer property: Provides read-only access
- Admin property: Provides read-write access.
Messages
Communication in a Bluetooth mesh is message oriented. Nodes exchange messages to control or relay information to each other. Messages invoke nodes operations. If a node wants to report a status, it sends it via a message. The type of message represents a collection of state values or an operation on a state. There are three types of messages in Bluetooth mesh.
- A GET message: This is a message to request the state from one or more nodes.
- A SET message: This type of message changes the value of a given state,
- A STATUS message: These messages can be used in different scenarios.
- In response to a GET message
- In response to a SET message
- To report the elements status such as a message triggered by a timer running on the element.
Some messages need an acknowledgement message to be sent by the receiver. An acknowledgement message serves the following purposes:
- To confirm reception of the message
- To return data related to the message received.
If a response to a message is not received by the sender, the sender may resend the message. If a node receives multiple acknowledged messages, its behavior is not affected.
Addresses
Messages must be sent to and from an address. There are three types of addresses in Bluetooth mesh.
Unicast Address: This address uniquely identifies a single node during the provisioning process.
Group Address: This address identifies a group of nodes. A group address reflects a grouping of nodes such as all nodes in a particular room. A group address could either be defined by Bluetooth SIG, or by the user.
Virtual Address: This type of address can be assigned to one or more element or node. These addresses are preconfigured at the time of manufacturing.
Publish/ Subscribe
Messages are exchanged in a Bluetooth mesh via the publish –subscribe pattern. Publishing is the act of sending a message while subscribing allows select messages to be sent to specific addresses for processing,
Managed Flooding
Most mesh networks use routing mechanisms to send messages across the network. An alternative is to flood the network with messages without considering the optimal routes the messages need to take to reach their perspective destinations. Bluetooth mesh uses both these techniques. This technique is referred to as managed flooding. Managed flooding sends messages to all nodes within range of the sender with a few optimizations.
Messages have a TTL assigned
TTL is an acronym for time-to-live. This limits the number of hops a message can take across multiple nodes in a mesh network. A zero value shows that a value of 1m message has not and should not be relayed.
If a message is sent with a TTL that is greater than two, then each time the message is relayed, the value is decremented. If it has a TTL value of 1, it means the message has been relayed more than once and should not be relayed again.
Messages are cached
All nodes must cache the messages. If the message received has already been cached, it should be discarded immediately.
Heartbeat messages are sent periodically
Heartbeat messages indicate that the sender is alive and active within the network.
Friendship
This is the relationship between two nodes. These two node types are:
- A low power node (LPN) which spends most of the time with the radio turned off. It conserves power and can’t receive mesh messages all the time.
- The friend node: It is live powered and can serve as a proxy for the LPN. It caches messages for the low power node to save power so that the low power node can stay asleep and only wakes up periodically. LPN modes are more concerned with sending messages rather than receiving them. When it wakes up, it reads the cache messages and sends any messages it needs to send. We shall cover the other types of nodes in another section.
Models
A model refers to some of all functionality of a given model. There are three types of models.
Sever model: A server model is a collection of states, state bindings, state transitions, and messages that an element containing the model may send or receive.
Client Model: A client model does not define any states but the messages sent to a server model.
Control Model: A control model contains both the server and client model. It allows communication with other server and client models.
You can extend models to include more functionality. A model that is not extended is called a root model
Scenes
Scenes in a Bluetooth mesh network is a stored collection of states and are defined by a unique 16 bit number. Scenes allow triggering action to multiple states of different nodes. Scenes can be triggered at specific times or on demand. For example, you can configure a scene to set the lights of a room to certain brightness, or even the temperature of a room to a specific degree.
Types of Nodes
All types of nodes can send and receive messages in a mesh network but some have optional features which give these nodes special capabilities. Let’s look the different types of nodes with optional features.
- Relay nodes
- Proxy nodes
- Friend nodes
- Low power nodes
Nodes may support some or all of these optional features. These features may be enabled or disabled at any time. For instance, a single node may have features of all the other nodes at the same time. We have already covered friend and low power nodes. Let’s now look at relay and proxy nodes.
Relay Nodes
Relay nodes support the relay feature. They can retransmit messages broadcast by other nodes. This extends the reach of these messages because it allows them to traverse the entire network beyond the reach of the original transmitting node.
Proxy Node
A proxy node enables communication with a mesh network from a non-mesh –supported Bluetooth device. It acts as an intermediary and utilizes GATT operations allowing nodes from outside the mesh network to interface and interact with the network.
Proxy nodes utilize the proxy protocol. The protocol is built on top of GATT allowing a device to read and write proxy protocol Data Units or PDUs .The proxy node translates between proxy protocol PDUs and mesh PDUs.
The Architecture of Bluetooth Mesh
Bluetooth mesh builds on top of BLE. However, Bluetooth devices with a Bluetooth mesh don’t connect to each other like other BLE devices. They use the advertising and scanning states to exchange messages. Let’s look at each layer of the Bluetooth architecture.
Models |
Foundation Models |
Access |
Upper Transport |
Lower Transport |
Bearer |
Bluetooth Low Energy |
- Bluetooth Low Energy layer
As already mentioned, Bluetooth mesh builds on top of BLE. This means it requires a full Bluetooth stack to run on the device. It makes use of the advertising and scanning states to send and receive messages between devices with the mesh network. It also supports connected states and GATT for proxy nodes.
- Bearer Layer
There are two types of Bluetooth mesh bearers and they define how different mesh packets are handled.
- Advertising bearer: It utilizes the advertising and scanning states of BLE devices.
- GATT bearer: It utilizes the connection state of BLE devices. It also allows non mesh supporting gadgets to interact with the mesh network.
- Lower Transport Layer
This layer handles the following tasks.
- Segmenting packets for the upper transport layer
- Reassembling packets from the bearer layer
- Upper Transport Layer
This layer performs the following functions:
- Encryption
- Decryption
- Authentication
- Transport control messages
- Access Layer
This layer defines how applications utilize the up[per transport layer. It performs the following tasks:
- Application data format
- Encryption
- Decryption
- Data Verification
- Foundation Models Layer
The foundation models layer is concerned with network management and configuration.
- Models Layer
This is the top most layer. Its concerned with the implementation of models including messages, states and state binding
Wrap up
In this post, we have covered Bluetooth mesh and some of its terminologies. We have also looked at an overview of its architecture. I hope that you found this post informative. Keep it here for related content.