microsoft / microsoft/demikernel
[inetstack] `INADDR_ANY` Should Be Supported As The Wildcard Address
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.2k
- Forks
- 151
- PR merge metrics
- No merged PRs in 30d
Description
Description
The standard socket API normally accepts INADDR_ANY (the all-zeroes address) as the wildcard (or "unspecified") address, meaning it matches all addresses. We don't appear to currently support this.
Expected Behavior
When a socket is bound to INADDR_ANY and some port X, it should receive all packets that arrive at the host for port X, regardless of which of the host's IP addresses it was addressed to.
Note the above statement is assuming that the arriving packets are addressed to an IP address assigned to the same interface upon which the packets are arriving (if the host is implementing the "strong host" model), or any one of the host's IP addresses (if the host is implementing the "weak host" model). The strong/weak host model distinction is currently immaterial for our implementation, as we only support a single interface (with only a single address!) at the moment.
Note also that while INADDR_ANY is typically used with the bind API, the concept of an unspecified address for either the local or remote address on a socket is used in multiple places. The matching of incoming packets to a receiving socket (which may have an unspecified local address as described above) is one such place. Another is when performing an active open (i.e., "connect") on an unbound (i.e., has an unspecified local address) socket to a given remote address, the stack must assign a local address to use for connecting to the remote address in question.
Related Issues
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
Start in the inetstack implementation areas handling bind, connect, and matching incoming packets to receiving sockets. Review the related issues 165 and demikernel issue 184 for context. Done means sockets bound to INADDR_ANY receive packets for the port, and unspecified local addresses are handled consistently for active opens and packet matching.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- networking
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100