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

Host bits on prefix/route options are non-zero, can cause confusion. #67

Open
robbat2 opened this issue Nov 23, 2016 · 9 comments
Open

Comments

@robbat2
Copy link
Member

robbat2 commented Nov 23, 2016

If a route or prefix option in the configuration has more bits specified than the address length mask, Radvd should:

  • warn or error.
  • forcing the non-network bits to zero.
  • collapse now duplicate prefix/routes.

Specifications:

https://tools.ietf.org/html/rfc4861#section-4.6.2 page 30:

      Prefix         An IP address or a prefix of an IP address.  The
                     Prefix Length field contains the number of valid
                     leading bits in the prefix.  The bits in the prefix
                     after the prefix length are reserved and MUST be
                     initialized to zero by the sender and ignored by
                     the receiver.  

Emphasis: The bits in the prefix after the prefix length are reserved and MUST be initialized to zero by the sender.

https://tools.ietf.org/html/rfc4191#section-2.3 page 5:

   Routers MUST NOT include two Route Information Options with the same
   Prefix and Prefix Length in the same Router Advertisement.

Splitting options in this case between two immediately sequential Router Advertisements should be considered as a case of a single long RA (of a link with infinite MTU).

Sample configuration input:

    prefix fd3c:b2e8:93df:1:2::/64 { };
    prefix fd3c:b2e8:93df:1:3::/64 { };
    route fd3c:b2e8:93df:cafe:f0fe::/64 { };
    route fd3c:b2e8:93df:cafe:f0ff::/64 { };

actual tcpdump:

prefix info option (3), length 32 (4): fd3c:b2e8:93df:1:2::/64, Flags [onlink, auto], valid time 86400s, pref. time 14400s
prefix info option (3), length 32 (4): fd3c:b2e8:93df:1:3::/64, Flags [onlink, auto], valid time 86400s, pref. time 14400s
route info option (24), length 24 (3):  fd3c:b2e8:93df:cafe:f0fe::/64, pref=medium, lifetime=5400s
route info option (24), length 24 (3):  fd3c:b2e8:93df:cafe:f0ff::/64, pref=medium, lifetime=5400s

expected tcpdump:

prefix info option (3), length 32 (4): fd3c:b2e8:93df:1::/64, Flags [onlink, auto], valid time 86400s, pref. time 14400s
route info option (24), length 24 (3):  fd3c:b2e8:93df:cafe::/64, pref=medium, lifetime=5400s

Problems to discuss:

  • What happens when the route/prefixes in the configuration have DIFFERENT parameters? How should Radvd handle it?
@robbat2
Copy link
Member Author

robbat2 commented Oct 30, 2017

A further case that needs special handling:

    prefix ::/64 { AdvValidLifetime 3600; };
    prefix fd3c:b2e8:93df:1:2::/64 { AdvValidLifetime 86400; };

vs.

    prefix fd3c:b2e8:93df:1:2::/64 { AdvValidLifetime 86400; };
    prefix ::/64 { AdvValidLifetime 3600; };

How should prefix fd3c:b2e8:93df:1:2::/64 be handled? On Linux hosts, this is treated as two seperate RAs, and the lifetime is seen flapping.

This is even more problematic when you want use prefix ::/64, but suppress a single prefix from it.

@reubenhwk
Copy link
Collaborator

reubenhwk commented Oct 31, 2017 via email

@robbat2
Copy link
Member Author

robbat2 commented Oct 31, 2017

I ask about the combination case because I recently encountered it inside Ubiquiti EdgeRouters when using DHCPv6-PD. It runs radvd with a prefix ::/64, and then the PD daemon rotates the addresses on the interface as pushed by the ISP. If you want to also run your own ULA address, with different parameter, you get the the duplicate prefix in the RA along with the flap. Or worse, if you wanted to have AdvAutonomous off on the ULA prefix, you're stuck, because the unspecified prefix causes it to be sent :-(.

@reubenhwk
Copy link
Collaborator

reubenhwk commented Oct 31, 2017 via email

@reubenhwk
Copy link
Collaborator

reubenhwk commented Oct 31, 2017 via email

@robbat2
Copy link
Member Author

robbat2 commented Oct 31, 2017

I think we can give ourselves easy flexibility: Introduce a priority param for prefixes.

  • Highest value wins.
  • Defaults to some middle number: Auto could have a lower default than static.
  • Settings taken for each unique prefix with highest priority.

@robbat2
Copy link
Member Author

robbat2 commented Oct 31, 2017

HostBits: Thinking about your concern in breaking existing configs, adding a new toplevel (command-line arg?) or interface option, for strict RFC, so it masks the hostbits?

@reubenhwk
Copy link
Collaborator

reubenhwk commented Oct 31, 2017 via email

@Neustradamus
Copy link
Member

Any news?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants