*2.1. Related Works*

In [7], the authors introduced an IoT application using a WSN distributed over a large geographic area in which the sensor nodes use LoRa technology. Their communication performance analysis was based on varying parameters related to the LoRa physical layer, such as the bandwidth (BW) and scattering factor (SF).

Performance comparisons of different routing protocols have been presented in [8–12] using simulation tools and metrics such as the packet delivery rate, average latency, average jitter, and throughput. Simulations were carried out under various scenarios, such as different node densities and variations in terms of mobility.

Routing protocols and LoRa networks have previously been detailed in [13–15]. In [13], a routing system protocol based on the AODV protocol was proposed for use in meshed LoRa networks. In [14], the development of a hybrid network based on a LoRa mesh topology and the LoRaWAN protocol was introduced. An emergency communication system using a mesh LoRa network and implementing a modified version of the AODV protocol was presented in [15] along with an evaluation of the system feasibility according to the package delivery rate.

#### 2.1.1. LPWAN

Currently, the most widely adopted wireless communication technologies for IoT and WSN applications are Low-Power Wide-Area Network (LPWAN), 3G/4G/5G cellular networks, and ZigBee. LPWANs have gained prominence compared to the alternatives, as they feature low power consumption and transmission over very long distances. The main LPWAN wireless communication technologies are LoRa (Long Range), Sigfox, NB-IoT (Narrow-Band IoT), and Wi-SUN (Wireless Smart Ubiquitous Network).

#### 2.1.2. LoRa

LoRa is a wireless communication technology patented by Semtech Corporation that can be applied on devices with battery restrictions, aiming at longer lifetimes and large transmission ranges [6]. The range of a LoRa-based network in an urban area is up to 15 km, and in rural areas it can be up to 30 km in normal conditions. Lora operates in the ISM (Industrial, Scientific, Medical) bands.

LoRa modulation is based on the Chirp Spread Spectrum (CSS), which is characterized by the spectral spread of the signal to be transmitted in a given frequency range (*flow*, *fhigh*), generating a signal called Compressed High Intensity Radar Pulse (Chirp) [6]. An unmodulated Chirp signal has constant amplitude, and its frequency varies inside the bandwidth (BW = *fhigh* − *flow*) by a given period of time (*TS* = Symbol time).

The parameters used in LoRa modulation are the Bandwidth (BW), Spreading Factor (SF), and Code Rate (CR). Each LoRa symbol spans an entire BW and can encode bits of data defined by the SF, which can be from six to twelve. A LoRa symbol is an up-chirp (from *flow* to *fhigh*), meaning that when a frequency related to the data being transmitted is reached, it is shifted to *flow* while maintaining the same frequency slope, causing a discontinuity point.The discontinuity point position is responsible for the encoding of the transmitted data [6].

#### 2.1.3. Sigfox

Sigfox, developed by the French company Sigfox, was the first LPWAN technology proposed by the IoT industry [5]. Sigfox physical layer modulation is based on an Ultra Narrow Band (UNB) modulation. However, there is limited documentation of its operation due to commercial protection, which becomes a relevant issue in academic studies on the network and the reproduction/simulation of results. A Sigfox network operates similarly to a cellular operator for the IoT industry [16], that is, there are service costs for subscribers to use the network. The coverage or range of Sigfox networks in urban areas is between 3 km and 10 km, and in rural areas it is between 30 km and 50 km. Sigfox operates in the ISM band (868 or 915 MHz), its communication rate is around 100 bps, and it supports up to 1,000,000 nodes per gateway [5,16].

#### 2.1.4. NB-IoT

NB-IoT is a standard developed by the 3GPP (Third Generation Partnership Project), which is an international telecommunications standardization body. The operation of NB-IoT is performed by telecom operators and is an extension of the 4G cellular network infrastructure [17] (4G LTE service providers such as Verizon and AT&T in the United States). The data transfer rate can reach 234.7 kbps [17], and it supports up to 50,000 devices per cell [16]. An important feature is that the battery life of an NB-IoT radio can be as long as ten years [16].

#### 2.1.5. Wi-SUN

Wi-SUN (Wireless Smart Ubiquitous Networks) technology is maintained by the Wi-SUN Alliance and consists of wireless communication networks that are based on the IEEE 802.15.4g standard and are designed to be reliable and have low power consumption. Wi-SUN allows the establishment of networks that integrate smart devices from different manufacturers and is able to implement different topologies, including star, mesh, or

hybrid,making the coverage area wider [18]. Wi-SUN adopts a Gaussian FSK (GFSK) modulation scheme, operates in the ISM bands, has low latency when compared to other LPWANs technologies, and has a transmission rate of around 300 kbps [18,19].

### *2.2. Routing Protocols for WSN*

With a higher the amount of sensor nodes, the amount of data exchanged over the WSN increases. This emphasizes the importance of an efficient data routing process when considering the mesh topology.

In short, a data routing process consists of verifying and evaluating available paths from a source node to a destination node, then determining the best path for forwarding data throughout the network based on a given criterion [20]. Based on this process, the data routing protocol specifies the technique by which routing tables are formed and maintained in order to aid in the forwarding of data [21].

In general, routing protocols fall into four categories:n Centralized vs. Distributed, Static vs. Adaptive, Flat vs. Hierarchical, and Proactive vs. Reactive vs. Hybrid [21].

In this work, we highlight proactive, reactive, and hybrid protocols, which differ in the way they operate according to the routing strategy [11]:


When considering routing protocols for WSN applications, energy efficiency is an important characteristic. In [23], the authors analysed wireless network energy models based on five reactive and proactive routing protocols for WSNs, including AODV and DVR protocols. A WSN energy model was proposed in [24] using AODV and DVR routing protocols and considering the energy consumption at each node of the network. A genetic algorithm-based routing protocol for sensor networks was presented in [25]; the authors compared their proposed method with different routing protocols, including DVR and AODV.

#### *2.3. Cupcarbon Simulator*

Cupcarbon is an open-source Java-based network simulator with a focus on Smart Cities, WSN, and IoT [26–28]. It allows network designers to debug and validate network applications in a 2D/3D graphical environment [29]. Cupcarbon is composed of four main blocks:


munication technologies, even in the physical layer, including Wi-Fi, Zigbee, and LoRa [26].

4. Implementation block: the user-customization block of Cupcarbon is developed in a modular wa with the aim of simplifying the replacement and customization of specific part of the simulator.

In Cupcarbon, network devices are programmed in a script language called Senscript, proposed in [29], which allows the generation of code for the Arduino platform. An important feature of Cupcarbon is that the energy consumption of a sensor node can be analysed according to both the classic consumption model and the Heinzelman model.

#### *2.4. Egli's Propagation Loss Model*

Network simulation tools use computational models for their operations, from component and device models to environmental condition and mobility behaviour models, as well as for signal propagation. Propagation loss models are mathematical models used to estimate the attenuation between RF transmitters and RF receivers in order to obtain the received signal power according to specific conditions (frequency, antenna gain, etc.) [31].

The Egli model is a widely used propagation loss model derived from experimental results using actual measurements of television broadcast systems [32]; it is suitable for cellular communications where there are a number of both fixed and mobile devices. Furthermore, it is applicable in scenarios where transmission occurs across uneven terrain without the presence of vegetation in the communication link [33]. The Egli model can be adopted for frequency ranges between 40 MHz and 1 GHz and for distances up to 60 km [34], and takes into consideration the line of sight between the devices, The Path Loss is denoted as *PL*, and is provided by the formula

$$P\_L = G\_l G\_r \left(\frac{h\_t h\_r}{d^2}\right)^2 \left(\frac{40}{f\_c}\right)^2 \tag{1}$$

where *Gt* and *Gr* are the gains of the transmitter and receiver antennas, respectively, *ht* and *hr* are the respective heights of the transmitter and receiver antennas, *d* is the distance between them, and *fc* is the carrier frequency in MHz.

## *2.5. Range Calculation Tool*

Cupcarbon provides default values for range depending on the wireless communication technology, for instance, 100 m, 400 m, and 5 km for Zigbee, WiFi, and LoRa, respectively.

This work proposes a slight modification to the Cupcarbon visual interface that allows for the computation of transmission range using the Egli model with the LoRa modulation parameters. The proposed modification, which is based on Java and integrated into the source code of Cupcarbon, allows the user to graphically select a node, choose LoRa, then enter the desired LoRa radio, LoRa parameters (*SF*, *BW*, frequency, etc.), and deployment parameters (*Gt*, *Gr*, *ht*, *hr*, radio power level, and receiver sensibility). Finally, after configuration, the user can apply it to all selected nodes in the simulation map.

It is important to highlight that when the user selects the LoRa radio module (SX1276, SX1277, SX1278, or SX1279), the radio parameters are automatically changed according to the datasheet [35].

#### *2.6. Methodology*

This work adopts as its main methodology the development and running of experimental simulations based on the DVR, AODV, and DSR routing protocols using the Cupcarbon simulator. Initially, these protocols were simulated while disregarding eventual errors that could occur in the network nodes or mobility situations; thus, several tests were carried out for each protocol with the purpose of applying the routing steps and their operation in a mobility scenario with both fixed and mobile sensors. Then, our new proposed radio

power adjustment (RPA) routing protocol for energy saving was compared with different alternatives.
