# Rogue Node Detection Based on a Fog Network Utilizing Parked Vehicles
## 3 Network Model
### Fog Network Construction  
Based on the above-mentioned prediction model, the set of vehicles that will continue to stay in the parking cluster in the next few hours is obtained. The fog nodes should be selected from these candidate parked vehicles. This is because selecting stable parked vehicles as fog computing nodes can avoid the computational migration cost caused by the sudden departure of the cluster member during the rogue node calculation process. At the same time, the number of fog nodes in the fog network should be related to the density of moving vehicles on the road. The higher the density of the moving vehicles, the more fog computing nodes should be needed to speed up the detection of rogue nodes. We select several nodes with high parking probability in the parking cluster to form the fog network. The fog node selection process is described as follows:  
(1) Firstly, the Greenshield model [20] is used to model the density of moving vehicles on the road where the parking cluster is located. The Greenshield model, which is widely used to model uninterrupted traffic conditions, is recognized as a highly accurate traffic flow statistical model in the field of traffic engineering. In the Greenshield model, vehicle density is inversely proportional to vehicle speed, and an increase in the vehicle density will decrease the vehicle's moving speed. According to this model, the vehicle density is:  
\[\rho=\frac{v_{0}\,\overline{\rho}}{v_{0}-v} \tag{1}\]  
where \(v\) is the average speed of the vehicles on this road, \(v_{0}\) is the moving speed of the vehicle when the vehicle density is zero (the maximum moving speed of the vehicle that is limited by the road section) and \(\overline{\rho}\) is the average vehicle density in the vehicle's communication range. According to Formula (1), to calculate \(\rho\), \(v\) and \(\overline{\rho}\) need to be obtained first. In order to know the average moving speed of vehicles on the road section, the cluster head interacts with the surrounding moving vehicles to obtain both their speed information and the number of moving vehicles within its communication range. In addition, cluster member nodes at the two ends of the cluster obtain the information about the speed of moving vehicles and the number of moving vehicles within their communication range, respectively. The obtained information is sent to the cluster head, and then the cluster head can roughly calculate the values of \(v\) and \(\overline{\rho}\).  
(2) The relationship between selection ratio \(t\) (the ratio of the number of fog nodes to the total number of stable parked vehicle members) and \(\rho\) is given as:  
\[t=t_{0}+\frac{\rho}{\rho_{max}}(1-t_{0}) \tag{2}\]  
where \(\rho_{max}\) denotes the maximum vehicle density of the road, which can be determined according to research [20]. If \(t_{0}=0.5\), according to Formula (2), when there are no moving vehicles on the road, that is, \(\rho=0\), 50% of the vehicles in the candidate vehicles are selected as fog nodes. As the number of moving vehicles increases, the value of \(t\) gradually approaches 1.  
After \(t\) is determined, the number of fog nodes is obtained. A certain number of parked vehicles are randomly selected from the candidate vehicles to form the fog network. When the fog nodes are selected, we first check whether the cluster head becomes a fog node. If so, the cluster head becomes the central computing node in the fog network. Otherwise, the fog node that is closest to the cluster head acts as the central computing node.