# Security Guarantee for Vehicular Message Transmission Based on Dynamic Social Attributes

Authors: Lishui Chen; Jing Wang; Xing Chen; Yifu Zhang
Journal: Wireless Communications and Mobile Computing
 (2021)

---

## Abstract

Effective message forwarding between vehicles can reduce the occurrence of traffic accidents and improve the driving experience. Vehicle clustering can improve message utilization, but attackers in the network pose a serious threat to message forwarding. Based on vehicle clustering, we propose a message forwarding strategy for Vehicular Ad hoc Network. Specifically, the vehicles are clustered based on their directions and speeds. Besides, the friendship of vehicles is evaluated in terms of the interaction friendship and reference friendship. Based on the friendship of vehicles, the optimal vehicle can be selected as the cluster head. Thereafter, the double key technology is designed to encrypt vehicular messages such that the messages can be forwarded more safely and efficiently. The analysis results show that the proposed strategy can effectively improve the message delivery rate, reduce the message leakage rate, and improve the network performance.


---

## Body

## 1. Introduction

As an important basis of intelligent transport system (ITS), Vehicular Ad hoc Network (VANET) is committed to the realization of intelligent traffic management and intelligent dynamic information services [1, 2]. Through vehicle to vehicle (V2V) communication and vehicle to infrastructure (V2I) communication, VANETs can reduce traffic accidents, improve road use efficiency, and promote the realization of traffic intelligence and information construction [3–5].VANETs can improve the performance of ITS through information interaction, and the behavior of vehicles is similar to that of mobile nodes [6], so VANETs belong to a kind of continuous ad hoc wireless mobile network. The topology of VANETs is usually unstable since it changes dynamically with the high-speed movement of vehicles. In addition, the communication between vehicles in VANETs is mainly based on wireless link, which provides an opportunity for malicious vehicles to launch attacks. Therefore, the dynamic network structure of VANETs leads to serious security and privacy threats to vehicles and drivers [7], which makes it urgent to design an effective secure communication strategy. To deal with the aforementioned issues, researchers usually design the security mechanism by using the authentication method based on public key infrastructure [8]. However, as a vehicle needs to store a large number of key pairs and their corresponding certificates that need to be transmitted with the message, the efficiency of those schemes in improving the network performance is low.Given the high similarity of messages acquired or transmitted by vehicles in a certain range of VANETs, when a vehicle receives a useful message, the message also has reference value for its adjacent vehicles. In this case, if the vehicles independently repeat the security message transmission, it will not only cause the waste of communication resources but also be difficult to improve the communication efficiency. Although the message sharing method can solve the above problems to a certain extent, the effectiveness of the message in the communication process is not considered in the traditional broadcast method, which is prone to collision and loss of messages. As a result, the effectiveness of message sharing cannot be improved [9]. On the other hand, clustering technology is usually to group nodes in a network according to a certain relationship to enable message transmission. Cluster communication can not only realize message sharing but also reduce the propagation of irrelevant and redundant messages, as well as reduce routing overhead and broadcast storm problems. Hence, message transmission efficiency and network performance can be improved [10]. Different clustering mechanisms have different optimization objectives and objects. Researchers have conducted in-depth research on cluster communication, and different clustering methods are introduced in detail in reference [11].According to the characteristics of VANETs, the clustering methods of VANETs include static clustering based on the base station (BS) and dynamic clustering based on the vehicle [12]. Static clustering based on BS takes BS as cluster head, and the surrounding vehicles transmit messages to BS, and then, the BS transmits messages to other vehicles around [13]. The advantage of static clustering method is that it is easy to distinguish clusters. However, due to the long distance between two BSs and the fast change of network topology, static clustering usually leads to high message transmission delay, thus greatly reducing the accuracy and effective utilization of the message [14]. Hence, dynamic clustering based on V2V communication emerges. In this type of clustering, vehicles are screened and clustered according to certain rules, including location, speed, vehicle attribute relationship, and destination. Nevertheless, how to cluster vehicles reasonably with consideration of communication security and communication effectiveness remains an open issue.Motivated by this, we propose a friendship assessment of security message forwarding (FASMF) strategy in VANETs. Firstly, considering the factors that affect the vehicle clustering performance and combining with the evaluation of friendship, the appropriate vehicle is selected as the cluster head. The cluster head is responsible for collecting the messages from its cluster members or other adjacent cluster heads and realizes the secure forwarding of messages by using double key message encryption within and between clusters. The effectiveness of the proposed scheme is finally validated by extensive simulations.The reminder of the paper is organized as follows. Section2 introduces the related works. Section 3 evaluates the vehicle friendship. Section 4 introduces the vehicle clustering scheme. Section 5 proposes a secure double key message forwarding strategy. In Section 6, simulation results are presented. Section 7 finally concludes the paper.


## 2. Related Work

In the literature, vehicular message transmission can be improved through vehicle clustering. In [15], the authors aimed to cluster a wide range of driving encounter scenarios based only on multivehicle GPS trajectories, where a generic unsupervised learning framework was proposed. In [16], a stochastic analysis of the impact of cluster instability on generic routing overhead was presented. In [17], the authors proposed to employ network representation learning to achieve accurate vehicle trajectory clustering, which could reduce the time and space resources. In [18], a power control scheme in an uplink clustering network was studied for a densely vehicular network with node clustering idea. In [19], an integrated network architecture for secure group communication was proposed by taking advantage of the software-defined network technology in fifth-generation mobile networks. However, those works only focused on the vehicle cluster based on wireless communication parameters, where social relationship between vehicles was not taken into account.Recently, some works tried to improve the security performance of intracluster and intercluster message transmissions. In [20], the authors proposed a tool called as cryptographic mix-zone to enhance vehicle privacy, in which the safety messages of vehicles were encrypted using a group secret key. In [21], a ternary join exit tree was constructed to secure communication and efficient key updating for vehicles in a platoon. In [22], an efficient security risk analysis method was proposed through fitting for evaluating the risks of attacks in the context of AV and CAVs. In [23], an efficient privacy-preserving data aggregation and dynamic pricing service PADP in V2G IoT were proposed, by designing an identity-based sequential aggregate signed data based on factoring and a threshold homomorphic encryption. However, those schemes usually introduced large amount of extraoverheads, which may degrade the delay or energy efficiency performance of VANETs.


## 3. Evaluation of Vehicle Friendship

The evaluation result of the vehicle-friendly relationship is the basis of the clustering strategy in this paper. The friendship of the vehicle in the network is evaluated by calculating the friendship of the vehicle. Specifically, the vehicle with high friendship is selected as the cluster head first, to ensure the reliability of message forwarding and improve the efficiency of message transmission. The direct interaction history behavior of both sides of the vehicle is selected to evaluate the interaction friendship, and the reference friendship provided by other neighboring vehicles is taken as the main factor to evaluate the vehicle friendship comprehensively.


### 3.1. Interactive Friendship

