# Virtual Pseudonym-Changing and Dynamic Grouping Policy for Privacy Preservation in VANETs
## 4 Proposed Solution
### Pseudonym-Changing Protocol  
In this section, we discuss the pseudonym-changing protocol of vehicles on the road network. The GH will monitor the number of neighboring vehicles in the group. A threshold is set for the maximum number of neighboring vehicles to change pseudonyms using road context information. The road context information includes vehicle velocity range, transmission ranges, number of neighbors in the vicinity. First, the neighbor function is applied to check the number of transmission range neighbors. After that, the neighbor threshold is verified before executing the pseudonym-changing process. Suppose the number of neighbors is greater than or equal to a threshold, then the GH disseminates information in the group to change pseudonyms cooperatively. Otherwise, the GH will announce the virtual pseudonym change process that is shown in Figure 6. The GH will select a few vehicles for a virtual pseudonym change. The chosen vehicles generate duplicate pseudonyms in the group and create a crowd of virtual vehicles in the vicinity. Algorithm 4 contains the detail of the pseudonym-changing protocol. The pseudonym-changing protocol is divided into two sections, i.e., the normal pseudonym update process and the virtual pseudonym update process. Figure 5: Selection of GH and group communication. **Initialization**: _Vi:_ Any vehicle \(i\), \(NeighCount\): Number of neighboring vehicles, \(NeighThreshold\): Threshold for several transmission range vehicles, \(T_{x}\): Vehicle transmission range, \(VL_{R}\): Velocity range, \(Pseudo-Update(V_{i})\): Change the pseudonyms of vehicle \(i\), \(Virtualizer(V_{i})\): Vehicle \(i\) take part in virtual pseudonym change process, \(Pseudon\)\(Expiry(t)\): Pseudonym expiry time, \(NF\): Neighbor Function, \(VerifyAuthenticity(V_{i})\): Verification of vehicle \(i\) authenticity, Calculate Distance \((GH,V_{i})\): distance calculation between GH and vehicle \(i\), \(DistanceV_{i}(minimum)\): Vehicle with minimum distance with GH  
**Input**: \(VL_{R}\), \(T_{x}\), \(NeighThreshold\)  
**Output**: Successful change of pseudonym and anonymization in the group  
```
1:for all\(V_{i}=1\in VelocityRange\)do
2:\(NF(VL_{R},T_{x},G_{ID})\)
3:if\(NeighCount\geq NeighThreshold\)then
4:\(VerifyAuthenticity(V_{i})\)
5:\(Pseudo-Update(V_{i})\)
6: Set flag to 0
7:else
8:\(GH\) notify virtual change process in the group
9:for\(Vi\in Group(GH)\)do
10: Calculate Distance \((GH,V_{i})\)
11:if\(DistanceV_{i}(minimum)\)then
12: Select \(Virtualizer(V_{i})\)
13:else
14: Go to step 10
15:endif
16:endfor
17:\(Virtualizer(V_{i})\) Messages creation
18:\(Msg_{1}(Pseudo-id_{1},VL_{1},POS_{1})\)
19:\(Msg_{2}(Pseudo-id_{2},VL_{2},POS_{2})\)
20:\(Pseudo-Update[V_{i}(Msg_{1},Msg_{2})]\)
21: Set flag to 0
22:endif
23:\(PseudonExpiry(t)\)
24: Set flag to 1 and go to step 2
25:endfor
```  
**Algorithm 4** Pseudonym-Changing Protocol  
Figure 6: Virtual pseudonyms changing in the grouping concept. The neighbor function is used to find the number of transmission range neighbors in the concerned region. The neighbor function is shown in Algorithm 5. Vehicles broadcast beacon messages for road status information. The messages are received by each transmission range vehicle. The algorithm takes velocity range, transmission range, and distance as input.