## 3 Proposed Quality of Service Routing Protocol (QoSRP) in UWSNs
### Underwater Acoustic Channel Detection (UWCD) Algorithm
Consequently, the test statics of energy detection \((\mathcal{T}_{\text{E}D})\) of the received signal at the \(\mathcal{SU}_{\dot{\epsilon}}\) can be numerically written as:  
\[\mathcal{T}_{\text{EnD}}=\sum_{n=1}^{\mathcal{L}_{s}}\left|\text{E}\mathcal{S} _{\mathcal{L}}[n]\right|^{2} \tag{2}\]  
subject to:  
\[\mathcal{S}_{\mathcal{L}}[n]\leq\tau_{\zeta}; \tag{2a}\] \[0<\mathcal{M}_{\text{S}g(i)}\leq M\text{s}g_{\text{S}g(i)}\leq 1;\] (2b) \[n>1\leq k;\] (2c) \[\text{E}\mathcal{S}_{\mathcal{L}}[n]\geq\text{E}_{\zeta};\] (2d) \[\rho_{\epsilon}\leq\ \rho_{\epsilon}(\epsilon)<1;\] (2e) \[\tau_{\zeta}>0\ 1\leq\zeta\leq\text{T}\ \forall n\in\mathcal{PU}_{ \dot{\mathcal{J}}};\] (2f) \[\forall\ \dot{\epsilon}=\ \{1,2,\ldots,n\};\forall\ \dot{\mathcal{J}}=\ \{1,2, \ldots,m\};\forall\ \dot{\mathcal{R}}=\ \{1,2,\ldots,\ell\};\]0 (2g) \[\forall\ \dot{\epsilon}=\ \{1,2,\ldots,n\};\forall\ \dot{\mathcal{J}}=\ \{1,2, \ldots,m\};\forall\ \dot{\mathcal{R}}=\ \{1,2,\ldots,\ell\};\]1  
In Equation (2), \(\text{E}\mathcal{S}_{\mathcal{L}}\) and \(\mathcal{S}_{\mathcal{L}}[n]\) are, the received signal energy and the \(n\)-sample of the \(\mathcal{S}_{\mathcal{L}}\) while \(\mathcal{L}_{s}\) is the sum of the length of \(n\) samples over an interval which helps to obtain a level of performance under certain \(\mathcal{SNR}\) conditions in the network. The number of samples collected by individual \(\mathcal{SU}\) depends upon the sensing time and the longer sensing delay within in predefined time intervals leads to better detection performance of the primary signals. However, the longer sensing time results in less available time for packets transmission, which minimizes the throughput of the \(\mathcal{SU}_{\dot{\mathcal{J}}}\) is constrained by Equation (2a). Moreover, due to additional sensing time the cooperation overhead with the increasing number of cooperating users' increases, which lead to a huge volume of information that need to process by the requested \(\mathcal{SU}\) to make a local decision is constrained by Equation (2b). Therefore, the number of samples of the received signal energy of \(\mathcal{L}_{s}(n)\) such that \(n>1\) using the central limit theorem over an interval are considered to obtain some level of performances under certain \(\mathcal{SNR}\) conditions is constrained by Equations (2c) and (2b) in the network. Therefore, it is indicated as one of the basic functions of the \(\mathcal{SNR}\) in the UWEs. The transmission of \(\mathcal{PU}\) signals is a random process, which follows an independent identically distributed pattern with mean zero and variance \(\sigma_{s}^{2}\). In the underwater, the noise \((n_{\text{\emph{oise}}})\) is a real-valued Gaussian variable that considers various underwater environment parameters with zero mean and variance \(\sigma_{s}^{2}\) is constrained by Equation (2e) within a certain error probability. Constraints in Equations (2f, h) satisfy the limits in the network. To this end, the \(\mathcal{SNR}\) in the underwater at the \(\iota\)th secondary user \(\mathcal{SU}_{\iota}\) is computed as \(\mathcal{SNR}(\mathcal{SU}_{\iota})=\left|\mathcal{C}_{g}\right|^{2}\sigma_{s}^ {2}/\sigma_{e}^{2}\). The primary user signal and noise are assumed to be independent and therefore a binary hypothesis testing problem of received energy signals at the \(\mathcal{SU}\) can be formulated as:  
\[\mathcal{T}_{\mathrm{En\mathcal{D}}}(\mathcal{SU}_{\iota})_{\mathcal{S}_{ \mathcal{L}}}=\sum_{ \begin{subarray}{c}\iota=1\end{subarray} }^{m}\bigl{|} \boldsymbol{n}_{\sigma(\iota)}\bigr{|}^{2}\in\,\mathcal{H}_{0} \tag{3}\]  
\[\mathcal{T}_{\mathrm{En\mathcal{D}}}(\mathcal{SU}_{\iota})_{\mathcal{S}_{ \mathcal{L}}}=\sum_{ \begin{subarray}{c}\iota=1\end{subarray}