An Active Defense Model with Low Power Consumption and Deviation for Wireless Sensor Networks Utilizing Evolutionary Game Theory

: In wireless sensors networks, nodes may be easily captured and act non-cooperatively, for example by not defending forwarding packets in response to their own limited resources. If most of these nodes are obtained by attackers, and an attack by an internal malicious node occurs, the entire network will be paralyzed and not be able to provide normal service. Low power consumption indicates that the rational sensor nodes tend to be very close to the mean; high power consumption indicates that the rational sensor nodes are spread out over a large range of values. This paper offers an active defense model for wireless sensor networks based on evolutionary game theory. We use evolutionary game theory to analyze the reliability and stability of a wireless sensor network with malicious nodes. Adding a defense model into the strategy space of the rational nodes and establishing a preventive mechanism forces the malicious node to abandon the attack and even switch to cooperative strategies. Thus, this paper argues that the stability and reliability of wireless sensor networks can be improved. Numerical experiments were conducted to evaluate the proposed defense model, and these results veriﬁed our conclusions based on a theoretical analysis that showed that, compared with the existing algorithms, our approach has lower energy consumption, lower deviation, and a higher probability to quickly switch each node to cooperative strategies.


Introduction
A wireless sensor network (WSN) is a network constructed through the self-organization of a large number of sensor nodes.When considering today's network security problems, a significant amount of research is being conducted on the security of wireless sensor networks from different perspectives, with the goal of ensuring that these networks are operating effectively.In terms of security issues, the problems encountered by WSNs and traditional wireless networks can differ greatly based on the characteristics of the individual network.
Since the resources for sensor nodes are limited, processing power, storage space, energy, and other factors can prevent the direct application of effective security protocols and algorithms to wireless sensor networks and result in greater security risks.Qiu et al. [1] proposed an active defense model for WSNs in which the sensor nodes can be dynamic and active, so as to adjust their defensive strategies, thereby achieving an effective defense against different approaches used by attackers.
Chen et al. [2] proposed a mechanism that emphasizes adjustments in the node strategies forwardly and passively to maximize their fitness, thereby forcing the population in the wireless sensor network to ultimately combine into a cooperative state.Hu et al. [3] proposed an adaptive active defense mechanism with low power consumption.This scheme configured some nodes as Energies 2018, 11, 1281 2 of 16 monitoring nodes to identify attacks, and when an attacker is identified, the defense system is activated and repairs the damaged node.
Elazouzi et al. [4] introduced a general framework for competitive forwarding in delay-tolerant networks (DTNs) under specific energy constraints and message lifetime requirements in the context of DTNs.In their proposed framework, a basic two-hop relay was used to route packets, and a wireless link becomes available whenever two nodes meet and focus on the probability of delivering a message.
Wu et al. [5] introduced a two-hop routing algorithm and an asymmetric multi-community evolutionary game framework.Their model found each community's unique evolutionary stable strategy (ESS)and provided its existence conditions.Wu et al. [6] proposed an incentive mechanism based on game theory and social networks to determine the availability of packets.Zuo et al. [7] introduced an evolutionary, game-based routing model to eliminate selfish routing behaviors and improve the routing efficiency in peer-to-peer (P2P) networks.The routing behavior of a node was considered a non-cooperative routing game wherein the selfish player routes traffic through a congested and sensitive network.The dynamic behavior of such nodes was studied using the generalized simulation dynamics method.
Feng et al. [8] studied the cooperative mechanism of prefabricated producers based on evolutionary game theory.Their model analyzed the behavioral evolution trends of both parties using evolutionary game theory.Esposito et al. [9] used game theory to promote truth-telling between service providers in smart cloud storage service selection.The dynamic behavior of these nodes was studied using the generalized imitative dynamics approach.
Chen et al. [10] proposed a proactive defense model for wireless sensor networks, in which the node's limited ability to learn the evolution of rationality from different attack strategies of the attacker was emphasized, and the node could dynamically adjust its strategy to achieve the most effective defense.Dynamic evolution means that nodes can be active and dynamic to adjust their defensive strategies to achieve effective defense, according to the attacker's different policies.Bendjima and Feham [11] proposed the use of an intelligent WSN communication architecture based on a multi-agent system (MAS) to ensure optimal data collection.To reduce the size of the MAS, nodes in the network sectors were grouped in such way that, for each MA, an optimal itinerary was established using the least amount of energy with efficient data aggregation within the least amount of time.
Alskaif et al. [12] conducted a survey of game theory to balance wireless sensor networks and provide the required service, while achieving a trade-off between providing the required lifetime and maximizing the lifetime of a network.Guo et al. [13] recommended against various routing attacks on DTNs; the network can reach evolutionary stable strategy (ESS) under special conditions after meeting the evolutionary requirements in the context of DTNs.Evolutionary game theory-based defense schemes can achieve an average delivery ratio, low average transmission delay, and low network overhead in various routing attack scenarios.The initial parameters affect the convergence speed and the final ESS, but the initial ratio of the nodes choosing different strategies only affects the game process.
Li et al. [14] proposed a novel topology link control technique and mitigation attacks in real-time environments.In the proposed approach, a prediction model was constructed using copula functions to predict the peak of a resource through another resource.Al-Jaoufi et al. [15] presented a new model for the selfish node incentive mechanism with a forward game node for wireless sensor networks, and used the incentive mechanism to successfully forward packets while resisting any slight variations.
Therefore, the present incentive model has the following disadvantages [12][13][14]: (1) with y being the current mechanism, determining the robustness and stability of these mechanisms is impossible due to the lack of analysis when applying strict mathematical theories; (2) the current mechanism enhances the performance of the system, so it can achieve its best performance, but it cannot guarantee that each node can or will achieve the best benefit, so the nodes are still likely to exhibit selfish behaviors; (3) the current model forwarded packets well while resisting any slight variations.However, the disadvantage is that this model used higher power; it was too late to initiate defensive measures due to the limited ability of power consumption for the defense to compute the nodes [15].
For these reasons, this paper proposes an active defense model for wireless sensor networks to analyze the reliability and stability of a wireless sensor network with malicious nodes.Our model uses game theory to construct prevention strategies for wireless sensor networks, and allows the malicious node to abandon the attack and even cooperate to effectively improve the reliability and stability of those networks.

