# Virtual Pseudonym-Changing and Dynamic Grouping Policy for Privacy Preservation in VANETs
## 4 Proposed Solution
### LBS Communication  
During a journey some vehicles will require the locations of places of interest such as the nearest shopping mall, restaurant, hospital, etc; a vehicle makes to request to an LBS. On obtaining a location query from the vehicle, the location service provider will respond to the concerned vehicle. In this research, LBS is not a trusted entity and may conspire with an adversary to compromise the location tracks of a vehicle. Figure 9 shows the adversary scenario capturing location data during vehicle communication with LBS. In this case, there is a need to safeguard the location traces of a vehicle. To protect the location's traces of a vehicle in such a situation, we use a position-mixing procedure. The position-mixing algorithm requires two parameters, i.e., \(G_{ID}\) and position coordinates of neighbors in the transmission range. The \(G_{ID}\) hides the target vehicle's actual identity. The vehicle will take the position coordinates of its neighbor randomly and will exchange its location position with it. The exchange of position coordinates mixes the target vehicle's precise location with its neighbor. The basic position-mixing algorithm is given in Algorithm 6. First, the target vehicle will calculate the distance with each neighbor members of the group. A neighbor with a maximum distance range is selected for position coordinates exchange. For example, a vehicle \(V_{i}\) finds another vehicle \(V_{j}\), with a maximum distance range so that \(V_{i}\) will take \(V_{j}\) as a position mixer vehicle in the group.  
```
0:\(V_{i}\): Any vehicle \(i\), \(G_{ID}\): Group identification, \(POS_{i}\): Position coordinates of vehicle \(i\), \(POS_{i}\): Position coordinates of vehicle \(i\), \(Distance(Max)\): Take neighbor vehicle with maximum distance range, \(RandomSelection(V_{j})\): Random selection of any vehicle \(j\) as a position mixer, Exchange \((POS_{i},POS_{j})\): Exchange of position coordinates between \(T_{x}\) vehicles
0:\(G_{ID}\), position coordinates
0: Mixing position coordinates
1:for\(V_{i}=1\to n\)do
2:\(NeighborFunction()\)
3: Calculate \(Distance(V_{i},V_{j})\)
4:if\(Distance(Max)\)then
5: Select \((V_{j})\) as a mixer
6:else
7:\(RandomSelection(V_{j})\)
8:endif
9: Take \(V_{i}(G_{ID})\)
10: Exchange \((POS_{i},POS_{j})\)
11: Ready Message \((G_{ID},POS_{j})\)
12: Query \((G_{ID},POS_{j})\) to LBS
13:endfor
```  
**Algorithm 6** Position-Mixing Method  
The location position coordinates are exchanged between these two vehicles. Both the vehicles will send their queries with \(G_{ID}\) and mixing positions to LBS for the nearest location of interest. On receiving location requests, the location provider will respond to each vehicle. The location request messages contain real position coordinates and the same group identities. Suppose someone (adversary) conspires with the location provider and wants to find a vehicle's status; he/she (adversary) will find it challenging to identify a vehicle based on the position-mixing method because the location request message which contains a group identity that hides the actual vehicle and location coordinates of a neighboring vehicle protects the target vehicle's location position. The flow procedure of query to LBS is shown with the help of Figure 10. If the distance ranges of a vehicle with neighbors are the same, it will randomly select one of these neighbors to participate in the position exchange process.