## 5 Rate Adaptive MAC (RA-MAC)
It can operate in the 433, 868 and 915 MHz license-free Industrial, Scientific and Medical (ISM) frequency bands. The data rates achievable with the XE1205 radio are programmable from 1.2 kbps to 152 kbps. Lowering the transmission data rates increases the transceiver's sensitivity extending the transmission range from approximately \(150\) m to \(1,800\) m (outdoor, line of sight). It is also possible to control the range by varying the transmission power levels of sender. However, the maximum transmission power levels of transceivers have been used in most outdoor WSN applications because multi-hop transmissions may be more energy expensive compared to single-hop transmissions [2]. Therefore, we argue that varying the transmission data rates provides a more viable option for most outdoor WSN applications. ### TinyOS Implementation

The manufacturer provides TinyOS 1.x support for TinyNodes, which includes a CSMA-style radio stack. Low Power Listening (LPL, B-MAC) [13,14] is also implemented as one of the alternatives of TinyNode MAC. B-MAC reduces receiver idle listening energy consumption by transferring the energy burden from receivers to senders, which are required to send long preambles before data packets. By introducing scheduled channel polling, the state-of-the-art WSN MAC protocol SCP-MAC [10] can reduce B-MAC node energy consumption by _a factor of 10_. Therefore, we decided to compare the performance of RA-MAC and SCP-MAC. Note that the rate adaptive mechanism introduced can be easily implemented with other sensor network MACs such as B-MAC and Z-MAC. However, the performance of RA-MAC will be compromised with B-MAC as the size of preamble/tone (the fixed part of Equation (9)) in B-MAC is significantly larger than in SCP-MAC. We implement a simplified version of SCP-MAC by introducing fine-grained time synchronization on top of the existing TinyNode B-MAC component. This simplified version of SCP-MAC has almost all the features of the original except for adaptive channel polling. Because the radio duty cycles are low (e.g., one sample per minute) in long-lived WSNs, the probability of transmission collisions is small. Forexample, if a node transmits one packet per minute and there are 20 nodes in the radio interference range, the probability of two or more nodes transmitting simultaneously is less than 2% [29]. The simplified version of SCP-MAC, henceforth referred to as simply as SCP-MAC, is the basis of our experimental performance comparison and our proposed RA-MAC protocol. Figure 2 shows the basic operations of RA-MAC in one duty cycle. Synchronized nodes wake up and listen to the channel periodically. First, the sender transmits a tone to notify the receiver that there is one packet coming. Then, the sender transmits a one-byte data rate value, determined by Algorithm 1, to the receiver. Both tone signal and data rate value are transmitted at the base rate (_i.e._, 9.6 kbps). Now that the receiver is ready to receive at the specified data rate (_i.e._, either 9.6, 20, 38 or 76 kbps) the sender transmits the preamble and data frame to the receiver at the specified rate (the preamble is needed to re-calibrate signal at the new rate). After the receiver captures the whole packet, it runs Algorithm 2 to process the packet. If the packet is correctly received, the receiver transmits the ACK back to the sender using the same data rate as the data packet. Finally, the sender applies Algorithm 2 to update function \(\textit{PRR}_{\textrm{data}}\) and \(\textit{PRR}_{\textrm{ack}}\) upon receiving the ACK packet. The parameters values we used in the implementation are \(M=10,\beta_{1}=1/2,\beta_{2}=\beta_{3}=1/32\). To handle clock drift in the nodes, a synchronization packet is sent every minute at the base transmission rate. We should also note that we found that the TinyOS implementation support for 152 kbps transmission data rate was not stable, and did not use it for our RA-MAC implementation and evaluation. Figure 3 shows the components of RA-MAC implementation in TinyOS.