## 3 Fundamental Concepts
### Packet Relaying and Energy Consumption
As \(B_{(i)}>>(k-x)\) in most cases, the original image \(i\) will be fragmented, and a fragmentation header with \(f\) bits containing information for the decoding at the receiver side (at least the image id and the fragment offset) will be added to every transmitted packet. Moreover, an image \(i\) may have an image header, with \(o_{(i)}\) bits, providing information as the width and height of the image and the number of bits used to represent a pixel. Thus, an original image \(i\) will be packetized in \((B_{(i)}+o_{(i)})/(k-x-f)\) packets, with packets carrying data information to their maximum payload excepting the last one, which may be carrying less data than its capacity. We define \(W_{(p,i)}\) as the number of packets sizing \(k\) bits to be transmitted in path \(p\), resulting from the packetization of image \(i\). The last packet has \(kl_{(p,i)}\) as the payload size, \(kl_{pi}<(k-x-f)\). If we define the maximum packet payload as \(y\), \(y=(k-x-f)\), we achieve the values for \(W_{(p,i)}\) and \(kl_{(p,i)}\) as expressed in Equation (1). \[ \begin{split}& W_{(p,i)}=\left[\frac{\left(B_{(i)}+o_{(i)}\right)}{y }\right]\\ & k_{(p,i)}=\left(\left(B_{(i)}+o_{(i)}\right)-y\left[\frac{ \left(B_{(i)}+o_{(i)}\right)}{y}\right]\right)\end{split}  \tag{1}\]  
Regarding that it is likely that all intermediate nodes of a path \(p\) are homogeneous (excepting the source and the sink), we will assume that all nodes have same hardware characteristics and energy consumption patterns. We can define \(D_{(p,i,h)}\) as the total amount of bits to be transmitted for image \(i\) from hop \(h\) to the hop (\(h+1\)) in path \(p\), as presented in Equation (2). Due to packet loss and retransmission procedures, \(D_{(p,i,h)}\) may be different than \(W_{(p,i)}k\) for \(h>0\) and \(kl_{(p,i)}=0\), but we are assuming a lossless communication scenario. \[D_{(p,i,h)}= \begin{cases}W_{(p,i)},k+\left(kl_{(p,i)}+x+f\right)\\ W_{(p,i)},k\qquad,kl_{(p,i)}=0\end{cases}  \tag{2}\]  
The energy consumption is directly related with the transmission power of sensor nodes, \(Pwt_{(p,h)}\), the power for packet reception, \(Pwr_{(p,h)}\), and the time for transmission of one bit, \(tx_{(p,h)}\)[30, 31]. We define \(E_{t(p,h)}\) as the energy consumption in joules for packet transmission from hop \(h\) to hop (\(h+1\)) in path \(p\) and \(E_{t(p,h)}\) as the energy consumption for packet reception in hop \(h\) in the same path. The formulation in Equation (3) presents the energy consumption in each hop. \[ \begin{split}& E_{t(p,h)}=\begin{cases}D_{(p,h)}.Pwt_{(p,h)},tx_{(p,h)}\\ 0\qquad,h=(H_{(p)}+1)\end{cases}\\ & E_{t(p,h)}=\begin{cases}D_{p(h-1)}.Pwt_{(p,h)},tx_{(p,h)}\\ 0\qquad,h=0\end{cases}\end{split}  \tag{3}\]The values for \(Pwt_{(p,h)}\) and \(Pwt_{(p,h)}\) can be easily computed in conventional sensor motes since most of them are powered by two AA batteries (3.3 V) and the energy consumed to transmit each bit is a known characteristic depending on the desired transmission range. For example, the MICAz mote draws 17.4 mA when the transmission power is 0 dBm (57.42 mW), and 14 mA for the transmission power of \(-5\) dBm (46.2 mW). The value for \(tx_{(p,h)}\) is also known depending on the packet transmission rate: for IEEE 802.15.4 sensors equipped with the CC24200 chipset, \(tx_{(p,h)}=4\)\(\upmu\)s for the transmission of a single bit [32]. In wireless communications, the radio of the sensor nodes will have to switch between at least the transmission and reception modes. In duty-cycle protocols, the radio may also be in the sleep mode. We simplified considering that the radio may be only in transmission or reception mode at each moment and for each packet transmission or reception it is required a mode switch operation. Our resulted energy consumption model in Equation (4) assumes \(Pws_{(p,h)}\) as the power for mode switching and \(ts_{(p,h)}\) as the time required for a switching operation (typically much lower than 0.1 ms). \[