Skip to content

resolved: make maximum transaction attempts 1 for non-probe MDNS requests - #22753

Merged
yuwata merged 1 commit into
systemd:mainfrom
vchillara:resolved-mdns-transaction-max-attempts
Jun 22, 2022
Merged

yuwata merged 1 commit into
systemd:mainfrom
vchillara:resolved-mdns-transaction-max-attempts

Conversation

@vchillara

Copy link
Copy Markdown
Contributor

Maximum attempts to send MDNS requests is one except for probe requests. See RFC 6762 Section 8.1
However, TRANSACTION_ATTEMPTS_MAX macro does not account for probe requests.

Comment thread src/resolve/resolved-dns-transaction.h Outdated
Comment on lines +217 to +223
/* Maximum attempts to send MDNS requests is one except for probe requests, see RFC 6762 Section 8.1 */
#define MDNS_TRANSACTION_ATTEMPTS_MAX 1

#define MDNS_PROBE_TRANSACTION_ATTEMPTS_MAX 3

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

RFC 6762 Section 8.1 says about probe requests. Where can I find that other requests should be tried only once?
Could you update comment more, e.g. quoting a relevant sentence in the RFC?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The RFC doesn't explicitly state that a non-probe mDNS query should only be attempted once.
However, since RFC 6762 differentiates between normal (single-shot/continuous) and probe requests, it probably makes sense to fire each normal query only once with no retries.
Otherwise we'd be sending out three attempts for a normal query as well.
The exception of course being probing, which should be attempted a max of 3 times as described in section 8.1.
This also messes with the timing of continuous querying in #22532.
Avahi's implementation is also in line with this.

@vchillara vchillara Jun 16, 2022 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This blurb in section 8.1 of RFC6762 also points out the difference in timing restrictions for probe and regular queries.

Note that probing is the one exception from the normal rule that there should be at least one
second between repetitions of the same question, and the interval between subsequent repetitions
should at least double.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I see. That part indeed implies the regular queries should be tried once. Could you update the comment in the code with quoting the above sentences?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated the comment in the code.

Maximum attempts to send mDNS requests is one except for probe requests, which should be attempted thrice.
Implemented fix to account for the difference between regular queries and probe requests, and prevent
even regular queries from being attempted thrice.
See RFC 6762 Section 8.1
@vchillara
vchillara force-pushed the resolved-mdns-transaction-max-attempts branch from 7641fb8 to b01f76c Compare June 20, 2022 06:59
@yuwata
yuwata merged commit 127b26f into systemd:main Jun 22, 2022
@evverx

evverx commented Jul 4, 2022

Copy link
Copy Markdown
Contributor

Just a heads-up, looks this PR will be reverted in #23875.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants