RESUMO
Secure routing is crucial for wireless sensor networks (WSNs) because they are vulnerable to various attacks. In this paper, we propose a new secure routing protocol for WSNs in the presence of malicious nodes. For each relay node in the route, associated information such as its trust value and status is considered in the protocol. The trust value is defined as the attack probability of the node according to previous packet-forwarding behaviors, and the status is a hybrid metric that combines the residual energy and distance to the sink node. Therefore, the route generated by the protocol is secure against malicious attacks and globally optimal according to the associated information. We used an improved variant of the Dijkstra algorithm to generate the secure route for WSNs in the presence of malicious nodes. Compared with the Reputation-Based Mechanism to Stimulate Cooperation (RBMSC) model in the same simulation environment, the proposed model can maintain a higher delivery ratio, which verifies the effectiveness of the proposed model on the basis of global optimization. Furthermore, compared with the traditional Dijkstra algorithm, the packet loss ratio in the improved Dijkstra algorithm is lower because it can more effectively avoid malicious nodes, thus verifying the effectiveness of the improved algorithm.