Development and Key Knowledge of Game Theory
In traditional game theory, the participants are often assumed to be completely rational and make decisions based on complete and full information.However, in real network life, participants' full rationality and the conditions wherein complete information is available are difficult to achieve.In any cooperative competition of enterprises, differences exist between participants, and incomplete information can be produced by the obvious complexities of the network environment, the game problem, and the limited rationality of the participants.
Game theory specializes in game strategies; it is also known as the "theory of games".Game theory is a discipline based on mathematics that deals with how a participant will plan to obtain maximum benefit in a game.Each standard game includes nine basic elements: participants, rules of the game, game behavior, information, game strategies, sequence of the game, earnings of the game, the results of the game, and equilibrium.Nash equilibrium is a very important concept in any game algorithm.It is a set of policies for a group of participant policies, and any participant who individually changes that strategy will be compromised.Nash equilibrium, therefore, corresponds to having a stable game result.Once the result of this game is attained, no participant has the motivation to change their own strategy [15].

Active Defense Model Based on Evolutionary Game Theory
The active defense model is based on procedural behavior, independent analysis, and the judgment of the real-time protection of a WSN.The model simultaneously provides accurate and automatic identification of attackers and monitoring of program behavior, as well as automatic extraction of feature values, visual display monitoring information, and other characteristics.Active defense is both a type of technology and a technical system composed of a variety of technologies that provide an active defense function for a wireless sensor network by using the rational nodes of these technologies.Active defense organically combines the rational nodes, provides coordination, and allows complete security of the wireless sensor network.
In statistics and probability theory, deviation shows how much variation or dispersion exists from the average or expected value.A low deviation indicates that the data points tend to be very close to the mean; high deviation indicates that the data points are spread out over a large range of values [16].Thus, to determine the results, we considered three kinds of defensive strategies in the simulations: (1) rational nodes without choosing defense; (2) half of the rational nodes choosing defense; and (3) all of rational nodes choosing defense.The architecture of the model systems is shown in Figures 1-3.Figures 1-3 show that our goal considered improving security while reducing the deviations for wireless sensor networks.Figure 1 shows that when the rational nodes do not choose defense, the attacker very easily captured nodes and acted non-cooperatively, and capturing the rational nodes resulted in higher power consumption.Figure 2 shows that when the half of the rational nodes choose defense, then the attacker does not easily capture the nodes and acts non-cooperatively, and taking the rational nodes takes more time with a lower power consumption.Figure 3 shows that when all   Figures 1-3 show that our goal considered improving security while reducing the deviations for wireless sensor networks.Figure 1 shows that when the rational nodes do not choose defense, the attacker very easily captured nodes and acted non-cooperatively, and capturing the rational nodes resulted in higher power consumption.Figure 2 shows that when the half of the rational nodes choose defense, then the attacker does not easily capture the nodes and acts non-cooperatively, and taking the rational nodes takes more time with a lower power consumption.Figure 3 shows that when all   Figures 1-3 show that our goal considered improving security while reducing the deviations for wireless sensor networks.Figure 1 shows that when the rational nodes do not choose defense, the attacker very easily captured nodes and acted non-cooperatively, and capturing the rational nodes resulted in higher power consumption.Figure 2 shows that when the half of the rational nodes choose defense, then the attacker does not easily capture the nodes and acts non-cooperatively, and taking the rational nodes takes more time with a lower power consumption.Figure 3 shows that when all Figures 1-3 show that our goal considered improving security while reducing the deviations for wireless sensor networks.Figure 1 shows that when the rational nodes do not choose defense, the attacker very easily captured nodes and acted non-cooperatively, and capturing the rational nodes resulted in higher power consumption.Figure 2 shows that when the half of the rational nodes choose Energies 2018, 11, 1281 5 of 16 defense, then the attacker does not easily capture the nodes and acts non-cooperatively, and taking the rational nodes takes more time with a lower power consumption.Figure 3 shows that when all rational nodes choose defense, then it is difficult for the attacker to capture nodes and act non-cooperatively, and taking the rational nodes occurs quickly with a much lower power consumption.
Before we establish the game model for the malicious behavior of nodes, we must make the following assumptions concerning a wireless sensor network: • Assumption 1: Infinite sensor network nodes are limited, and each node has a routing forwarding function.The parameters of the defender and the attacker can be defined as follows: R denotes the reward for forwarding one message, C A denotes the cost of the attacker, C D denotes the cost of the defender, D f ,hal f denotes half the rational nodes choosing defense, and D f ,all denotes all the rational nodes choosing defense.In this current effort, we assumed that the value of half the rational nodes choosing defense was 0.33, and the value of all the rational nodes choosing the defenders was 1. Normally, D f ,all > D f ,hal f .• Assumption 2: is widely used to design defensive strategies for rational sensor nodes and protocol implementation in WSNs [17].There are two kinds of nodes in the network: (1) defender nodes (rational nodes), and (2) attacker nodes (malicious nodes).The latter type refers to nodes in the network after capture with all packets having the same size as the malicious node.The node will successfully forward a packet, and the benefits are the same as those for the proceeds of the R units.
Applying the three basic elements of the game model-the participant, the strategy space, and the profit matrix-the game model for a wireless sensor network node was established as follows: 1.
Participants: According to the features of the security of a wireless sensor network, the participants in the game can be divided into two different populations: (1) a population composed of rational nodes, mainly through forwarding packets to obtain benefits (the rational nodes); and (2) a population composed of malicious nodes (denoted the malicious nodes), so that the population system is a group of strategic behaviors.These populations can gain revenue by launching attacks or by forwarding packets, with the former having a larger payoff than the latter.

2.
Strategy Space: The rational node has two kinds of cooperation strategies: (1) rational node cooperation (R c ), and (2) rational node non-cooperation (R nc ).Cooperation is the behavior of the node when it is forwarding a packet, which is the behavior of a node loss packet; then, its strategy set is recorded as S 1 = {R c , R nc }.A malicious node has three different strategies: (1)  malicious node cooperation (M c ); (2) attacker (A t ); and (3) malicious node non-cooperation (M nc ).This strategy set is recorded as Profit Matrix: According to the characteristics of wireless sensor networks, C A represents the resource (e.g., energy or bandwidth) being consumed by the malicious node to attack the behavior, and C R indicates that the node is forwarding the resource consumed by a forwarded packet, normally C R > C A .This profit matrix is divided into two kinds of nodes as shown in Table 1.
Table 1.Profit matrix for forwarding packets.

Malicious Node Cooperative
The profit matrix above shows that, after a finite number of games, both kinds of nodes in a wireless sensor network choose the non-cooperative strategy, and that strategy combination {non-cooperative, non-cooperative} becomes the Nash equilibrium solution of the finite repetition Energies 2018, 11, 1281 game.If the network is in this non-cooperative equilibrium state, the network will be paralyzed and unable to provide normal service, thus providing an unsatisfactory result.
In the current research, a new defensive strategy was added to the rational node strategy to limit the attack behavior of the malicious node.This new strategy makes the malicious node unprofitable, and the malicious node thus can no longer attack and cooperate.Furthermore, it allows the network to provide normal service and promotes the higher performance of the network.
When the rational node adds a new defensive strategy, it has three possible strategies: cooperative, non-cooperative, and defender (D f ).The strategy space, S 1 = R c , R nc , D f , as well as both sides of the game profit matrix are shown below in Table 2.
We assume here that the nodes in wireless sensor networks use rational node strategies, i.e., R c , R nc , and D f for x Rc , x Rnc , and x D f , respectively, where We assume that the malicious nodes' strategies are used, i.e., M c , M nc , and A t for y Mc , y Mnc , and, y At respectively, wherein y Mc + y Mnc + y At = 1, and it appears that y 1 + y 2 + y 3 = 1.The strategies of the rational nodes and malicious nodes are defined as follows: As the defender has three strategies gleaned from the strategy space S 1 = R c , R nc , D f , the profit matrix of the defender and attacker are defined as A and B, respectively: Replicator dynamics describe a dynamic selection process, as proposed by Taylor and Jonker [18].At time t, let p i (t) be the number of individuals who are currently programmed to the strategy i ∈ K, and let p(t) = ∑ i∈K p i (t) be the total population.Then, the associated population state can be in defined as the vector z i (t) = (z i (t), . . ., z k (t)), where each component z i (t) is the population share, i.e.,z i (t) = p i (t)/p(t).The term u(z, z) is defined as the average payoff of the population, and the term u(s i , z) is defined as the expected payoff using strategy i.The replicator dynamics in the evolutionary game can thus be expressed as: According to Equations ( 1)-( 4), the replicator dynamic equations of the blurred vision game for defenders and attackers are divided into two replicator dynamic equations, as follows: Energies 2018, 11, 1281 x i a jk y k x h (5) where h, k, j = 1, 2, 3 and a, b are the corresponding elements of the A and B matrices.Thus, the replicator dynamic equations for x 1 , x 2 , x 3 , y 1 , y 2 , y 3 are computed as: Thus, we applied the game theoretic analysis tool to produce the security of a wireless sensor network.The following theorems are provided to achieve that result.First, based on the characteristics of WSNs, the active defense model of node forwarding packets was established.Second, using evolutionary game theory to analyze the dynamics and stability of the active defense model and for the networks to achieve good collaboration, emphasis was placed on the nodes of the game through continuous learning, imitation, and trial and error to determine their strategies to find the most suitable strategy for their own interests.
Theorem 1.In wireless sensor networks that consist of N nodes with a small probability of having a population of sensor nodes, lower cost (C D ) and a mutation probability approach of zero based on the active defense strategies, the defensive strategy (D f ) is considered to be evolutionarily stable.
Proof.Based on the theorem of evolutionary stability, if strategy i is evolutionarily stable, it must meet the following two conditions: (1) a ii > a ji and (2) if a ii = a ji , then a ij > a jj for the arbitrary condition i = j.The profit matrix in Table 2 suggests that the defensive strategy requires a 22 > a 12 and a 22 > a 32 to meet the definition of an evolutionary game, so that the defensive strategy is evolutionarily stable and exhibits a strict Nash equilibrium.Theorem 2. If the deviation value is zero and the average-medium defensive strategy has the same value, and the variation probabilities and composition of sensor nodes are fewer in wireless sensor networks, the population system then converges and uses defensive strategies and the malicious node in order to cooperate.
Proof.Based on the theorem of a population system that converges, in order for the malicious node to cooperate, it must meet the following two conditions: (1) the deviation value ≤ 0 and (2) average value = medium value, so that the population system is evolutionarily stable and exhibits a strict Nash equilibrium.
Accordingly, using Theorem 2 from the previous analysis, we can obtain the following propositions: Energies 2018, 11, 1281 8 of 16 Proposition 1.When strategy R c = 0, strategy R nc = 0, and strategy D f = 0 after a period of an evolutionary game, the nodes in the wireless sensor networks eventually choose strategy M nc .At this point, the population system is unable to continue in a stable state.
Proof.Based on the proposition of the population system being in an unstable state, if the strategy without defense is (D f = 0), the nodes in the wireless sensor networks eventually choose strategy M nc .Thus, after the nodes choose strategy M nc , the population system is unable to continue in the stable state that is shown in Figure 4. Proposition 2. When strategy R c = 0, strategy R nc = 0, and strategy D f , hal f = 0, and half of the rational nodes in the wireless sensor networks choosing the defensive strategy are in the system after a period of time for evolution, the nodes in the wireless sensor networks eventually choose strategy M c .At this point, the population system is able to continue in a stable state.
Proof.Based on the proposition of the population system being in a stable state, if the strategy is D f , hal f = 0 for half the rational nodes when choosing defense, the nodes in the wireless sensor networks eventually choose strategy M c .Thus, after the nodes choose strategy M c , the population system is able to continue in a stable state, as shown in Figure 5. Proposition 3. When strategy R c = 0, strategy R nc = 0, and strategy D f ,all = 0, and all the rational nodes in the wireless sensor networks choosing a defensive strategy are in the system after a period of time for evolution, then the nodes in the wireless sensor networks eventually choose strategy M c .At this point, the population system is in a stable state.
Proof.Based on the proposition that the population system is in a stable state, if the strategy D f ,all = 0 when all the rational nodes choose defense, the nodes in the wireless sensor networks eventually choose strategy M c , thus after the nodes choose strategy M c , the population system is in a stable state, as shown in Figure 8. Proposition 4. When strategy R c = 0, strategy R nc = 0, and strategy D f ,all = 0, and all the rational nodes that appear in the wireless sensor networks choose the defensive strategy, in the system, after a period of time for evolution, the nodes in the wireless sensor networks eventually choose strategies M c and R c .At this point, the population system converges and adopts a stable state.
Proof.Based on the proposition that the population system converges and adopts a stable state, if the strategy D f ,all = 0 for all rational nodes when choosing defense is adopted, along with the strategy R c = 0, the nodes in the wireless sensor networks will eventually choose strategies M c and R c .Thus, after the nodes choose strategies M c and R c , the population system is in a stable state, as shown in Figure 10.

Modeling Simulation and Analysis
Modeling and simulation experiments were performed using the MATLAB mathematical tool version 2016a.The assumptions for the wireless sensor network were as follows.Due to different measurement standards for the profit and the cost of the nodes, all the participants' parameters were standardized with values in the range of [0,1].Given R = 1.0,C R = 0.4, C A = 0.3, and C D = 0.5, a mathematical model was established using Equations ( 7)-(12).

Rational Nodes Not Choosing Defense and Half the Rational Nodes Choosing Defense
The simulation results for the state of the wireless sensor population when (x, y) = (x 1 , x 2 , x 3 , y 1 , y 2 , y 3 ) = (0.5, 0.5, 0, 0.33, 0.33, 0.33) and (0.33, 0.33, 0.33, 0.33, 0.33, 0.33) are shown below in Figures 4 and 5, respectively.When the rational nodes in wireless sensor networks are without defensive strategies, the simulation result in Figure 4 indicates that the nodes of the wireless sensor network choose strategy nc M after an evolutionary game is performed for a period of time.In Figure 5, to determine the simulation results, we believed that wide area wireless sensor networks would appear and the range would increase up to 600, showing that, in this part of the simulation, when half the rational nodes in the wireless sensor networks choose defensive strategies in the system after a period of time for evolution, the nodes of the wireless sensor network will choose strategy c M in this state.As long as little variation occurs in the node, the population system will choose strategy c R .At this point, the population system continues in a stable state.
The results of the statistical analysis of all the data in Figures 4 and 5 are provided below in Tables 3 and 4, respectively.
, and nc M .When the rational nodes in wireless sensor networks are without defensive strategies, the simulation result in Figure 4 indicates that the nodes of the wireless sensor network choose strategy M nc after an evolutionary game is performed for a period of time.In Figure 5, to determine the simulation results, we believed that wide area wireless sensor networks would appear and the range would increase up to 600, showing that, in this part of the simulation, when half the rational nodes in the wireless sensor networks choose defensive strategies in the system after a period of time for evolution, the nodes of the wireless sensor network will choose strategy M c in this state.As long as little variation occurs in the node, the population system will choose strategy R c .At this point, the population system continues in a stable state.The results of the statistical analysis of all the data in Figures 4 and 5 are provided below in Tables 3 and 4, respectively.From the statistical analyses shown in Tables 3 and 4, we used these experiments in 0/300/116.3/95.03/0/94.09/300rows and 0/600/294.7/294.5/0/177.1/600rows to obtain more meaningful data.These data are presented below in Figures 6 and 7, respectively.
From the results in Figure 6, when all the values of the nodes' defender strategies D f were zero, all nodes of the wireless sensors network chose strategy M nc .In Figure 7, the range increased up to 600, and D f was able to resist small variations; the nodes of the wireless sensors network then chose strategy M c .The average medium values in Figure 6 are 0 and 0.4, whereas they are 0.03 and 0 in Figure 7.The results of the average medium values in each case were not smooth and steady.These conclusions are verified in Figures 4 and 5, respectively.Propositions 1 and 2 were also verified.From the statistical analyses shown in Tables 3 and 4, we used these experiments in 0/300/116.3/95.03/0/94.09/300rows and 0/600/294.7/294.5/0/177.1/600rows to obtain more meaningful data.These data are presented below in Figures 6 and 7, respectively.From the results in Figure 6, when all the values of the nodes' defender strategies f D were zero, all nodes of the wireless sensors network chose strategy nc M .In Figure 7, the range increased up to 600, and f D was able to resist small variations; the nodes of the wireless sensors network then chose strategy c M .The average medium values in Figure 6 are 0 and 0.4, whereas they are 0.03 and 0 in Figure 7.The results of the average medium values in each case were not smooth and steady.These conclusions are verified in Figures 4 and 5, respectively.Propositions 1 and 2 were also verified.

