Data Dissemination in VANETs Using Particle Swarm Optimization

A vehicular Ad-Hoc Network (VANET) is a type of Mobile Ad-Hoc Networks (MANETs) that uses wireless routers inside each vehicle to act as a node. The need for effective solutions to urban traffic congestion issues has increased recently due to the growing number of automobile connections in the car communications system. To ensure a high level of service and avoid unsafe situations brought on by congestion or a broadcast storm, data dissemination in a VANET network requires an effective approach. Effective multi-objective optimization methods are required to tackle this because of the implied competing nature of multi-metric approaches. A meta-heuristic technique with a high level of solution interactions can handle efficient optimization. To accomplish this, a meta-heuristic search algorithm particle optimization was chosen. In this paper, we have created a network consisting of vehicles as nodes. The aim is to send emergency messages immediately to the stationary nodes. The normal messages will be sent to the FIFO queue. To send these messages to a destination node, multiple routes were found using Time delay-based Multipath Routing (TMR) method, and to find the optimal and secure path Particle Swarm Optimization (PSO) is used. Our method is compared with different optimization methods such as Ant Colony Optimization (ACO), Firefly Optimization (FFO), and Enhanced Flying Ant Colony Optimization (EFACO). Significant improvements in terms of throughput and packet loss ratio, reduced end-to-end delay, rounding overhead ratio, and the energy consumption are revealed by the experimental results.


Introduction
The vehicular ad hoc network (VANET) is a variant of a mobile ad hoc network (MANET) that uses wireless network technologies to design communication for message flow between adjacent vehicles to vehicles (V2V), vehicles to roadside infrastructures (V2I), and through vehicle-to-vehicle (V2V) and vehicle-to-infrastructure (V2I) connectivity [1]. Vehicular networks have emerged in recent years as a possible data communication option for intelligent transportation systems. The mobility of cars, however, is one of the elements that have a considerable impact on the architecture of these networks. Furthermore, because different vehicles have unique mobility characteristics in urban settings, it becomes much more complicated [2]. In this regard, it is crucial to make use of knowledge of these vehicles' movement to offer strong solutions and a variety of applications [3].
Accidents and delays in transportation have become inevitable due to the rapidly increasing number of cars, the over-saturation of the transportation infrastructure, and traffic congestion. VANET has been exhibited as a promising solution that can boost a driver's awareness and provides vehicles with tremendous up-to-date information to prevent accidents and traffic congestion [4]. These systems allow for the construction of several applications that, by utilizing data shared across road agents, empower entities (such as drivers) to make more informed decisions, either manually or automatically [5].
VANET Architecture is made up of highly mobile vehicles called nodes that have sensors called On-Board Units (OBU), which are specialized dedicated sensors. Sensors gather data from stationary Road Side Units (RSU) or other moving vehicles and transmit it directly to other cars or indirectly by passing it to RSUs. Passengers can travel safely and comfortably thanks to VANET. These nodes in VANETs are fitted with sensors that gather data in real-time and transmit it to other moving vehicles or stationary RSUs. The basic structure of a VANET is made up of groups of stationary or moving cars connected via wireless and processing capabilities to create a dynamic vehicular network while traveling on highways. It primarily offers car nodes decentralized data communication. These networks' primary goals are to support traffic monitoring systems and sustain network effectiveness by enhancing data communication procedures and wireless communication channel performance. The fundamental VANET components, the several forms of communication that can occur between VANET nodes, and the benefits of employing VANET in ITS are all briefly covered in the sections that follow [5].
The main and basic applications of VANETs that enable the enhancement of the efficiency and safety of contemporary transportation systems are those related to safety, commerce, convenience, and productive applications [6,7].
Designing a trustworthy message dissemination protocol that can deliver effective message dissemination, especially for safety-related applications, is a difficult task on the VANET. Network connectivity, which ensures that a message from one car can be forwarded to reach all vehicles in the network, is necessary for the creation of an efficient dissemination protocol [8].
As the VANET network grows, security and privacy problems must be effectively handled. The VANET architecture is susceptible to numerous assaults, including protocol tunneling, eavesdropping, the disclosure of personal information, phony messages that clog up traffic, and the unlawful use of sensitive data [9]. VANETs' primary goals are to increase road safety, significantly reduce the number of accidents, and boost safety through emergency warnings. These apps unquestionably avert accidents by giving drivers forewarning. Emergency braking, post-crash alerts, real-time traffic, traffic violation warnings, road hazard control alerts, cooperative message transfer, pre-crash sensing, and cooperative collision warning are the main safety applications.
To make the most of the road's capacity and avoid traffic jams, the driver should be given the information necessary to make decisions and secure the journey. The general goal of convenience applications, such as navigation, active prediction, personal routing, road congestion advice, electronic toll collection, parking availability information, road congestion management, etc., is to manage traffic more conveniently for drivers to increase efficiency. These apps make it possible to prevent traffic issues and maintain a steady flow of traffic.
VANET experts are always attempting to reduce data redundancy to increase the scalability of data dissemination. To overcome scaling issues and create reliable and strong intelligent transportation networks, novel ways of assessing traffic density are required [10]. Despite a plethora of suggestions and the development of communication technology, exact algorithms cannot solve the routing problem in VANETs in polynomial time. Numerous mathematical and computational methodologies have employed optimization as a solution to different engineering problems. A crucial computational strategy in optimization is meta-heuristic optimization. It has the strength and efficiency to find the best solutions since it makes use of the hardware processing capability and incorporates a heuristic search for solutions. The ant bee colony algorithm, the firefly algorithm, particle swarm optimization, harmony search optimization, and heterogeneous computing task scheduling using improved harmony search optimization are a few examples of these heuristic solutions [10].
In this paper, we utilize the Particle Swarm Optimization (PSO) method [11] to optimize the routes returned by the Time delay-based Multipath Routing (TMR) mechanism proposed in [12]. An optimized route is selected for data communication between vehicles in VANETs, particularly in case of emergency incidents. PSO uses the fitness values of the vehicles (particles) to calculate the best route among all of the TMR routes pool. PSO offers better solutions with little parameterization, which is its fundamental advantage. The PSO method is based on velocity rather than only position.
The following are the main contributions of this work: • To create an effective data dissemination technique for broadcasting in the VANET; • To create a new appliance for VANET broadcasting that will increase the packet delivery ratio; • To improve the fitness function and improve the selection of better-optimized solutions in VANET broadcasting by using the Particle Swarm optimization technique.
The rest of the paper is arranged as follows: A survey on a literature review is covered in Section 2. Section 3 explains the proposed protocol. The methodology is shown in Section 4. The performance metrics are explained in Section 5. Section 6 has the experimental results. Lastly, the conclusions are provided in Section 7.

Particle Swarm Optimization
In [13], authors have explained how clusters arise. Nodes that had been attacked were displayed in the Certificate Revocation List (CRL). Before transmission for secure communication, each node is verified by the Certificate Authority (CA). Following validation, the data are sent from the source node through the best path to the destination node. Utilizing the upgraded OLSR routing protocol, the path was created. PSO is utilized for the best MPR (Multi-point relay) selection. According to the simulation results, the network's energy efficiency increased when the suggested OLSR-PSO routing technique is used. However, the overhead cost is a challenge in this method where the validation process consumes the network resources in terms of bandwidth and time.
In [14], authors have introduced a two-stage multi-swarm particle swarm optimizer (TMPSO), which makes use of the multi-swarm approach and uses two separate search strategies during all iterations. Unconstrained TMPSO (uTMPSO) and constrained TMPSO (cTMPSO) global optimizations are the two versions of this novel optimizer. The cTMPSO version of the uTMPSO, which replaces the conventional penalty function method, is further improved to handle the constraints by using the trial and error method. Constraint violations are checked on each newly created particle in the aforementioned uTMPSO procedures, and the violating ones are forced to execute "retreat" operations, return to the feasible region, and recreate new positions. However, this method is multi-swarm which requires more processing time than the individual-swarm optimization technique.
The conventional particle swarm optimization process, according to their explanation, will prematurely stagnate as a result of the particle diversity limit and will thereafter reach a local optimum. In [15], authors suggested an optimization approach for particle swarms based on a particle swarm factor selection strategy (FPSO) to address the aforementioned drawbacks. Different parameter selection procedures are used at different phases of the particle swarm search process to enhance the capability of the global search. The outcomes of the simulation demonstrate how effective and better the strategy is at resolving complicated problem optimization. The algorithm's accuracy over time for high-dimensional test functions stays high. FPSO enhances the average optimization effect; however, it runs longer than the traditional PSO due to the factor selection technique. To enhance the FPSO in terms of the optima convergence, particle population should be enlarged using optimization techniques such as mutation [16].
In [17], the authors propose a large-scale bi-level particle swarm optimization algorithm that expands the particle swarm scale and improves the initial population diversity based on multi-particle swarms. This algorithm is targeted at the slow convergence and the local optimum problems of PSO. A bi-level particle swarm's structural benefits, on the other hand, allow this method to increase the operating efficiency of particle swarms by allowing the upper-level particle swarm to give decision-making information while the lower-level working particle swarms operate concurrently. The large-scale bi-level particle swarm optimization approach has been shown through simulated trials to provide satisfactory optimization results. However, the stability of the algorithm keeps changing in terms of data throughput.
In [18], an easy particle was suggested, which is motivated by the effect of a lazy ant in the ant colony for PSO to address the constraint issue in Nonlinear Constrained Optimization (NCO) problems. The easy particle is very convenient to embed in the current PSO-based techniques. The proposed easy particle, which is unrestrained by social and cognitive characteristics and exhibits lazy ant behavior, can overcome constraint containment to improve the possibility of exploring uncharted territory. The experiments demonstrate that the suggested simple particles integrated into the referred algorithms can successfully reduce premature convergence, thereby greatly enhancing NCO problem performance. Refreshing the number of simple particles as needed sounds like a wise course of action.
The PSOR routing protocol is proposed in [19], and it uses the vehicle's distance and speed to locate the next forwarding vehicle. PSOR is proven to perform efficiently, particularly when compared with AntHocNet and Adaptive QoS-based Routing for VANETs (AQRV). However, they are not considering highway scenarios where vehicle nodes have high speeds.
The study in [20] focuses on using an efficient system to distribute tasks among vehicles based on position and velocity. With PSO, each vehicle is used more efficiently, resulting in higher average resource utilization. However, this method did not consider the fair load distribution among the vehicles so some are overloaded while others would stay idle.
The algorithm presented in [21,22] is a hybrid metaheuristic optimization algorithm that combines the Particle Filter (PF) and Particle Swarm Optimization (PSO) algorithms. The new Particle Filter-Particle Swarm Optimization (PF-PSO) algorithm is applied to the optimal tuning of Proportional-Integral-fuzzy controllers for the position control of a family of integral-type servo systems. However, energy consumption is augmented due to the fuzzy control system operation, and this accordingly reduces the lifespan of the vehicle nodes.

Data Dissemination
The virtual representation of Data dissemination in the Vehicular Ad-Hoc network is displayed in Figure 1. In [23], it is explored how to best choose which vehicle to inject data into, when to do so, and whether to have the vehicle collect the required data directly from the edge or adjacent neighbors to reduce edge traffic costs and satisfy data acquisition deadlines. The current methodology gives priority to choosing V2I dissemination first before exploring V2V dissemination that does not clash with V2I dissemination. This method falls short of fully utilizing V2V to lower edge traffic costs. The authors have proposed a new data dissemination algorithm, called the offline algorithm for hybrid data dissemination (OFDD), which seeks the most beneficial V2V broadcasts with priority, and then chooses feasible V2I dissemination. Based on OFDD, both the snapshot and prediction-based online algorithms were developed. However, the performance of the vehicle densities and data request load is affected by this method.
In [24], the authors proposed an Efficient multi-directional Data Dissemination Protocol (EDDP), which considers the requirements of an urban vehicular environment without requiring the extra communication overhead. Simple local data only were used to indicate the road condition for better dissemination performance. In their proposal, the design is considering urban layout including message format, broadcast suppression mechanism, and delay control. The EDDP utilizes the properties of the received messages along with positioning information to make decisions on suppressing broadcasts, and to improve coverage in different directions without unnecessary transmissions. EDDP can effectively disseminate traffic data with a high data delivery ratio and a minimized overhead. However, and in terms of coverage, data redundancy, and dissemination latency, EDDP did not address the broadcast storm problem with various layout considerations.
In [25], the authors have proposed a novel unmanned aerial vehicle (UAV)-enabled scheduling protocol consisting of a proactive caching policy and a file-sharing strategy in V2X networks to empower the efficiency of data dissemination. In the proactive caching process, it was suggested to deploy UAVs as flying base stations (BSs) with caching capability. A UAV dynamic trajectory scheduling (DTS) algorithm was introduced to optimize the caching duration. However, in the file sharing strategy, based on the previous vehicular caching status, this model provides a framework of file sharing cycle for data dissemination scheduling and employs a channel prediction algorithm to alleviate communication overhead. Moreover, this method proposes a relay ordering algorithm to effectively improve the file-sharing process. However, with increasing the number of vehicles, the throughput is reduced obviously, and this can lead to low stability for dissemination problems.
In [26], the authors considered a cognitive unmanned aerial vehicle (UAV) to disseminate data to a group of Internet of Things (IoT) devices. The cognitive UAV shares the wireless spectrums of primary users (PUs) where it accesses the spectrums opportunistically when the corresponding channels are available. The UAV predicts the OFF periods of the PU; then, it decides the number of consecutive transmission slots to be used for data transmission. To protect the PUs from harmful interference, the number of slots used for transmission should not exceed a certain threshold. The formulated problem is in a form of a mixed integer nonlinear program (MINLP). Therefore, a successive convex approximation-based algorithm was proposed to solve this problem after approximating it to a convex problem. However, topology change would degrade the network performance.
In [27], the authors introduced a novel approach known as Named Data Networking (NDN). It enables scalable, efficient, and secure data distribution for a variety of applications. NDN is a data-centric communication protocol that combines content naming, name-based routing and forwarding, in-network caching, and data-centric security. It is based on simple and effective working principles. This method aims to present a multilayered framework as a multiple-phase systematic approach for designing an efficient VANET-NDN data dissemination scheme. However, the network performance in terms of throughput and latency is not that high.
In [28], a Travel Angle-based Fast Data Dissemination to Relevant Vehicles (TAFDRV) protocol was proposed to control the direction of data dissemination. The design goal of this protocol is to distribute information among relevant vehicles. However, the information may not be equally relevant for all vehicles in the scenario, and this will lead to network congestion.
In [29], it was proposed a MultiCriteria-based Relay Election Protocol for Data Dissemination in Urban VANETs (MCRE-DDP). The most relevant relay node is chosen based on several parameters such as Signal Noise Ratio (SNR), vehicle speed, and distance between sender and receiver to determine the node's quality and ability to successfully relay the dissemination message. Relevant relays prevent the communication system from multiple sending and guarantee the appropriate message delivery. However, the rounding overhead ratio is comparatively high as more packets are required for network maintenance.
In [30], for efficiently distributing deadline-sensitive streaming files in VANETs, a mechanism (dubbed TDDV) for disseminating timely P2P segments is proposed. This mechanism enhances the QoS performance; however, the high mobility speed of nodes is not tolerated.

Problem Statement
The data dissemination is a promising application for VANETs. Most existing data dissemination strategies typically rely on a random-access protocol, which leads to a collision problem that cannot be avoided. Another issue is the risk of delay, which is not meeting the real-time restrictions on managing an emergency. Hence, the logic of data dissemination must be accurate and checks if all the requirements of efficient delivery are met. This includes reducing data collisions, preventing bottlenecks, and minimizing the overhead cost, and this should be made possible under time limitations. Data dissemination requires the assurance of optimal routes for delivering messages to their destinations within a certain time interval. The most difficult components of this challenge are assumed to be the different features of optimization in data dissemination, its relationship to the dynamics of message generation and vehicle mobility, as well as the fact of topological change. Thus, to solve this problem, the integration of different optimized models is required.

