User:MichalHobot/Bluetooth Mesh

Bluetooth&reg; mesh networking, conceived in 2015, adopted on July 13, 2017 is a protocol based upon Bluetooth Low Energy that allows for many-to-many communication over Bluetooth radio. It has been defined in Mesh Profile Specification and Mesh Model Specification.

Overview
Communication is carried in the messages that may be up to 384 bytes long, when using Segmentation and Reassembly (SAR) mechanism, but most of the messages fit in one segment, that is 11 bytes. Each message starts with an opcode, which may be a single byte (for special messages), 2 bytes (for standard messages), or 3 bytes (for vendor-specific messages).

Every message has a source and a destination address, determining which devices process messages. Devices publish messages to destinations which can be single things / groups of things / everything.

Each message has a sequence number that protects the network against replay attacks.

Each message is encrypted and authenticated. Two keys are used to secure messages: (1) network keys – allocated to a single mesh network, (2) application keys – specific for a given application functionality, e.g. turning the light on vs reconfiguring the light.

Messages have a time to live (TTL). Each time message is received and retransmitted, TTL is decremented which limits the number of "hops", eliminating endless loops.

Bluetooth Mesh is a flood network. It's based on the nodes relaying the messages: every relay node that receives a network packet that authenticates against a known network key that is not in message cache, that has a TTL ≥ 2 can be retransmitted with TTL = TTL - 1. Message cache used to prevent relaying messages recently seen.

Theoretical limits
It's yet to be determined what are the practical limits of Bluetooth Mesh technology. There are some limits that are built into the specification, though:

Foundation Models
Following models has been defined in the core specification. They are mandatory for all mesh nodes.
 * Configuration Server
 * Configuration Client
 * Health Server
 * Health Client

Other Mesh Models
Application layer for Bluetooth Mesh has been defined in a separate Mesh Model Specification. As of release 1.0 lighting, sensors, time, scenes and generic devices has been defined.

Provisioning
Provisioning is a process of installing the device into a network. It is a mandatory step to build a Bluetooth Mesh network.

In the provisioning process a network key, common to the mesh nodes and a device key, unique to a given node are being used. Device key is generated by the device and then passed to the provisioner using P-256 elliptic curve cryptography. Network key is transferred to the device from provisioner.

Terminology used in Bluetooth mesh networking specification

 * Destination: The address to which a message is sent.
 * Element: An addressable entity within a device.
 * Model: Standardized operation of typical user scenarios.
 * Node: A provisioned device.
 * Provisioner: A node that can add a device to a mesh network.
 * Relay: A node able to retransmit messages.
 * Source: The address from which a message is sent.