Volume 28 ,Issue 2 ,November 2026 ,Pages 22-42
Tara Al Attar 1 ; Dlsoz Rashid 2 ; Hawar Sharif 2
1 Department of Computer Science, College of Science, University of Sulaimani, Sulaimani, Iraq.
2 Department of Computer Science, College of Science, University of Sulaimani, Sulaimani, Iraq
A wireless sensor network (WSN) is an important part of the Internet of Things (IoT), enabling lightweight, long-distance wireless data collection and transmission. However, WSNs face energy limitations, security vulnerabilities, and complex topology making them susceptible to attacks (e.g., black hole, gray hole, flooding), which further degrade the performance and useful life of WSNs. This paper presents a theoretical framework addressing attacks on WSNs using trust-based management methods and directed acyclic graphs (DAGs) to develop optimized routing methods. Particle swarm optimization (PSO) using a composite fitness function to identify an optimal communication path based on energy efficiency, trust-based security, and the ratio of packets transmitted. Fixed weights were assigned to energy, trust, and hop count as follows: 0.4, 0.4, and 0.2, providing for fast convergence to optimal solutions. The trust scores were calculated hierarchically using the DAG structure and node resources and then used to identify malicious nodes using a hybrid random forest classifier. The effectiveness of this framework was evaluated using the WSN-Dataset (374,286 records with four different classes of attacks), which resulted in an accuracy rate of 99.7 percent and an outperformance of the decision tree (98.13 %), K-NN (99.42 %), and random forest (99.42 % without trust-based security) algorithms. The evaluation showed that the method developed in this study was statistically significant based on Friedman ( and Nemenyi, Wilcoxon, and McNemar’s tests with Bonferroni's correction (
, and all Cohen’s d values between 1.54 and 2.61 were achieved.
© 2026 The Author(s)
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.