# Detection of Intelligent Intruders in Wireless Sensor Networks
## 4 Demonstration, Simulation and Discussion
### Impact of Node Density \(\lambda\)  
First, we examine the impact of node density on the WSN win probability and the intruder's escape probability, considering the three proposed intrusion algorithms. In this simulation, we fix \(L=500\) m, \(r_{s}=50\) m and \(r_{c}=100\) m and vary \(N\) from five to 45 to generate different node densities and network topologies. The intruder's sensing range is set as \(I_{rs}=60\), unless otherwise specified. Figures 5-7 illustrate the WSN win probability (\(P_{usn}\)), the escape probability (\(P_{intru}\)) and the network detection probability (\(P_{det}\)) of an intruder that adopts the linear, pinball and flood-fill algorithms in random WSNs with varying node densities \(\lambda\). All results plotted here are the average of 500 simulation runs under the same network settings. In each simulation run, we use two random variables, \(x\) and \(y\), to generate the coordinates for each sensor in the FoI. In other words, 500 different network topologies within the considered node density range are generated and tested for statistical analysis in this section. Figure 4: A screenshot of the simulator using the Unity platform. Figure 5: The WSN win probability (\(P_{usn}\)) of an intruder that adopts the linear, pinball and flood-fill algorithms in a WSN with varying node densities \(\lambda\). As Figures 5 and 6 illustrate, the WSN win probability (\(P_{\mathit{wsn}}\)) increases and the intruder's escape probability (\(P_{\mathit{intru}}\)) decreases as the node density \(\lambda\) increases. This is because increased node density leads to higher connected coverage in the network field with a reduced safe area for the intruder to find a successful escape path. Second, there exist significant differences when an intruder traverses the same WSN field using different intrusion algorithms. Among the three considered algorithms, the flood-fill algorithm performs the best, while the pinball algorithm performs the worst. This is caused by the different design and implementation of detection avoidance strategies on the intruder side. To be specific, the pinball intruder simply avoids nearby sensors without taking into consideration the destination when adjusting its intrusion path. It then frequently moves to an area or position that is further away from the destination and results in the worst escape probability. This observation coincides with the results in a related work [16; 30], \"for an intruder, following a sine-curve intrusion path can be more beneficial than following a straight-line path as the probability of being detected can be substantially decreased, however, with a side effect of reducing intrusion progress towards the destination to some extent\". Namely, a linear intruder moves directly toward the destination without avoiding nearby sensors, and hence, it has a higher probability of escaping the WSN as compared to the pinball intruder. On the other hand, the flood-fill intruder aims to reach its destination and takes into consideration the destination when avoiding nearby sensors during its traversal and, thus, leads to the best performance in escaping the WSN field among the three algorithms. Figure 6: The escape probability (\(P_{\mathit{intru}}\)) of an intruder that adopts the linear, pinball and flood-fill algorithms in a WSN with varying node densities \(\lambda\). Figure 7: The detection probability \(P_{\mathit{det}}\) of an intruder that adopts the linear, pinball and flood-fill algorithms in a WSN with varying node densities \(\lambda\). Figure 8 demonstrates the variances of the intruder's escape probability (\(P_{intru}\)) of an intruder that adopts the linear, pinball and flood-fill algorithms _versus_ node densities \(\lambda\). As the node density increases, the escape probability (\(P_{intru}\)) of a pinball intruder gets closer to \"0\" most quickly while the flood-fill intruder gets the highest probability to escape the sensor field. This is caused by the different intelligent strategies applied in the intruder's intrusion strategies.