The vehicle has mobility and can be operated across geographical locations. If there is historical interaction between the vehicles that meet, the vehicle will obtain the vehicle interaction friendship according to the historical friendship calculated by the historical interaction experience and the interval of meeting again. If the interaction between vehiclevi and vj is more successful, the friendship of vehicle vi to vj is greater, which indicates that vehicle vi has more sufficient evidence to forward the message to the vehicle vj; on the contrary, if the number of successful interactions between vehicle vi and vj is not frequent enough, the friendship of vehicle vi to vehicle vj will be reduced. Therefore, taking the number of successful interactions between vehicles as a parameter can directly evaluate the historical friendship. If there are Sumi,j historical interaction records between vehicle vi and vj in the historical interaction, the historical friendship <His,Fre,Deg>i,j of vehicle vi to vj can be expressed as:
(1)<His,Fre,Deg>i,j=Suci,jSumi,j1Faii,j,Sumi,j≠0andSumi,j=Suci,j+Faii,j,0,Sumi,j=0andSumi,j=Suci,j+Faii,j,where Suci,j is the number of successful transactions and Faii,j is the number of failed transactions. At the same time, if there is no interactive record, the historical friendship is 0.In addition, the time interval of vehicles meeting again will inevitably affect the level of friendship between vehicles, and the time interval of vehicles meeting again is negatively correlated with the friendship of historical interaction. That is to say, the longer the interval, the lower the referential value of historical interaction, and the less its impact on current friendship; on the contrary, the shorter the interval, the higher the value of historical cross reference, should improve the impact on the current friendship. To solve the appealing problem,Δtmax is used to represent the effective time window size of historical behavior, δ is the decay rate factor, and its value is defined according to the specific application. Then, based on the historical friendship <His,Fre,Deg>i,j, forgetting factor α is introduced, whose value is as follows:
(2)α=eΔtmax/δ−et−t′/δeΔmax/δ−1,t−t′<Δtmax,0,else,where t is the current time and t′ is the time of the last interaction.In conclusion, according to the historical friendship<His,Fre,Deg>i,j and forgetting factor α, the interactive friendlship <Mul,Fre,Deg>i,j of vehicle vi to vj is shown in
(3)<Mul,Fre,Deg>i,j=∑t=t′Δtmaxα·<His,Fre,Deg>i,jtΔtmax,t−t′<Δtmax,0,else.By introducing the forgetting factor, when the historical interaction occurs beyond the effective time length, the forgetting factorα is 0, which indicates that the past interaction has lost its value; as the past interaction time t′ approaches the current time t, the value of α tends to 1, which indicates that the past interaction is valuable. Therefore, using the forgetting factor can reduce the impact on network security caused by the transformation of ordinary vehicles into malicious vehicles and improve network stability.


### 3.2. Reference Friendship

In the process of evaluating the friendship of vehiclevi to vj, not only the friendship formed by the historical interaction with vehicle vi but also the evaluation factors of other vehicle vk to vj and the friendship evaluation of vehicle vi to vehicle vk should be considered, so as to obtain the recommended friendship <Rec,Fre,Deg>i,j of vehicle vi to vj. In order to make the recommendation reliable, the average friendship of all neighbor recommended vehicles vk to vi and vj is calculated as the value of recommended friendship <Rec,Fre,Deg>i,j as shown in
(4)<Rec,Fre,Deg>i,j=1n∑k=1n<Mul,Fre,Deg>i,k·<Mul,Fre,Deg>k,j,where n denotes the number of neighbor vehicles, <Mul,Fre,Deg>i,k denotes the interactive friendship of vehicle vi to neighbor vehicle vk, and <Mul,Fre,Deg>k,j denotes the friendship of vehicle vj provided by vk.As neighbor vehiclevk may carry out malicious recommendation attacks, vehicle vi does not fully trust the friendship <Mul,Fre,Deg>k,j provided by vk. In order to prevent malicious attack from vehicle vk, vehicle vi introduces a penalty factor Puii,k. The size of Puii,k is determined by the number of interaction failures during the historical interaction between vi and vk.
(5)Puii,k=arctanFaii,kSumi,k.We introduce a penalty factor when the number of unsuccessful communication between vehicles increases in a short period. That is, when the vehicle behaves as malicious behavior, the friendship value of the vehicle decreases rapidly, to achieve the purpose of the abrupt decline of friendly degree. At the same time, to prevent the collusion attack between neighbor vehiclevk and vj leading to the rapid increase of recommendation friendship, we also consider the adjustment factor Regi,k, which means that with the increase of the number of successful interactive communication between vehicles, its size is closer to 1, but the approaching speed will not increase suddenly. Therefore, the calculation of the adjustment factor Regi,k is as follows:
(6)Regi,k=1−Suci,k1+Suci,k.In conclusion, according to the recommended friendship, penalty factor, and adjustment factor, the reference friendship<Con,Fre,Deg>i,j of vehicle vi to vj is calculated as follows:
(7)<Con,Fre,Deg>i,j=Puii,k−1·Regi,k·<Rec,Fre,Deg>i,j.The introduction of penalty factorPuii,k and adjustment factor Regi,k in the calculation of reference friendship can not only effectively prevent the occurrence of malicious recommendation behavior of neighbor vehicle vk but also reduce the influence of collusion attack between vehicles on the network, to prevent the rapid growth of reference friendship.


### 3.3. Friendship Integration

As mentioned above, measuring the friendship of vehicles from the above two aspects can improve the reliability of cluster heads, but the interaction between vehicles is different, so the influence of interaction friendship and reference friendship on friendship is also different. Therefore, it is necessary to allocate the weight dynamically.Firstly, if the interaction between vehiclevi and vj is more frequent, the more information of vehicle vi to vj is, vehicle vi has sufficient evidence to evaluate vehicle vj; secondly, if there is less interaction between vehicle vi and vj, vehicle vi has less information about vehicle vj, so it needs to rely more on reference to evaluate the vehicle. Therefore, the dynamic weight distribution can be achieved more accurately by taking the interaction frequency factor between vehicles as the parameter. When vehicle vi interacts with vj at time t, according to the historical interaction records, the proportion of all interaction time between vehicle vi and vj before time t in the whole time can be calculated as follows:
(8)ρ=1Sumi,j∑n=1Sumi,jtwntwn+tsn,where twn is the duration of the nth interaction and tsn is the interval of the nth interaction.The more interaction times between nodes, the greater the proportion of interaction time, indicating that the interaction betweenvi and vj is more frequent. Therefore, the interaction frequency factor between vehicles is defined as
(9)ω1=Sumi,jSumi×eρ−1,where Sumi denotes the total number of interactions of vehicle vi before time t. Thus, the expression of friendship <Fre,Deg>i,j holds as follows
(10)<Fre,Deg>i,j=ω1<Mul,Fre,Deg>i,j+ω2<Con,Fre,Deg>i,j,where ω2 represents the weight of reference friendship and ω2=1−ω1.


## 3.1. Interactive Friendship

The vehicle has mobility and can be operated across geographical locations. If there is historical interaction between the vehicles that meet, the vehicle will obtain the vehicle interaction friendship according to the historical friendship calculated by the historical interaction experience and the interval of meeting again. If the interaction between vehiclevi and vj is more successful, the friendship of vehicle vi to vj is greater, which indicates that vehicle vi has more sufficient evidence to forward the message to the vehicle vj; on the contrary, if the number of successful interactions between vehicle vi and vj is not frequent enough, the friendship of vehicle vi to vehicle vj will be reduced. Therefore, taking the number of successful interactions between vehicles as a parameter can directly evaluate the historical friendship. If there are Sumi,j historical interaction records between vehicle vi and vj in the historical interaction, the historical friendship <His,Fre,Deg>i,j of vehicle vi to vj can be expressed as:
(1)<His,Fre,Deg>i,j=Suci,jSumi,j1Faii,j,Sumi,j≠0andSumi,j=Suci,j+Faii,j,0,Sumi,j=0andSumi,j=Suci,j+Faii,j,where Suci,j is the number of successful transactions and Faii,j is the number of failed transactions. At the same time, if there is no interactive record, the historical friendship is 0.In addition, the time interval of vehicles meeting again will inevitably affect the level of friendship between vehicles, and the time interval of vehicles meeting again is negatively correlated with the friendship of historical interaction. That is to say, the longer the interval, the lower the referential value of historical interaction, and the less its impact on current friendship; on the contrary, the shorter the interval, the higher the value of historical cross reference, should improve the impact on the current friendship. To solve the appealing problem,Δtmax is used to represent the effective time window size of historical behavior, δ is the decay rate factor, and its value is defined according to the specific application. Then, based on the historical friendship <His,Fre,Deg>i,j, forgetting factor α is introduced, whose value is as follows:
(2)α=eΔtmax/δ−et−t′/δeΔmax/δ−1,t−t′<Δtmax,0,else,where t is the current time and t′ is the time of the last interaction.In conclusion, according to the historical friendship<His,Fre,Deg>i,j and forgetting factor α, the interactive friendlship <Mul,Fre,Deg>i,j of vehicle vi to vj is shown in
(3)<Mul,Fre,Deg>i,j=∑t=t′Δtmaxα·<His,Fre,Deg>i,jtΔtmax,t−t′<Δtmax,0,else.By introducing the forgetting factor, when the historical interaction occurs beyond the effective time length, the forgetting factorα is 0, which indicates that the past interaction has lost its value; as the past interaction time t′ approaches the current time t, the value of α tends to 1, which indicates that the past interaction is valuable. Therefore, using the forgetting factor can reduce the impact on network security caused by the transformation of ordinary vehicles into malicious vehicles and improve network stability.


## 3.2. Reference Friendship

In the process of evaluating the friendship of vehiclevi to vj, not only the friendship formed by the historical interaction with vehicle vi but also the evaluation factors of other vehicle vk to vj and the friendship evaluation of vehicle vi to vehicle vk should be considered, so as to obtain the recommended friendship <Rec,Fre,Deg>i,j of vehicle vi to vj. In order to make the recommendation reliable, the average friendship of all neighbor recommended vehicles vk to vi and vj is calculated as the value of recommended friendship <Rec,Fre,Deg>i,j as shown in
(4)<Rec,Fre,Deg>i,j=1n∑k=1n<Mul,Fre,Deg>i,k·<Mul,Fre,Deg>k,j,where n denotes the number of neighbor vehicles, <Mul,Fre,Deg>i,k denotes the interactive friendship of vehicle vi to neighbor vehicle vk, and <Mul,Fre,Deg>k,j denotes the friendship of vehicle vj provided by vk.As neighbor vehiclevk may carry out malicious recommendation attacks, vehicle vi does not fully trust the friendship <Mul,Fre,Deg>k,j provided by vk. In order to prevent malicious attack from vehicle vk, vehicle vi introduces a penalty factor Puii,k. The size of Puii,k is determined by the number of interaction failures during the historical interaction between vi and vk.
(5)Puii,k=arctanFaii,kSumi,k.We introduce a penalty factor when the number of unsuccessful communication between vehicles increases in a short period. That is, when the vehicle behaves as malicious behavior, the friendship value of the vehicle decreases rapidly, to achieve the purpose of the abrupt decline of friendly degree. At the same time, to prevent the collusion attack between neighbor vehiclevk and vj leading to the rapid increase of recommendation friendship, we also consider the adjustment factor Regi,k, which means that with the increase of the number of successful interactive communication between vehicles, its size is closer to 1, but the approaching speed will not increase suddenly. Therefore, the calculation of the adjustment factor Regi,k is as follows:
(6)Regi,k=1−Suci,k1+Suci,k.In conclusion, according to the recommended friendship, penalty factor, and adjustment factor, the reference friendship<Con,Fre,Deg>i,j of vehicle vi to vj is calculated as follows:
(7)<Con,Fre,Deg>i,j=Puii,k−1·Regi,k·<Rec,Fre,Deg>i,j.The introduction of penalty factorPuii,k and adjustment factor Regi,k in the calculation of reference friendship can not only effectively prevent the occurrence of malicious recommendation behavior of neighbor vehicle vk but also reduce the influence of collusion attack between vehicles on the network, to prevent the rapid growth of reference friendship.


## 3.3. Friendship Integration

As mentioned above, measuring the friendship of vehicles from the above two aspects can improve the reliability of cluster heads, but the interaction between vehicles is different, so the influence of interaction friendship and reference friendship on friendship is also different. Therefore, it is necessary to allocate the weight dynamically.Firstly, if the interaction between vehiclevi and vj is more frequent, the more information of vehicle vi to vj is, vehicle vi has sufficient evidence to evaluate vehicle vj; secondly, if there is less interaction between vehicle vi and vj, vehicle vi has less information about vehicle vj, so it needs to rely more on reference to evaluate the vehicle. Therefore, the dynamic weight distribution can be achieved more accurately by taking the interaction frequency factor between vehicles as the parameter. When vehicle vi interacts with vj at time t, according to the historical interaction records, the proportion of all interaction time between vehicle vi and vj before time t in the whole time can be calculated as follows:
(8)ρ=1Sumi,j∑n=1Sumi,jtwntwn+tsn,where twn is the duration of the nth interaction and tsn is the interval of the nth interaction.The more interaction times between nodes, the greater the proportion of interaction time, indicating that the interaction betweenvi and vj is more frequent. Therefore, the interaction frequency factor between vehicles is defined as
(9)ω1=Sumi,jSumi×eρ−1,where Sumi denotes the total number of interactions of vehicle vi before time t. Thus, the expression of friendship <Fre,Deg>i,j holds as follows
(10)<Fre,Deg>i,j=ω1<Mul,Fre,Deg>i,j+ω2<Con,Fre,Deg>i,j,where ω2 represents the weight of reference friendship and ω2=1−ω1.


## 4. Vehicle Clustering

To improve the transmission performance of VANETs, this section proposes a clustering algorithm based on friendship, which mainly includes three processes: dynamic cluster generation, cluster head selection, and dynamic cluster maintenance.


### 4.1. Cluster Generation

