0% found this document useful (0 votes)
62 views13 pages

What Is Bluetooth Mesh?

Bluetooth mesh allows Bluetooth Low Energy devices to communicate in a many-to-many topology rather than just one-to-one or one-to-many. This introduces benefits like extended range through message relaying between nodes and self-healing capabilities if a node drops from the network. Bluetooth mesh uses concepts like nodes, elements, states, messages, addresses, and publish/subscribe to facilitate communication between devices in a mesh network through techniques like managed flooding.

Uploaded by

Nghiep Nguyen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views13 pages

What Is Bluetooth Mesh?

Bluetooth mesh allows Bluetooth Low Energy devices to communicate in a many-to-many topology rather than just one-to-one or one-to-many. This introduces benefits like extended range through message relaying between nodes and self-healing capabilities if a node drops from the network. Bluetooth mesh uses concepts like nodes, elements, states, messages, addresses, and publish/subscribe to facilitate communication between devices in a mesh network through techniques like managed flooding.

Uploaded by

Nghiep Nguyen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Mesh Profile

1. What is Bluetooth Mesh?


Earlier versions of Bluetooth supported two different topologies:
● One-to-one: when two BLE devices are connected.
● One-to-many: when BLE devices operate exclusively in the Broadcast
state, such as Beacons.
With Bluetooth mesh, a new topology is introduced for BLE. Devices can now
operate in a many-to-many topology, or what’s called mesh, where devices
can set up connections with multiple other devices within the network.

There are two main benefits of a mesh network:


● Extended range:
Since nodes can relay messages to far away nodes via the nodes
in between them, this allows a network to extend its range and
expand the reach of devices.
● Self-healing capabilities:
Self-healing refers to the fact that there is no single point of
failure. If a node drops from the mesh network, the other nodes
can still participate and send messages to one another. However,
this is only partially true for Bluetooth mesh since it has different
types of nodes within the network, some of which other nodes
may depend on.

2. Bluetooth Mesh Concepts


There are many concepts that we need to cover to better understand the way
Bluetooth mesh operates.

Nodes
A node is a device that has joined a Bluetooth mesh network. Devices that
are not part of the network are called unprovisioned devices. Once an
unprovisioned device gets provisioned, it joins the network and becomes a
node.

Elements
A node may contain multiple parts which can be controlled independently. For
example, a light fixture may contain multiple light bulbs which can be turned
on/off independently. These different parts of a single node are referred to as
elements.
States
Elements can be in various conditions, represented by state values. For
example, on and off are states of a lightbulb within a light fixture. A change
from one state to another is called a state transition. This can be
instantaneous, or it can occur over time, after what’s called a transition
period. When a state change occurs, it is likely to cause a change in the
behavior of an element.
Some states may be bound to each other, meaning that a change in one
state triggers a change in the other. There may be two or more states bound
to each other. Let’s take for example a light dimmer: it will likely have a level
state as well as an on/off state. If the level state value changes to zero, it will
trigger the on/off state to transition to off. If the level value changes from zero
to a non-zero value, then that triggers the on/off state to transition to on.

Properties
Properties add some context to a state value. For example, defining that a
temperature value is an outdoor or indoor temperature. There are two types
of properties:
Manufacturer property: provides read-only access
Admin property: provides read-write access

Messages
In Bluetooth mesh, all communications within the network are
message-oriented, and nodes send messages to control or relay information
to each other. Messages are the mechanism by which operations on nodes
are invoked. If a node needs to report its status, it also sends it via a
message. A given message type represents an operation on a state or
collection of multiple state values.
There are three types of messages in Bluetooth mesh, each of which is
defined by a unique opcode (operation code):
● A GET message: a message to request the state from one or more
nodes.
● A SET message: a message to change the value of a given state.
● A STATUS message: A status message is used in different scenarios:
○ In response to a GET message, containing the state value.
○ In response to an acknowledged SET message.
○ Sent independently of any message to report the element’s status.
One example is a message that’s triggered by a timer running on
the element sending this message.
Some messages require an acknowledgment message to be sent by the
receiver of the original message. An acknowledgment message serves two
purposes:
● Confirmation of receipt of the message.
● Return of data related to the message received.
In the case where a response to the message is not received by the sender,
or an unexpected response is received, the sender may resend the message.
Multiple acknowledged messages received by a node do not affect the
behavior (it’s as if the message was received once).

