## 4 The Proposed Selective Retransmission Mechanism
### The Proposed DWT-Based Selective Retransmission Mechanism  
We define three levels of reliability according to the value of DR: reliable, unreliable and semi-reliable. Based on the mapping in Table 1, if a 1-level 2D DWT is applied over an original image, packets will be transmitted in a reliable or unreliable way. On the other hand, packets carrying data produced by a 2-level 2D DWT may be transmitted under any of the three reliability levels. The number of times DWT is applied over original images (defining possible values of DR) will indicate \begin{table}
\begin{tabular}{|c|l|l|} \hline
**DR** & **DWT subbands** & **Expected level of reliability** \\ \hline
0 & \(\mathrm{LL}_{(1)}\), \(\mathrm{LL}_{(2)}\) & Reliable transmission \\ \hline
1–254 & \(\mathrm{HL}_{(2)}\), \(\mathrm{LH}_{(2)}\), \(\mathrm{HH}_{(2)}\) & Semi-reliable transmission \\ \hline
255 & \(\mathrm{HL}_{(1)}\), \(\mathrm{LH}_{(1)}\), \(\mathrm{HH}_{(1)}\) & Unreliable transmission \\ \hline \end{tabular}
\end{table} 
Table 1: Values for the Data Relevance. the transmission service that must be considered. We will extend the energy consumption model described in Section 3 to incorporate these new definitions. In reliable transmission, every corrupted packet is retransmitted. For unreliable transmission, no retransmission is performed for the corrupted packet. Finally, in semi-reliable transmission, corrupted packets may be retransmitted depending on where the event occurred. Figure 4 depicts the three different reliability services. It is considered that an original image \(i\), \(i=1\),..., \(i=I\), sizing \(B_{i}\) bytes may be decomposed by a 2D DWT applied once or twice. Whatever the case, 75% of the resulted data will correspond to the \(\mathrm{HL}_{(1)}\), \(\mathrm{LH}_{(1)}\) and \(\mathrm{HH}_{(1)}\) subbands, and packets containing such data will be unreliably transmitted. We can define \(U_{pi}\) as the number of required packets with size \(s\) to transmit these three subbands and \(Lu_{pi}\) as the size of the payload of the last packet after fragmentation, if any, as expressed in Equation (15). We define \(l\) as the maximum payload size in bits of each packet, \(l=(s-k-f-\delta)\), considering the 8-bit Data Relevance field. The total number of packets carrying data of the \(\mathrm{HL}_{(1)}\), \(\mathrm{LH}_{(1)}\) and \(\mathrm{HH}_{(1)}\) subbands is \(U_{pi}+1\), for \(Lu_{pi}>0\). \[U_{pi}=\left|\frac{\left[\frac{3*B_{i}}{4}\right]}{l}\right| \tag{15}\] \[Lu_{pi}=\left|\left(\frac{3*B_{i}}{4}\right]-l\right|\frac{ \left[\frac{3*B_{i}}{4}\right]}{l}\right|\]  
Figure 4: Reliable, semi-reliable and unreliable transmission services. In average, each hop (\(h+1\)) will transmit less packets with DR = 255 to the next hop than hop \(h\) transmitted to it, for the same path, since some of them will be lost and not retransmitted. Defining \(Ptu_{ph}\) as the packet error rate in hop \(h\) when \(n=(Lu_{pi}+s-l)\) in Equation (4), we can estimate the average number of bits to be transmitted from hop \(h\) as \(Tu_{pih}\), as presented in Equation (16). \[Tu_{pih}= \begin{bmatrix}U_{pi}\cdot S.\prod\limits_{j=1}^{h}\left(1-Pt_{pi} \right),Lu_{pi}=0\\ U_{pi}\cdot S.\prod\limits_{j=1}^{h}\left(1-Pt_{pi}\right)+\left(Lu_{pi}+s-l \right)\prod\limits_{j=1}^{h}\left(1-Ptu_{pi}\right),Lu_{pi}>0\end{bmatrix}  \tag{16}\]  
A 2D DWT is applied only after the LL\({}_{(1)}\) subband is produced, representing 25% of the size of the original image. We define \(M_{pi}\) as the number of packets for the LL\({}_{(1)}\) subband and the image header \(i_{o}\) considering that all packets are carrying data to their maximum capacity and \(Lm_{pi}\) as the size of the last packet after fragmentation, if any, as presented in Equation (17). The total number of packets carrying data of the LL\({}_{(1)}\) subband is \(M_{pi}+1\), for \(Lm_{pi}>0\). \[M_{pi}= \begin{bmatrix}\left\lceil\dfrac{B_{i}}{4}\right\rceil+i_{o}\\ \dfrac{1}{l}\end{bmatrix}  \tag{17}\] \[Lm_{pi}=