**3. 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.

#### *3.1. Determining the Safety Margin of the proposed RPA Routing Protocol*

With the aim of providing more reliability during the computation of *PTX*, 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%.

**Figure 3.** Power adjustment safety margin versus energy savings.

#### *3.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.

**Figure 4.** Packet delivery rate (PDR) as a function of the source node's speed for the DVR, AODV, DSR, and Modified DSR protocols.

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.

**Figure 5.** End-to-end delay (E2ED) as a function of the source node's speed for the DVR, AODV, DSR, and Modified DSR protocols.

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.

**Figure 6.** Average Jitter (JIT) as a function of the source node's speed for the DVR, AODV, DSR, and Modified DSR protocols.

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.

**Figure 7.** Throughput (THR) as a function of the source node's speed for the DVR, AODV, DSR, and Modified DSR protocols.

**Figure 8.** Total average consumption per protocol.

Table 2 summarizes the achievements of this work compared with other routing protocols considering a mobile WSN with 24 sensor nodes and one concentrator node at two speed values (18 km/h and 90 km/h).


**Table 2.** Comparative analysis for DVR, AODV, DSR, and modified DSR protocols.

#### **4. 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 *PTX* 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.
