# Rogue Node Detection Based on a Fog Network Utilizing Parked Vehicles
## 5 Simulation Experiment  
In order to verify the performance of the proposed rogue node detection mechanism described in this paper, we use Python to conduct simulation experiments and compare our scheme with the F-RouND strategy in literature [10] and the method described in reference (RSUs) [7]. The F-RouND strategy of literature [10] is used to organize moving vehicles to form vehicle clusters, and literature [7] proposed to use RSUs to monitor the speed information of moving vehicles. In this experiment, three RSU devices are set, and the communication radius of each RSU is assumed to be 500 m.  
We assume that the length of each parking cluster is 1000 m. The road has two-way lanes and the width of the road is 12 m. The communication mechanism among vehicles uses a 2 MHz 802.11p channel. According to the investigation of parked vehicles on both sides of the road in the urban environment in research [19], the number of parked vehicles on the roadside is set as 100. The number of mobile vehicles is varied from 20-200, and the speed range of mobile vehicles is 10 km/ h-100 km/h. The specific simulation parameters used in the experiment are shown in Table 2.  
In order to compare the performance of the three schemes, this paper uses two evaluation indicators as True Positive Rate (TPR) and False Positive Rate (FPR), which are defined as follows:  
\[T_{TPR}=\frac{\text{Number of rogue nodes correctly detected}}{\text{Number of rogue nodes}}\times 100\% \tag{6}\]  
\[T_{FPR}=\frac{\text{Number of normal nodes for error detection}}{\text{Number of normal nodes}}\times 100\% \tag{7}\]  
TPR refers to the ratio of the number of rogue nodes correctly detected to the whole number of rogue nodes, while FPR refers to the ratio of the number of incorrectly detected rogue nodes to the number of normal nodes. \begin{table}
\begin{tabular}{l c} \hline \hline
**Parameter** & **Value** \\ \hline Parking cluster length & 1000 m \\ Road width/m & 12 m \\ Number of moving vehicles & [20, 200] \\ Wireless mechanism & 802.11p \\ Transmission bandwidth & 2 MHz \\ Vehicle node communication range & 250 m \\ Moving vehicle speed & [10, 100] km/h \\ Communication frequency & 200 ms \\ Ratio of rogue nodes & 20\%, 30\% \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Simulation parameters in this paper. The U-test uses the theory of normal distribution to determine the difference between two samples. To verify whether the U-test is fit to detect rogue vehicles, the speed distributions of mobile vehicles are analyzed. Figure 8 shows the histogram of the speed distribution of a randomly selected mobile vehicle within the simulation time from 100 s to 200 s in our simulation. It can be seen from Figure 7 that the speed of the moving vehicle basically obeys the normal distribution, which meets the prerequisite of using the U-test. Therefore, the U-test is suitable for rogue node detection. Figures 9 and 10 show that, when the proportion of rogue nodes is 20% and the number of mobile vehicles is less than 60, the scheme of this paper has significantly stronger stability than the other two schemes. The TPR value is 100% and the FPR remains at 0% when varying the number of moving vehicles, which indicates that the detection accuracy of the scheme proposed in this paper is very high. With the increase of the number of mobile vehicles, the accuracy of each scheme declines, but the decline of our proposed schemes is the smallest among the three schemes. When the number of mobile vehicles is 200, the TPR of our scheme is still more than 80%, and the FPR of our scheme is below 5%. Compared with the other two research works, our scheme achieves high performance  
It can be seen from Figures 11 and 12 that, when the proportion of rogue nodes is increased to 30%, the proposed scheme still achieves much higher detection accuracy than the other two schemes ever though the number of automobiles is small on the road.