Proposed Solution
To address the problem of data dissemination in VANETs, we introduce an optimization technique based on PSO while using the TMR routing technique [12]. Instead of selecting the road with the fewest hops, TMR selects the path with the lowest RTT. The second shortest RTT path is utilized to transfer data messages if the first one fails. When evaluating a potential route, the average TMR establishes a threshold value that restricts a measured instant RTT. When RTT or node speed is high, this average RTT is set to prevent overburdening the network with data packets. This protocol is designed to differentiate the normal and emergency messages. Emergency messages are delivered without delay, whereas normal messages are queued and delivered using the TMR protocol. We propose to optimize TMR routes using PSO to transfer the message from the source to the destination with a low delivery delay time because the velocity and the position are considered. In PSO, particles (vehicles) can converge quickly to the best positions. PSO has a fast convergence speed in finding the global optimum for uni-modal and simple multi-modal problems. Particles are easily trapped into local minima when solving complex multi-modal problems. As a result, all particles will rapidly converge to the local optimum. Finally, premature convergence takes place. This paper embeds neighborhood search strategies in standard PSO to improve its performance in solving complex problems.

Network Configuration
In the scenario depicted in Figure 2, we considered a situation in which data communication occurs between OBUs and the RSU close to it in one road segment [31]. The study's objective in this scenario is to evaluate the effectiveness of each protocol within a road segment. The stationary nodes, such as hospitals and fire stations, are the destination node for the emergency message transfer.

Methodology
In this paper, the PSO technique is used for fast searching and optimization. For a better understanding of our proposed protocol, we first explain to the network model as follows: The series of vehicles in a network is denoted as X = x 1 , x 2 , . . . , x n , where n is the maximum number of vehicles in the network. The vehicles' velocity is denoted as V = v 1 , v 2 , . . . , v n . The position of the vehicles is referred as D i = d i1 , d i2 , . . . , d in . To find the best solutions, the PSO algorithm [32] uses velocity to change (evolution) a particle's position. The most frequent way to control particle velocity is to multiply it by a factor. A is the array of routes returned by TMR. Every particle has a unique velocity and position, which are first established at random. The pbest, or local best position, and gbest, or global best position, of every particle, must be maintained.
The virtual representation of the flowchart is given in Figure 3: • We start with n vehicle nodes, some RSUs and OBUs connected in the same network. The message forwarding process between RSU and OBUs occurs when the vehicles are moving in the same area zone. • These messages are divided into two parts which can be distinguished by their weights. If the weight = 1, then it is the emergency message which needs immediate assistance. Source or destination ends may be mobile nodes which are referred to as OBUs. On the other hand, the messages with weight = 0 will directly transfer to the FIFO queue for further data transmission. For these message transmissions, multiple routes were found using TMR [12]. • Vehicles send both routine and urgent communications to RSUs, which then transmit them to other vehicles [33]. In the case of unicast communication, TMR, which is a multipath routing technique based on Round Trip Time (RTT), is utilized, and it is primarily concerned with cutting down the end-to-end time delay. • We assume that the initial position and velocity can be determined using the following equations: Each node that joins the network should announce its v i . PSO is applied on routes returned by TMR. For each TMR's route, node i will send hello messages to its neighbor nodes j recorded in the TMR routes. T ij is the time between one node and its neighbor node. Therefore, the Euclidean distance between nodes i and j, for a given route, can be calculated as: where v j is the velocity of the neighbor vehicle j compared to previous node i. Alternatively, inter-distance between nodes can be calculated as in [34]. Hence, the best position (pbest) between one node and its adjacent l node in a given route out of k TMR routes is: The pbest is calculated with the maximum distance between the source node and the nodes in a given TMR route to consider the closest node to the destination vehicle/RSU.
From one iteration to the next, a swarm of particles (nodes) updates their relative positions, giving the PSO algorithm the boost it needs to properly search. Each particle advances toward its previous personal best position (pbest) to achieve the best result. • The optimization function is defined in terms of fitness function (FF). This FF is computed to determine the next forwarding vehicle that uses parameters such as the position of the vehicle, its velocity, and distance to its adjacent vehicle. The source node finds the adjacent node closer to the destination, and its fitness value is determined. The adjacent vehicle having the highest fitness value is selected as the next forwarding node and the packet is forwarded to it. The process is repeated iteratively for all TMR routes until the packet reaches the destination node [35]. The fitness function is calculated for each vehicle according to its position and velocity. FF is represented in Equation (3) given below [36]: where w 1 , w 2 are the weights, l is the number of all nodes in each TMR's route, and i, j are two adjacent nodes. Each particle is considered as a vehicle where its position d and velocity v are updated using Equations (4) and (5), respectively: where t stands for the iteration index representing each TMR's route. In other words, d(t + 1) is the updated position of the previous position at d(t) and similarly for velocity v(t + 1). w, c 1 , c 2 are acceleration coefficients. Acceleration coefficients are critical parameters of the PSO algorithm, which is used to control vehicles' movement by modifying its cognitive and social components. r 1 , r 2 are random uniform numbers in between 0 and 1, pbest is at the previous position d(t) of the vehicle (local best) and gbest is the pbest at the updated position d(t + 1) of vehicle (global best) [37]. Algorithm 1 shows our mechanism which is explained as follows: 1.
The routes were given using TMR as input to look for the best solution.

