## 4 Performance Evaluation
### Experimental Results
This is because the greater the amount of nodes, the more network resources are used. An increase in the coupling between nodes causes the system to sacrifice the stability time while coordinating between nodes. To test the effect of the algorithm's game mechanism on detection, the reliability of the network under the long-term operation of different algorithms is shown in Figure 10. The  
Figure 9: Distribution of number of nodes. reliability of the algorithm is related to the failure rate of the attacked sensor node, number of sensor nodes in a cluster, number of cluster heads passing on a route, and number of routes available for the entire network. Therefore, the numbers of nodes and routes were unchanged in experiments, ensuring that each algorithm was tested on the same type and number of attacks. The experimental results of reliability were obtained as the time of normal sending and receiving of network data. In the experiment, the network is defined as an undirected simple network topology diagram. Graph G consists of a set of points V(G) and an edge set E(G), G = (V, E). The reliability of the network is R(G,\(\Phi\),\(\psi\)), where G = (V, E), \(\Phi\) and \(\psi\) represent the probability of failure of all nodes and edges in the graph, respectively, and the value range is [0, 1]. Thus, the reliability of the network R(G,\(\Phi\),\(\psi\)) is generally defined as the probability that graph G remains connected under the possible abnormal of points and edges. Owing to the algorithm comparison experiment, the reliability is quantified by the network reliability running time in this paper. According to the literature [26; 27], this paper adopts _MTTF_ of the mean fault-free time of nodes to calculate the reliability of the network. For simplicity, it is assumed that the failure rate \(\lambda\) is a constant during the whole period of system operation, and that each cluster of the network contains \(m\) nodes. That is,  
\[\lambda=\frac{1}{MTTF} \tag{20}\]  
Then, the reliability of a node is defined as  
\[R_{i}(t)=\exp(-\lambda t) \tag{21}\]  
Due to the fact that the probability of abnormal occurrence of each node is independent, a cluster will lose its ability to work normally only when all the candidate cluster heads are abnormal and cause faults. Therefore, the reliability of a cluster can be obtained. \[R_{ci}(t)=1-\prod_{i=1}^{m}(1-R_{i}(t))=1-(1-\exp(-\lambda t))^{m} \tag{22}\]  
Figure 10: Reliability of algorithms. Since the failure of any cluster on a route will lead to the failure of the whole route, the reliability of a route can be obtained. Figure 7:0  
where \(n\) indicates the number of clusters through which a route passes. Assuming that any route to transmit data passes through the same number of clusters, the reliability of the entire network is  
Figure 7:1  
where \(l\) represents the number of all available routes from the source node to the base station in the entire network. In the experimental scheme, the number of nodes and routes is kept unchanged. It is important to ensure that the network is given the same type and number of attacks during each algorithm test. The experimental results of reliability are obtained by the normal transmission and reception time of network data. It can be seen from the figure that the network reliability of the application of the immune-game algorithm was significantly higher than that of the other algorithms.