Routing Protocol for Underwater Wireless Sensor Networks Based on a Trust Model and Void-Avoided Algorithm Authors: Jun Ye, Weili Jiang Published: 2024 ABSTRACT Underwater wireless sensor networks have a wide range of application prospects in important fields such as ocean exploration and underwater environment monitoring. However, the influence of complex underwater environments makes underwater wireless sensor networks subject to many limitations, such as resource limitation, channel openness, malicious attacks, and other problems. To address the above issues, we propose a routing scheme for underwater wireless networks based on a trust model and Void-Avoided algorithm. The proposed scheme establishes a trust model, evaluates the behavior of underwater nodes through direct trust, indirect trust, and environmental trust, and finds malicious nodes while taking into account evaluation of the channel, which provides support for the next data transmission event. The proposed scheme prioritizes the total cabling distance and introduces a two-hop availability checking model for data transmission, checking the nodes for voids and avoiding the void areas, to find the transmission path with the lowest energy consumption and lowest latency as much as possible. In this study, simulation experiments were conducted on the proposed scheme, and the results showed that the target scheme can effectively detect malicious nodes through anomalous behaviors and outperforms existing work in terms of malicious node detection rate, energy consumption, and end-to-end latency, and network performance. 1. Introduction Underwater Wireless Sensor Network (UWSN) technology is receiving widespread attention both at home and abroad and is being widely used for marine data collection, pollution prediction, offshore mining, shipwreck avoidance marine monitoring, and more. UWSNs are one of the key basic support technologies for the development of intelligent water conservancy and ocean exploration, and have broad application prospects in real-time water quality monitoring, water pollution control, and other aspects. However, UWSNs have many limitations compared with wireless sensor networks due to the specific conditions:Acoustic communication: Due to the large attenuation of electromagnetic waves and light waves underwater, hydroacoustic communication is the main means of underwater long-distance communication [1].Bandwidth: Acoustic waves travel underwater at 1500 m/s, which results in much lower bandwidth for acoustic communications compared to terrestrial wireless sensors (TWSNs) [2].High BER: Hydroacoustic channels are characterized by high time variation, long propagation delay, high signal attenuation, high environmental noise, and low available bandwidth, which, to a certain extent, result in high BER and high packet loss, affecting the efficiency and accuracy of data transmission [3].Environmental constraints: The harsh underwater environment constrains the computational resources and storage resources of UWSNs nodes. Underwater sensor nodes (UW-sensors) use batteries for their energy supply, and it is technically difficult to recharge the batteries of UW-sensors at a higher cost. In addition, due to environmental noise, channel fading, and so on, UW-sensors need to consume more energy to compensate for the signal during data transmission, which greatly increases the energy consumption of the UW-sensors [4]. Acoustic communication: Due to the large attenuation of electromagnetic waves and light waves underwater, hydroacoustic communication is the main means of underwater long-distance communication [1]. Acoustic communication: Due to the large attenuation of electromagnetic waves and light waves underwater, hydroacoustic communication is the main means of underwater long-distance communication [1]. Bandwidth: Acoustic waves travel underwater at 1500 m/s, which results in much lower bandwidth for acoustic communications compared to terrestrial wireless sensors (TWSNs) [2]. Bandwidth: Acoustic waves travel underwater at 1500 m/s, which results in much lower bandwidth for acoustic communications compared to terrestrial wireless sensors (TWSNs) [2]. High BER: Hydroacoustic channels are characterized by high time variation, long propagation delay, high signal attenuation, high environmental noise, and low available bandwidth, which, to a certain extent, result in high BER and high packet loss, affecting the efficiency and accuracy of data transmission [3]. High BER: Hydroacoustic channels are characterized by high time variation, long propagation delay, high signal attenuation, high environmental noise, and low available bandwidth, which, to a certain extent, result in high BER and high packet loss, affecting the efficiency and accuracy of data transmission [3]. Environmental constraints: The harsh underwater environment constrains the computational resources and storage resources of UWSNs nodes. Underwater sensor nodes (UW-sensors) use batteries for their energy supply, and it is technically difficult to recharge the batteries of UW-sensors at a higher cost. In addition, due to environmental noise, channel fading, and so on, UW-sensors need to consume more energy to compensate for the signal during data transmission, which greatly increases the energy consumption of the UW-sensors [4]. Environmental constraints: The harsh underwater environment constrains the computational resources and storage resources of UWSNs nodes. Underwater sensor nodes (UW-sensors) use batteries for their energy supply, and it is technically difficult to recharge the batteries of UW-sensors at a higher cost. In addition, due to environmental noise, channel fading, and so on, UW-sensors need to consume more energy to compensate for the signal during data transmission, which greatly increases the energy consumption of the UW-sensors [4]. All these factors converge to result in minimal resources available for UWSNs. They also limit the prospect of using some of the more mature security algorithms used in TWSNs in UWSNs. Due to the limited transmission range, UW-sensors usually relay the received data to the receiver nodes through multiple forwarding nodes, which provides conditions for malicious nodes (MNs) inside the network to damage the underwater wireless sensor network. MNs within the network can forge, discard, eavesdrop, and modify the transmitted data to affect the accuracy and efficiency of network data transmission. In addition to this, MNs can send a large number of useless and repetitive messages inside the network to occupy the network channel, consume a large amount of energy, and greatly reduce the survival time of the UWSNs. Numerous researchers have introduced trust models into UWSNs to identify MNs inside the network and drive them out of the network. This is a core element. The trust model assigns a trust value to each underwater sensor node, and other nodes confirm their trustworthiness before collaborating with them. The trust model can be applied to protocols such as routing protocols, localization, and synchronization to enhance the security of the UWSNs. Unlike authentication models, trust models usually work periodically to collect trust evidence and calculate the trustworthiness of nodes through their multifaceted performance. The trust model can effectively respond to internal attacks and improve network security. We designed a new trust management scheme for UWSNs to ensure the security of packet transmission and improve the efficiency of data transmission. The main contributions of this paper are shown below:We propose a trust model for checking the trust performance of underwater nodes in UWSNs. The proposed scheme considers three metrics (environmental trust, direct trust, and indirect trust) to analyze the performance of UW-sensors, identify MNs, and find the set of forwarding nodes suitable for data transmission.The scheme proposed in this paper considers the total wiring distance and utilizes a two-hop availability checking algorithm to find the void nodes and improve the data transmission efficiency of the UWSNs.We evaluated the performance of the proposed scheme with HH-VBF [5], GEDAR [6], and TADR-EAODV [7] in network simulation experiments. The simulation experiments demonstrate the superiority of the proposed scheme over existing protocols. We propose a trust model for checking the trust performance of underwater nodes in UWSNs. The proposed scheme considers three metrics (environmental trust, direct trust, and indirect trust) to analyze the performance of UW-sensors, identify MNs, and find the set of forwarding nodes suitable for data transmission. We propose a trust model for checking the trust performance of underwater nodes in UWSNs. The proposed scheme considers three metrics (environmental trust, direct trust, and indirect trust) to analyze the performance of UW-sensors, identify MNs, and find the set of forwarding nodes suitable for data transmission. The scheme proposed in this paper considers the total wiring distance and utilizes a two-hop availability checking algorithm to find the void nodes and improve the data transmission efficiency of the UWSNs. The scheme proposed in this paper considers the total wiring distance and utilizes a two-hop availability checking algorithm to find the void nodes and improve the data transmission efficiency of the UWSNs. We evaluated the performance of the proposed scheme with HH-VBF [5], GEDAR [6], and TADR-EAODV [7] in network simulation experiments. The simulation experiments demonstrate the superiority of the proposed scheme over existing protocols. We evaluated the performance of the proposed scheme with HH-VBF [5], GEDAR [6], and TADR-EAODV [7] in network simulation experiments. The simulation experiments demonstrate the superiority of the proposed scheme over existing protocols. 2. Related Work Trust models have been widely used in WSNs, but the research on trust models suitable for UWSNs is still relatively small. From the existing research results, trust models can be used in areas such as malicious node detection [8], data collection security [9], and intrusion detection [10]. Yang et al. [7] proposed a trust-aware dynamic routing algorithm augmented with an AODV protocol (TADR-EAODV) protocol for secure communication in WSNs. It considers the trustworthiness of nodes while making routing decisions. It dynamically adjusts the routing paths based on real-time network conditions such as node availability, energy levels, and security factors. Improvements are made in detecting defective nodes and average packet transmission rate. GEDAR is geographic and opportunistic routing protocol. It selects those nodes with the highest Expected Packet Advancement (EPA) as forwarders. The GEDAR protocol solves void routing by adjusting the depth of void nodes. However, node movement may not always be optimal and may consume more energy. Li H et al. [11] proposed a cluster-based vector-based forwarding (CVBF) technique to improve the effectiveness of vector-based forwarding protocols (VBFs) [12]. The entire UWSN volume is divided into multiple rectangles to make clusters, and then a virtual receiver is assigned to each cluster in CVBF. Nicolas et al. [5] extended VBF to the HH-VBF protocol (hop-by-hop VBF protocol). HH-VBF changes the direction of the forwarding pipe by hopping hop-by-hop throughout the lifecycle. Although network performance can be improved by dynamically changing the direction of the flooding pipe compared to VBF, HH-VBF has lower performance in sparse networks when a smaller pipe radius is set. Nandyala et al. [13] proposed a Q-learning-based dynamic network topology aware routing algorithm (QTAR) which uses implicit tangent vertex identification to optimize the selection of the NF (next forwarder), thereby mitigating the energy wastage incurred in forwarding packets away from the receivers and improving network performance. Ganeriwald et al. [14] proposed a trust model RFSN for WSN. In RFSNs, each node monitors the communication records of other nodes and maintains the trust of other nodes locally. Feng et al. [15] proposed a trust model which defined seven categories of trust evidence. However, it is difficult to assign reasonable weights to all trust indicators when fusing multiple pieces of evidence. Ren et al. [16] proposed an unattended WSN trust model based on subjective logic. However, their main focus was ensuring the security of observational evidence storage, so they did not deal with trust assessment and trust update. Han et al. [17] proposed a trust model called Attack-Resistant Trust Model based on Multidimensional trust metrics (ARTMM) in UWSNs. This scheme can reduce the impact of the underwater environment to some extent. However, ARTMM ignores the effect on the network layer after an attack, and it is difficult to accurately describe the trust relationship using only fuzzy logic. Vani et al. [18] used fuzzy logic and cryptographic encryption schemes considering relative mobility, energy, and distance metrics to select secure cluster head nodes and transmit data within the cluster, but their transmission did not consider the energy efficiency and low latency of the forwarding path. He et al. [19] proposed a trust model based on reinforcement learning for UWSNs. The scheme reduces the influence of environment on the trust model to a certain extent and utilizes the reinforcement learning theory to update the trust dynamically, which can cope with changing attack patterns to a certain extent. Transmission security models for UWSNs mainly rely on the introduction of cryptographic algorithms and routing protocols that are unable to cope with attacks from within the network. The introduction of a trust model to regulate internal nodes is an effective way to deal with internal attacks. Although the existing trust model has made progress in the detection of MNs, it still needs to consider the impact of harsh underwater environments on packet transmission. Therefore, the proposed scheme designed in this paper incorporates intelligent routing with the trust model to find more efficient transmission paths. 3. Network Structure In this section, the UWSN model required for implementation of the proposed algorithm is presented along with some assumptions. The underwater nodes of the UWSNs are randomly distributed within a predetermined range, while the sink nodes (BN) are distributed at the center of the water surface and have no energy constraints to forward the packets from the UW-sensors to the base station. The UW-sensors are deployed with moorings that stop moving after a certain distance with the current, and their relative positions throughout the individual network structure are relatively stable. Each UW-sensor has acoustic–electrical communication equipment for collecting packets from the seafloor and transmitting the packets to the surface buoy node, and the BPSK [20] modulation technique modulates and demodulates the signal. Each underwater node periodically obtains the position of its neighboring nodes through a position algorithm [21] and maintains a node adjacency list locally; this communication record and status about the neighboring nodes help in choosing the NF. In addition, the UW-sensor maintains a local communication log table with neighboring nodes to continuously record the communication status and history with neighboring nodes. 4. Proposed Scheme 4.1. The Scheme Overview This section mainly introduces the model of the proposed scheme. As shown in Figure 1, the BNs are distributed at sea level, the UWSNs are clustered and layered according to the depth of the UW-sensors, the UW-sensor within each time transmits the packets to the cluster head node (CH) inside the cluster, and the CH in each layer accepts the data sent by other UW-sensors and then forwards the packet to the previous CH until it reaches the BN. The non-CH common nodes in the first layer near the BN node can directly transmit data to the BN. The underwater nodes transmit data to avoid the MN detected by the trust model to ensure data security. After calculating the trust value of UW-sensor, the UWSNs will exclude MNs from being pre-selected nodes for data transmission. Before data transmission we need to perform a two-hop availability check on the neighboring nodes to find the void nodes. After removing the void nodes, a path with a smaller total wiring distance is constructed from the remaining neighbor nodes for transmission. 4.2. UWSN Clustering The UWSNs are dynamically clustered according to the depth and distribution of the nodes, as follows:(1)Mi=1+hiRmax, where the number of UW-sensors in the kth layer is given by:(2)Numk2σ)≤0.477 The reliability of the recommended trust value after excluding outliers is given by:(14)Trecin=1−2|∫μR f(R)dR| where f(R) is the trust value distribution function of Equation (12). For a set of recommended trust values R=(R1,R2,R3,…,RC) that excludes outliers, the reliability Trecin is obtained for each of these trust values, and the indirect trust calculation formula is given by:(15)Tindirect=∑i=1c Treci×Ric where c is the number of recommended UW-sensors participating in the computation, Ri is the recommended trust value of node ni to the pre-selected nodes, and Treci is the assessment of the reliability of the recommended trust value of node ni. Environmental trust: Hydroacoustic communication will be affected by a variety of factors. For example, environmental noise will lead to poor quality of the communication link, resulting in fluctuations in communication, energy, and data, which in turn leads to miscalculation of the trust between the nodes and reduces the accuracy of the detection for MN. Using the underwater acoustic signal path attenuation model [28], the absorption coefficient α(f) estimated from Thorp’s formula is given by:(16)α(f)=0.11f21+f2+44f24100+f2+2.75×10−4f2+0.003 where f is the signal frequency. The average signal-to-noise ratio is given by:(17)SNR(d,f)=P/(dka(f)d)N(f)B where k is the spreading factor in the noise simulation, which represents the propagation loss and is set to 1.7 for practical propagation, d is the distance, B is the bandwidth, and N(f) is the PSD of noise in acoustic communication, including four categories: turbulence noise, ship noise, wave noise, and thermal noise [29]. In the 1 < f < 100 KHz range, the PSDs of the noise categories are very close to each other, and the estimation equation is given by:(18)N(f)≈N1−τ10log(f) where N1 and τ are experimentally obtained constants. Based on the calculation of Equations (16)–(18) above, the BER calculation for conditional channel transmission at frequency f and distance d is given by:(19)LTij=1−p.(d,f) 4.4.3. Total Trust Total trust in the proposed scheme is calculated using three indicators: direct trust, indirect trust, and environmental trust:(20)Ttotal=λTdirect+βTindirect+γLTij where β, λ, and γ are constants between 0 and 1, and add up to 1, and β, λ, and γ are the weight of the total trust calculated. Trust update: In the trust model of the proposed scenario, to reflect the state of UWSNs in a timely manner and maintain the timeliness of the trust values, each UW-sensor of the UWSNs performs the trust value computation as well as the trust update at the beginning of each time window and uses the new trust value as an important basis for interaction with other nodes. At the beginning of each time window, the trust of the previous time window is used as the historical trust with the calculated trust of the current window for trust update. However, the trust values are time-sensitive, and the latest trust values are much more important than the historical trust, so the historical trust decays exponentially [30], and the trust update calculation formula is given by:(21)Tt+1=Tt+1cur+TtWt where Tt+1cur is the current trust, Tt is the trust of the previous round, and Wt is the time decay factor that needs to be used for specific underwater scenarios. 4.5. Data Forwarding At the beginning of the time window, the trust model of the proposed scheme will allow each UW-sensor to record the performance of the neighboring UW-sensor, as well as the channel condition. After calculating the trust value of the UW-sensors, the UWSNs will exclude UW-sensors with trust values below 0.5 from being pre-selected nodes for data transmission. An explanation as to why the threshold is chosen to be 0.5 will be given in Section 5, Simulation and Analysis of Results. Because of the limitations of hydroacoustic communication, most of the energy of UW-sensors is consumed in sending and receiving datagrams, so to reduce the communication consumption of UW-sensors, the proposed scheme will prioritize the transmission routes in the set of candidate neighbors Neighbori to choose the transmission paths taking into account the total cabling distance of the CHs or BNs. But this leads to possible routing voids in the network [31]. To solve the routing voids, before data transmission we need to perform a two-hop availability check on the neighboring nodes to find out the void nodes. After removing the void nodes, a path with a smaller total wiring distance is constructed from the remaining neighbor nodes for transmission. The algorithm for the data forwarding phase is shown in Algorithm 1: Algorithm 1: Packet forwarding Procedure forwarding data (node ni) Initialize; Get ID of CH, locations of Neighbor; locations of CH, BN Calculate the trust value of neighboring nodes For nj in network do If (nj<0.5) Exclude nj from the network; End if End for If (the distance from ni to BNRmax) Neighbori←two hop check (ni); End if For nj in Neighbori do Calculate the distance from nj to CH; Calculate the distance from ni to nj; Calculate the total distance; Check the nj with the smallest total distance in Neighbori; Set a timer for nj; Sending packets Update the rate of communication record table End for //supplement While the timer for nj is expired If do not get ACK from nj Sending packets to next node in Neighbori End if End while End procedure Initialization: when the network model is initialized, the network will initialize the energy, neighbor table, and local communication record table, obtain the remaining energy, location information, and data trust from the previous time window, and obtain other information to cluster the network. The cluster head node will be re-elected at the beginning of each time window, and the ID, as well as the location information of the CH, will be broadcast in the network. The normal underwater nodes will only receive the CH information of the corresponding layer, as well as the information of the BN. Filtering the candidate set: after the trust model excludes the MNs below the threshold from the network, the underwater node ni checks whether the BN node is within its communication range or not, because the nodes close to the BN nodes in the first layer of the cluster are more likely to be the CH and have to take on more data transmission tasks, so to alleviate the energy consumption of the UW-sensors in this area, these UW-sensors do not transmit packets to the CHs in the first layer. Instead, they transmit data directly to the BN. The other underwater nodes will transmit data to the CH in the same layer. To improve the performance of the UWSNs, the algorithm prioritizes the total wiring distance, and to solve the possible routing void problem, a two-hop availability check is performed on the neighboring nodes to find void nodes before the data transmission. The algorithm finds a node in the neighbor table that is closer to the CH than the source node and checks if this neighbor node has a neighbor node that is closer to the CH and if the neighbor node is a void node. For two-hop availability checking, as shown in Figure 3, when node n0 of the data sends a packet, there are two legitimate nodes n1 and n2 that can transmit it, and then, according to the routing protocol, we check the neighbor table of the n1 and n2 nodes and find that both nodes have legitimate forwarding nodes n3 and n5. Then, when we query the neighbor table of the n5 node, we find that there is no adjacent node of node n5 that can transmit the data to the CH; the protocol then marks n5 as a void node and n1 as a trap node, excluding n5 as well as n1 from the candidate set during data transmission. After removing the void node, the source node n0 will sort the nodes in the candidate set for sending according to the total wiring distance, but because of the variable underwater environment and high complexity, there may be a situation where data transmission to the forwarding node with high priority fails at a certain time, and if it does not select the next priority node as a forwarding node in a timely manner, there will be a phenomenon that consumes energy, occupies bandwidth, and reduces data delivery rate. So, we have designed a supplement to the routing algorithm of the scheme in the supplemental algorithm. We set a timer for the forwarding node. When the priority node expires at its timer time and the source node n0 has not received the ACK message returned by the priority node (which indicates that the packet has been accepted and forwarded to the next node), the source node n0 forwards the message to the next priority node until the data arrive at the CH or BN. 5. Simulation Simulations were performed using the proposed scheme by MATLAB (R2022a). We conduct a comprehensive comparison of our scheme with the other schemes: HH-VBF, GEDAR, and TADR-EAODV. To prove the accuracy of the experiments we simulated the target scheme with the HH-VBF, GEDAR, and TADR-EAODV schemes under the same network conditions. 5.1. Simulation Setting We simulated 50–100 underwater node deployments with a communication range set to 700 m. The UW-sensors in the underwater network are randomly distributed, all nodes can generate data packets, and a sink node is distributed in the central water surface of the monitoring area The specific simulation settings are shown in Table 2. We simulated three typical attacks on internal nodes: black hole attack, gray hole attack, and DOS. In a black hole attack, the infected MNs will refuse to accept and forward any packet, affecting data communication. The malicious node in a gray hole attack will discard the accepted packets randomly; the packet discard rate of the gray hole attack set for the experiments in this paper was 0.4. The malicious node in the DOS attack simulated in this paper will forward a large number of duplicate packets or send false packets, which occupies the channel resources of the network and makes normal nodes unable to communicate. In addition to this, to verify the network performance as well as the reliability of the proposed algorithm, the experiment also evaluated the average energy consumption (AEC), average end-to-end delay (AE2ED), and other aspects of the UWSNs. 5.2. 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 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 round versus the number 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. Because the proposed scheme has screened out a number of MNs or defective nodes with very poor communication environments during the trust calculation, it prioritizes the total cabling distance in data transmission and avoids the void areas. This makes the proposed scheme more energy-efficient. As shown in Figure 6, as the number of simulation rounds increases, the AE2ED also increases. This is mainly due to the fact that, as the UWSN operates, some of the UW-sensors consume energy too quickly, resulting in data forwarding paths having to choose nodes with longer total cabling distances. The AE2ED of the scheme is always lower than the other three schemes, while HH-VBF and GEDAR have the worst performance because these two algorithms are limited to nodes within the radius of the pipeline or nodes shallower than the current node, which is not flexible enough in forwarding node selection, resulting in their higher AE2EDs. As shown in Figure 7a, 20 malicious nodes were randomly distributed in the setting node of the simulation experiment, and the simulation results of the average energy consumption (AEC) per round of the network and the number of nodes were obtained. As can be seen from the figure, the energy consumption of the target scheme was relatively low compared with other schemes. Figure 7b shows the random distribution of 20 malicious nodes in the setting node of the simulation, and the results of the AE2ED and simulation rounds. By combining Figure 7a,b, compared with the other three protocols, when there are malicious nodes in the network, the network performance of the target scheme is better than that of the other three protocols, and the impact of malicious nodes on the network is less than that of the other two protocols: HH-VBF and GEDAR perform the worst. This is because they lack security mechanisms to respond effectively to malicious nodes. This proves that the trust model can effectively identify malicious nodes, and the target scheme is robust enough to detect malicious nodes. 6. Conclusions Due to the many limitations of the environment in which underwater sensor networks are located, underwater sensor networks are unsupervised environments, and the possibility of data exposure or attack by MNs in the UWSNs is high. To ensure secure packet transmission in underwater sensor networks while maximizing the efficiency of packet transmission, we proposed to come up with a routing protocol for UWSNs based on a trust model and void avoidance algorithm. The trust model was used to detect MNs within the UWSNs, and environmental trust was considered to exclude some defective nodes with very poor communication environments from the routing. In addition, the total wiring distance of the route and the null node avoidance algorithm were also considered to create as much as possible an efficient and reliable transmission route. The simulation results were compared with several schemes (HH-VBF, GEDAR, and TADR-EAODV). The target scheme has excellent performance and high accuracy, as well as reliability for malicious node detection.