# DCO-MAC: A Hybrid MAC Protocol for Data Collection in Underwater Acoustic Sensor Networks
## 4 Proposed DCO-MAC Protocol
### RSV-MAC Protocol
According to Figure 2, the waiting period at node \(i\), \(T_{\text{w\_ATS,i}}\), can be set as follows:  
\[T_{\text{w\_ATS,i}}=T_{\text{wtr\_ATS,i}}-2\tau_{\text{sink,i}}-\theta,i\in\{ \text{A, B,C}\}. \tag{2}\]  
The mobile node is scheduled to send the ATS packet once it receives the RTR packet successfully. Therefore, the waiting time of node D is assumed to be \(T_{\text{w\_ATS,D}}=0\). After receiving the ATS packet from the mobile node, the propagation delay between the sink and the mobile node can be calculated by the sink, using the RTR packet sending time and ATS packet receiving time. Hence, the mobile node can be treated as a normal one in the follow-up data transmission phase. According to the increasing order of propagation delay between the sink and level-1 nodes, the transmission order of the DATA packets is B\(\rightarrow\)C\(\rightarrow\)A\(\rightarrow\)D, as illustrated in Figure 2. After receiving the ATS packets from the level-1 nodes, the sink calculates the time period between the ORDER packet sending and the DATA packets receiving from node \(i\), \(T_{\text{wtr\_DATA,i}}\), as follows:  
\[T_{\text{wtr\_DATA,i}}=T_{\text{wtr\_DATA,B}}+ \sum_{ \begin{array}{c}k\in\{\text{A,B,C,D}\}\\ O_{\text{DATA,k}}<O_{\text{DATA,j}}\end{array} }\varphi_{k}(\delta+T_{\text{guard}}),\,\,i\in\{ \text{A,C,D}\} \tag{3}\]  
where \(\delta\) is the transmission delay of the DATA packet, and \(O_{\text{DATA,i}}\) denotes the transmission order of the DATA packet at node \(i\). The time period between the ORDER packet sending and the DATA packets receiving, from the first node in the transmission order, node B, is \(T_{\text{wtr\_DATA,B}}=2\tau_{\text{sink,B}}+\theta\). Meanwhile, the receiving period of the DATA packets at the sink can be calculated as \(T_{\text{r\_DATA,sink}}=T_{\text{wtr\_DATA,D}}+\varphi_{\text{D}}(\delta+T_{ \text{guard}})\). The sink broadcasts the ORDER packet containing \([T_{\text{wtr\_DATA,i}}\,|\,i\in\{\text{A,B,C,D}\}]\) and \(T_{\text{r\_DATA,sink}}\). After receiving the ORDER packet, the level-1 node, \(i\), with data packet(s) to be transmitted, sends the DATA packet(s) to the sink node after waiting a period, \(T_{\text{w\_DATA,i}}\). The waiting period at node \(i\), \(T_{\text{w\_DATA,i}}\), can be set as follows:  
\[T_{\text{w\_DATA,i}}=T_{\text{wtr\_DATA,i}}-2\tau_{\text{sink,i}}-\theta,i\in \{\text{A, B,C,D}\}. \tag{4}\]  
After receiving the DATA packets successfully, the sink broadcasts an ACK packet to finish the transmission of the level-1 sub-network. In the RSV-MAC protocol, the sink has three states, namely, IDLE, WF_ATS (wait for ATS), and WF_DATA (wait for DATA). The state transition diagram of the sink is shown in Figure 3.  
The sink starts from the IDLE state at the beginning of level-1 sub-network transmission phase. The sink broadcasts the RTR packet, sets a WF_ATS timer, and enters the WF_ATS state. The duration of the WF_ATS timer is \(T_{\text{WF\_ATS\_timer}}=T_{\text{r\_ATS,sink}}\). When the WF_ATS timer expires, and no ATS packets are received, the sink goes back to the IDLE state. When an ATS packet is received, and the receiving phase of the ATS packets are not finished, the sink keeps the current state. When all of the pre-scheduled ATS packets are received or the WF_ATS timer expires, the sink broadcasts the ORDER packet, sets a WF_DATA timer, and enters the WF_DATA state. The duration of the WF_DATA timer is \(T_{\text{WF\_DATA\_timer}}=T_{\text{r\_DATA\_sink}}\). When the WF_DATA timer expires, and no DATA packets are received, the sink goes back to the IDLE state. When a DATA packet is received, and the receiving phase of the DATA packets does not finish, the sink keeps the current state. When all of the pre-scheduled DATA packets are received or the WF_DATA timer expires, the sink broadcasts the ACK packet, and goes back to the IDLE state. The level-1 node has five states in RSV-MAC protocol, namely IDLE, WTS_ATS (wait to send ATS), WF_ORDER (wait for ORDER), WTS_DATA (wait to send DATA), and WF_ACK (wait for ACK).