7 Conclusion
This paper focused on detecting and preventing the black hole and selective forwarding attacks in the WSN. To detect, and prevent such type of attacks, this paper proposed two schemes, named as a two-stage security mechanism, and dual assurance scheme, for transmitting the data packet securely in the network. Moreover, this paper identified the untrusted path and provided secure routing paths using trust and CS algorithm, with active trust scheme in the clustered based sensor networks. This proposed scheme can quickly identify malicious nodes in the network with high energy efficiency. Finally, the avoidance of black holes and selective forwarding attack is done by the proposed secure routing scheme, which maximizes the ratio of packet delivery. The proposed system provides various features that are helpful in the real-time applications of WSN. For instance, it has maximal accuracy, minimal energy loss, ease of use, privacy, and reliability. These are very essential as they easily analysis to use in risk management, and assessment of the system as well as providing data packet, and secure routing path. Therefore, the experimental result shows that the proposed system is better than existing work in terms of energy consumption, latency, path length, Network lifetime in the heterogeneous and homogeneous network, throughput, and packet drop ratio. From the results, it is observed that the proposed system yields better performance with 20,000 ms latency power, and 85% throughput with maximum network size.