Because the vehicles in the same direction have similar speeds and have a relatively stable communication environment for a certain period, therefore, to maintain the stability of the cluster to the maximum extent and minimize the maintenance cost, the driving direction and speed of the vehicle are used as the basis for vehicle clustering.Firstly, the scene is established based on the two-dimensional coordinate axis. The position and speed of vehiclevi and vj at time t are, respectively, represented by xi,yi, Sit⟵Sixt,yiyt and xj,yj, Sjt⟵Sjxt,yjyt, the relative direction Oijt, and the relative distance Dijt.Direction is the primary considered factor in the proposed clustering algorithm. Att time, the relative direction between vehicle vi and vj is calculated as follows:
(11)Oi,jt=cosϑ=SitSjtSit∥Sjt=SixtSjxt+SiytSjytSix2t+Siy2tSjx2t+Sjy2t,where ϑ is the driving angle between vehicle vi and vehicle vj. When the value of ϑ is between −4/π,4/π, it means that the vehicles have the same driving direction and can generate clusters; otherwise, it indicates the opposite direction of travel and cannot generate clusters.The V2V communication in VANETs adopts DSRC technology, and its communication range is limited. Therefore, distance is the reference content of VANET clustering algorithm. Att time, the relative distance between vehicle vi and vj is
(12)Di,jt=xi−xj2+yi−yj2.It is necessary for vehiclevi and vj to form a cluster when Di,jt is in the DSRC transmission range. If Di,jt is beyond its range, vehicle vi and vj cannot form a cluster.


### 4.2. Selection of Cluster Head

To sum up, vehicle clustering is carried out concerning vehicle driving direction and speed, and the structure diagram of vehicle clustering is shown in Figure1.Figure 1
Vehicle cluster structure.Among them, ordinary vehicles can only participate in the interaction as service requester or service provider, and cluster head (with ordinary vehicle identity) is responsible for the maintenance and management of the blacklist of the cluster and the relay of intercluster communication.As mentioned earlier, cluster heads play an important role in the communication process of VANETs [24]. To ensure the high reliability of the leader and reduce the computing cost of the vehicle, we adopt the method of combining the friendship evaluation with the roadside unit- (RSU-) assisted selection of cluster heads.When selecting a cluster head, not only the friendship is calculated according to the interaction behavior but also the relative mobility of vehicles should be considered. The main reason of considering the relative mobility of vehicles instead of the driving speed is that the vehicles in VANETs are all moving. The relative mobilityRMi of vehicle vi can be calculated in the following [25]:
(13)RMi=1−1/n∑j=1nVi,j2Vmax,(14)Vi,j=Di,jT,where Vi,j denotes the relative speed between vi and vj and T denotes the time length of a cluster remaining duration. According to the above expression, the value of RMi is within the range [0,1]. The larger RMi of a cluster head holds, the more stability the cluster is.As mentioned above, vehicle-friendship conditions<Fre,Deg>i,j and RMi are two factors for selecting cluster heads. However, compared with the size of RMi, the friendly state <Fre,Deg>i,j of the vehicle has priority over RMi. The reason is that the stability of the cluster can be maintained not only by selecting the larger RMi but also by the subsequent cluster maintenance process. However, if the friendly vehicle is selected as Vhead, the probability of a malicious vehicle as Vhead will be increased accordingly, which will have an irreversible negative impact on network stability and security.Therefore, the specific process of selectingVhead is as follows: firstly, the friendship of vehicle vj is calculated and sent to RSU by cluster vehicle vi according to the friendship assessment proposed in section 2-B; then, RSU selects the most friendly vehicle as cluster head Vhead. If there are vehicles with the same friendship, Vhead is selected according to the size of RMi. Algorithm 1 describes how to select Vhead. According to Algorithm 1, each vehicle can calculate and report its friendship to other vehicles independently; as a result, the friendship value comparison among all the vehicles needs computation complexity On. Moreover, if there exist some vehicles with the same highest friendship evaluation, the cluster head is chosen by further comparing the relative mobility of those vehicles, the number of which (denoted by constant C) is far lower than n. In summary, the computation complexity of the cluster head selection holds as OnC.Algorithm 1: Optimal power allocation algorithm.
1: CalculateOi,jt⟵Equation (11), Di,jt⟵ Equation (12) to generate a cluster head2:if failed then3: return4: else5: vehiclevi and vj...vn are in the cluster6: calculate the friendship degree for all vehicles each other in the cluster by Equation (10) and sends them to RSU7:if the friendship degree of vi is the highest then8:  the vehiclevi is selected as cluster head9:else10:  calculate the mobility ofvi and vj11:if it still cannot select the cluster head then12:   return to the step 613:else14:   the mobility ofvi higher than vj15:   the vehiclevi is selected as cluster head16:end if17:end if18:end if


### 4.3. Maintenance of Dynamic Cluster

Due to the rapid movement of vehicles in the network, the vehicles in the cluster will leave continuously or the vehicles outside the cluster will join at any time, which leads to the change of the network topology of the cluster. Therefore, to maintain the relative stability of the cluster topology as far as possible and reduce the impact of the change of the vehicle cluster structure on the network performance, this section aims to formulate the corresponding dynamic cluster maintenance strategy to ensure the stability of the whole network as far as possible.Firstly, the departure of different types of vehicles in the cluster can be divided into the following two cases:(1)
If cluster head vehiclevhead wants to leave, the cluster will no longer exist(2)
If vehiclevi is ready to leave the current cluster, vi will first send the departure message to vhead, and then, vehicle vi can leave after vhead confirms. At the same time, vhead sends the message of vehicle vi leaving to the vehicles in the cluster to update the information in time. When vi leaves the region of the original cluster and enters the region of other clusters, that is, vi detects a new vhead′ instead of the original vhead, vi will join a new cluster as a cluster member or become a cluster head according to the cluster head selection processSecondly, the addition of vehicles outside the cluster can also be divided into the following three cases:(1)
If vehiclevj joins the network for the first time, it can use the supervision of neighbor vehicles and calculate the friendship according to Equation (10) as the friendship of vj(2)
If the vehiclevj moves from cluster C1 to cluster C2, in order to reduce the observation time, the behavior of vj in cluster C1, i.e., vhead−1 is the friendship issued by vj as the recommended friendship from vhead−1 to vhead−2, and the reference friendship of vhead−2 to C1 is calculated according to formula (7).In addition, according to the direct interaction history ofvhead−2 and vj, the interaction friendship of vhead−2 to vj is calculated by using formula (3). Furthermore, the friendship of vj in cluster C2 is calculated according to formula (10).It is worth noting that in the above two cases, if the calculated friendship to vehicles outside the cluster is lower than the average friendship in clusterC2, then vhead−2 will not be added to the cluster.
(3)
If two adjacent vehicle clusters merge, it is similar to reclustering, and a new cluster head needs to be reselected


## 4.1. Cluster Generation

