**7. Results**

In the network we have implemented, the most severe aspects to be analyzed under coexistence are presented among the BLE, WiFi, Lora, and ZigBee devices, because LoRa can be configured for other frequencies. ZigBee allows the dynamic selection of channels, a scanning function goes through a list of compatible channels in search of beacon, receiver energy detection, indication of link quality. A feature called frequency agility is specified in the ZigBee standard to improve the robustness of ZigBee networks. According to this function, if an interference is detected in the current channel, a ZigBee network can move to a clear channel depending on some mechanisms. The ZigBee operation in the 2.4 GHz band is favored by the choice of the 16 available channels. The frequency agility feature facilitates the use of these additional channels. When a network is integrated for the first time, the node looks for a channel with the least noise or traffic. If additional overtime traffic appears or if there is noise, the host application looks for a better channel and moves the entire network to the new channel, allowing the network to adapt to changes in Radio Frequency RF environments. Table 1 shows the specifications of the studied wireless technologies.



Tables 2 and 3 show the results of the different protocols under the cooperative and collaborative schemes. The metrics used together with the results should be analyzed together as they affect each other. When a node connects to the network the route discovery stage starts, in the case of ZigBee the gateway must assign an ID to the connected node. On the other hand, some protocols send control messages so that other nodes respond them, and in this way, the new node creates its neighbor tables and depending of the configuration also creates its routing tables. Hence, the more percentage of disconnected nodes the discovery process will occur more times.


**Table 2.** Nodes under the cooperative scheme.


**Table 3.** Nodes under the collaborative scheme.

Moreover, when a node tries to connect to the network, control messages are sent, therefore, the higher the percentage of disconnection of nodes, the greater the overhead. In the same way, having a greater number of packets in the network will result in more collisions and as a consequence in a greater number of retransmissions, the channel will be busier and will increase the channel retries. It is important to note that the channel retries occur when a node access the channel to verify if it is free, and if so transmit the packet. Finally, by increasing the disconnected nodes, retransmissions and channel retries the energy consumption will increase.

Otherwise, when a node is disconnected from the network some routes are canceled and new routes are created, when the node reconnects, the network enters a non-stable state, the time it takes to pass from non-stable state to a stable state is known as resilience. Therefore, the lower the resilience, the higher the energy consumption, since the network will take longer to configure and achieve new stable routes. This is directly related to the available routes, when this metric is low, there is a greater possibility of packet loss, which causes a greater number of retransmissions and finally energy consumption increases.

Tables 2 and 3 show results of performance metrics to observe the behavior of the network under the cooperative and collaborative schemes. Samples were taken from the network running for 24 h. The tests are carried out during a weekday so that the number of users and the vehicular flow is that of a normal day with activity on campus. Metrics are an average obtained every hour by all the sensors that work under each technology. The tests are carried out in an area of 300 square meters with indoor and outdoor sensors. No battery change was made for any of the sensors. The maximum number of packet retransmissions is 3, before the packet is discarded. The maximum number of retries to listen to the channel is 5, before the packet is discarded. It is well known that cross traffic affects adversely the network parameters. Thus, the scenarios experimented in this work, in practical terms, the traffic is only related to sensor network and it is expected that variation tends to be small value. A slightly variation is observed during experimentation and it can be observed that is independent of protocol. The data of the metrics studied present a standard deviation between 1 and 1.3% for the four technologies presented in each performance metrics for the cooperative and collaborative schemes. This shows that the measurements taken over 24 h can reflect a similar behavior with a small variation in the morning hours, where the traffic of people and vehicles decreases remarkably.

Specifically, Table 2 describes the results of the main performance metrics for the nodes under the cooperative scheme, i.e., when the technologies studied are in operation in the same geographical area and the priorities of the network are above the priorities of the sensor. The result of the metrics described is an average of the sensors that are under the wireless communication protocol. With respect to the end-to-end delay, ZigBee is the fastest due to its topology and message concentration. Subsequently, WiFi follows the speed of information delivery due to the greater sensitivity of the WiFi antenna and this gives an advantage, in addition to the fact that bandwidth is greater. On the other hand, the protocol with most retransmissions is WiFi, it is important to mention that a high retransmission rate increases delay and energy consumption. Additionally, retransmission as well as control packets contribute to the network overhead, being WiFi the protocol with the highest overhead,

so it has a higher probability of collisions. Another important metric is resilience, in this case BLE and LoRa have the best response times, since after a failure they return to a normal operating state in a shorter time than WiFi and ZigBee.

