# VANET Clustering Based Routing Protocol Suitable for Deserts
## 4 Clustering and Cluster Management
### Cluster Head Election Procedure  
The CHE procedure is as follows:  
1. Each vehicle periodically sends a _HELLO_ (_msg_, _hop-cnt_) message; at the same time, it also forwards the _HELLO_ messages of other vehicles. Upon doing \(M\) hops, the vehicle will be capable of processing all other vehicles' information, which includes the ID number, the cluster election priority \(P\), location information, velocity \((v)\) and hop count (_hop-cnt_). Every vehicle upon receiving the _HELLO_ message from others stores the other vehicle's information and subsequently uses this information to determine the hop count \(M\) of each vehicle and save it for further usage. During the information collection process, the receiving vehicle always determines the hop count of the other vehicle, stores the original \(M\), adds one to the count and then forwards the information to the next vehicle. Through this process, the next vehicle will beable to determine the \(M\) hop of that vehicle. After a number of transmissions, vehicles will have all the neighbors' information. 2. After information collection, each vehicle \((i)\) calculates \(P(i)\) according to Equation (16) and compares the result with \(P(j)\), if: \[P(i)<P(j)\ \ \ \forall j\in\phi_{i}\] (19) The vehicle with a lower \(P\) value has the highest priority, thus it will upgrade itself as a CH. If two or more vehicles share the least value of \(P\), \[\left\{ \begin{array}{c}P(i)=P(j)\\ P_{e}(i)<P_{e}(j)\end{array} \right.\] (20) The vehicle with the least \(P_{e}\) value is selected as a CH, if: \[\left\{ \begin{array}{c}P_{e}(i)=P_{e}(j)\\ ID(i)<ID(j)\end{array} \right.\] (21) The vehicle with the least ID should be elected as the CH. 3. The vehicle, after upgrading itself as a CH, will broadcast a message to the outside, propagating cluster information, _HEAD (CluID, head-msg, way-car, hop-cnt)_, where _CluID_ is a cluster label, _head-msg_ is the CH vehicle information, _way-car_ is the route information and _hop-cnt_ is the number of hops. In the initial transmission, the value of _way-car_ is set to null, and _hop-cnt_ is set to zero. Other vehicles within the cluster, upon receiving the _HEAD_ message, store all values and examine the value of _hop-cnt_. If _hop-cnt_ is less than \(M_{max}\), then they will add one to its current value and then forward the information to the next hop. If _hop-cnt_ is equal to \(M_{max}\), then there is no need for further treatments. Other vehicles when receiving the same _CluID_ investigate \(M\) values and select the lowest value of \(M\), then use this value to determine the value of their _hop-cnt_ return. When they receive a message from a different _CluID_, they analyze _head-msg_ of the CHs, and the information of the high priority vehicle is retained. During the exchange of the HELLO messages, vehicles usually examine the _CluID_ when the _hop-cnt_ equals one, if a vehicle found that the _CluID_ is different from its _CluID_, that means those two vehicles are border nodes. 4. The vehicle sends the apply message _APPLY (CluID, msg, way-car, hop-cnt)_ to the CH, which was selected according to Step 2; other vehicles on the route interrupt this message and add their information to _way-car_ and add one to the _hop-cnt_, then forward it to the CH. 5. The CH will add the vehicle to its member list just after verifying that the number of vehicles is less than \(N_{max}\); in this case, the CH sends back an accept message (_ACCP_) to the intended vehicle; otherwise, it sends back a refuse message (_RFUS_). If a vehicle receive a _RFUS_ message, it will establish a temporary link with one of the neighbor vehicles to access the network resources until the number of vehicles becomes less than \(N_{max}\) or joins another cluster. 6. The intended vehicle after receiving the _ACCP_ message broadcasts the _MEMR (CluID, msg, way-car, dis-cnt, hop-cnt)_ message, and then, there is no need to be involved in the other clustering election process by sending _dis-cnt_ to other CHs. 7.