-
Notifications
You must be signed in to change notification settings - Fork 2k
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_ndp: add external routers to FIB when RPL is enabled #4489
gnrc_ndp: add external routers to FIB when RPL is enabled #4489
Conversation
dd4d5a6
to
494c266
Compare
@Yonezawa-T2 sorry for the late reply. I think you would need another RPL-Instance and DODAG with the intranet-connected leaf-node as its root. |
If I understand correctly, it would not result in loops. RPL DODAG is DAG, that is acyclic, so that looped route will not formed in RPL network in ideal situation. Actually, loops may be formed in general due to device movement and/or packet loss, but it is not related to this pull request. It is general RPL problem and shoud be resolved with loop avoidance mechanisms. Because RPL DODAG is DAG, not tree, RPL allows multiple routes to the destination. Receiving ambiguous information for the forwarding towards the intranet is not a problem. Let's see an example. Assuming four RIOT nodes are incorporated into a 6LoWPAN network. The root node
Now fibroutes of each nodes have the following state. Note that The upstream route and the downstream route between |
|
||
#if defined(MODULE_GNRC_RPL) && defined(MODULE_GNRC_SIXLOWPAN_ND_BORDER_ROUTER) | ||
if (!(if_entry->flags & GNRC_IPV6_NETIF_FLAGS_SIXLOWPAN)) { | ||
ipv6_addr_t default_route_prefix; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can initialize this statically by using ipv6_addr_t default_route_prefix = IPV6_ADDR_UNSPECIFIED;
and ignore the memset
below
@Yonezawa-T2 now I see you're totally right, I must admit I didn't look too closely into your code and focused on your images/descriptions. I still can imagine of difficult situations when nodes move in the DODAG or messages get lost. Please don't get me wrong I like your proposition :) |
I am still unsure whether it is a good idea to set up routes in the fib as Besides of my concerns above, I like the changes to RPL that you presented |
@BytesGalore Yes, it does form a loop, but it is a general problem of RPL, not related to intranets. Suppose a pure (no internet nor intranet connected) 6LoWPAN network. Now the node Suppose RPL defines loop avoidance mechanisms for such case but RIOT does not support it yet. |
@cgundogan I will split the commit and make a PR. Manually configureing fibroute of the leaf is acceptable. |
@cgundogan could you give an example how the attack vectors would manifesting? |
@BytesGalore In the scenario above: A malicious node would be able to announce faulty "routes" via the RA message. AFAIK, there is no such thing as seting up routes when receiving RAs |
@cgundogan I see, and we would just accept them.
I also never stumbled upon such behaviour. |
Well, RFC4861 tells you to configure the sender of an RA as default router. Since the actual datastructures (FIB and neighbor cache for RIOT) are implementation specific, you could interpret this statement this way. |
Sounds convicing. Currently, RPL just puts all FIB entries into DAOs. Should we also consult the default routers list and put that information into DAOs? |
Feature freeze -> postponed. |
What is the status of this PR? |
I would say postpone. If activity is happening here in the next few hours I might be convinced to reverse the postponement ;-) |
@cgundogan, @BytesGalore, what is your opinion on this PR? |
bump |
@miri64 you kind of expert here, is this still the way to go or obsolete with changes/advances on NIB and so on? |
This PR is based on the old neighbor discovery implementation and FIB (which still can be used, when a back-end for the NIB is implemented). While the concept seems sound it still requires adaption, so I would say we close this for now as memo. |
Summary
This patch adds FIB entries when a 6LoWPAN border router received Router Advertisements from external network.
What I want to do
Suppose a 6LoWPAN network with RPL routing. The root is connected to the internet and a leaf node is connected a intranet. I want exchange packets between the intranet and the internet via the 6LoWPAN network.
I don't want to do manual network settings as much as possible. It should be configured by IPv6 Router Advertisement and/or RPL.
What we need
The FIB of the root node should forward all packets addressed to the intranet or 6LoWPAN nodes to the 6LoWPAN network, and all other packets to the upstream router given by Router Advertisements.
The FIB of the leaf node should forward all packets addressed to the intranet to the intranet router given by Router Advertisements, and all other packets to the RPL parent.
The current FIB implementation only stores internal entries for 6LoWPAN (and manually configured external nodes, but not prefixes).
How to achieve this
When the RPL root received a Router Advertisement from non-6LoWPAN network, register it as a upstream gateway.
When the RPL leaf received a Router Advertisement with Prefix Information from non-6LoWPAN network, register the prefix as a external network. Propagate it with RPL DAO message up to the root.
Changes on
gnrc_ndp.c
register routers to FIB. Changes ongnrc_rpl_control_messages.c
propagate them up to the root node.This patch guess prefix lengths of FIB entries with
universal_address_compare
. It should be updated when #4279 is merged.Usage
Tested on two OS X machines and three XBees using
examples/gnrc_xbee_border_router
(#4448). Use https://github.com/Yonezawa-T2/RIOT/tree/xbee_border_router branch, which contains several fixes of other Pull Requests, for testing.RIOT 1 (examples/gnrc_xbee_border_router on OS X 1):
OS X 1:
RIOT 2 (examples/gnrc_xbee_router, not a border router, on OS X 1):
RIOT 3 (examples/gnrc_xbee_border_router on OS X 2):
OS X 2:
Change
XBEE_DENIED_ADDRESSES
in Makefile to prohibit direct communication between RIOT 1 and RIOT 3.