Because the vehicles in the same direction have similar speeds and have a relatively stable communication environment for a certain period, therefore, to maintain the stability of the cluster to the maximum extent and minimize the maintenance cost, the driving direction and speed of the vehicle are used as the basis for vehicle clustering.Firstly, the scene is established based on the two-dimensional coordinate axis. The position and speed of vehiclevi and vj at time t are, respectively, represented by xi,yi, Sit⟵Sixt,yiyt and xj,yj, Sjt⟵Sjxt,yjyt, the relative direction Oijt, and the relative distance Dijt.Direction is the primary considered factor in the proposed clustering algorithm. Att time, the relative direction between vehicle vi and vj is calculated as follows:
(11)Oi,jt=cosϑ=SitSjtSit∥Sjt=SixtSjxt+SiytSjytSix2t+Siy2tSjx2t+Sjy2t,where ϑ is the driving angle between vehicle vi and vehicle vj. When the value of ϑ is between −4/π,4/π, it means that the vehicles have the same driving direction and can generate clusters; otherwise, it indicates the opposite direction of travel and cannot generate clusters.The V2V communication in VANETs adopts DSRC technology, and its communication range is limited. Therefore, distance is the reference content of VANET clustering algorithm. Att time, the relative distance between vehicle vi and vj is
(12)Di,jt=xi−xj2+yi−yj2.It is necessary for vehiclevi and vj to form a cluster when Di,jt is in the DSRC transmission range. If Di,jt is beyond its range, vehicle vi and vj cannot form a cluster.


## 4.2. Selection of Cluster Head

To sum up, vehicle clustering is carried out concerning vehicle driving direction and speed, and the structure diagram of vehicle clustering is shown in Figure1.Figure 1
Vehicle cluster structure.Among them, ordinary vehicles can only participate in the interaction as service requester or service provider, and cluster head (with ordinary vehicle identity) is responsible for the maintenance and management of the blacklist of the cluster and the relay of intercluster communication.As mentioned earlier, cluster heads play an important role in the communication process of VANETs [24]. To ensure the high reliability of the leader and reduce the computing cost of the vehicle, we adopt the method of combining the friendship evaluation with the roadside unit- (RSU-) assisted selection of cluster heads.When selecting a cluster head, not only the friendship is calculated according to the interaction behavior but also the relative mobility of vehicles should be considered. The main reason of considering the relative mobility of vehicles instead of the driving speed is that the vehicles in VANETs are all moving. The relative mobilityRMi of vehicle vi can be calculated in the following [25]:
(13)RMi=1−1/n∑j=1nVi,j2Vmax,(14)Vi,j=Di,jT,where Vi,j denotes the relative speed between vi and vj and T denotes the time length of a cluster remaining duration. According to the above expression, the value of RMi is within the range [0,1]. The larger RMi of a cluster head holds, the more stability the cluster is.As mentioned above, vehicle-friendship conditions<Fre,Deg>i,j and RMi are two factors for selecting cluster heads. However, compared with the size of RMi, the friendly state <Fre,Deg>i,j of the vehicle has priority over RMi. The reason is that the stability of the cluster can be maintained not only by selecting the larger RMi but also by the subsequent cluster maintenance process. However, if the friendly vehicle is selected as Vhead, the probability of a malicious vehicle as Vhead will be increased accordingly, which will have an irreversible negative impact on network stability and security.Therefore, the specific process of selectingVhead is as follows: firstly, the friendship of vehicle vj is calculated and sent to RSU by cluster vehicle vi according to the friendship assessment proposed in section 2-B; then, RSU selects the most friendly vehicle as cluster head Vhead. If there are vehicles with the same friendship, Vhead is selected according to the size of RMi. Algorithm 1 describes how to select Vhead. According to Algorithm 1, each vehicle can calculate and report its friendship to other vehicles independently; as a result, the friendship value comparison among all the vehicles needs computation complexity On. Moreover, if there exist some vehicles with the same highest friendship evaluation, the cluster head is chosen by further comparing the relative mobility of those vehicles, the number of which (denoted by constant C) is far lower than n. In summary, the computation complexity of the cluster head selection holds as OnC.Algorithm 1: Optimal power allocation algorithm.
1: CalculateOi,jt⟵Equation (11), Di,jt⟵ Equation (12) to generate a cluster head2:if failed then3: return4: else5: vehiclevi and vj...vn are in the cluster6: calculate the friendship degree for all vehicles each other in the cluster by Equation (10) and sends them to RSU7:if the friendship degree of vi is the highest then8:  the vehiclevi is selected as cluster head9:else10:  calculate the mobility ofvi and vj11:if it still cannot select the cluster head then12:   return to the step 613:else14:   the mobility ofvi higher than vj15:   the vehiclevi is selected as cluster head16:end if17:end if18:end if


## 4.3. Maintenance of Dynamic Cluster

Due to the rapid movement of vehicles in the network, the vehicles in the cluster will leave continuously or the vehicles outside the cluster will join at any time, which leads to the change of the network topology of the cluster. Therefore, to maintain the relative stability of the cluster topology as far as possible and reduce the impact of the change of the vehicle cluster structure on the network performance, this section aims to formulate the corresponding dynamic cluster maintenance strategy to ensure the stability of the whole network as far as possible.Firstly, the departure of different types of vehicles in the cluster can be divided into the following two cases:(1)
If cluster head vehiclevhead wants to leave, the cluster will no longer exist(2)
If vehiclevi is ready to leave the current cluster, vi will first send the departure message to vhead, and then, vehicle vi can leave after vhead confirms. At the same time, vhead sends the message of vehicle vi leaving to the vehicles in the cluster to update the information in time. When vi leaves the region of the original cluster and enters the region of other clusters, that is, vi detects a new vhead′ instead of the original vhead, vi will join a new cluster as a cluster member or become a cluster head according to the cluster head selection processSecondly, the addition of vehicles outside the cluster can also be divided into the following three cases:(1)
If vehiclevj joins the network for the first time, it can use the supervision of neighbor vehicles and calculate the friendship according to Equation (10) as the friendship of vj(2)
If the vehiclevj moves from cluster C1 to cluster C2, in order to reduce the observation time, the behavior of vj in cluster C1, i.e., vhead−1 is the friendship issued by vj as the recommended friendship from vhead−1 to vhead−2, and the reference friendship of vhead−2 to C1 is calculated according to formula (7).In addition, according to the direct interaction history ofvhead−2 and vj, the interaction friendship of vhead−2 to vj is calculated by using formula (3). Furthermore, the friendship of vj in cluster C2 is calculated according to formula (10).It is worth noting that in the above two cases, if the calculated friendship to vehicles outside the cluster is lower than the average friendship in clusterC2, then vhead−2 will not be added to the cluster.
(3)
If two adjacent vehicle clusters merge, it is similar to reclustering, and a new cluster head needs to be reselected


## 5. Secure Double Key Message Forwarding

Although the friendly degree management method can effectively solve the problem of network internal attack in the process of cluster head selection, it cannot prevent an external attack in the process of message sending. Therefore, we design a secure and effective message forwarding strategy based on vehicle clustering, which mainly includes communication key generation and cluster communication.


### 5.1. Communication Key Generation

For different communication objects, this section uses a dual key system composed of vehicle’s own key and cluster key [26]. Bilinear pairing is mainly used to generate key, and bilinear pairing is a way to realize identity based encryption. It defines three multiplicative cyclic groups G1, G2, and GT of order q; g1 and g2 are generators of G1 and G2, respectively, and defines a mapping relation e:G1×G2⟶GT on these three groups. At the same time, it is assumed that he/she is completely credible, and the public parameters g1,g2,G1,G2,GT of the system are published.As mentioned above, after the cluster head is generated, RSU will send the information in the cluster to him/her through the secure channel. Then, he/she selects a random numbersi∈Zn∗ for vi as its temporary private key and calculates the corresponding temporary public key Pi=g2si in a short time. Finally, he/she generates the cluster key keyc of the cluster through the corresponding private key si of each vehicle in the cluster and constructs the polynomial as follows:
(15)fcx=keyc+x−s1x−s2⋯x−sn,where i=1,2,⋯,n and n is the number of vehicles in the cluster. He/she sends the polynomial fcx to the corresponding vhead, and then, vhead sends fcx to the vehicles in the cluster. At this time, each vehicle (including vhead) in the cluster can calculate the cluster key fcx=keyc by substituting the private key si.However, considering that the cluster key will change with the change of cluster structure, and the same key is not suitable for long-term use, therefore, to protect the forward and backward security of the cluster, the double key should be transient and valid only when the cluster structure remains unchanged. Next, according to the cluster maintenance in section3-C, the corresponding cluster key management scheme is developed.When vehiclevi leaves, he/she needs to update the cluster key of cluster C and delete its corresponding polynomial factor x−si in polynomial fcx to protect the backward security of the cluster. Specifically, vhead sends the message that vi leaves the cluster and the original fcx to him/her at the same time, and then, he/she regenerates fc′x according to section 4-A.When vehiclevj joins, to protect the forward security of cluster C, he/she also needs to update the cluster key of cluster C. Contrary to the case of vehicle vi leaving cluster C, in this case, its corresponding polynomial factor x−sj needs to be added to the polynomial fcx so that vj can participate in the communication of cluster C. Similarly, vhead sends the message that vj joins the cluster with the original fcx to him/her at the same time, and then, he/she regenerates fc′x according to section 4-A. In the process of key update, to avoid excessive communication overhead caused by the key update, as long as cluster C exists, that is, vhead does not leave C, he/she does not need to update the key for the original vehicle, just update the cluster key.


### 5.2. Message Forwarding

Cluster communication process is divided into intercluster communication and intracluster communication. When two cluster headsvhead−1 and vhead−2 confirm the communication, they will encrypt the messages to be sent with each other’s public key, respectively. Take vhead−2 sending messages to vhead−1 as an example. vhead−2 encrypts the message M with vhead−1’s public key:
(16)EPhead−1PIDhead−2M,where M=ContentMDistanceMTimeM and ContentM represent the content of the forwarded message, respectively, DistanceM and TimeM represent the time and place of message M, respectively, Phead−1 is the public key of vhead−1 and PIDhead−2 is the pseudonym of vhead−2.After receiving the encrypted message fromvhead−2, cluster head vhead−1 decrypts the packet with its private key and uses the message:
(17)Dshead−1EPhead−1PIDhead−2M.Through intercluster communication, cluster headvhead−1 can obtain the specific content, time, and place of the message M from vhead−2. But at this time, only vhead−1 in cluster C1 gets the message, so in order to make other vehicles in the cluster get the message, vhead−1 has the responsibility to forward the message to the members in the cluster. Firstly, vhead−1 encrypts the message through the cluster key Keyc of cluster C1 and forwards it to the vehicles in the cluster:
(18)EkeycPIDhead−1M.After receiving the message fromvhead−1, the vehicles in cluster C1 can use keyc to decrypt the ciphertext to obtain the message M:
(19)Dshead−1EkeycPIDhead−1M.It can be seen that by using clustering technology, only cluster head vehicles are required to participate in message forwarding to ensure that multiple vehicles can obtain messages at the same time, to reduce the communication resource consumption of independent communication between vehicles.In addition, ifvhead−1 obtains a malicious message from the malicious cluster head vhead−2 and forwards it to the member vehicles in the cluster, once the vehicles in the cluster, including vhead−1 and the member vehicles in the cluster, recognize that the message is false or malicious, they need to send the result to other vehicles immediately. If the malicious message is found in the vehicle vhead−1, the warning message is sent to the member vehicles in the cluster C1 through the communication mode of the vehicles; if the vehicle that finds the malicious message is a cluster member vehicle, the cluster member vehicle forwards the warning message to the cluster head.


## 5.1. Communication Key Generation

For different communication objects, this section uses a dual key system composed of vehicle’s own key and cluster key [26]. Bilinear pairing is mainly used to generate key, and bilinear pairing is a way to realize identity based encryption. It defines three multiplicative cyclic groups G1, G2, and GT of order q; g1 and g2 are generators of G1 and G2, respectively, and defines a mapping relation e:G1×G2⟶GT on these three groups. At the same time, it is assumed that he/she is completely credible, and the public parameters g1,g2,G1,G2,GT of the system are published.As mentioned above, after the cluster head is generated, RSU will send the information in the cluster to him/her through the secure channel. Then, he/she selects a random numbersi∈Zn∗ for vi as its temporary private key and calculates the corresponding temporary public key Pi=g2si in a short time. Finally, he/she generates the cluster key keyc of the cluster through the corresponding private key si of each vehicle in the cluster and constructs the polynomial as follows:
(15)fcx=keyc+x−s1x−s2⋯x−sn,where i=1,2,⋯,n and n is the number of vehicles in the cluster. He/she sends the polynomial fcx to the corresponding vhead, and then, vhead sends fcx to the vehicles in the cluster. At this time, each vehicle (including vhead) in the cluster can calculate the cluster key fcx=keyc by substituting the private key si.However, considering that the cluster key will change with the change of cluster structure, and the same key is not suitable for long-term use, therefore, to protect the forward and backward security of the cluster, the double key should be transient and valid only when the cluster structure remains unchanged. Next, according to the cluster maintenance in section3-C, the corresponding cluster key management scheme is developed.When vehiclevi leaves, he/she needs to update the cluster key of cluster C and delete its corresponding polynomial factor x−si in polynomial fcx to protect the backward security of the cluster. Specifically, vhead sends the message that vi leaves the cluster and the original fcx to him/her at the same time, and then, he/she regenerates fc′x according to section 4-A.When vehiclevj joins, to protect the forward security of cluster C, he/she also needs to update the cluster key of cluster C. Contrary to the case of vehicle vi leaving cluster C, in this case, its corresponding polynomial factor x−sj needs to be added to the polynomial fcx so that vj can participate in the communication of cluster C. Similarly, vhead sends the message that vj joins the cluster with the original fcx to him/her at the same time, and then, he/she regenerates fc′x according to section 4-A. In the process of key update, to avoid excessive communication overhead caused by the key update, as long as cluster C exists, that is, vhead does not leave C, he/she does not need to update the key for the original vehicle, just update the cluster key.


## 5.2. Message Forwarding

Cluster communication process is divided into intercluster communication and intracluster communication. When two cluster headsvhead−1 and vhead−2 confirm the communication, they will encrypt the messages to be sent with each other’s public key, respectively. Take vhead−2 sending messages to vhead−1 as an example. vhead−2 encrypts the message M with vhead−1’s public key:
(16)EPhead−1PIDhead−2M,where M=ContentMDistanceMTimeM and ContentM represent the content of the forwarded message, respectively, DistanceM and TimeM represent the time and place of message M, respectively, Phead−1 is the public key of vhead−1 and PIDhead−2 is the pseudonym of vhead−2.After receiving the encrypted message fromvhead−2, cluster head vhead−1 decrypts the packet with its private key and uses the message:
(17)Dshead−1EPhead−1PIDhead−2M.Through intercluster communication, cluster headvhead−1 can obtain the specific content, time, and place of the message M from vhead−2. But at this time, only vhead−1 in cluster C1 gets the message, so in order to make other vehicles in the cluster get the message, vhead−1 has the responsibility to forward the message to the members in the cluster. Firstly, vhead−1 encrypts the message through the cluster key Keyc of cluster C1 and forwards it to the vehicles in the cluster:
(18)EkeycPIDhead−1M.After receiving the message fromvhead−1, the vehicles in cluster C1 can use keyc to decrypt the ciphertext to obtain the message M:
(19)Dshead−1EkeycPIDhead−1M.It can be seen that by using clustering technology, only cluster head vehicles are required to participate in message forwarding to ensure that multiple vehicles can obtain messages at the same time, to reduce the communication resource consumption of independent communication between vehicles.In addition, ifvhead−1 obtains a malicious message from the malicious cluster head vhead−2 and forwards it to the member vehicles in the cluster, once the vehicles in the cluster, including vhead−1 and the member vehicles in the cluster, recognize that the message is false or malicious, they need to send the result to other vehicles immediately. If the malicious message is found in the vehicle vhead−1, the warning message is sent to the member vehicles in the cluster C1 through the communication mode of the vehicles; if the vehicle that finds the malicious message is a cluster member vehicle, the cluster member vehicle forwards the warning message to the cluster head.


## 6. Simulation Results

In this section, the performance of the proposed strategy is validated through extensive simulations by NS2 software. To verify the effectiveness of the proposed FASMF algorithm, the proposed FASMF strategy is compared with NSTCM [20], SGC [19], and TJET [21] in terms of average message delivery rate, average message delay, and cluster stability. The simulation parameter settings are shown in Table 1.Table 1
Simulation parameter setting.
ParameterParameter valueNetwork aream23000×3500Number of vehicles50-450Vehicle moving modelSUMOVehicle speed (km/h)0-45Vehicle communication protocol802.11pVehicle communication modeDSRCInitial friendship0Simulation time (h)6


### 6.1. Influence of Vehicle Number on Network Performance

With the increase of the number of vehicles in the cluster, the average delivery rate, average delay, and cluster stability of FASMF strategy and NSTCM, SGC, and TJET are shown in Figures2, 3, and 4, respectively.Figure 2
Influence of vehicle number on the average delivery rate of messages in each mechanism.Figure 3
Influence of vehicle number on the average delay of messages in each mechanism.Figure 4
Influence of the number of vehicles on the average survival time of cluster heads.It can be seen from Figure2 that with the increase in the number of vehicles, the message delivery rates of the FASMF strategy and the other three strategies are on the rise. Although NSTCM uses encryption to protect the security of message transmission in VANETs, it uses the method of region division to form a cluster of vehicles in the region; the vehicles in the cluster still exist independently without any social relationship, resulting in the low overall message delivery rate. In addition, the FASMF strategy, SGC, and TJET strategy proposed in this paper contain the cluster head and the corresponding security policy and forward the message to the member vehicles in the cluster through the cluster head, so it has a high message delivery rate. However, the message delivery rate of the FASMF strategy is higher than that of the SGC and TJET strategies. The reason is that SGC and TJET strategies lack corresponding security measures for messages in the process of message transmission, and SGC lacks a corresponding cluster head selection process. TJET only selects cluster heads according to the front and rear positions of vehicles, so the latter two cannot guarantee the reliability of cluster heads. After the cluster head fails, the message cannot be delivered in time.Figure3 shows that as the number of vehicles increases, the average message delay of the four strategies is on the rise. The delay of the NSTCM strategy is the lowest, mainly because the vehicles in its encrypted area can communicate directly and reduce the communication time. Compared with SGC and TJET strategies, the FASMF strategy has a lower average delay. The main reason is that although FASMF uses double key message encryption transmission to increase its delay, because it uses friendship to select cluster heads, the calculation process of the double key scheme adopted in this paper is smaller, while SGC and TJET strategies both use more complex key schemes; at the same time, TJET uses the tree to manage vehicles in a distributed way, which results in the highest delay.In Figure4, with the increase of the number of vehicles in the network, the average lifetime of cluster heads of each strategy increases gradually, which indicates that the stability of clusters is positively correlated with the increase of the number of vehicles. However, the NSTCM strategy has no cluster head in the encrypted area and only uses the encryption algorithm to protect the security of the area. It cannot identify the attacker. Once the attacker enters the area and obtains the key, the security of the vehicle and communication in the area is threatened, so the network stability is the worst. In addition, the average survival time of cluster heads of the SGC strategy is longer than that of TJET. The main reason is that the vehicle tracking strategy is adopted in TJET, and the cluster head selection is determined only by the location of vehicles, so the stability of TJET is lower than SGC. Compared with the SGC strategy, the FASMF designed in this paper considers the factors of vehicle speed, direction, and so on in the process of cluster formation and uses the social friendship between vehicles to select the cluster head. If the friendship of new members is greater than the current cluster head, the FASMF will update the cluster head, so it has a better stability.


### 6.2. Influence of Vehicle Speed on Network Performance

In VANETs, the speed of vehicles not only affects the formation of vehicle clusters but also the fast mobility of vehicles affects the stability of vehicle clusters. The analysis of vehicle speed on the average delivery rate, message average delay, and network stability of the proposed FASMF strategy and NSTCM, SGC, and TJET strategies are shown in Figures5, 6, and 7, respectively.Figure 5
Influence of driving speed on average message delivery rate of each mechanism.Figure 6
Influence of driving speed on average message delay of each mechanism.Figure 7
Influence of driving speed on average survival time of cluster heads.As shown in Figure6, the average message delivery rate of the FASMF strategy, NSTCM strategy, SGC strategy, and TJET strategy decreases with the increase of vehicle speed. This is because the faster the vehicle speed is, the frequent interruption of communication links between vehicles increases the difficulty of message forwarding, and the average message delivery rate of the four schemes decreases. However, the FASMF strategy proposed in this paper involves reasonable cluster head selection, clustering, and cluster maintenance scheme, so compared with the other three strategies, the message delivery rate is higher.As shown in Figure7, with the increase of vehicle speed, the average message delay of FASMF, NSTCM, SGC, and TJET strategies increases in this paper. This is because the faster the driving speed is, the faster the relative relationship between vehicles will change, the easier the cluster head will be replaced by other vehicles, and more time will be consumed in cluster maintenance. In addition, the higher the vehicle speed, the lower the stability of the cluster, and the frequent interruption of the communication link will also lead to the increase of the average message delay. However, because of the physical factors such as relative location factors and relative speed, the FASMF strategy introduced in this paper has stronger cluster stability than the other three strategies, so the time delay is the lowest. NSTCM uses the method of regional encryption, so when the vehicle speed increases, it will generate more time only in the cross-region, so its delay is lower than the SGC and TJET strategies.As shown in Figure7, the average lifetime of cluster heads of FASMF, NSTCM, SGC, and TJET strategies shows an overall downward trend. The reason is that the topology of VANETs is greatly affected by vehicle speed. The increase of speed leads to frequent changes in the network topology of clusters, which makes it difficult to maintain the relative stability of clusters. The NSTCM strategy uses area encryption, and the vehicles in the area can communicate. Therefore, network stability is most affected by the increase of speed, and the increase of vehicle speed reduces the duration of vehicles in the region. In addition, the average time of cluster heads of SGC and TJET strategies is lower than the FASMF strategy proposed in this paper. This is because the FASMF strategy designed in this paper not only takes into account the mobility of vehicles but also takes into account the friendship of vehicles, so the cluster heads still have strong stability.


