Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gnrc/rpl: Implement Minimum Rank with Hysteresis Objective Function #14623

Closed
wants to merge 5 commits into from

Conversation

benpicco
Copy link
Contributor

@benpicco benpicco commented Jul 27, 2020

Contribution description

This is a rebase of a previous PR to add the Minimum Rank with Hysteresis Objective Function (rfc 6719) for RPL.

Currently RIOT only implements the 'zero' objective function for RPL. Here always the path with the least hops will be selected.
If two nodes can see each other just barely, they would still rather chose the direct link instead of using an additional hop over a third node that both can see well.

MR-HOF adds link metrics to the rank calculation to solve this situation.

Testing procedure

A test application is provided in examples/gnrc_networking_rpl. Each node flashed with it will periodically (once per second) try to send a HELLO message to the DODAG root.
One node can be selected as the root node with the test start command. This starts the experiment.
The root node will count the HELLO messages from each node, the current results can be displayed with test info.

Under ideal conditions, the root node should receive as many HELLO messages per second as there are nodes in the mesh.

The experiment was conducted on the IoT-Lab using iotlab-m3 on the grenoble site. I used 50 mesh nodes as well as 5 sniffer nodes to visualize the resulting DODAG using foren6.

OF0

This is the default behavior and the only available objective function currently in master.
It will always select the shortest path, disregarding any link metrics.

OF0

test results
node address			count	TTL	RSSI	LQI
dead:beef::a4d1:30cc:a00d:1c81	159	64	-37	254
dead:beef::5c0f:9995:1957:47e5	146	64	-78	254
dead:beef::bcf1:935c:5bf0:704	156	63	-82	254
dead:beef::5880:3c4d:ec49:584d	96	63	-89	186
dead:beef::a472:9bc4:5997:7a5	159	64	-66	254
dead:beef::6452:e96b:a33c:af70	157	64	-67	254
dead:beef::ec1a:a605:46d1:c2d9	149	64	-85	238
dead:beef::b854:c1c:349c:b612	148	63	-66	254
dead:beef::6c79:499f:b1bf:efbd	52	63	-89	212
dead:beef::a8c8:5d92:b35:c9fb	159	64	-63	254
dead:beef::ec8e:8c2b:109d:8c11	152	64	-41	254
dead:beef::accd:b48e:20cb:2443	155	64	-65	254
dead:beef::a493:5d69:c593:83a1	157	64	-49	254
dead:beef::7874:f46f:9433:80e3	157	63	-66	254
dead:beef::a461:e4e9:18d3:c5b	157	64	-67	254
dead:beef::a48b:d9e5:5903:7769	155	64	-64	254
dead:beef::a46e:5204:724c:a062	158	64	-81	254
dead:beef::e449:92fa:8265:160d	124	64	-78	254
dead:beef::bcce:d5:ac5b:98db	156	64	-42	254
dead:beef::a808:c377:cd58:7918	155	64	-66	254
dead:beef::a858:6ff6:6913:6799	161	64	-51	254
dead:beef::ec39:47e6:e72e:23a6	166	63	-81	254
dead:beef::a4da:e993:b3cc:9f60	110	64	-89	188
dead:beef::bcb2:caf3:7a23:96b7	151	63	-66	254
dead:beef::dce5:5c81:4c98:361e	99	63	-89	210
dead:beef::a4a1:f4a4:54c1:d0d5	152	63	-81	254
dead:beef::ac76:9ad:ab62:df6a	162	64	-51	254
dead:beef::5cde:3003:d441:5055	79	63	-89	192
dead:beef::58ec:5b2:53d9:891f	139	64	-82	254
dead:beef::5c5f:c08b:28db:6c13	158	64	-72	188
dead:beef::78f4:2d4d:d3ec:ff40	140	64	-78	254
dead:beef::78fc:7f35:b18a:1d2e	160	64	-46	254
dead:beef::b870:eda5:93b8:4fbc	159	64	-67	254
dead:beef::a49a:2891:748e:22a4	160	63	-66	254
dead:beef::7890:b0a2:20d2:2e58	144	63	-82	254
dead:beef::ec89:5bb4:308:bfcc	97	63	-81	254
dead:beef::78f0:356f:f34e:27ae	141	63	-82	251
dead:beef::bc55:e417:ed:7c21	100	63	-89	168
dead:beef::f8dc:ed8c:23df:551d	154	63	-81	254
dead:beef::ac1d:64ff:90fe:8e3c	136	64	-69	254
dead:beef::bc6d:9e53:ba10:2066	90	63	-89	187
dead:beef::d8c0:5ba4:ed59:171f	98	63	-89	199
dead:beef::645d:eb28:53f8:f7c	28	64	-89	151
dead:beef::e4e2:fc97:38b5:a479	82	64	-89	172
dead:beef::5c6e:7b9e:514d:8363	78	63	-89	204
dead:beef::b8d0:5b74:8db9:373f	2	64	-68	68
dead:beef::a40d:a3e8:4bc0:f714	12	63	-89	200
nodes: 47
running for 157 s
6065 received (38 / s)

