# Performance Evaluation of a Mesh-Topology LoRa Network
## 5 Proposed Approach: LoRaMesh
### LoRa-Mesh MAC
#### 5.1.1 Real-Time Clock (RTC) Synchronisation in the Network
To minimise the possible packet collisions, we propose the following three techniques to minimise the beacon-frame packet collision, and evaluate the efficacy with a simulation model:  
* Re-transmissions: Beacon frames are re-transmitted three times sequentially by each relay node to improve the probability that child nodes receive the beacon frame successfully. The gateway only transmits a beacon frame once, as the probability of a packet collision is low since no nodes are scheduled to transmit during this time slot. * Frequency diversity: Re-transmissions of the beacon frames occur on a randomly assigned frequency channel. With the increase in the number of channels available for transmissions, the probability of a packet collision is reduced. Nodes in the first hop are set to receive beacon frames on 868.1 MHz, and the gateways only transmit the beacon frame on this specific frequency. The nodes in the first hop then re-transmit the beacon frame once on each of the standard LoRa channels (868.1 MHz, 868.3 MHz, 868.5 MHz) and each of the child nodes are set to only receive a beacon frame on a specific frequency channel. * Time diversity: Re-transmitted beacon frames are re-transmitted with a randomly selected time-offset. This time-offset is transmitted as part of the beacon frame header, to allow the nodes to successfully calculate the beacon frame start time. Including this time diversity minimises the probability of packet collisions. We performed a simulation using a varying number of nodes to determine the effectiveness of different beacon frame dissemination methods. The nodes were distributed uniformly within a 5 km radius from a single gateway, and all nodes were within 2 hops from the gateway. The simulations were conducted for ten different randomly generated node location distributions and ten beacon frame dissemination routines were performed per distribution. The configured simulation setup is deemed sufficient to converge reliably to an accurate result. The results of the simulation can be seen in Figure 3. From the simulation results, it is clear that time diversity in the re-transmission of the beacon frame messages increased the beacon frame distribution to greater than 99%. The results also showed a minimal increase in the beacon frame distribution when all the beacon frames were re-transmitted three times. The minimal advantage of re-transmission of the beacon frames will need to be considered against the additional time required for a single beacon-frame distribution routine and the additional power consumption requirements. For the remainder of this research article, the reader can assume that a beacon frame dissemination method, with time diversity and re-transmissions and without frequency diversity, has been used to ensure the best possible packet delivery ratio. Nodes recalculate the start of a new beacon frame dissemination process, Beacon Frame start time (\(BF_{start}\)) according to Equation (1), where the Beacon Frame packet duration (\(BF_{time}\)) represents the total time required to transmit a beacon frame (a network configuration parameter), \(TotalDelay\) is the total amount of time delay added by the multiple time delays (this information is transmitted the message content of the beacon frame), which were added to add time diversity, and \(CurrentTime\) is the node's RTC. \[BF_{start}=CurrentTime-BF_{time}\times HopNo-TotalDelay \tag{3}\]