## 4 The Trust Evaluation Process
### Trust Calculation for One-Hop Neighbor Nodes
#### 4.2.1 Direct Trust Calculation for One-Hop Neighbor Nodes
According to the broadcasted coordinates, each anchor node can calculate the distances \(l_{ij}\) to its neighbor nodes. At the same, the distances \(l_{c}\) can be obtained by sound-ranging techniques, e.g., ToA (Time of Arrival), TDoA (Time difference of arrival), RToF (Round Trip time of Flight). For two neighbor anchor nodes \(i\) and \(j\), we calculate their distance by  
\[l_{ij}=\sqrt{\left(x_{i}-x_{j}\right)^{2}+\left(y_{i}-y_{j}\right)^{2}} \tag{7}\]  
If \(|l_{ij}-l_{c}|>l_{th}\), where \(l_{th}\) is the maximum ranging error, the received packet can be judged as including wrong coordinate information. In UWSNs, the bit error rate (BER) of underwater acoustic channel is very high, thus the wrong coordinate information may be caused by BER. We cannot directly judge whether the neighbor node is trusty or not based on the result of a calculation from Equation (6). Therefore, we propose that node \(i\) record the number of correct packets and wrong packets from node \(j\) as \(n_{c}\) and \(n_{r}\), respectively. In each time period \(T\), we obtain the number of neighbor node's cooperative and non-cooperative behaviors as  
\[\left\{ \begin{array}{l}n_{1}=n_{s}+n_{c}\\ n_{2}=n_{f}+n_{r}\end{array} \right. \tag{8}\]  
Therefore, based on packet loss and packet error, the trust of node \(j\) is calculated by  
\[T_{ij}=\frac{n_{1}+1}{n_{1}+n_{2}+2} \tag{9}\]  
In each time period \(T\), node \(i\) can calculate trust value of node \(j\) for \(N\) time. How to combine the \(N\) calculated trust values to evaluate the trust relationship is the essential problem to research in the trust model. In underwater environment, the acoustic communication and the behaviors of packet exchanges are uncertainty, thus the calculated \(N\) calculated trust values are different. The usually used average method and the median method cannot deal with the uncertainty characteristic of acoustic communication. Thus, in this subsection, we adopt cloud theory to calculate the sensor node's direct trust based on the \(N\) trust values, since cloud theory are well used to describe uncertainties relationship, e.g., fuzziness and randomness [35]. For any trust attribute \(x\), if \(\forall x\in X\), where \(X\) is a trust evaluation domain denoted with accurate value, there is a mapping \(\mu\) satisfies that  
\[\mu:X\rightarrow[0,1],x\rightarrow\mu(x)\in[0,1] \tag{10}\]  
then, the distribution of \(x\) in the domain \(X\) is called trust cloud. Cloud model has three digital features \((E_{x},E_{n},E_{e})\). \(E_{x}\) is the excepted value of the attribute, which reflects the central trust value. \(E_{n}\) is the entropy of the attribute, which reflects the trust ambiguity of \(E_{x}\). \(E_{e}\) is the hyper entropy of the attribute, which reflects the uncertainty of \(E_{n}\). For any \(x_{i}\), we can obtain \((E_{xi},E_{ni},E_{ei})\) as follows:  
* Step 1. Computing the mean value \(\overline{x_{i}}\) and the variance \(S^{2}\) of \(x_{i}\), \(\overline{x_{i}}=\frac{1}{n}\sum\limits_{i=1}^{n}x_{i}\), \(S^{2}=\frac{1}{n-1}\sum\limits_{i=1}^{n}\left(\overline{x_{i}}-x_{i}\right)^{2}\). * Step 2. Computing \(E_{xi}\), \(E_{xi}=\overline{x_{i}}\). * Step 3. Computing \(E_{ni}\), \(E_{ni}=\sqrt{\frac{\pi}{2}}\times\frac{1}{n}\sum\limits_{i=1}^{n}\left|E_{xi}- x_{i}\right|.\)
* Step 4. Computing \(E_{ei}\), \(E_{ei}=\sqrt{S^{2}-E_{ni}}^{2}\). Therefore, according to the \(N\) calculated trust values \(T_{ij}\), we can obtain the direct trust \(T_{d}(E_{x},E_{n},E_{e})\) based on the excepted value, the entropy and the hyper entropy of the attribute \(T_{ij}\).