WebAssembly / WebAssembly/WASI
UDP: Local address should be regularly available
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 5.8k
- Forks
- 333
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 3
Description
Many UDP based protocols (eg. CoAP and QUIC) require the application to have control over the local address -- running a server at :: (or 0.0.0.0) means that a datagram comes in, and the server needs to take extra steps to reply with the same address (otherwise it violates the protocol, and the peer won't process the response).
While this is supported in POSIX sockets, it means that rather than doing the simple thing, implementers need to set the IPV6_RECVPKTINFO option, do recvmsg instead of recvfrom and pick the address out of there (which only in IPv6 is well specified).
WASI has the opportunity to make this straightforward, please use it. An example API that provides both addresses is the Rust embedded-nal abstraction for UDP (and the PR introducing it contains ample references and discussion on why this is necessary and good, which I'm happy to reiterate here in case this request is contentious).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the WASI UDP/socket API alongside the linked Rust embedded-nal async UnconnectedUdp abstraction. Compare the current address information available through recvfrom with the local and peer addresses required for wildcard-bound UDP servers. Done should be a settled API design that supports replying from the received local address.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, networking
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100