wiki:node-contiki

Version 12 (modified by ikram, 14 years ago) (diff)

--

Node-contiki

This guide describes how to setup an IPv6 tunnel and configure a Linux for routing traffic to and from a sensor network running Contiki and IPv6/6LoWPAN. This guide is best suited for Ubuntu Linux.

Table of Contents

  1. Introduction
  2. Operating System (ubuntu)
  3. Enabling connectivity between sensor network and IPv6 network
    1. Download Contiki-2.4
    2. Bridge overview
    3. Setting up the IPv6 GOGO6 Tunnel

Introduction

This guide describes the steps how to program contiki-2.4 with sensei components to a node.

NOTE: The information related to the bridge and Contiki OS is taken from Contiki website and other Contiki related resources.

Operating System (ubuntu)

If you have fresh copy of Ubuntu operating system, to install msp430 tool chain perform the following steps. $ gksudo gedit /etc/apt/sources.list --> remove all # before source lists $ sudo ldconfig $ sudo apt-get update $ sudo apt-get install subversion wireshark radvd Download the (msp430-tmote-tools-contiki) folder from http://www.ee.oulu.fi/~ikram/ Install msp430-tools: sudo dpkg -i msp430tools-*.deb sudo nano /home/sensei/.profile export PATH=$PATH:/opt/msp430/bin:/opt/msp430/lib

Enabling connectivity between sensor network and IPv6 network

Download Contiki-2.4

Download Contiki 2.4 release source code (contiki-2.4.zip) from (http://www.sics.se/contiki/download.html) and extract it with a command: $ unzip contiki-2.4.zip

Bridge overview

setup

Initial Steps to setup the Bridge

Open the terminal on Ubuntu.

IPv6 forwarding must be enabled before running the bridge sudo nano /etc/sysctl.conf Uncomment the line which contains:

net.ipv6.conf.default.forwarding=1

Reboot / logout and login back on the system

Build a bridge

  1. Disable the WLAN before building the bridge.
  1. First you will need to program a TelosB/Tmote Sky, or similar node with a IEEE 802.15.4 compliant bridge. The bridge is available in contiki-2.4/tools/sky/uip6-bridge/uip6-bridge-tap.c and you upload the code with the following steps:
  • $ cd contiki-2.4/tools/sky/uip6-bridge
  • $ make uip6-bridge-tap.upload
  1. Install radvd in your Ubuntu Linux
  • $ sudo apt-get install radvd
  1. Create a file /etc/radvd.conf and copy the following lines to that file

interface tap0 {

AdvSendAdvert? on; AdvLinkMTU 1280; AdvCurHopLimit? 128;

AdvReachableTime? 360000; MinRtrAdvInterval? 10; MaxRtrAdvInterval? 15; AdvDefaultLifetime? 45;

prefix aaaa::/64

{

AdvOnLink? on; AdvAutonomous? on; AdvPreferredLifetime? 4294967295; AdvValidLifetime? 4294967295;

};

};

  1. Build a bridge
  • $ cd contiki-2.4/tools/sky/uip-bridge
  • $ make connect
  • $ shift+ctrl+t (opens a new terminal tap)
  • $ make bridge

Now the bridge node and the Linux should be a router for your IPv6 enabled sensor nodes. Make sure you have some nodes (JCreate, Tmote Sky, Raven LCD, etc) with some IPv6 software and then try to ping some of your nodes with ping6 and see what happens! Notice that you have to add %tap0 after the IPv6 address, in order to use the right interface, e.g.:

  • $ ping6 fe80::0212:7400:10cf:a5c9%tap0

Note: if you run "tcpdump -i tap0" you will see the IP addresses of your nodes when they ask for routers (Router Solicitation).

  1. Enable WLAN

Setting up the IPv6 GOGO6 Tunnel

To setup the IPv6 tunnel, there are following steps needs to be performed:

  1. Create an account on the http://gogonet.gogo6.com to access the Greenet6 website. follow the link: http://gogonet.gogo6.com/page/freenet6-tunnelbrokerdownloadthegogoCLIENT
  • To get a static IPv6 address or get a /56 network you need to get an account on the Freenet6 server. Create your account at this page:

http://gogonet.gogo6.com/page/freenet6-registration. Remember that this username and password can be used in go6.conf file, when we setting the ipv6 tunnel.

  • Download the gogoCLIENT for your System, In our case we have Ubuntu so download the Client 6.0 Source Code (Linux/Unix?/MacOS/BSD). http://gogonet.gogo6.com/page/download-1
  • Follow the HEX_DC_0005_Gateway6_Client_Guide (PDF) (page-61) contained in the gw6c package for the installation on your ubuntu machine. But for simplicity the steps are as follow.
  1. Complete the following steps to install the gogoCLIENT from the source code:
  1. Retrieve the source code (*.tgz or *.zip) and decompress it to a temporary directory.

/temp$ tar –xf gw6c-6_0-RELEASE-src.tar

  1. Compile the gogoCLIENT.

/temp/gw6c-6_0_1$ make all

  1. To install the gogoCLIENT in the /usr/local/gw6c directory with the necessary files, run the following command:

/gw6c-6_0_1$ make installdir=/usr/local/gw6c install

  1. Executing the gogoCLIENT requires the files listed below:
  • The gw6c binary file (gw6c) located in the bin directory.
  • A sample gw6c.conf file.
  • The template subdirectory containing the operating system scripts.
  1. In order to run the IPv6 tunnel as DNS, setup gw6c.conf file; the setting for the usr/local/gw6c/bin/gw6c.conf

Suppose we create an account with username. username: sensei-oulu password: *

$ sudo nano gw6c.conf

Change the following configurations: userid=sensei-oulu passwd=* server=authenticated.freenet6.net auth_method=any Other configurations: leave as default

Whole gw6c.conf file is at the end of this document.

Attachments (8)

Download all attachments as: .zip