# Receiver-Initiated Handshaking MAC Based on Traffic Estimation for Underwater Sensor Networks +
## 5 TERI-MAC Design
### Arrangement of \(\mathsf{ATS}\) Transmission  
The \(\mathsf{ATS}\) packets from different senders should arrive at the receiver in a staggered manner to prevent \(\mathsf{ATS}\) collisions, as introduced in Phase 2 of Section 5.1. Based on the receiver-initiated protocols, each receiver in TERI-MAC needs to arrange the transmission of \(\mathsf{ATS}\) packets for these invited senders in advance in the \(\mathsf{R}\mathsf{TR}\) packet. By optimally scheduling the \(\mathsf{ATS}\) transmission, one can get a minimal \(\mathsf{ATS}\) reception time while improving the utilization of the acoustic channel. Now, assume that there are \(L\) senders, denoted by a set \(\mathbf{S}=[S_{1},S_{2},\ldots,S_{L}]\). Each sender \(S_{i}\) transmits an \(\mathsf{ATS}_{i}\) packet to the common receiver \(R\), and the propagation delay between \(R\) and \(S_{i}\) is denoted by \(\tau_{i}\). At time \(t_{0}\), the receiver \(R\) transmits an \(\mathsf{R}\mathsf{TR}\) packet and at time \(t_{i}\), the receiver \(R\) receives the \(\mathsf{ATS}_{i}\) from the sender \(S_{i}\) successively, where \(i\in\{1,\ldots,L\}\). The transmission times of \(\mathsf{R}\mathsf{TR}\) and \(\mathsf{ATS}\) are denoted by \(T_{\mathsf{R}\mathsf{TR}}\) and \(T_{\mathsf{ATS}}\), respectively, and the time difference between the \(\mathsf{R}\mathsf{TR}\) reception and the \(\mathsf{ATS}_{i}\) transmission on \(S_{i}\) is labeled \(D_{i}\). Let \(b_{i}\) (\(i\in\{1,\ldots,L-1\}\)) denote the reception interval among \(\mathsf{ATS}_{i}\) and \(\mathsf{ATS}_{i+1}\), as shown in Figure 6.  
In order to avoid collisions among \(\mathsf{ATS}\) messages, each sender \(S_{i}\) should wait for an appropriate time difference \(D_{i}\) to make the \(b_{i}\geq 0\) (i.e., no \(\mathsf{ATS}\) overlapping at the receiver). Based on the fact that the differences in propagation delays to different senders are marginal compared to the length of control packets considering the long preamble in acoustic modems, it is highly possible to ensure \(b_{i}=0\) and to obtain a minimum total time for all \(\mathsf{ATS}\) receptions. In this case, according to the propagation delay between the receiver and the sender \(S_{i}\), we have  
\[D_{i}=t_{i}-\left(t_{0}+T_{\mathsf{R}\mathsf{T}\mathsf{R}\mathsf{T}}\right)-2 \tau_{i},\hskip 28.452756 pti\in\{1,\ldots,L\}. \tag{1}\]  
If \(\mathsf{ATS}_{i}\) is the \(l^{th}\) of \(L\)\(\mathsf{ATS}\) packets arriving at the receiver, then Equation (1) can be written as  
\[D_{i}=T_{m}-(L-l)T_{\mathsf{ATS}}-\left(t_{0}+T_{\mathsf{R}\mathsf{T}\mathsf{ R}\mathsf{T}}\right)-2\tau_{i},\hskip 28.452756 pti\in\{1,\ldots,L\} \tag{2}\]  
where \(T_{m}\) is the local time at the receiver receiving the last \(\mathsf{ATS}\) packet, i.e., \(T_{m}=\max\{t_{i}\},i\in\{1,\ldots,L\}\). Then, the goal of minimizing the total time for all \(\mathsf{ATS}\) packets receptions is equivalent to minimizing \(T_{m}\). Since \(D_{i}\geq 0\), from Equation (2), we can get  
\[T_{m}\geq(L-l)T_{\mathsf{ATS}}+(t_{0}+T_{\mathsf{R}\mathsf{T}\mathsf{R}})+2 \tau_{i},\hskip 28.452756 pti\in\{1,\ldots,L\}. \tag{3}\]  
By observing Equation (3), we find that \((t_{0}+T_{\mathsf{R}\mathsf{T}\mathsf{R}})\) is a constant. So, in order to minimize \(T_{m}\), we have to add the smallest \((L-l)T_{\mathsf{ATS}}\) to the largest \(\tau_{i}\). More specifically, an \(\mathsf{ATS}\) packet from a sender with the largest propagation delay should be the last to arrive at the receiver. Similar rules apply to other senders. Therefore, an \(\mathsf{ATS}\) packet from a sender with a larger propagation delay (larger \(\tau\)) should come after the one from a closer sender (smaller \(\tau\)) and vice versa.