CC2420 Packet Formats

From TinyOS Wiki
Revision as of 11:14, 7 July 2008 by Dmoss (talk | contribs) (New page: The CC2420 Packet structure is defined in CC2420.h. The default I-Frame CC2420 header takes on the following format::: typedef nx_struct cc2420_header_t { nxle_uint8_t length; ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The CC2420 Packet structure is defined in CC2420.h. The default I-Frame CC2420 header takes on the following format:::

 typedef nx_struct cc2420_header_t {
   nxle_uint8_t length;
   nxle_uint16_t fcf;
   nxle_uint8_t dsn;
   nxle_uint16_t destpan;
   nxle_uint16_t dest;
   nxle_uint16_t src;
   nxle_uint8_t network;  // optionally included with 6LowPAN layer
   nxle_uint8_t type;
 } cc2420_header_t;

All fields up to 'network' are 802.15.4 specified fields, and are used in the CC2420 hardware itself. The 'network' field is a 6LowPAN interoperability specification only to be included when the 6LowPAN TinyosNetwork layer is included. The 'type' field is a TinyOS specific field.

The TinyOS T-Frame packet does not include the 'network' field, nor the functionality found in the Dispatch layer to set and check the 'network' field.

No software footer is defined for the CC2420 radio. A 2-byte CRC byte is auto-appended to each outbound packet by the CC2420 radio hardware itself.

On reception of a packet, the 2-byte hardware generated CRC is replaced with an RSSI and LQI byte. The most significant bit of the LQI byte represents a boolean CRC pass/fail.

The maximum size of a packet is 128 bytes including its headers and CRC, which matches the 802.15.4 specifications. Increasing the packet size will increase data throughput and RAM consumption in the TinyOS application, but will also increase the probability that interference will cause the packet to be destroyed and need to be retransmitted. The TOSH_DATA_LENGTH preprocessor variable can be altered to increase the size of the message_t payload at compile time.

See Also

Next