-
Notifications
You must be signed in to change notification settings - Fork 457
Adding SLAAC support #948
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
Adding SLAAC support #948
Conversation
Leaving the IP generation to the user is a bit odd, but then again, better to have this in first and then add a way for the user to pick an automatism for it. DNS through SLAAC just works (and has been standardized since 2010, but people kept repeating the talking point): The same Router Advertisement that gives you the prefix information and the routes will also give you (in option 25) the IP address of a recursive DNS server. |
Does this really get simpler by using a new socket type? There is already the ICMP socket, and that can be bound to the relevant ICMP identifiers for Router Advertisement and Neighbor Advertisement, and send Router / Neighbor Solicitation. |
Anyways DNS parsing has to be added to smoltcp |
smoltcp/examples/dhcp_client.rs Lines 60 to 77 in 1ff5bc4
smoltcp/src/iface/interface/mod.rs Line 132 in 99ddd22
|
ad 1., I think that many developers will eventually expect a choice akin to what NetworkManager gives you ("use MAC address based", "generate both and primarily use {which of them}"). I don't know enough about the scope of smoltcp yet to know whether that's a choice that smoltcp should offer, or embassy_net (although I'd hope that the crate that offers the options would take a smoltcp network stack, plus maybe an impl RngCore and impl embedded_hal_async::timer something, so it could be used outside embassy_net as well). If DHCPv4 is implemented this way, it probably makes sense here as well; DHCPv4 also needs to have at least access to a timer, so whatever is done there sounds like a good template. ad 2.1: You may not need a random number generator, just a stable per-device secret. RFC7217 is state of the art there. ad 2.2: MAC addresses may just have 6 bytes, but there is an 8-byte form called the EUI-64 where they are embedded, and there are precise rules on how those wind up in the interface identifier (low 8 bytes) of an IPv6 address in section 2.5.1 of RFC4291. These are what gives you the typical "fe80::xXxx:xxff:fexx:xxxx" IPv6 addresses you may have seen. (Note how if you look at the output of But having SLAAC implemented with a "proposing IPv6 addresses for DAD is up to the user" interface sounds totally sufficient to me as a first iteration, as long as the SLAAC can ask that user provided function for another address (eg. providing a DAD_Counter). Note that I'm not really an expert on any of this, and have barely contributed to smoltcp at all, so take all I'm writing here with a grains of salt, minimum. |
Could you please take a look if I am going the right way before I implement the whole thing :D
These are my ideas:
My questions:
ref #570