A Model to Improve the Effectiveness and Energy Consumption to Address the Routing Problem for Cognitive Radio Ad Hoc Networks by Utilizing an Optimized Cuckoo Search Algorithm

: A cognitive radio ad hoc network (CRAHN) is a mobile network that can communicate without any form of centralized infrastructure. The nodes can learn about the environment and make routing decisions. Furthermore, distributed computing, spectrum mobility, and the Internet of Things have created large data sets, which require more spectrum for data transmission. Unfortunately, the spectrum is a scarce resource that underutilized by licensed users, while unlicensed users are overcrowding the free spectrum. The CRAHNs technology has emerged as a promising solution to the underutilization of the spectrum. The focus of this study is to improve the effectiveness and energy consumption of routing in order to address the routing problem of CRAHNs through the implementation of the optimized cuckoo search algorithm. In CRAHNs, the node and spectrum mobility cause some frequent link breakages within the network, which degrades the performance of the routing protocols. This requires a routing solution to this routing problem. The proposed scheme was implemented in NS2 installed in Linux operating system, with a cognitive radio cognitive network (CRCN) patch. From the experimental results, we observed that the proposed OCS-AODV scheme outperformed CS-DSDV and ACO-AODV schemes. It obtained at least 3.87% packet delivery ratio and 2.56% and lower packets lost. The scheme enabled the mobile nodes to adjust accordingly to minimize energy consumption. If not busy, they switch to an idle state to save battery power.


