# Hybrid ARQ Scheme with Autonomous Retransmission for Multicasting in Wireless Sensor Networks
## 5 Practical Implementation of Proposed HARQ Scheme  
For practical implementation, we propose an adaptive algorithm that adjusts the number of autonomous retransmissions blockwise, such that the value \(N\) is fixed during an update interval and can be changed between update intervals. Specifically, the proposed algorithm adjusts the value of \(N\) used for the current update interval by using the estimated \(\left\{p_{p,m};1\leq m\leq M_{\max}\right\}\) from the previous update interval. To adaptively adjust the number of autonomous retransmissions, we need two criteria--one is used to increase the value of \(N\) and the other is used to decrease the value of \(N\). To derive the criterion used to increase \(N\), we compare \(\eta_{p}(N)\) and \(\eta_{p}(N+1)\). In other words, the value \(N\) is increased, when \(\eta_{p}(N+1)\) is greater than \(\eta_{p}(N)\). Since the numerators of \(\eta_{p}(N)\) and \(\eta_{p}(N+1)\) are the same, we compute the difference between the denominators of \(\eta_{p}(N)\) and \(\eta_{p}(N+1)\). For \(\eta_{p}(N)\), the denominator of (14) is defined by  
\[R_{t}(N)=(R_{d}+KR_{u})L_{p}(N)-KR_{u}N. \tag{19}\]  
The difference between the denominators of \(\eta_{p}(N)\) and \(\eta_{p}(N+1)\) is written as  
\[\begin{array}{ll}d(N,N+1)&=R_{t}(N)-R_{t}(N+1)\\ &=(R_{d}+KR_{u})[L_{p}(N)-L_{p}(N+1)]+KR_{u}\end{array}. \tag{20}\]  
Using (12), \(d(N,N+1)\) is computed as  
\[d(N,N+1)=KR_{u}-(R_{d}+KR_{u})p_{p,N+1}. \tag{21}\]  
Since \(p_{p,N+1}=P[M\leq N+1]\) is the probability that a packet transfer is terminated by the \((N+1)-\text{th}\) transmission, the estimate can be easily calculated from the transmission history of previous HARQ packets. In (21), \(d(N,N+1)>0\) implies that \(\eta_{p}(N)<\eta_{p}(N+1)\). Thus, the current value of \(N\) increases when \(d(N,N+1)>0\). As a next step, we need to determine the criterion that can be used to decrease the value of \(N\). As in (19-21), we can derive \(d(N-1,N)\) as follows  
\[d(N-1,N)=KR_{u}-(R_{d}+KR_{u})P[M\leq N]. \tag{22}\]  
In this case, \(P[M\leq N]\) is not available for the HARQ process with \(N\) autonomous retransmissions, because a packet transfer is not completed before the \((N+1)\)-th transmission. Therefore, \(d(N\ -\ 1,\ N)\) cannot be computed in the proposed HARQ scheme with \(N\) autonomous retransmissions. Thus, we propose an alternative approach to compute \(d(N-1,N)\). When the number of autonomous retransmissions remains unchanged during a predetermined time interval, we decrease the number of autonomous retransmissions. Then, it is possible to compare \(\eta_{p}(N-1)\) and \(\eta_{p}(N)\)using (22). In the proposed HARQ scheme, the procedure for adjusting the number of autonomous retransmissions is summarized as follows  
1. Initialization: \(N=0\).
2. Estimation of \(p_{p,N+1}\) during the current update interval.
3. Computation of \(d(N,N+1)\): use (21).
4. Adjustment of \(N\): If \(d(N,N+1)>0\), then \(N=\min(N+1,M_{\max}-1)\).  
Else if \(N\) is not changed for \(T\) consecutive update intervals, then \(N=\max(N-1,0)\).
5. Repeat steps 2-4 for the next update interval.  
In step 5, \(T\) is a positive integer which is determined based on a tradeoff between the adaptation speed and the steady-state performance. The steady-state performance for various \(T\) values is provided in Section 6.