Optimization of Maximum Routing Hop Count Parameter Based on Vehicle Density for VANET

Vehicular Ad Hoc Network (VANET) is the basic technology of intelligent transportation systems for providing reliable and realtime communications between vehicles and vehicles or roadside units. In order to improve the communication quality of VANET, this paper studies the effects of different maximum routing hop count parameters on the performance of the network under different vehicle densities. We establish the mathematical models of node connectivity probability and the packet delivery ratio by using the Poisson distribution model. And the maximum routing hop count selection algorithm (MRHSA) is proposed based on the theoretical model established in the paper. *e simulation experiments and statistical analysis on packet delivery ratio, throughput, and end-to-end delay are performed under the straight road and urban road scenes, supported by the Vehicle in Network Simulation (Veins). *e results show that the maximum routing hop count parameter is an important impact factor on the communication quality of the network. It is found that MRSHA proposed in this paper can improve the packet delivery ratio by about 9.1% at most in straight road scenarios, which indicates that MRHSA will contribute to the improvement of the communication quality of VANET.

with an optimal routing path selection policy, the maximum routing hop count setting still has a greater impact on the network. Large values may excessively increase routing overhead and network congestion and reduce network packet delivery ratio and reliability. Small values will lead to a lower routing success rate, which will also reduce the packet delivery ratio and reliability of the network [9,10]. e objective of this paper is to propose an optimal maximum routing hop count parameter setting method based on vehicle density, which can provide higher packet delivery ratio and throughput for the Internet of Vehicles (IoV) communication. By establishing the model of node connectivity probability and packet delivery ratio of the maximum routing hop count and vehicle density, the paper analyzes the growth rate of node connectivity probability and the reduction rate of packet delivery ratio caused by the increase of the maximum routing hop count under different vehicle densities. And, on this basis, the algorithm is proposed to find the near-optimal maximum routing hop count according to different vehicle densities. e rest of the paper is organized as follows. Section 2 discusses the related work in VANET routing protocols and vehicle density. In Section 3, we propose the node connectivity probability model and the packet delivery ratio model. Section 4 introduces the maximum routing hop count selection algorithm based vehicle density. Simulation results are showed and analyzed in Section 5. Finally, we conclude this paper and suggest future work in Section 6.

Related Work
Several traditional routing protocols in VANET come from Mobile Ad Hoc Network (MANET), including Ad Hoc On Demand Distance Vector (AODV) routing protocol based on network topology [11] and Greedy Perimeter Stateless Routing (GPSR) based on location information [12]. Reference [13] proposes a hybrid geographic routing protocol, which combines AODV and GPSR. e Geographic Source Routing (GSR) protocol calculates the forwarding path based on the location information of the vehicle on the map [14]. Vehicle-Assisted Data Delivery (VADD) uses predictable vehicle movement paths to calculate packet transmission delays and find the next route to forward packets [15]. It includes three different forwarding protocols: Location First Probe, Direction First Probe, and Hybrid-VADD.
Generally, different routing protocols have their own routing hop selection schemes. e AODV routing protocol uses a path with the smallest number of routing hops from the optional routing path to forward, and VADD selects the forwarding path with the lowest latency. Nabil et al. [16] improved Location-Aided Routing (LAR) by using vehicle location information and driving directions and estimated hold time of neighboring vehicles to increase routing lifetime. References [17] proposes a method called Long Lifetime Anypaths (LLA) to provide stable communication paths. It adds a stability index to anypath routing and selects neighboring vehicles with relatively stable distance for forwarding. In [18], robustness is defined as a qualitative QoS parameter of communication links that depends on link lifetime and error rate over the link. Modeling and quantification of link-robustness and route-robustness are carried out in that paper by synthesizing temporal, spatial, and environmental dependencies of the network. And, based on this, a routing selection strategy is proposed. However, from the studies above, we can find that the optimal setting of maximum routing hop count is not considered in the routing process. e density of nodes can make an important impact not only on traditional ad hoc networks but also on VANETs. A great number of studies have been conducted on the relationship between network connectivity and vehicle density [19][20][21][22]. Generally speaking, in the environment of high vehicle density, the connectivity probability between nodes is higher with a high network congestion probability. Conversely, the probability of network congestion is lower when the vehicle density is lower, but the connectivity probability between nodes also decreases [23,24].
Historical or real-time acquired vehicle density for routing strategy optimization is also used in some research. Reference [9] proposed Adaptive Connectivity Aware Routing (ACAR) protocol, using historical statistical vehicle density and real-time acquired vehicle density information to optimize the routing strategy to minimize the packet error ratio. An Intelligent Routing Protocol Using Real-Time Traffic Information in Urban Vehicular Environment (IRTIV) is proposed in [25]. It collects real-time traffic density through periodic Hello messages and calculates the weight of the road segment based on traffic density and Dijkstra algorithm and then selects the shortest transmission path with sufficient vehicle connection. However, it is difficult to find a forwarding path when traffic density is low. Wang et al. [26] proposed a Software-Defined Cognitive Routing (SDCoR) for Internet of Vehicles, which uses the software-defined network and reinforcement learning to perceive the environment (the environmental parameters of vehicle density and speed are mainly used in this paper) and designed the Q-learning based Cognitive Routing (QCR) algorithm to choose different routing strategy according to different environments.
Compared with the incremental fixed value of AODV and the fixed value of GPSR and VADD, based on the study of routing hops and vehicle density in the existing literature, this paper proposes dynamically adjusting the parameters of the maximum routing hop count of each communication node according to vehicle density. A more detailed comparison is shown in Table 1.

System Model
is section first introduces the multihop VANET system architecture and then establishes the theoretical models of node connection probability and packet delivery ratio. e advantages of multihop communication in VANET are reflected in two aspects. One is for V2I communication, and the other is for V2V communication. For the layout of RSU, if only single-hop communication is allowed, its layout density is required to be high. e two RSUs must be seamlessly connected to ensure that all vehicles are covered by the communication range of RSUs. However, if multihop communication is allowed, the layout density of the RSU can be relatively reduced. For example, the V A in Figure 1 is not within the communication range of RSU1 but can communicate with RSU1 through communication between V A and V E . On the other hand, for V2V communication, if the destination node is not within the communication range of the source node, single-hop communication cannot be completed, but multihop communication is possible. e setting of the maximum routing hop count parameter is of great significance in multihop VANET. Larger value usually increases the probability of connection between vehicle nodes, but it also increases the routing overhead and packet collision probability of the network. For example, in Figure 1, the source node V S needs to establish a communication link with the destination node V D . If the maximum routing hop count parameter is set to 1, the communication link cannot be established between the two nodes because the distance x between the two nodes is greater than the node communication distance R. When the maximum routing hop count parameter is set to 2, a possible communication link V S ⟶ V A ⟶ V D can be established. When it is set to 3, four possible communication links can be established, one of which is 2-hop communication: It can be seen intuitively that the appropriate value of the maximum routing hop count can increase the possibility of establishing a communication link. But this usually also increases the possibility of data packet collisions because large routing hops mean that more data packets will be transmitted in the network. erefore, we can increase the connection probability of the communication link by setting an appropriate maximum route hop value on the basis of not increasing network conflicts as much as possible; that is, find the balance between the connection probability and the collision probability.

Node Connectivity Probability Model.
Firstly, consider the relationships between node connectivity probability and maximum routing hop count (and vehicle density) in special scenarios. As shown in Figure 2, in a straight road with a length of L, the distance between the source node V 0 and the destination node V n is x, and the vehicle communication model is set to a Unit-disk model with a communication range of R, where R < x < 2R. A Cartesian coordinate system is established with the source node V 0 as the coordinate origin. Since the road width is short compared to the vehicle communication distance, the influence of the road width is ignored here.
According to the Unit-disk model, assuming that the communication radius of the vehicle is R, communication can be established as long as the distance between the two vehicles is less than R. e probability that communication can be established between two nodes can be expressed as where d is the distance between the two nodes.
For the convenience of analysis, it is assumed that the traffic flow distribution is subject to a Poisson distribution with a vehicle density of λ vehicles/kilometer [27]. en the probability that there are k vehicles distributed on the road with length x is  Mobile Information Systems According to the Poisson distribution model, there are λL vehicles in the section with length L, and there are λx vehicles between the source node and the destination node. Let K(R) be the number of vehicles located on the section with length R; then the probability of having at least one vehicle in R range is e vehicles in Figure 2 are numbered V 0 to V n from left to right. V i represents the ith vehicle node. Let the distance between neighbor nodes in the communication link be d i ; then d i � V i − V i− 1 ; that is, the distance between the ith vehicle and the (i − 1)th vehicle is d i . Among the vehicles V 0 to V n , d i is greater than R only when there is no vehicle node in the section of length R. erefore, according to (2), To ensure that the neighbor nodes can communicate, d i < R is required, that is, at least one vehicle in the length R section. e probability of d i < R is Let h be the routing hop count of communication link and let f(h � i) be the connectivity probability between the source node V 0 and destination node V n when the routing hop count equals i and let x i be the coordinate position of the relay node of the ith hop (the distance between the node of the ith hop and V 0 ), and x i < x, as shown in Figure 2. en we can get . . .
Similarly, the connectivity probability in the general scenario can be obtained as follows.
When ⌈x/R⌉ < 1 Let H be the maximum routing hop count set by the node; then the connection probability between the source node V S and the destination node V D when H � j is It is easy to see that the larger the value of the maximum routing hop count (or the greater the vehicle density), the greater the connection probability between the nodes.

Packet Delivery Ratio Model.
Packet delivery ratio refers to the ratio of the total number of successfully received packets to the total number of packets sent in the network, which can reflect the network communication quality intuitively. ere are two main reasons for packet transmission failures: data collisions and physical layer data errors.
Assume that each vehicle node transmits a data packet with an average probability τ in each packet duration (the continuous transmission time of a data packet). In practical applications, each vehicle usually has a different probability of packet transmission per packet duration. Here, we only consider τ as an approximate average:  Mobile Information Systems where s mean is the average packet duration, T mean is the average packet interval, and H mean is the average maximum routing hop count. Let the interference radius of the node be R; then 2λR vehicles exist in the bidirectional range 2R under the condition that the vehicle density is λ. erefore, there are two cases where no collision occurs within the same packet duration. One is that only one node in range R sends data packets and no other nodes send data packets. e other case is that all nodes in range R do not send data packets. e probability of the first situation is τ(1 − τ) 2λR− 1 , and the probability of the other situation is (1 − τ) 2λR . en the probability that the same packet duration does not collide within the radius R is en, the single-hop collision probability is P c � 1 − P n � 1 − (1 − τ) 2λR− 1 . Any one-hop communication collision in multihop communication is regarded as a collision of communication. Since the collision probability of each hop transmission is an independent probability event, the collision probability of h-hops is From [28], the SINR in the DSRC/IEEE 802.11p physical environment can be expressed as SINR � α · 10 log 10 C N + I , where α is the attenuation factor added in consideration of the effect of the cyclic prefix attached to each OFDM symbol, and here α � 0.8. N is the background noise and I is the sum of the surrounding vehicle interference. Assuming that the BPSK modulation method is used, its bit error rate (BER) can be expressed as where ) and erf(·) is the error function. en, for a data frame of length L bits, the frame error rate (FER) is P f � 1 − (1 − P b ) L . Considering the data retransmission mechanism of the link layer, the frame error rate can be corrected to where M is the number of retransmissions. Assuming that each packet consists of t frames, the physical layer transmission single-hop packet error rate is PER phy for a routing link with hop count h, the physical layer transmission packet error rate is erefore, considering the data collision probability and the packet error rate of the physical layer transmission, according to (11) and (15), the packet delivery ratio can be expressed as For the connection probability model, it can be seen from (8) that it is a summation mathematical probability model; that is, for a large maximum routing hop count, its connection probability includes the cumulative value of the connection probability of the smaller routing hop count. For example, when H � 4, the connection probability includes the summation of the connection probability of H � 1, 2, 3, 4. erefore, the greater the value of the maximum routing hop count, the greater the node connection probability. For the packet delivery ratio model, it can be seen from (16) that its relationship with the maximum routing hop count consists of two parts. e first part is the packet collision probability. Equation (11) shows that its relationship with the number of routing hops is an exponentially increasing function. e second part is the physical layer packet error rate, which can be seen from (15) as an incremental multiplication mathematical model. erefore, the greater the value of the maximum routing hop count, the smaller the success ratio of packet transmission.
rough the established theoretical model, the influence of vehicle density and maximum routing hop count on communication quality can be relatively intuitively reflected. Large maximum routing hop count and high vehicle density can not only increase the probability of connection between nodes, but also increase the transmission failure ratio of packets. is allows different maximum routing hop count to be set for different vehicle densities, which provides a theoretical basis for further optimization of the routing algorithm.

