# Adaptive Power-Controlled Depth-Based Routing Protocol for Underwater Wireless Sensor Networks
## 3 The Proposed Protocol
### Detailed Design of APCDBRP
#### 3.3.1 Route Establishment Phase  
The Structure of Packets  
APCDBRP defines six packet types: BEACON packet, Data packet, ACK packet, PROBE packet, PROBE REPLY packet, and HOLE packet, as shown in Figure 2. Except for the Data packet, all other packets are categorized as control packets. Among these fields, Type ID and Sender ID are common fields present in all packets. Type ID indicates the packet type, used for distinguishing different types of packets, while Sender ID represents the node ID of the sending packet. Receiver ID and Data Packet ID exist only in Data packets and ACK packets. Receiver ID is used to specify the receiver, while Data Packet ID consists of the node ID and packet number, ensuring the uniqueness of each data packet's Data Packet ID. Residual Energy, Depth, Forwarding Success Rate, and Transmit Power Level represent the information used for calculating the forwarding factor. The detailed calculation of the forwarding factor will be explained in Section 3.3.2. Due to the adoption of the implicit route update mechanism in this protocol, all packets except for the HOLE packet contain Residual Energy, Forwarding Success Rate, and Depth information. Additionally, since the transmitting power of nodes varies when sending Data packets and ACK packets, Data packets and ACK packets also carry Transmit Power Level information. It is important to note that the usage of ACK packets in this protocol differs from the common practice. ACK packets are used only under specific conditions, which will be discussed in detail in Section 3.3.2. The Structure of the Routing Table  
Figure 3 displays the structure of the routing table, which consists of the following fields: Node ID, Depth, Residual Energy, Optimal Next Hop ID, and Neighbor List. The Neighbor List contains the Node ID, Forwarding Factor, and Transmit Power Level required for communication between the local node and each neighbor node. The neighbor node with the highest Forwarding Factor is selected as the best next hop. In addition, the Transmit Power Level is used to set the Transmit Power Level field in the packets. The Forwarding Success Rate is the ratio of the number of data packets successfully forwarded by the node to the total number of data packets forwarded by the node. The Detail of the Route Establishment Phase  
In the route establishment phase, we apply receiver-side routing to establish the initial path by broadcasting the BEACON packet at the maximum transmitting power from the sink node. With the assistance of the forwarding factor, data transmission along this path achieves an optimal trade-off between energy efficiency and energy balance. The receiving node determines the suitability of the beacon sender as the next hop based on depth information. If it does not meet the criteria, the packet is directly discarded; Otherwise, the optimal transmitting power from the current node to the beacon sender is estimated using the recorded transmitting power and received signal strength in the packet. The forwarding factor is then calculated based on the remaining energy information of the current node and stored in the routing table. The neighbor node with the highest forwarding factor is selected as the optimal next hop. Subsequently, the current node generates a BEACON packet and broadcasts it. To prevent duplicate transmissions, a node only sends a BEACON packet once within a certain time period. The entire process of the route establishment phase is illustrated in Algorithm 1. It should be noted that in this study, the depth value of underwater was set to 0, and the depth value of water surface was set to 1500, with units in meters. Figure 4 illustrates an example of route establishment. The sink node initiates the process by broadcasting the BEACON packet at the maximum transmitting power. The nodes (i.e., N2, N3, or N4) that receive the BEACON packet measure the received signal strength to determine the power level required from their respective positions to reach the sink node.