2.
Every vehicle has its distinct position (quality of solution) and velocity.

3.
Each vehicle selects the best position and uses the velocity of the vehicle to move towards a new best position. The adjustment of the position to the global optimum is made feasible using the best position of individuals and the whole swarm. 4.
At each iteration, each vehicle updates its velocity and position. 5.
For each vehicle, the fitness value of each vehicle is computed and compared with the fitness value in the memory. If the current fitness value is greater, then it acts as a global optimum. 6.
The procedure stops after the last iteration. The best solution is considered the global best. 7.
A vehicle with the maximum global optimum is the next forwarding node and the packet is forwarded towards it. 8.

Simulation Parameters
The parameters and their values are shown in Table 1. Throughput of the VANET has successfully received packets in terms of Mbps. Mathematically throughput can be represented as [38]: where T represents the throughput, S P is the number of successfully transmitted packets, and T L is simulation time.

Rounding Overhead
It denotes the number of routing packets that must be broadcasted for route discovery and route maintenance to deliver data packets [39]. It can be represented as: where RO represents routing overhead, R p represents the number of routing packets, and D p represents the number of data packets sent.

Packet Delivery Ratio
It is calculated by dividing the number of successfully delivered data packets by the total number of data packets generated [39]. It can be expressed mathematically as: where PDR represents Packet Delivery Ratio, PR is the total data packets received successfully, and PG is the total data packets generated.

End to End Delay
The total time spent by the network in a memory buffer, waiting in a queue, packet retransmission, and packet propagation is referred to as End to End Delay. In other words, delay can be represented as the difference in time stamps between packet arrival and transmission [40]. Delay can be represented mathematically as: where E2E represents the End-to-End Delay, PD is the total time taken by the packets to be successfully delivered since sent out, and n is the total number of packets received.

Energy Consumption
The amount of energy consumed by each vehicle node during packet transmission is referred to as energy consumption. It is the difference between the vehicle node's initial and current energy [40]: where EC represents Energy Consumption.

Gain/Savings
To understand better about gain and savings of our proposed protocol PSO compared with other protocols which are ACO, FFO, and EFACO is calculated using the below equation [41]: where x 1i is the performance value of our protocol; x 2i is the performance value of other protocols; ∑ is the summation over the range from i = 1 to the number of x-axis points of the metric y.

