Running RPL routing protocol with RIOT on M3 nodes

 

Difficulty: Medium

 Duration: 30 minutes

Prerequisites:  RIOT networking example for M3 nodesNodes Serial Link Aggregation

Description: The aim of this tutorial is to run an experiment on M3 nodes with the RPL routing protocol on RIOT OS. RIOT provides an implementation of the RPL routing protocol. RPL routing is based on DAG (Directed Acyclic Graph) structures.

  1. Connect to the SSH frontend of Saclay :
    my_computer:~$ ssh <login>@saclay.iot-lab.info
  2. Compile the firmware
    <login>@<site>:~$ source /opt/riot.source
    <login>@<site>:~$ cd iot-lab/parts/RIOT/examples/gnrc_networking/
    <login>@<site>:~$ BOARD=iotlab-m3 make all
  3. Retrieve the generated binary firmware file on your computer (execute this scp command on your computer!)
    my_computer:$ scp <login>@saclay.iot-lab.info:iot-lab/parts/RIOT/examples/gnrc_networking/bin/iotlab-m3/gnrc_networking.elf gnrc_networking.elf
  4. Log into the Web portal with your account credentials
  5. Submit a new experiment:
    • Set an experiment name (no spaces nor funny chars in the experiment name)
    • Duration: 30 minutes and starting “As soon as possible
    • Choose nodes with Architecture m3 (at86rf231) / Site = saclay / Number = 3 and click “Add to experiment”
    • Add your binary firmware gnrc_networking.elf with nodes selected
  6. Wait experiment state Running in dashboard list. After click on experiment details and visualize which nodes you are booked and verify that you have Success in the deployment result
  7. First, we have to initialize RPL on all nodes for interface 7 (can be obtained by looking at the output of ifconfig).We use on the SSH frontend the serial aggregator to talk to all nodes:
    <login>@<site>:~$ serial_aggregator
    rpl init 7
    1449177253.320969;m3-7;> rpl init 7
    1449177253.322160;m3-6;> rpl init 7
    1449177253.322816;m3-7;successfully initialized RPL on interface 7
    1449177253.323151;m3-8;> rpl init 7
    1449177253.323429;m3-6;successfully initialized RPL on interface 7
    1449177253.324136;m3-8;successfully initialized RPL on interface 7
    
  8. With RPL two types of nodes are available: simple router nodes and root nodes (the root of the DAG).In our example we will choose m3-6 as the root of the DAG. Before doing so however, we need to configure a global IPv6 address form3-6 that can be used as the RPL DODAG-ID.
    m3-6;ifconfig 7 add 2001:db8::1
    1449177776.399768;m3-6;> ifconfig 7 add 2001:db8::1
    1449177776.399935;m3-6;success: added 2001:db8::1/64 to interface 7
    
  9. Now we can start a RPL DODAG on the root node with the configured global IPv6 address as the DODAG-ID and the instance id 1.
    m3-6;rpl root 1 2001:db8::1
    1449177966.453694;m3-6;> rpl root 1 2001:db8::1
    1449177966.454517;m3-6;successfully added a new RPL DODAG
    
  10. To show the dodag at node 7 and 8:
    m3-7;rpl
    1449177995.460814;m3-7;> rpl
    1449177995.461945;m3-7;instance table:  [X]
    1449177995.462053;m3-7;parent table:    [X]     [ ]     [ ]
    1449177995.462144;m3-7;
    1449177995.462787;m3-7;instance [1 | mop: 2 | ocp: 0 | mhri: 256 | mri 0]
    1449177995.464708;m3-7; dodag [2001:db8::1 | R: 512 | OP: Router | CL: 0s | TR(I=[8,20], k=10, c=0, TC=lus, TI=lus)]
    1449177995.466627;m3-7;         parent [addr: fe80::3432:4833:46de:9f16 | rank: 256 | lifetime: 109s]
    
    m3-8;rpl
    1449177998.722267;m3-8;> rpl
    1449177998.722532;m3-8;instance table:  [X]
    1449177998.724176;m3-8;parent table:    [X]     [ ]     [ ]
    1449177998.724176;m3-8;
    1449177998.724176;m3-8;instance [1 | mop: 2 | ocp: 0 | mhri: 256 | mri 0]
    1449177998.726506;m3-8; dodag [2001:db8::1 | R: 512 | OP: Router | CL: 0s | TR(I=[8,20], k=10, c=0, TC=lus, TI=lus)]
    1449177998.727195;m3-8;         parent [addr: fe80::3432:4833:46de:9f16 | rank: 256 | lifetime: 106s]
    

    We see that these nodes are part of a dodag with a rank of 512 and having a parent with IPv6 address fe80::3432:4833:46de:9f16, which is the root node.

  11. For the root node:
    m3-6;rpl
    1449178290.113545;m3-6;> rpl
    1449178290.114897;m3-6;instance table:  [X]
    1449178290.115005;m3-6;parent table:    [ ]     [ ]     [ ]
    1449178290.115095;m3-6;
    1449178290.117920;m3-6;instance [1 | mop: 2 | ocp: 0 | mhri: 256 | mri 0]
    1449178290.118965;m3-6; dodag [2001:db8::1 | R: 256 | OP: Router | CL: 0s | TR(I=[8,20], k=10, c=2, TC=lus, TI=lus)]
    

    As expected, the root node has no parent, because it is the root of the dodag.

  12. Show the forwarding table of the root node:
    m3-6;nib route
    1449178347.494238;m3-6;> nib route
    1449178347.497593;m3-6;Destination                             Flags        Next Hop                                Flags      Expires          Interface
    1449178347.499694;m3-6;2001:db8::3432:4833:46d4:9f22           0x00000000 H fe80::3432:4833:46d4:9f22               0x00000001 117.3989637
    1449178347.502168;m3-6;2001:db8::3432:4833:46d8:9f06           0x00000000 H fe80::3432:4833:46d4:9f22               0x00000001 117.3989957
    
  13. More information regarding RIOT-OS and RPL can be found in the RIOT-OS wiki