# A Robust Routing Protocol in Cognitive Unmanned Aerial Vehicular Networks
## 4 Proposed Routing Protocol
### Central Node Discovery Process  
In the proposed routing Algorithm 1, the route discovery procedure starts with broadcasting the Route Request (RREQ) to its nearby nodes. The nearby nodes then evaluate the trustworthiness of the mediator nodes using the Suspected UAV Node (SQN) value. If the SQN value exceeds 50%, that particular node is declared malicious and flagged with an infinity value, initiating the node exit process for the suspicious UAVs.  
The proposed protocol also examines Residual Energy (RE) and Reliability Factor (RF) during the process. Based on the distance, angle, speed ratio, and number of free channels of a node, a destination node calculates the Central Node Resolution Factor (CNRF). RREQ and Route Reply (RREP) messages are exchanged between nodes to discover all possible paths, collectively referred to as the 'Path' of the algorithm. The 'Path' represents the overall route that data packets will follow, consisting of a sequence of nodes or waypoints. In contrast, a 'path' represents a single segment or connection between two nodes within the overall 'Path'. Both 'Path' and 'path' are implemented using list data structures, with each element corresponding to a node or waypoint. The source node calculates and stores the CNRF, RE, and RF, ensuring efficient and reliable routing by selecting the most optimal 'Path' based on these parameters.  
The Cluster Formation Algorithm runs periodically, optimizing energy consumption by processing, sending, and receiving messages at defined intervals. It involves each node (\(UN_{i}\)) scanning and constructing an Adjacent Cluster List (\(ACL_{i}\)) and Node List (\(NL_{i}\)), which are then transmitted to neighboring nodes (\(UN_{n}\)). Based on gathered information, each node constructs a graph component (\(G_{cl}\)) from its previous graph information (\(G_{pi}\) ). Each node determines its Central Node Route Factor (\(CNRF_{i}\)) and shares it with its neighbors. The node with the highest \(CNRF\) within its neighborhood is selected as the Cluster Node (\(CN\)), forming a cluster and selecting Sub-Cluster Nodes (\(SCN\)) based on \(CNRF\) values. If there are multiple neighbors with higher \(CNRF\) values, the node with the smallest ID is chosen. This process continues until clusters are formed with selected CNs and Cluster Members (\(CMs\)). Considering the number of neighbors (\(n\)) and the number of nodes in the network (\(N\)), the total number of accessible channels is \(C\), and a particular node's accessible channels is \(X\). For one node, the route discovery algorithm has a complexity of \(O(n+\delta C)\), where \(\delta C\) represents the accessible channels for that node. For \(N\) nodes, the algorithm's complexity becomes \(O(nlogN+\delta C)\). However, when the number of nodes (\(N\)) in the network is significantly larger than the constant \(\delta C\), the complexity simplifies to \(O(nlogN)\).  
```
while truedo START RF = 1; RE = 0; \(UN_{s}\) broadcasts RREQ; while(\(UN_{i}\))do SQN for Unreliable Information; while(\(SQN\))do \(RF=RF+1\); if(\(RF<Q_{l}\))then RF remains unchanged; else RF sets to INFINITY; if(\(UN_{d}\) in \(UN_{i}\))then \(UN_{i}\) Calculates CNRF; \(UN_{i}\) transmits RREP with CNRF, RE, RF with Path Link; Break; else if(\(UN_{i}==UN_{s}\))then \(UN_{i}\) calculates CNRF, RF, and RE in the route path; Break; if(\(UN_{i}\) is not \(UN_{s}\))then \(UN_{i}\) Broadcasts RREQ; if(\(P_{s}>1\))then PathSelection = PathSelectionAlgorithm; \(UN_{s}\) transmits message to \(UN_{d}\) using Path; \(UN_{s}\) transmits message to \(UN_{d}\) using Path; END
```  
**Algorithm 1**Central Node Discovery Process