Control Mechanism of Virus Propagation in Wireless Sensor Networks Based on Analytic Hierarchy Process

The research on virus propagation process and control method in wireless sensor networks (WSNs) is one of the essential challenges of network security. This paper proposes a virus control mechanism of degree, betweenness centrality, and k-core-based analytical hierarchy process (DBC-AHP) for WSNs. According to the topology of WSNs, the virus control mechanism uses the DBC-AHP to identify the crucial nodes of the network. It uses the way of crucial nodes’ self-disconnection to suppress the spread of the virus, to improve the network security. In this paper, the eﬀectiveness of the virus control mechanism based on the DBC-AHP is veriﬁed by comparing and analyzing the eﬀect of four diﬀerent crucial node recognition algorithms. With the research of virus control mechanisms in various network environments, it is found that the average degree of nodes, the communication radius of nodes, and the probability of virus infection can aﬀect the inhibition eﬀect of the virus control mechanism. Furthermore, the inhibition eﬀect of virus control mechanisms is studied under the condition with/without MAC mechanism.


Introduction
Wireless sensor networks (WSNs) are wireless communication networks formed by a large number of sensor nodes connected in a self-organizing manner. In general, WSNs is the subclass of computer network, using complex network communication protocols, so the WSNs face the virus threat [1]. e spatial openness [2] and topology heterogeneity [3] of WSNs make it easy for attackers to invade the networks. In addition, the limited energy of nodes makes WSNs vulnerable to resource consumption [4,5]. In addition, protocols of WSNs at different layers will also suffer from different types of attacks, for example, MAC (media access control) layer DoS attack [6], routing attack [7], and so on. erefore, with the development of the application of WSNs, the network safety problem against virus propagation has increased prominently. e virus propagation model in complex networks can describe the process of the virus spreading in computer networks or wireless networks [8,9]. In the process of virus propagation, some nodes can accelerate or inhibit the dynamical spreading process as influential spreaders. We call these nodes crucial nodes. With the identification and strength of crucial nodes, the virus spread speed or the scale of infected nodes can be effectively controlled [10]. Although the research on crucial node identification and virus control methods in complex networks is abundant, there are still few related researches due to the structural characteristics of WSNs.
is paper proposes a crucial node identification and virus control method in WSNs. In detail, we use the node degree, betweenness centrality, and k-core as the indicators of the importance of node, then rank the importance of nodes by the analytical hierarchy process (AHP) method in the process of virus propagation in WSNs, and finally reduce the scale of virus infection. is paper is organized as follows: in Section 2, we study the relative works of the virus propagation process and the virus control mechanism in WSNs. en, we introduce the network construction model and the SIR model of network virus propagation in our research in Section 3. Section 4 describes the detail of the crucial node identification and virus control method. e simulation results show that the algorithm is effective to suppress the infection scale of the virus in Section 5. In Section 6, we conclude.

