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

Implemented unicast responses to direct unicast, unicast questions and legacy unicast queries. #190

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

pixsperdavid
Copy link
Contributor

Draft for now as I now need to construct some tests for this to verify it functions as expected.

One missing area for now is the following from RFC 6762:

When receiving a question with the unicast-response bit set, a
responder SHOULD usually respond with a unicast packet directed back
to the querier. However, if the responder has not multicast that
record recently (within one quarter of its TTL), then the responder
SHOULD instead multicast the response so as to keep all the peer
caches up to date, and to permit passive conflict detection. In the
case of answering a probe question (Section 8.1) with the unicast-
response bit set, the responder should always generate the requested
unicast response, but it may also send a multicast announcement if
the time since the last multicast announcement of that record is more
than a quarter of its TTL.

Implementing the above will require storing the time in which each service record was last multicasted on each specific interface so is therefore quite complex. For now I have simply used the logic that if all the questions in a given query request a unicast response, a unicast response is sent.

@pixsperdavid pixsperdavid marked this pull request as draft April 3, 2024 15:24
Copy link
Owner

@keepsimple1 keepsimple1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR! While you're working on adding the tests, here are a few comments inline.

src/service_daemon.rs Show resolved Hide resolved
src/service_daemon.rs Show resolved Hide resolved
src/service_daemon.rs Outdated Show resolved Hide resolved
src/dns_parser.rs Outdated Show resolved Hide resolved
src/service_daemon.rs Outdated Show resolved Hide resolved
src/service_daemon.rs Outdated Show resolved Hide resolved
src/service_daemon.rs Show resolved Hide resolved
@keepsimple1
Copy link
Owner

keepsimple1 commented Apr 3, 2024

Implementing the above will require storing the time in which each service record was last multicasted on each specific interface so is therefore quite complex. For now I have simply used the logic that if all the questions in a given query request a unicast response, a unicast response is sent.

Sounds good to me, to implement this part later / separately.

Copy link
Owner

@keepsimple1 keepsimple1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making the changes. Looks good!

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

Successfully merging this pull request may close these issues.

2 participants