# Impact of Direction Parameter in Performance of Modified AODV in VANET
## 2 AODV and Modified AODV Routing Algorithms
### Modified AODV  
In this study, we proposed an improved AODV routing protocol for VANETs by introducing two optimization steps: (1) a route discovery phase and (2) a route selection phase. The current location, speed, and direction information about vehicles is included for performance optimization while keeping the E2E delays to a minimum. We assumed a Manhattan model in our research experiment environment. In this model, a vehicle can go straight with 50% probability and left or right, with a 25% probability each. We also assumed a highway model where the vehicles can move in the opposite direction. The AODV packets carry more information on each vehicle to keep the other vehicles more up to date about each node on the road. We assumed automated cars with automated cruise control and wireless sensors will be used to prevent accidents. Therefore, the RREP and RREQ packets now have three pieces of information: velocity, direction, and position of each source node. The routing table in the vehicles is updated with this information so that all of the nearby vehicles can be known to each other. This method will certainly not increase the size of a packet. However, the direction information will provide more filtering options (to make the route more stable) for the vehicles. In our model, we have assumed two different situations:  
1. _Nonaccident mode:_ In this case, each vehicle will update its routing table for nearby cars; but it will transmit the information to those cars which are moving in the same direction as well as all nearby RSUs within 92 m.
2. _Accident mode:_ In this case, each vehicle will update the information in its routing table so that if there is an accident, the information will be sent in all directions and to nearby RSUs so that all of the vehicles can update their routing tables accordingly. Here the filtering process will be divided in two different ways. In the first half, the information will be sent to all of the vehicles within 92 m. If an accident is on the opposite side of the road, the vehicle will keep moving and updating the information for nearby vehicles. However, if it is on the same side of the road, the vehicle will stop (if it is immediate to the point of the accident and there is no free lane to move into), or it will reduce its speed and change into an available lane for safety and broadcast information. The RREQ packet format is changed in a modified AODV so that the reserved eight bits can be used for assigning the direction in which the source is moving in terms of the degree of rotation with reference to the equator. Therefore, each node of the network has the direction information along with the location of the destination. In the case of an accident, the information can be filtered and prioritized. This information will be given to the cars moving in the same direction and close to the accident. Therefore, the accident information will be passed to the nearby nodes with more ease. The RREQ message format is presented in Figure 2, and the fields include [15]:  
Figure 2: RREQ message format. The nearest node is calculated using the Pythagoras formula. If the location of node \(A\) is (\(\lambda_{1}\), \(\varphi_{1}\)) and the location of node \(B\) is (\(\lambda_{2}\), \(\varphi_{2}\)), then the shortest distance between them is calculated as [16]  
\[d\ =\ 2R\ \sin^{-1}\sqrt{\sin^{2}\frac{(\varphi_{1}-\varphi_{2})}{2}+\cos \varphi_{1}\cos\varphi_{2}\sin^{2}\frac{(\lambda_{1}-\lambda_{2})}{2}} \tag{1}\]  
where \(R\) is the earth radius, \(\varphi\) is the latitude, and \(\lambda\) is the longitude. If the latitudes of nodes \(A\) and \(B\) are \(\varphi_{1}\) and \(\varphi_{2}\), respectively, the direction between them is calculated as  
\[\theta\ =\ \varphi_{1}-\varphi_{2} \tag{2}\]  
In addition, the modified AODV routing table contains the direction information column for each nearby node that will be used to filter the nodes to pass data with little or no delay. Priority will be given to those nodes which have a minimum angle \(\theta\).