Genetic Algorithm Based QoS Perception Routing Protocol for VANETs

. A genetic algorithm (GA) based QoS perception routing protocol (GABR) is proposed to guarantee the quality of service (QoS) influenced by broken links between vehicles and the failure of packets transmission in a vehicular ad hoc network (VANET). With theobservationthatallimprovablepathsareprobedbytheintersectionbasedroutingprotocol,thegeneticGAisutilizedtooptimize theglobalavailablepathswhichsatisfiestheQoSrequirement.Moreover,bymeansofthenumericalresults,itisshownthatthe proposedschemeissignificantlyimprovedcomparedwithprotocolsoftheintersectionbasedrouting(IBR)andconnectivityaware routing(CAR)intermsoftransmissiondelayandpacketlossrate.


Introduction
Recently, vehicular ad hoc networks (VANETs) has been widely considered as a new class of mobile ad hoc networks since it serves as an important part in intelligent transportation systems (ITS). Following the traffic rules, the vehicles can move along the roads in the VANETs. Specifically, the network topology has shown the ability to dynamically change the diversity of roads, different velocities, and densities of vehicles. With the cooperation of the wireless communication devices, the vehicles can communicate with each other in VANETs [1,2], which is exhibited as the vehicle to vehicle (V2V) and/or the vehicle to infrastructure communication architectures (V2X).
Classically, routing protocols can be classified into two categories: the topology based routing protocols and the routing protocols based on geographical location information. By taking into account the complicated topological structure, for the topology based routing protocol, it makes routing decisions by using the topology information of network, which may lead to the broken links between vehicles. On the other hand, the routing protocols based on geographical location information require data communications to obtain the vehicle positions via global position system (GPS).
Based on which, it is clear that the second routing protocol characterizes a superiority for varied VANETs [3,4]. Unfortunately, even the position based routing protocols have received considerable interest in the VANETs, it is up against many potential challenges, i.e., the latency of real-time capabilities, position accuracy, huge overhead, and increased cost of applications. For instance, in connectivity aware routing protocols, source node explores paths by broadcasting messages to obtain a fixed routing path, which is unable to deal with frequent changes of topology in VANETs [5]. Particularly, considering the real-time road conditions for the intersections selection, the packets delivering in the intersections are dependent on the direction of other vehicles, which causes packets lose for the connectivity of the roads [6]. The improved greedy traffic aware routing protocols (GyTAR) combine the density and direction of vehicles and local street conditions for routing decisions. Without taking the global information into account, it will result in network partitions in the process of delivering packets [7].
Due to the improvement of QoS performance [8][9][10] as the goal of optimizing routing paths, some articles consider to apply genetic algorithms (GAs) to enhance the performance of routing protocols. Reference [11] presented the destination sequenced distance vector routing protocol using GA in 2 Wireless Communications and Mobile Computing VANET, which is a kind of the topology based routing protocol and uses a fitness function to evaluate the solution, then simulation result analysis showed the QoS of DSDV with GA is better than the simple DSDV scheme. The authors in [12] considered the ad hoc on-demand distance vector routing protocol through genetic algorithm, which aims to find the optimal path from the source to destination and increase the throughput of AODV, where the simulation results illustrated that the proposed algorithm significantly improves the QoS compared to the simple one with satisfactory efficiency.
In this paper, to further enhance the QoS performance of location based routing protocols in urban environment for VANETs, an efficient GA is applied to optimize the routing path between source and destination nodes. The connectivity model and the delay model are also analyzed to estimate the average delay, where the road segment is divided into several blocks. Moreover, the IBR protocol is also employed to explore possible paths between sources and destinations. Based on that, the proposed genetic algorithm optimizes routing paths which subjects to the fitness function switched by the objective function with parallelism, where an initial population composed of multiple solutions is considered. It is worth noting that the genetic operations, i.e., selection, crossover, and mutation, are disposed with certain probabilities that reinforce the flexibility of the searching process [13,14]. With this observation, for our proposed GA, the obtained results undergo genetic operations which support the following search. From the numerical results, it is shown that, compared with the IBR and CAR protocols, the proposed GABR protocol scheme outperforms significantly in terms of packets transmission delay and packet loss rate.
The rest of this paper is organized as follows. Section 2 describes the GABR algorithm. In Section 3, it shows investigation for GABR. Analysis of the QoS model for the proposed scheme is presented in Section 4. Section 5 shows the excellent performance of our proposed scheme compared with the existing works. Section 6 concludes this paper.

GABR Algorithm
2.1. QoS Model. One example of urban street is shown in Figure 1, in which four intersections ( 1 ∼ 4 ) are considered. Due to the forward delay and connectivity between multiple links on the two-way lane, the road segment model is designed. Therefore, for each road segment, traffic conditions are randomly distributed. In the proposed system, the following assumptions are considered:   In this paper, QoS model is split into two parts: the connectivity model and delay model. Particularly, the road segment is also divided into several rectangular blocks with the length and width of each block as , where = 0.7 and two-lane road width is used to accurately analyze the QoS [1].

Connectivity Probability Model.
In order to study the exact connectivity model for a two-lane road as shown in Figure 2, the distance between two consecutive vehicles on the eastbound lane is compared with . By this way, the link between two consecutive vehicles is connected and packets are delivered directly with the condition ≤ ; otherwise, the packets are out of scope which can not be forwarded directly. Owing to the cooperation of the auxiliary vehicle in the westbound block, the broken link is possible to be repaired regarding .
Without loss of generality, further assume that is a random variable denoting the number of vehicles in each block which follows the Poisson distribution with Probability Mass Function (PMF) as where denotes the vehicle density on a road segment lane. Since the distance between any two consecutive vehicles obeys the exponential distribution [16], the corresponding probability of a broken link between two vehicles on the eastbound lane can be expressed as with 1 as the vehicle density on eastbound lane.

Transmission Delay Model.
Following traffic rules in the urban environment, vehicles move into clusters, where the

Packet delivering direction Westbound
Eastbound Figure 2: Distribution of road vehicles.

Connected situation 1 Connected situation 2
Broken link link between two consecutive vehicles is connected in each cluster. On account of the cluster size, there are two kind situations of vehicles moving: (i) Road segment with partly connected (PC): as shown in Figure 3, packets can be forwarded to the furthest vehicles within communication range as next-hop node by utilizing greedy algorithm on the connected road segment. On the contrary, packets on the broken segment can use carry-forward mechanism. (ii) Road segment with absolutely connected (AC): as shown in Figure 4, packets can be delivered by hop to hop with greedy algorithm between two intersections.

Genetic Algorithm.
It is well known that GA is a random search method based on the evolution rule of biology (survival of the fittest), which was first proposed by J. Holland in 1975 to optimize the complete NP problems [17]. The genetic algorithm imitates the process of natural selection (NS), in which NS means a central concept of evolution: some organisms have traits that will make it more likely that the organism survives long enough to reproduce. It is likely that these traits will be passed on to the next generation, which is also named survival of the fittest. For a simple description, genetic algorithm can be seen as a simulation in which a population of abstract representations (called chromosomes or the phenotype of the genome, after their biological counterparts) of candidate solutions (called individuals, creatures, or phenotypes) to an optimization problem. Since that genetic algorithms are randomized search and optimization techniques guided by the principles of evolution and natural genetics, having a large amount of implicit parallelism. Therefore, genetic algorithms are part of the broader class of evolutionary algorithms that can be applied to the optimization of complex algorithms, the training of text classification systems, and the evolution of intelligent artificial agents in stochastic environments. With these observations, genetic algorithms perform search in complex, large, and multimodal landscapes and provide near-optimal solutions for objective or fitness function of an optimization problem. Figure 5 depicts the basic module process of GA [18], which is illustrated in detail as follows: (i) The first step to develop a GA for an optimization problem is to represent it. Therefore, the solution is in the form of a string of bits which consists of the same number of element. (ii) An initial population is normally generated randomly which should be spread over enough of the search space to represent as wide a variety of solutions as possible. (iii) The selection allows strings to be copied for possible inclusion in the next generation, where the standard for the selection is that of the fitness of all individuals. (iv) The crossover is applied to two chromosomes and creates two new chromosomes by selecting a random position. (v) Selection and crossover alone can generate a staggering amount of differing strings.
(vi) The stopping criterion can be set by the number of evolution cycles, the amount of variation of individuals between different generations, or a predefined value of fitness.

Routing Exploration.
In this paper, the proposed protocol is based on IBR with GA, and vehicles are equipped with GPS and navigation system. Adopting traffic information to predict the vehicle moving direction, GABR protocol selects the next-hop intersection dynamically. Meanwhile, vehicles utilize carry-forward strategy to deliver packets on the road segment. The proposed routing exploration integrates locating destinations with finding connected paths between source and destination. It means that, to gather the available information along the routes, the source vehicle broadcasts the request packets to the destination. After receiving the request packets, accordingly, the destination confirms the best routing path which will be replied to the source.

