# Optimal Path Routing Protocol for Warning Messages Dissemination for Highway VANET
## 4 Optimal Path Discovery Phase
### Optimal Path Discovery
#### 4.2.1 Scenario 1  
In this scenario, we consider a case revealed in Figure 4 with the source and destination nodes specified as follows:  
* Source node C1: A is the rear node. * Destination node C3: G is the front node. * Source and destination nodes are moving in the same direction. * Assume there are two paths to reach from the source node C1: A to the destination node C3:G scenario mentioned above. The first path is the other side of a road to the source node, i.e., C1:A >>\(CH\) >> C4: \(CH\) >> C5: \(CH\) >> C6: \(CH\) >>C3: \(CH\) >> G, and the second path is C1: A >>\(CH\) >> C2: \(CH\) >> C3: \(CH\) >> G. Suppose cluster C4: \(CH\) is closer to the target than C2: \(CH\), cluster C4: \(CH\) will be given preference for packet forwarding under the traditional greedy routing method, choosing the first path out of the available possibilities. Similarly, to this, direction-based techniques that choose a hop close to the source's transmission range boundary in the direction of the destination will favor using the same node for the subsequent hop. In VANETs, these priority-based protocols cannot offer superior results when nodes move in various directions. The number of hops on a path is influenced by the direction of nodes. It is not a sensible choice to choose a path with fewer hops on a given time step without considering the locations and the directions of nodes on the path because the number of hops on a path continues to be proportional to the delay in communication of WM. For instance, if we use the previously given paths to Node C3: G as an example, the first path, upon safe delivery of the WM, is C1: A >> _CH >>_ C4: _CH >>_ C5: _CH >>_ C6: _CH >>_ C2: _CH >>_ C4: CH >>_ G. By the time a packet is received on C6: CH, the target Node C3: _CH_ has moved out of its transmission range because the C6: CH is traveling in the opposite direction. In order to get out of this predicament, Node C6: _CH_ needs more intermediate relay nodes to enable the successful transmission of WMs. There are two options in such a situation:  
* Cluster C6: _CH_ does not find any forwarder further to reach the destination Node C3:G.
* Cluster C6: _CH_ finds a forwarder C2: _CH_ and goes into a path reconstruction process. The case becomes exceedingly severe if no alternative forwarder is available because C6:_CH_, which moves in the opposite direction from the destination node, carries the packets with it, causing a message drop. Whenever a forwarder is still accessible in the second scenario, a path reconstruction procedure that adds additional nodes to the already specific path is started. On a newly built path, cluster C6: _CH_ travels through additional cluster C2: _CH_ to reach the destination cluster C3: _CH >>_ G.  
However, there is no change in the number of hops for the second path chosen by OPRP because all nodes travel in the same direction as the destination node. This shows clearly that the placement of intermediate relay nodes along a path significantly affects the prompt and accurate transmission of warning messages. When the source node is in the back and the destination node is in front, while both are going in the same direction, it is possible to grant such direction-based priority to routes if the ultimate distance for the following hop with the destination node is  
\[\delta_{i}=\frac{\Delta}{H(NG_{si}\ S)} \tag{7}\]  
where \(\delta_{i}\) denotes the final distance of \(NG_{Si}\) (i.e., the next hop to which the WM can be transmitted) from the destination node, \(\Delta\) is the Euclidean distance between \(NG_{Si}\) and the destination node, and \(H\) (.) is the Hamming distance function. The node with the lowest distance is calculated using Equation (7). That node will be favored as an _O\({}_{f}\)_ over the other nodes. In our suggested protocol, if \(H\) (_S_, _D_) = 1, S  
Figure 4: Dissemination of warning messages with different scenarios.