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

mDNS: LabelIsNotAscii #2676

Closed
thearossman opened this issue May 28, 2022 · 5 comments
Closed

mDNS: LabelIsNotAscii #2676

thearossman opened this issue May 28, 2022 · 5 comments

Comments

@thearossman
Copy link

thearossman commented May 28, 2022

Summary

mDNS discovery sometimes fails with "parsing MDNS packet failed" message; may be an old mdns_parser issue in general?

Expected behaviour

I'd assume that all mDNS packets sent/received should be correctly parsed? And that I shouldn't see this error message?

Actual behaviour

mDNS sometimes works, and sometimes prints the debug message: DEBUG libp2p_mdns::behaviour::iface::query] Parsing mdns packet failed: LabelIsNotAscii.

After a threshold of errors, mDNS seems to begin behaving inconsistently -- e.g., expiring peers and erroneously disconnecting. (So, for example, if I'm using mDNS to do peer discovery for a GossipSub network, the network will eventually fail w/ insufficient peers or uptime will suffer.)

This first showed up on a separate project, but I was able to observe the same behavior running the chat-tokio example, which uses mDNS. I've reproduced this on multiple libp2p versions, including the most recent (0.44.0) and older (e.g., 0.39.1).

[2022-05-28T01:49:34Z DEBUG libp2p_mdns::behaviour::iface::query] Parsing mdns packet failed: LabelIsNotAscii
[2022-05-28T01:49:35Z DEBUG libp2p_mdns::behaviour::iface::query] Parsing mdns packet failed: LabelIsNotAscii
[2022-05-28T01:49:36Z DEBUG libp2p_mdns::behaviour::iface::query] Parsing mdns packet failed: LabelIsNotAscii

Possible Solution

This is an error from dns_parser here. Seems like others have encountered it before.

I've been working around with a high TTL and query interval.

Version

0.44.0, 0.39.1 (I've been able to reproduce this on multiple versions)

@mxinden
Copy link
Member

mxinden commented May 29, 2022

Do these mdns packets come from libp2p hosts? If no, this should not affect libp2p-mdns.

@thearossman
Copy link
Author

thearossman commented May 29, 2022

I believe they come from libp2p hosts -- we're not using anything else, and we were able to get the same error just by running the chat-tokio example with nothing else (https://github.com/libp2p/rust-libp2p/blob/master/examples/chat-tokio.rs).

@mxinden
Copy link
Member

mxinden commented May 31, 2022

@thearossman can you use wireshark to post a dump of the original packet here?

@mxinden
Copy link
Member

mxinden commented Oct 5, 2022

Friendly ping @thearossman.

@thearossman
Copy link
Author

thearossman commented Oct 16, 2022

Thanks so much for the ping; apologies for dropping this.

This is from running the chat-tokio example with two hosts, running for about 30 seconds. You can see the MDNS error message; in this case, the hosts didn't disconnect from each other.

Partial log from one of the hosts (you can see the mdns error message): debuglog-libp2p-mdns.txt

Here's a pcap -- can't upload to Github; so it's on Google Drive here

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

No branches or pull requests

3 participants