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

proposal 011: implement mDNS in Go and JS. #23

Merged
merged 1 commit into from
Aug 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions 011-mdns-go-js.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Implement MDNS discovery in Go and JS per the new spec

## Motivation and context

Issue: https://github.com/libp2p/go-libp2p/issues/623
Spec: https://github.com/libp2p/specs/blob/master/discovery/mdns.md

The current MDNS discovery mechanism implemented in go:

1. Does not conform to the above MDNS spec.
2. Does not support transports other than TCP (due to limitations of the current protocol).
3. Is filled with race conditions and other bugs (see the linked issue above) due to issues with the underlying MDNS implementation.

## Value

### Benefits (if addressed)

The value is just a mirror of the motivation:

* Replacing the underlying MDNS library (note: not with https://github.com/grandcat/zeroconf, that library doesn't fix the relevant bugs) will fix some data races (the only known data races in go-libp2p).
* Implementing the new protocol will improve interop between go-libp2p (which only implements the old, outdated protocol) and rust-libp2p (which only implements the new protocol).
* Implementing the new protocol will add support for discovering QUIC addresses (the current protocol only supports TCP).

### Risks (if not addressed)

* go/rust libp2p interop on local networks isn't complete.
* go-libp2p has a serious race condition when MDNS is enabled and can't be run with the race detector enabled.

## Expected output and constraints

The module must:

* Not trigger the race detector.
* Implement the new spec.
* Interoperate with js-libp2p and rust-libp2p.

Non-issues:

* The module _does not_ have to work with the current go-libp2p MDNS implementation. We can just pull in multiple modules for a transition period.

## Design/implementation notes

## Potential funders

<!-- Optional: know of projects or organizations that would benefit from seeing this project come to fruition? Enumerate them here, supplying some context, and possibly mention the relevant people. -->

Protocol Labs.