Related Works
To explore the virus propagation dynamics in WSNs, many researchers use the virus propagation principle of complex networks theory in WSNs. Upadhyay and Kumari [11] develop an electronic popular SITR model to analyze the attack behavior of worms in WSNs with cytoid type functional response. Considering channel interference and dynamic linking, Liu et al. [12] study the influence of mobility on the spread of malignant software in WSNs in extended mode and communication mode. Some researchers use classical methods such as the principle of percolation to quantitatively analyze the virus propagation process in WSNs [13]. Liu et al. [14] considered the low power consumption characteristics of WSNs. ey introduced a low-energy state to the traditional SIR model and then described the virus propagation and mutation process in the rechargeable WSNs. In our former work [15], we proposed an SIR model considered with media access control (MAC) mechanism and found out that MAC with listen/sleep duty cycle can inhibit the scale of virus propagation. Shakya et al. [16] used spatial correlation to improve the SIR model in WSNs and study the influence of basic reproduction number, spatial correlation, and node density on the speed of virus propagation. Nwokoye et al. [17] established a multistate virus propagation model, adding a variety of intermediate states between the susceptible state and the infectious state. In summary, the SIR model can describe the virus propagation process in WSNs, but it is also necessary to improve the SIR model for the characteristics of low power consumption, the openness of wireless channels, and self-organization in WSNs [18]. e immunization control of virus propagation is one of the hotspots in studying virus dynamics. e existing WSN virus immunization control mechanisms can be divided into network-structure-and machine-learning-based control methods. And the network-structure-based control methods can be further subdivided into uniform control, acquaintance control, and target control methods. Each immunization control mechanism has its advantages and disadvantages.
e uniform control method randomly [19][20][21] selects a certain proportion of nodes as immune nodes in the network. is mechanism is relatively simple to apply, but the accuracy is not high, the immune cost is high, the virus suppression effect is not apparent, and the virus spread cannot be accurately and quickly suppressed due to the strong randomness. e acquaintance control method [22,23] is an improved random control mechanism. e mechanism first selects a certain proportion of nodes. It then randomly selects a node from the neighbor nodes of each selected node for control. Compared with the random control mechanism, the accuracy of the acquaintance control mechanism has been improved; the virus suppression effect has also been enhanced; and it is suitable for large-scale network virus defense, but the acquaintance control mechanism is unstable. e target control method is a relatively complete mechanism among these three immunization control mechanisms [24,25]. Xia et al. [26] take the clustering attribute as a critical feature of nodes, find out the crucial nodes, and strengthen their protection. Zhang et al. [27] provide a LeaderRank algorithm to find out the crucial spreaders of the virus with node degree and clustering coefficient. Li and Xiao [28] rank the importance of nodes based on the precise radius and value information. Guo et al. [29] identify the crucial nodes with the indicator of entropy. e core idea of target control is to identify crucial nodes based on network structure information, and then strengthen the immunity of these nodes. As long as a few nodes are immunized, the spread of the virus can be quickly suppressed. erefore, this mechanism has strong performance and high accuracy.
Machine learning is a type of essential method to realize intrusion detection and security [30]. Machine learning technology can predict the dynamic behavior of networks according to develop a model for completing specific security tasks. Some researchers have applied machine learning technology to identify the crucial spreaders in virus propagation. Rathore and Jha [31] use bio-inspired machine learning technology to distinguish between fraudulent nodes and good nodes in the system. Some researchers identify the crucial nodes with graph convolutional networks (GCNs) [32,33]. ough machine learning technology shows an excellent application effect on security situation assessment, the identification of crucial nodes is still mainly based on network structure. e reason is that the crucial node identification method based on network structure has strong interpretability and better generalization performance for all kinds of networks [34].

Network Construction and Virus
Spreading Model

Network Construction Model.
e wireless sensor node is limited by energy and a terrible environment, making charging and checking the sensor node difficult. erefore, it is vital that prolong the sensor node's life [35]. Besides, WSNs are composed of a free-networking mode, which causes topological randomness significantly. erefore, we have proposed a random network topology generation model based on the Waxman algorithm in our former work [15]. We deploy N nodes randomly in an area with a size of S × S and then link two arbitrary nodes with p e . e probability p e of the existing a link between two nodes in a WSN is where r c is the node communication radius, l(u, v) is the distance between two nodes u and v, L is the longest distance between arbitrary pair of nodes, β is the adjustment parameters of average node degree, and α can adjust the ratio of long links number to short links number.

Virus Propagation
Model. e model of virus propagation in WSNs is based on the classic SIR virus propagation model, and this model is further constructed by comprehensively considering the environment and the propagation characteristics of the virus itself [36,37]. We proposed an improved SIR propagation model according to the effect of the link-layer listening/sleeping mechanism and limited energy in WSNs. Furthermore, we explore the effect of duty ratio in the WSNs link-layer listening/sleeping mechanism and the interaction of data translation and virus propagation in WSNs.
Each node in WSNs has three different states, namely susceptible state (S), infectious state (I), and removed state (R). A node in a susceptible state can be infected and turns to be infectious state. And then, the infected node turns into be removed state. Every node can only be in one of three states at each moment. Only the R node became invalid, which means it cannot transfer the data or propagate the virus or be infected again. Let S(t) denote the number of susceptible nodes at time t, I(t) denote the number of infectious nodes at time t, and R(t) denote the number of removed nodes at time t. At every moment the equation N � S(t) + I(t) + R(t) is always satisfied. All node states in the networks are S when the topology of the networks is generated. At the beginning of the virus propagation, set an arbitrary node as I state. en, this node starts propagating virus outward. e proportion of nodes in each state of the initial networks is Virus propagation or normal data transmission between any nodes in WSNs is subject to a link-layer mechanism. Nodes need to check the transmission channel status before data transmission or virus propagation. Nodes can transfer the data or virus only if the transmission channel is idle. e link layer in WSNs uses a listening and sleeping cycle execution mechanism to save energy. Nodes will close the listening function when it goes to sleep; simultaneously, they cannot receive or transfer data. We denote the times of listening/sleeping duty ratio as τ.
According to the SIR model, every I-state node infects the S-state neighbours in communication range r c with probability η. Subsequently, every I-state node transfers to the R-state node, which cannot normally work with probability c. en we can get the infection efficiency as η/c. Without loss of generality, we can set c � 1.
e three-state transition equation at time t in networks is given by Let A � τc 1 − c 2 /δαβπr 2 c /X 2 and ρ � c/η, and α, c 1 , and c 2 are adjustment constant. We also can combine (2) that can be viewed as .
At the beginning of virus spreading, the initial proportion of the S-state node is S 0 , and the initial proportion of the R-state node is 0. We also can get the following equations from equations (3):

