BLE MESH tutorial – Bluetooth Mesh Networking Architecture

EmbeddedPathashala · BLE Mesh Series

BLE MESH tutorial – Bluetooth Mesh Networking Architecture
Part 1 — Introduction & Architecture

From single BLE links to a self-healing, multi-hop wireless mesh — understand how Bluetooth Mesh works from the ground up.

8
Protocol Layers
126
Max TTL Hops
32K+
Max Nodes
4
Parts in Series

What You Will Learn

BLE Mesh Architecture Protocol Stack Managed-Flood Network Mesh Layers Bearer Layer Model Layer BlueZ Mesh bluetooth-meshd

What is Bluetooth Mesh?

Classic BLE is a point-to-point technology — one phone talks to one sensor. That works perfectly for a heart rate monitor or earbuds. But imagine a smart building with 500 lights, 200 occupancy sensors, and 100 thermostats. You cannot pair your phone to every single device.

Bluetooth Mesh (defined in the Bluetooth Mesh Profile specification) solves this by forming a many-to-many network where every device is both a communicator and a relay. A message travels across the network by hopping from node to node until it reaches its destination — even if the sender and receiver are not in direct radio range.

The entire stack is built on top of the Bluetooth Low Energy Core Specification, meaning existing BLE hardware can participate in a mesh network with a firmware update.

🔌 Traditional BLE vs Bluetooth Mesh

Understanding the core difference before diving into the stack.

Feature Traditional BLE Bluetooth Mesh
Network Topology Point-to-Point (Star) Many-to-Many (Mesh)
Message Range Direct radio range only Extended via relay nodes
Connection Model Requires pairing/bonding Provisioning (no pairing)
Fault Tolerance Single link failure = broken Routes around failed nodes
Node Scalability Limited (few devices) 32,767 unicast addresses
Security Link-layer encryption Network + Application keys
Use Cases Earbuds, wearables, HID Smart buildings, lighting, IoT

🌐 The Layered Architecture

Bluetooth Mesh is defined as a strict layered stack, sitting on top of the BLE Core Specification. Each layer has one job and hands off to the layer above or below it.

↑ Data to AppData to Radio ↓

● Model Layer

Lighting, Sensors, Vendor Models

Foundation Model Layer

Network configuration & management

Access Layer

App data format, encryption control

Upper Transport Layer

Encrypt/decrypt, Friend feature

Lower Transport Layer

Segmentation & reassembly

Network Layer

Addressing, routing, network encryption

Bearer Layer

Advertising Bearer / GATT Bearer

● Bluetooth Low Energy Core Specification

Figure: BLE Mesh Layered Architecture (Bluetooth SIG Mesh Profile Spec)

📄 Layer-by-Layer Quick Reference

L8
Model Layer

Defines standardised models for real-world use cases — a Light Lightness Server, a Temperature Sensor, etc. This is the layer your application code lives in.

L7
Foundation Model Layer

Provides models needed to configure and manage the mesh network itself — adding/removing nodes, distributing keys, setting publication addresses.

L6
Access Layer

Formats application data for the transport layer. Controls application-level encryption/decryption and verifies incoming messages are using the correct application keys.

L5
Upper Transport Layer

Encrypts, decrypts, and authenticates application data. Also handles the Friend feature — buffering messages for low-power nodes that sleep most of the time.

L4
Lower Transport Layer

Handles segmentation and reassembly (SAR). BLE advertising payloads are small (~29 bytes usable). Large messages are split here and reassembled at the destination.

L3
Network Layer

Addresses messages toward one or more elements, applies network-layer encryption, and decides whether to relay, accept, or reject each incoming PDU.

L2
Bearer Layer

Defines how network messages physically travel between nodes. Two bearers are defined: the Advertising Bearer (all devices) and the GATT Bearer (for legacy devices).

L1
BLE Core Spec

The foundation. Bluetooth Mesh reuses the BLE radio, advertising channels (37, 38, 39), and packet formats — making it compatible with existing BLE chips like nRF52, ESP32, etc.

💡
Key Insight: Two Encryption Keys

Bluetooth Mesh uses two separate encryption layers. The Network Key (NetKey) protects all network traffic and controls who can relay messages. The Application Key (AppKey) protects the actual application data and controls who can decode the payload. A relay node can forward a message without ever seeing its content — because it only holds the NetKey, not the AppKey.

📚 What This Series Covers
Part 1
Introduction & Architecture (You are here) — Stack overview, layer roles, key concepts
Part 2
Layers Deep Dive — PDU formats, encapsulation, encryption at each layer with BlueZ D-Bus mapping
Part 3
Mesh Network Operation — Flood mesh, TTL, message cache, subnets, BlueZ meshd setup
Part 4
Devices, Nodes & Provisioning — Provisioning flow, meshctl walkthrough, mesh-cfgclient setup

Ready to Go Deeper?

Part 2 covers each mesh layer in detail — including how PDUs are built, where encryption happens, and how BlueZ maps to each layer.

Next: Part 2 → Layers Deep Dive Back to EmbeddedPathashala

Leave a Reply

Your email address will not be published. Required fields are marked *