## 6.1. Influence of Vehicle Number on Network Performance

With the increase of the number of vehicles in the cluster, the average delivery rate, average delay, and cluster stability of FASMF strategy and NSTCM, SGC, and TJET are shown in Figures2, 3, and 4, respectively.Figure 2
Influence of vehicle number on the average delivery rate of messages in each mechanism.Figure 3
Influence of vehicle number on the average delay of messages in each mechanism.Figure 4
Influence of the number of vehicles on the average survival time of cluster heads.It can be seen from Figure2 that with the increase in the number of vehicles, the message delivery rates of the FASMF strategy and the other three strategies are on the rise. Although NSTCM uses encryption to protect the security of message transmission in VANETs, it uses the method of region division to form a cluster of vehicles in the region; the vehicles in the cluster still exist independently without any social relationship, resulting in the low overall message delivery rate. In addition, the FASMF strategy, SGC, and TJET strategy proposed in this paper contain the cluster head and the corresponding security policy and forward the message to the member vehicles in the cluster through the cluster head, so it has a high message delivery rate. However, the message delivery rate of the FASMF strategy is higher than that of the SGC and TJET strategies. The reason is that SGC and TJET strategies lack corresponding security measures for messages in the process of message transmission, and SGC lacks a corresponding cluster head selection process. TJET only selects cluster heads according to the front and rear positions of vehicles, so the latter two cannot guarantee the reliability of cluster heads. After the cluster head fails, the message cannot be delivered in time.Figure3 shows that as the number of vehicles increases, the average message delay of the four strategies is on the rise. The delay of the NSTCM strategy is the lowest, mainly because the vehicles in its encrypted area can communicate directly and reduce the communication time. Compared with SGC and TJET strategies, the FASMF strategy has a lower average delay. The main reason is that although FASMF uses double key message encryption transmission to increase its delay, because it uses friendship to select cluster heads, the calculation process of the double key scheme adopted in this paper is smaller, while SGC and TJET strategies both use more complex key schemes; at the same time, TJET uses the tree to manage vehicles in a distributed way, which results in the highest delay.In Figure4, with the increase of the number of vehicles in the network, the average lifetime of cluster heads of each strategy increases gradually, which indicates that the stability of clusters is positively correlated with the increase of the number of vehicles. However, the NSTCM strategy has no cluster head in the encrypted area and only uses the encryption algorithm to protect the security of the area. It cannot identify the attacker. Once the attacker enters the area and obtains the key, the security of the vehicle and communication in the area is threatened, so the network stability is the worst. In addition, the average survival time of cluster heads of the SGC strategy is longer than that of TJET. The main reason is that the vehicle tracking strategy is adopted in TJET, and the cluster head selection is determined only by the location of vehicles, so the stability of TJET is lower than SGC. Compared with the SGC strategy, the FASMF designed in this paper considers the factors of vehicle speed, direction, and so on in the process of cluster formation and uses the social friendship between vehicles to select the cluster head. If the friendship of new members is greater than the current cluster head, the FASMF will update the cluster head, so it has a better stability.


## 6.2. Influence of Vehicle Speed on Network Performance

In VANETs, the speed of vehicles not only affects the formation of vehicle clusters but also the fast mobility of vehicles affects the stability of vehicle clusters. The analysis of vehicle speed on the average delivery rate, message average delay, and network stability of the proposed FASMF strategy and NSTCM, SGC, and TJET strategies are shown in Figures5, 6, and 7, respectively.Figure 5
Influence of driving speed on average message delivery rate of each mechanism.Figure 6
Influence of driving speed on average message delay of each mechanism.Figure 7
Influence of driving speed on average survival time of cluster heads.As shown in Figure6, the average message delivery rate of the FASMF strategy, NSTCM strategy, SGC strategy, and TJET strategy decreases with the increase of vehicle speed. This is because the faster the vehicle speed is, the frequent interruption of communication links between vehicles increases the difficulty of message forwarding, and the average message delivery rate of the four schemes decreases. However, the FASMF strategy proposed in this paper involves reasonable cluster head selection, clustering, and cluster maintenance scheme, so compared with the other three strategies, the message delivery rate is higher.As shown in Figure7, with the increase of vehicle speed, the average message delay of FASMF, NSTCM, SGC, and TJET strategies increases in this paper. This is because the faster the driving speed is, the faster the relative relationship between vehicles will change, the easier the cluster head will be replaced by other vehicles, and more time will be consumed in cluster maintenance. In addition, the higher the vehicle speed, the lower the stability of the cluster, and the frequent interruption of the communication link will also lead to the increase of the average message delay. However, because of the physical factors such as relative location factors and relative speed, the FASMF strategy introduced in this paper has stronger cluster stability than the other three strategies, so the time delay is the lowest. NSTCM uses the method of regional encryption, so when the vehicle speed increases, it will generate more time only in the cross-region, so its delay is lower than the SGC and TJET strategies.As shown in Figure7, the average lifetime of cluster heads of FASMF, NSTCM, SGC, and TJET strategies shows an overall downward trend. The reason is that the topology of VANETs is greatly affected by vehicle speed. The increase of speed leads to frequent changes in the network topology of clusters, which makes it difficult to maintain the relative stability of clusters. The NSTCM strategy uses area encryption, and the vehicles in the area can communicate. Therefore, network stability is most affected by the increase of speed, and the increase of vehicle speed reduces the duration of vehicles in the region. In addition, the average time of cluster heads of SGC and TJET strategies is lower than the FASMF strategy proposed in this paper. This is because the FASMF strategy designed in this paper not only takes into account the mobility of vehicles but also takes into account the friendship of vehicles, so the cluster heads still have strong stability.


## 7. Conclusion

To enhance the security of VANET message forwarding process and improve the efficiency of message forwarding, we propose a VANET message forwarding mechanism with the dynamic evaluation of friendship by combining friendship evaluation and double key method. The vehicles on the road are divided into several clusters by clustering technology, and then, the vehicles in the cluster select the cluster head as the vehicle of intercluster communication according to the result of friendship evaluation and forward the message using message encryption. The results show that vehicle mobility as a factor of vehicle clustering can effectively improve the message delivery rate and reduce the message leakage rate, and the proposed strategy can effectively enhance the stability of the cluster topology.



---

*Source: 8302527-2021-12-20.xml*