All Rational Nodes Choosing Defense
For the simulation results for the state of the wireless sensor population, we considered that all the rational nodes choosing defense were divided into two kinds of defensive strategies: (1) the all rational nodes strategy, which is zero; and (2) the all rational nodes strategy, which is not zero.The results when (x, y) = (x 1 , x 2 , x 3 , y 1 , y 2 , y 3 ) = (0, 0, 1, 0.001, 0.5, 0.49) are shown in Figure 8.

All Rational Nodes Choosing Defense
For the simulation results for the state of the wireless sensor population, we considered that all the rational nodes choosing defense were divided into two kinds of defensive strategies: (1) the all rational nodes strategy, which is zero; and (2) the all rational nodes strategy, which is not zero.The results when  In Figure 8, to determine the simulation results, wide area wireless sensor networks appeared, the range increased up to 1000, and the rational nodes strategy was zero.The simulation results showed that when all the rational nodes in a wireless sensor network choose a defensive strategy in the system after a period of time for evolution, the malicious node chose the cooperative strategy.In this state, as long as little variation exists in the node, the population system will choose strategy c M , but when the medium average value of strategies Each node is not guaranteed to achieve the best benefit.Thus, the stability and reliability of the network is improved.The results of the statistical analysis of the data in Figure 8 are provided in Table 5.In Figure 8, to determine the simulation results, wide area wireless sensor networks appeared, the range increased up to 1000, and the rational nodes strategy was zero.The simulation results showed that when all the rational nodes in a wireless sensor network choose a defensive strategy in the system after a period of time for evolution, the malicious node chose the cooperative strategy.In this state, as long as little variation exists in the node, the population system will choose strategy M c , but when the medium average value of strategies M c , A t , and M nc are not at equilibrium, the model always chose strategy D f , and the defender cannot become zero for low power consumption.Each node is not guaranteed to achieve the best benefit.Thus, the stability and reliability of the network is improved.The results of the statistical analysis of the data in Figure 8 are provided in Table 5.  Figure 9 shows that the range increased up to 1000, and when all the values of the nodes' choosing defender strategies D f were nonzero, all the rational nodes of the wireless sensors network chose strategy M c .Also, when the deviation X = 298.5 occurred, the result of that deviation was zero in the D f nodes strategy.However, when the average medium values in the node strategy M c were 0.97 and 1, the average medium values in each case were smooth and steady, but each node did not achieve the best benefit.This conclusion is verified in Figure 8; Proposition 3 was also verified.The results when (x, y) = (x 1 , x 2 , x 3 , y 1 , y 2 , y 3 ) = (0.001, 0, 1, 0.001, 0.5, 0.49) are shown in Figure 10.
In Figure 10, to determine the simulation results, wide area wireless sensor networks appeared, the range increased up to 10,000, and the rational nodes strategy was nonzero.In the system, after allowing a period of time for evolution to elapse, the malicious node chose the cooperative strategy to maximize its interests because the rational node chose defensive measures.Thus, the malicious node can multiply inorganically, and the malicious node will always choose the cooperative strategy.The final network converges into the equilibrium state of malicious node cooperation and all the rational nodes choose defense, so the wireless sensor network can effectively avoid the attacker behavior of the malicious node.In this state, as long as little variation exists in the node, the population system will choose strategy R c .When the medium average value of strategies M c , A t , and M nc are at equilibrium, the strategy D f becomes to zero for low power consumption.The final network converged to the equilibrium state of the malicious node cooperation and rational node cooperation, The final network converges into the equilibrium state of malicious node cooperation and all the rational nodes choose defense, so the wireless sensor network can effectively avoid the attacker behavior of the malicious node.In this state, as long as little variation exists in the node, the population system will choose strategy becomes to zero for low power consumption.The final network converged to the equilibrium state of the malicious node cooperation and rational node cooperation, thus improving the stability and reliability of the network.The statistical analyses of all these data is shown in Figure 10, and the statistics are provided in Table 6.Using the statistical analyses shown in Table 6, the range increased up to 10,000.We used these experiments in the 0/10,000/4952/4951/0/2917/10,000 rows to gather more meaningful data, which are presented in Figure 11.In Figure 11, the range increased up to 10,000, and when all the values of the node defender strategy In Figure 11, the range increased up to 10,000, and when all the values of the node defender strategy D f and rational nodes strategy were nonzero, all nodes of the wireless sensors network chose strategies M c and R c .When the deviation X = 2917 in Figure 11 occurred, the result of that deviation was zero in the nodes strategy M c .The average medium values in the node strategy M c in each case were one, and in the nodes strategies A t and M nc , they were zero.The results of the average medium values in each case were both smooth and steady.This conclusion is verified in Figure 10; Proposition 4 is also verified.

