## 3 Problem Formulation
### Fundamental Concepts for Energy Consumption
#### 3.2.1 Error Model  
Packets in WSNs may be discarded for many reasons, as congestion, node failure and optimization mechanisms [10]. Moreover, multiple accesses to the communication medium may also result in packet collision, requiring a MAC protocol to handle the shared access to the channel and to retransmit collided packets. In such cases, many works have proposed solutions to recover lost data or to minimize the impact of packet loss in the final quality of the received data at the sink [4, 15, 24]. Wireless sensor networks are composed of resource-constrained nodes interconnected by ad-hoc wireless links that are expected to be deployed in regions with diverse characteristics, where signal interference may be a constant. Due to the nature of packet transmission over wireless links, communications also face channel fading. Such characteristics result in bit-errors that may happen in any part of the communication and in any hop from the source to the sink. Bit-errors resulting from transmission over wireless links is an inner characteristic of radio communications that directly results in packet losses, while the other causes of data loss depends on the employed sensor hardware, unexpected physical harming and/or the procedures of the physical/MAC protocols. For example, IEEE 802.15.4 allows the transmission of packets controlled by a slotted CSMA/CA protocol to handle packet collision but most or even all multimedia content can be transmitted during a Contention Free Period (CFP), where source nodes have dedicated access to the communication channel and frames do not collide [25]. As we are designing a generic solution for selective hop-by-hop retransmission, we are exclusively concerned with bit-errors and packet losses resulted from the characteristics of wireless communications. Errors in wireless links will happen as bursts [19, 25]. Although it is simpler to define the same error probability for every transmitted bit in a theoretical model, it is not practical for real-world applications since the error rate depends on the size of the packets [19]. The Gilbert/Elliot error model defines a Markov chain with two states: \"good\" and \"bad\". For simplicity, all the bits are unchanged in the good state, while in the bad state at least one of the bits is corrupted [26]. Figure 2 presents the Gilbert/Elliot Markov chain, where \(g\) is the probability to stay in good state and \(b\) is the probability to stay in the bad state. This error model refers to the transmission of bits in a wireless link connecting two nodes, and the values for \(g\) and \(b\) depend on physical characteristics of the considered link. Although this model refers to bit-errors, an error in a single bit will corrupt a whole packet, requiring retransmission. As we want to measure the energy consumption for packet transmissions and possible retransmissions, we are concerned with the average Packet Error Rate (PER) for transmitted packets from hop \(h\) to hop (\(h+1\)) in path \(p\), \(Pn_{ph}\), considering the transmission of \(n\) bits. For that, we need to compute the steady-state probability to good (\(G_{ph}\)) and bad (\(B_{ph}\)) states [26] in the wireless link from hop \(h\) to hop (\(h+1\)) in path \(p\), as presented in Equation (3). \[ \begin{split} G_{ph}=&\frac{1-b_{ph}}{2-\left(g_{ph} +b_{ph}\right)}\\ B_{ph}=&\frac{1-g_{ph}}{2-\left(g_{ph}+b_{ph}\right) }\end{split}  \tag{3}\]  
Based on these probabilities, we can compute the average PER for a packet with \(n\) bits (\(Pn_{ph}\)), as expressed in Equation (4). Such formulation is obtained considering the two cases where no bit error occurs during a transmission of a packet: the channel is in a good state and remains there for the entire transmission or the channel is initially in a bad state but the channel changes to a good state before transmission and remains in good state for the transmission of all bits [26].