# A Novel Cooperative Opportunistic Routing Scheme for Underwater Sensor Networks
## 3 Opportunistic Void-Avoidance Routing Protocol
### Routing Algorithm
#### 3.5.5 Holding Time of Forwarded Packets  
Eventually, node \(R_{i}\) locally selects the forwarding set \(F(R_{i})\) based on our criteria and broadcasts the packet. Algorithm 5 details the receiving packet procedure at each candidate node. OVAR is a sender-based protocol in which the forwarding node decides which candidate nodes should take part in the packet forwarding. The packet header contains all IDs of members of \(F(R_{i})\). The receiver node should be in the forwarding set of the sender to accept the packet; otherwise, it drops the packet. Upon receiving a packet by a forwarding candidate, it sets a forwarding timer proportional to its fitness factor (Equation (7)). Because we adopt the retransmission procedure in OVAR, if a node receives a repetitive packet, it should again set a new holding timer for this packet to be synchronised with other candidate nodes in the forwarding set. A node with the highest priority has the lowest forwarding timer value among forwarding candidates, and if the packet is relayed by this node, other lower priorities candidates should discard the packet after hearing the packet transmission. A low priority candidate can become a forwarding node if all of the nodes in the forwarding set with higher priority failed to receive or relay the packet, which can be recognised by listening to the channel. This procedure with the aid of timer scheduling is repeated until the packet is successfully relayed to the next hop. By using this mechanism, redundant transmissions are prevented, which leads to more energy savings for the whole network.  
```
1:procedureReceivePacket(\(R_{i}\), packet)
2:if\(R_{i}\).ID \(\in\) header (packet) then
3: Calculate \(\alpha\) and \(T_{hold}\)
4: Set forwarding timer
5:else
6: Drop packet
7:endif
8:endprocedure
```  
**Algorithm 5** Receiving packet.  
Each candidate node calculates its forwarding timer, \(T_{hold}\), as follows:  
\[T_{hold}=\frac{1}{2}(1-\alpha)T_{Delay}+\frac{R-|\vec{SC}|}{\
u_{sound}} \tag{12}\]  
where \(T_{Delay}\) is the predefined maximum delay, which should be set in a way that all forwarding candidates are able to hear the transmission of higher priority nodes before relaying the packet. \(R\) and \(\
u_{sound}\) are the transmission range of the node and the propagation speed of sound in the water, respectively. \(|\vec{SC}|\) indicates the relative distance between the sending node \(S\) to the candidate node \(C\), which can be estimated based on the received signal strength or time of arrival. The first part of the equation ensures that candidate nodes hold the packet based on their priorities (the greater the fitness factor value, the shorter the timer), and the second part of the equation is used to compensate the receiving delays resulting from the propagation delay between a forwarding node and its multiple candidate nodes. To satisfy the prioritization among candidate nodes after receiving the packet,in Equation (12) should be big enough to compensate the propagation delay among the forwarding nodes with maximum \(R\) distance (all candidate nodes are within the transmission range of each other). The prioritization can be guaranteed if \(T_{Delay}\) is considered more than \(\frac{2R}{V_{sound}}\), which is equal to twice as much as the maximum of the propagation delay between the nodes within a forwarding set.