## 4 The Proposed Selective Retransmission Mechanism
### DWT-Based QoS
During packet transmission, intermediate nodes will check DR in order to verify the expected reliability level of the packet. In practical terms, the relaying node will check it to decide if a timeout must be set and if an ACK message is expected from the next hop toward the sink, while the receiving node relies on the value of DR to decide if an ACK message must be sent to the previous hop for positive acknowledgment purposes. Table 1 presents the possible values of DR according to DWT subbands, and the corresponding transmission service. It is interesting to notice that packets carrying data of a single image may experience different reliability guarantees, according to the packet's DR. An important remark is that the image header of the entire image (\(i_{o}\)) must be transmitted with the same priority of LL\({}_{\text{(n)}}\) subbands  
Figure 3: DWT processing generating two and three levels of resolution. (highest priority), since it is mandatory for the proper reconstruction of the original image at the receiver side. Table 1 gives us a clear notion that most information (75%) will be unreliably transmitted over the network (not retransmitted if corrupted), saving energy avoiding packet retransmissions and transmission of ACK messages. For a 1-level 2D DWT, the proposed solution assures reliable transmission for only 25% of the image information (\(\mathrm{LL}_{(1)}\)), while for a 2-level 2D DWT, only 6.25% of the original visual information (\(\mathrm{LL}_{(2)}\)) will be granted with full reliability guaranties. If packets carrying part of the remaining subbands are lost and not retransmitted, the sink can interpolate the received data to overcome the missing information or consider zeros to complete the subband. After applying DWT over the original image, the resulting packets should be transmitted in a scrambled order according to their Data Relevance, alternating the packets of highest relevance with low relevant packets. As the occurrence of error bursts is unpredictable (it is estimated only the average errors occurrence), a scrambled transmission may reduce the probability of mass losses of least relevant packets in the worst cases, providing a fairer distribution of retransmission attempts across time. As a final comment, DWT processing at source nodes demands energy that should be considered when computing the overall energy consumption. Such required energy, \(C_{pi}\), is a direct function of the type (coefficients of the L and H filters) of the employed DWT and it is consumed only in the source node, since we do not consider the energy consumption at the sink. As we are comparing the proposed solution with traditional hop-by-hop retransmission mechanisms, where original images will also need to be processed/coded at source nodes in most cases, we do not consider such energy crucial to the desired analyses. Nevertheless, we compute such energy adapting the corresponding equation in [16], where DWT is performed using a integer 5-tap/3-tap filter. For a \(m\) x \(n\) image, and considering \(e_{shift}\) the energy required for a 1-byte shift operation, \(e_{add}\) the energy for an 1-byte add operation, \(e_{read}\) the energy to read one byte from memory and \(e_{write}\) the energy to write one byte, the computation of \(C_{pi}\) is defined in Equation (14), where \(T\) is the number of times DWT is applied. \[C_{Tpi}=\sum_{j=1}^{T}\Biggl{(}\frac{1}{4^{(j-1)}}.m.n.\Bigl{(}10.e_{shift}+ 12.e_{add}+2.e_{read}+2.e_{write}\Bigr{)}\Biggr{)} \tag{14}\]