MR-HOF (LQI)

The at86r231 on the testbed does not support ETX reporting (and at86rf2xx is not using the new radio HAL for a software fallback yet) so I used the LQI as metric instead. (gnrc_rpl_mrhof_lqi)

MR-HOF with LQI metric

test results
node address			count	TTL	RSSI	LQI
dead:beef::78fc:7f35:b18a:1d2e	282	64	-46	254
dead:beef::a4d1:30cc:a00d:1c81	260	64	-37	254
dead:beef::ec8e:8c2b:109d:8c11	264	63	-67	254
dead:beef::5c0f:9995:1957:47e5	229	64	-78	254
dead:beef::6452:e96b:a33c:af70	258	63	-64	254
dead:beef::d8c0:5ba4:ed59:171f	233	63	-82	254
dead:beef::ec1a:a605:46d1:c2d9	244	63	-65	254
dead:beef::accd:b48e:20cb:2443	233	64	-65	254
dead:beef::b870:eda5:93b8:4fbc	261	64	-67	254
dead:beef::a8c8:5d92:b35:c9fb	267	64	-63	254
dead:beef::bcf1:935c:5bf0:704	234	62	-52	254
dead:beef::a4a1:f4a4:54c1:d0d5	237	63	-73	254
dead:beef::a472:9bc4:5997:7a5	264	63	-65	254
dead:beef::a493:5d69:c593:83a1	259	64	-49	254
dead:beef::bcce:d5:ac5b:98db	258	64	-43	254
dead:beef::7890:b0a2:20d2:2e58	220	63	-78	254
dead:beef::7874:f46f:9433:80e3	215	63	-72	185
dead:beef::a808:c377:cd58:7918	260	63	-49	254
dead:beef::ac76:9ad:ab62:df6a	264	64	-52	254
dead:beef::ec39:47e6:e72e:23a6	183	63	-72	249
dead:beef::a461:e4e9:18d3:c5b	262	64	-66	254
dead:beef::bc55:e417:ed:7c21	202	63	-72	251
dead:beef::a858:6ff6:6913:6799	252	64	-51	254
dead:beef::b8d0:5b74:8db9:373f	217	63	-82	254
dead:beef::a4da:e993:b3cc:9f60	234	62	-72	177
dead:beef::6c79:499f:b1bf:efbd	227	63	-82	247
dead:beef::5c5f:c08b:28db:6c13	182	64	-73	254
dead:beef::58ec:5b2:53d9:891f	219	64	-82	253
dead:beef::5cde:3003:d441:5055	220	62	-72	252
dead:beef::5880:3c4d:ec49:584d	228	62	-78	254
dead:beef::ac1d:64ff:90fe:8e3c	254	63	-64	254
dead:beef::bcb2:caf3:7a23:96b7	214	63	-73	254
dead:beef::e449:92fa:8265:160d	188	63	-78	254
dead:beef::a48b:d9e5:5903:7769	255	64	-64	254
dead:beef::bc6d:9e53:ba10:2066	212	63	-78	254
dead:beef::78f4:2d4d:d3ec:ff40	214	64	-78	254
dead:beef::dce5:5c81:4c98:361e	252	63	-78	254
dead:beef::e4e2:fc97:38b5:a479	215	63	-67	254
dead:beef::a40d:a3e8:4bc0:f714	230	63	-78	254
dead:beef::a46e:5204:724c:a062	200	64	-81	254
dead:beef::78f0:356f:f34e:27ae	195	63	-73	254
dead:beef::645d:eb28:53f8:f7c	203	62	-72	246
dead:beef::b854:c1c:349c:b612	198	63	-78	254
dead:beef::a49a:2891:748e:22a4	243	63	-72	254
dead:beef::ec89:5bb4:308:bfcc	121	63	-73	254
dead:beef::5c6e:7b9e:514d:8363	153	62	-73	254
dead:beef::f8dc:ed8c:23df:551d	193	63	-52	254
nodes: 47
running for 261 s
10708 received (41 / s)

Issues/PRs references

taken over from #7450
depends on and includes #14448

I noticed that the DODAG would degrade after several minutes independent of the objective function. This lead to a drop in the packets/s received on the root node.
In foren6 it seemed like some nodes would select parent nodes with a higher rank than they themselves had.

I did not attempt to debug this yet, but with socket_zep we should soon be able to simulate a mesh entirely on native, which should make that easier.