Experimental Results
Here, we compare our proposed method PSO method with three other methods which are Firefly Optimization (FFO) [42], Ant Colony Optimization (ACO) [43], and Enhanced Flying Ant Colony Optimization (EFACO) [44] in a VANET network. Figure 4 depicts the effect of varying simulation time on the throughput. As the simulation time progresses, the data traffic enlarges in the network. Therefore, the packet loss probability increases which in turn reduces the throughput for all protocols. However, our protocol has a higher performance than other protocols. Figure 5 presents results with the assumption of having faulty nodes in the selected route. When the faulty nodes are present, it becomes harder for the algorithms to progress with the same flow. More packets will be dropped when the number of faulty nodes increases and that, in turn, would degrade the throughput. Here, we have taken three scenarios as 5%, 10%, 15% faulty nodes out of 100 nodes. From the results, it is clear that PSO performs better in comparison to other optimization methods. In addition, we can see that the EFACO method is better than ACO.   Figure 6 shows the throughput with various mobility speeds of nodes. Nodes having high speeds would result in topological change and packet drops. Accordingly, the throughput degrades with the mobility speed. Our protocol considers the node's speeds where data will be forwarded to those nodes having the close speed to the forwarding node. As a result, our protocol outperforms ACO, FFO, and EFACO with 67.4%, 130.61%, and 54.97%, respectively, as shown in Table 2.

Throughput
The number of nodes is assumed 100 as indicated in Table 1. This in turn increases the population and hence the optima convergence is reached with a weak stagnation possibility. Accordingly, the throughput is stable as shown in the above figures.

End to End Delay
Results in Figures 7 and 8 represent the performance of End-to-End delay comparing other optimization methods. It is clear that our proposed method PSO is giving better performance because it uses a reliable route so the amount of successfully delivered data n in Equation (9) is augmented and accordingly end-to-end delay is reduced. PSO reduces the delay with 15.03%, 23.22%, and 12.69%, compared to ACO, FFO, and EFACO, respectively, as shown in Table 3.
In case of having faulty nodes or vehicles with high speeds, topological change occurs frequently and this in turn reduces the performance of the network due to a higher chance of link failure. Some of the packets are lost and, therefore, retransmissions will augment the end-to-end delay as shown in Figures 9 and 10.

Packet Delivery Ratio
As the simulation time progresses or the density of nodes augments, more data packets overwhelm the network, and this in turn would result in data loss and more data retransmissions triggered. Accordingly, the performance degrades as shown in Figures 11 and 12. Our mechanism considers the least node's velocity and the closest nodes to the destination, and this as a result would minimize the possibility of packet drops. PSO enhances the PDR with 16.81%, 54.49%, and 10.39%, compared to ACO, FFO, and EFACO, respectively, as shown in Table 4.   Table 4. Packet Delivery Ratio in (%) in Figure 11. PSO  ACO  FFO  EFACO   10  98  75  70  80  20  97  78  67  82  30  95  79  64  83  40  93  82  58  84  50  90  78  57  85  60  85  75  56  82  70  83  74  55  81  80  84  73  54  80  90  88  77

Rounding Overhead
As the vehicle density increases or simulation time progresses, more data packets are transferred through the network. This as a result would lead to more data drops. Accordingly, the need for new routes will augment requiring an excessive amount of control messages (RREQ/RREP) to seek new routes and this in turn increases the routing overhead as shown in Figures 13 and 14.

Energy Consumption
When the number of vehicles increases, more packets travel through the network as indicated earlier. As a result, the possibility of data loss augments and retransmissions are triggered, and this will consume more energy. Our mechanism selects the most reliable route in which it will reduce the retransmission rate and this lessens the energy consumption as shown in Figure 15. PSO saves the energy with 8.46%, 28.87%, and 43.72%, compared to ACO, FFO, and EFACO, respectively, as shown in Table 5.

Conclusions
Vehicular Ad hoc Networks (VANETs) have a wide range of applications requiring secure and efficient data dissemination. Because of the time-varying topology and frequent path disconnections of vehicular communication, a mechanism to provide a reliable path for data transmission from source to destination is probed. In this paper, we propose a routing mechanism that utilizes the time delay-based multipath routing (TMR) method. We apply the particle swarm optimization technique on the routes returned by TMR to select the best reliable path. This method provides stable routes to disseminate data packets in VANETs. Our proposed technique shows great performance in terms of QoS parameters compared to recent routing protocols.