# Trusted Energy-Aware Hierarchical Routing (TEAHR) for Wireless Sensor Networks
## 3 Proposed Studies
### Proposed Algorithm
post_attack_detection_rate is a detection rate computed after the spoofing attack begins. spoofing_success_rate metric indicates the success rate of the spoofing attack in terms of how many spoofing attempts or malicious actions were effectively carried out on the network. A higher value suggests that the attack was more successful in bypassing security measures. Table 5 shows the spoofing attack analysis; in this we compare the spoofing attack in 500, 1000, and 2000 sensor nodes. The percentage of malicious nodes remains consistent across all sample sizes (approximately 29%), but the spoofing vulnerability increases slightly with the full dataset (48.21% compared to 47.26% for 1000 nodes and 42.07% for 500 nodes). This suggests that as the network scales, the percentage of malicious nodes that can successfully spoof the system increases, making larger networks potentially more vulnerable to strategic spoofing attacks. The data demonstrates that anomaly nodes can effectively execute strategic spoofing attacks against TEAHR, with high success rates and significant network compromise levels, particularly as networks scale up in size. If some nodes are isolated due to misjuddment in WSN, they will be treated as anomaly nodes, and isolating them affects the network connectivity. If we drop those nodes, it leads to reduced global connectivity and might separate the network into many disconnected components. More nodes will be removed, and its size will decrease. The data flow, resiliency, and cooperation among nodes are affected by this. An increase in connectivity can drive down the average path length for small communities; however, homogeneities can form that can reduce end-to-end communications across the network. In general, we avoid connection of anomaly (malicious) nodes to the rest of the network. However, identifying benign nodes as anomalies led to unnecessary fragmentation and weakened the overall robustness of the network. If we reassess those misjuddged isolated sensors, they may lead to overhead as it will increase the computation. In TEAHR, reintegration of wrongly isolated nodes should be considered if they were misclassified; for that, adaptive

\begin{table}
\begin{tabular}{c c c c c c c c c c} \hline \hline
**Num Nodes** & **Num Anomaly** & **Anomaly Percentage** & **Pre Attack Excluded** & **Pre Attack Excluded** & **Post Attack Excluded** & **Post Attack Excluded** & **Post Attack Excluded** & **Spoofing Success Rate** \\ \hline
500 & 145 & 29 & 253 & 84 & 57.93 & 238 & 69 & 47.58 & 52.41 \\
1000 & 292 & 29.2 & 508 & 157 & 53.76 & 487 & 136 & 46.57 & 53.42 \\
2000 & 585 & 29.25 & 1007 & 307 & 52.47 & 958 & 258 & 44.10 & 55.89 \\ \hlinere-routing mechanisms should be optimized to ensure sustained packet delivery rates. Lastly, this further emphasizes the need to strike the right balance of node accuracy to maintain network connectivity while still preserving security. So, in future analysis could focus on the long-term impact on latency and routing overhead. ### Analysis of TEAHR

In Figure 11, the proposed algorithm is compared with other algorithms, and the proposed algorithm reduces total latency by 15% after inserting the anomaly as defined above. As shown in Figure 11, the average latency of the TEAHR algorithm is more stable than other algorithms. In Figure 12, we represent the packet forwarding rate analysis when the network grows; in this figure, all four algorithms start with high efficiency in smaller networks but begin to diverge as more nodes are introduced. The Energy Efficient and Ant algorithms show a moderate decrease in packet delivery rate, which might be acceptable in many applications. The TIOCHR algorithm performs slightly better, implying a more robust handling of packet forwarding under scaling conditions. The TEAHR algorithm stands out for its remarkable stability, indicating a robust approach to packet forwarding that is less affected by network scaling.