Discussion
In Figure 11, when all the rational nodes chose defense, the deviation value was zero and the average medium defensive strategy had the same value, and the variation probabilities and composition of sensor nodes were fewer in the wireless sensor networks.The population system then converged and used defensive strategies against the malicious node in order to oblige it to cooperate.Compared with previous studies [12][13][14], in which the system performance could not guarantee that each node can achieve the best benefit, the node is still likely to appear to exhibit selfish behavior.Also, the system is unable to complete an accurate description of the dynamic evolution of the node strategy, preventing the determination of the robustness and stability of these mechanisms due to the lack of analysis based on strict mathematical theories.
Our research results indicated that our approach is faster and the best among all recent reports in that we added a new defensive strategy between the rational nodes of the WSN, and these rational nodes can be cooperative by then forwarding defense packets efficiently and resisting small variations.
Compared to the previous literature [19][20][21], in which game theory and dynamic programming were used to model a multiple-period, attacker-defender, resource allocation, and signaling game with incomplete information, attacks are deflected to an asset or deferred altogether with our method, or the assets are made less valuable to the attacker.As a result, we generally recommend that defensive investments be disclosed.However, disclosure cannot always be optimal in practice, because otherwise there is no role for secrecy and/or deception in defensive investments.
Our research results indicated that our approach is faster and can be optimal in practice, with lower power consumption and fewer deviations.Compared with Al-Jaoufi et al. [15], the disadvantages are outlined in Table 7 below.The average medium values in the non-cooperative nodes strategy were 0.003944 and 4.44 × 10 −58 , and nodes strategy conditional cooperative were 0.7485 and 0.7529.
The average medium values in malicious node cooperation for each case were only 1, and in the attacker nodes strategies and malicious node non-cooperation were each only zero.

