{'fraction_non_alphanumeric': 0.0234375, 'fraction_numerical': 0.003951408959537573, 'mean_word_length': 4.777328463344639, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Cognitive Routing in Software-Defined Maritime Networks

Due to the constantly changing sea surface, there is a high risk of link fragility caused by sea waves when different marine users are intended to establish stable links for communication. To ensure stability with less delay, finding a stable route is one of the crucial aspects of maritime networks. In order to achieve this aim, we propose a routing protocol for cognitive maritime networks based on software-defined networking (SDN). This SDN-based cognitive routing protocol provides stable routes among different marine users. To provide the global view of the whole network, a main controller is placed close to the seashore, whereas the localized views are provided by the cluster heads. Autonomous surface vehicles are used as gateways under sparse network conditions to collect and transport data among clusters, and to and from the main controller. This is an SDN-based ship-to-ship communication scheme where two ships can only establish a link when they not only have consensus about a common idle channel but are also within the communication range of each other. We perform extensive simulations to test the proposed scheme with different parameters and find better performance in comparison with both SDN-based and non-SDN-based schemes in terms of end-to-end delay, packet delivery ratio, and routing overhead ratio.


Introduction
Maritime networks have been playing a crucial role in dealing with various applications, ranging from ship safety and security to all commercial applications for passengers [1]. This is a technology where ships, surface buoys, autonomous surface vehicles (ASVs), and large vessels communicate with each other by joining and departing from the network in a dynamic manner, thereby forming an ad hoc maritime network. This type of marine communication has a high risk of fluctuations in signal strength due to constantly varying sea waves which results in links fragility; therefore, providing stability with an adequate routing scheme is a major issue in a marine environment. Moreover, with the development of the marine industry and an increase in the number of marine users, there is an essential need for a high-speed and lowcost maritime communication system that provides ubiquitous stable links among users' aboard ship. Current maritime communication systems are based on high frequency (HF), network performance in the marine environment by renting out additional spectrum outside the licensed bands (e.g., TV bands). Similar to vehicular ad hoc networks (VANETs) [5], the implementation of a CR technology in a maritime network is different from the conventional CR networks due to the highly dynamic sea environment; therefore, a new algorithm is needed to find whether the primary user (PU) is present in the network or not by ensuring that the activity of the PU is safe. Two marine users can only communicate if they both have a common idle channel. Several routing techniques have been implemented to provide a stable link in mobile ad hoc networks (MANETs) and VANETs. Due to the constantly moving nature of the sea surface, these networking techniques cannot be exactly adapted for maritime networks. And when it comes to implementing cognitive maritime communication, both the PU activity and the rough surface of the sea impede these routing techniques from providing a robust and distinguished solution for safe and stable marine communications. A few routing protocols have been proposed for maritime communications, but they do not deal with the issues of spectrum insufficiency. We try to implement a novel concept of software-defined networking (SDN) for marine networks in this paper to deal with the shortcomings of existing architectures in the marine environment. SDN is a developing approach that enhances network intelligence by the separation of two planes: the control plane and the data plane [6]. The SDN approach has been more and more distributed into various groups of network systems, including maritime networks, in order to deal with the shortcomings in these networks [7,8].
The purpose of this paper is to implement a cognitive routing technique in the marine environment by utilizing the SDN technology. We try to resolve the issues of spectrum insufficiency, sporadically connected networks, high latency, and the large overhead in cognitive maritime networks by proposing a new cognitive routing protocol for cognitive radio software-defined maritime networks (CR-SDMNs). Our objective is to find the best path between source and destination by selecting the one with maximum path duration among all the paths in the network. Channel selection is done with a belief propagation (BP) algorithm [9] where each ship makes a final decision about the channels' availability based on an iterative combination of beliefs of all neighboring ships. The SDN controllers organize the traffic programmatically by keeping a global network topology. The proposed architecture has one main controller (MC) on land close to the seashore, and numerous local controllers (LCs) that serve as cluster heads (CHs) are in different locations at sea. CHs keep a local network topology by collecting information within each cluster. For intercluster communication, ASVs serve as gateways for relaying data between distant nodes. Ships forward requests to CHs, asking for a stable path to the destination. In response to these requests, the LC provides a route to the destination, if it has; if not, the request is forwarded to the MC.
The significant contributions of this paper are as follows.
(i) A new approach, the cognitive radio softwaredefined maritime network, that itself considers a new approach (SDN) to ensure cognitive routing in the marine environment is proposed to establish a path between source and destination by also ensuring stability. Ships moving for a planned mission are considered clusters, where CHs act as local controllers. The technique includes ASVs for relaying data between marine users close to the seashore and far out at sea (ii) To deal with the issues of limited services collectively in view of the high cost of satellite links, spectrum insufficiency, and large latency, we are the first to consider SDN in combination with cognitive and routing technology in the marine environment In comparison with our previous work [5], this work has the following major differences: The remainder of this paper is organized as follows. Related work is presented in Section 2. In Section 3, we propose a cognitive routing protocol for software-defined maritime networks. Section 4 discusses simulation performance results, while Section 5 concludes the paper.

Related Work
Routing in cognitive maritime networks is more demanding than generic routing protocols in maritime networks. Kong et al. [10] implemented a routing scheme based on 2 Wireless Communications and Mobile Computing aggregated-path in multihop wireless maritime networks. The purpose of this scheme was to deter retransmissions that are caused by large links' duration in maritime communications. The authors presented that aggregated-path routing shows improved performance than conventional single-path routing. To avoid the use of unstable links in maritime wireless networks, the ad hoc on-demand distance vector (AODV) protocol was used [11] to minimize undesirable effects of the marine environment by considering the relationship between sea waves and received signal strength. Similarly, four diverse MANET routing schemes were applied [12] for the marine environment. A comparison was made between these schemes, showing their pros and cons. These schemes show some restrictions due to network sparsity and density in different locations in a marine environment. Among four of these MANET schemes, ad hoc on-demand multipath distance vector (AOMDV) was considered to be competent for marine communications. A maritime two-state (MTS) multihop networking scheme [1] was implemented for the marine environment. The two states are beaconing and predicting states. All marine users must be in one state at a time. The beaconing state allows the exchange of routing information among the marine neighbors, whereas the predicting state determines the location for future correspondence of each ship. The authors achieved better usage of bandwidth for transmission areas of appropriately 10 km. Wen et al. [13] examined a multiple-ship routing and speed optimization issue adhering to time, cost, and environmental objectives. This is the first paper in the maritime literature that addresses a multiple ship scenario in which fuel price, the market freight rate, the dependency of fuel consumption on payload, and the cargo inventory costs were all taken into account to provide useful insights into a balanced economic and environmental performance. Wu et al. [14] employed opportunistic routing for maritime searchand-rescue wireless sensor networks to make better utilization of broadcasting. The information is forwarded depending on the information provided by neighbors only, without requiring flooding in the network. To maintain the information collected by neighbors and to minimize this information cost, they proposed a lightweight, prediction method based on a routing metric in a timely manner. Their results showed that an opportunistic routing protocol with prediction performs better than one without prediction. Kessab et al. [15] provided a new tool for predictions about the satellite-terrestrial station in a hybrid satellite-maritime mobile ad hoc network. They reviewed the shortest path multirelay routing protocol to maintain a bidirectional link between those nodes who intend to communicate. Their results demonstrated that end-to-end propagation delays can be efficiently reduced by the deployment of hybrid stations.
None of the schemes discussed above for maritime networks examined limited spectrum problems induced by limited communication frequencies. To deal with the growing demands of marine users, it is crucial to propose a cognitive routing scheme that considers the limited spectrum problems. Due to the lack of broadband wireless networks at sea, Zhou et al. [16] envisaged worldwide interoperability for microwave access (WiMAX) mesh networks for highspeed and low-cost ship-to-ship communication. Multiple frequency channels are employed in this scheme, and the information about routing is forwarded in a control subframe part. The experimental test was conducted in the ocean near Singapore. The scheme used WiMAX to overcome the issues of wireless networking in a marine environment; however, Ejaz et al. [17] considered channel sensing in cognitive maritime networks for the first time to find a dedicated spectrum in current congested bandwidth allocations. They implemented an entropy-based detection method by considering the optimized samples to balance the effects of sea state in a cognitive radio maritime network. The method considered entropy as a parameter that calculates the on/off PU activity. The authors showed performance improvement with optimized samples for high sea conditions by ignoring the conditions given for the probabilities of detection and false alarm. Tang et al. [18] were the first to present the cognitive technology in an automatic identification system (AIS). They considered the energy detection sensing scheme for finding the white space without interrupting the AIS services. They unlocked new doors for channel sensing in the cognitive maritime environment for licensed bands (VHF).
The cooperative cognitive maritime cyber-physical system (CCMCPS) [19] is an innovative paradigm that achieved rapid and economical communication services for the cognitive maritime community. It was intended that the cyberphysical systems that integrate information communication technology and the vessels which are enabled with sensors could execute novel opportunities, applications, and schemes along with challenges for the maritime community. A biologically inspired cooperative spectrum sensing scheme (BIC3S) [20] is another mechanism to deal with the reliability and energy consumption challenges associated with the marine environment. BIC3S chooses the participating secondary users (SUs) for cooperative spectrum sensing according to their given sea states and provides better adaptation capabilities for the sea environment. Zhang et al. [3] studied the problem of effectively allocating the spectrum to SUs with various preferences in a cognitive marine communication system. The authors proposed a dynamic channel provision method depending on a simplified queuing model and analysed it with a two-dimensional Markov chain. Another hybrid satellite-terrestrial communication system aimed at the fifth generation (5G) [21] was proposed to discuss numerous important problems to apply CR in future 5G satellite communication. The authors proposed a cooperative spectrum sensing algorithm for mobile users of terrestrial and space segments. A cognitive routing protocol in maritime networks [22] was proposed to consider both cognitive and routing technologies in order to deal with the issues of limited spectrum and intermittent connectivity in cognitive maritime communications.
Likewise, studies related to software-defined maritime networks are still in its infancy. Nazari et al. [23] proposed a multipath transmission control protocol (MPTCP) based on a software-defined networking approach for naval ships which relies on several satellite communication systems. The collaboration between two controllers, i.e., MPTCP and 3 Wireless Communications and Mobile Computing the SDN, results in an efficient and robust naval network. A new software-defined wireless network (SDWN) architecture was proposed [24] to enable high performance in the next generation of ship-area networks based on self-organizing time division multiplexing access. Their results achieved the expected throughput by considering node-to-node communication within a ship. Nobre et al. [25] were the first to integrate battle networking (BN) with SDN and established a software-defined battle networking (SDBN) architecture to get more flexibility and programmability in network-centric operations. The authors envisioned the SDBN controller being viewed as a military SDN exchange that integrates different SDN controllers, considering specific communication technologies. Yang et al. [7] integrated SDN and fog computing into a maritime wideband communication system to minimize total weighted tardiness for a single-machine scheduling scenario in order to achieve a minimized delay of weighted uploading packets. The weights are assigned depending on the highest priority information in order to convert the problem of intermittent resource scheduling at sea into a continuous scheduling problem. Another novel software-defined framework was presented in [26] for maritime communication in order to tackle the communication mode barrier in different networks. The authors presented a scheduling scheme by considering the enhanced deep Qlearning algorithm to make optimal strategy quickly and accurately as compared to the traditional scheme. A software-defined cognitive network for the Internet of vehicles (IoV) was proposed in [27] to provide optimal routing by considering reinforcement learning and SDN technology simultaneously. The authors applied the concept of the cognitive capability to sense and learn from the environment of IoV. Their results showed better performance in comparison with two well-known routing protocols in the literature, GPSR and AODV.
All the studies cited above for software-defined maritime networks developed schemes by utilizing satellite communication to improve the performance of maritime networks. We propose a scheme that combines both cognitive and routing technologies without considering satellite communication (because of its high cost and latency) in softwaredefined maritime networks. We are the first to implement this cognitive routing scheme in SDMN that considers channel sensing and routing simultaneously for the marine environment. Table 1 shows a comparative analysis of all described schemes in this section.

Proposed Cognitive Routing Protocol for Software-Defined Maritime Networks
A cognitive routing scheme is proposed in this section for software-defined maritime networks. The purpose of this new routing technique is to resolve key issues in the present maritime communication that cause degradation in network performance. We aim to resolve the issues of the limited maritime spectrum, sporadically connected networks due to constantly changing sea surfaces, high latency (especially due to satellite links), and large amounts of overhead. The idea combines a cognitive capability with a routing scheme in the marine environment by means of SDN as a novel applicant to guarantee reliability and stability among communicating users. By exploiting SDN technology, we propose that ships moving on a planned mission (e.g., naval fleets, courier missions, research missions) are considered a cluster. Each cluster head within a cluster performs the role of local controller (LC). This logically centralized controller is responsible to gather any type of information that is required by any application to exploit the entire network. In this way, the ships which are part of one application within a cluster gather information from the environment and send the collected information to the controller. Our goal is to establish a stable path from source to destination by picking out the channel and the next hop node jointly in a competent and reliable way. A CR-SDMN is shown in Figure 1, where a source ship in a cluster close to the seashore is searching for a stable path to a destination far out at sea and in a different cluster. The CR-SDMN considers S ships, C CHs, and one MC. Mobile ASVs improve network connectivity by relaying traffic under sparse network conditions. ASVs are used to collect and transport data among clusters (intercluster communication) as clusters are usually far away from each other (i.e., outside the transmission range of any cluster member (CM) or CH) in the maritime network, and for communication to and from the MC (when CHs are far out at sea). ASVs move with known trajectories [28] where the path is managed by the MC, and they identify themselves as gateways. PUs are supposed to be located along the seashore, as can be seen in Figure 1. For marine users far at sea, we assume that plenty of TV white spaces (WS) are available for communications. The nodes at deep sea need to sense TVWS at current locations as the availability of WS is possible only at specific locations. One might think of how the MC makes connections with these marine users far at sea. The ASVs provide this connectivity in the same way as described above. This is a 3-layered hierarchical approach in which MC and CHs communicate directly with one another only if the CHs are near the seashore. All the ships are moving, and therefore, for those CHs far out at sea, an ASV is used to collect and transport data to and from the MC, as shown in Figure 2. The cluster members (ships) gather information from all the neighbors and send the gathered data to corresponding CHs (intracluster communication). All CHs exchange the network local view with the MC (either directly or via ASV), so that the MC builds a globalized view of the network.
The CHs decrease the load of the MC by maintaining a local, updated view of the network within their clusters. Generally, a fleet consists of hundreds of nodes; therefore, it is improper for the only controller to monitor several ships moving on a specific mission in the network. Due to this reason, we consider the assumption that ships update one another in a periodic manner and their corresponding CH about their present state on move. Therefore, the MC collaborates with CHs to maintain the globalized network view, and it supports the network to deliver the best stable path by considering the maximum The protocol has two phases: beaconing and route estimation. In the beaconing phase, each cluster selects its CH first, and the ones moving far out at sea select a gateway to make a connection with the MC. Each CM updates its CH with its current state, and each CH provides a localized overview of each cluster to the MC, which keeps global, updated information about the network. For

Wireless Communications and Mobile Computing
simplicity, we assume that CMs must be one or two hops away from a CH, and each ship (either CH or CM) already has the exact position of the MC. Once the selec-tion of CHs is done, the procedure switches to the next phase, i.e., the route prediction phase. The details for each phase are provided in the following subsections. In the beaconing phase, all ships moving on a planned mission in a fleet select a CH by exchanging beacon messages with each other. The beacon message includes ship ID, the position from the MC, and speed. The ships in a fleet move at a constant speed but are at different locations from the seashore. To make each cluster stable, we choose as the CH the one moving closer to the seashore. The CH should be the ship that incurs the lowest cost (i.e., has the highest stability and the more durable link with the MC) from among its neighboring ships in a cluster. Each ship calculates its cost (1/LD) using link duration (LD) and compares it with other members of the cluster, and the ship with the minimum cost announces itself as the CH: where R is the communication range, d MC,j = ððx MC − x j Þ 2 + ðy MC − y j Þ 2 Þ 1/2 and is the distance between the MC and each j ship, and v is the velocity of the ship. As the ships move, it is inappropriate to assume that all the clusters are moving closer to the shore. The ships far out at sea are unable to make a direct connection with the MC. Therefore, to make a stable network, we take advantage of the ASVs moving autonomously at sea with generally preprogrammed routes. Because there are several ASVs in the network, the primary objective is to find the one that will play the role of the gateway and through which measure the querying CH out at sea will announce it as a gateway. To make a stable connection for selecting the gateway node, the CH estimates the connection time (CT) [29] between itself and the moving ASVs and selects a gateway node that has the maximum CT: where Δv CH,a = ððv CH cos θ CH − v a cos θ a Þ 2 + ðv CH sin θ CH − v a sin θ a Þ 2 Þ 1/2 , θ is the angle with respect to the MC, and a is any ASV. Now, the CH of each cluster keeps the MC updated with the network topology of all members within a cluster. The CHs provide a localized overview of each cluster. In this manner, any requesting node, whenever it faces link fragility, can request the controller for an efficient stable path to destination irrespective of searching the route back to the source node for further correspondence. Hence, numerous controllers are employed in this novel approach to reduce the load from a single MC, thereby reducing the entire network delay and overhead.

Route Estimation Phase.
Once the CHs and gateways are selected, the scheme moves to the route estimation phase. When a source ship in any cluster wants to make a connection with a destination ship, it forwards a request to the controller. The primary role of this cognitive routing protocol, which makes it effective, is the approxima-tion of path duration between the source ship and destination ship. In such a rough sea environment, this seems to be a challenging job for any node, especially when ships are far from each other and communication is continuously perturbed by sea waves. To make it possible, we consider the SDN approach so the controllers are in charge of finding the best stable path from the source ship to the destination ship by finding both the channel and relay simultaneously. We identify that some ships are close to the seashore, showing high network density, and therefore establish stable links, while others are far away, making fragile links, thereby deteriorating the entire performance of the network. Moreover, sea waves are also a source of signal fluctuations, which also results in several fragile links. For that reason, we form clusters and announce each CH as an LC. The two controller layers help the ships in providing stable links by keeping an updated network state.
The source sends a request packet directly to the CH. The CH checks whether it has a route in its flow table or not. If it finds a match (the best stable path), it immediately responds to the querying node. If it does not, it sends the request to MC. Now, the controller that could be CH or MC, depending on the scenario, is responsible to estimate the best path towards the destination in the following way. Any MC or CH first calculates the path duration of the entire paths, P, from the source ship to the destination ship as follows: where p = 1, ⋯, P, Th is the total number of hops making up each path between the source and destination, and link estimation time (LET ij ) is calculated as: where min ðCh 1 , Ch 2 , ⋯, Ch M Þ signifies the channel having the maximum belief in a set of free channels between ship i and ship j, whose details will be provided shortly in the subsequent subsection. Because two ships (either CM and CH, or CM and CM) can only make a link if there is a consensus about a free channel, the beacon message sent by a source node is an extended beacon message. This extended beacon message contains ID, position, channel state, and speed. Lastly, the controller discovers the best route,r, to the destination: The source ship, after getting the best path/route, begins communicating data. As the scheme is a cognitive routing scheme, finding the maximum path duration is therefore enhancing the network constancy. This ultimate route is depending on the path duration (i.e., how long a link shows stability between two ships that are intending 7 Wireless Communications and Mobile Computing to communicate). If any middle node declines to maintain stability, it repeats the above process to reach a closer CH irrespective of sending requests back to the source ship. Accordingly, the SDN technology decreases delay by decreasing the amount of control messages. Figure 3 explains the complete algorithm by presenting how the ships first select the CH and then communicate, either with their corresponding CH or the MC, to discover the final path that maximizes path duration from the entire paths between source ship and destination ship.

Selection of Spectrum Using Belief
Propagation. This subsection clarifies in what way ships sense the free spectrum and combine the local sensing results with one another and with the corresponding CH. Each ship periodically senses the channel and stores the sensing result in its own sensing table. BP [9] is a method that calculates marginal probabilities (i.e., beliefs) by combining local results in an iterative manner. The primary phase of this algorithm is to calculate localized sensing results. To find whether PU is present or not, each ship senses the channel using an energy detection scheme. Energy detection is the simplest detection scheme as it has a small sensing time and is beneficial when no or little knowledge of PU signal is provided. Also, due to its capability to be adapted in all kinds of deterministic signals, energy detection is an appropriate scheme for cognitive maritime networks. PUs are incumbent users that can be oil/gas platforms or large vessels utilizing licensed bands, such as HF and VHF [19]. We study the TV spectrum as a cognitive radio spectrum in this novel scheme, and we divide this TV band into M channels, where the activity of PU is demonstrated as an exponential on/off activity pattern. Channel sensing is performed by each ship using the binary hypothesis standard as follows: where i = 1, 2, ⋯, S ðships in the networkÞ,s i ðtÞ is the complex primary signal obtained by ship i, and n i ðtÞ is the complex additive white Gaussian noise. Thus, the energybased statistic in the discrete domain is provided as follows: where N is the product of time and bandwidth and e x i ½n is the conjugate signal of x i ½n.
Creating a marine environment is a demanding job. Pierson and Moskowitz [30] define the sea movement caused by sea waves by distributing sea states into 10 levels. A measure of the movement of sea surface using substantial wave height, wave period, and wavelength as parameters is defined as sea state. Each sea state has its own wave height, average period, and average wavelength. The movement of the sea changes the alignment of an antenna, which influences the power of the received signal. We suppose that antennas are omnidirectional in the horizontal plane, so due to sea movement, tilting of antenna masts accounts for a change in antenna gain that influences the power of the received signal. Hence, various  Figure 3: A flowchart representing the proposed algorithm. 8 Wireless Communications and Mobile Computing ships experience a different signal-to-noise ratio (SNR), which is considered as follows: where N o W is the total noise power and P R i is the received power computed as: PLðd o Þ is the path loss calculated at a reference distance from the transmitter, and X f is a Gaussian random variable with zero mean and standard deviation, specified as σ f = ½0:157f + 0:405 × h s : Each ship computes its local decision as an a posteriori probability, which is calculated as: where f ∈ M,Pðx i | H h Þ is the probability density function of normally distributed random variable x i conditioned on H h , ðh = 0, 1Þ. Pðx i Þ is a normalizing constant, and PðH h Þ is the prior probability, which is assumed to be uniform for all ships. To calculate the belief about the state of ship j as estimated by ship i, ships i and j within the communication range of each other exchange messages as follows: μ f ij ðH j Þ describes the belief of ship j as predicted by ship i, w is the weighting factor, the term k ∈ ðN i − fjgÞ defines how k only goes to the neighbors of i and not to the neighbors of j, and ψ f ij ðH i , H j Þ is a compatibility function, which is defined as: Lastly, the belief of each ship is computed as follows: Depending on these beliefs, each ship generates the ultimate decision about the spectrum in which it is moving as follows: Now, the term min ðCh 1 , Ch 2 , ⋯, Ch M Þ in (4) is described as the spectrum that has the maximum belief among the entire beliefs for a set of free channels, where the value of Ch f * for idle channel f * ð f * = 1, ⋯, MÞ between ship i and ship j is computed as

Performance Evaluation
The proposed scheme was evaluated in NS-2 using the module for cognitive radio ad hoc networks. In this scheme, ships S were moving in three different clusters, each with a communication range of 200 m in a target area of 5000 m × 5000 m. The speed of the ships within a cluster was constant. However, different clusters moved at various speeds up to a maximum of 15 m/s. Two ASVs were used, each moving at 20 m/s and with a communication range of 300 m. The spectrum band was divided into M = 5, and each channel could be occupied by one of two licensed PUs, each with a communication range of 500 m. These PU nodes were fixed nodes on land, and their activity was modeled as an exponential on/off activity pattern with rate parameter 0.05. We consider the TV signal as a PU signal in this study. One MC was on land close to the seashore. The number of ships varied from 10 to 35. The value η = 0:9 meant the two states H i and H j are highly correlated and, hence, yield a large probability for H i = H j . The path loss model described in (10) was used for simulation. A moderate sea state with a wave height between 1.83 m and 2.29 m [30] was used to evaluate the simulation results. Random values of wave height were generated. Therefore, the SNR value for each ship changed continuously. The source is selected randomly from cluster 1 (close to the seashore) and destination from cluster 3 (far at sea). Our simulation results are an average of more than 70 runs. These simulation parameters are listed in Table 2.
As claimed in sections I and II, there is not one publicly recognized cognitive routing protocol for a CR-SDMN that provides the combination of a cognitive capability with a routing technique by considering the SDN technology. Hence, we chose to make a comparison of our proposed scheme with a hierarchical software-defined VANET (HSDV) [32] and an expected path duration maximized routing (EPDM-R) [33] algorithm. These protocols were actually proposed for vehicular networks. Because two 9 Wireless Communications and Mobile Computing networks are bothered by topological constraints, and a vessel at sea is equivalent to an automobile in traffic, we simulated these protocols in a sea environment just by reason of comparison. Moreover, with the aim of making HSDV a cognitive routing scheme, we evaluated it jointly with the spectrum sensing scheme implemented by Tang et al. [18] for cognitive maritime networks and denote it as the Cog-HSDV. In HSDV, the controller is in charge of selecting the next hop by creating links depending on the nearest distance to the destination. But our proposed scheme approximates the path duration based on calculating stable links and then finds the best path based on maximum path duration. Another motive for selecting HSDV is that both schemes decrease the load on the MC by using numerous LCs to keep a localized network view. To evaluate the impact of utilizing controllers in our proposed scheme, we made another comparison with an EPDM-R that does not consider SDN, and we denote it as the Cog-EPDM-R. This protocol is like AODV, which finds the best path between the source and destination among the entire possible paths. We used three metrics to assess the performance of our proposed scheme: (A) End-to-end delay (B) Packet delivery ratio (C) Routing overhead ratio Figure 4 shows the performance of end-to-end delay as a function of the number of ships, with different probabilities of the PU being idle as a parameter. End-to-end delay is defined as the time difference between the starting time and the ending time of a packet that is destined to the destination ship and originated from source considering all the hops in between. Figure 4 illustrates a comparison of our proposed scheme with the SDN-based (Cog-HSDV) and non-SDNbased (Cog-EPDM-R) reference schemes. The network delay decreases as the network density (number of marine users, i.e., ships) in the sea increases. All the schemes follow the same pattern, i.e., when increasing the network density along with increasing the probability of the idle state of the PU, the delay decreases. This is due to the connectivity in the network that increases with the network density. However, in the second case, the high probability of the idle state of PU means that the number of free channels in the network increases. When the network density is low, i.e., the network is sparse (from 10 to 15 nodes), the end-to-end delay is high for all the proposed and reference schemes. This is for the reason that the requesting ship does not discover any other relay ship to establish a stable connection (under low network density) and hence suffers from a large delay. But in our proposed scheme, the CHs allow a querying ship to make a stable connection by connecting with a gateway that serves as a relay node, even under low network density. Hence, choosing the CHs in the proposed scheme additionally decreases the delay. When these CHs have a path to the destination, they respond to the requesting ship with the updated information regardless of asking the MC for route and in that way decrease end-to-end delay. Therefore, our goal is to keep the stability of the network by providing the best path from the source ship to the destination ship. That is the reason our proposed architecture demonstrates less delay in comparison with both reference schemes. The Cog-HSDV scheme in Figure 4 chooses the next ship depending on the distance only, while our proposed scheme computes the link estimation time, which contains both the speed and direction of the ships. In the Cog-EPDM-R scheme of Figure 4, each ship chooses its next relay ship to establish a stable link, hop-by-hop, which experiences a large  Figure 4 presents that the decrease in the probability of PU being idle decreases entire the network performance. When the probability is decreased, the number of free channels in the network also decreases; thus, the network performance decreases. In comparison with other channel sensing schemes, the BP algorithm in our proposed protocol surpasses the channel sensing method of the reference approaches. The BP algorithm improves the hypotheses precisely that are concerned with channel availability. Consequently, the entire network performance in terms of end-to-end delay for our proposed approach outperforms the other two approaches. Figure 5 shows the performance of the packet delivery ratio as a function of the number of ships, with different probabilities of the PU being idle as a parameter. Packet delivery ratio is defined as the ratio of the total number of packets delivered to the destination ship to the total number of packets generated by the source ship. The delivery ratio for the entire scheme follows the same pattern, i.e., by increasing the network density, the delivery ratio increases. The SDN technique enhances the delivery ratio due to the logically centralized controller that keeps the globalized network view by dictating all the nodes in the network. In the Cog-EPDM-R, a requesting ship has to choose the next relay ship hop-by-hop until it delivers the message to the destination. To do so, it may face high link fragility due to the constant movement of the sea's surface. Furthermore, for each unstable connection, the approach needs to keep the entire ships informed from source to destination about the present state of the network. But in our proposed scheme, the MC maintains a global network view in such a way that the MC regulates the entire information about the free spectrum and relay ships for every cluster in the network. Consequently, by estimating the path duration, the MC delivers the best stable path from source to destination to each requesting ship. Moreover, in any circumstance of an unstable connection due to the absence of any ship or spectrum, the requesting ship directly requests the MC for a path update regardless of searching for a route back to the source ship. Therefore, our proposed scheme provides more stable routes which as a result increase both the delivery ratio and the network stability. Figure 5 also presents that our proposed scheme surpasses the Cog-HSDV, even though the two approaches are SDN-based. The reason for this is the route selection that differentiates the two schemes. Choosing the closer ship to the destination (geographic-based) only generates additional intermittent links, which reduces the delivery ratio. Moreover, we can see that for all the schemes, the delivery ratio decreases with the decrease in the number of free channels in the network. This is due to the same reason as mentioned above; the number of idle channels increases with the increase in the probability. When the probability of PU being  idle is low, there are less chances for ships to establish a stable connection, because they do not discover a mutual free channel. A low idle probability means that a ship may not select a CH because it does not find a mutual channel among the two, thus reducing the chance for CM-to-CH communication.
Consequently, the performance deteriorates when the probability of the PU being idle decreases. Figure 6 presents the performance of the routing overhead ratio as a function of the number of ships, with different probabilities of the PU being idle as a parameter. The routing overhead ratio is defined as the ratio of the number of control packets to the entire number of packets in the network. From the figure, we can realize that the overhead ratio rises with a rise in the quantity of ships and with a reduction in idle probability under both the proposed and reference approaches. But, the overhead ratio of SDN-based approaches presents the performance improvement when compared with the non-SDN-based scheme. This is because of the logically centralized controller, which decreases the amount of control messages in the entire network. Each requesting ship in the SDN-based approach communicates with the controller (either MC or LC) each and every time when it encounters a mismatch or it needs any update about the path. Though, in the non-SDN-based scheme, the requesting ship forwards beacon messages to the entire ships in the neighbors to get every update about the present state of the network. Accordingly, with high network density, the update rate of messages is also high. Our proposed scheme surpasses both reference schemes. The reason for this improvement is the main controller, which maintains a globalized record of the entire information because of the cooperation between the CHs with the help of ASVs. Furthermore, choosing the maximum stable path from the source to the destination by calculating the maximum path duration at the controllers decreases the entire overhead in the network. Instead, choosing the path based on the distance in the reference scheme with SDN presents deterioration in the network performance in terms of the overhead ratio, because the stability is not guaranteed. Figure 6 also presents that reducing the probability of the PU being idle raises the overhead. The maximum values of these results discussed above with the maximum probability of being idle are shown in Table 3.

Conclusions
A new routing scheme is proposed in this article for cognitive radio software-defined maritime networks. The scheme is novel in the sense that we are the first who combine both cognitive and routing technologies in software-defined maritime networks. This is a 3-layered hierarchical approach with two phases: beaconing and route estimation. The network management is controlled by the main controller, whereas CHs that serve as local controllers decrease the amount of control messages as well as the network delay. The ships are moving in clusters at different positions from the MC. Therefore, CHs that are close to the shore make a direct connection with the MC, while the CHs far out at sea consider ASVs as gateways to relay the data to and from the MC. ASVs are moving on fixed routes and are also used to relay data through CHto-CH communication. The controllers are in charge of providing a stable path from any source ship to a destination ship requested by any querying node. Two nodes can only communicate if they both show an agreement on a mutual free channel. A belief propagation algorithm is used to collect the local sensing results of each ship in order to make a global decision. Our results show better performance in end-to-end delay, packet delivery ratio, and routing overhead ratio.
Since we have shown improvement in all the three metrics in comparison with two reference schemes, there are still some weaknesses that exist while applying the SDN approach. The centralized controller must be in its active state; otherwise, the whole protocol depends only on the localized views of the network that would cause a problem in finding different paths. The performance depends on the connectivity of different nodes. The larger the nodes are connected, the higher the chance of successful delivery of messages. We will further explore these issues in our future work. Moreover, we will test the proposed solution with a real marine traffic dataset and extend the scheme for different marine applications in integration with the underwater environment for different numbers of PUs in near future.

Data Availability
Data is not available.

Conflicts of Interest
The authors declare that there is no conflict of interest regarding the publication of this paper.