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

MinMDNS client requires recursion and support for multi-answer in a single packet #18256

Closed
andy31415 opened this issue May 10, 2022 · 1 comment
Assignees
Labels

Comments

@andy31415
Copy link
Contributor

Problem

MinMDNS makes some assuptions to be 'minimal' however these assuptions break especially on thread. Specifically:

  • It assumes that a single packet contains a single answer for a specific node. This is incorrect for "Browse" for example, where a OpenThread Border Router may answer on behalf of multiple thread devices in a single packet, resulting in separate SRV/AAAA/TXT entries in a single packet. MinMDNS will currently "Pick last entry" and assume they match, but they do not have to

  • It assumes that a reply containing a SRV entry would contain also TXT and A/AAAA entries. mDNS spec says that implementations SHOULD do this, but not SHALL and specifically for OTBR we observed that we may get SRV entries without IP addresses and then Operational Discovery will fail.

  • MinMDNS enters a 'mode' state where it either browses or does operational discovery. Since replies are async, this is incorrect in terms of calling operational vs commissioning discovery callbacks.

Proposed Solution

Implement stateful processing of mDNS replies:

  • every SRV entry should be considered individually and matched with TXT and AAAA (maybe A) entries
  • if TXT/AAAA entries are not received, the server should explicitly query for them. Note that AAAA entries are matched by a separate host address (i.e. request has to be based off SRV content)

MDNS packet processing should not depend on a stateful logic of 'sending queries'. Sending queries should be independent from receiving results.

@andy31415
Copy link
Contributor Author

Recursive minmdns support added. Closing issue.

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

No branches or pull requests

1 participant