Power Consumption
Higher power consumption because the model always chooses the conditional cooperative nodes strategy.
Lower power consumption, only after malicious nodes cooperation, attacker, and malicious nodes non-cooperation equilibrium state, the defender strategies are close to zero.

Deviations
When the deviation X = 294.7, the result of the deviation was small in the non-cooperative nodes, given that the deviation value was 0.031.
When the deviation X = 2917 in Figure 11 occurred, the result of that deviation was zero in the attacker nodes strategy, which is a better result given that the deviation value was 0.02.
Our analyses were the best among all recent reports, indicating that the performance of the WSNs could be enhanced due to its stability and reliability.The deviations were 0.13, 0.06, and 0.02 in rational node cooperation, malicious node cooperation, and attacker nodes, respectively, as shown in Figure 11.Thus, using our method the time requirement was much shorter with very low power consumption because the deviation was very small.

Conclusions
The microscopic behavior of malicious nodes in wireless sensor networks was studied for this paper and corresponding strategies were offered.A defense strategy based on evolutionary game theory was proposed and a model was developed.In particular, Section 4.2 shows that malicious node cooperation (M c ) can be an equilibrium strategy when the average medium values have the same value, which was only one, and the attacker nodes strategies (A t ) and malicious node non-cooperation (M nc ) values were only zero.In those cases, the final result required low power consumption.Only after malicious node cooperation (M c ), and attacker (A t ) and malicious node non-cooperation (M nc ) equilibrium states, were the defender (D f ) strategies close to zero.
The simulation results show that all the malicious nodes in the network chose to cooperate, so that the network remains in good working condition, meaning that the stability and reliability of the wireless sensor networks improved.

