Difference between revisions of "Protocols stack"

From Contiki
Jump to: navigation, search
 
(12 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
__TOC__
 
__TOC__
  
Protocols stack in ContikiOS, which does not include the Application, has 5 different layers. Each layer is implemented as a driver.
 
  
* '''Network Layer - network_driver'''
+
The Contiki netstacks<br><br>
* '''MAC Layer - mac_driver'''
+
* '''RDC Layer - rdc_driver'''
+
* '''Framer Layer - framer'''
+
* '''Radio Layer - radio_driver'''
+
  
 +
'''Three network stacks'''<br>
 +
1. IPv6<br>
 +
2. IPv4<br>
 +
3. Rime<br><br>
 +
 +
 +
== The Contiki netstack ==
 +
[[File:Contikinetstack.png|frame|Contiki Network Stack]]<br><br>
 +
 +
'''Four Layers'''<br>
 +
1. Network layer - NETSTACK_RADIO<br>
 +
2. MAC (Medium Access Control) layer - NETSTACK_MAC<br>
 +
3. RDC (Radio Duty Cycling) layer - NETSTACK_RDC<br>
 +
4. Radio layer - NETSTACK_RADIO<br><br>
 +
 +
'''The packet buffer - packetbuf'''<br>
 +
* One buffer, holds a single packet.<br>
 +
* All layers of the netstack operate on the packetbuf.<br>
 +
* Large enough to hold a single radio packet - PACKETBUF_CONF_LEN<br><br>
 +
 +
'''Queue buffers - queuebuf'''<br>
 +
* The packetbuf only holds the current packet.<br>
 +
* To store packets on queues, use a queuebuf.<br>
 +
* Use a list to keep track of them.<br><br>
 +
 +
'''uIP packet buffer - uip_buf'''<br><br>
 +
 +
'''Framers - NETSTACK_FRAMER'''<br>
 +
* The framer module converts link-layer headers to packet attributes - '''parse()'''<br>
 +
* And packet attributes to link-layer headers - '''create()'''<br>
 +
 +
 +
<br><br><br>
 +
== Network & Routing Layer ==
 +
 +
* Contiki automatically forms a wireless IPv6 network with the help of routing protocol called RPL (Routing Protocol for Low-power and Lossy Networks (LLNs)).<br>
 +
* RPL forms routing graph from root node or AP (Access Point). It builds acyclic graph from root node called DODAG (Destination Oriented Directed Acyclic Graph).<br>
 +
[[File:RPLDODAG.png|center|frame|RPL DODAG]]<br>
 +
* DIO (DODAG Information Object) messages are broadcast by all nodes starting from the root node. It includes the node's rank, ETX, DAG version number etc.<br>
 +
[[File:NF1.png|center|frame|5 nodes Network]]<br>
 +
[[File:NF2.png|center|frame|DIO message sent by root node]]<br>
 +
[[File:NF3.png|center|frame|DIO message broadcasted by receiving nodes]]<br>
 +
[[File:NF4.png|center|frame|DIO message broadcasted by receiving nodes]]<br>
 +
[[File:NF5.png|center|frame|Rank of the nodes with respect to the root]]<br>
 +
* The node selects a parent based on the received DIO messages and calculates its rank.<br>
 +
*
 +
 +
 +
== References ==
 +
http://www.slideshare.net/ADunkels/building-day-2-upload-building-the-internet-of-things-with-thingsquare-and-contiki-day-2-part-3<br>
 +
http://www.slideshare.net/ADunkels/building-the-internet-of-things-with-thingsquare-and-contiki-day-1-part-2?related=1<br>
 +
https://tools.ietf.org/html/rfc6550<br>
 +
http://www.slideshare.net/ADunkels/building-day-2-upload-1?next_slideshow=1<br>
 +
http://www.slideshare.net/ADunkels/advanced-internet-of-things-firmware-engineering-with-thingsquare-and-contiki-day-1-part-2<br>
  
  
 
[[Contiki_tutorials | Back to Contiki Tutorials]]
 
[[Contiki_tutorials | Back to Contiki Tutorials]]

Latest revision as of 01:34, 27 October 2014

Back to Contiki Tutorials


The Contiki netstacks

Three network stacks
1. IPv6
2. IPv4
3. Rime


The Contiki netstack

Contiki Network Stack


Four Layers
1. Network layer - NETSTACK_RADIO
2. MAC (Medium Access Control) layer - NETSTACK_MAC
3. RDC (Radio Duty Cycling) layer - NETSTACK_RDC
4. Radio layer - NETSTACK_RADIO

The packet buffer - packetbuf

  • One buffer, holds a single packet.
  • All layers of the netstack operate on the packetbuf.
  • Large enough to hold a single radio packet - PACKETBUF_CONF_LEN

Queue buffers - queuebuf

  • The packetbuf only holds the current packet.
  • To store packets on queues, use a queuebuf.
  • Use a list to keep track of them.

uIP packet buffer - uip_buf

Framers - NETSTACK_FRAMER

  • The framer module converts link-layer headers to packet attributes - parse()
  • And packet attributes to link-layer headers - create()





Network & Routing Layer

  • Contiki automatically forms a wireless IPv6 network with the help of routing protocol called RPL (Routing Protocol for Low-power and Lossy Networks (LLNs)).
  • RPL forms routing graph from root node or AP (Access Point). It builds acyclic graph from root node called DODAG (Destination Oriented Directed Acyclic Graph).
RPL DODAG

  • DIO (DODAG Information Object) messages are broadcast by all nodes starting from the root node. It includes the node's rank, ETX, DAG version number etc.
5 nodes Network

DIO message sent by root node

DIO message broadcasted by receiving nodes

DIO message broadcasted by receiving nodes

Rank of the nodes with respect to the root

  • The node selects a parent based on the received DIO messages and calculates its rank.


References

http://www.slideshare.net/ADunkels/building-day-2-upload-building-the-internet-of-things-with-thingsquare-and-contiki-day-2-part-3
http://www.slideshare.net/ADunkels/building-the-internet-of-things-with-thingsquare-and-contiki-day-1-part-2?related=1
https://tools.ietf.org/html/rfc6550
http://www.slideshare.net/ADunkels/building-day-2-upload-1?next_slideshow=1
http://www.slideshare.net/ADunkels/advanced-internet-of-things-firmware-engineering-with-thingsquare-and-contiki-day-1-part-2


Back to Contiki Tutorials