# Performance Evaluation of a Mesh-Topology LoRa Network
## 5 Proposed Approach: LoRaMesh
### Routing Method  
The current routing method implemented in the NS3 simulation model assumes a global overview of the node locations. The objective of the routing helper is to minimise the number of hops in the network, minimise bottleneck nodes, and minimise the path loss between the child and the parent node.  
To achieve this, the path loss between the GW and all nodes are calculated. All nodes that are able to reach the GW with a single transmission hop are assigned to the hop number 0. Thereafter, the path loss between all nodes without a parent node and the nodes in hop number 0 is calculated. All nodes that are able to reach these relay nodes with a single transmission hop are assigned to hop number one. This routine is continued until all nodes have been covered, or until the maximum number of hops has been reached. The criteria for whether a node or a GW can be considered is based on the path-loss Equation (4). InEquation (4), \(P_{Tx}\) refers to the node's transmission (kept at maximum when attempting to set up node routing), \(PL_{dB}\) represents the path losses between the node and possible parent node, \(RxSensitivity_{dB}\) is the receiver sensitivity at the selected SF, and \(LinkBudgetMargin_{dB}\) is a user-defined option, which will ensure that there is some margin for the transmissions between the node and possible parent node.  
\[P_{Tx}-PL_{dB}>RxSensitivity_{dB}+LinkBudgetMargin_{dB} \tag{4}\]  
Figure 3(a),b present a visualisation of two different routing topologies in which a network with identical node locations can be configured. The difference in the two networks is down to the \(LinkBudgetMargin_{dB}\) selected. An increment in the \(LinkBudgetMargin_{dB}\) increases the number of hops, as it decreases the transmission range of a node.  
To minimise the bottlenecks at relay nodes and the path loss between the child and the parent nodes, the child node's parent choice is based on the routine shown in Figure 5. Since this is a sequential routing assignment algorithm, it can lead to non-optimal routing solutions. This is a complex optimisation problem which should be addressed through continuous research.  
The following are three variations of the proposed parent node selection routines discussed in Figure 5, which could possibly be implemented as rule-based solutions:  
* Nodes attempt to select the closest parent node to them while attempting to minimise bottlenecks at parent nodes.
* Nodes attempt to select the parent node which is the closest to the gateway while attempting to minimise bottlenecks at parent nodes.
* Nodes randomly select a parent node within their allowed link-budget to them, while attempting to minimise bottlenecks at parent nodes.  
To determine the optimal parent node selection to be used in the multi-hop network, we simulated the three different approaches in the ns-3 simulation model. The varying number of nodes have been evenly distributed in a 6.5 km radius around a gateway. Nodes transmit 10-byte messages every 600 s for a total of 10 transmissions. The simulation results shown in Figure 6 demonstrated no drastic changes in the power consumption of nodes in the network due to the parent node selection method. Selecting the closest parent node, while attempting to minimise bottlenecks at parent nodes, showed the lowest  
Figure 4: Simulation of two different layout networks.  
median power consumption; hence, throughout the rest of the simulations, this method will be used.  
Figure 5: Parent node selection.  
Figure 6: LoRaMesh parent node selection’s impact on power consumption. (**a**) Closest parent node selected (with bottleneck prevention). (**b**) Furthest parent node selected (with bottleneck prevention). (**c**) Random parent node selection (with bottleneck prevention).