## 5 Rate Adaptive MAC (RA-MAC)
Since the ACK packet normally has very small size and does not have a CRC field, we implicitly assume that an ACK packet is always correct if it is received by the sender. Therefore, it is difficult to measure \(\textit{PRR}_{\mbox{ack}}\) directly. However, we can use an alternative approach to estimate \(\textit{PRR}_{\mbox{ack}}\). We introduce a new parameter named \(PRR_{\mbox{data}\&ack}\), which is the successful rate of data packet transmission. A data packet transmission is only considered successful when the ACK packet for the data packet is received at the sender. In other words, \(PRR_{\mbox{data}\&ack}\) is the successful rate of both a data packet and an ACK packet. We have \(PRR_{\mbox{data}\&ack}=\textit{PRR}_{\mbox{data}}\cdot\textit{PRR}_{\mbox{ack}}\). Therefore, we can estimate \(\textit{PRR}_{\mbox{ack}}\) by \(PRR_{\mbox{data}\&ack}/\textit{PRR}_{\mbox{data}}\). In```
1:procedure\(ReceiveData(Packet)\)
2: Collect \(RSSI\) and \(R\)
3: Calculate CRC
4: Stat \(\Leftarrow\) (CRC correct)? 1:0
5:\(PRR_{\mbox{data}}(RSSI,R)\Leftarrow(1-\beta_{2})\cdot PRR_{\mbox{data}}(RSSI,R)+ \beta_{2}\cdot Stat\)
6:if CRC correct then
7: Transmit ACK packet with RSSI and \(PRR_{\mbox{data}}(RSSI,R)\)
8:endif
9:endprocedure
```

**Algorithm 2** Pseudo-code for receiving a data packet

```
1:procedure\(ReceiveData(Packet)\)
2: Collect \(RSSI\) and \(R\)
3: Calculate CRC
4: Stat \(\Leftarrow\) (CRC correct)? 1:0
5:\(PRR_{\mbox{data}}(RSSI,R)\Leftarrow(1-\beta_{2})\cdot PRR_{\mbox{data}}(RSSI,R)+ \beta_{2}\cdot Stat\)
6:if CRC correct then
7: Transmit ACK packet with RSSI and \(PRR_{\mbox{data}}(RSSI,R)\)
8:endif
9:endprocedure
```

**Algorithm 3** Pseudo-code for receiving an ACK packet

Now we discuss the memory space required in RA-MAC algorithm. The main variables \(PRR_{\mbox{data}}\), \(PRR_{\mbox{ack}}\), and \(PRR_{data\mbox{ack}}\) are a function of \(RSSI\) and \(R\). They can be stored in three arrays, each of which is a two dimensional array with one row for each RSSI value (7 for Tinynode) and one column for each data rate (4 in our experiments). Thus the memory space required for these arrays is \(28\times 3=84\) bytes. Note that the link quality, _i.e._, PRR, closely depends on the RSSI. Wireless transmission effects such as multi-path fading have been taken into account by the collected RSSI values. Consequently, a node only needs to maintain one copy of these three arrays. The communications of this node to its multiple neighbors can share these PRR functions (even if the radio links to different neighbors have different multi-path effect). Therefore the size of the look-up table in RA-MAC is independent of the number of neighbors and is scalable with the density of the network. ## 6 Implementation and Evaluation

In this section, we describe our experimental results using RA-MAC on the TinyNode [9] platform. We first highlight the platform's features as well as the TinyOS [8] implementation details of RA-MAC. Then, we show the experimental results comparing the performance of RA-MAC to that of SCP-MAC. Although we chose to use TinyNode the proposed rate adaptive MAC algorithm is applicable to other off-the-shelf sensor network platforms, such as Mica2 motes (4.8 kbps to 76.8 kbps), and EyesIFX nodes (4.8 kbps to 64 kbps), which support multiple transmission data rates. Recently, in fact, Atmel introduced a 900 Mhz IEEE 802.15.4 transceiver (AT86 RF212), which supports multiple data rates from 20 kbps to 1 Mbps. Future radios will follow this trend requiring the need for algorithms such as RA-MAC. ### TinyNode and Multi-rate Radio

Manufactured by Shockfish SA, the TinyNode platform provides a versatile ultra-low-power sensing solution for research and industrial applications. The platform includes a TinyNode 584 core device and several extension boards that support richer connectivity and storage functions. The core module TinyNode 584 is a compact device, which features an ultra low power MSP430 micro controller. The radio chip is the XE1205 [30] radio transceiver from Semtech.