Maximum Routing Hop Count Selection Algorithm-Based Vehicle Density
According to the node connectivity probability model and the packet delivery ratio model proposed in the previous section, this section proposes the maximum routing hop count selection algorithm based vehicle density (MRHSA). From (7) and (8), the growth rate of node connectivity probability with the increase of maximum routing hop count is calculated as follows:

Mobile Information Systems
Let the exponential term − λ(2R − x + x i− 2 ) in (7) take its approximate mean value X and substitute it into the above formula: e impact of the increase in the routing hop count on the packet delivery ratio is mainly to increase the collision probability of the data packet but does not affect the transmission of the channel. erefore, we only consider the probability of packet collision here. According to (16), the packet delivery ratio model is simplified to From the above formula, the reduction rate of the packet delivery ratio as the routing hop count increases can be calculated: As in the GPSR, it is assumed that the position coordinates of the source vehicle and the destination vehicle can be acquired. Vehicle density can be obtained from beacon messages or obtained from historical statistics [29].
(1) e Euclidean distance is calculated from the locations of the source and destination vehicles, and then the minimum initial value H min � ⌈x/R⌉ of the maximum routing hop count is calculated. See line 5 of Algorithm 1. (2) To simplify the calculation, when the destination node is within the communication range of the source node (x < R), the maximum routing hop count is set to 2. In theory, one-hop communication is more reliable in the communication range. Setting the value to 2 here is mainly to prevent the vehicle from being at the maximum edge of the communication range. See lines 6 to 7 of Algorithm 1. (3) When the vehicle density is less than 1 vehicle/km, the maximum routing hop count is set to the maximum achievable value in the range of distance x; that is, H min + ⌈λx⌉. See lines 9 to 10 of Algorithm 1. (4) With H min as the initial value, the node connectivity probability and the packet delivery ratio are iteratively calculated until the growth rate of the connectivity probability is less than the rate of decline rate of the packet delivery ratio. After the iterative calculation is completed, the value of H is returned. See lines 11 to 17 of Algorithm 1 where σ in line 16 is the weighting factor to balance the preference for packet delivery ratio and connection probability and its value range is (0-1).
e process of the MRHSA is described in detail in Algorithm 1. is algorithm consumes insignificant computing power because the number of iterations is limited (mostly less than 20).

Simulation and Results
is section presents the simulation and analysis results of the MRHSA in the AODV routing protocol under the Vehicle in Network Simulation (Veins). e MRHSA was evaluated in terms of average packet delivery ratio, throughput, and average end-to-end delay.