Genetic Operations.
In this subsection, the main flow chart of our proposed routing algorithm with GA is introduced as shown in Figure 6. To begin with, all improvable paths are probed by IBR. Subsequently, genetic algorithm is utilized in the global optimization of available paths to acquire the path with optimal QoS. All available paths are optimized by GA repeatedly with five steps to find optimal QoS path, which are shown as follows.
(a) Code: a given route between the source and destination nodes is equal to an individual, i.e., the serial number sequence of intersections of the route is a chromosome, which can be encoded directly. Therefore, this coding scheme avoids the route circulation due to that the variation length of the (c) Selection: the pros and cons of individuals depend on the fitness value in GA, where the fitness value represents the QoS performance. With the increasing fitness, the QoS performance should be also correspondingly improved. An individual has more fitness value, which means that the  individual is excellent and the corresponding path is optimal. Therefore, the fitness function can be expressed as follows: where and ℎ denote the connectivity probability and average delay of -th individual and and are weight parameters with { , } ∈ [0, 1], respectively.
In this step, we propose to combine the optimal strategical selection and roulette wheel selection to rank all paths. Before each pair of chromosome crossing, the optimal individual replaces the worst one and becomes an offspring individual according to the fitness value. Then, the rest of the population uses the roulette wheel method, where the individual with higher fitness value is selected by greater probability.
(d) Crossover: crossover operator is used to exchange the subpath of two individuals. As shown in Figure 7, 1 and 2 paths are selected as parents. These alternative crossing positions should be randomly selected as the crossing sites, which are both in parents. Remarkably, two new offspring, 1 and 2 , take shapes after exchanging all nodes and the crossing site.
(e) Mutation: mutation operator is applied to the randomly select the solution from the population, which is with small random changes in the solution. We further consider that the node selected randomly from for mutation is called mutation node. The operation details in Figure 8 can be summarized as follows.
Step 1. Select a node from the neighbors of mutation node .
Step 2. Generate two random paths ( 1 , 2 ) from the source node to node and from node to destination node, respectively.
Step 3. If there is a duplication nodes in 1 , 2 , discard the path, and do not perform mutation on it; otherwise, these two routes are connected with each other to form a new mutated chromosome .
Step 4. Repeat the process of the selection, crossover, and mutation until reaching the maximum number of iterations or the route paths are optimized.

Analysis of QoS Model
In this section, in order to characterize the superiority of our proposed scheme, we analyze the performance of the proposed scenario in terms of the connectivity probability and the transmission delay.  Figure 2, two consecutive vehicles and +1 on the eastbound lane are disconnected due to the distance > . Using the vehicles on the opposite lane, the broken link between and +1 can be repaired by the vehicles ( , +1 ). Clearly, the corresponding probability for a broken link between and +1 can be expressed as

Analysis of Connectivity Probability. As shown in
where stands for the number of vehicles on the eastbound lane. When = broken links exist among − 1 links on the lane, the Probability Mass Function ( = ) follows the binomial distribution which is given as From (6), it is easy to see that, for the case of at least one broken link existing on the eastbound lane ( ≥ 1), the connectivity probability of the road segment can be expressed as On the other hand, when there is no broken link on the eastbound lane, i.e., all cells are occupied by at least one vehicle, the connectivity probability of the road segment is given as

Analysis of Transmission Delay.
In this section, the transmission delay of PC and AC will be analyzed which have been mentioned in Section 2. Figure 3, the road segment transmission delay is given as

