## 6 Evaluation Performances
### Implementation  
This section introduces the MHAR algorithms of the implemented code into the OLSR protocol:  
* Algorithms 1 and 2 show the node identification and path calculation functions,
* The path classification function (Algorithm 3) aims to assign an identifier to every calculated path using the path identification function and to mark the ones having the smaller number of hops with the short path tag,
* The path identification function (Algorithm 4) dispatches identifiers to all routes based on the nature of their components (nodes). ```
1:Initial
2:NeighborTuple: Tuple of neighboring nodes grouping their important characteristics
3:RANGE_FANET: Range value of FANET nodes
4:\(Speed_{(1,i)}\): Instantaneous relative velocity between N1 and its neighbors
5:HUMAN_SPEED: Speed max value of MANET nodes
6:\(N_{1}\): Current node
7:\(ID-N_{i}\): Node identifier
8:IDNList: List of all identified node
9:Begin
10:Identification(NeighborTuple)
11:\(N_{i}\longleftarrow\) GetNeighbor(NeighborTuple)
12:\((X_{i}\), \(Y_{i}\), \(Z_{i})\longleftarrow\) GetCoordinates(NeighborTuple)
13:\(Range_{i}\longleftarrow\) GetRange(NeighborTuple)
14:\(Speed_{(1,i)}\longleftarrow\) RelativeVelocity(\(X_{i}\), \(Y_{i}\), \(Z_{i}\))
15:for all neighbor Ni of NeighborTuple do
16:if\(Range_{i}>\) RANGE_FANET then
17:\(ID-N_{i}\longleftarrow\) 3
18:elseif\(Speed_{(1,i)}\leq\) HUMAN_SPEED then
19:\(ID-N_{i}\longleftarrow\) 1
20:else
21:\(ID-N_{i}\longleftarrow\) 2
22:endif
23:endif
24:endfor
25:return IDNList
26:End
**Algorithm 1**Node identification function
```
1:Initial
2:src: the source
3:dest: the destination
4:NoP: number of routes
5:V: set of the graph vertices or nodes
6:E: set of arcs e of V \(\times\) V (i.e., a relation on V)
7:c are cost
8:G: the graph composed of (V; E; c)
9:\(P_{i}\) : the path
10:PathTree: set of calculated path (\(P_{1}\),..., \(P_{NoP}\))
11:Begin
12:functionMultiPathDijkstra (src, dest, G, NoP)
13:\(c_{1}\longleftarrow\) C
14:\(G_{1}\longleftarrow\) G
15:fori \(\longleftarrow 1\)to NoP do
16:\(SourceTree\);\(\longleftarrow\) Dijkstra(\(G_{i}\), src)
17:\(P_{i}\longleftarrow\) GetPath(\(SourceTree\), dest)
18:forall arcs in E do
19:ife is in \(P_{i}\) OR Reverse(e) is in \(P_{i}\)then
20:\(c_{i+1}\)(e)\(\longleftarrow\)\(f_{p}\)(\(c_{i}\)(e))
21:elseif vertexHead(e) in \(P_{i}\)then
22:\(c_{i+1}\)(e)\(\longleftarrow\)\(f_{p}\)(\(c_{i}\)(e))
23:else
24:\(c_{i+1}\)(e)\(\longleftarrow\)\(c_{i}\)(e)
25:endif
26:endif
27:endfor
28:\(G_{i+1}\longleftarrow\) (V, E, \(c_{i+1}\))
29:endfor
30:returnPathTree
31:End
```
**Algorithm 2**Path calculation function
```
1:Initial
2:\(HopTuple\): tuple of address and identifier of hops composing a path \(i\)
3:\(P_{i}\); the path
4:PathTree: set of calculated path (\(P_{1}\),..., \(P_{NoP}\))
5:\(IDHList_{i}\): list of identified hops in a path \(i\)
6:\(ID-P_{i}\): path \(i\) identifier
7:\(NbHop_{i}\): number of hops in path \(i\)
8:SPLList: list of shortest paths
9:\(Tag-P_{i}\): tag of path \(j\) inserted in the ShPList
10:SP: shortest path tag
11:NbShP: number of shortest paths
12:ClassPathTuple: set of classified path composed by (\(P_{i}\), \(ID-P_{i}\), \(Tag-P_{i}\))
13:Begin
14:PathClassification(PathTree, IDNList)
15:fori \(\longleftarrow\) 1 to NoP do
16:\(P_{i}\longleftarrow\) GetPath(PathTree)
17:\(NbHop_{i}\longleftarrow\) GetNbHop (\(P_{i}\))
18:\(IDHList_{i}\longleftarrow\) GetID(IDNList, \(NbHop_{i}\))
19:\(HopTuple_{i}\longleftarrow\) Browse\(P_{i}\), \(IDHList_{i}\))
20:\(ID-P_{i}\longleftarrow\) Path_Identification(\(HopTuple_{i}\), \(NbHop_{i}\))
21:endfor
22:ShPList \(\longleftarrow\) Shortest_Paths(PathTree)
23:NbShP \(\longleftarrow\) GetSize(ShPList)
24:forj \(\longleftarrow\) 1 to NbShP do
25:\(Tag-P_{j}\longleftarrow\)\"SP\"
26:endfor
27:returnNbShP, ClassPathTuple
28:End
```

**Algorithm 3**Path classification function

### Simulation

To evaluate and compare MHAR-OLSR and OLSR routing protocols efficiency, we use the NS3 [44] version 3.29. This network simulator provides an open, extensible platform for networking research and education.