In the collaborative scheme specified in Table 3, which consists of sharing resources and functions only if the sensor has availability, the sensor priorities are over the network priorities. In comparison with the results of Table 2, the end-to-end delay increases; however, the ZigBee remains the fastest. Following this trend, retransmissions as well as lost packets increase. Because the retransmissions increased in all the protocols, it is expected that the percentage of overhead will also increase, since mores packets are sent. Finally, it is important to mention that in critical applications where safety becomes a priority, two characteristics of the network are of high importance: resilience and availability. However, Table 3 shows that the resilience time increased with respect to the configuration of Table 2, therefore in collaborative scheme, it will take more time to achieve a normal operating state after a failure, a key factor in critical systems. On the other hand, the energy consumption directly affects the availability, most of the sensors are battery powered, i.e., the more energy they consume the faster the battery will run out. In this aspect, the collaborative scheme is better, since it consumes less energy, being ZigBee the protocol with the lowest consumption.

These Figures 8 and 9 show random measurements (11 for each wireless technology). These figures are intended to show the intensity of the received signal. In this way, we can see under which scheme we can determine if a signal is sufficient to establish a wireless connection when other technologies and diverse environmental situations are present. Then, each of these measurements helps us to know the strength with which the devices listen or could hear the signal at that specific point. Likewise, we observe that for both schemes, WiFi is the technology with higher RSSI levels (in dBm), which shows that there are areas of very low signal coverage, while the technology that exhibits the best levels (very good coverage) presents is LoRa, possibly because its operating frequency is different and faces fewer collisions. The position of each measurement was performed in a uniformly distributed manner throughout the area of the university campus, where the sensors were located. For the cooperative scheme shown in Figure 8, the average RSSI value in dBm for BLE is −90.36, for ZigBee it is −85.36, for WiFi it is −99.09 and for LoRa it is −68.36. For the collaborative scheme shown in Figure 9, the average RSSI value in dBm for BLE is −92.73, for ZigBee it is −87.91, for WiFi it is −100.73 and for LoRa it is −71.82. We can then state that both schemes differ between 8 and 10% with the cooperative scheme being less interfering. It is important to bear in mind that the best transmission signals are observed in values close to −75 dBm. This makes sense considering that the LoRa technology is the one with the best coverage and, therefore, will present the least number of collisions. The one that presents worse coverage is WiFi and is understandable due to the large number of devices connected to campus networks, it is logical that the characteristics of a campus present a smaller scale than the characteristics of a city. Of the three technologies that are in the same frequency band, ZigBee has better signal coverage (between good and medium coverage). These figures help to better understand Tables 2 and 3 due to the metrics related to the interference of the channel such as: collisions, packets retransmissions, resilience, among others.

**Figure 8.** Received Signal Strength Indication (RSSI) values in dBm under cooperation scheme for each technology.

**Figure 9.** RSSI values in dBm under collaboration scheme for each technology.

As mentioned above, one of the key metrics in any sensor network is energy consumption. Figures 10 and 11 show a summary of the energy consumption for each protocol under the cooperative and collaborative schemes.

**Figure 10.** Energy in Joules under cooperation scheme for each technology.

**Figure 11.** Energy in Joules under collaboration scheme for each technology.

Figure 10 shows that under the cooperative scheme the protocol with the lowest energy consumption is ZigBee, where the minimum consumption value is 0.2 Joules, but most of the sensors consume between 0.8 and 2.1 Joules, with the median being 1.5 Joules. Zigbee consumes about half of the LoRa protocol, since the latter has an average value of 2.4 Joules; however, 50% of the sensors consume between 2.4 and 4.3 Joules. On the other hand, BLE and WiFi have very scattered data, reaching to consume values as low as 1.1 Joules up to 6.8 Joules as in the case of WiFi, with the median

value of 3.2 Joules for BLE and 4.8 Joules for WiFi. In this way, it is clear that the protocol with the best consumption is ZigBee, additionally it has less dispersed data so that a more exact battery life calculation can be made, otherwise in WiFi the scattered data would cause different battery life time for each sensor.

By contrast, Figure 11 shows the protocols under the collaborative scheme; however, the results are very similar to those in Figure 10, with the ZigBee protocol having the lowest energy consumption. It is important to mention that in a comparison between schemes, the cooperative has a lower energy consumption in all protocols except for WiFi, in which values are very similar. The biggest difference is the dispersion of the data, for the ZigBee protocol the range in the cooperative scheme is 3.6 Joules and in the collaborative scheme is 0.7 Joules, something similar occurs for both LoRa and BLE. This low dispersion indicates that all the sensors consume practically the same energy (at least in ZigBee), so that the lifetime of their batteries will be very similar, being able to program a more efficient maintenance of the network.
