*4.3.2. Preamble transmission*

20 Will-be-set-by-IN-TECH

In the following a brief introduction of the packet reception procedure for the CC2420 is given to provide MAC protocol designers useful information regarding the implementation. Upon detection of the Start Frame Delimiter (SFD) field, the chip begins to buffer the received data in its 128 byte RXFIFO [40]. In case the default Auto Cyclic Redundancy Check (AUTOCRC) settings are not changed, the chip replaces the first byte of the Frame Check Sequence (FCS) with a RSSI value estimated over the first 8 symbols after the SFD field. The second FCS byte is replaced by a 7 bit correlation value used for Link Quality Indication (LQI) computation and by a 1 bit field which indicates whether the frame was correctly received. The resulting

Length MPDU (without FCS) FCS

Bytes: 1 n-2 n

The main limitation of this strategy is that damaged frames remain in the RXFIFO until they are read. In case of an overflow, the chip is not able to receive data until all correctly received frames are read and the buffer is flushed. Furthermore, the CC2420 does not protect the length field of the physical header. If the field is damaged and indicates, for example, that the stored frame is larger than the default frame size, TinyOS will *immediately* flush the buffer regardless of whether it contains correctly received frames since it does not know when the next correctly received packet starts. This means that if a MAC protocol fails to recognize a busy channel, a possible frame collision may cause correctly received frames to be flushed at the receiver before they are forwarded to the application. Listing 1 describes the reception routine in detail.

RSSI Correlation Value CRC

158 Wireless Sensor Networks – Technology and Protocols Preamble-Based Medium Access

Bits: 0 7 8 15

*4.3.1. Performance limitation factor - RXFIFO*

data frame is shown in Figure 11.

**Figure 11.** Data Frame in RXFIFO

...

} **else** {

}

} **else** {

} } ...

}

flush ( );

flush ( );

**Listing 1.** Frame Length Field Processing

async event **void** RXFIFO . readDone ( . . . ) {

**i f** ( rxFrameLength + 1 > m\_bytes\_left ) {

m\_bytes\_left −= rxFrameLength + 1;

**i f** ( rxFrameLength <= MAC\_FRAME\_SIZE ) {

*// further frame processing*

**i f** ( ! call FIFO . ge t ( ) && ! call FIFOP . ge t ( ) ) {

Buffer overflows represent a serious problem in dense wireless sensor networks with event-driven traffic due to the fact that nodes often try to retransmit lost data. Moreover, frequent transmission of preambles increases the utilization of the medium and the probability of buffer overflows in the receiver. Before writing a packet in the receive buffer, a transceiver reads the SFD flag of a received frame. The packet is only stored in the receive buffer if the SFD flag indicates a valid frame. Otherwise, the frame is silently discarded. However, an invalid frame is still detected by transceiver. Thus, a preamble that is transmitted with an invalid SFD flag can be used as reservation signal. On the other hand, useful information cannot be stored in the preamble since receiving nodes immediately discard the frame without further evaluation. Therefore, this mechanism cannot be applied for protocols, like XMAC or WiseMAC, which store information in the preamble.
