# A Distributed Mix-Context-Based Method for Location Privacy in Road Networks
## 4 Proposed Solution  
We propose a crowd-based mix context scheme which offers location privacy to vehicles in a vehicular network. The scheme comprises two cases based on the vehicle speed, direction, and traffic density. The first case in our proposed scheme is the road intersection or the situation in which vehicles have low speed and traffic congestion on the road. In the second case, vehicles have low speed and fewer neighbors within transmission range. We use a mix context method to hide the actual identity of the vehicle in a crowd. A crowd of vehicles of similar status neighboring vehicles is established where they mix their context and identities to blur the sensitive information of vehicles. Here, context means a vehicles' direction of movement, speed range, and the number of transmission range neighboring vehicles. The proposed scheme block diagram is shown in Figure 4. The vehicle senses the environment to find the number of neighboring vehicles in its range. Based on the road context information, vehicles change pseudonyms to mix it in the crowd of vehicles. Otherwise, the virtual crowd method is used to mix the identities of vehicles. In the first case, there is a higher number of neighboring vehicles in the vicinity, and the simple pseudonym changing process is used, while in the second case, there is a lower  
Figure 3: Adversary model. number of neighboring vehicles in the transmission range, so the target vehicle selects neighboring vehicles randomly to exchange pseudonyms with. In both of these cases, there is a need for the protection of location privacy of vehicles. The whole process of the crowd-based mix context procedure is explained with the help of Algorithm 1. _DenThreshold_ is the vehicle traffic threshold and _NeigThreshold_ is the number of transmission range vehicles in the vicinity of a target vehicle. The high-level flowchart of the mix context scheme is shown in Figure 5.  
Figure 4: The block diagram of vehicles context mixing. Figure 5: The high-level flow of the mix context method. ```
1:\(V_{i}\): Any vehicle i, \(T_{x}\): Transmission range, \(Den\)_Threshold_: Density threshold, \(Neig\)_Threshold_: Neighbor threshold, \(VD\): Vehicle density, \(SP_{R}\): Speed range, \(Latency\)_Broad_: Beacon broadcast latency, \(D\): Direction of vehicle
2:\(SP_{R}\), \(D\), \(Den\)_Threshold_, \(T_{x}\)
3: Successful pseudonym update process
4:for\(V_{i}=1\to n\)do
5:\(NeighborFunction(SP_{R},D,T_{x})\)
6:if\(VD\geq Den\)_Threshold_then
7: Wait (TimeLimit)
8:if Speed (lower) then
9: Increase \(Latency\)_Broad_(BSMs)
10:else
11: Normal broadcast
12:endif
13:endif
14:if\(Neigbors(V_{i})\geq Neig\)_Threshold_then
15: Change pseudonym cooperatively
16: Set \(PUplate(V_{i})\) to 0
17:else
18: Randomize selection of \(T_{x}\) neighboring vehicle
19: Select \(V_{j}\) as virtualizer of \(V_{i}\)
20: Exchange \(Msgs(V_{i},V_{j})\)
21: Report Pseudonyms exchanged to TA
22:endif
23: Set timer for pseudonym change \(Pseudo(t)\)
24: Expiry of \(Pseudo(t)\)
25: Set \(PUplate(V_{i})\) to 1
26: Start beacon transmission and wait for at least \(k\) context neighbors
27:endfor
```  
**Algorithm 1** Crowd-based Mix Context. The neighbor function is used to search and count the number of neighboring vehicles in the transmission range. The procedure of neighbor function is given in Algorithm 2. The speed range, transmission range, and distance are given to the algorithm as input. ```
1:\(V_{i}\): any vehicle \(i\), \(T_{x}\): Transmission range, \(SP_{R}\): Speed Range, \(D\): Direction of a vehicle, \(CountV_{ID}\): Counting of number of vehicles
2:\(SP_{R}\), \(T_{x}\), \(D\)
3:Number of transmission range vehicles (\(CountV_{ID}\))
4:for\(V_{i}=1\to n\)do
5:\(MessageReceived(M_{i})\)
6: Check(\(V_{ID}\), Distance, \(SP_{R}\))
7: Calculate Distance \((V_{i},V_{j})\)
8:if\((V_{ID}\
eq V_{ID}(i)\) and Distance \(\leq 300\) m) then
9:\(CountV_{ID}++\)
10:else
11: Check again(Limit)
12:endif
13:endfor
14:Return \((CountV_{ID})\)
```  
**Algorithm 2** Neighbor Function.