Introduction
Reducing energy consumption of the mobile nodes extends the network life span which improves the effectiveness of the network. Nodes can also minimize the routing problem experienced within the Cognitive radio ad hoc network (CRAHN). CRAHN is a set of wireless mobile nodes, where each node collaborates to relay data packets to extend the transmission of source nodes beyond their communication zones. A steady and scalable network is ideal [1]. The advancement of technology, distributed computing, spectrum mobility, and the Internet of Things (IoT) has created large data sets requiring more spectrum for data communication. Unfortunately, the spectrum is a scarce resource that is non-deterministic and varies from one sector to another, as illustrated in Figure 1. Figure 1 shows the available channels known as the spectrum holes, which unlicensed users have the privilege to access only when they are idle [2,3]. When licensed users are detected, the unlicensed users must vacate the spectrum to avoid interfering with the licensed user's transmission.
The ad hoc networks exhibit unique characteristics, such as being aware and adaptive to their environment [4]. For example, they can alter their physical layer behavior based on their previous experience and current environmental characteristics. Ad hoc networks are made up of smart and spectrum-agile gadgets that can adjust their configurations based on the spectral environment [5]. Figure 1 depicts the spectrum holes that can be utilized by The ad hoc networks exhibit unique characteristics, such as being aware and adaptive to their environment [4]. For example, they can alter their physical layer behavior based on their previous experience and current environmental characteristics. Ad hoc networks are made up of smart and spectrum-agile gadgets that can adjust their configurations based on the spectral environment [5]. Figure 1 depicts the spectrum holes that can be utilized by cognitive users opportunistically when they are idle. Bands with no signal characterize the spectrum holes. These bands are marked with the phrase "Spectrum holes" in Figure 1.  Figure 1 shows the number of bands starting from b1, b2,…, bk, where the green, orange, and blue colors demonstrate the signals in various spectrum bands. The signals notify the secondary users (SUs) whenever the primary user (PU) is about to access the spectrum. The SUs must then find an alternative free spectrum holes to utilize and vacate the current spectrum without interfering with the PUs' activities.
This study aims to improve the routing problem and reduce energy consumption and to allow cognitive users to effectively detect spectrum holes and utilize them while the life span of the network is extended due to efficiency in energy consumption. However, the coming of IoT and smart gadgets is increasing the requirements for spectrum and robust quality-of-service (QoS)-aware routing protocols [7]. Cognitive radio technology has emerged as an encouraging solution to address the spectrum challenge. It enables unlicensed users to use the spectrum when it is idle and to vacate the spectrum immediately once a licensed user is detected [8]. This technology is widely utilized in disaster management, vehicular networks, combat, mountainous areas, fire, earthquakes, acoustic underwater networks, forest fire detection, wildlife protection, rescue, and many more hazardous environments. However, mobile nodes in such environments have a limited amount of energy; moreover, this energy can be costly and not renewable [9].
Energy-efficient strategies are necessary to maximize both the network lifespan and the number of data packets transmitted. Various radio spectrum bands are obtainable, such as a global system for mobile GSM, television, wireless local area network (WLAN), military, and LTE that are causing spectral inefficiency whereby the spectrum for cognitive users are congested [10,11]. From the previous methods utilized by researchers, the principal challenge of CRAHNs is the routing problem, which requires further attention because the present routing protocols that are utilized for conventional networks are not suitable for CRAHNs, since routing paths are affected by node mobility, spectrum mobility, and network partition [12].
There is a need to enhance or modify the existing routing protocols for CRAHNs or design new algorithms. CRAHNs are self-configuration and adaptive; hence, the mobile nodes must discover network resources and communicate accordingly. The system need Figure 1. Spectrum model depicting signals, noise, reversed bands, and the spectrum holes in k bands [6]. Figure 1 shows the number of bands starting from b 1 , b 2 , . . . , b k , where the green, orange, and blue colors demonstrate the signals in various spectrum bands. The signals notify the secondary users (SUs) whenever the primary user (PU) is about to access the spectrum. The SUs must then find an alternative free spectrum holes to utilize and vacate the current spectrum without interfering with the PUs' activities.
This study aims to improve the routing problem and reduce energy consumption and to allow cognitive users to effectively detect spectrum holes and utilize them while the life span of the network is extended due to efficiency in energy consumption. However, the coming of IoT and smart gadgets is increasing the requirements for spectrum and robust quality-of-service (QoS)-aware routing protocols [7]. Cognitive radio technology has emerged as an encouraging solution to address the spectrum challenge. It enables unlicensed users to use the spectrum when it is idle and to vacate the spectrum immediately once a licensed user is detected [8]. This technology is widely utilized in disaster management, vehicular networks, combat, mountainous areas, fire, earthquakes, acoustic underwater networks, forest fire detection, wildlife protection, rescue, and many more hazardous environments. However, mobile nodes in such environments have a limited amount of energy; moreover, this energy can be costly and not renewable [9].
Energy-efficient strategies are necessary to maximize both the network lifespan and the number of data packets transmitted. Various radio spectrum bands are obtainable, such as a global system for mobile GSM, television, wireless local area network (WLAN), military, and LTE that are causing spectral inefficiency whereby the spectrum for cognitive users are congested [10,11]. From the previous methods utilized by researchers, the principal challenge of CRAHNs is the routing problem, which requires further attention because the present routing protocols that are utilized for conventional networks are not suitable for CRAHNs, since routing paths are affected by node mobility, spectrum mobility, and network partition [12].
There is a need to enhance or modify the existing routing protocols for CRAHNs or design new algorithms. CRAHNs are self-configuration and adaptive; hence, the mobile nodes must discover network resources and communicate accordingly. The system need to sense changing environmental conditions or changing capabilities and respond appropriately so that the entire system can operate efficiently [13]. Each node acts as a router and as a host, and the nodes can move in any direction, changing the network topology and, in some instances, partitioning the network. Hence, route maintenance in an intermittent network is a challenge.
Node and spectrum mobility cause connection breakages which impacts negatively on data transmissions. Therefore, undelivered packets are stored in buffers for prolonged periods, which results in them being dropped. The increase in network traffic and the absence of centralized infrastructure increase network complexity in terms of routing challenges. This study aims to minimize the signal overhead and improve network performance while ensuring that network resources are utilized efficiently [14].
This study proposes a routing scheme based on a cuckoo search cluster-based algorithm to address the routing challenge in ad hoc networks. Due to the increase in the request for spectrum and a need to transmit multimedia data at high rates, the need for robust and efficient routing schemes cannot be overemphasized [15]. The unique characteristics of ad hoc networks does not guarantee long-term network stability with low congestion and overhead. This study focuses on three routing metrics: the packet-delivery ratio, packet loss, and residual energy. Mobile nodes have limited energy resources; hence, the goal is to implement energy-aware routing scheme to extend the lifespan of a network [16]. The current routing schemes do not consider the energy of nodes in data transmission.
Routing protocols play a significant part in CRAHNs, as the nodes are dynamic, and nodes assist in routing the data packets. Energy-efficient routing protocols are required in such a situation, particularly when there are no routers, base stations, and fixed infrastructure. Establishing an optimal and efficient path from source to destination is the main goal of routing protocols in CRAHNs. They must ensure that the network's lifespan is extended, and data transmission does not experience interference while minimum battery power is utilized. These objectives can be achieved by reducing the mobile node's energy consumption during both active and indolent transmissions.