Addresses
Messages in a Bluetooth mesh network must be sent to and from an address.
There are three types of addresses:
● Unicast Address: an address that uniquely identifies a single node
assigned during the provisioning process (which we’ll cover in an
upcoming post).
● Group Address: an address used to identify a group of nodes. A group
address usually reflects a physical grouping of nodes such as all nodes
within a specific room. A group address could either be:
○ Defined by the Bluetooth SIG, also referred to as a SIG-Fixed
Group Address. These include All-proxies, All-friends, All-relays,
and All-nodes group addresses.
○ Dynamic Group Address, which is defined by the user via a
configuration application.
● Virtual Address: an address that may be assigned to one or more
elements, spanning one or more nodes. This acts as a label and takes
the form of a 128-bit UUID with which any element can be associated.
Virtual addresses are likely to be preconfigured at the time of
manufacturing.

Publish/Subscribe
The way messages are exchanged in a Bluetooth mesh network is via the
publish-subscribe pattern
Publishing is the act of sending a message. Subscribing is a configuration
used to allow select messages to be sent to specific addresses for
processing. Typically, messages are addressed to group or virtual
addresses.
Here’s an example of a mesh network in a home that’s comprised of 6 light
switches and 9 light bulbs. The network utilizes the publish-subscribe method
to allow nodes to send messages to each other.
Nodes may subscribe to multiple addresses. An example of this is light #3 in
the above figure, which is subscribed to both the kitchen and the dining room
group addresses. Also, multiple nodes may publish to the same address, such
as switches #5 and #6 in this example. These two switches control the same
group of lights, located in the garden.
The benefit of using group or virtual addresses is that adding or removing
nodes does not require reconfiguration of nodes

Managed Flooding
Many mesh networks use routing mechanisms to relay messages across the
network. The other extreme is to flood the network with the messages being
relayed without consideration of the optimal routes these messages need to
take to reach their perspective destinations. Bluetooth mesh uses a technique
that’s a compromise of both of these techniques. This technique is referred to
as managed flooding.
Managed flooding relies on broadcasting messages to all nodes within range
of the sender node, with a few added optimizations:
● Messages have a TTL assigned
TTL stands for time-to-live, which limits the number of hops a message
can take across multiple nodes within the mesh network. A value of zero
indicates that a message has not been relayed and should not be
relayed. This means that a node can send a message to other nodes
which are in its direct radio range and indicate that the receiving node(s)
should not relay the message.
If a message is sent with a TTL ≥ 2, then each time it is relayed, the TTL
value gets decremented. A TTL value of 1 means that the message may
have been relayed at least once, but that it should not be relayed again.
● Messages are cached
Message caching is required by all nodes and requires that messages
received that already exist in the cache get immediately discarded.
● Heartbeat messages are sent periodically
Heartbeat messages are used to indicate to other nodes that the
sender is alive and active within the network.
● Friendship
Friendship refers to the relationship between two nodes. These two
node types are:
○ A low-power node, or LPN, conserves power and is not able to
receive mesh messages all the time. This node spends most of its
time with the radio turned off.
○ A live-powered node called the friend node, which can serve as a
proxy for the LPN. The friend node caches messages for the LPN
to save power, so that the LPN can stay asleep most of the time
and only wake up occasionally. When the LPN wakes up, it polls
the friend node to read the cached messages and sends any
messages it needs to send to the mesh network.
There are several other types of nodes in a mesh network which we’ll be
covering in a later post.

Models
One important term defined in Bluetooth mesh is the concept of a model. A
model defines some or all functionality of a given element.
There are three categories of models:
● Server model: is a collection of states, state transitions, state bindings,
and messages which an element containing the model may send or
receive.
● Client model: does not define any states; rather, it defines only
messages such as the GET, SET and STATUS messages sent to a
server model.
● Control model: contains both a server and client model allowing
communication with other server and client models.
Models can be extended to include additional functionality instead of
modifying the original model. A model that is not extended is called a root
model.

Scenes
Another concept we want to cover is the concept of scenes in a Bluetooth
mesh network. A scene is a stored collection of states and is identified by a
16-bit number which is unique within the mesh network.
Scenes allow triggering one action to set multiple states of different nodes.
They can be triggered on-demand or at a specified time. For example, a
scene may be configured to set the temperature of a room to 72 degrees, the
living room lights to a certain brightness level, and the window blinds to close.

