-
Notifications
You must be signed in to change notification settings - Fork 25
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
bind-multiple is hard to imlement on smoltcp #104
Comments
tl;dr: Does smoltcp-rs/smoltcp#904 fix this for you? To start this off with some background on where this is coming from: Both QUIC and CoAP, when run as servers, need to know where the incoming packet was sent to, and reply from that very address. It is a frequent source of CoAP interoperability troubles if servers just send from any address (worst because it works most of the time, but when the device gets an extra IP address, suddenly it stops working). Also, this is highly important for distinguishing unicast from multicast messages. This doesn't really come from BSD sockets -- on the contrary, it is hard to do on BSD sockets because they need to go through recvmsg, set the PKTINFO socket option and hope to get the platform specific format of the ancillary data item right when using IP versions smaller than 6. In contrast, the embedded-nal sockets are more oriented toward basic BSD sockets (without recvmsg), and thus are missing crucial functionality for implementing UDP based protocols that are more complex than an Echo server. On the long run, I think that the sync NAL should migrate to the async NAL's concepts, especially if and when we've ironed out any warts such as this (which I hope is resolved with the PR) or #103. On the smoltcp side, there is a PR that just fixes this: smoltcp-rs/smoltcp#904. Could you have a look at it to see whether it resolves the problem? An example of how it is used (to implement the bind_multiple_server, even, although through embassy-nal) is available at embassy-rs/embassy#2519 |
Yep, seems to address precisely the issue at hand. Sorry for not looking into what is open w.r.t. PRs in
Interesting that you mentioned multicast. Did you really mean multicast or broadcast? Because while I can imagine that (a) having access to the 'local' (= destination) IP address in
Agreed.
Let me look into this deeper, but as per above - seems to be spot on. |
I am talking of multicast -- broadcast only really exists on IPv4 and I barely touch that any more. IPv4 is hard there, because the application needs extra information (from the network stack) to determine whether an address is a broadcast address or not. With IPv6, cases are clear. Setting up the multicast groups is out of scope for embedded-nal, at least with the current interfaces, but a library could be documented as
I'm curious about the traits you are proposing; they are a welcome addition as they allow the application to do things more automatically, but they are not essential. (Also they seem like the right pool into which I should merge my embedded-nal-tcpextensions :-) ). |
Perhaps I can agree for
If - you know - our answer for these use cases is - "you need to do it outside the I guess what I'm saying is that - at least for me - the perceived value of |
I've split this out of #103 as reported by @ivmarkov to keep threads disentangled:
The text was updated successfully, but these errors were encountered: