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

fix delays when sending initial probe packets #14

Merged
merged 1 commit into from
Sep 20, 2021

Conversation

marten-seemann
Copy link

From https://datatracker.ietf.org/doc/html/rfc6762#section-8.1:

When ready to send its Multicast DNS probe packet(s) the host should
first wait for a short random delay time, uniformly distributed in
the range 0-250 ms. This random delay is to guard against the case
where several devices are powered on simultaneously, or several
devices are connected to an Ethernet hub, which is then powered on,
or some other external event happens that might cause a group of
hosts to all send synchronized probes.

250 ms after the first query, the host should send a second; then,
250 ms after that, a third. If, by 250 ms after the third probe, no
conflicting Multicast DNS responses have been received, the host may
move to the next step, announcing.

Note that we don't properly distinguish between probing and announcing, and we don't do any conflict detection at all. This PR should still at least bring us closer to what the spec is saying, and hopefully help us resolve libp2p/go-libp2p#1167.

@marten-seemann
Copy link
Author

marten-seemann commented Sep 20, 2021

Taking the approval for #16 as an approval for this PR as well.

@marten-seemann marten-seemann merged commit 41c0a97 into master Sep 20, 2021
@marten-seemann marten-seemann deleted the fix-initial-probing branch September 20, 2021 13:10
@aschmahmann aschmahmann mentioned this pull request Dec 1, 2021
80 tasks
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.

flaky mDNS test: TestOtherDiscovery
1 participant