Crucial Node Identification in Virus Propagation
4.1. Degree, Betweenness Centrality, and k-Core. In the complex network, node important evaluation indicators based on topological structure are node degree, betweenness centrality [38], k-core decomposition [39], and so on. e degree of a node is the number of connections it has to other nodes. In WSNs, the node degree k indicates the number of direct communication relations between a node and its k neighbors.
Betweenness centrality measures the centrality in a network based on the shortest paths. Betweenness centrality of node i in network is defined as where l w,v is the number of shortest paths between an arbitrary pair of nodes w and v and l i w,v is the number of shortest paths between nodes w and v and pass through node i. erefore, betweenness centrality is a parameter that measures the importance of a node according to the amount of information passing through it. e higher the betweenness centrality of the node in the network, the more the importance of this node as a bridge. Betweenness centrality is the characterization of nodes in the global scope of the entire network. e k-core means the largest subgraph where nodes in the network have at least k interconnections [40]. We can get the k-core of each node starting with k � 1 as follows: Step 1. Remove all nodes with degrees less than k in the network and their edges.
Step 2. If some of the rest nodes remain with less than degree k, then repeat step 1; otherwise go to step 3.
Step 3. If there are remaining nodes in the rest of the network, let k � k + 1 and go to step 1. Or the decomposition is completed if there is no node left. Figure 1 is an example of k-core decomposition. e k-core reflects the depth of the network, which is a mediumgranularity scale parameter between local scale degree and global scale betweenness centrality to describe network characteristics.

Degree, k-Core, and Betweenness Centrality Based Analytical Hierarchy Process.
e degree, betweenness centrality, and k-core can describe the importance of nodes on local, medium, and global scales. erefore, we adopt a degree, betweenness centrality, and k-core based analytical hierarchy process (DBC-AHP) to rank the importance of nodes in the process of virus propagation in WSNs. en we can locate the crucial node according to the rank list.
e DBC-AHP is divided into three layers. e highest layer is the target layer, which indicates the crucial nodes in the network. e second layer is the criterion layer, including node degree, k-core, and betweenness centrality of a node. e bottom layer is the object layer, corresponding to each node in the networks. Figure 2 illustrates the diagram of DBC-AHP.
In the analytical hierarchy process (AHP) [41], the relative importance comparison scales of each pair of criteria are shown in Table 1 [42]. In complex networks, the relative importance of node degree, k-core evaluation, and betweenness centrality indicators are as follows: compared with the node degree index, the betweenness centrality is the most important criterion, and k-core is slightly important [43][44][45]. In the criterion layer, we denote the three criteria of degree, k-core, and betweenness centrality as c 1 , c 2 , and c 3 , respectively, so that indicators set is C � c 1 , c 2 , c 3 . en, we can structure a 3 × 3 pairwise comparison matrix as We normalize the columns of matrix A as If there are N nodes in the WSN, the set of nodes in the object layer can be denoted as A � a 1 , a 2 , . . . , a N . erefore, all the pairs of the j-th criterion c j and the i-th node a i composed of a judgment matrix, which is denoted as X � a 1 s 1 a 1 s 2 a 1 s 3 a 2 s 1 a 2 s 2 a 2 s 3 · · · · · · · · · a N s 1 a N s 2 a N s 3 Each a i (s j ) can be normalized as and then get the comprehensive importance of each node under these three parameters according to the weight of each index as judgment matrix R � (r ij ) N×3 . After that, get the rank of the importance of each node in descending order according to the comprehensive. Finally, find the crucial nodes according to this rank list.

