## 4 Discussion
Another reason for this behavior is that, for example, LEACH assigns time slots that are wasted in the absence of an event, and the CH consumes energy in listening to said empty slots. In Figure 14, we observe the behavior of the routing tables of the nodes for each routing protocol under study. We have a simulation of ten thousand samples for each node of each routing protocol in Figure 4:3 This metric analyzes the routing tables' size in each node; that is, the valid routes that the nodes have to send packets to the coordinator node. When the network reconfigures the topology, valid routes may no longer exist or become obsolete, reflecting on the packet loss and a greater number of control packets by the routing protocol. This implies an increase in overhead, leading to more collisions and packet loss. We have that the more valid routes the nodes have, the greater redundancy for sending the information. The LEACH and HPAR protocols have the least amount of valid routes in the nodes' routing tables, with LEACH being 6% more redundant than HPAR. The protocol with the most valid routes is PEGASIS with 11% more routes than TEEN, 15% more than LEACH, and 19% more than HPAR. The above is measured under normal network conditions. When the network has the presence of jamming (the jammer node located at node 25 of the network topology), the network's overall performance decreases in terms of the number of valid routes. This will cause more packet loss. We have the HPAR protocol down 16%; the LEACH protocol drops 12%; the TEEN protocol drops 9%, and the PEGASIS protocol fell 7%. We can conclude that PEGASIS has a better reaction to jamming than the reconfiguration of the network and reconstruction of routes. The model that we present in this work is based on analyzing specific performance metrics that directly impact noticeable jamming behavior. The metrics are retransmissions, resiliency, power, and node routing table behavior (keeping valid routes). In this work, we focus on the stage of jamming detection. It is important to note that our analysis aims to differentiate jamming against noise or network interference. The metric that has the most significant impact on detection is energy, giving 12% more noticeable information than the other metrics. It is followed by the resilience metric with an impact of 7% and the retransmission metric with an impact of 6%. Regarding the maintenance of the routing tables, we observed that, with the jammer node's presence, there is a 15% of variation in the behavior of the valid routes, which helps with the early detection of jamming. Figure 15 shows the network's energy performance under the four types of protocols under study: TEEN, HPAR, LEACH, and PEGASIS. For this test, we have put a reactive jammer on node 25 and set the jamming activity to increase the packet loss of affected links by 20%. We have simulated 24 h of network operation to collect data from each node. We do this simulation to check how misleading jamming could be against interference under a specific routing protocol. The protocol with the highest dispersion of values between contiguous nodes is HPAR, with 7% against LEACH, 6% against TEEN, and 8% against PEGASIS. We visualize the least impact on energy levels in the PEGASIS protocol, which presents a 17% lower energy consumption on an approximate average than the other three protocols. The resistance shown by the PEGASIS protocol against the impact on energy consumption is an advantage related to the network's performance. Still, it can present a disadvantage when faced with the detection of possible jamming. This is because the observed difference between common interference and jamming is very little noticeable. Figure 4:4 Routing tables’ conditions under normal conditions and jamming. Figure 4:5 Energy per node for simultaneous conditions of interference and jamming. Figure 16 shows a rough summary of each protocol's average detection zones (PEAGIS, TEEN, LEACH, and HPAR).