# RESEMBLE: A Real-Time Stack for Synchronized Mesh Mobile Bluetooth Low Energy Networks
## 4 Resemble Design  
The findings of Section 3 show that the main limitations to supporting real-time communications derive from the lack of synchronization between the nodes in the BLE layer. In particular, the adoption of ADVs is the main source of non-determinism and unpredictabilities in the communication delay. However, connectionless transmissions provide very low start-up times for links, as there is no need to establish connections. For this reason, the adoption of a connectionless approach may be a good solution.  
Figure 3: Advertisement collision example.  
To enable the adoption of Bluetooth Mesh networks for industrial communications, the following goals have to be achieved:  
* Goal 1. Providing a medium access protocol that allows for predictable message transmissions with bounded delays and no collisions. The first step to achieve this goal is to define a synchronization mechanism for the node communication. To this end, a novel medium access mechanism, operating over BLE v.4.2 and BLE v.5.3, is required.
* Goal 2. Introducing message priority in order to adopt real-time scheduling algorithms.
* Goal 3. Enabling the separation between real-time and non-real-time traffic through the establishment of two \"logical\" channels, a real-time channel and a non-real-time one.  
The solution proposed in this work to achieve real-time communication over Bluetooth Mesh networks is based on the design of a novel Bearer Layer (RESEMBLE Bearer Layer in Figure 4) that is able to provide a TDMA-based medium access mechanism while maintaining compliance with the Bluetooth Mesh specifications, i.e., using non-connectable undirected advertising events.  
The network stack is made up of two layers. On top of the stack, there is an optimized version of the Network Layer, in which the flooding mechanism (already defined in the Bluetooth Mesh specifications [22]) is optimized to support message priority. Below the Network Layer, the RESEMBLE Bearer Layer guarantees bounded latencies and collision-free transmissions. The layers that are on top of the Network Layer in the Bluetooth Mesh standard are not addressed in this design for two reasons:  
1. Industrial networks generally have a very minimal stack, as each layer introduces delays and, in some cases, such delays can be unpredictable.
2. The functionalities provided by the upper layers are application-dependent. The different design steps are as follows:  
1. Enabling TDMA-based communications. This requires a clock synchronization mechanism, as the nodes have to know the exact time at which they can transmit.
2. Providing a medium-access mechanism to allow unsynchronized nodes to transmit/receive both synchronization and provisioning messages without interfering with TDMA transmissions.
3. Defining a clock synchronization mechanism that is suitable for Bluetooth Mesh communications. To achieve clock synchronization, nodes have to exchange synchronization messages with each other, but without interfering with the TDMA transmissions of the synchronized nodes.
4. Introducing message priority to cope with the different temporal requirements of the messages.  
Figure 4: RESEMBLE stack.  
These steps are outlined in the following subsections. A detailed description of the transmission mechanism is not possible at this time, as there is a patent pending (International patent pending No. PCT/IT2022/050003); therefore, this is left for future work. Section 5 addresses how to implement RESEMBLE on COTS devices and the results in Section 6 show its effectiveness.