3. Types of Nodes
All types of nodes can send and receive mesh messages. However, optional
features give particular nodes special capabilities. Here are the different types
of nodes with optional features enabled:
● Relay nodes
● Proxy nodes
● Friend nodes
● Low power nodes
A node may support none, some, or all of these optional features, which may
be enabled or disabled at any time. For example, a single node may have the
features of a relay node, proxy node, and friend node, all at the same time.
Relay Nodes
A relay node is one that supports the relay feature. This means it can
retransmit messages that are broadcast by other nodes. This enables
extending the reach of these messages and allows them to traverse the entire
network beyond the reach of the original transmitting node.

Proxy Nodes
To allow communication with a mesh network from a non-mesh-supported
BLE device, a special type of node called a proxy node can be utilized. A
proxy node acts as an intermediary and utilizes GATT operations to allow
other nodes outside of the mesh network to interface and interact with the
network.
The protocol used in this case is called the proxy protocol, which is intended
to be used with a connection-enabled device (using GATT).
The protocol is built on top of GATT and allows a device to read and write
proxy protocol PDUs from GATT characteristics exposed by the proxy node.
The proxy node performs the translation between proxy protocol PDUs and
mesh PDUs.
For example, this allows a smartphone that does not implement the Bluetooth
mesh protocol to interact with a mesh network via a proxy device through
GATT operations.

Friend Nodes and Low Power Nodes


A friend node and a low power node (LPN) are closely related to each
other. In fact, in order for a low power node to participate in a Bluetooth mesh
network, it requires a friendship relationship with another node, called the
friend node.
Here are how these two types of nodes work together:
● Low power nodes usually have limited power supply such as
batteries, so they need to conserve energy by keeping the radio
off as often as possible.
● Low power nodes may be concerned with sending messages
more than receiving them. Take for example, a temperature
sensor powered by a coin cell battery. It may need to send the
temperature reading once per minute whenever that reading is
above or below a set limit. If the user decides to change the
threshold limit, then that gets sent in a message to the
temperature sensor. In order for the sensor to not miss this
threshold configuration message, it needs to be on all the time,
meaning it will consume a lot of power.
● To solve the problem mentioned in the previous point, the concept
of a friend node is introduced. A friend node lets the low power
node stay asleep longer.
● Friend nodes make this possible by caching messages that are
destined to the low power node. The low power node, at its
control, wakes up and polls the friend node for these cached
messages. When it polls for the messages, it also sends any
messages it needs to relay to the network to its friend node.
● The relationship between a friend node and a low power node is
known as “friendship”.
● Friendship is key to allowing power-constrained nodes to
participate in a mesh network while keeping their power
consumption optimized.
4. The Architecture of Bluetooth Mesh
Bluetooth mesh builds on top of BLE. It specifically utilizes the advertising
state of BLE devices. Devices within a Bluetooth mesh network do not
connect to each other like traditional BLE devices do. Rather, they use the
advertising and scanning states to relay messages to each other. There is one
exception to this in a special device that can be part of the mesh network
(which we’ll cover in the section on “Node Types”).
Here’s a description for each of the layers within the architecture of Bluetooth
mesh (starting with the bottom layer):
1. Bluetooth Low Energy layer
As we mentioned earlier, Bluetooth mesh builds on top of BLE, so it
requires a full BLE stack to be running on the device. It utilizes the
advertising and scanning states for sending and receiving messages
between devices within the mesh network. It also supports the
connected state and GATT for special devices called proxy nodes.
2. Bearer layer
The bearer layer defines how the different mesh packets (Protocol Data
Units or PDUs) are handled. There are two types of Bluetooth mesh
bearers:
○ Advertising bearer: this bearer utilizes the advertising and
scanning states of BLE devices.
○ GATT bearer: this bearer utilizes the connection state of BLE
devices. It allows non-mesh supporting devices to interact with the
mesh network via GATT operations. This is accomplished via a
special node called the proxy node.
3. Lower transport layer
This layer handles two main tasks:
○ Segmentation of packets from the layer above (upper transport
layer)
○ Reassembly of packets from the layer below (bearer layer)
4. Upper transport layer
This layer is Responsible for the following functionalities:
○ Encryption
○ Decryption
○ Authentication
○ Transport control messages (heartbeat, friendship, etc.)
5. Access layer
This layer defines how the application uses the upper transport layer. It
handles the following tasks:
○ Application data format
○ Encryption and decryption
○ Data verification
6. Foundation Models layer
This layer is concerned with the network configuration and network
management models.
7. Models layer
This layer addresses the implementation of models including behaviors,
messages, states, and state bindings.

You might also like