# Optimal Routing for Time-Driven EH-WSN under Regular Energy Sources
## 2 Energy Consumption Model
### Energy Consumption Model for the LPL mechanism in TinyOS Sensor Nodes  
For the sake of completeness, this subsection recalls the main results obtained in [14] about the energy consumed by the LPL mechanism implemented in TinyOS sensor nodes. Figure 2 describes this mechanism, where node A transmits a packet to node B, which receives and forwards such packet to the next hop (not shown). As it can be noticed, node A sends the packet repetitively until node B wakes up, captures the full packet and sends back an acknowledgment packet. The figure introduces the following temporal magnitudes:  
Figure 1: Uncoupled duty cycles between a transmitter node (T) and a receiver node (R) in asynchronous communication. * \(T_{CCA}\): Time for clear channel assessment. This is the time required by the sending node to check that there are no ongoing transmissions on the channel. * \(T_{pkt}\): Packet duration. * \(W_{ack}\): Waiting time for the acknowledgment from the receiver. If no acknowledgment is received, the transmission was unsuccessful and the transmitter tries again. * \(T_{ack}\): Duration of acknowledgment packets. * \(T_{c}=T_{CCA}+T_{pkt}+W_{ack}\). * \(T^{\prime}_{c}=T_{CCA}+T_{pkt}+T_{ack}\). * \(T_{l}\): Nominal duration of duty periods, also known as DUTY_ON_TIME in TinyOS nomenclature. This is, in fact, the duration of duty periods in absence of traffic activity (minimum duration). * \(T_{slp}\): Duration of sleep periods. If \(DC\) denotes the nominal duty cycle (in percentage), we can set up the following equality: \(DC=\frac{T_{l}}{T_{l}+T_{slp}}100\). * \(DAR\): This is the DELAY_AFTER_RECEIVE, a period of time that a node remains active after completing a traffic task, either a transmission (node A) or a reception (with subsequent forwarding) (node B). Note that the name of this magnitude does not reflect its full role, as it suggests that it only takes place after a packet reception. According to the assumption that the offered traffic is homogeneously distributed over the network (Section 1), let us assume, with no loss of generality, that each node reports one packet per communication round. Therefore, if a given node \(X\) has \(\sigma(X)\) descendants in the routing tree, its traffic load is precisely \(\sigma(X)\), since this node has to receive and forward \(\sigma(X)\) packets (aside from transmitting its own packet). In [14], an accurate expression is provided for the average energy consumed by a TinyOS sensor node in every communication round of a time-driven application:  
\[\varepsilon[E_{round}(X)]=\sigma(X)\cdot\varepsilon[E_{R}(X)]+(\sigma(X)+1) \cdot\varepsilon[E_{T}(X)]+\left(\frac{T_{rnd}}{T_{l}+T_{slp}}-(\sigma(X)+1) \right)\cdot E_{l}. \tag{1}\]  
In the above equation, \(E_{R}(X)\) denotes the energy wasted to receive a packet, \(E_{T}(X)\) is the energy wasted to transmit a packet, \(T_{rnd}\) is the duration of a communication round and \(E_{l}\) is the energy consumed in idle listening by every duty period without traffic activity. \(\varepsilon[\cdot]\) is the expectation operator. The presence of this operator is due to the random asynchrony between the duty periods of the two communicating nodes (see Figure 2). This randomness is reflected in two components: The number of  
Figure 2: Operation of Low Power Listening (LPL) in TinyOS sensor nodes: Node A transmits a packet to node B, which receives and forwards this packet. tries performed by the transmitter until it receives an acknowledgment (node A in Figure 2), and the fraction of receiver duty period until the start of a full packet (node B in Figure 2).