# Enhancing OLSR Protocol by an Advanced Greedy Forwarding Mechanism for VANET in Smart Cities
## 4 Proposed Work
### Optimization of OLSR for VANET Communication  
Given the results of the last analysis, the OLSR protocol presents the best performance. The integration of the \"greedy forwarding\" will enhance the protocol because it reduces the end-to-end delay [20].  
Greedy forwarding is based on proximity metrics by distance calculation. This greedy mode refers to the selection of the nearest neighbor to the destination as the next hop for the transfer of a packet.  
In this work, we improve the greedy forwarding mechanism [21] to choose the best vehicle and quickly reach the destination. We add a score to make it more efficient and precise.  
We start by presenting the communication in the vehicular system, as shown in the following Figure 4:  
To adapt the OLSR protocol to the VANET environment and to be more efficient, we add the advanced greedy forwarding mechanism in selecting the step by a score explained in the following paragraph.  
The advanced Greedy Forwarding Mechanism \"GFA\" [22] takes into account the distance between the source vehicle and the intermediate vehicle, which is a candidate to be considered as a relay, the candidates' speed of the vehicles of the candidates, and their geographical positions. The concept of score is attributed to each node in Figure 5:  
Figure 4: Communication in the vehicular system.  
The source selects the node with the smaller score \(t_{p}\):  
\[t_{p}=\frac{x_{p}-x_{i}}{v_{i}}+t_{i} \tag{1}\]  
where \(t_{p}\) is the time to reach the range \(x_{p}\) of the vehicle source \"S\", and \(t_{i}\) is the moment when the vehicle \"Vhi\" is in xi position with the speed \(v_{i}\) at time it.  
The classic greedy forwarding does not take into account whether the vehicle is moving or not, so to accelerate the communication, we add the speed of the vehicle in our amelioration, using the rule that the furthest node will not necessarily be the fastest and best for the transfer.  
The algorithm using the previous score \(t_{p}\) is as follows:  
1. The node Ni receives the packet,
2. If a node or group of nodes are within the reach of node Ni,
3. Then select the node that has the smallest T score,
4. Otherwise, save the package to find a node in its scope and select the one with the lowest score \(t_{p}\),
5. Repeat these steps until to reach D (destination).  
Analyzing this algorithm, we note that GFA reacts better than the GF because of the score \(t_{p}\). If the difference between the speeds of candidate nodes does not influence the score \(t_{p}\) in such a way that the score of the furthest node is lower than that of another closer node, GFA and GF have the same result.  
To validate our proposition compared to the classic greedy forwarding method, we choose the following model:  
The study, performed in the following Section 5, treats the particular case as shown in Figure 6 when the elected vehicle by the Greedy forwarding mechanism is not efficient, because of its speed. Therefore, our proposition reacts positively in this case to improve the performance such as EED (End-to-End Delay) and PDR (Packet Delivery Ratio) of the network by verifying the speed of each node participating in the communication.  
We execute GF and GFA to evaluate their performances in the case of end-to-end time for different distances and speeds between the candidate nodes.  
In the following, the parameters are not chosen randomly but by considering the particular case from which our approach will be able to react better than the classic version. In another case, the two approaches give the same results.  
Figure 5: Advanced greedy forwarding.