The article, as the initial in the MESH series, introduces the architecture and functions of the Bluetooth mesh 1.0 protocol. As a supplementary protocol to the Bluetooth Low Energy protocol, the Bluetooth Mesh protocol, independent of Bluetooth 5.0, introduces an open standard mesh network to Bluetooth Low Energy devices for the first time.
MESH network is a low-power wireless technology for smart home and building automation applications. At first, because SIG lacks the support for MESH network, engineers have to change Bluetooth Low Energy to other technologies (such as ZigBee and Thread) for the development of the smart home applications. The situation lasted until the specification of Bluetooth mesh was made public in mid-2017. Now the Bluetooth SIG has solved the lack of MESH networking by introducing the Bluetooth 5.0 supplementary specification - Bluetooth mesh network 1.0. The specification does not need other hardware supports and can run on existing Bluetooth Low Energy chips (BLE4.0, BLE4.1, BLE4.2 and BLE5.0) by flashing the firmware. Some chip manufacturers can support the Bluetooth Mesh 1.0 protocol now.
1. BLE MESH Market Now
So far, 73 companies in the world have certified BLE MESH in the SIG, and the number of certified products is as high as 461. This data includes the total number of certifications of the terminal products and the chip. The following table lists the certified companies and the number of their product certifications, of which there are many terminal products certified by Chinese Internet giants.
2. Advantages of the MESH
Bluetooth Low Energy was originally designed to complement the high power consumption of "classic" Bluetooth by extending wireless technology to battery-powered devices. For example, the heart rate belts and wirelessly controlled toy applications communicate with a master device (such as a mobile phone) through Bluetooth Low Energy technology. Even a master device controls multiple slave devices to form a star network topology.
Due to the interoperability of Bluetooth low energy and mobile phones, Bluetooth low energy can be quickly extended to other applications such as lighting control, smart home, etc. In these types of applications, the shortcomings of the star network appear. For example, Bluetooth low energy solutions can only cope with a limited number of simultaneous connections (usually eight). And lighting devices with more than 8 bulbs cannot be controlled by a single command, which will cause control delays. The light bulbs far away from the big house may not be within the range of the central controller, and it need to be switched by nodes with routing functions.
Since the launch of Bluetooth Low Energy, it has launched versions 4.1, 4.2, 5.0, 5.1, and 5.2. Many functions in the protocol have been enhanced, such as transmission range, throughput, carrying capacity of broadcast data, AoA/AoD positioning, and coexistence improvements. (some of these new features are optional. Optional means that a chip that does not support these new functions can also be a BLE 5.0 chip).
Bluetooth Mesh 1.0 is not a simple upgrade of BLE 5, but a set of protocols independent of the Bluetooth protocol. And any previous version (BLE 4.0, BLE 4.1, BLE 4.2, BLE 5.0) chip products can be upgraded. Under the premise of sufficient Flash and RAM resources, it only needs to upgrade the firmware to run the Bluetooth mesh.
When the Bluetooth MESH node receives a message, it transfers the data obtained from the Bluetooth low energy layer to the bearer layer, then the data is transferred to the network layer through the bearer layer. The network layer uses various checks to decide whether to pass the message to the lower transport layer or discard it.
The Bluetooth MESH specification defines a new core protocol. Some of the core protocol layers share some concepts with the Bluetooth low energy core protocol layers, but the two protocols are not completely compatible with each other. This is different from technologies such as ZigBee and Thread. ZigBee and Thread have been designed as MESH networks from the beginning. The underlying specifications are based on 802.15.4, but the compatibility of other mainstream protocols has not been considered. (In the past two years, ZigBee has considered using dotdot at the top level to be compatible with other network protocols and achieve interconnection. For details, please refer to https://zigbeealliance.org/solution/dotdot/)
There are four types of network nodes:
A Relay Node receives and retransmits Bluetooth mesh messages using the advertising bearer. The disadvantage of relay nodes is that they must always keep the alert state, which will greatly increase power consumption. It has little effect on applications powered by main power such as smart lighting, but it is a big problem for battery-powered nodes such as switches incorporated into the network.
Low power nodes use the standard power-saving features of Bluetooth Low Energy (that is keeping sleep state for a long time), so they can run for a long time through battery or energy harvesting. LPNs work in tandem with Friend node, one which is not power-constrained (e.g.it has a permanent AC power source). The Friend stores messages addressed to the LPN and delivers them to the LPN whenever the LPN polls the Friend node for “waiting messages”. When the LPN enters the receiving mode (according to a predetermined schedule), it receives the stored message and follows the instructions, then returns to the energy-saving sleep mode.
Friend Nodes
A Friend Node can store and later forward messages addressed to an associated Low Power Node. When a Low power node wakes up and polls a Friend node, Friend will transmit these messages to the relevant Low power node. Friend nodes will occupy more memory than other types of nodes because it needs to store messages for one or more Low power nodes. The required memory size depends on the amount of data /commands that need to be stored in Friend nodes and sent to Low power nodes during polling operations.
Proxy Nodes
The Proxy Node is the key to enabling non-mesh Bluetooth Low Energy devices (such as a mobile phone) to be part of a Bluetooth mesh network. Proxy nodes expose a GATT interface which Bluetooth LE devices may use to interact with a mesh network. A Proxy Node can receive messages over one bearer (advertising or GATT) and retransmit them over the other (advertising or GATT). The fundamental purpose of the Proxy Node is to perform bearer conversion. It can convert from the advertising bearer to the GATT bearer and vice versa. Therefore, a device which does not support the advertising bearer may instead send and receive various types of Bluetooth mesh messages over a GATT connection. For example, the function is useful when the user wants to use a traditional smart phone to control a smart lighting network. The interaction is realized through GATT data transmission of the node and the device.
5. Bluetooth MESH Architecture
The Bluetooth mesh network uses "flooding" technology to send messages in the network (It is similar to the way the virus spreads). Each data packet is forwarded to other nodes in the network until the message reaches the target node. Message broadcast can be for a single node, a group of nodes and all nodes. For example, we can define all the lights in a single room as a group address. The Bluetooth mesh specification defines four fixed group addresses: "All-Proxies ", "All-Friends", "All-Relays " and "All-nodes". (LPN does not have the function of forwarding messages, because it has to maintain low power consumption.)
The flooding mesh architecture and the choice of group address enhance the support of Bluetooth mesh network for smart home applications. For example, if the Gateway device in the MESH network receives the "ON" command, which can be quickly broadcast to the entire network through the MESH network. Each node device in the network receives the command and takes action accordingly, the lights in the target group can be turned on immediately.
Compared with the star network, the minimum waiting time of the average receiving data for the MESH network nodes is much lower than that of the star network. Because the central device is required to send a separate command to each connected bulb in the star network. And the CPU needs to send commands to all sub-devices in time intervals.
There are some differences between Bluetooth MESH and traditional Bluetooth. All mesh data will only be transmitted on three advertising channels 37, 38, and 39. It has its advantages and disadvantages. The advantage is high efficiency and simple transmission way. And the disadvantage is that it reduces network bandwidth and increases the risk of congestion.
There are two methods for the MESH network to handle congestion: the first is the TTL (Time To Live), which defines how many times a specific packet can be forwarded (typically three steps). The second is the network cache. The device will only broadcast once after capturing a forwarded data packet. The device will not forward it further when it receives the same information packet broadcast by other devices next time.
Developers can also use optional group delivery routes and retain the relay function. After the setting, the node can receive data packet, but cannot transmit it. Therefore, the flexibility of the node will become poor.
6. BLE MESH Model
The concept of MESH model is similar to the concept of Bluetooth profile. The model specifies a public information structure, which can contain one or more services (the concept of model is used to define terminal devices).
The model contains the specific behaviors and services of nodes, and defines a set of status and messages that act on the status. The standard model can work in the typical applications, such as device configuration, sensor readings and lighting control. And developers can also create custom models.
The models in the nodes are arranged by elements. Each element acts as a virtual entity in the mesh with a unique address, and each incoming message is processed by the model in the element.
Different models interact with each other through "publish and subscribe". The publishing node sends a message, and the node configured to subscribe will process it after receiving the message.
In following figure, we can see that the node “Switch 1” is publishing to group address Kitchen. Nodes Light 1, Light 2, and Light 3 each subscribe to the Kitchen address and therefore receive and process messages published to this address. In other words, Light 1, Light 2, and Light 3 can be switched on or off using Switch 1.
Switch 2 publishes to the group address Dining Room. Light 3 alone subscribed to this address and so is the only light controlled by Switch 2. Note that this example also illustrates the fact that nodes may subscribe to messages addressed to more than one distinct address. This is both powerful and flexible.
Similarly, notice how both nodes Switch 5 and Switch 6 publish to the same Garden address.
7. Bluetooth Mesh Configuration Network
8. Bluetooth MESH Applications
Based on the preliminary statistics of SIG certified products, it is found that the applications of BLE MESH are mainly concentrated in smart homes and lighting control applications, with lighting control accounting for 60%, smart homes accounting for 30%, and the last 10% belonging to the original manufacturer chip certification and niche market application. BLE MESH is undoubtedly the biggest competitor of ZigBee.