Private IPv6/6LoWPAN/RPL network with M3 nodes

 

Difficulty: High

Duration: 45 minutes

Prerequisites: Configure SSH Access / Submit an experiment with M3 nodes using the web portal

Description: The aim of this tutorial is to discover the basics of Contiki uIP stack & tools for IoT-LAB IPv6. You will reserve some nodes on the Grenoble site, set them up with the two provided firmwares using CLI tools, and create a simple IPv6 network in IoT-LAB. You will access nodes over HTTP over IPv6 from the SSH frontend, using a Contiki tunslip6 bridge.

  1. Log into the Web portal with your account credentials
  2. Submit a new experiment:
    • Set an experiment name (no spaces nor funny chars in the experiment name)
    • Duration: 60 minutes and starting “As soon as possible
    • Choose ten nodes with Architecture m3 (at86rf231) / Site = grenoble / Number = 10 and click “Add to experiment”
  3. Wait experiment state Running in the Schedule dashboard section. After click on experiment details and visualize which nodes you are booked and verify that you have Success in the deployment result
  4. Download firmware binaries on SSH frontend:
    my_computer$ ssh <login>@grenoble.iot-lab.info
    • Border Router: bridge between the server and the IoT-LAB IPv6 network
      <login>@grenoble:~$ wget --no-check-certificate https://raw.githubusercontent.com/wiki/iot-lab/iot-lab/firmwares/contiki/border-router.iotlab-m3
    • HTTP server: simple IPv6 node
      <login>@grenoble:~$ wget --no-check-certificate https://raw.githubusercontent.com/wiki/iot-lab/iot-lab/firmwares/contiki/http-server.iotlab-m3

    View Border Router and HTTP Server source code on GitHub.

  5. Choose one node in your nodes list to implement the Border Router (BR) node
    • we chose node m3-4
  6. Start tunslip6 on the SSH frontend:
    • <login>@grenoble:~$ sudo tunslip6.py -v2 -L -a m3-4 -p 20000 fd00::1/64
      slip connected to ``172.16.10.4:20000''
      
      10:26:01 opened tun device ``/dev/tun0''
      0000.000 ifconfig tun0 inet `hostname` up
      0000.007 ifconfig tun0 add fd00::1/64
      0000.010 ifconfig tun0 add fe80::0:0:0:1/64
      0000.013 ifconfig tun0
      
      tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
                inet adr:192.168.1.5  P-t-P:192.168.1.5  Masque:255.255.255.255
                adr inet6: fe80::1/64 Scope:Lien
                adr inet6: fd00::1/64 Scope:Global
                UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
                RX packets:0 errors:0 dropped:0 overruns:0 frame:0
                TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
                collisions:0 lg file transmission:500 
                RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
    • Note 1: leave the terminal open (you don’t want to kill tunslip6, it bridges the BR to the front-end network)
    • Note 2: If you have an error “overlaps with routes”, it’s because another experiment is using the same ipv6 prefix (e.g. : fd00::1/64).You can view ipv6 prefix used on the frontend SSH with this command and choose another prefix in IPv6Network(‘fd00::/8′) like fddd::1/64.
      <login>@grenoble:~$ ip -6 route
      fd00::/64 dev tun_7589  proto kernel  metric 256  mtu 1500 advmss 1440 hoplimit 4294967295
      fe80::/64 dev eth1  proto kernel  metric 256  mtu 1500 advmss 1440 hoplimit 4294967295
      fe80::/64 dev eth0  proto kernel  metric 256  mtu 1500 advmss 1440 hoplimit 4294967295
    • Note 3: if you did not already authenticate using iotlab-auth, do it now:
      <login>@grenoble:~$ iotlab-auth -u login
  7. Deploy the Border Router (BR) node on selected node using the CLI tool iotlab-node.
    <login>@grenoble:~$ iotlab-node --update ~/border-router.iotlab-m3 -l grenoble,m3,4
    {
        "0": [
            "m3-4.grenoble.iot-lab.info"
        ]
    }
  8. Get the Border Router IPv6 address from tunslip output:
    ...
    Platform starting in 1... 
    GO!
    [in clock_init() DEBUG] Starting systick timer at 100Hz
    
    0081.141 *** Address:fd00::1 => fd00:0000:0000:0000
    0081.171  Starting 'Border router process' 'Web server'Got configuration message of type P
    0081.171 Setting prefix fd00::
    0181.141 Server IPv6 addresses:
    0181.141  fd00::9176
    0181.141  fe80::9176
    
  9. Ping6 BR node using global address:
    <login>@grenoble:~$ ping6 fd00::9176
  10. View BR’s web-interface :
    <login>@grenoble:~$ lynx -dump http://[fd00::9176]

    You should see a web page with no neighbors and no routes.

    Note: if you want to use your computer browser you can configure a Web proxy with SSH frontend

  11. Deploy one HTTP server node picking another node (here node 5)
    <login>@grenoble:~$ iotlab-node --update ~/http-server.iotlab-m3 -l grenoble,m3,5
    {
        "0": [
            "m3-5.grenoble.iot-lab.info"
        ]
    }
  12. Check the BR’s web interface to see the newcomer
  13. Grab the HTTP server node’s IPv6 address from the BR’s web interface
       Neighbors
    fe80::a176
    
       Routes
    fd00::a176/128 (via fe80::a176) 16711424s

    Understand M3 nodes uid / ipv6 address match.

  14. Ping the HTTP server’s global address from SSH frontend
    <login>@grenoble:~$ ping6 fd00::a176
  15. Deploy one more HTTP server node
  16. Check again the BR’s web-interface and see the newcomer
  17. Download the page of the first HTTP server:
    <login>@grenoble:~$ lynx -dump http://[fd00::a176]/
  18. Deploy HTTP servers on all remaining nodes (with –exclude iotlab-node option)
    <login>@grenoble:~$ iotlab-node --update ~/http-server.iotlab-m3 --exclude grenoble,m3,4+5{
        "0": [
            "m3-1.grenoble.iot-lab.info", 
            "m3-2.grenoble.iot-lab.info", 
            "m3-3.grenoble.iot-lab.info", 
            "m3-6.grenoble.iot-lab.info", 
            "m3-13.grenoble.iot-lab.info", 
            "m3-287.grenoble.iot-lab.info", 
            "m3-288.grenoble.iot-lab.info", 
            "m3-289.grenoble.iot-lab.info"
        ]
    }
  19. Check again the BR’s web-interface (reload) and see the newcomers
       Neighbors
    fe80::a176
    fe80::a682
    fe80::b868
    fe80::c370
    fe80::9982
    fe80::2354
    fe80::1162
    fe80::b982
    
       Routes
    fd00::a176/128 (via fe80::a176) 16711415s
    fd00::a682/128 (via fe80::a682) 16711415s
    fd00::1162/128 (via fe80::a682) 16711421s
    fd00::9982/128 (via fe80::a682) 16711416s
    fd00::b868/128 (via fe80::b868) 16711415s
    fd00::c370/128 (via fe80::c370) 16711414s
    fd00::b982/128 (via fe80::c370) 16711420s
    fd00::2354/128 (via fe80::2354) 16711416s

    Study how RPL shapes the routing table. Here: 5 nodes out of 7 neighbors are targeted as routers for other nodes (check the “via” addresses).

    The RPL tree can be represented as shown below:

    <login>@grenoble:~$ wget --no-check-certificate https://github.com/iot-lab/contiki/raw/master/examples/ipv6/http-server/get_rpl_tree.sh
    <login>@grenoble:~$ bash get_rpl_tree.sh fd00::9176
     fd00::9176
         fd00::2354
         fd00::a176
         fd00::a682
              fd00::1162
         fd00::b868
         fd00::c370
              fd00::b982
    

     

  20. Check again the first HTTP server page and see (some of) the newcomers, plus a new route.
       Neighbors
    fe80::9176 PREFERRED
    fe80::b868
    fe80::c370
    fe80::2354
    fe80::9982
    fe80::a682
    
       Default Route
    fe80::9176
    
       Routes
  21. Check the “furthest” HTTP server listed in BR’s neighborhood:
    <login>@grenoble:~$ lynx -dump http://[fd00::1162]/
    Neighbors
    fe80::a682 PREFERRED
    fe80::b868
    fe80::c370
    fe80::2354
    fe80::9982
    fe80::b982
    fe80::9176
    fe80::a176
    
       Default Route
    fe80::a682
    
       Routes
  22. Check to see if all deployed nodes are reachable
    • check number of neighbors visible in BR vs number of deployed nodes
    • use ping6 to check all nodes are reachable
  23. Kill some of the RPL network nodes using ”iotlab-node –stop”
    <login>@grenoble:~$ iotlab-node --stop -l grenoble,m3,288+289
  24. Check the effect on the RPL network by reloading the pages with lynx
  25. Restart one node using ”iotlab-node –start”, check the effect
    <login>@grenoble:~$ iotlab-node --start -l grenoble,m3,288

 

Additionnal details

Configure a Web proxy with SSH frontend

Setup sock5 proxy with :

my_computer$ ssh -v -ND 1234 <login>@grenoble.iot-lab.info

Configure your browser to use sock5 proxy localhost:1234 :

my_computer$ google-chrome --proxy-server="socks://localhost:1234"

Access serial port directly from your computer

Open a SSH tunnel between your computer and the M3 node

my_computer$ ssh -L 20000:m3-:20000 @grenoble.iot-lab.info

In another terminal, run nc locally as if you were on the ssh frontend.

my_computer $nc localhost 20000

Run this tutorial on your computer

Go to Build tunslip6 on your computer tutorial