[riot-users] Multihop Network

Cenk Gündogan cenk.guendogan at fu-berlin.de
Fri Sep 25 09:08:57 CEST 2015


Hello Caroline,

I hope you don't mind that I put this particular email back on the 
mailing list, because this might
be of interest to others, too.

While it is possible to do some extra tinkering on the `gnrc_networking` 
example in order
to receive the udp payload in the application's thread, I rather would 
suggest to look into
the posix sockets that are now merged into master. An example usage can 
be found here [1].

You have to adjust the Makefile of the example in [1] the following way:
* replace `gnrc_ipv6_default` with `gnrc_ipv6_router_default`
* add a new line `USEMODULE += gnrc_rpl`

This should suffice to get rpl into this new example. (Martine, correct 
me if I am wrong).

Best,
Cenk

[1] https://github.com/RIOT-OS/RIOT/tree/master/examples/posix_sockets


On 24.09.2015 15:33, QUEVA Caroline 242137 wrote:
> Thanks for the answer, it seems to solve my problem.
>
> Just another question, for now the udp server prints information from 
> packet dump. Do you know how I can get the information in packet 
> received (for example an integer) to print it or better to do 
> calculations with it ?
>
> For desvirt, I just modified xml files to create my own topology and 
> use vnet commands (in desvirt) to define and start my grid network.
> Then I start my nodes with "make term PORT=grid1_1_7_aX" with 
> grid1_1_7 the name of my xml file (in attachment) and X from 0 to n 
> (with n the number of total nodes).
> I didn't hear about problem using desvirt with RIOT.
>
> Caroline QUEVA
> Research Engineer at CEA-LIST
> DRT/LIST/DACLE/LIALP
> Laboratoire Infrastructures et Ateliers pour le Logiciel sur Puces
>
> Commissariat à l’énergie atomique et aux énergies alternatives
> MINATEC Campus | 17 rue des Martyrs | 38054 Grenoble Cedex 9
> ------------------------------------------------------------------------
> *De :* Cenk Gündogan [cenk.guendogan at fu-berlin.de]
> *Envoyé :* jeudi 24 septembre 2015 15:19
> *À :* QUEVA Caroline 242137
> *Objet :* Re: [riot-users] Multihop Network
>
> Hey Caroline,
>
> I can guess:
> Can you try using a global IPv6 address for the root node?
> e.g. by executing: `ifconfig <interface_id> 2001:db8::1` (or any other 
> global IPv6 address you desire) in the shell of the root node.
> You have to replace <interface_id> with the interface id you see when 
> you type `ifconfig` without parameters.
>
> Rationale:
> Dodag-IDs must be global IPv6 addresses or unique local IPv6 addresses.
> So using any address with a link-local prefix like `fe80...` will not 
> work.
>
> So when starting the RPL dodag on the root, you use the global IPv6 
> address instead:
> `rpl root 1 2001:db8::1`.
>
> I hope this solves the problem.
>
> By the way, you mentioned desvirt. Can I ask you how you are using 
> desvirt?
> Because AFAIK, desvirt is not able to run the RIOT native port right now.
> I made a pull request here [1] and here [2]. Are you using any of 
> these patches?
> Would be interesting to know (:
>
> Best,
> Cenk
>
> [1] https://github.com/RIOT-OS/RIOT/pull/3908
> [2] https://github.com/des-testbed/desvirt/pull/17
>
> On 24.09.2015 15:04, QUEVA Caroline 242137 wrote:
>> Hej Cenk,
>>
>> Thanks again for your answer,
>>
>> I updated my branch, I am currently on the last version of the master 
>> branch and it's still not working.
>>
>> To explain in more details, I created a network using desvirt tool 
>> with three nodes.
>> The first node is the dodag's root with the address 
>> fe80::8c6f:cdff:fe13:1 and runs the UDP server.
>> My second node is connected to the root, has the address 
>> fe80::8c6f:cdff:fe13:cb2a and can send message to the root via udp.
>> The third node is not connected to the root but it is connected to 
>> the second node, and should be able to send messages to the root via 
>> the second node.
>>
>> This is what I get on the third node :
>> /> fibroute
>> fibroute
>> Destination                             Flags  Next 
>> Hop                                Flags Expires          Interface
>> ::                                      0x0003 
>> fe80::8c6f:cdff:fe13:cb2a               0x0003 98.4643706
>> > udp send fe80::947d:6ff:fe40:1 8088 hello
>> udp send fe80::947d:6ff:fe40:1 8088 hello
>> Success: send 5 byte to [fe80::947d:6ff:fe40:1]:8088/
>>
>> On the second node I have this :
>> /fibroute
>> Destination Flags  Next Hop                                Flags 
>> Expires          Interface
>> ::   0x0003 fe80::947d:6ff:fe40:b46d 0x0003 74.4523616
>> fe80::2878:adff:fe49:c384               0x0003 
>> fe80::2878:adff:fe49:c384               0x0003 68.3986206/
>>
>> On the root node I have this :
>> /> fibroute
>> fibroute
>> Destination Flags  Next Hop                                Flags 
>> Expires          Interface
>> fe80::8c6f:cdff:fe13:cb2a                0x0003 
>> fe80::8c6f:cdff:fe13:cb2a               0x0003 117.677536
>> fe80::2878:adff:fe49:c384               0x0003 
>> fe80::8c6f:cdff:fe13:cb2a               0x0003 112.132266/
>> And no packet is dumped as expected...
>>
>> Do you know what's wrong ?
>>
>> Best,
>> Caroline
>>
>> Caroline QUEVA
>> Research Engineer at CEA-LIST
>> DRT/LIST/DACLE/LIALP
>> Laboratoire Infrastructures et Ateliers pour le Logiciel sur Puces
>>
>> Commissariat à l’énergie atomique et aux énergies alternatives
>> MINATEC Campus | 17 rue des Martyrs | 38054 Grenoble Cedex 9
>> ------------------------------------------------------------------------
>> *De :* users [users-bounces at riot-os.org] de la part de Cenk Gündogan 
>> [cenk.guendogan at fu-berlin.de]
>> *Envoyé :* jeudi 24 septembre 2015 11:17
>> *À :* users at riot-os.org
>> *Objet :* Re: [riot-users] Multihop Network
>>
>> Hey Caroline,
>>
>>> Thanks a lot for your information, it's very helpful.
>> You're welcome! I am happy to help.
>>
>> There was a bug in the RPL implementation some days ago that resulted 
>> in wrong entries in the FIB table.
>> However, this should be fixed in the current master branch of RIOT. 
>> In case you haven't tried it already:
>> could you rebase/update your branch?
>>
>> If this doesn't fix the multi-hop communication problem, then I would 
>> be interested in the output of your fib table. You can dump the fib 
>> entries by issueing the command `fibroutes` in your RIOT shell.
>> (To reduce noise on the mailing list, you can send the dump directly 
>> to me)
>>
>> Let me know if you have further questions/feedback.
>>
>> Best,
>> Cenk
>>
>>>
>>> I tried to follow the process using rpl for routing and udp to send 
>>> messages but I don't manage to send messages via multihop. I can 
>>> send a message to the udp server with single hop but as soon as 
>>> multihop is necessary to reach the udp server, the message is not 
>>> received.
>>> When I check the rpl dodag, everything is fine, nodes have the right 
>>> parent in the parent list...
>>> Do you have any idea what's could be wrong ?
>>>
>>> Thanks for your help !
>>>
>>> Caroline QUEVA
>>> Research Engineer at CEA-LIST
>>> DRT/LIST/DACLE/LIALP
>>> Laboratoire Infrastructures et Ateliers pour le Logiciel sur Puces
>>>
>>> Commissariat à l’énergie atomique et aux énergies alternatives
>>> MINATEC Campus | 17 rue des Martyrs | 38054 Grenoble Cedex 9
>>> ------------------------------------------------------------------------
>>> *De :* users [users-bounces at riot-os.org] de la part de Cenk Gündogan 
>>> [cenk.guendogan at fu-berlin.de]
>>> *Envoyé :* lundi 21 septembre 2015 15:30
>>> *À :* users at riot-os.org
>>> *Objet :* Re: [riot-users] Multihop Network
>>>
>>> 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:
>>> 1) 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
>>> 2) 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):
>>> 1) configure a global IPv6 address for the root node of RPL
>>>     m3-1;ifconfig 7 add dead:beef::1
>>> 2) initialize RPL on interface 7 for all nodes
>>>     rpl init 7
>>> 3) 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
>>>
>>>
>>>
>>> On 21.09.2015 12:20, Santiago Bragagnolo wrote:
>>>> Hi all!
>>>>
>>>> I am quite new in this brave new world of IOT. Sorry if the 
>>>> question then is maybe trivial.
>>>>
>>>> I am looking for a solution for sending a packet from a node to an 
>>>> other through an other node using a wireless radio connection. For 
>>>> this I'am using iot-lab platform (iot-lab.info), working strictly 
>>>> with M3 cortex based nodes.
>>>>
>>>> These nodes of course will not be in direct range, and that is why 
>>>> i need a multihop network.
>>>>
>>>> Then my question is how to build up a network in between different 
>>>> IOT nodes and finally being able to send packets.
>>>>
>>>> I already tried searching in google and in the documentation, and 
>>>> the best link I arrived is the following :
>>>> https://github.com/RIOT-OS/RIOT/wiki/Virtual-riot-network
>>>>
>>>> from the following conversation:
>>>> https://lists.riot-os.org/pipermail/users/2015-July/000389.html
>>>>
>>>> I understand that desvirt creates a virtual network for me, but i 
>>>> cannot arrive to understand how to deploy that into a real set of 
>>>> nodes, since it looks more as a simulation than to a real deployment.
>>>>
>>>> If any one can give me a better clue about how to solve this 
>>>> problem it would be great.
>>>>
>>>>
>>>> Thank you very much!
>>>>
>>>> Santiago.
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> users mailing list
>>>> users at riot-os.org
>>>> http://lists.riot-os.org/mailman/listinfo/users
>>>
>>>
>>>
>>> _______________________________________________
>>> users mailing list
>>> users at riot-os.org
>>> http://lists.riot-os.org/mailman/listinfo/users
>>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.stillroot.org/pipermail/users/attachments/20150925/d098514e/attachment-0001.html>


More information about the users mailing list