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

change child route on new rank #25

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

smlng
Copy link

@smlng smlng commented Sep 2, 2016

This PR fixes the following issue I observed when using sunshine as RPL root on a RPi with OpenLabs transceiver and 2 sensor nodes running RIOT gnrc_networking example.

RPL root (sunshine) has rank 1, the first RIOT nodes takes up rank 257, after sending a DAO sunshine adds a route to that first child node. Starting the second RIOT node it first chooses the other RIOT node as parent, hence has rank 513. When sunshine hears the DAO of the second node it correctly implements a route via the first RIOT node as first hop.

However, when sunshine sends its next DIO both RIOT nodes receive that and the second RIOT node changes its parent to the RPL root node running sunshine, hence adapting its rank to 257 as the first RIOT node. After sunshine hears the DAO it should change the route for the second node, that is changing the next hop. Without this fix, this does not happen, sunshine would still assume to reach the second node via the first one - any packet from RPL root to the second child would end up in a loop, bouncing back-and-forth between root and the first (child) node.

My fix changes the command from ip -6 route add ... to ip -6 route replace ... which changes the next hop if route already present or adds a new route if none exists.

The code changes are minor and not beautiful, I didn't take the time to apply coding conventions. As I read in the code, the respective commands are bound to change to use netlink. However, this fix is required otherwise sunshine does not adapt to route changes of its children.

@smlng
Copy link
Author

smlng commented Sep 2, 2016

another quick note: it seems that unstrung increases the dodag version number with every DIO send. This basically triggers init of a new DODAG hence RIOT sends a DAO on every DIO by unstrung. And that likely causes a rank change and new parent for the second RIOT node, but unstrung does not adapt the respective route.

So another solutions would be to fix/disable dodag version increase in unstrung, but that way the topology would be static. So my fix is IMO the better option, and increasing dodag version in every DIO is discouraged by the standard - but might be necessary every now and then to repair the dodag when links are broken.

@smlng
Copy link
Author

smlng commented Sep 2, 2016

ah its not the DODAG version that increases but the DTNS (destination advertisement trigger sequence number) in DIOs, however that make RIOT sending a DAO on each DIO by unstrung.

@mcr
Copy link
Collaborator

mcr commented Sep 16, 2016

Sorry, to have missed this pull request when you posted it. I will pull your code and review today.

@mcr mcr self-assigned this Sep 16, 2016
@smlng smlng force-pushed the pr/fix_update_child_route branch from 4df73e1 to 638bd66 Compare September 26, 2016 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants