Bluetooth Mesh Overview

Scalable, Reliable, and Secure Mesh Networking

March 18, 2024 (1mo ago)


Bluetooth mesh is a mesh networking standard built on top of the LE Physical Transport defined in the Bluetooth Core Specification.

Bluetooth mesh supports the deployment of large scale mesh networks, enabling vast connectivity in many IoT applications.

Mesh Devices

In mesh context, devices can be categorized into the following groups:

  • An unprovisioned device is A device that is not a member of a mesh network.
  • A node is a device that is a member of a mesh network
  • A provisioner is a device that is used to manage the transitions between an unprovisioned device and a node.

An unprovisioned device cannot send or receive mesh messages.

They advertise their presence to provisioners to undergo a process known as provisioning.

A provisioner provisions an unprovisioned device converting it to a node.

Network Topology

Its many-to-many topology allows for deployment of large scale networks.

A mesh networks consists of nodes sharing 4 common resources:

a node can be defined as a device that is participating within a mesh network.

  • network addresses are used to identify source and destination of messages
  • network keys are used to secure and authenticate messages at the network layer
  • application keys are used to secure and authenticate message at the access layer
  • IV Index is used to extend the lifetime of the network.

Networks can consist of subnets that facilitate "area" isolation. Allowing groups of nodes to be independent of other nodes within a larger network.

Network resources are managed by a node, known as the Configuration Manager.

Configuration Managers are typically smartphones or other mobile computing devices.

Network resources are allocated to nodes at the time of configuration.

Mesh Gateway

Mesh Gateways are nodes within a mesh network that can interpret mesh messages for destinations external from the network.

For example, a sensor network can utilize a Mesh Gateway to upload mesh data to a database via WiFi.

Provisioning

Adding devices to a mesh network is done through provisioning.

The purpose of provisioning is for an unprovisioned device to receive the 4 common resources mentioned above so it can participate within the network.

Provisioning of devices is conducted using either a simple advertising bearer or a point-to-point GATT based bearer.

Both share the same provisioning protocol. Provisioning over a GATT-based bearer allows devices such as legacy phones to be Provisioners.

Core Concepts

Understanding these core concepts about Bluetooth mesh will start a base foundation for future mesh learning.

Elements

An element is an addressable entity on a node.

‘addressable entity’ means that the element will have its own unicast address

A node consists of at least 1 element.

For example, a node with two LEDs would have 2 elements, allowing each LED to be addressable.

States

A state represents the condition of an element.

An element that exposes a state is referred to as a server. An element accessing a state is referred to as a client.

Messages

All communication within a mesh network is conducted through messages. The specification defines two types of messages:

  • Access messages
  • Transport Control messages

Access messages interact with states. They consist of various parameters such as opcodes. These messages can be used by clients to request a value of a state or request change of a state.

Transport Control messages are associated with functionalities supported by the node. These messages are transmitted and received by the upper transport layer.

Models

A model describes the functionality element. An element can have one or more models.

A model describes the required states and the associated messages that act upon those states.

The Bluetooth SIG defines some generic models for typical user interactions. However, vendor specific models can be drafted for unique operation.

Depending on if the element has state or not, there are both Server and Client models defined for the associated behavior allowed.

Addresses

An address my be:

  • an unicast address
  • a virtual address
  • a group address

A unicast address is allocated to an element and always represents a single element of a node.

There are 32767 unicast addresses per mesh network.

Both virtual and group addresses are multicast addresses and can represent multiple elements on one or more nodes.

Publishing / Subscribing

A mesh application adopts a client-server architecture communicating with a publish-subscribe paradigm.

Bluetooth Mesh Stack

Model Layer

Models are used in the Model Layer to standardize the operation of common user scenarios. encouraging interoperability of nodes between networks.

The model layer specifies the guidelines for defining models for elements within a node.

Foundation Model Layer

The foundation model layer defines the necessary states, messages, and models required to configure and manage a mesh network. Some states within the Foundation Models include:

  • Composition Data contains information about a node, the elements it includes, and all the support models.
  • Relay State indicates support for the Relay feature.
  • Friend state indicates support for the Friend feature.

Access Layer

The access layer defines how upper layer applications such as models can use the upper transport layer.

It defines the and controls the application data encryption and decryption performed in the upper transport layer.

Essentially verify the incoming data is validated prior to being forwarded to the higher layer.

Upper transport layer

The key responsibility for the upper transport layer is to take an access message or internally generated transport control message and transmit the message to a peer upper transport layer.

The upper transport layer encrypts, decrypts, and authenticates access layer messages embedded within Upper Transport Access PDUs.

The Upper Transport Access PDU and the Upper Transport Control PDU are collectively known as the Upper Transport PDUs.

The upper transport layer also handles many transport control messages related to Friendship, Heartbeat, and Direct forwarding.

Lower Transport Layer

The lower transport layer transmits Upper Transport Layer PDUs to a peer lower transport layer. There are four Lower Transport PDU formats

  • Unsegmented Access Message
  • Segmented Access Message
  • Unsegmented Control Message
  • Segmented Control Message

The unsegmented format is used when the Upper Transport PDU can fit within a single Lower Transport PDU.

The segmented format is used when the Upper Transport PDU cannot fit within a single Lower Transport PDU.

Segmentation and Reassembly

Segmentation is performed by the lower transport layer of the transmitting node, where the Upper Transport PDU is segmented into multiple Lower Transport PDUs.

Segmented messages are acknowledged by the receiving node.

The receiving lower transport layer reassembles the Upper Transport PDU from the segmented message and sends acknowledgements for the complete delivery of the Upper Transport PDU.

The lower transport layer is also responsible for managing a Friend Queue for each friend Low Power Node.

Friend Queues hold Lower Transport PDUs for a Low Power node.

Network Layer

The network layer defines the Network PDU allowing Lower Transport PDUs to be transported by the bearer layer.

The network layer implemented network interfaces which essentially filter incoming/outgoing Network PDUs.

Received Network PDUs pass through the interface input filter which determines if it will be sent to the lower transport layer for further processing or dropped.

The network layer is responsible for relaying/forwarding Network PDUs received by a node if the relay feature is enabled.

The network layer is responsible for relaying/forwarding Network PDUs received by a node between GATT and advertising bearers.

The network layer also manages a Network Message Cache, which stores recent Network PDUs. Its use reduces unnecessary security checks and excessive relaying.

Bearer Layer

The bearer layer is responsible for how Network PDUs are transported between nodes.

A bearer is a service that allows the transmission of data within a network.

The Bluetooth mesh specification defines two mesh bearers in which message may be transported:

  • Advertising bearer (connectionless)
  • GATT bearer (connection-oriented)