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

Implement (finish) circuit switching relay #82

Closed
4 tasks
whyrusleeping opened this issue Aug 8, 2016 · 3 comments
Closed
4 tasks

Implement (finish) circuit switching relay #82

whyrusleeping opened this issue Aug 8, 2016 · 3 comments
Labels
exp/expert Having worked on the specific codebase is important help wanted Seeking public contribution on this issue status/deferred Conscious decision to pause or backlog
Milestone

Comments

@whyrusleeping
Copy link
Contributor

circuit switching is a very basic form of relaying that we already have some code in place for in p2p/protocol/relay. The code isnt currently functional and needs some attention.

Implementing circuit switching means that we can provide nearly 100% connectivity to users. Anyone who can connect to a public relay node should be able to communicate with any other user in the network (who can also connect to a public relay).

Tasks:

  • finish and test code in p2p/protocol/relay
  • determine how this code will be used
    • Host addon
    • if X dials fail, try using a relay?
    • Try using a relay and dialing normally at the same time, drop relay if normal connection succeeds?
  • add config option to set your node as a relay
  • config option for rate limiting relayed connections. (bandwidth of each, and total count)
  • set all gateway nodes as open relays
@whyrusleeping whyrusleeping added help wanted Seeking public contribution on this issue exp/expert Having worked on the specific codebase is important feature labels Aug 8, 2016
@whyrusleeping whyrusleeping added this to the libp2p Relay milestone Sep 13, 2016
@ghost ghost added status/deferred Conscious decision to pause or backlog and removed status/deferred Conscious decision to pause or backlog labels Nov 12, 2016
@whyrusleeping whyrusleeping added the status/deferred Conscious decision to pause or backlog label Nov 28, 2016
@ghost
Copy link

ghost commented Jan 17, 2017

cc @diasdavid @victorbjelkholm this is relevant to you two because of js-libp2p-relay.

I started working on relay in go-ipfs as part of the "browser accesses go-ipfs" sprint (ipfs/team-mgmt#130).

So far I think the cleanest solution is to make the relay service a transport, so that we get end-to-end encryption -- the existing but unused relay code makes no attempt at that. It might at first feel weird that a swarm protocol is at the same time a transport, but this kind of stack hopping is what you sign up for when building overlay networks. It'll be something like: the RelayService calls Host.NewStream() and Host.SetStreamHandler(), and the Host calls RelayService.AddRelayPeer()

In the end I think this solution is the simplest in that it doesn't have to touch any existing libp2p interfaces. It will also fit in nicely with any future things like transport capabilities and connection estimators.

  • /relay multiaddr (/relay-exp for now)
    • Just a PeerID is enough, RelayService picks a suitable peer for relaying
    • Can be explicit though: /ip4/1.2.3.4/tcp/4737/ipfs/Qmfoo/relay/Qmbar
    • Nice side-effect for free: multihop: /relay/Qmfoo/relay/Qmbar/relay/Qmbaz
  • RelayService
    • Implements go-libp2p-net.StreamHandler and go-libp2p-transport.Transport
  • Config option for relay hosts
    • Probably a static list for now?

@ghost
Copy link

ghost commented Mar 7, 2017

The spec is in libp2p/specs, the /p2p-circuit multiaddr has been added to the protocol table, and @dryajov has made great progress on js-libp2p-circuit.

🚢🚢🚢

@daviddias
Copy link
Member

The spec was revisited and released as 0.1.0 - https://github.com/libp2p/specs/tree/master/relay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exp/expert Having worked on the specific codebase is important help wanted Seeking public contribution on this issue status/deferred Conscious decision to pause or backlog
Projects
None yet
Development

No branches or pull requests

3 participants