gnrc_rpl: port to nib#8010
Conversation
miri64
left a comment
There was a problem hiding this comment.
If you don't change the API you don't have to adapt the tests ;-).
sys/include/net/gnrc/ipv6/nib/ft.h
Outdated
| */ | ||
| int gnrc_ipv6_nib_ft_add(const ipv6_addr_t *dst, unsigned dst_len, | ||
| const ipv6_addr_t *next_hop, unsigned iface); | ||
| const ipv6_addr_t *next_hop, uint16_t ltime, |
There was a problem hiding this comment.
This was kept out of the intentionally. The routing protocol should timeout the routes externally (e.g. by storing the context for the timer in the protocol's routing table)
There was a problem hiding this comment.
This is weird. Every FIB entry should have a lifetime. RPL is not aware of link failures way down the tree as it does not maintain a children list, only a parent list. So RPL does not know when to prune an entry in that case. FIB maintenance should be in the FIB, not in a routing protocol.
There was a problem hiding this comment.
This isn't about FIB maintenance, but about route maintenance IMHO. The lifetime of the route (and its scale) is intrinsic to the routing protocol (if you want a proof for that, see various discussions in our GitHub issue history about which unit should be used with route lifetimes).
There was a problem hiding this comment.
Iff [edit]and I'm not saying we should[/edit] we do it like this I have some questions: Why is the route lifetime in seconds (isn't milliseconds a more usual unit for that)? Why did you choose uint16_t as the type for that?
There was a problem hiding this comment.
Why is the route lifetime in seconds (isn't milliseconds a more usual unit for that)? Why did you choose uint16_t as the type for that?
We had the discussion for gnrc_fib that milliseconds granularity is overkill and the port to deciseconds was never done.. I guess having a second granularity is okay for our constrained IoT scenario and routing protocols usually are not that fast in noticing routing state changes.
There was a problem hiding this comment.
Oh, and I chose uint16_t because that's what the default router struct is also using.
| } | ||
| } | ||
| /* add external and RPL FT entries */ | ||
| /* TODO: nib: dropped support for external transit options for now */ |
There was a problem hiding this comment.
In case we don't get this in before your vacation and someone else needs to take over: can you please answer my question?
There was a problem hiding this comment.
RPL is able to distribute routing states that were not learned/produced by RPL, but from an external source – like another routing protocol or a manually admnistered route entry. These routing states should be marked with the E flag in DAO transit optoins [1].
External (E): 1-bit flag. The 'E' flag is set to indicate that the
parent router redistributes external targets into the RPL
network. An external Target is a Target that has been learned
through an alternate protocol. The external targets are listed
in the Target options that immediately precede the Transit
Information option. An external Target is not expected to
support RPL messages and options.
In the "old" fib implementation user defined flags could be stored along the forwarding entry. We used that to mark a forwarding entry as "learned by RPL" and used this information to decide whether to set or not set the E flag in DAOs.
This feature is missing in the current nib_ft implementation that's why I put a note about dropped support there.
There was a problem hiding this comment.
Okay. I guess we'll need to extend the NIB for something like this later on ;-).
miri64
left a comment
There was a problem hiding this comment.
Where do you start the timer btw?
| ptr = _nib_ft_add(next_hop, iface, dst, dst_len); | ||
| _nib_offl_entry_t *offl = _nib_ft_add(next_hop, iface, dst, dst_len); | ||
| if (offl) { | ||
| offl->valid_until = offl->pref_until = ltime * MS_PER_SEC; |
There was a problem hiding this comment.
Iff we add this feature we need to add a new field to _nib_offl_entry_t. You are risking here to override prefix lifetimes and thus causing potential side effects.
| fib_remove_entry(&gnrc_ipv6_fib_table, | ||
| (uint8_t *) ipv6_addr_unspecified.u8, | ||
| sizeof(ipv6_addr_t)); | ||
| gnrc_ipv6_nib_ft_del(&ipv6_addr_unspecified, 0); |
There was a problem hiding this comment.
Note to self: this might cause problems with address registration => investigate.
|
Ideally there shouldn't be any comment here. But just in case: this is a warning for that ;-). |
|
Worked :-) |
| /* TODO: nib: dropped support for external transit options for now */ | ||
| void *ft_state = NULL; | ||
| gnrc_ipv6_nib_ft_t fte; | ||
| while(gnrc_ipv6_nib_ft_iter(NULL, dodag->iface, &state, &fte)) { |
2bd88b0 to
81b70b8
Compare
|
rebased onto #8083 |
d3a1a4c to
63a4bfc
Compare
miri64
left a comment
There was a problem hiding this comment.
(Untested) ACK. Please squash. If any errors except the ones related to the NIB you already reported offline, I'll fix them in a follow-up.
| netopt2str(opt->opt)); | ||
| #else | ||
| DEBUG("gnrc_netif: GNRC_NETAPI_MSG_TYPE_SET received. opt=%s\n", | ||
| DEBUG("gnrc_netif: GNRC_NETAPI_MSG_TYPE_SET received. opt=%d\n", |
There was a problem hiding this comment.
Unrelated, but okay, as long as it stays its own commit.
| GNRC_IPV6_NIB_NC_INFO_NUD_STATE_UNREACHABLE); | ||
| } | ||
| /* falls through intentionally */ | ||
| /* intentionally falls through */ |
There was a problem hiding this comment.
Dito (also has GCC become so picky??!!? oO)
There was a problem hiding this comment.
Don't know if we have a stricter fall through level now, but assuming we have level 3[1],
then the previous string doesn't match the given regex. However, my compiler was able to compile it sometimes, and other times it didn't want to .. with the provided change it worked every time so far.
|
|
||
| gnrc_ipv6_nib_ft_add(&(target->target), target->prefix_length, src, | ||
| dodag->iface, | ||
| dodag->default_lifetime * dodag->lifetime_unit); |
There was a problem hiding this comment.
Not part of this PR, but is it really necessary to store the lifetime_unit of a DODAG Oo?
There was a problem hiding this comment.
The lifetime and the lifetimeunit are both distributed in DIOs. Need to store that to further distribute it (:
| } | ||
| } | ||
| /* add external and RPL FT entries */ | ||
| /* TODO: nib: dropped support for external transit options for now */ |
There was a problem hiding this comment.
Okay. I guess we'll need to extend the NIB for something like this later on ;-).
| @@ -346,11 +346,9 @@ void gnrc_rpl_p2p_recv_DRO(gnrc_pktsnip_t *pkt, ipv6_addr_t *src) | |||
| } | |||
|
|
|||
| if (gnrc_ipv6_netif_find_by_addr(&me, &addr) == dodag->iface) { | |||
There was a problem hiding this comment.
Are you sure, this is the right function as well?
470ba35 to
3565c04
Compare
3565c04 to
de5e0c6
Compare
|
Go! |
|
woohoo |
replaces fib with nib/ft
WIP for now. There are still some modifications missing in the tests for
gnrc_ipv6_nib_ft_adde.g.Also, I have to re-evaluate the netif2 changes ..
Will continue tomorrow with that.
This PR is part of the network layer remodelling effort:

depends on #8083