# An Integrated Cognitive Radio Network for Coastal Smart Cities
## 2 Integrated Cognitive Hybrid Communications for a Coastal City
### Belief Propagation-Based Channel Selection Algorithm
The term \(Ch_{f^{*}}\) for the idle channel \(f^{*}(f^{*}=1,...,M)\) between vehicle/ship \(i\) and vehicle/ship \(j\) is calculated as \(Ch_{f^{*}}=1-min\left(b_{i}^{f^{*}}(H_{0}),b_{j}^{f^{*}}(H_{0})\right)\). Hence, the path is selected by choosing, hop-by-hop, the highest Q-values for each link between the source and destination. The lower the value of \(TD\), the higher the reward. In order to make the convergence faster in a mixed (terrestrial plus marine) environment and to reduce latency, we used (1) to update the Q-values. To generate a marine environment for an integrated coastal city, we considered the similar division as described by [PERSON] and [PERSON] [22]. They divided sea states into 10 different levels and measured each level by using a significant wave height, wave period, and wave length as parameters. Due to the continuous movement of the sea surface, different ships receive different power levels of the received signal, thereby resulting in different signal-to-noise ratios (SNRs), which is defined as:  
\[\gamma_{i}=\frac{P_{R_{i}}}{N_{o}W} \tag{10}\]  
where \(N_{o}W\) represents the total noise power, and \(P_{R_{i}}\) is the power received at each ship \(i\), which is calculated as follows:  
\[P_{R_{i}}=P_{T}-PL \tag{11}\]  
\(P_{T}\) and \(PL\) are the transmitted power and path loss, respectively. For the sea environment, path loss \(PL\) is a function of frequency \(f\) and sea surface height \(h_{s}\), and was defined by [PERSON] and [PERSON]\({}^{\prime}\)[PERSON] [23] as follows:  
\[ \begin{split} PL(h_{s},f)=PL(d_{o})+10+[(0.498\,log_{10}(f)+0.79 3)h_{s}+2]\\ log_{10}\left(\frac{d}{d_{o}}\right)+X_{f}\end{split}  \tag{12}\]  
\(PL(d_{o})\) defines the path loss model which is measured from the transmitter at a reference distance \(d_{o}\), and \(X_{f}\) is a Gaussian random variable with zero mean and standard deviation, given as \(\sigma_{f}=[0.157f+0.405]\times h_{s}\). Figure 3 presents the complete algorithm by describing in what way the user benefits from the integrated cognitive coastal city network. The nodes (moving vehicles and ships) periodically exchange messages with each other and with the corresponding LCs in order to maintain an updated network state. The exchanged information is their IDs, positions, velocities, and channel states. To keep from discrimination among different communicating nodes, we used the v_ID, v_position, v_velocity, and v_channel for vehicular communications, and s_ID, s_position, s_velocity, and s_channel for marine communications. The channel state represents the existence and nonexistence of the PU in the network. This updated information is exchanged between LCs and the SDN controller, respectively, so that an updated local and global network topology is maintained. Accordingly, whenever a user demands a service, it sends an SRM to an LC. The LC replies with an SPM if it has a route to the destination of the querying node; otherwise, it asks the SDN controller for the SPM. The SPM in this paper is a stable route calculated with (1). The SDN controller sends the SPM back to the LC if it has a route for the querying node; otherwise, it requests the service from the corresponding VNFs if the VNF for that service was already launched by NFV. If not, it sends the SRM to the NFV to launch the corresponding VNF and provide the service. Figure 3: A flowchart representing the proposed architecture.