# Cognitive Routing in Software-Defined Underwater Acoustic Networks
## 3 Proposed Cognitive Acoustic Software-Defined Underwater Network
This is a four-layered hierarchical network scheme where the first two layers (MC and LCs) communicate directly with each other while gateways (the third layer) are used between sensor nodes (the fourth layer) and the AUVs, as shown in Figure 1. These gateways collect data from all neighboring nodes and store this information until passing it over to the LCs. The double-layering of controllers (MC and LCs) improves network performance in terms of delay and overhead. Both natural acoustic systems (e.g., marine mammals) and artificial acoustic systems (e.g., sonar systems) play the role of primary users (PUs), as shown in Figure 1. All sensor nodes periodically update their current network state with each other and send the gathered information to LCs (either directly or via gateways). All LCs share their localized view of the network with the MC, such that the MC establishes a global network view. The protocol has two phases: beaconing and route estimation. The beaconing phase establishes the global and localized network states for the MC and LCs, respectively, and updates all the sensor nodes with the current network state. In the route estimation phase, a querying node sends a route request message to an LC. On receiving the message, the LC checks its flow table to determine if it has an updated route to the destination. It quickly responds to the source node without contacting the MC if it finds the updated route in its flow table. In the following subsections, we will discuss each phase in depth. 1. _Beaconing Phase_: In the beaconing phase, all sensor nodes (either gateways or conventional nodes) send a beacon message to their neighbors. The beacon message includes node ID, depth, channel state, and speed. Channel state is the presence or absence of the primary user (PU), which will be explained in the next subsection. The MC sends a request message to the LCs in order to maintain the global network state. Each LC forwards this message to all the nodes within transmission range. By doing so, gateway nodes exchange the gathered data with the LCs, which forward it to the MC. The gateway nodes identify themselves as a gateway (an extra entity) in the beacon message. At the conclusion of this phase, all the communicating nodes in the network are aware of the updated network state. In this way, any querying node, whenever it comes across link  
Figure 1: Cognitive acoustic software-defined underwater network (CA-SDUN). SDN: software-defined networking; PU: primary user. fragility, can ask the controller for an updated stable route to a destination without sending the packet back to the source node. 2. _Route Estimation Phase_: When a source node wants to communicate with the destination node, it sends a request message to the controller. The foremost part of this cognitive routing scheme that makes it efficient is the estimation of path duration between source and destination. This is a challenging task for any source node in an underwater environment when one kind of PU includes marine mammals. To make it possible, we apply the SDN technique so that the controllers are responsible for providing the best stable route between source and destination by jointly selecting both channel and relay. We all know that the unpredicted movement of marine mammals makes the underwater environment more challenging, which results in several fragile links. For that reason, the two layers of controllers help the sensor nodes with the provision of stable links by keeping an updated network state. There are two possibilities for the source node: either it is outside the transmission range of an LC, or it is within transmission range of an LC. Case 1: _Source outside transmission range_ The source node needs to find the best relay node to reach any gateway when it is outside the transmission range of any LC. The source sends a beacon message to all neighboring nodes and calculates the transmission delay for each node within transmission range.