Energy-Saving Routing Protocols for Smart Cities

: In recent decades, expansion in urban areas has faced issues such as management of public waste, noise, mobility, and air quality, among others. In this scenario, Internet of Things (IoT) and Wireless Sensor Network (WSN) scenarios are being considered for Smart Cities solutions based on the deployment of wireless remote sensor nodes to monitor large urban areas. However, as the number of nodes increases, the amount of data to be routed increases signiﬁcantly as well, meaning that the choice of the data routing process has great importance in terms of the energy consumption and lifetime of the network. In this work, we describe and evaluate the energy consumption of routing protocols for WSN-based Smart Cities applications in LoRa-based mesh networks, then propose a novel energy-saving radio power adjustment (RPA) routing protocol. The Cupcarbon network simulator was used to evaluate the performance of different routing protocols in terms of their data package delivery rate, average end-to-end delay, average jitter, throughput, and load consumption of battery charge. Additionally, a novel tool for determining the range of nodes based on the Egli propagation model was designed and integrated into Cupcarbon. The routing protocols used in this work are Ad Hoc On-Demand Distance Vector (AODV), Dynamic Source Routing (DSR), and Distance Vector Routing (DVR). Our simulation results show that AODV presents the best overall performance, DSR achieves the best results for power consumption, and DVR is the best protocol in terms of latency. Finally, the proposed RPA routing protocol presents power savings of 11.32% compared to the original DSR protocol. Conceptualization, and W.T.A.L.; methodology, writing—original


Introduction
Urban growth has been boosted in recent decades due both to economic factors and to political, social, and health trends. However, this growth brings with it problems in such different areas as waste management, mobility, scarcity of natural resources, noise and air pollution, and more.Air pollution, for example, is an environmental problem that can cause several diseases in humans and damage to both the environment and animals, with transportation and industry being the main sources of pollutants in the atmosphere [1].
Smart Cities are emerging as an alternative that can enable applications to deal with several problems associated with urban centers. Smart Cities are urban scenarios using Information, Technology, and Communications (ITC) to improve infrastructure and the quality of citizens' lives. Strongly linked with the concepts of the Internet of Things (IoT) and Wireless Sensor Networks (WSN), Smart Cities provide means to carry out acquisition, transmission, and processing of data to make more effective tools available for facing the challenges of the urban environment [2,3].
A WSN is comprised of several wireless sensor nodes distributed in a large area to perform control and monitoring tasks and to share sensor data with each other in order to solve specific problems [4].
To deploy a WSN, several stages are needed, including the development of sensors, which depends on the application, number of sensors, network topology, communication technology, and routing protocol. It is worth mentioning that the routing protocol is critical in any WSN design and that its performance needs to be evaluated for different scenarios and applications.
Computer simulations are an important design tool for evaluating routing protocols in high-density WSNs, thereby reducing costs and saving time during implementation. Simulations can support the choice of a particular routing protocol and help in evaluating new protocols, mainly in scenarios subjected to unfavorable conditions, such those in which device failure is highly probable.
Another important stage in WSN implementation is the wireless communication technology used by the network. Many of the main wireless communication technologies adopted in IoT and WSN applications are based on Low-Power Wide-Area Networks (LPWAN), 3G/4G/5G cellular networks, or ZigBee. LPWANs have gained importance compared to the others thanks to relevant characteristics such as low power consumption and transmission over long distances. Among LPWAN technologies, LoRa (Long Range) is being widely used worldwide, as it can achieve ranges up to 15 km in urban areas with a very low power consumption [5,6].
In this context, the main objective of this paper is to implement and evaluate the performance of routing protocols for the establishment of LoRa-based WSN applications. To this end, we chose the Cupcarbon network simulator, which was developed specifically for Smart Cities and IoT scenario, to evaluate the performance of different routing protocols in terms of data package delivery rate, average jitter, average end-to-end delay, throughput, and load consumption of battery power. In addition, we propose a novel tool for determining node ranges using the Egli propagation model inside the Cupcarbon simulator. In this paper, we consider the widely used WSN routing protocols Ad Hoc On-Demand Distance Vector (AODV), Dynamic Source Routing (DSR), and Distance Vector Routing (DVR). Additionally, a novel routing protocol based on radio power adjustment (RPA) is proposed as means of energy saving.
The rest of this paper is organized as follows. In Section 2, details about LoRa technology and routing protocols for WSN are presented. The Cupcarbon simulator and the Egli propagation loss model are highlighted within the methodology considered in this work. Simulation results are presented and evaluated in Section 3, then and the conclusions and next steps in the research derived from this paper are discussed in Section 4.

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][9][10][11][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][14][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.

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).

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 ( f low , f high ), 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 = f high − f low ) 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 f low to f high ), meaning that when a frequency related to the data being transmitted is reached, it is shifted to f low while maintaining the same frequency slope, causing a discontinuity point.The discontinuity point position is responsible for the encoding of the transmitted data [6].

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].

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].

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].

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]: • Proactive: Routing tables are shared with neighboring nodes during network startup and at fixed times, meaning that all nodes know the paths to any destination nodes even before this information is needed [22]. Examples of proactive routing protocols include Distance Vector Routing (DVR), Destination-Sequenced Distance Vector Routing (DSDV), Optimized Link State Routing Protocol (OLSR), and Wireless Routing Protocol (WRP); • Reactive: Routes to destination are established only when needed, that is, when there are data packets to be sent. Therefore, only active routes to destination nodes that are in use are stored. These protocols do not share data at network startup, and have periodic routing table sharing mechanisms [10]. 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.

