Contiki 2.6
|
The phase1 MAC implemented to support the IPv6/6LoWPAN stack within the Contiki project is a light weight yet adequate beginning. This phase supports point to point data connectivity between a router device and an end device. The router is the RZ USB stick from the ATAVRRZRAVEN kit. The end node is the AVR Raven from the ATAVRRZRAVEN kit. The picture below shows the complete ATAVRRZRAVEN kit.
The next phases will implement a commissioning concept including scan, and beacon generation. These kinds of primitives will allow dynamic network formation. Additionally, routing and low power/sleep will be implemented in following phases.
See the Running Contiki with uIPv6 and SICSlowpan support on Atmel RAVEN hardware for required systems setup configuration.
This MAC follows the recommendations of RFC4944 with respect to data frames and acknowledgements (i.e. all data frames are acknowledged). At the time of this writing (phase 1) beacons (frames) and association events are not implemented. Additionally, data frames always carry both source and destination addresses. PANID compression (intra-pan) is not used so both source and destination PANID's are present in the frame.
The SICSLoWMAC supports the IEEE 802.15.4 Data Request primitive and the Data Request Indication primitive. The data request primitive constructs a proper 802.15.4 frame for transmission over the air while the data indication parses a received frame for processing in higher layers (6LoWPAN). The source code for the mac can be found in the sicslowmac.[c,h] files.
To assemble a frame a MAC header is constructed with certain presumptions:
These and other variables are defined in mac.h.
Given this data and the output of the 6LoWPAN function, the MAC can construct the data frame and the Frame Control Field for transmission.
An IEEE 802.15.4 MAC data frame consists of the fields shown below:
The Frame Control Field (FCF) consist of the fields shown below:
The output function of the 6LoWPAN layer (sicslowpan.c) is the input function to the MAC (sicslowmac.c). The output function of the MAC is the input function of the radio (radio.c). When the radio receives a frame over the air it processes it in its TRX_END event function. If the frame passes address and CRC filtering it is queued in the MAC event queue. Subsequently, when the MAC task is processed, the received frame is parsed and handed off to the 6LoWPAN layer via its input function. These relationships are depicted below:
The source code for the MAC, Radio and support functions is located in the path:
The source code for the Raven platforms is located in the path:
There are two projects that utilize the Logo Certified IPv6 and 6LoWPAN layers contributed to the Contiki project by Cisco. These are ping-ipv6and webserver-ipv6 applications. They are located in the following paths:
The ping-ipv6 application will allow the USB stick to ping the Raven board while the webserver-ipv6 application will allow the raven board to serve a web page. When the ravenlcd-3290 application is programmed into the ATmega3290P on the Raven board, the Raven board can ping the USB stick and it can periodically update the temperature in the appropriate web page when served.