Literature Review
In the study in [17], the authors proposed a routing scheme called the QoS multicastrouting method based on the tuned cuckoo algorithm (TCSA). The TCSA algorithm was compared to a particle swarm optimization (PSO) to evaluate the performance of the two routing algorithms. The authors considered three quality metrics: packet-delivery ratio (PDR), path-success ratio, and the average end-to-end delay. The results show that the TCSA scheme performed better than the PSO scheme. Unfortunately, the scheme did not consider real-time applications. The TCSA scheme can be modified to consider real-time applications and the residual energy to determine the network lifetime and stability.
In CRAHNs, the frequent connection failures and the loss of packets affect the routing performance. The mobility of nodes and overcrowding should be considered because they cause network bottleneck. In the study in [18], the authors proposed a QoS-aware routing algorithm that enhances network performance. They proposed a solid energy-efficient QoS established on congestion and delay. The development is based on using the strongest signal, queue-length drains rate, and delay. The results show that the algorithm performs better. However, throughput was not considered. Hence, the scheme can be enhanced to address the throughput metric and the PDR.
In the study in [19], the authors proposed an algorithm known as cuckoo search ad hoc on-demand distance vector (CSAODV). The scheme was proposed to address the routing in MANET. The scheme's objective was to reduce the end-to-end delay and the number of packets lost as well as ameliorate the throughput. The CSAODV protocol is designed to select relatively stable paths. The AODV and CSAODV, in an environment where nodes are moving fast or the speed of the nodes is increasing, the performance of network is degraded. The performance of the CSAODV was superior to that of the AODV.
The authors also noticed that in an environment with different traffic loads, the CSAODV impacts negatively on the bandwidth and delay which affects the performance of the routing protocols. The network load however, is distributed across the network. The CSAODV protocols can be enhanced to utilize the QoS requirements to make certain that a selected path has sufficient network resources and should consider the requirements of real-time applications.
In the study in [20], the authors proposed an efficient routing scheme known as the FACE routing optimized utilizing the genetic algorithm. FACE routing uses intelligence to determine the mobile node's location. The genetic algorithm and FACE routing, which reduces the routing overhead, such as delay time and packet loss, ameliorates the network performance. The algorithm considers the QoS characteristic, which is the main objective of ensuring network availability. This ensures that while retransmission of packets takes place, the energy consumption is minimized.
In the study in [21], the authors proposed a secure routing protocol known as trustpredicated routing (TPR), which utilizes the cuckoo search algorithm. The TPR scheme guarantees reliability, and the cuckoo search minimized the processing time and facilitated efficient routing. The results show that the proposed scheme performs better in terms of PDR, but its drawback is its poor end-to-end delay. However, its energy consumption is good. The study proposed an algorithm known as the optimized CSAODV (OCS-AODV) scheme, and it was compared to two existing schemes, namely cuckoo search-destination sequence distance vector (CS-DSDV) and ant colony optimization ad hoc on-demand distance vector (ACO-AODV) routing protocols.

Cuckoo Search Algorithm Overview
Yang and Deb in [22] originally developed the cuckoo search algorithm in 2009. The CS scheme is effective in optimization issues because it can trade off the local and global random walks. The CS is inspired by the behavior of cuckoo species that lay eggs in another bird's nest. The host bird can incubate the foreign eggs until they are hatched or discard them or abandon its own nest and build a new nest elsewhere [23]. When it lays its eggs on another bird's nest, the cuckoo bird replaces the other bird's eggs with its own eggs in attempt to ensure that its eggs are not detected. The cuckoo eggs are similar to the host eggs. It can mimic the color of the host eggs, texture and patterns. This strategy minimizes the chances of their eggs being detected, which increases their productivity. In the optimization, a solution's quality and fitness is proportional to the objective function's estimation.

Proposed Methodology
The dynamic environment of ad hoc networks has brought numerous challenges. Efficient cooperation among mobile nodes is a critical for the effective operation of the network. These mobile nodes must have the capacity to communicate, share information, and network resources. Due to limited network resources and QoS requirements, this study optimizes the cuckoo search algorithm for ad hoc networks using the levy-flight distribution to improve the QoS provisioning [24].

