Hey Santiago,
I am quite new in this brave new world of IOT. Sorry if the question then is maybe trivial.
All questions regarding IoT and RIOT are welcome on this mailing list (:
You are right, desvirt
is suitable for creating virtualized networks and is a great tool to test your
application in a controlled environment.
If you want to deploy your app on real hardware though, desvirt
will not help you here.
If you want to communicate over multiple hops, then you need to configure routes so that your nodes
know in which direction incoming traffic must flow.
These routes can be configured either statically by using the fibroute
command from within the RIOT shell, or by using a routing protocol that configures the routes dynamically.
Let’s try both ways:
Pre:
You can start an experiment from the IoT-Lab website or directly from the command line via a Makefile that we provide in RIOTBASE/dist/testbed-support/Makefile.iotlab
.
From within the gnrc_networking
example folder in RIOT you can call:
IOTLAB_USER=user_name IOTLAB_PHY_NODES=1-10 IOTLAB_EXP_NAME=multihop_test IOTLAB_DURATION=30 BOARD=iotlab-m3 make iotlab-exp -I ../../dist/testbed-support
user_name must be replaced by your login account for the IoT-Lab Testbed.
With IOTLAB_PHY_NODES you can specify the nodes you want to use for your experiment. You can also choose single nodes that are further apart like this: IOTLAB_PHY_NODES=1-3+7-10+15
IOTLAB_DURATION=30 <-- this is the duration of the experiment in minutes
Assuming the experiment started successfully, you can then communicate with the nodes directly from the command line like this:
IOTLAB_USER=user_name BOARD=iotlab-m3 make iotlab-term -I ../../dist/testbed-support
This command may prompt you for a password if your SSH key that you uploaded to the IoT-Lab testbed for SSH usage is password protected.
Once you are connected, the serial aggregator of the iot-lab testbed will be started and you have a console
from where you can control every node.
For the following I assume you have an experiment with nodes 1 + 5 + 10 and the gnrc_networking
example flashed on every node.
Static routing:
- configure a global IPv6 address for every node like this:
m3-1;ifconfig 7 add dead:beef::1 (or any other ipv6 address you desire)
m3-5;ifconfig 7 add dead:beef::5
m3-10;ifconfig 7 add dead:beef::10
- configure static routes:
m3-1;fibroute add dead:beef::5 via fe80::x_5
m3-1;fibroute add dead:beef::10 via fe80::x_5
m3-5;fibroute add :: via fe80::x_1
m3-5;fibroute add dead:beef::10 via fe80::x_10
m3-10;fibroute add :: via fe80::x_5
you have to look up the link local addresses (fe80::x_1,5,10) via the m3-x;ifconfig
command.
Now you can start e.g. a udp server on all nodes with this single command udp start server 8888
.
To communicate e.g. from node m1 over node m5 to node m10 you can then do:
m3-1;udp send dead:beef::10 8888 hello
. Et voilà, multi hop communication with static routes.
To save most of the preconfiguration needed for multi-hop communication, you can use a routing protocol.
Currently, you can only use RPL, but we also have an AODVV2 implementation, which is mostly done porting to the new network stack (AFAIK, correct me if I’m wrong).
Starting from a running experiment with the same preconditions as above (just execute reboot
to bring the nodes back to the initial state):
- configure a global IPv6 address for the root node of RPL
m3-1;ifconfig 7 add dead:beef::1
- initialize RPL on interface 7 for all nodes
rpl init 7
- start a RPL DODAG with m3-1 as root node and an instance id of 1
m3-1;rpl root 1 dead:beef::1
Within a couple of seconds, all nodes should have correctly configured routes and you should be able to ping or send udp packets from one node to any other node that participates in the RPL dodag.
You can check the RPL state of a node by issueing the rpl
command, e.g. m3-1;rpl
.
Let me know if you have further questions (:
Best,
Cenk