# Adaptive Packet Coding for Reliable Underwater Acoustic Communications
## 5 RLPC-J-ARQ Scheme  
In the RLPC-ARQ scheme, the sender idles for a round-trip time while waiting for the ACK. This is quite inefficient for UWA communications, which have a long propagation delay. Ref. [5] proposed the J-ARQ to solve this problem. However, the block size of J-ARQ is fixed, which leads to the analysis in [5]; it cannot be directly applied in this problem. Essentially, the J-ARQ scheme uses the time that the feedback information is transmitted in the channel to send the following data blocks. According to this idea, we propose a RLPC-J-ARQ in our problem. Figure 2 illustrates the transmission style of the RLPC-J-ARQ scheme. We only consider that two blocks are transmitted simultaneously. The sender leaves a gap after sending \(N_{i}^{(k)}\) coded packets for receiving the ACK messages. Similarly, a guard interval is reserved for the node to change the mode. Next, the sender sends \(N_{i}^{(k+1)}\) data packets for the \((k+1)\)-th block. In this way, the transmitter could send more data blocks than the RLPC-ARQ scheme. In Figure 2, \(\rho_{k+1,i}^{(j)}\) and \(\sigma_{k+1,i}^{(j)}\) represent the time points for the sender and receiver with the \((k+1)\)-th block, respectively. The relationship between the time instants \(\rho_{k+1,i}^{(j)}\) and \(\sigma_{k+1,i}^{(j)}\) are similar to those of the \(k\)-th block. According to Figure 2, there are some constraints about the time instants to avoid the collision. At the sender, we have  
\[\left\{ \begin{array}{l}\rho_{k+1,i}^{(2)}\leq\rho_{k,i}^{(3)}-T_{g}\\ \rho_{k+1,i}^{(2)}\leq\rho_{k+1,i}^{(3)}-T_{g}\\ \rho_{k+1,i+1}^{(2)}\leq\rho_{k,i+1}^{(3)}-T_{g}\\ \rho_{k+2}^{(2)}\leq\rho_{k+1,i+1}^{(3)}-T_{g}\\ \end{array} \right. \tag{22}\]  
At the receiver, we have  
\[\left\{ \begin{array}{l}\sigma_{k,i}^{(4)}\leq\sigma_{k+1,i}^{(1)}-T_{g}\\ \sigma_{k+1,i}^{(4)}\leq\sigma_{k+1,i}^{(1)}-T_{g}\\ \sigma_{k+1,i+1}^{(4)}\leq\sigma_{k+1,i+1}^{(1)}-T_{g}\\ \sigma_{k+1,i+1}^{(4)}\leq\sigma_{k,i+2}^{(1)}-T_{g}\\ \end{array} \right. \tag{23}\]  
According to (1), (2), (4) and (5), the relationship between \(\rho_{k,i}^{(j)}\) and \(\rho_{k,i+1}^{(j)}\) is given as  
\[\left\{ \begin{array}{l}\rho_{k,i+1}^{(1)}=\rho_{k,i}^{(1)}+T_{\tau}+T_{p}N_{ i}^{(k)}\\ \rho_{k+1}^{(2)}=\rho_{k,i}^{(2)}+T_{\tau}+T_{p}N_{i+1}^{(k)}\\ \rho_{k,i+1}^{(3)}=\rho_{k,i}^{(3)}+T_{\tau}+T_{p}N_{i+1}^{(k)}\\ \rho_{k,i+1}^{(4)}=\rho_{k,i}^{(4)}+T_{\tau}+T_{p}N_{i+1}^{(k)}\\ \end{array} \right. \tag{24}\]  
At the receiver, there is the same relationship \(\sigma_{k,i}^{(j)}\) and \(\sigma_{k,i+1}^{(j)}\). Similarly, there is the same relationship for the \((k+1)\)-th block. Thus, according to the relationship in (24), (22) can be rewritten as  
\[\left\{ \begin{array}{l}\rho_{k+1,i}^{(2)}\leq\rho_{k,i}^{(3)}-T_{g}\\ \rho_{k,i+1}^{(2)}\leq\rho_{k+1,i}^{(3)}-T_{g}\\ \rho_{k+1,i}^{(2)}+N_{i+1}^{(k+1)}\leq\rho_{k,i}^{(3)}-T_{g}+T_{p}N_{i+1}^{(k) }\\ \rho_{k,i+1}^{(2)}+N_{i+2}^{(k)}\leq\rho_{k+1,i}^{(3)}-T_{g}+T_{p}N_{i+1}^{(k+1 )}\\ \end{array} \right. \tag{25}\]  
Figure 2: The proposed RLPC-J-ARQ scheme. After further straightforward deduction, we have  
\[\left\{ \begin{array}{l}\rho^{(2)}_{\dot{k}+1,l}\leq\rho^{(3)}_{\dot{k}+1,l}-T_{g }\\ \rho^{(2)}_{\dot{k}+1}\leq\rho^{(3)}_{\dot{k}+1,l}-T_{g}\\ N^{(k+1)}_{\dot{i}+1}\leq N^{(k)}_{\dot{i}+1}\\ N^{(k)}_{\dot{i}+2}\leq N^{(k+1)}_{\dot{i}+1}\\ \end{array} \right. \tag{26}\]  
Similar results can be obtained for the receiver, (23) can be rewritten as  
\[\left\{ \begin{array}{l}\sigma^{(4)}_{\dot{k};i}\leq\sigma^{(1)}_{\dot{k}+1,i }-T_{g}\\ \sigma^{(4)}_{\dot{k}+1,l}\leq\sigma^{(1)}_{\dot{k}+1}-T_{g}\\ N^{(k)}_{\dot{i}+1}\leq N^{(k+1)}_{\dot{i}+1}\\ N^{(k+1)}_{\dot{i}+1}\leq N^{(k)}_{\dot{i}+1}\\ \end{array} \right. \tag{27}\]  
For the first transmission, \(i=1\), the constraints at the sender are given by  
\[\left\{