Sinkhole Attack Defense Strategy Integrating SPA and Jaya Algorithms in Wireless Sensor Networks Authors: Zhijun Teng, Mingzhe Li, Libo Yu, Jinliang Gu, Meng Li Published: 2023 ABSTRACT A sinkhole attack is characterized by low difficulty to launch, high destructive power, and difficulty to detect and defend. It is a common attack mode for wireless sensor networks. This paper proposes a sinkhole attack detection and defense strategy integrating SPA and Jaya algorithms in wireless sensor networks (WSNs). Then, combined with the SPA trust model, the trust values of suspicious nodes were calculated, and the attack nodes were detected. The Jaya algorithm was adopted to avoid the attacked area so that nodes can find the route to communicate with the real Sink, and attack nodes are isolated in the network to improve the capabilities of network directional defense. The simulation results show that the improved detection algorithm can effectively detect malicious nodes in the network, and the defense strategy implemented in the attacked area can improve the packet delivery rate, reduce network delay and energy consumption, and improve the security and reliability of wireless sensor networks. 1. Introduction A wireless sensor network (WSN) is a network composed of many sensing nodes [1]. Its nodes have communication and computing capabilities and can cooperate in real-time monitoring, sensing, collecting information about various environments or monitoring objects in the network distribution area, and processing this information to obtain detailed and accurate information, which can be transmitted to users who need this information. It can be widely used in national defense and military affairs, national security, environmental monitoring, traffic management, health care, manufacturing, anti-terrorism, disaster relief, and other fields [2]. However, due to limited sensor node resources and often being deployed in unsupervised areas, it is vulnerable to various forms of attacks [3,4,5,6]. A sinkhole attack (Sinkhole) provides a bridge to a wide range of internal attacks, attracting almost all the surrounding data streams to pass through the node and performing malicious operations on the received data, which is highly destructive [7,8]. As a result, network security is one of the most challenging issues in WSNs. The literature [9] proposed a detection algorithm DFFR based on data traffic, which used data mining techniques to analyze the packet traffic and forwarding rate in the network to detect sinkhole attacks, taking advantage of the significantly larger data traffic within the vortex and the lower packet forwarding rate of the malicious nodes. The literature [10] proposed a PRDSA scheme for defending against sinkhole attacks based on probing routes, which combined the routing mechanisms of far-Sink reverse routing, equal-hop routing, and minimum-hop routing to be able to circumvent sinkhole attacks and found a secure route to the real Sink. The literature [11] proposed a HCODESSA detection scheme for sinkhole attacks based on hop counting, where the base station received all the hop counts from neighboring nodes and sorted the hop counts in ascending order, which caused the node hop count sorting position to change after being attacked, and identified Sinkhole nodes according to the position change. Another paper [12] proposed a hybrid intrusion detection system with PC and MK-Means machine learning techniques, where data pre-processing was performed in PCS to reduce the amount of collected training data features, and the pre-processed features were sent to the MK-Means algorithm for data training and classification enhancement, capable of capturing Sinkhole and Blackhole nodes. The authors of [13] proposed the trust-based RPL secure routing protocol RF-Trust, which used RF algorithms to identify the trustworthiness of nodes in this model and subjective logic to avoid biased or incorrect recommendations. Trust metrics such as the delivery ratio, delay, energy consumption, and honesty were used to detect sinkhole attacks in IoT networks. Other authors [14] proposed a lightweight and secure approach based on a threshold-sensitive high-performance sensor network protocol and watermarking techniques, using watermarking to protect sensed data during transmission, homomorphic encryption processing for internal communication, and the use of network keys for Sinkhole node detection. The authors of [15] proposed a detection method based on contaminated boundaries. The proposed scheme relied on the assumption that contaminated areas and contaminated boundaries exist and used the sequence number as the target feature to calculate the difference value between the sequence number on the contaminated boundary node and the sequence number of its neighbors to identify the malicious behavior of the Sinkhole node. Next, ref. [16] proposed RMHSD, a Sinkhole detection algorithm based on minimum hop selection random paths, which measured the frequency of each node by establishing M optimal hop routes from each node to the Sink node. Dynamic programming was used to build a database, calculate the hop difference between suspect nodes and their neighbors, and compare it with the threshold value to identify malicious nodes. In contrast, ref. [17] used a centralized geostatistical fragile survival model approach to obtain the residual energy of sampled nodes and their geostatistical data to detect suspicious areas in the network, and a distributed monitoring approach using fully trusted surveillance nodes monitoring local information was used to explore each neighborhood in the network to detect malicious behavior. Some of the existing research is not effective against sinkhole attacks due to the great danger of sinkhole attacks and the difficulty in detecting and defending against them. As a result, the following issues still require improvement:(1)In the existing research, there are several methods that can detect sinkhole attacks. However, some studies can only detect the presence of a Sinkhole in a network but cannot determine the location of the Sinkhole.(2)It is possible to bypass the scope of a sinkhole attack to reach the Sink using a multi-path forwarding approach, but using multiple routes at the same time can seriously damage the network’s lifespan. Even when multiple routes are used, it is difficult to ensure that one route will bypass the sinkhole attack.(3)When a Sinkhole does not perform any attacks on other nodes, neighboring nodes cannot observe the Sinkhole’s illegal behavior. Even if abnormal behavior is observed, warning messages from nodes within the attack range are sent to the Sinkhole, and therefore, the damage caused to the network by the sinkhole attack cannot be eliminated in time. As a result, the network still does not have access to valid warning messages.(4)A node in range of an attack cannot report to the Sink whether it is under attack and requires additional hardware or other policies in the network to report the presence of a Sinkhole in the network. This approach will result in increased network costs and reduced network performance. (1)In the existing research, there are several methods that can detect sinkhole attacks. However, some studies can only detect the presence of a Sinkhole in a network but cannot determine the location of the Sinkhole. In the existing research, there are several methods that can detect sinkhole attacks. However, some studies can only detect the presence of a Sinkhole in a network but cannot determine the location of the Sinkhole. (2)It is possible to bypass the scope of a sinkhole attack to reach the Sink using a multi-path forwarding approach, but using multiple routes at the same time can seriously damage the network’s lifespan. Even when multiple routes are used, it is difficult to ensure that one route will bypass the sinkhole attack. It is possible to bypass the scope of a sinkhole attack to reach the Sink using a multi-path forwarding approach, but using multiple routes at the same time can seriously damage the network’s lifespan. Even when multiple routes are used, it is difficult to ensure that one route will bypass the sinkhole attack. (3)When a Sinkhole does not perform any attacks on other nodes, neighboring nodes cannot observe the Sinkhole’s illegal behavior. Even if abnormal behavior is observed, warning messages from nodes within the attack range are sent to the Sinkhole, and therefore, the damage caused to the network by the sinkhole attack cannot be eliminated in time. As a result, the network still does not have access to valid warning messages. When a Sinkhole does not perform any attacks on other nodes, neighboring nodes cannot observe the Sinkhole’s illegal behavior. Even if abnormal behavior is observed, warning messages from nodes within the attack range are sent to the Sinkhole, and therefore, the damage caused to the network by the sinkhole attack cannot be eliminated in time. As a result, the network still does not have access to valid warning messages. (4)A node in range of an attack cannot report to the Sink whether it is under attack and requires additional hardware or other policies in the network to report the presence of a Sinkhole in the network. This approach will result in increased network costs and reduced network performance. A node in range of an attack cannot report to the Sink whether it is under attack and requires additional hardware or other policies in the network to report the presence of a Sinkhole in the network. This approach will result in increased network costs and reduced network performance. This paper proposes a sinkhole attack detection and defensive strategy integrating the SPA and Jaya algorithm in WSNs (SJ-SHDDS) with the innovation of using a segmented detection method. Based on the attack characteristics of sinkhole attacks, we first analyzed the number of node hops in the network and then combined the SPA trust model to calculate the trust value of suspicious nodes and identify the attacking nodes. Finally, to avoid retransmitting packets to the attacking node, the Jaya algorithm was used to avoid the attacked area, find the optimal path to communicate with the real Sink node, and isolate the attacking node in the whole network. 2. Analysis of Typical Cyber Attacks 2.1. Network Model This paper uses a typical wireless sensor network model [18] where a Sink node is deployed in the network, keeping the location information of all nodes, with unlimited energy and high transmitting power to communicate directly with the nodes. All sensor nodes in the network are randomly distributed with density ρ and are homogeneous, where r is the communication radius. ES is the initial energy. The storage capacity and the computational power are the same. Each node is assigned a unique ID and a fixed location that cannot be moved after deployment, and each node can communicate with its neighbors within the communication radius and obtain the neighbor’s ID and the number of hops to the Sink. The sensor network is of the event-monitoring type. After an event occurs, the node that detects the event will generate a packet, and the sensor node collects the information and transmits it to the Sink node via a shortest path routing algorithm. The distribution density of sensor nodes is as follows:(1)ρ=NnodeS where Nnode is the number of nodes and S is the approximate uniformly distributed area of each node. The energy consumption of the sensor nodes is modeled as follows:(2)Erl,d=Eelec×l (3)Esl,d=Eelec×l+Eamp×ld2 (4)ECl,d=2⋅Eelec×l+Eamp×ld2 where Er (l, d) and Es (l, d) are the energy consumed by the node when sending and receiving data, respectively. EC (l, d) is the total energy consumption of the node when performing data forwarding. l is the number of packet bits sent and received. d is the distance between node s and node f. Eelec is the energy per unit bit consumed by node j when transmitting data, and Eamp is the energy consumed by the power amplifier during transmission. If the initial energy of the network node is EB, the remaining energy of the node is (5)Eresidual l,d=EB−ECl,d 2.2. Sinkhole Attack Model A model of a wireless sensor network under a sinkhole attack [19] is shown in Figure 1, where SH is the malicious node and Sink is the aggregation node. Figure 1a shows the data flow in the network without any attack, and Figure 1b shows the data flow in the network with a sinkhole attack. The sinkhole attack in Figure 1b attracts a large amount of data by broadcasting a false message, creating the illusion of a channel with high quality to the base station. Nodes that receive this message are lured to send their own data to the attacking node, and the lured sensor nodes may continue to spread this false message within their own communication range, again attracting some normal nodes to send packets to the attacker, thus forming a metaphorical Sinkhole around the attacker. A malicious node can arbitrarily organize or tamper with the packets sent by the attacking area nodes, thus posing a significant threat to WSN security. 3. SJ-SHDDS Algorithms The SJ-SHDDS algorithms proposed in this paper can be divided into three phases—suspiciousness detection phase, malicious identification phase, and defense against attack phase. 3.1. Suspiciousness Detection In WSNs, routing from sensor nodes to the Sink is usually based on a hop-by-hop routing mechanism. When data need to be routed to the Sink, the sensor node chooses the neighboring node with the smallest number of hops to the Sink to forward the data. However, SH nodes usually set their hop count to the Sink to be less than their actual hop count and broadcast a false hop count to all neighboring nodes to detect anomalies based on hop count changes. Definition 1—Boundary nodes: Using Equations (6) and (7) to calculate the degree of suspiciousness between the average hop count Hopaverage and the lowest hop count Hopmin, if the Suspiciousness degree is greater than the threshold Suspiciousth, the node is defined as a boundary node—that is, the node is a neighboring node contaminated by the attacking node. (6)Hopaverage=Hop1+Hop2+…+Hopnn (7)Suspicious %=(1−HopminHopaverage)×100% where n is the number of neighboring nodes. Hopn is the hop count of the nth node. And since the hop count of Sink is 0, the suspiciousness of Sink’s neighboring nodes is 1. As shown in Figure 2, red nodes are SH nodes, grey nodes are boundary nodes, and the rest of the nodes are normal nodes. Taking node 5 as an example, the degree of suspiciousness values of the nodes are analyzed, as shown in Table 1. Definition 2—Suspicious node: There is no significant difference between the hop count from a node to a Sink and the hop count from a neighboring node to a Sink. If the neighboring node has an abnormally low hop count, the neighboring node is determined to be suspicious. Thus, the node with the lowest hop count among the neighboring nodes of the boundary node is the suspicious node. 3.2. Building a Trust Evaluation Model This phase is the malicious identification phase, in which the trust value of a suspicious node in the path is calculated using a boundary node at a fixed time interval to determine the state of the node. The trust degree between nodes is subjective and fuzzy, and the main methods of trust evaluation are hierarchical analysis [20] and fuzzy comprehensive judgment [21]. In this paper, we use set pair analysis (SPA) to use the change of the operation state of nodes to calculate the comprehensive trust value of nodes. 3.2.1. SPA SPA is a mathematical theory that deals with the interaction of certainty and uncertainty [22] and is able to analyze the effects of uncertainty elements such as randomness, non-linearity, and ambiguity, which is suitable for evaluating trust between nodes. The expression for SPA connectivity is (8)μA,B=SN+FNi+PNj=a+bi+cj where μ(A, B) is the degree of association of the set pair H(A, B). N is the total number of elements in the set, N = S + P + F. S is the number of elements in the same state (same characteristics) in both sets; F is the number of elements in the different state (different characteristics) in both sets; P is the number of elements in the opposite state (opposite characteristics) in both sets; a is the degree of similarity; b is the degree of difference; c is the degree of opposition, and a,b,c ∈ [0, 1], a + b + c = 1. i is the coefficient of the degree of difference, i ∈ [−1, 1]; j is the coefficient of the degree of opposition, taking a constant value of −1. Determining the similarity of two sets is ultimately achieved by calculating the magnitude of the degree of connectivity. When the weights of each influencing factor or evaluation indicator are considered, then the degree of connectivity μ for the weights of the same, opposing, and differential characteristics is (9)μA,B=∑k=1Sωk+∑k=S+1S+Fωki+∑k=S+F+1Nωkj where ∑k=1Nωk=1. 3.2.2. Direct Trust This paper uses the SPA method to calculate the trust value of nodes and introduces a reputation maintenance function to adaptively reduce the impact of the number of interactions between nodes in the early stage. Also, since the network nodes may be uncooperative influences brought about by non-intrusive factors—that is, abnormal behavior of the nodes due to the network’s own failures—an abnormal weakening factor is introduced to reduce the false detection rate of the network. The direct trust DTij obtained from the direct interaction behavior of the nodes is expressed as follows:(10)DTsf(t)=κasf+ΔasfG+ρ(κbsf+ΔbsfGi+κcsf+ΔcsfGj) (11)κ=θasf+bsf+csf (12)ρ=NintNdet where asf, bsf, and csf are the number of historical successful, uncertain, and failed communications between node s and node f, respectively, ∆asf, ∆bsf, and ∆csf are the number of successful, uncertain, and failed communications between nodes in ∆t time, and G is the total number of node interactions. κ is the reputation maintenance function, which maintains the impact of the current node behavior on reputation and reduces the impact of historical behavior. θ is a fixed maintenance value to set the range of the maintenance function action. ρ ∈ [0, 1] is the suspicious weakening factor. Nint denotes the number of node anomalous communications due to intrusion factors, and Ndet denotes the total number of anomalous communications in the network. 3.2.3. Indirect Trust Three evaluation factors are selected to weigh the indirect trust value of the nodes. The set of evaluation factors Q = {q1, q2, q3}, where qm (m = 1, 2, 3) denotes the data delivery rate, node residual energy, and processing delay, respectively. The corresponding weight sets w = (w1, w2, w3). wm (m = 1, 2, 3) denotes the weights of each evaluation factor qm, respectively, and the importance of each factor is calculated by referring to the three-scale method [23] to establish a judgment scale table, which yields w1 = 0.6334,w2 = 0.2605,w3 = 0.1061. The set of trust judgment indicators E = {e1, e2, e3}, em (m = 1, 2, 3) denote untrustworthy, uncertain, and high trustworthiness, respectively. The factors are normalized to the interval [0, 1] and used as input variables, respectively, and the homogeneous inverse vector matrix R of each factor can be obtained according to the affiliation function. Data-normalization process: The evaluation factor set obtains different values for each, and the data need to be normalized by the deviation, a linear transformation of the original data that maps the results to between 0 and 1. The normalization formula is (13)xn=0,x