# A Robust Routing Protocol in Cognitive Unmanned Aerial Vehicular Networks
## 4 Proposed Routing Protocol
### Proposed Clustering Strategy  
In our proposed Cognitive Radio UAV networks (CR-UAV), it introduces a distributed clustering scheme aimed at optimizing network performance. This approach adapts channel access timing within each cluster through synchronized super-frames. In our proposed super-frame setup, the Central Node (CN) initiates the beacon period by broadcasting a beacon message containing essential cluster information such as its ID, time synchronization data, SCH ID, and control/resource allocation details. Following this, during the spectrum sensing period, nodes assess channel availability and update their list of usable channels accordingly. If the channel is clear, the CN proceeds to transmit data; if not, it waits and retries later using a Distributed Coordination Function (DCF). Each cluster has its common channels chosen by the CN, and if a Primary User (PU) appears, the CN switches to the next channel to avoid interference, with other nodes following suit. In our proposed super-frame setup, the Neighbor Discovery phase immediately follows the Spectrum Sensing period. It has a critical time for both discovering neighbors and forming clusters. Nodes entering the network begin by scanning available channels and compiling a list of accessible channels. They then organize these channels and cycle through them to locate nearby nodes. If a Primary User signal is detected on a channel, nodes move to the next one. The goal is for nodes to spend sufficient time on each channel to identify all nearby nodes. Once neighboring UAVs are found, nodes exchange their lists of available channels and establish connections. Finally, the data period split into communicating within clusters and communicating between clusters. These phases are very important for making sure our clusters work seamlessly and can communicate with each other effectively in our CR-UAV network (Figure 3). Neighbour Discovery Process  
In our proposed network framework, the Neighbor Discovery phase represents a crucial step for Cognitive Radio-UAV (CR-UAV) nodes seeking to join the network. Through this phase, CR-UAV nodes can identify neighboring nodes and/or neighboring clusters, facilitating the exchange of control information essential for network integration. The process begins with the identification of available free spectrum by the CR-UAV node, followed by the preparation of its Accessible Channels List (ACL). Once the ACL is established, the CR-UAV node arranges the channels in sequential order, optimizing the process for neighbor discovery. Channel hopping then ensues, as the CR-UAV node sequentially explores the identified channels to listen for beacon signals. To ensure synchronization and coordination, a global common control channel is utilized to obtain a common time reference. During this phase, the CR-UAV node remains on each channel for a defined channel stopover time, allowing ample duration to detect neighboring nodes within the vicinity. Upon successfully receiving a beacon signal, the CR-UAV node promptly responds by transmitting a HELLO message to the Central Node (CN), initiating communication. Subsequently, the CR node awaits a REPLY message from the neighboring CN. A timer is activated during the transmission of the HELLO message to establish a maximum waiting time for the receipt of the REPLY message. In cases where no reply is received within the specified time frame or upon failure to receive the REPLY message, the CR-UAV node employs a retransmission mechanism to ensure data transmission reliability. However, it is essential to note that the total duration of all re-transmissions and corresponding timers for any particular HELLO message should not surpass the channel stopover time. Following successful communication and receipt of a REPLY message from a neighboring cluster, the CR-UAV node proceeds to initiate the node joining process, as detailed further in the Node Move-in and Node Move-out subsection of our paper.