@benpicco benpicco added Area: network Area: Networking Type: new feature The issue requests / The PR implemements a new feature for RIOT State: waiting for other PR State: The PR requires another PR to be merged first labels Jul 27, 2020
@benpicco benpicco marked this pull request as ready for review October 10, 2020 22:19
@benpicco benpicco requested a review from chrysn October 12, 2020 09:02
@benpicco benpicco force-pushed the rpl-mrhof branch 2 times, most recently from 098ff4e to 095b5b9 Compare January 15, 2021 21:40
@benpicco benpicco requested a review from jia200x as a code owner January 15, 2021 21:40
@benpicco benpicco removed the State: waiting for other PR State: The PR requires another PR to be merged first label Feb 9, 2021
@miri64
Copy link
Member

miri64 commented Feb 22, 2021

A test application is provided in examples/gnrc_networking_rpl.

Given that examples/gnrc_networking is already a RPL example, this seems somewhat redundant.

@benpicco
Copy link
Contributor Author

The inclusion of neighbor statistics would exclude some low-memory boards from running gnrc_networking though.
We could also remove rpl from examples/gnrc_networking to make this a plain networking example.

Copy link
Member

@miri64 miri64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really a comment about MRHOF yet, but about the example application for now.

examples/gnrc_networking_rpl/Makefile Outdated Show resolved Hide resolved
sys/include/net/gnrc/rpl.h Outdated Show resolved Hide resolved
miri64
miri64 previously requested changes Feb 22, 2021
Copy link
Member

@miri64 miri64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now a bit more about the MRHOF code.

sys/net/gnrc/routing/rpl/mrhof.c Outdated Show resolved Hide resolved
sys/net/gnrc/routing/rpl/mrhof.c Show resolved Hide resolved
sys/net/gnrc/routing/rpl/mrhof.c Outdated Show resolved Hide resolved
sys/net/gnrc/routing/rpl/mrhof.c Outdated Show resolved Hide resolved
sys/net/gnrc/routing/rpl/mrhof.c Show resolved Hide resolved
sys/net/gnrc/routing/rpl/mrhof.c Outdated Show resolved Hide resolved
sys/net/gnrc/routing/rpl/mrhof.c Outdated Show resolved Hide resolved
@benpicco
Copy link
Contributor Author

@mcr maybe you are interested in this one.

@benpicco benpicco dismissed miri64’s stale review February 26, 2022 16:31

No time to look into this in detail. If you think this is in a good state, please go ahead without my review.

@benpicco benpicco requested a review from bergzand March 21, 2022 16:23
@benpicco benpicco requested a review from fabian18 May 18, 2022 21:52
@OlegHahm
Copy link
Member

RPL doesn't really require 6LoWPAN, so testing this with this native and des-virt should be possible or am I mistaken? This way we may be "easily" able to put regression tests in place.

@OlegHahm OlegHahm self-requested a review November 28, 2022 21:05
@OlegHahm
Copy link
Member

I'm willing to review and test this in the near future. Please ping me if I forget to do so.

@benpicco
Copy link
Contributor Author

benpicco commented Nov 28, 2022

Thank you!
I don't know about des-virt, but you can use ZEP dispatcher to test this on native.

Just ping me if the documentation there is lacking, I hoped it would allow for easy testing.
It's actually already used for an integration test of gcoap_fileserver to simulate packet loss on CI.
But you can of course also spawn the native nodes manually.

@riot-ci
Copy link

riot-ci commented Dec 13, 2022

Murdock results

✔️ PASSED

de745e4 gnrc/rpl: convert objective_functions array to list

Success Failures Total Runtime
7953 0 7953 16m:28s

Artifacts

@benpicco benpicco added the State: waiting for maintainer State: Action by a maintainer is required label Feb 24, 2023
@github-actions github-actions bot removed Area: doc Area: Documentation Area: examples Area: Example Applications labels Oct 19, 2023
@benpicco
Copy link
Contributor Author

I dropped the test/benchmark application hoping that this will make the PR easier to review.

@benpicco
Copy link
Contributor Author

Please ping me if I forget to do so.

@OlegHahm is there anything I can do to move this forward?

@OlegHahm
Copy link
Member

Please ping me if I forget to do so.

@OlegHahm is there anything I can do to move this forward?

Let me see - I'll try my best.

@benpicco
Copy link
Contributor Author

This patch has been floating around for 7 years now, closing it now.
If someone is interested in this feature they are more than welcome to re-open the PR and do the rebase.

@chrysn
Copy link
Member

chrysn commented Feb 14, 2024

I don't have the capacity to pick it up, but collecting some notes for when I do (or whoever does it):

The of_list_head parts of can probably be simplified to XFA (wasn't around when this was written).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: build system Area: Build system Area: network Area: Networking Area: sys Area: System CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR State: waiting for maintainer State: Action by a maintainer is required Type: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants