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/ipv6: nib route: hide off-link PLEs #20835

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

xnumad
Copy link
Contributor

@xnumad xnumad commented Aug 26, 2024

Contribution description

An off-link prefix with SLAAC (i.e. RA PIO: L flag = 0, A flag = 1):

  • is listed in nib prefix. Listing it here only means it’s a "managed" prefix (for SLAAC lifetimes), no indication about whether it’s on-link.
  • nib route
    ❌ Currently falsely displays it as on-link (e.g. 2001:db8::/32 dev #6)
    Should not list it, to reflect the actually used routing logic [1]
    /* give default route precedence over off-link PLEs */

This PR removes it from the nib route output.

[1] which is correct ("forward the packet to a default router" - https://datatracker.ietf.org/doc/html/rfc4861#section-6.3.4)

Testing procedure

Expand

sudo dist/tools/tapsetup/tapsetup

In any directory:
Set file content of radvd-offl.conf to:

interface tapbr0 {
    AdvSendAdvert on;
    prefix 2001:db8::/32 {
        AdvOnLink off;
    };
};

Run
sudo radvd --nodaemon --config=radvd-offl.conf

cd examples/gnrc_networking/
make && make term

In RIOT terminal: command nib route
In command output, observe unexpected line 2001:db8::/32 dev #6.

Issues/PRs references

#20757 revealed this bug by adding a feature

@github-actions github-actions bot added Area: network Area: Networking Area: sys Area: System labels Aug 26, 2024
@benpicco benpicco added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Aug 26, 2024
@riot-ci
Copy link

riot-ci commented Aug 26, 2024

Murdock results

✔️ PASSED

92b77ed gnrc_ipv6_nib: refactor

Success Failures Total Runtime
10196 0 10197 17m:40s

Artifacts

@miri64
Copy link
Member

miri64 commented Aug 26, 2024

I'm confused. RFC 4861 does not say anything about the concept of a forwarding table (which nib route effectively displays). Can you please quote the part of 6.3.4 where the listing of on-link prefixes is explicitly forbidden in forwarding tables? The example you gave, also happens e.g. with iproute2 in Linux:

$ ip -6 route
[...]
fd01:d470:435e:2000::9 dev eth0 proto kernel metric 100 pref medium
fd01:d470:435e:2000::/64 dev eth0 proto ra metric 100 pref medium
[...]

@xnumad
Copy link
Contributor Author

xnumad commented Aug 26, 2024

Sorry for the confusion, I meant off-link PLEs (changed the PR title and commit title, can't rename the branch without closing the PR, everything else like PR description is correct)!

Here's the full sentence I quoted in part:

The default behavior (see Section 5.2) when sending a packet to an address for which no information is known about the on-link status of the address is to forward the packet to a default router

I.e. if PIO L-flag was never set in any PIO for the prefix, and therefore _PFX_ON_LINK was never set, then - as I understand - the prefix should be effectively ignored for routing, and the default route shall be simply used.
Therefore, it should not be displayed in nib route; esp. not as on-link (like now), ideally not at all.

@xnumad xnumad changed the title gnrc/ipv6: nib route: hide on-link prefixes gnrc/ipv6: nib route: hide off-link PLEs Aug 26, 2024
@xnumad xnumad force-pushed the nib-route-hide-on-link-prefixes branch from d6f177c to 48a2417 Compare August 26, 2024 14:31
@miri64
Copy link
Member

miri64 commented Aug 26, 2024

Here's the full sentence I quoted in part:

The default behavior (see Section 5.2) when sending a packet to an address for which no information is known about the on-link status of the address is to forward the packet to a default router

This is about sending behavior, not what to show or not to show in a forwarding table. Since with 6LoWPAN, the mesh prefix is always off-link, I am not sure it is a good idea to not list those in the forwarding table (granted RPL would add the downstream addresses that use that prefix anyway, but it would feel weird if the RPL DODAG ID would not show up there).

@xnumad
Copy link
Contributor Author

xnumad commented Aug 26, 2024

For a 6LN, the A-flag is still usually set and therefore the prefix is listed in nib prefix.
In RIOT, it has only unintentionally begun to be displayed in nib route since #20757.

I think it's wrong that nib route displays it as on-link in when it is nowhere treated as on-link. It just doesn't have a next hop address specified.

For comparison, ip -6 route in Linux (iproute2) does not list such prefixes. (see also L-flag handling)

@miri64
Copy link
Member

miri64 commented Aug 27, 2024

For a 6LN, the A-flag is still usually set and therefore the prefix is listed in nib prefix.
In RIOT, it has only unintentionally begun to be displayed in nib route since #20757.

Ah ok, if this is something that only showed up recently, then nevermind.

Co-Authored-By: benpicco <benpicco@googlemail.com>
@xnumad xnumad force-pushed the nib-route-hide-on-link-prefixes branch from 6dbaed6 to 92b77ed Compare September 18, 2024 14:10
@xnumad
Copy link
Contributor Author

xnumad commented Sep 18, 2024

Amended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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 Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants