## 3 Proposed Quality of Service Routing Protocol (QoSRP) in UWSNs
### Packets Forwarding Scheme (UIWPF)
#### 3.4.2 Routes Construction with Optimal Forwarders  
The route construction process starts from the source node have packets to convey to the sea surface sink. To do so, the source node by considering the local records sends the route discovery \((r\)_dits_msg_\(\mathcal{G}\)) message to its neighbors with the following values: the sender identity, current channel, remaining energy, level number, position with the angle of message departure and distance to the sink. Upon receiving the _rdfs_msg_ message successfully, each ASN computes and updates the distance to the sender of itself, angle of packet arrival, level number in the routing table. The receiver node compares its own distance and the sender distance to the sink. Then, it sends its own information of sender identity, current channel, remaining energy, level number, position with the angle of message received with value 1 only if its distance to the sink is lower than the sender, otherwise it is 0. The receiver node also computes the priority of the sender node and updates in the routing table with decreasing priority. In fact, this priority is important for sender since it will be used during reverse routes finding towards the data source. Upon receiving the reply \((r\)_ep_m_sg_)message correctly, the source node computes the angle of packets arrivals and updates the sender's received information with a priority in the routing table. Usually, a candidate with high residual energy, lower distance to the source node and sink is given high priority in the routing table. Consequently, the priority of each neighboring acoustic node in both upwards and downwards direction is updated in the routing table. In addition, the forwarding candidates with the same level \(n\) and being equal to the sink have the intermediate priority in the routing table. The forwarding candidates with the lowest level \((n-\hat{\epsilon})\) such that \(\hat{\epsilon}\in\{1,2,\ldots,n\}\) and long distance has the lowest priority in the routing table since they are far away to the sea surface sink. The intermediate and lowest priority forwarding candidates are selected as forwarding candidates only if a suitable forwarding node is not found in the transmission range of the source node in the network. Both the intermediate and lowest priority candidates are usually called helpers or guide nodes in the network. Thus, a node with the highest priority in the routing table is selected as a potential forwarder to relay information of the source node towards the sink. The higher the priority, the shorter is the time for data to reach the sea surface sink. In the packet forwarding process (see Section 3.4 for details) it is also possible that a huge volume of events data is moved over a particular forwarder result in packets overflow problem due to the limited buffer size. Therefore, after a predefined iteration, a new parameter called buffer overflow time is included in the priority list of each potential forwarder to avoid congestion in UWSNs. To prevent congestion occurrence, each forwarder node monitors its buffer occupancy level periodically since it is gradually filling up. The congestion is detected once the buffer occupancy exceeds a predefined threshold value in the network. Then, the congestion avoidance procedure begins, which is based on diverting the incoming data traffic to the other available forwarding candidates towards the sea surface sink. This reduces packets loss rate and thus help to maximize the overall packet delivery ratio in the network. During each message exchange process, the receiver acoustic node sends an acknowledgment message to the sender to ensure the guaranteed delivery. Subsequently, the route discovery process at each hop follows the same previous procedure until the forwarding candidate closer to the sea surface sink is found to convey packets. In the worst case, if a suitable packets forwarder is not found in the sender's communication range in upward direction then it sends _rdfs_msg_ to the same or lower levels neighboring candidates.