## 3 Results  
When designing a WSN network, it is vital to know the characteristics and requirements of the application. In the first stage of the design process, certain parameters will be taken into account due to their importance on the WSN's performance. These include the following: number and cost of nodes, power consumption, auto-configuration, scalability, adaptability, reliability, fault tolerance, security, channel utilization, and quality of service (QoS) support. We have used an event-based simulator programmed in C++ to generate the results; the simulator accepts several input settings for the physical, MAC, and network layers. Figure 1: Network grid topology. We consider variables related to the channel's quality and electrical variables such as the nodes' voltages or currents in the physical layer. In the MAC layer, to control the access to the physical transmission medium by devices that share the same communication channel, we implement a CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance) algorithm. The routing protocols studied in this work are built at the network layer. In order to quantitatively measure the energy impact, we have simulated the grid in Figure 1 under normal and jamming conditions, the results are depicted in Table 4 Thus, we have generated four scenarios to show the average impact of each metric on energy [45]. The scenarios are no jamming (normal conditions), with one jammer node (at node 25 of the topology), with two jammer nodes (at nodes 7 and 25 of the topology), and with three jammer nodes (at nodes 7, 25, and 43 of the topology). We measure each metric's impact for the four scenarios when we force their values to 100%. For example, we compare the power difference in the four scenarios when we force packet loss to zero versus the actual packet loss. Likewise, we hypothetically reduce the delay to zero and compare the energy impact. Thus, in this way, we have an approximate result of how much that metric directly affects energy. Table 5 shows a summary of the most relevant studied metrics analyzed in this work and their impact on grid energy. We do a qualitative analysis in which we take a week of samples both in the simulation tool and in a real scenario based on Zigbee and LoRa technologies (which will be expanded later in this same study). When we analyze each metric, we pay special attention to its behavior while the network is being affected by a jammer node. In this way, we can analyze it by comparing their values under normal and jamming conditions, and each metric's effect on local energy (at node level) and global (at network level). This analysis results in three levels of impact or impact on energy, denoted by the symbol \(\uparrow\), where \(\uparrow\) means low impact, \(\uparrow\uparrow\) means medium impact, and \(\uparrow\uparrow\uparrow\) means high impact. Thanks to this analysis, we can obtain the metrics with the most significant impact on energy to use in the experimentation methodology and our jamming detection algorithm. For the results, we analyzed the highest impact metrics such as retransmissions, the routing tables' behavior in the nodes (this includes valid and obsolete routes), and resilience (taking into account the nodes' link recovery times as they were under normal conditions ). It is also important to visualize the nodes' energy to observe the network's impact under stable and jamming conditions. \begin{table}
\begin{tabular}{l c} \hline
**Metric** & **Impact on Energy** \\ \hline PDR & 38\% \\ Availability routes & 67\% \\ Valid routes & 71\% \\ SNR & 30\% \\ Overhead & 35\% \\ Delay & 29\% \\ Hops & 19\% \\ Retransmissions & 81\% \\ CSMA retries & 21\% \\ Resilience & 68\% \\ RSSI & 25\% \\ \hline \end{tabular}
\end{table} 
Table 4: Impact on energy for relevant performance metrics.