# Performance Evaluation of a Mesh-Topology LoRa Network
## 3 LoRaWAN Overview
### LoRa and LoRaWAN MAC  
The LoRaWAN topology consists of nodes, gateways, and a network server configured in a star-of-star network. Gateways have both a multi-channel LoRa transceiver, as well as some form of traditional IP-based (e.g., Fibre, LTE, 5G, etc.) interface. Figure 1 provides an overview of a LoRaWAN. Nodes utilise the LoRa physical layer to relay packets, while the gateways utilise a traditional IP-based back-end network to connect to the network server. The LoRaWAN gateways are designed to receive LoRa packets from a large number of nodes as they offer eight parallel demodulation paths for LoRa messages on different SFs and frequency channels. Messages are relayed from the nodes, through the gateways to the network server. The network server is responsible for decoding packets sent by the nodes, generating the packets that should be sent back to the devices, and serving as an interface to the application and join server. Devices in a LoRaWAN adhere to a contention-based MAC protocol similar to a pure-Aloha MAC protocol. In [10], an up-link-only LoRaWAN is compared to the performance of a pure-Aloha network. The authors found that through the capture effect, the LoRaWAN outperformed a pure-Aloha network. The capture effect is a radio-level feature whereby, when two concurrently transmitting nodes are utilising the same medium, the node with the stronger received signal strength at the receiver's packet will be decoded successfully, and the lower signal strength packet will be detected as noise. The difference in received signal strength can be relatively small; however, when the difference is too small, the receiver will keep switching between the two signals. This translates in the receiver not being able to decode either transmission. As LoRa is a form of frequency modulation, it exhibits the capture effect. This effect allows the effective throughput of a network to be increased substantially, as not all packet collisions will result in packet loss. Three classes of nodes are specified in the LoRaWAN standard [2]. Class A devices are typically implemented in most power-constraint up-link-focused nodes. This class offers bi-directional communication, where each up-link transmission by a node is followed by two short down-link receive windows. Class B nodes extend the functionality of Class A devices, with scheduled reception slots. Class C devices are continuously in reception mode, except when transmitting. Both Class B and C sacrifice power consumption for improved down-link latency. To extend the above-mentioned Class A device type, various research articles [11; 12; 13] have proposed a slotted ALOHA MAC protocol to improve the performance of the network. Figure 1: LoRaWAN topology. The additional complication of time-slotted coordination provides additional challenges in LoRa nodes and renders the implementation impractical in some use cases where precision timekeeping is not possible. However, in most cases, nodes follow a periodic cycle, where nodes stay in Ultra-Low Power (ULP) mode until measurements are required, upon which a node samples a sensor and reports the data. In these types of applications, a Real-Time Clock (RTC) is typically available for precise time keeping, which would allow the use of slotted ALOHA. LoRaWAN gateways can receive accurate timings via an IP-based network; however, gateways embedded with a GPS module will provide the most accurate timing for slotted ALOHA. In a typical slotted ALOHA MAC protocol, the nodes rely on beacon frames sent by the gateway to synchronise the start of the current frame period, with \(n\) being the number of slots following the frame start [12]. The authors in [11] proposed a slotted ALOHA protocol, with periodic time- synchronisation based on the ACK message received in the down-link slot of an acknowledged up-link message. The proposed solution was implemented in the application layer, with no modification on either the node's gateway's, or network server's LoRaWAN stack.