## 4 The Proposed Selective Retransmission Mechanism
### The Proposed DWT-Based Selective Retransmission Mechanism
The values of \(Tz_{pih}\) and \(Az_{pih}\) are presented in Equation (22). \[ \begin{split} Tz_{pih}&=\left\{\begin{matrix}Z_{pi} \cdot s.Rt_{ph}+\big{(}Lz_{pi}+s-l\big{)}Rtz_{ph}\,,Lz_{pi}>0\\ Z_{pi}\cdot s.Rt_{ph}\,,Lz_{pi}=0\end{matrix}\right.\\ \left.Az_{pih}=&\left\{\begin{matrix}a.\Big{(}Z_{pi}\cdot Ra _{ph}+Raz_{ph}\,\Big{)},Lz_{pi}>0\\ a.Z_{pi}\cdot Ra_{ph}\,,Lz_{pi}=0\end{matrix}\right.\end{split}  \tag{22}\]  
transmissions of the last packet after fragmentation is defined as \(Rtq_{ph}\), when employing \(Ptq_{ph}\) in Equation (8). Note that \(Ptq_{ph}=1\) and \(Rtq_{ph}=0\) when \(Lq_{pi}=0\). \[Tq_{ph}= \begin{cases}Q_{pi}\cdot\prod\limits_{j=1}^{h}\bigl{(}\{-Pt_{pj}\}+ \bigl{(}Lq_{pi}+s-l\bigr{)}\prod\limits_{j=1}^{h}\bigl{(}\{-Ptq_{pj}\},h<DR,Lq_ {pi}>0\\ Q_{pi}\cdot\prod\limits_{j=1}^{h}\bigl{(}\{-Pt_{pj}\},h<DR,Lq_{pi}=0\\ \biggl{\{}\biggl{(}Q_{pi}\cdot s.\prod\limits_{j=1}^{DR}\bigl{(}\{-Pt_{pj}\} \biggr{)}\biggr{)}Rt_{ph}+\biggl{(}Lq_{pi}+s-l\bigr{)}\prod\limits_{j=1}^{DR} \bigl{(}\{-Ptq_{pj}\}\biggr{)}\biggr{)}Rtq_{ph},h\geq DR,Lq_{pi}>0\\ \biggl{\{}\biggl{(}Q_{pi}\cdot s.\prod\limits_{j=1}^{DR}\bigl{(}\{-Pt_{pj}\} \biggr{)}\biggr{)}Rt_{ph},h\geq DR,Lq_{pi}=0\\ \end{cases}  \tag{24}\]  
The total number of bit transmission for acknowledgment is defined as \(Aq_{ph}\). The hop DR in path \(p\) receives ACK messages from hop (DR + 1), but does not transmit ACK to the previous hop (DR - 1). Applying the value of \(Ptq_{ph}\) in Equation (10), we achieve the average number of ACK messages to acknowledge the transmission of the last packet after fragmentation received from hop \(h\), \(h>\) DR, that is \(Raq_{ph}\). The definitions for \(Aq_{ph}\) is presented in Equation (25), where \(Raq_{ph}=0\) if \(Lq_{pi}=0\) and \(Aq_{ph}=0\) for h \(<\) DR.  
\[Aq_{ph}= \begin{cases}a\Biggl{(}Q_{pi}\cdot\prod\limits_{j=1}^{DR}\bigl{(}\{- Pt_{pj}\}Ra_{ph}+\prod\limits_{j=1}^{DR}\bigl{(}\{-Ptq_{pj}\}Ra_{ph}\biggr{)} \bigr{)}Raq_{ph}\Biggr{)},h\geq DR,Lq_{pi}>0\\ a\Biggl{(}Q_{pi}\cdot\prod\limits_{j=1}^{DR}\bigl{(}\{-Pt_{pj}\}Ra_{ph}\biggr{)} \Biggr{)},h\geq DR,Lq_{pi}=0\\ \end{cases}  \tag{25}\]  
The computation of the energy consumption due to transmissions and receptions of an image \(i\) in hop \(h\) of path \(p\), considering original images processed by a 2-level 2D DWT, is defined in Equation (26). \[Et_{ph}=\bigl{(}Tz_{ph}+Tu_{ph}+Tq_{ph}\bigr{)}\Bigl{(}e_{e}+e_{ t}d_{ph}^{2}\bigr{)}+\bigl{(}Az_{pi(h-1)}+Aq_{pi(h-1)}\biggr{)}\Bigl{(}e_{e}+e_{ t}d_{p(h-1)}^{2}\Bigr{)} \tag{26}\] \[Er_{ph}=e_{e}\bigl{(}Tz_{pi(h-1)}+Az_{pih}+Tu_{pi(h-1)}+Tq_{pi(h- 1)}+Aq_{pih}\bigr{)}\]  
The energy consumption of the path is presented in Equation (27). Note that the value for \(Aq_{pi0}\) is zero for the source node. \[E_{pi}=\sum\limits_{h=1}^{H_{p}}\Bigl{(}Et_{ph}+Er_{ph}\Bigr{)}+\bigl{(}Tz_{ pi0}+Tu_{pi0}+Tq_{pi0}\bigr{)}\Bigl{(}e_{e}+e_{t}d_{p0}^{2}\Bigr{)}+Az_{pi0}e_{e}+C_{2 pi} \tag{27}\]  
When a 1-level 2D DWT is applied over the original image, the energy consumption can be estimated using Equation (20). For the 2-level 2D DWT, the equation in Equation (27) must be considered.