Road Segment with Partly Connected (PC). From
where and (V) denote the road segment length and the average data packets transmission speed on the road segment, respectively.
With the assistance of vehicles on the westbound lane, there are alternating periods of disconnection and connectivity on the eastbound lane. In the disconnection phase, data packets are carried by a forwarding vehicle with vehicle speed V 1 until next neighboring vehicle to be connected. In the connection phase, data packets are propagated at wireless transmission speed V 1,ℎ , which can be represented as where is the one-hop transmission delay [19].
Referring to the alternating renewal process theorem as shown in [20], the long-run probability of data transmission time spent in disconnected phase is given as where , , , , and , , , , respectively, indicate the data packets travelling time and the distances in the disconnected and connected phases. For the connected phase, the probability is deduced as , = , , + , Comprehensivizing (11), (12), and (13), we have Further substituting (14) back into (13), the road segment transmission delay can be obtained as (a) Disconnected Phase. As shown in Figure 3, the forwarding vehicle and the next consecutive vehicle +1 on the eastbound lane are disconnected due to the distance > . With this observation, the data packets are carried by vehicle until the connectivity between and the neighbor vehicle is set up.
The corresponding distance on the westbound lane between and +1 is connected, i.e., ⌊ / ⌋ consecutive blocks are occupied by at least one vehicle. Therefore, the number of blocks traversed by is given as Wireless Communications and Mobile Computing 7 where = 1 − − 2 denotes the probability that each block has at least one vehicle on the westbound lane. The link between and +1 is broken if at least one block on the westbound lane is vacant along the gap , for > . The disconnection probability between and +1 is given as follows: Noting that the probability density function (PDF) of the vehicles on the eastbound lane ( ) = 1 − 1 , the disconnection probability can be expressed as Based on which, the average distance of data transmission in disconnected phase is given as Substituting (16)-(18) back into (19), the final expression of , can be obtained.
(b) Connected Phase. In the connected phase, vehicles are connected with each other and data packets are transmitted at the speed V 1,ℎ . The transmission distance is divided into two parts.
In the first part, as shown in Figure 3, consecutive eastbound vehicles are connected if the distance between them is no more than , and/or even if the distance is greater than , each westbound block within the distance is occupied by at least one vehicle. In this case, the expected transmission distance between two consecutive vehicles on the eastbound lane is obtained as If , which is a slack value, consecutive links on the eastbound lane are connected, the transmission distance covered is ⋅ E( | ). Therefore, the average transmission distance is shown as follows: In the second equality, if the gap in the disconnected phase is repaired by the vehicles on the westbound lane successfully, the distance is also traversed by data packets with the speed V 1,ℎ . As shown in Figure 3, with the movement of vehicles, the vacant blocks between and +1 will be occupied by the vehicles in connected situation 2, and data packets can then be forwarded hop by hop when going through these blocks. Meanwhile, the average distance between and +1 is deduced as Particularly, in terms of the above investigation, the average distance of data transmission in partly connected phase is obtained as Substituting (21) and (22) back into (24), , can be deduced and the road segment delay can be finally obtained from (15), (19), and (24). Figure 4, all links are connected and data packets are delivered by hop and hop greedy algorithm, so the transmission delay between adjacent intersections and is given as

Road Segment with Absolutely Connected (AC). As shown in
where = ⌈ / ⌉ and present the number of hops in the road segment and the transmission delay of one hop, respectively. According to above analysis, the average transmission delay between two adjacent intersections and is deduced as follows: where ( , ) means the connectivity probability of the road segment. transmission delay on the road segment, respectively. As shown in Figure 9, the average delay is given as a function of communication range and the vehicle density in a twolane scenario. In this scenario, the vehicle speed V 1 = 10 m/s and V 2 = 25 m/s, the road segment length = 2000 m, and vehicle density 1 = 2 = , respectively. With vehicle density 1 = {0.01, 0.02, 0.03, 0.04} vehicles/m, we can deduce these rules as follows: (1) increased communication range has low average delay with the constant vehicle density; (2) high vehicle density has low average delay with the fixed communication range. In Figure 10, the average delay is shown as a function of the number of vehicles and length  From the figure, we observe that the fast vehicles have lower average delay with the same vehicle density and that more vehicles get low average delay in two-lane road segment with the same vehicle speed. In addition, it also shows the variation trend between the average delay and different variables.

Simulation Results
In this section, we examine the performance of our proposed GABR protocol with IBR and CAR [5], where the simulation scenario is urban road, and simulation parameters are given in Table 1. GABR provides the lowest transmission delay compared with IBR and CAR. In the case of CAR, which cannot adopt rapid topology changes, it results in slow packets transmission. IBR is based on intersection routing protocol but cannot consider vehicles density, which results in high transmission delay. The proposed routing protocol divides the road into several blocks and analyzes average delay by considering the connectivity, and it can utilize GA to find the optimal route paths. Figure 13 shows that the packets delivery ratio as a function of number of vehicles on the road segment. It is found that more vehicles can significantly reduce the loss of packets. It is clear that the GABR provides better performance of delivering packets when compared with the other two protocols. Specifically, GABR obtains real-time traffic information, divides roads into several blocks, and analyzes road connectivity to select next-hop intersection dynamically. Moreover, the proposed scheme uses GA to optimize routes for successful delivery of packets. In the case of IBR, packets may be lost because of ignoring road connectivity. It is pointed out that CAR is based on source node routing protocol but cannot deal with protean topology changes, which results frequent loss of packets.

Conclusions
In this paper, a genetic algorithm based QoS perception routing protocol, namely, GABR is proposed for VANETs, where each improvable path is probed by IBR protocol and road segments are divided into several blocks. In our proposed scheme, vehicles between two adjacent intersections utilized greedy carry-forward algorithm to deliver packets. In addition, genetic algorithm is employed to find the path with optimal QoS in the global available paths. The simulation results validated that GABR protocol is superior to the IBR and CAR protocols in terms of packets transmission delay and the packet loss rate. However, it is worth noting that our proposed scheme is complex to program in GA, and the speed of searching is slower. In our future work, we will focus on combining genetic algorithm with other heuristic bionic algorithms to speed up the optimization.

Data Availability
The simulation code and data used to support the findings of this study are available from the corresponding author upon request.