Time Complexity of DBC-AHP.
e DBC-AHP can be divided into two steps: the first step is to calculate the values of degree, k-core, and betweenness centrality for each node. en the second step is to sort the node importance according to the AHP.
For the first step, we analyze the time complexity of degree, k-core, and betweenness centrality of nodes. e calculation of node degree is straightforward, and its time complexity is related to the number of nodes n, that is, the complexity is O(log(N)) [46]. e k-core has a low computational complexity with O(M) [46], where M stands for the links in the network. According to a fast method of calculating the betweenness centrality, the complexity of the unweighted graph is O(MN) [47]. In the first step, it is obvious that the stage with the highest time complexity is the calculating of betweenness centrality. For a network of average degree 〈k〉, the number of edges is M � 〈k〉M/2. erefore, the time complexity of the first step is determined by betweenness centrality with O(N 2 ).
In the second step, the time complexity of AHP is O(min NC 2 , N 2 C) [48], where M stands for the number of nodes in the object layer and C stands for the number of criteria. In our application, the criteria is a constant C � 3, which refers to degree, k-core, and betweenness centrality. erefore, the time complexity of AHP in our application is O (N).
Finally, considering the time complexity of the first and second steps, it can be found that the calculation of betweenness centrality has the highest time complexity. erefore, the time complexity of DBC-AHP is O(N 2 ).

Comparison of Four Virus Control Mechanisms in WSNs.
We verify the efficiency of DBC-AHP by comparing virus propagation processes with/without various control mechanisms. Referring to our previous work on the research of virus propagation process in WSNs [15], assuming N � 1000 nodes are randomly distributed in a 100 × 100 area, α � 0.87, r c � 7, the listening/sleeping duty ratio of link-layer is τ � 0.6, and the infection probability η � 0.6 in this network topology. In our former work, η � 0.6 is the threshold for full virus outbreak in our network structure model, which means the virus cannot infect the entire network when η < 0.6 and only can infect the whole network when η ≤ 0.6. e simulation was carried out in MATLAB with the graph theory framework MatlabBGL. We add four virus control mechanisms to strengthen the immune ability of nodes in WSNs. From the perspective of a complex network, the immunity of a node is equivalent to the deletion of the node or the deletion of the edge of this node [49]. We contrastively analyze the effects of four virus control mechanisms based on node degree, betweenness  If i-th criterion and j-th criterion are equally important 3 If i-th criterion is slightly more important than j-th criterion 5 If i-th criterion is more important than j-th criterion 7 If i-th criterion is more important than j-th criterion 9 If i-th criterion is perfectly more important than j-th criterion 2, 4, 6, 8 Scale value of intermediate state a ij � 1/a ji e importance of index i to index j is equal to the reciprocal of the importance of index j to index i Security and Communication Networks centrality, k-core, and DBC-AHP separately for crucial node immunization. Taking the DBC-AHP index as an example, we rank the nodes in descending order and immunize them in proportion from high to low. Moreover, we also consider the listening/sleeping mechanism in MAC might affect the virus control process. e virus control mechanism comparison process is as follows: at the beginning, we add four types of virus control mechanisms in the virus propagation in WSNs. en, we analyze the effect of four types of virus control mechanisms with the same node proportion by comparing the proportion of the R-state node after the virus propagation is over and the network is stable. e simulation results are illustrated in Figures 3 and 4. e virus control mechanism aims to restrain the virus propagation and decrease the number of I-state node. e less of the infectious node means a better inhibitory effect of the virus; meanwhile, the curve is lower. We realize the four virus control mechanisms all can protect the node and improve the antiviral property of the network from Figures 3 and 4. However, the inhibitory effects of the four different virus control mechanisms are disparate. From the simulation result, the inhibitory effect can be divided into two categories. One group is the virus control mechanisms based on the node degree and k-core decomposition; the other group is based on the betweenness centrality and the DBC-AHP algorithm. e inhibitory effects of the former group are better than those of the latter group. is phenomenon indicates that global information is essential to inhibit the spread of the virus. However, local information can also take some effects supplementarily. As represented in Figure 4, the scales of virus propagation reduce with the listening/sleeping mechanism of the link layer. e inhibitory effect based on the betweenness centrality mechanism is slightly weak from that of the DBC-AHP mechanism. However, the effects of both are better than the other two methods. Whether with or without the listening/sleeping mechanism, the inhibitory effect based on the DBC-AHP algorithm exceeds the other three mechanisms.
According to the phenomena shown in Figures 3 and 4, the DBC-AHP algorithm has the best inhibition effect on virus propagation. erefore, in the remaining part, we will discuss the influence of other factors on the virus propagation inhibition effects with the DBC-AHP algorithm.

Virus Propagation with the Control Mechanism of DBC-AHP.
In order to understand the obstruction of virus control mechanism DBC-AHP to virus propagation comprehensively, we explore the dynamic processes with the changes of 〈k〉, r c , η, and the listening/sleeping mechanism of the link layer. Following is the default setting of network and virus propagation models: there are N � 1000 nodes distributed randomly in 100 × 100 area with α � 0.87 and β � 0.7.

Average
Node Degree 〈k〉. We observed the virus propagation processes with various 〈k〉 � 7, 10, 13 and with or without DBC-AHP. Furthermore, we add the listening/ sleeping mechanism of the link layer with τ � 0.6 for comparison.
e results of the simulation are shown in Figures 5 and 6.
As shown in Figures 5 and 6, the DBC-AHP can defend the virus effectively, especially in the network with listening/ sleeping in MAC. Furthermore, the inhibition effect of DBC-AHP is inversely proportional to the average node degree 〈k〉. e smaller 〈k〉 is, the less proportion of removed node R becomes, and the inhibition of the mechanism gets more obvious.

e Communication Radius of Nodes r c .
e communication radius r c of nodes is one of the influencing factors in virus propagation. We set r c � 6, 7, 8 with or without DBC-AHP. Furthermore, we add the listening/ sleeping mechanism of the link layer with τ � 0.6 for comparison. e results of the simulation are shown in Figures 7 and 8.
We found that DBC-AHP can inhibit the virus propagation process with various r c . We observed that the less the communication radius r c is, the less the number of infectious nodes becomes, and the inhibition of the mechanism gets stronger. Furthermore, the inhibitions of virus propagation are stronger with the listening/sleeping in MAC. erefore, the DBC-AHP will be more effective in WSNs closer to the actual situation.

e Probability of Virus Infection η.
e probability of virus infection η reflects the ability of the virus. Different values of η refer to different kinds of the virus. In this part, we verify the inhibition effect of DBC-AHP on viruses with different infection probabilities. We set η � 0.4, 0.6, 08 with or without DBC-AHP. Furthermore, we add the listening/sleeping mechanism of the link layer with τ � 0.6 for comparison. e results of the simulation are shown in Figures 9 and 10.

Security and Communication Networks 7
As shown in Figures 9 and 10, DBC-AHP limits the speed of virus infection and the scale of infectious nodes with or without the listening/sleeping mechanism, which is already verified. e fewer the η is, the less the number of infectious nodes become, and the inhibition of DBC-AHP is much better. Figures 9 and 10 show the inhibition effects of DBC-AHP with and without listening/sleeping mechanism. e results show that using DBC-AHP with listening/ sleeping mechanism can effectively block the spread of virus.
is indicates that the collective effect of DBC-AHP and the listening/sleeping mechanism in MAC would make the network safer.

Appling DBC-AHP in EDGF
Networks. Furthermore, we verify the effectiveness of DBC-AHP in the network generated with the empirical data set generation framework (EDGF) without MAC [50]. e parameters of the network are grid-based deployment with node number N � 160, seed value X[0] � 43, constants a � 3.359886 and c � 1.902161, transmission range TR � 15, and deployment area 100 × 100. Figure 11 shows infection scale under different infection probability with immune rate values of 5%, 10%, 25%, and 50% in EDGF networks. e immune strategy protects the nodes with large values of average degree, k-core, betweenness centrality, and DBC-AHP. In Figures 11(a)-11(d), the red line is the baseline without immune nodes. For example, in Figure 11(a), 95% of nodes are not protected by the virus control mechanism of immune, so the scale of virus propagation will not exceed 95% of nodes. In subfigures 11(a)-11(d), we found that when the proportion of immune nodes increases, the scale of virus infection will continue to decrease with the same value of infection probability η. Under various immune proportions, the protection results of DBC-AHP were similar to those of betweenness centrality, and the results were the best. e control mechanism of average degree has the worst effect. Under the DBC-AHP and betweenness centrality control mechanisms in Figure 11(b), even if η � 1, the virus still cannot infect all nodes in the network. e reason is that after those nodes based on DBC-AHP and betweenness centrality are protected, the network connectivity for virus propagation has been split. erefore, there is

Conclusion
is paper proposes a virus control mechanism for DBC-AHP in WSNs. In DBC-AHP, we combine the node degree, betweenness centrality, and k-core comprehensively with AHP and get the rank of the node's importance. After implementing immune protection for crucial nodes, we finally reduce the speed and the scale of virus infection. DBC-AHP shows a better effect than a single indicator method in the context of virus defense in WSNs.
In future work, we can carry out some extended research on the virus control mechanism of WSNs. e DBC-AHP is highly dependent on the global index of betweenness centrality, and the time complexity is high. erefore, we can find an alternative to betweenness centrality, such as the technology based on information entropy and so on. ere are also some other virus control mechanisms in practical applications, such as routingbased mechanisms. Future research can start from the control mechanism and explore the inhibitory effects of other safety measures and other immune mechanisms on the spread of the virus.

Data Availability
e simulation data and results used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that they have no conflicts of interest.