Cupcarbon Simulator
Cupcarbon is an open-source Java-based network simulator with a focus on Smart Cities, WSN, and IoT [26][27][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: 1.
The radio channel block: this comprises two Radio-Frequency (RF) propagation models, the first based on a visibility tree and the second one devoted to tracing 3D beans using a Monte Carlo algorithm [26]. 2.
2D/3D environment: a graphical environment for implementing 2D/3D maps that can be displayed on Open Street Maps (OSM) or Google Maps [30].

3.
Interference block: this can be divided into two layers, the physical layer and interference models layer. It can simulate realistic baseband models for wireless com-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.

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 P L , and is provided by the formula where G t and G r are the gains of the transmitter and receiver antennas, respectively, h t and h r are the respective heights of the transmitter and receiver antennas, d is the distance between them, and f c is the carrier frequency in MHz.

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 (G t , G r , h t , h r , 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].

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.

Simulation Scenario
In order to compare performance between the protocols in a near-real scenario, we considered a scenario based on a real city in which a source sensor node was represented as a bus traveling through the streets and avenues of an urban environment and performing air quality measurements while periodically sending the measured data to a central node (gateway). Thus, a mesh network topology was considered consisting of 25 nodes distributed among the streets and avenues of the city of João Pessoa, Brazil, as illustrated in Figure 1.

Simulation Settings
Each node illustrated in Figure 1 was defined with the wireless communication module LoRa SX1276 in the frequency range of 915 MHz. The node range was calculated considering antennas with a gain of 3 dBi, antenna height of 2.5 m, and transmission power of 20 dBm. In addition, the LoRa parameters are shown in Table 1.
Considering that the DVR protocol is proactive, a period of 5 min for sharing the routing tables was defined, with the first sharing being initiated at the start of the simulation. In the case of AODV protocol simulations, a period of 90 s was defined for the route maintenance mechanism (sending 'Hello' messages). Finally, a period of 30 s was used to transmit general messages and data packets from the sensors.

. Evaluation Metrics
To evaluate the performance of the protocols implemented in Cupcarbon, several quantitative metrics calculated by the gateway during the reception of data packets were considered.
• Packet Delivery Rate (PDR): this metric is the ratio between the number of packets sent by a source node and the number of packets received by the destination, as provided by [9]: where N RX i represents the number of data packets successfully received by a destination node i and N TX i is the number of packets sent to this device. • Throughput (THR): the number of data packets successfully transmitted to their final destination on a given communication channel per unit of time [11]; THR can be calculated as follows: • End-to-End Delay (E2ED): the average time required for a number of data packets to be successfully transmitted over the network from a source node to a specific destination [9]; it can be defined mathematically by where N RX i is the number of data packets received by node i, T RX i represents the time the data packet was received, and T TX i is the time when the package was sent. • Average Jitter (JIT): this represents the variation of the average end-to-end delay in the delivery of data packets in a network, which may cause a situation of non-regularity in the reception of data packets; the formula is provided by [36,37]: where E2ED i k is the average delay of a given instant k, E2ED i k−1 is the average delay of the previous instant, and N RX i is the number of data packets received by node i.

Classic Energy Consumption Model
This is the standard energy consumption model adopted by the Cupcarbon simulator. To calculate how much battery energy a node consumes during data packet transmission, the following expression [29] can be used: where n is the number of bits transmitted or received, E TXb is the energy consumption required to transmit one byte, and P is the power of the transmission expressed as a percentage.
Similarly, the energy consumption during data reception can be obtained as follows: where n is the number of bits transmitted or received and E RXb is the energy consumption required to receive one byte.

Proposed Radio Power Adjustment (RPA) Routing Protocol for Energy Savings
The proposed radio power adjustment (RPA) routing protocol is based on the DSR protocol, as DSR shows better overall performance, including the lowest energy consumption, as compared to DVR and AODV.
The first step of the proposed RPA routing protocol is to provide a way for Cupcarbon to compute the Radio Signal Strength Indicator (RSSI) from the distance between two nodes according to the log-distance model. This model was chosen because it is independent of the transmission frequency and antenna gain. The log-distance path loss model can be obtained by [38]: where n corresponds to the path loss coefficient (the value of 3.3 was adopted in this work), d is the distance between the transmitter and the receiver, and d 0 is the reference distance. The choice of the value of n was carried out by taking into account the experimental results obtained in [39]. In these experiments, two devices were used to exchange data using LoRa modulation in an urban environment while evaluating the packet delivery rate and RSSI as a function of the transmission distance. Then, the RSSI curves versus the distance were obtained and compared to the experimental data and the data from the log-distance model, with the value of n = 3.3 representing the best fit between the curves.
The value of PL(d 0 ) represents the path loss for a direct line of sight with respect to the reference distance, and can be obtained by [38]: In Equation (9), d 0 is the reference distance and the parameter λ corresponds to the carrier wavelength.
Equations (8) and (9) were programmed in CupCarbon. When any data are received, the distance between the transmitting and receiving nodes which are exchanging data is obtained through the computed RSSI function.
The second step of the proposed RPA routing protocol is the definition of an equation that relates the computed RSSI value to the minimum P TX necessary to maintain the communication link. To this end, simulations were performed in Cupcarbon varying the distance between two nodes.
In this way, a node RX was kept fixed and a node TX was initially moved to a distance equal to the maximum range of 1.7 km; P TX , that is, the transmission power of node TX, was set to the maximum value (20 dBm). Thus, the distance between the nodes was reduced in 50-meter intervals until the minimum distance of 1 m was reached, with the RSSI value calculated for each distance at these intervals. At the same time as the distance was being reduced, at each new displacement point P TX was reduced in 5% intervals until a minimum value at which the communication link was not lost was reached.
The results of this process were then imported into Octave software and an interpolation process was performed applying the polyfit function. To assess which polynomial obtained a better approximation of the original data, the Root Mean Square Error (RMSE) was used as a criterion, resulting in the following mathematical expression being obtained: Finally, this expression was inserted into the DSR protocol code to determine the appropriate P TX for each RSSI value. To use the proposed RPA routing protocol, it is necessary to add a new column to the routing table that contains the value of P TX for each destination, this value being initialized with 100% and automatically changed as the simulation is run. A safety margin of 2% was considered as well, and was added to the value calculated by Equation (10) to provide more reliability during data packet transmission. Figure 2 shows the process used to compute the minimum level of P TX needed to establish reliable communications. The first step is to identify the address of the node that sent the data and calculate the RSSI. This procedure is illustrated in Figure 2a, and the corresponding pseudocode is detailed in Algorithm 1 . This RSSI value is then used as an input parameter in Equation (10) to obtain the value of P TX , which is added to the safety margin value and saved in the column of the routing table that stores the level information power relative to that destination node. When it is needed to carry out a transmission, the source node consults the power level value in its routing table, updates it, and sends the data packet. This procedure is illustrated in Figure 2b, and the corresponding pseudocode is detailed in Algorithm 2.

Results
This section describes and discusses the main results obtained in this work. The simulation results for both metrics and total energy consumption refer to the average values obtained from five simulation trials.

Determining the Safety Margin of the proposed RPA Routing Protocol
With the aim of providing more reliability during the computation of P TX , a safety margin in the range from 0 to 5% was added to the proposed RPA algorithm. Thus, the total energy consumption was evaluated as a function of the variation of the safety margin. For this purpose, three simulation experiments were performed for a scenario composed by 25 nodes, one source sensor node, 23 router nodes, and one gateway.
In this experiment, the source node moves at a fixed speed of 18 km/h and the others remain static. The source sensor node sends data to the gateway at every 30 s. At the end, the value of energy savings is calculated from the average consumption value comparing the simulations of the DSR protocol with and without the RPA algorithm.
As shown in Figure 3, when the adjustment margin is greater than 2.5% the energy savings are less than 10%. Therefore, to obtain energy savings of at least 10%, we decided to keep the safety margin fixed at 2%.

Simulation Results and Discussion
As mentioned before, the simulation results refer to the average values obtained from five simulation trials. Figure 4 shows the PDR metric for DVR, AODV, DSR, and modified DSR (that is, DSR with the proposed RPA routing protocol).
From these results, it can be seen that the reactive protocols present better overall performance in sending data; the AODV protocol has the highest rate of data packet delivery, followed by the DSR and modified DSR protocols. The result for AODV corresponds to a route verification mechanism that works periodically and during the movement of the source node, anticipating the discovery of new routes in case of unavailability.
For speeds below 20 km/h, all protocols maintained high data delivery rates. However, above this speed value the performance decay of the DVR protocol was quite high, with more than 50% of transmitted packets being lost when the source node moved at speeds greater than 60 km/h. The other protocols were able to maintain delivery rates above 80% for the same speed range. Consequently, the impact of the source node speed variation on the proactive DVR protocol was much greater. This characteristic was expected, as new routes could be discovered only within the fixed routing interval of 5 min. In Figure 5, the performance results of the routing protocols in relation to the average end-to-end delay are shown. From these results, it can be observed that the DVR protocol had the lowest latency, followed by the AODV protocol. The DSR and modified DSR protocols had higher average latency compared to the others. It is important to mention that the performance of the DVR protocol in terms of latency shows expected behavior. As a proactive protocol, it is independent of unavailable routes, as the discovery of new paths to destinations takes place during fixed routing periods and is accessible in the routing tables prior to each transmission demand.
The average performance of the protocols according to the jitter metric is shown in Figure 6. Based on the curves in Figure 6, it can be seen that the DSR protocol was the only one that does not have a variation for latency higher than 4 ms. For speeds below 100 km/h, the DVR protocol presented similar behavior. However, at higher speeds, it is the protocol with the highest jitter. Regarding the throughput performance, shown in Figure 7, a high correlation was observed with the packet delivery rate. The performance of the AODV protocol in terms of the packet delivery rate is reflected in the transfer rate metric, indicating that this protocol is capable of transmitting more data per unit of time than the others. Both the DSR protocol and the modified DSR had slightly lower performance than AODV.
As the DVR protocol obtains data regarding routes at a fixed interval of 5 min, this protocol has a higher packet loss rate when subjected to high speeds, causing a considerable reduction in its transfer rate, as can be seen in Figure 7. Figure 8 shows the results of the average total battery charge consumption according to the routing protocol. From these results, the impact of the large number of re-transmissions on the total consumption of the DVR protocol can be observed, leading it to consume around 460 J for the whole simulation. Although the AODV protocol presents the best performance in the delivery of data packets, it consumed the second-highest energy, at almost 300 J, while the modified DSR protocol (DSR with RPA routing protocol) consumed the least energy over the total simulation time.
As this work is focused on applications for smart cities, our results take into account the existence of moving nodes (e.g., deployed in a vehicle) and node speeds from 0 to 180 km/h are considered. As expected, this scenario constitutes a very challenging environment for routing protocols. Consequently, all results in Figures 4-7 use the source node's speed as the independent variable. The simulation results demonstrate that the speed influences the adopted metric (Packet Delivery Rate (PDR), Throughput (THR), End-to-End Delay (E2ED), Average Jitter (JIT), and Energy Consumption). Therefore, these results prove the energy savings provided by our proposed DSR with RPA routing protocol has an average total power consumption that is 11.32% lower compared to the same protocol without the proposed RPA.

Conclusions and Future Works
In this work, we analyzed routing protocols in two distinct categories, namely, proactive and reactive protocols. The Cupcarbon network simulator was used to evaluate important metrics such as data package delivery rate, average end-to-end delay, average jitter, throughput, and load consumption of battery charge. Thus, the Ad Hoc On-Demand Distance Vector (AODV), Dynamic Source Routing (DSR), and Distance Vector Routing (DVR) routing protocols were implemented in the Cupcarbon simulator. In addition, a tool for calculating the range between devices according to the Egli propagation model was developed and integrated into the graphical interface of Cupcarbon. The results showed that the DSR protocol was the most suitable option among those implemented for use in conjunction with the P TX adjustment algorithm proposed in this work, providing energy savings of 11.32% compared to the original DSR. On the other hand, the AODV protocol had better overall performance and had the second-highest power consumption. While the DVR protocol consumed the most energy, it had the best performance in terms of latency; however, it led to high packet loss.
For this implementation, a mixed network topology was defined using the DSR protocol together with the LoRaWAN protocol. A cloud application was developed to monitor data reception, confirming the correct functioning of the network.

Future Works
The simulation results obtained here can be used as the basis for future experimental implementations, which we intend to carry out in our continuation of this work. It is important to note that Equation (10) cannot be generalized to every situation, and is specific to the simulation scenario used in this work. However, the proposed procedure can be replicated to obtain new equations for other simulation scenarios. In addition, while the algorithm proposed in this work does not take into consideration all of the factors that may influence the transmission of data in real scenarios, it is now possible to perform more realistic transmission modeling in Cupcarbon, as updates have been released in recent months that make it possible to use real devices in conjunction with simulations developed in the software.
In this context, we propose further experimental implementation of the proposed power adjustment algorithm; for example, it could be used with ESP32 devices for the purpose of evaluating its operation in a real scenario and making further improvements.