The Cuckoo Search Algorithm Depends on Three Principles as Follows
The cuckoo bird chooses a nest randomly and lays its egg at any given time. The nest that has a cuckoo egg would be viewed as the best nest/cluster containing the best gateway node. There is a fixed number of nests that would be accessible, and Pa is the probability of finding a cuckoo egg such that Pα ∈ [0,1]. The smaller the number, the lesser the chance of finding the cuckoo egg.

Proposed Scheme Assumptions
Each nest must always have the cuckoo egg The host bird cannot detect the cuckoo egg.

Cuckoo Search Algorithm Adapted for Cognitive Radio ad Hoc Networks
The CS scheme was adapted for CRAHNs to address the routing problem by utilizing the PDR and packet loss metrics. There is a fixed number of local area networks (LANs). A new solution node is established in every LAN, which serves as a gateway to other LANs. A LAN with a gateway node is considered the best, and it provides an extended lifespan of the network. The cluster head, the network gateway which is the cuckoo egg, minimizes routing overhead within a cluster and effectively communicates with other gateway nodes across different networks. Having investigated various routing metrics and protocols in CRAHNs, their challenges, efficiency, and point of interest, the study proposes a routing scheme known as the optimized CSAODV (OCS-AODV).
The algorithm's objective is to combine the advantages of OCS and AODV to address the routing problem and evaluate the route stability of each link. To reduce the routing overheads within the network, the scheme considers various paths and calculates their fitness-function value to ensure that a selected path meets the desired conditions. Appropriate decisions are made before data transmission. The proposed OCS-AODV routing scheme is based on a WLAN whereby each node within the LAN is responsible for establishing information regarding its neighborhood. Hence the communication between the source and destinations is managed through gateway nodes of each LAN in communicating with other LANs. Figure 2 presents the network design for the proposed scheme which shows how the networks are connected through gateway nodes. The communication between different LANs is facilitated through the gateways nodes, which links different LANs. The gateway nodes are, ideally, the cuckoo nodes.

Cuckoo Search Algorithm Adapted for Cognitive Radio ad Hoc Networks
The CS scheme was adapted for CRAHNs to address the routing problem by utilizing the PDR and packet loss metrics. There is a fixed number of local area networks (LANs). A new solution node is established in every LAN, which serves as a gateway to other LANs. A LAN with a gateway node is considered the best, and it provides an extended lifespan of the network. The cluster head, the network gateway which is the cuckoo egg, minimizes routing overhead within a cluster and effectively communicates with other gateway nodes across different networks. Having investigated various routing metrics and protocols in CRAHNs, their challenges, efficiency, and point of interest, the study proposes a routing scheme known as the optimized CSAODV (OCS-AODV).
The algorithm's objective is to combine the advantages of OCS and AODV to address the routing problem and evaluate the route stability of each link. To reduce the routing overheads within the network, the scheme considers various paths and calculates their fitness-function value to ensure that a selected path meets the desired conditions. Appropriate decisions are made before data transmission. The proposed OCS-AODV routing scheme is based on a WLAN whereby each node within the LAN is responsible for establishing information regarding its neighborhood. Hence the communication between the source and destinations is managed through gateway nodes of each LAN in communicating with other LANs. Figure 2 presents the network design for the proposed scheme which shows how the networks are connected through gateway nodes. The communication between different LANs is facilitated through the gateways nodes, which links different LANs. The gateway nodes are, ideally, the cuckoo nodes. The environment consist of two LANs, where each LAN has a network gateway node that helps other nodes within the LAN to communicate with nodes in another LAN through the two gateways. When node 1 in LAN 1 wants to communicate with node 2 in LAN 2, node 1 sends a route request and floods the network, which ultimately is received by the network gateway of LAN 1. Then, the gateway node in LAN1 communicates with the gateway node in LAN 2, which floods its network with the route-request packet. When The environment consist of two LANs, where each LAN has a network gateway node that helps other nodes within the LAN to communicate with nodes in another LAN through the two gateways. When node 1 in LAN 1 wants to communicate with node 2 in LAN 2, node 1 sends a route request and floods the network, which ultimately is received by the network gateway of LAN 1. Then, the gateway node in LAN1 communicates with the gateway node in LAN 2, which floods its network with the route-request packet. When the destination node receives the route request, it first calculates the fitness functions of the routes and then selects an optimal path to send back the route-reply packet, enabling the source node to start transmission. Figure 3 shows the route-discovery process about a communication taking place within a LAN. The S node generates the route-request packet and floods it to its neighboring nodes. The nodes will check in the routing tables if they have the address to the desired destination; if they do not have it, they flood the route request until it reaches the destination D node. The D node receives the route request before sending out the route reply; it calculates the evaluation function on how close the desired solution is, checks if the selected route meets the QoS requirements, and then it sends back the route reply if the fitness function is very low and QoS requirements, such as performance, availability, scalability, and serviceability are met. boring nodes. The nodes will check in the routing tables if they have the address to the desired destination; if they do not have it, they flood the route request until it reaches the destination D node. The D node receives the route request before sending out the route reply; it calculates the evaluation function on how close the desired solution is, checks if the selected route meets the QoS requirements, and then it sends back the route reply if the fitness function is very low and QoS requirements, such as performance, availability, scalability, and serviceability are met.

