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: the spec to explicitly allow for configurability of the service name #620

Open
dhuseby opened this issue Jul 2, 2024 · 3 comments

Comments

@dhuseby
Copy link

dhuseby commented Jul 2, 2024

          https://github.com/libp2p/specs/blob/master/discovery/mdns.md#definitions

If a private network is in use, then the service-name contains the base-16 encoding of the network's fingerprint as in _p2p-X._udp.local. This prevents public and private networks from discovering each other's peers.

The spec mentions that when using a private network, you can contains the network's fingerprint in the service name to prevent the private network and the public network from discovering each other.

In the Go implementation, I use a service name like this: _p2p-dced2aa3b9ea8def145b7f80271517b6._udp

Originally posted by @fei-ke in libp2p/rust-libp2p#2898 (comment)

@dhuseby
Copy link
Author

dhuseby commented Jul 2, 2024

@dhuseby
Copy link
Author

dhuseby commented Jul 2, 2024

@aschmahmann has some thoughts

@dhuseby dhuseby changed the title https://github.com/libp2p/specs/blob/master/discovery/mdns.md#definitions mDNS: the spec to explicitly allow for configurability of the service name Jul 2, 2024
@aschmahmann
Copy link
Contributor

A few thoughts:

  1. There is already some configurability/fragmentation described in the spec for private swarms / pnet which addresses this a little but not enough for some users
    • We've seen this people use pnet for isolation ("this isn't really meant to talk to other systems) more than security, speaking to a desire for some level of isolation
    • We've also seen this in say forks of protocols like Bitswap where some will use the same protocol + implementation but fork the protocol ID to have a base level of separation
    • This pushes towards allowing users to fragment by "application" (e.g. like the service-name)
  2. AFAICT it seems like the main reason for this proposal is for users to save the resources around making connections + performing identify or a similar protocol before deciding if they want to talk to some peer.
    • If doing this it might be helpful to remind users they should have a plan in place for receiving connections from peers not in their "service" since having an application-specific service name does not mean you won't get libp2p connections from other sources
    • Someone with greater expertise should check me, but I'm not sure we'd want to encourage too many mDNS service names since IIRC various devices run into problems with too many mDNS messages (not sure how much the problems were about bandwidth vs just the number of messages).
      • If this is an issue that would push us away from many service names, perhaps it'd help to modify the spec to enable sending back more "identify-like" information than just a multiaddr (depends on what the scale issues are)

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

No branches or pull requests

2 participants