Protocols stack

From Contiki
Jump to: navigation, search

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


  • 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).

  • 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.


Back to Contiki Tutorials