## 5 Conclusions  
The protocols described in this work have different characteristics and benefits. Among other things, they are keeping the network activity for as long as possible, which guarantees successful communication between the various nodes that comprise it. They use different techniques or strategies, such as grouping nodes into subgroups that exchange messages between them, doing a minimum amount of processing of these messages before sending them to the rest of the network. Others work with data aggregation or with assigning different roles to nodes. In many cases, they use various metrics to make communication more efficient, allowing dynamic changes in schemes or routes, among many other alternatives. This work shows the use of two wireless communication technologies in the same scenario. For comparison purposes, different analyses of the performance of these technologies were carried out. From the results obtained, we have confirmed that the observed metrics can be used in these network implementations. This work's main contribution is the analysis of metrics related to the routing protocol to determine the impact and its real proportion in energy consumption. The contribution focuses on studying the compendium of the main parameters to design an algorithm for detecting abnormal behavior in the nodes without altering the processing of the routing algorithm at the local level (at the node level). This constitutes an interesting perspective from the point of view of energy consumption because the jamming detection stage does add significant overhead to the network. The metrics are compared against the network's normal performance conditions, and zones of possible impact are established. This analysis must complement the network topology knowledge to point out false positives in the  
Figure 22: LoRa network deployment under jamming conditions. potentially affected areas. In this way, the detection stage consumes little energy to prioritize the jamming mitigation stage. In this work, we consider reactive jamming that adds some intelligence to the jammer because it transmits when there is a signal in the communication medium, which makes it more aggressive to the network. We analyze four routing protocols based on clusters: PEGASIS, TEEN, LEACH, and HPAR. Our analysis shows the robustness of the PEGASIS and TEEN protocols against the zoning of a possible attack. These protocols are also tested in two known and currently used wireless technologies such as Zigbee and LoRa. Experiments are carried out on a real network in an area of a university campus in Guadalajara, Mexico, and the detection algorithm implemented is analyzed. The results show the algorithm's ability to detect nodes with anomalous behavior. Thanks to the low processing in the detection, it could help reduce the network's total energy consumption. We have conducted a study of the performance metrics on these four protocols. The metrics were chosen based on their high impact on energy, resulting in the following set: retransmissions, route availability, resilience, and energy. We analyzed the variation of the nodes' metrics under normal conditions and jamming, which allowed for establishing a way for identifying areas with greater affectation. These zones indicate a possible detection of jamming or the presence of malicious nodes on the network. PEGASIS shows a more accurate approximation by 92%; TEEN presents 86% accuracy, LEACH focuses on 70%, and HPAR focuses on these areas by 61%. This accuracy favors the detection of a possible jamming attack. On the other hand, we have generated a simulation environment for networks with a more significant number of nodes, similar to those found in industrial facilities, which are subject to a noisier wireless environment. We performed a further study on the PEGASIS protocol, which shows a behavior under normal conditions that worsen the nodes' metrics by 70% from 200 nodes. Under jamming, the network conditions are highly affected (in 85%) from 150 nodes.