Figure 1 .
Figure 1.The architecture of rational nodes without choosing defense.

Figure 2 .
Figure 2. The architecture for half of the rational nodes choosing defense.

Figure 3 .
Figure 3.The architecture for all rational nodes choosing defense.

Figure 1 . 17 Figure 1 .
Figure 1.The architecture of rational nodes without choosing defense.

Figure 2 .
Figure 2. The architecture for half of the rational nodes choosing defense.

Figure 3 .
Figure 3.The architecture for all rational nodes choosing defense.

Figure 2 . 17 Figure 1 .
Figure 2. The architecture for half of the rational nodes choosing defense.

Figure 2 .
Figure 2. The architecture for half of the rational nodes choosing defense.

Figure 3 .
Figure 3.The architecture for all rational nodes choosing defense.

Figure 3 .
Figure 3.The architecture for all rational nodes choosing defense.

1 .
Rational Nodes Not Choosing Defense and Half the Rational Nodes Choosing DefenseThe simulation results for the state of the wireless sensor population when Figures4 and 5, respectively.

Figure 4 .
Figure 4.The rational nodes not choosing defense.

Figure 5 .
Figure 5. Half the rational nodes choosing defense.

Figure 6 .
Figure 6.Analyses of rational nodes without defender strategies.Figure 6. Analyses of rational nodes without defender strategies.

Figure 6 .
Figure 6.Analyses of rational nodes without defender strategies.Figure 6. Analyses of rational nodes without defender strategies.

Figure 6 .
Figure 6.Analyses of rational nodes without defender strategies.

Figure 7 .
Figure 7. Analyses half of rational nodes when choosing defender strategies.

Figure 7 .
Figure 7. Analyses half of rational nodes when choosing defender strategies.
nc M are not at equilibrium, the model always chose strategy f D , and the defender cannot become zero for low power consumption.

Figure 8 .
Figure 8.All rational nodes choosing defender strategies and R c = 0.

Figure 9 .
Figure 9. Analyses of when all rational nodes choose defender strategies.

Figure 11 .
Figure 11.Analyses all of rational nodes when choosing defender strategies.

Figure 11 .
Figure 11.Analyses all of rational nodes when choosing defender strategies.

Table 2 .
Profit matrix for active defensive strategies.

Table 3 .
Statistical analyses of strategies

Table 3 .
Statistical analyses of strategies R c , R nc , D f , M c , A t , and M nc .

Table 4 .
Statistical analyses of strategies R c , R nc , D f , M c , A t , and M nc

Table 5 .
Statistical analyses of strategies

Table 6 .
Statistical analyses of strategies