# Detection of Intelligent Intruders in Wireless Sensor Networks
## 4 Demonstration, Simulation and Discussion
### Impact of Communication Range \(r_{c}\)  
To detect an intruder, a WSN should be well connected, so that detection can be reported to the base station. Namely, the network connectivity impacts the detection and prevention probability of a WSN and the escape probability of an intruder. The sensor's communication range \(r_{c}\) determines the network connectivity of a WSN. In order to examine the impact of communication range \(r_{c}\) on the WSN win probability (\(P_{wsn}\)) and the intruder's escape probability (\(P_{intru}\)), we fix the network parameters as \(N=25\), \(r_{s}=50\) m, \(L=500\) m, \(A=500^{2}\) m\({}^{2}\) and vary the the communication range \(r_{c}\) from 25 to 250 m. Each result plotted here is the average of 500 simulation runs under the same network settings.  
Figures 11 and 12 depict the WSN win probability (\(P_{wsn}\)) and the escape probability (\(P_{intru}\)) of an intruder in traversing a WSN with varying communication ranges \(r_{c}\), taking into consideration the three considered intrusion algorithms. In the two figures, we have the following observations. First, the WSN win probability increases quickly in preventing and detecting the linear intruder, while that for the pinball and flood-fill intruders remains nearly constant as the communication range \(r_{c}\) increases. This is because the network's coverage remains the same with a constant number of deployed sensors \(N\) and sensing range \(r_{s}\). The same sensing coverage poses the same challenge for pinball and flood-fill intruders to detect and avoid sensors in their traversing. Namely, increased communication range has no contribution to the sensing coverage of the WSN. Thus, the WSN win probability of detecting and preventing pinball and flood-fill intruders keeps constant at the increase of the communication range \(r_{c}\). This also explains the nearly constant escape probability of the pinball and flood-fill intruder, as shown in Figure 12.  
Figure 11: The WSN win probability (\(P_{wsn}\)) of a WSN in detecting and preventing an intruder that adopts the linear, pinball and flood-fill algorithms in a WSN with varying communication range \(r_{c}\).  
On the other hand, it is observed that the WSN win probability of detecting and preventing the linear intruders increases, and the escape probability of the linear intruder drops with the increase of the communication range. This is because an increased communication range significantly contributes to the network connectivity and the connected coverage of a WSN. With increased communication range, more sensors that were initially isolated get connected to report the detection of the linear intruder to the base station. In other words, when the communication range is low, there exists a fraction of sensors that may be able detect the linear intruder within its sensing range; however, they may not able to report the detection to the base station for successful intruder detection. Hence, as the communication range increases, the probability that a linear intruder gets caught by a connected sensor increases, and its escape probability decreases accordingly.  
Moreover, we observe that there exist two critical communication ranges \(r_{c1}=60\) and \(r_{c2}=120\). Specifically, when the communication range is below \(r_{c1}\), _i.e._, \(r_{c}<r_{c1}\), the linear intruder outperforms the other two intelligent counterparts in terms of escape probability under the same network settings. Second, when the communication is above \(r_{c2}\), _i.e._, \(r_{c}>r_{c2}\), both pinball and flood-fill intruders outperform the linear intruder, while the flood-fill intruder excels. Third, when the communication range is between the two critical ranges, _i.e._, \(r_{c1}<r_{c}<r_{c2}\), the flood-fill algorithm outperforms the linear algorithm, while the pinball algorithm performs the worst. The results indicate that intruder's intelligence in detecting and avoiding nearby sensors has a significant impact on its escape probability, so as for the network connectivity.