## 3 Proposed Quality of Service Routing Protocol (QoSRP) in UWSNs
### Underwater Acoustic Channel Detection (UWCD) Algorithm
This detection technique can improve the sensing detection, however, it requires prior knowledge of the primary signal characteristics. In addition, the high computational complexity and significantly extensive sensing delays are the other shortcomings of this approach. The EnD is the widely used channel detection method, which does not require any previous knowledge of the \(\mathcal{PU}\) signals. This method identifies the primary user's signals based on the sensed energy, where the received signal strength indicator or acoustic-frequency energy is computed to find whether the channel is free or not. Initially, an input signal to obtain the required bandwidth is filtered through a band pass filter and then the obtained signal is squared and combined over the observation interval. Lastly, to find the presence of a primary user signal a predetermined threshold is compared with the output of the integrator. Generally, fast Fourier transform-based techniques are used to analyze the spectral in the digital domain. In particular, in a specific time window, the received signal is sampled and passes through fast Fourier transform equipment to obtain the power spectrum. Then, the power spectrum peak after windowing is detected in the frequency domain. This technique provides better channel detection in underwater since it does not need any previous information about the \(\mathcal{PU}^{\prime}\)\(\beta\) signals. However, the high noise, interference, fading, and multipath effects increase the probability of sensing errors in terms of false alarms \((\mathcal{FAR})\) or miss-detection \((\mathcal{MID})\), which leads to poor channel detection performance in UWSNs. Hence, it is highly desired to reduce the sensing errors during channel detection to enhance the usage level of the vacant channel and to minimize the collision probability with \(\mathcal{PU}\) transmissions. In this respect, the detection threshold that precisely detects the presence of primary signals plays an important role in the multichannel acoustic sensor networks (MCASNs). The less error in computing the SNR value decreases the probability of \(\mathcal{FAR}\) in UWEs. However, there exists a limit for the noise level. The increase in noise level above this limit increases the probability of \(\mathcal{FAR}\) while it reduces with the decrease in noise below this threshold level. In the proposed scheme, the channel detection threshold level is determined by considering the various underwater environment parameters and set to a minimum level of the transmitted signal power value in the underwater. This detection sensitivity identifies the received SNR ratio at the secondary user (\(\mathcal{SU}\)) with a satisfied probability of detection conditions in MCASNs. Thus, the optimal channel detection threshold significantly reduces the sensing errors, enhance spectrum utilization and provides enough protection to \(\mathcal{PU}\) transmissions in the MCASNs. In the designed scheme, a simple and effective energy detection mechanism appropriately detects the existence of the \(\mathcal{PU}\) signal based on its received energy by comparing it to a detection threshold. Herein, we employ an energy-based signal detection \((E)\) method revealed in [37] to identify idle spectrums in UWSNs. The key objective function of the EnD mechanism \(\left(\phi_{UWCD(1)}\right)\) of the proposed algorithm is numerically indicated as:  
\[\forall\ \dot{\epsilon}=\ \{1,2,\ldots,n\};\forall\ \dot{\mathcal{J}}=\ \{1,2, \ldots,m\};\forall\ \dot{\mathcal{R}}=\ \{1,2,\ldots,\ell\};\]  
\[\phi_{UWCD(1)}=\sum_{i=1}^{|n|}\underset{i}{\max}\rho_{\mathcal{D}e\mathcal{T }}+\underset{i}{\min}\rho_{\mathcal{F}\mathcal{A}_{i}}+\ \underset{i}{\min}\rho_{M\mathcal{ID}} \tag{1}\]  
The key aims of the objective function is to maximize the probability of detection \((\rho_{\mathcal{D}e\mathcal{T}})\) and minimize the probability of \(\mathcal{F}\mathcal{A}_{i}\)\((\rho_{\mathcal{F}\mathcal{A}_{i}})\) and missed-detection \((\rho_{M\mathcal{ID}})\) in UWSNs.