## 5 Simulation
### Results  
As shown in Figure 4, regarding the change of the average trust of normal UW-sensors and MNs in the UWSNs during the attack between 0-100 rounds, the average trust of the normal UW-sensors of the proposed scenario fluctuated between 0.55 and 0.65, and the MNs' average trust value of the UW-sensors stabilized between 0.4 and 0.5 after 10 rounds of updating the trust value, so in the previous section setting the MN detection of the threshold set to 0.5 was accurate. The threshold of 0.5 is the data point obtained from the simulation experiment. Because the scheme calculates the impact of the environment on data transmission, the threshold of 0.5 depends on the network and is not fixed. As shown in Table 3, to test the detection accuracy of the proposed scheme for MN, the simulation experiment was set up with 100 underwater nodes, 150 rounds, and ratios of MN from 10% to 30%. The simulation experiment shows that the increase in the ratio of the MNs for the proposed scheme puts a greater burden on the detection accuracy of the proposed scheme. The detection rate of MNs decreased slowly with the ratio of MNs, but the reduction in MN detection rate was relatively small, indicating that the trust model \begin{table}
\begin{tabular}{c c} \hline \hline
**Simulation Condition Settings** & **Value** \\ \hline Number of nodes & 50–150 \\ Space measuring & \(1500\times 1500\times 1000\) m \\ Initial energy & 1000 J \\ Frequency & 20 kHz \\ Packet size & 50–100 bytes \\ Data rate & 4 kbps \\ Transmission power & 10 W \\ Receiver power & 2 W \\ Communication range & 700 m \\ Malicious node & 10–30\% \\ Idle power & 15 mW \\ Sink node & 1 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Simulation condition settings. used by the proposed scheme has strong reliability for the detection of MN, as well as the ability to resist stress. As shown in Table 4, to detect changes in the detection accuracy of the trust model proposed by our scheme for MNs according to the number of rounds, the simulation experiment was set to 100 underwater nodes, 100-300 rounds, and a rate of 20% of MNs in the underwater nodes. The simulation experiments showed that the detection rate of MNs increases with the increase in UWSN operation time. This is because the proposed scheme detects the MNs and quickly isolates them from the UWSNs to mitigate the impact of MNs on the UWSNs. With the increase in simulation rounds, the model will evaluate the MNs in the network more accurately, indicating that the trust model used by the proposed scheme is more reliable in evaluating MNs. As shown in Figure 5a, regarding the simulation results of energy consumption (the average remaining energy of the network node) versus the UWSN operation time when the simulation experiment has 100 underwater nodes, the proposed scheme has a relatively low energy consumption compared to the other schemes as the increase in UWSN operation time. Figure 5b shows the results of AEC per \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Simulation Rounds** & **100** & **150** & **200** & **250** & **300** \\ \hline DOS & 0.823 & 0.858 & 0.872 & 0.891 & 0.907 \\ Black hole attack & 0.948 & 0.952 & 0.959 & 0.963 & 0.975 \\ Gray hole attack & 0.852 & 0.871 & 0.889 & 0.906 & 0.912 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Malicious node detection accuracy with Simulation rounds. Figure 4: Average trust values of nodes during simulated attack with respect to rounds. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**MN Ratio** & **10\%** & **15\%** & **20\%** & **25\%** & **30\%** \\ \hline DOS & 0.846 & 0.862 & 0.858 & 0.859 & 0.853 \\ Black hole attack & 0.948 & 0.956 & 0.952 & 0.943 & 0.935 \\ Gray hole attack & 0.852 & 0.864 & 0.871 & 0.864 & 0.856 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Malicious node detection accuracy with malicious node ratios. of nodes. Combining Figure 5a with Figure 5b shows that the proposed scheme's energy consumption is significantly lower as compared to the HHVBF and GEDAR protocols.