Code Monkey home page Code Monkey logo

Comments (6)

Stebalien avatar Stebalien commented on August 21, 2024

I agree. We wouldn't even need a CAN_HOP in this case.

Thoughts @vyzo?

from specs.

vyzo avatar vyzo commented on August 21, 2024

I think this was discussed during the spec development and rejected as an idea?
It's nice to be able to see if the relay hops without CAN_HOP but other than that it doesn't add much.
Also, it will be a bear to deploy as it would break existing nodes badly.

from specs.

Stebalien avatar Stebalien commented on August 21, 2024

Well, we can always support both so we don't need to break anything. However, as you said, this may be a pain to implement/deploy.

Really, my motivation is that this would allow us to split the implementation into a separate transport and relay.

from specs.

raulk avatar raulk commented on August 21, 2024

Based on discussions in libp2p/go-libp2p-circuit#67, I think the core problem is that the relay protocol doesn't model allocations.

So when a client connects to a relay, the relay has no idea if this is a NAT'ted client wishing to allocate a slot in the relay, or if it's a node wanting to connect to establish a channel to a relayed peer.

We can draw inspiration from the TURN spec (RFC5766), which models "allocations" explicitly. I think the hop/stop separation doesn't get to the root of the issue.

IMO a more correct design would be:

  • A /libp2p/relay/allocate protocol that NAT'ted peers use to acquire and renew a slot in a relay, enabling them to announce a relayed address for themselves.
    A /libp2p/relay/channel protocol, that clients use to open streams against NAT'ted peers, and that the relay uses to relay that stream over to the allocated peer.

See libp2p/go-libp2p-circuit#67 (review) for related discussion.

from specs.

tmakarios avatar tmakarios commented on August 21, 2024

Has any thought been given to how a relay should respond if it doesn't want to relay data to the requested peer? (For example, no allocation has been (or will be) made to the requested peer, due to whatever policies the relay uses.)

HOP_BACKOFF is described as a temporary backoff, rather than a refusal to relay to that peer. HOP_NO_CONN_TO_DST comes close, but I can imagine situations where the relay does have a connection to the destination, but wants to reserve its scarce bandwidth or data cap for relaying only to its closest friends.

from specs.

mxinden avatar mxinden commented on August 21, 2024

Instead of negotiating /libp2p/relay/circuit/0.1.0 then requesting a mode, it could be a good idea to have two different protocols instead. For example /libp2p/relay/circuit/0.1.0/hop and /libp2p/relay/circuit/0.1.0/stop.

This has been incorporated in the circuit relay v2 protocol (#325), thus I am closing here. Thanks for raising it @tomaka. In my eyes this is a great improvement to the v1 specification.

So when a client connects to a relay, the relay has no idea if this is a NAT'ted client wishing to allocate a slot in the relay, or if it's a node wanting to connect to establish a channel to a relayed peer.

This is handled in the circuit relay v2 protocol via Reservations.

HOP_BACKOFF is described as a temporary backoff, rather than a refusal to relay to that peer. HOP_NO_CONN_TO_DST comes close, but I can imagine situations where the relay does have a connection to the destination, but wants to reserve its scarce bandwidth or data cap for relaying only to its closest friends.

For now this is modeled via the PERMISSION_DENIED status in the circuit relay v2 specification. Error messages can be extended by more specific entities in the future.

from specs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.