# A Resilient LoRa-Based Solution to Support Pervasive Sensing
## 2 Background  
One of the main characteristics of LoRa is that it uses techniques derived from chirp spread spectrum (CSS) modulation to send messages. These techniques allow LoRa to have six spreading factors ranging from 7 to 12. These factors are a transmission setting that controls how fast messages are sent out. Using higher spreading factors increases the time required to send a message, but, in return, it significantly increases the sensibility of the receiver device, resulting in a longer transmission range. Figure 1 shows how higher spreading factors increase sending times. When implementing a solution that uses LoRa, choosing the best spreading factor is vital; lower ones will have higher throughput, and in comparison, higher ones will have a greater maximum transmission range. It is important to note that devices using different spreading factors cannot communicate with each other, so every device in a network has to use the same one to communicate with its neighbors.  
It is also possible to increase the connection data rate by increasing the bandwidth, but the options are limited to three choices: 125, 250 and 500 kHz. Furthermore, this choice can be further limited by the country in which Lora is used.  
In addition, spreading factors are orthogonal to each other, so messages sent with different spreading factors and transmitted simultaneously on the same frequency channel do not interfere, meaning that multiple LoRa-based solutions can coexist in the same physical space, provided each one adopts different spreading factors.  
The actual maximum range of LoRa can vary greatly by changing variables other than the spreading factor, like how powerful the devices are. According to the specifications, the technology provides a 5 km range in urban areas and 15 km in rural areas where nodes have a line of sight of each other. In 2019, researchers established a new record and transmitted a message across a distance of 766 km by using a helium balloon [13].  
Since LoRa only defines the lower physical layer that enables the long-range communication link, often called LoRa PHY, the upper networking layers are lacking. LoRaWAN is one of several protocols that define the upper layers of the network stack and the one that is used more often. It acts mainly as a network layer protocol for managing communication  
Figure 1: Example of time difference in sending times at different spreading factors (SF) [12].  
between LPWANs gateways and end-node devices as a routing protocol. It is maintained by the LoRa Alliance, an open, non-profit association created in 2015 to support, develop and ensure interoperability between LoRaWAN devices, similar to what the Wi-Fi Alliance does [14]. Projects that use LoRa almost always use LoRaWAN, but this is not necessary as LoRa can be used by itself.  
The LoRaWAN network architecture is a star-of-star where gateways relay messages between the end-devices and a central network server. This means that every end-node is connected to a more powerful device (a gateway), and, in turn, this device is connected to another one that is usually IP-capable and connected to the Internet.  
Due to the topology it uses and its focus on end-node-to-gateway communication, LoRaWAN has inherently some limitations on what it can be used to do; particularly, it cannot properly have node-to-node communication, meaning no real mesh network can be implemented with it. Due to this, LoRaWAN has not been used in this work.