Analyse of a real 6LoWPAN network using a Contiki-based sniffer module

From Contiki
Revision as of 13:38, 9 November 2014 by Ygoyal (Talk | contribs)

Jump to: navigation, search

Back to Contiki Tutorials


  • This tutorial is an introduction to IP-based sensor networks with Contiki.
  • Contiki has supported IP networking, through the uIP TCP/IP stack, since its first released in 2003. In 2008, Cisco released the world's smallest IPv6 stack, called uIPv6, for Contiki.
  • 6LoWPAN: is an acronym of IPv6 over Low power Wireless Personal Area Networks. The 6LoWPAN group has defined encapsulation and header compression mechanisms that allow IPv6 packets to be sent to and received over IEEE 802.15.4 based networks.
  • Basics of working with IPv6:
+ First thing to know is the fact that IPv6 addresses contain several zeros that can be shortened in several forms, such as-
FE80:0000:0000:0000:0000:0000:0000:F123 = FE80:0:0:0:0:0:0:F123 = FE80::F123
+ Additionally, the huge address space of IPv6 allows devices to have serverl addresses used for various purposes (for example, local communication, global communication)
The loopback address (::1) is a similar address than in IPv4 used to check the status of the interface (is good for checking if you have enabled IPv6 in your OS).
The local-link addresses (FE80::/10) is used to communicate with devices in the same link (however, the link can be extended with Layer 2 switches).
The global addresses (everything else) are used for communicating devices globally.

You will learn

This tutorial will walk you through the steps of setting up Contiki to sniff 6LoWPAN packets and visualize a real time wireless sensor network (WSN) in an interactive environment of Foren6. You will deploy UDP server-client IPv6 example on Tmote-Sky motes and sniff the packets on particular RF channel (1-26) (Note: In Contiki RF Channel range from 11-26) on a Tmote-Sky. You will install Foren6 and learn how to integrate a Tmote-sky with real-time diagnosis tool.

Foren6: A 6LoWPAN Diagnosis tool

Real layout of WSN

Foren6 is an effort to provide a non-intrusive 6LoWPAN network analysis tool. It leverages passive sniffer devices to reconstruct a visual and textual representation of network information to support real-world Internet of Things applications where other means of debug (cabled or network-based monitoring) are too costly or impractical.

  • Foren6 uses sniffers to capture 6LoWPAN traffic and renders the network state it in a GUI.
  • Foren6 captures all RPL-related information and identifies abnormal behaviors.
  • Multiple sniffers can be combined for extended coverage.
  • Rewind the packet capture history, replay a previous packet trace and navigate through different overlays to pinpoint problems.

Installation guide


  • System with Linux/MacOS X

  • For the purpose of this tutorial it is assumed that you already have a working Contiki 2.7 environment set up on your system and have access to at least three Tmote-Sky motes. Otherwise follow this link -

Foren6 Installation:

  • Dependencies
sudo apt-get install -y libqt4-dev qt4-qmake cmake make libexpat1-dev tshark libpcap0.8-dev libc6-dev g++ gcc

  • Get the Source
git clone

  • Install Foren6
cd foren6
sudo make install

Collect-view on Tmote-Sky

Configuring the sniffer for real time capture


Future Scope

  • You can also use Cooja (Network Simulator) to analyze an network. In Cooja use "Radio Message with a 6LoWPAN analyzer with pcap export" to store the packet capture in pcap format. Thus you can then use Wireshark or Foren6 to visualize the network and debug it.
Tip: You will find the pcap file in contiki/tools/cooja/build/radiolog-xxxxxxx.pcap

Understanding 6LoWPAN network: More about Foren6, Video:

Back to Contiki Tutorials