Route-Discovery Process
where p denotes each node within the discovered path and n, the number of nodes along that path, with α = 0.05, and the solution must approach zero.

Levy-Flight Distribution
The levy flight is a random walk in which the step lengths' probability distribution is heavy-tailed. The levy flight is used to generate new routes, say ( +1) where ( +1) denotes the newly laid egg by cuckoo k: The alpha is the step size related to the scales of the problem of interest; usually, alpha is equals to one. Equation one is a stochastic equation for random walks, generally a Markov chain whereby the next move depends on the current position. The random walk is more efficient when applying the levy flight to explore the search space due to step lengths extended in the long run. The random step is drawn from a levy-flight distribution, denoted by: where p denotes each node within the discovered path and n, the number of nodes along that path, with α = 0.05, and the solution must approach zero.

Levy-Flight Distribution
The levy flight is a random walk in which the step lengths' probability distribution is heavy-tailed. The levy flight is used to generate new routes, say M (t+1) where M (t+1) denotes the newly laid egg by cuckoo k: The alpha is the step size related to the scales of the problem of interest; usually, alpha is equals to one. Equation one is a stochastic equation for random walks, generally a Markov chain whereby the next move depends on the current position. The random walk is more efficient when applying the levy flight to explore the search space due to step lengths extended in the long run. The random step is drawn from a levy-flight distribution, denoted by: where both the lengths consist of mean and variance. The levy-flight steps form a randomwalk process, obeying the power-law step length.

Random Walk
The random walk is a process that consists of taking a series of consecutive, random steps. Mathematically, it can be denoted by: where the S N is a random step that can be drawn from the levy-flight distribution, which can be modeled as a recursive formula as: Indicating that the next step will depend on the current state. The step size of the random walk can be fixed and mathematically represent the random-walk equation as: where the S t is the current state, and W t is a step variable with a known variable. Utilizing Mantegna's algorithm, we can calculate the step length, which can be denoted by: The β is a parameter between the range [1,2] intervals. The value for β is given to be 1.5, where the values of u and v are drawn from the normal distribution shown by: where the N denotes the normal distribution σ u and σ v and can be calculated using the following equation: where Γ represents the gamma function, and the process of discovering the cuckoo eggs is repeated using the matrix P probability and is calculated as follows: where P ij is the exploration probability for the jth variable of the ith nest in the matrix P. The P α value is estimated if it falls within the interval (0,1) to determine if the local random walk can be considered or rejected, and rand is a random number in [0,1]; after the discovery of the probabilities, new nests are built using Equation (10): Also, S denotes the local step-size matrix produced using the equation: S = rand ( ) * (nests(randperm1 ( n), :) − nests(randperm2(n), :)) where the ( ) value is a random-number generator with intervals 0 and 1 and randperm 1 and randperm2.

Implementation Steps
The proposed OCS algorithm has been used to enhance the AODV routing protocol. This technique can achieve quality and precise global optimal solutions for enhanced secondary cluster-head selection and network stability.
Initialization step-There is a fixed n number of LANs. Each LAN consists of several mobile nodes and a gateway node to facilitate communication between two LANs. Consider N to be the number of LANs in CRAHNs parameters, including the step size α, the probability of discovering the cuckoo eggs, and the number of iterations utilized as a stop criterion.
Calculating the levy flight-to produce new solution nodes utilizing the levy-flight distribution, we use Equation (1) and compute the fitness-function value for each path discovered and determine the random step length. The population of the nodes-the number of mobile nodes is initiated randomly, according to the node's parameters. Figure 3 shows the number of LANs within WLAN, where each LAN has one gateway node.
Best and worst LANs-a LAN having a gateway node is considered for the next generation with high-quality node constraints selected using probability function P α . The worst nest is discarded when the host bird detects the cuckoo egg.
Gateway node optimized-this node act as a network backbone and as a gateway node to allow two nodes not in the same network to communicate. The Optimized Cuckoo Search Algorithm is shown as Algorithm 1: Algorithm 1:

1:
Begin: 2: Objective function f(x), 3: Generate initial population for number of nodes: 4: While (d<MaxGenerate)//stop criterion do 5: Generate new LANs using levy flights and evaluate its 6: Fj (quality of newly discovered paths) randomly 7: Choose LAN among the n LANs (say k) 8: If(fj(newly generated path) > fk(existing best path)) 9: Then replace existing path k with the new path j 10: End 11: If the worst LAN is abandoned with Pa and a new LAN 12: It is an iteration that evaluates fitness, ranks the solutions, and 13: Find the current best until the termination criterion 14: are satisfied produce the best solution.

Residual Energy Consumption of the Mobile Nodes
The mobile nodes are battery powered, and energy efficiency is required for an extended network lifespan because if the energy of a node is depleted, its capability to route data is affected resulting in network bottlenecks, which in turn adversely affects the network lifespan. Let P max (u) be the maximum transmission power, then let P min (u) be the minimum transmission power and let P u be the transmission power of a node u ∈ V. The nodes initially transmit with max power P max . Then assume that the transmission power can be regulated between the max and min values such that P min (u) <= P u <= P max . Then, let P uv be the minimum transmission power required to facilitate communication between node u and node v. Table 1 presents the simulation parameters. with ready to send (RTS)/clear to send (CTS) handshake packets. We demonstrate the normal power (X m ) consumed by the interface as: X m = t sl * X sl + t ud * X ud + t Rv * X Rv + t Wk * X Wk . . . (13) where t sl , t ud , t Rv , and t Wk are the negligible portions of the time epochs spent by the interfaces in one of the potential states: sleep, idle, receive, and transmit. These epochs fulfill the condition. Similarly, X sl , X ud , X Rv , and X Wk represent energy consumed in the four states, considering X m and the underlying energy of the node (E). We can compute the node lifetime (T v ), which addresses the duration before the energy of the node is depleted: It also shows energy utilization at the four states: idle, sleep, received, and transmit. We can compute the energy management (X m ) and the node lifetime (T v ), which addresses the time before the energy is depleted [23]. Managing the battery usage among nodes enables the estimation of the power consumption of the nodes.

Experimental Constraints
Since the NS2 does not duplicate cumulative interference, the study considered its limitation and the receiver sensitivity (RXThresh) and capture threshold (CPThresh). When the physical carrier sense is utilized, a mobile node desiring to dispatch information should first detect the channel. Once the energy is identified on the channel (carrier sense threshold), the channel is occupied, and the node must postpone its transmission. Thus, a carrier-sense threshold suggests that even the mobile nodes quite far away from a sending node would recognize the channel as occupied and defer.

Mobility Environment
The experiments were conducted utilizing the network simulation 2 (NS2) and (CRCN) patch installed on a Linux operating system. The network topology is a grid of 1000 m × 1000 m, and the simulation time is 100 simulation seconds. Figure 4 shows the initial state of mobile nodes and their configurations. To generate initial nodes, the study utilized the NSG2 graphic user-interface system. The setup environment and the configuration connections between the source node and the destination node are represented in Table 2.    Figure 5 denotes the comparison of the network lifespan for the three routing protocols, namely OCS-AODV, CS-DSDV, and ACO-AODV, under various environmental conditions, namely 0 to 60, 60-80, and 80-100 internals. When nodes are in an idle state, they switch to a sleep mode to save battery. We observed that, compared to other routing protocols, the proposed scheme was the best performing scheme. The advantage of the pro-  9.1. Experimental Results Figure 5 denotes the comparison of the network lifespan for the three routing protocols, namely OCS-AODV, CS-DSDV, and ACO-AODV, under various environmental conditions, namely 0 to 60, 60-80, and 80-100 internals. When nodes are in an idle state, they switch to a sleep mode to save battery. We observed that, compared to other routing protocols, the proposed scheme was the best performing scheme. The advantage of the proposed scheme is that it utilizes the cluster-heads, optimization strategies, and improved data-transmission techniques to conserve energy of the nodes. The graph shows the performance of the three routing protocols during the simulation. The time ranges are divided into three categories reflecting observation of the mobile nodes on how long they could operate before they could ran out of power. It shows that the proposed scheme consumes the least power compared to the other routing protocols. For time interval, from 0 to 60 s shows that the energy is still sufficient; continuing to 60 to 80 s shows that the CS-DSDV and the ACO-AODV routing protocols' residual energy is decreasing, while the proposed scheme still has sufficient energy. Finally, between 80 to 100, it shows how long the average energy can last between the schemes. Hence, we observed that the CS-DSDV and ACO-AODV energy was almost depleted, whereas the proposed scheme still had sufficient energy. Figure 6 present the packet loses and packet delivery rates of the three schemes.

Scenario 1 Results
Figure 6a depicts the simulation results of the proposed OCS-AODV routing scheme and it was compared to CS-DSDV and ACO-AODV protocols. The proposed scheme achieved the best performance because of the effectiveness of its OCS technique. A selected path tends to be optimal. Hence, the scheme delivered more packets than the other schemes. The study observed that the CS-DSDV protocol performed badly throughout the simulation due to nodes moving away from their original location, exiting the network, and others joining the network. This causes frequent reconfiguration of mobile nodes as they keep updating each other about the state of the network. So, the scheme is subjected to link breakages whereas, after a link breaks, it also fails to rediscover the link quickly.
The study did not use the congestion control or avoidance mechanism to stabilize the traffic load accordingly. When the number of nodes increased within the network, the proposed scheme experienced a decrease in PDR. The nature of ACO-AODV iteration can prohibit the use of ongoing applications while the ant-colony optimization takes an exceptionally long time to converge; thus, the two protocols were outperformed by the cuckoo search algorithm.
The packet loss occurs when packets are sent across the network and are not delivered to their destination. Figure 6b presents the outcomes of the packets lost throughout

Scenario 1 Results
Figure 6a depicts the simulation results of the proposed OCS-AODV routing scheme and it was compared to CS-DSDV and ACO-AODV protocols. The proposed scheme achieved the best performance because of the effectiveness of its OCS technique. A selected path tends to be optimal. Hence, the scheme delivered more packets than the other schemes. The study observed that the CS-DSDV protocol performed badly throughout the simulation due to nodes moving away from their original location, exiting the network, and others joining the network. This causes frequent reconfiguration of mobile nodes as they keep updating each other about the state of the network. So, the scheme is subjected to link breakages whereas, after a link breaks, it also fails to rediscover the link quickly.
The study did not use the congestion control or avoidance mechanism to stabilize the traffic load accordingly. When the number of nodes increased within the network, the proposed scheme experienced a decrease in PDR. The nature of ACO-AODV iteration can prohibit the use of ongoing applications while the ant-colony optimization takes an exceptionally long time to converge; thus, the two protocols were outperformed by the cuckoo search algorithm.
The packet loss occurs when packets are sent across the network and are not delivered to their destination. Figure 6b presents the outcomes of the packets lost throughout the data transmission. The proposed scheme OCS-AODV performed better than the CS-DSDV and ACO-AODV protocols, as it dropped the least number of packets. The scheme guarantees the reliability of a route and the network resources consumed by each application. The packets may be lost due to signal interruption or network performance challenges.
We also observed that during the busiest periods, congestions occur frequently. When a connection is congested with heavy traffic, the data packets are dropped. However, the proposed scheme is effective, as it first checks the quality of routes before granting any request for transmission. The disadvantage of the CS-DSDV is that it regularly updates the routing tables, which uses up the battery power and the node's resources; thus, it loses more packets.
We consider scenario two, where the number of mobile nodes ranging from 60 to 100. We observed that in terms of PDR, the proposed scheme performs best. This enhancement was accomplished by implementing the optimized CS scheme, for example, the connection lifespan and reliability, which impacts the PDR by selecting stable paths as optimal routes. As the number of nodes increases, the network environment becomes congested, and this reduces the chances of having a higher PDR, which affects all the routing protocols. Figure 7 depicts the simulation results that demonstrate that OCS-AODV is the best performing protocol due to lower rates of packet loss and higher PDR. CS-DSDV is marginally better, which means that it would perform better if the route-discovery challenge can be addressed to enable the delivery of more packets. We also observed that, as the mobile nodes increased in CS-DSDV, the scheme experienced many delays that affected the delivery of transmitted packets. The challenge of the ACO-AODV is the process of discovering paths. When a link is broken, the scheme is not efficient enough to handle a congested environment, as illustrated in Figure 7a.
We consider scenario two, where the number of mobile nodes ranging from 60 to 100. We observed that in terms of PDR, the proposed scheme performs best. This enhancement was accomplished by implementing the optimized CS scheme, for example, the connection lifespan and reliability, which impacts the PDR by selecting stable paths as optimal routes. As the number of nodes increases, the network environment becomes congested, and this reduces the chances of having a higher PDR, which affects all the routing protocols. Figure 7 depicts the simulation results that demonstrate that OCS-AODV is the best performing protocol due to lower rates of packet loss and higher PDR. CS-DSDV is marginally better, which means that it would perform better if the route-discovery challenge can be addressed to enable the delivery of more packets. We also observed that, as the mobile nodes increased in CS-DSDV, the scheme experienced many delays that affected the delivery of transmitted packets. The challenge of the ACO-AODV is the process of discovering paths. When a link is broken, the scheme is not efficient enough to handle a congested environment, as illustrated in Figure 7a.  Figure 7b shows the performance of the schemes in terms of packet-loss metrics. The CS-DSDV and ACO-AODV incurred many packets losses due to the collision of packets, link breakages, inadequate bandwidth, and higher overhead. The fitness function value of the OCS-AODV route selection was configured based on route lifespan and reliability. Applying these factors contributed to the selection of more stable routes with fewer link breakages, impacting the packet loss positively.
When the number of nodes increased, the CS-DSDV scheme drops more packets due to network congestion caused by a network bottleneck. The network overwhelms the receiving nodes due to more data generated by the source node than the receiving node can consume, thus causing many packets to be dropped. The ACO-AODV performs better  Figure 7b shows the performance of the schemes in terms of packet-loss metrics. The CS-DSDV and ACO-AODV incurred many packets losses due to the collision of packets, link breakages, inadequate bandwidth, and higher overhead. The fitness function value of the OCS-AODV route selection was configured based on route lifespan and reliability. Applying these factors contributed to the selection of more stable routes with fewer link breakages, impacting the packet loss positively.
When the number of nodes increased, the CS-DSDV scheme drops more packets due to network congestion caused by a network bottleneck. The network overwhelms the receiving nodes due to more data generated by the source node than the receiving node can consume, thus causing many packets to be dropped. The ACO-AODV performs better than CS-DSDV in most cases when the ACO scheme encounters link breakages. It can adapt to changes, such as new routes, though it takes a longer time to do so.

Discussion
The routing problem of CRAHN is a challenge that requires a flexible, robust, and dynamic solution. The routing challenge degrades the quality of routing, leading to a high packet-drop rate. In an endeavor to address the routing issue, several studies have either modified or designed new algorithms. This study investigated PDR and packetloss and proposed an OCS-AODV scheme employing the levy-flight distribution. The scheme is optimized for the discovery of stable routes with sufficient residual energy. The simulation results show that the proposed scheme addressed the PDR and packet loss and outperformed the CS-DSDV and ACO-AODV schemes.
The DSDV protocol has some disadvantages because it is a proactive protocol and has the challenge of making consistent updates even when the state of the network is stable. DSDV keeps outdated paths for a prolonged duration, which makes it not reliable for ad hoc networks. Given the results, we observed that the proposed scheme can transmit data for longer periods without experiencing problems with the battery power of nodes because the scheme can allow the mobile nodes to adjust energy consumption when idle and when transmitting to conserve energy. The ACO algorithm takes a long time to converge, and coding does not achieve optimal results.

Conclusions
The cuckoo search algorithm was optimized utilizing the levy flight distribution to address the routing challenges in CRAHNs. The performance of the proposed scheme was evaluated in NS2 simulator. From the experimental results, we observed that the proposed scheme OCS-AODV outperformed the CS-DSDV and ACO-AODV routing protocols, as it obtained a highest PDR and the least packet losses. When the number of nodes increased from 60 to 100, the proposed scheme outperformed the other two routing protocols. The proposed scheme can also sustain the network for a long time with residual energy because when mobile nodes are idle, they switch to the sleep mode to save battery life. Based on the observation of the experimental results for this study, we can further deduce that, according to simulation parameters and their respective values, better performing, QoSaware routing protocols in CRAHNs are required for improved performance. The proposed scheme obtained 3.87% higher PDR and 2.56% lower packet loss. The scheme enabled the mobile nodes to adjust accordingly to minimize energy consumption. The node switched to an idle state to save battery power when inactive.