Simulation Setup.
e Veins simulation platform integrates the OMNET++ network simulator and the SUMO road traffic simulator to provide an open source simulation architecture for VANET simulation [30]. is section first establishes a two-way four-lane straight road simulation scene with a length of 5 km, which can also be used to represent highway scenes. Because the vehicle density distribution on the straight road is simple, it can intuitively reflect the influence of the maximum routing hop count parameter on the communication index under different vehicle densities. en the simulation experiment is extended to the general urban scene, and the real-time simulation data of the urban road area of 2500 m × 2500 m is analyzed. is paper focuses on the impact of the maximum routing hop count and vehicle density on communication indicators in the same road environment. e environmental differences between straight road scenes and urban road scenes can be further studied in further work.
As shown in Table 2, the physical layer and mac layer of the simulation parameters use the 802.11p standard, the network layer uses the AODV routing protocol, and the application layer uses the UdpApp protocol. e vehicle speed in the urban area is set to 30-60 km/h, and the vehicle speed in the high-speed public area is set to 60-200 km/h. In order to simulate a real vehicle model, four different vehicle types are set in the SUMO environment, including different settings for parameters such as maximum vehicle speed, vehicle acceleration, vehicle deceleration, vehicle length, following model, and driver behavior. In addition, the simulation time of the straight road scene is set to 300 s, and the simulation time of the urban scene is set to 600 s.
According to the Wireless Access in Vehicular Environment (WAVE) standard file, the main parameters of the physical layer and the MAC layer are shown in Table 3. e communication range of each vehicle node is set to 300 m and the bitrate is 6 Mbps. For the MAC layer, each access time slot is set to 16 μs, the maximum queue length is set to 14, and the maximum number of repeated accesses is set to 7. e application layer periodically transmits a packet at a random time of (0-5)s after the vehicle enters the road, and the transmission interval is (3)(4)(5)(6)(7)(8)s. e transmission destination address is randomly selected from existing vehicle nodes in the road. Both the address and the packet are in Ipv4 format. e size of each packet is 512 bytes. In order to achieve a reproducible randomness experimental study, the same set of data in the same scenario uses the same random number seed, and the average of the data of four different random number seeds is taken as the final simulation data.

