DOI: 10.3390/app16199736 ISSN: 2076-3417

SecureFresh-WSN: An Energy-Aware and Trust-Based Clustering and Routing Protocol for Cyberattack-Resilient Wireless Sensor Networks

Abdulla Juwaied

Wireless sensor networks (WSNs) in critical environments need to conserve energy and deliver fresh information despite possible cyberattacks. Meeting these requirements remains a challenge. Classical protocols such as LEACH optimise energy but neglect security and freshness, while recent reinforcement-learning and fuzzy-trust methods address security at the expense of energy balance or data freshness. This paper proposes SecureFresh-WSN, a unified clustering and routing protocol that jointly balances the optimisation of energy consumption, cyberattack resilience, and Age-of-Information (AoI) freshness in terrestrial WSNs. The framework integrates (1) K-Means spatial clustering for stable topology formation; (2) a temporal anomaly-detection mechanism with per-node risk memory over a six-round sliding window; (3) a multi-criteria, trust-aware cluster-head (CH) selection mechanism that penalises suspicious, attacked, and energy-depleted nodes; and (4) confidence-weighted routing that prioritises fresh data delivery while reducing exposure to compromised forwarding nodes. MATLAB R2025a simulations were conducted for the network sizes of 100, 500, and 1000 nodes. Each of the four independent attack types (Denial of Service, False Data Injection, Selective Forwarding, Sinkhole) was injected independently with the probability of 0.015 per node per round, which led to an overall attack probability of approximately 5.87% per node per round. Over 20 independent random seeds, SecureFresh-WSN decreased the mean network Age-of-Information (AoI) by 66.4% compared to the LEACH protocol, increased the network lifetime (LND) by 28.4%, improved the packet delivery ratio by 11.3%, and reduced false suspicion of selected CHs by 41.7% in the case of 100 nodes, with similar trends observed for larger network sizes. Energy consumption was reduced in most cases while maintaining a good level of performance.