# Void Hole Avoidance for Reliable Data Delivery in IoT Enabled Underwater Wireless Sensor Networks
## 3 Background
### System Model
#### 3.1.4 Explanation of Algorithm 1  
Algorithm 1 describes the packet forwarding mechanism in general. First, node \(i\) receives a packet from node \(j\). Then, it calculates the previous and current depths of the node. After calculating the depths of both nodes, node \(i\) calculates the distance difference of node \(i\) and the previous node corresponding to the Received Signal Strength Indicator (RSSI) of the Received Packet RSSI (RP-RSSI) and the RSSI of Signals at Senders (SS-RSSI). In these schemes, SS-RSSI is known to all nodes in the network. Therefore, every node in the network can calculate the distance between two nodes corresponding to [PERSON]'s propagation model. Next, the Relative Coordinate (RC) is calculated, corresponding to the depth difference between them.  
```
Node \(i\) receives \(data\_packet\) from node \(j\) Obtain \(prev_{node\_depth}\) and \(curr_{node\_depth}\) Calculate distance relative to \(diff(SS\_RSSI,RP\_RSSI)\) Calculate \(RC(\textit{sender},\textit{receiver})\) corresponding to distance and \(diff(prev_{node\_depth},curr_{node\_depth})\) SWITCH \((\textit{packettype})\) CASE 1: NeighborRequest ifnode \(i\) is the preferable forwarder node of node \(j\)then  send ack endif Hold for next data packet END CASE CASE 2: Ack ifnode \(j\) is the preferable forwarder node of node \(i\)then  up-to-date entry neighbor_tablemaking use of item \((prev_{node\_depth},\textit{distance},t_{current})\) endif  END CASE 3: DataPacket Move to the next step END CASE END SWITCH if selected node \(i\) is not the preferable forwarder node of \(data\_packet\)then  Upgrade \(neighbor\_table\) using item \((prev_{node\_depth},t_{current},\textit{distance})\) Drop \(data\_packet\) endif ifnode \(i\) is the preferable forwarder node of \(data\_packet\)then  Obtain source ID, packet ID from \(data\_packet\) if(source ID, packet ID) within the queue then  Drop \(data\_packet\) endif if the node is within the forwarding area then  Move to the next step else  Hold for the next \(data\_packet\) endif endif  Find the next \(depth_{min}\) in \(neighbor\_table\) ifneighbor_table is emptythen  Drop \(data\_packet\) endif  Upgrade the depth in \(data\_packet\) with \(current_{node\_depth}\) Add (source ID, packet ID) into the queue
```  
**Algorithm 1** Algorithm for forwarding data packetsThe type of forwarded or received packets is checked accordingly. When a node receives the data packet, it manages the data packet as follows:  
* If the node is not within the effective forwarding range of the preceding hop, it solely updates its neighbor table. In the other case, it enqueues information if it finds no report regarding the packet in the packet queue.
* If the node is not within the forwarding area, it will wait for the subsequent packet; this means that the packet is inside the suppression area. In any other case, the node searches for neighboring nodes in the neighbor table.
* If the neighbor table is empty, it will directly drop the data packet, as there are no nodes in the forwarding area. Thus, void holes can be prevented earlier.