## 4 The Proposed Selective Retransmission Mechanism
### The Proposed DWT-Based Selective Retransmission Mechanism
\begin{bmatrix}\left(\left\lceil\dfrac{B_{i}}{4}\right \rceil+i_{o}\right)-l,\begin{bmatrix}\left(\left\lceil\dfrac{B_{i}}{4}\right \rceil+i_{o}\right)\\ \dfrac{1}{l}\end{bmatrix}\end{bmatrix} \]  
Defining \(Ptm_{ph}\) as the packet error rate in hop \(h\) when \(n=(Lm_{pi}+s-l)\) in Equation (4), we achieve the average number of transmissions of the last packet, \(Rtm_{ph}\), when employing \(Ptm_{ph}\) in Equation (8), where \(Ptm_{ph}=0\) and \(Rtm_{ph}=1\) if \(Lm_{pi}=0\). As packets with DR = 0 will be retransmitted if corrupted, \(Tm_{pih}\) refers to the total amount of bit transmission (considering possible retransmissions) of subband LL\({}_{(1)}\) in path \(p\) and from hop \(h\) to \((h+l)\). As the probability of ACK transmissions is also affected by the possible smaller size of the last packet, we apply \(Ptm_{ph}\) to Equation (10), achieving the average number of ACK messages to acknowledge the transmission of the last packet after fragmentation in hop \(h\) of path \(p\), \(Ram_{ph}\), where \(Ram_{ph}=0\) if \(Lm_{pi}=0\). The values of \(Tm_{pih}\) and \(Am_{pih}\) for the most relevant data (DR = 0) and for a 1-level 2D DWT are defined in Equation (18). \[Tm_{pih}= \begin{bmatrix}M_{pi}\cdot S.Rt_{ph}+\left(Lm_{pi}+s-l\right)Rtm_{ph }\,,Lm_{pi}>0\\ M_{pi}\cdot S.Rt_{ph}\,,Lm_{pi}=0\end{bmatrix}  \tag{18}\]  
\[Am_{pih}= \begin{bmatrix}a.\left(M_{pi}\cdot Ra_{ph}+\left.Ram_{ph}\right)Lm_{pi }>0\\ a.M_{pi}\cdot Ra_{ph}\,,Lm_{pi}=0\end{bmatrix} \]  
When source nodes process gathered images using a 1-level 2D DWT, packets can only be transmitted in a reliable or unreliable way. We can estimate the expected energy consumption in such a case, as presented in Equation (19). For transmission of multiple images, all one has to do is to sum the expected energy consumption in path \(p\) for each image \(i\). \[ \begin{split} Et_{pih}=&\Big{(}Tm_{pih}+Tu_{pih}\Big{)} \Big{(}e_{e}+e_{t}\,d_{pih}^{2}\Big{)}+Am_{pi(h-1)}\cdot\Big{(}e_{e}+e_{t}\,d_ {pi(h-1)}^{2}\Big{)}\\ Er_{pih}=&\Big{(}Tm_{pi(h-1)}+Am_{pih}+Tu_{pi(h-1)} \Big{)}e_{e}\end{split}  \tag{19}\]  
The final energy consumption model when images are processed by a 1-level 2D DWT, considering the energy costs of the source node, is presented in Equation (20). \[E_{pi}=\sum\limits_{h=1}^{H_{p}}\Big{(}Et_{pih}+Er_{pih}\Big{)}+\Big{(}Tm_{pi0} +Tu_{pi0}\Big{)}\Big{(}e_{e}+e_{t}\,d_{pi0}^{2}\Big{)}+Am_{pi0}\cdot e_{e}+C_{1 pi} \tag{20}\]  
When a 2-level 2D DWT is applied over a raw image, reliable, unreliable and semi-reliable transmission services may be provided according to the resulted subbands. The subbands HL\({}_{(1)}\), LH\({}_{(1)}\) and HH\({}_{(1)}\) present the same visual information of the equivalent subbands after a 1-level 2D DWT, thereby receiving the same treating by intermediate nodes. The subband LL\({}_{(2)}\) contains the most significant visual information to the reconstruction of the original image, and so the highest relevance (DR = 0) is assigned to it. As the LL\({}_{(2)}\) subband is only 6.25% of the size of original image, \(M_{pi}\) cannot be considered for energy consumption computation in this case. Thus, \(Z_{pi}\) is defined as the number of packets for the LL\({}_{(2)}\) subband, and \(L_{2 pi}\) as the size of the payload of the last packet after fragmentation, as presented in Equation (21). \[ \begin{split} Z_{pi}=&\left|\left[\frac{B_{i}}{16} \right]+i_{o}\over l\right|\\ L_{2}=&\left(\left[\frac{B_{i}}{16}\right]+i_{o} \right)-l\left|\left[\frac{B_{i}}{16}\right]\right|\\ \end{split}  \tag{21}\]  
Defining \(Ptz_{ph}\) as the packet error rate in hop \(h\) when \(n=(Lz_{pi}+s-l)\) in Equation (4), we achieve the average number of transmissions of the last packet, \(Rtz_{ph}\), when employing \(Ptz_{ph}\) in Equation (8), where \(Ptz_{ph}=0\) and \(Rtz_{ph}=1\) if \(Lz_{pi}=0\). As the probability of ACK transmissions is also affected by the possible smaller size of the last packet, we apply \(Ptz_{ph}\) to Equation (10), achieving \(Raz_{ph}\), where \(Raz_{ph}=0\) if \(Lz_{pi}=0\).