Simulation Results.
During the simulation, the vehicle density is controlled by controlling the vehicle depart rate λ of each lane (the probability of departing the vehicle per second, taking the value 0-1). e corresponding values of λ and vehicle density for the straight road scenario are shown in Table 4. Figure 3 shows the packet delivery ratio for different vehicle densities and different maximum routing hop count. MRHSA dynamically adjusts the maximum routing hop count based on vehicle density, with the rest set to a fixed value. It can be seen that the maximum routing hop count set to 20 in the experiment for the straight road scenario is too large for the packet delivery ratio because its packet delivery ratio is smaller than the packet delivery ratio of maximum routing hop count of 10 when the vehicle depart rate is 0.1-1.0. e performance of packet delivery ratio with a maximum routing hop count of 5 gradually improves with the increase of vehicle density, and its performance at the vehicle depart rates of 0.7 and 1.0 exceeds the performance of the maximum routing hop count of 10. is verifies the theory in the third section that when the vehicle density is low, the larger maximum routing hop count can increase the packet delivery ratio by increasing the connection probability; but when the vehicle density is high, the larger maximum routing hop count will reduce the packet delivery ratio by increasing the data collision probability. e whole performance of the MRHSA algorithm presented in the previous section is better than setting the maximum routing hop count to a fixed value. During the simulation, MRHSA improved the packet delivery ratio by about 9.1% at most. As the vehicle density increases, the spacing between the MRHSA curve and other curves increases, which indicates that MRHSA has a more obvious optimization effect on packet delivery ratio when vehicle density is large. It can also be observed that, as the vehicle density increases, the value of the packet delivery ratio decreases overall. is is because we set all the vehicle nodes to send messages periodically during the simulation process. As the density of vehicles increases, the number of packets (1) Notations; (2) X S : source vehicle location; X D : destination vehicle location; λ: vehicle density; (3) τ: average packet transmission probability. H: output of maximum routing hop count (4) Initialization; (5) x � sqrt (X S − X D ) 2 ; H min � ⌈x/R⌉; H � H min ; (6) if H min <� 1 then (7) return H � 2; (8) else then (9) if (λ < 1) then (10) return H � H min + ⌈λx⌉; (11) else then (12) repeat (13) calculate P con (H) and P success (H) with (8) and (19); (14) calculate Growth (H) and Reduction (H) with (18) and (20); (15) H++; (16) until σ * Growth (H) >� (1 − σ) * Reduction (H) (17) return H; (18)     transmitted in the network increases, and the collision probability of packets increases. As shown in Figure 4, the throughput performance of MRHSA is optimal, and, as the vehicle density increases, the optimization effect of MRHSA on throughput is gradually enhanced. e throughput for maximum routing hop count of 10 or 20 is higher than the throughput for maximum routing hop count of 5 at λ � 0.1 to 0.5, but their throughput growth rate is lower than the latter after λ > 0.5. e increase of vehicle density and maximum routing hop count can increase the number of packets in the network and thus increase the network throughput. However, when the vehicle density and the maximum routing hop count are both large, serious data collisions will occur, which will reduce the growth rate of throughput.
As shown in Figure 5, the end-to-end delay increases overall as the vehicle density and maximum routing hop count increase. is is mainly caused by two aspects: one is the increase of delay caused by the increase of average routing hops; the other is the increase of access delay caused by data congestion. e end-to-end delay curve of MRHSA fluctuates greatly, which is related to the average routing hops in the actual transmission process. According to different vehicle densities, MRHSA algorithm provides the possibility of larger forwarding hops on the premise of minimizing unnecessary congestion. It should be noted that this paper does not optimize for the end-to-end delay, only analyzing its relationship with the maximum routing hop count and vehicle density. e density of vehicles in urban scenes is difficult to control accurately during the simulation, so we recorded the   number of real-time vehicles in the simulation to analyze the real-time data of the simulation process, as shown in Figure 6. Since the amount of data in real-time simulation is too large, we have done a window batch average and exponential moving average processing for the packet delivery ratio for the convenience of observation, as shown in Figure 7.
Before about 280s, that is, when the number of vehicles is less than 190, the larger the maximum routing hop count is, the better the packet delivery ratio will be. After that, the packet delivery ratio with a maximum routing hop count of 10 is better than the packet delivery ratio with a maximum routing hop count of 20. When the number of vehicles reaches the maximum between 330s and 450s, all packet delivery ratio curves decrease with a large slope, except for the packet delivery ratio curve with the maximum routing hop count of 5. Because the packet delivery ratio with a maximum routing hop count of 5 is originally small, and it causes less data collision when the vehicle density is very large. Except for the first 50 seconds, MRHSA's performance is always optimal. In the first 50 seconds of the simulation, the number of vehicles is small and the position of the vehicle entering the simulation area is scattered, so accurate vehicle density cannot be obtained.
Real-time throughput data have a large value range, so we recorded the average throughput per 100 seconds for the convenience of observation, as shown in Figure 8. Real-time end-to-end delay data fluctuate greatly with time; so also for ease of observation, the end-to-end delay data are averaged per 100 seconds, as shown in Figure 9. As can be seen from the figure, the relationships between the maximum routing hop count and throughput (and end-to-end delay) under urban road scenes are similar to the straight road scenes.

Conclusions
e effects of choosing different maximum routing hop count parameters on network performance under different vehicle densities are studied in this paper. Firstly, the connectivity probability model and the packet delivery ratio model related to the maximum routing hop count and vehicle density are established. en, on the basis of the theoretical model established in this paper, MRHSA is proposed.
rough simulation experiments on straight road scenes and urban scenes, we verify that the larger maximum routing hop count will reduce network performance when the vehicle density is high. Meanwhile, the improvement of network performance by MRHSA algorithm is also evaluated. MRHSA has a more obvious optimization effect on packet delivery ratio and throughput when vehicle density is large. In the straight road scenario, MRHSA can improve the packet delivery ratio by about 9.1% at most. In the future work, the MRHSA algorithm can be integrated into the routing strategy to further improve the transmission performance of the network.

Conflicts of Interest
e authors declare that there are no conflicts of interest regarding the publication of this paper.