# Analytical Model for the Duty Cycle in Solar-Based EH-WSN for Environmental Monitoring
## 3 Background  
The default MAC protocol delivered with the TinyOS 2.x release [54; 55] for the MicaZ platform, which holds a CC2420 radio [56], consists of an implementation of a protocol known as BoX-MAC [18]. This implementation, called BoX-MAC-2, was jointly proposed with implementation BoX-MAC-1 by [PERSON] and [PERSON] in [18]. Thus, this section aims to describe the operation of BoX-MAC-2, as it becomes a major issue in order to understand the energy model proposed in the next section. The CC2420 radio exhibits five operational states with different energy consumptions: (1) Power Off, where the voltage regulator is switched off; (2) Power Down, where the voltage regulator is on but the on-chip oscillator is still turned off; (3) Idle, where the oscillator is running; (4) Receive (RX), for reception mode; and (5) Transmit (TX), for transmission mode. Transitions between these states are triggered as consequence of some action on the radio. In essence, the LPL TinyOS mechanism alternately switches the CC2420 radio between the states ON and OFF, though through several intermediate states. For example, when a sensor node wakes up and puts its radio on to listen the channel, three transitions take place: (1) from Power Off to Power Down, (2) from Power Down to Idle, and (3) from Idle to RX. Analogously, when the sensor node turns off the radio from RX state, transitions from RX to Power Down and from Power Down to Power Off occur. Specifically, the state transition diagram for a CC2420 radio activation in which no ongoing packets are heard by the node is shown in Figure 1 on the left: the radio transits from Power Off to RX (passing through the intermediate states) and remains in the latter state for a period of time \(T_{l}\); after that, the radio transits from RX to Power Off and stays in this state for \(T_{slp}\) in order to perform a complete sleep period. Alternately, it could be the case that the node listens to an in-progress packet over the channel. This could occur during any radio activation of the node, at some instant between the start and end of a predetermined listening period. If this occurs, the listener keeps its radio at RX state until the packet is completely received and, after that, it transits to TX state in order to send the corresponding acknowledgement to the sender. Note that, in general, the time for checking the channel will be smaller than the duration of the RX period (\(T_{l}\)). Note also that the transmitter could need several retries until the receiver catches the full packet. Additionally, as the receiver of the packet will be generally a forwarding node (except in the case of the base station), this will perform subsequent TX-RX transitions until receiving an acknowledgement from its next hop. Then, before switching to the Power Off state, the node listens to the channel again for an additional time called DELAY_AFTER_RECEIVE, whose purpose is to keep the radio in RX state when activity, either transmission or reception, is detected on the channel. Note that, although the term suggests that this time is only spent after a reception occurs, it is also spent after a transmission occurs (DELAY_AFTER_RECEIVE in CC2420 Low Power Listening: [[http://mail.millennium.berkeley.edu/piperail/tinyos-help/2008-May/033858.html](http://mail.millennium.berkeley.edu/piperail/tinyos-help/2008-May/033858.html)]([http://mail.millennium.berkeley.edu/piperail/tinyos-help/2008-May/033858.html](http://mail.millennium.berkeley.edu/piperail/tinyos-help/2008-May/033858.html))). Figure 1 on the right shows the state transition diagram for this scenario. Finally, it could also happen that the reception (and subsequent forwarding) of a packet and the transmission of a packet generated by the node itself coincide at the same radio activation. In this case, the node behaves as explained previously and, additionally, it must accomplish the transmission of the own packet, for which the node goes into a new loop of TX-RX transitions until receiving a new ACK from its next hop.