Skip to content

Clarify the difference between a tunnel and a relay#8

Merged
daviddias merged 1 commit intomasterfrom
relay-vs-tunnel
Mar 28, 2017
Merged

Clarify the difference between a tunnel and a relay#8
daviddias merged 1 commit intomasterfrom
relay-vs-tunnel

Conversation

@hsanjuan
Copy link
Copy Markdown
Contributor

It took me a while to realize that a relay it's not just
tunneling a stream to a destination through a proxy peer
but rather it is making a destination peer
aware that the source peer is reachable through the relaying
node. Hopefully this makes that more explicit.

License: MIT
Signed-off-by: Hector Sanjuan code@hector.link

@hsanjuan hsanjuan self-assigned this Feb 16, 2017
@hsanjuan hsanjuan requested a review from a user February 16, 2017 06:52
relay/README.md Outdated
Unlike a transparent **tunnel**, where a libp2p peer would just proxy a communication
stream to a destination (the destination being unaware of the original source),
a circuit-relay makes the destination aware of the original source and
the circuit followed to stablish communication between the two. This provides
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/stablish/establish/

relay/README.md Outdated
a circuit-relay makes the destination aware of the original source and
the circuit followed to stablish communication between the two. This provides
the destination side with the capacity of re-contacting the original source
by rebuilding the circuit in the oposite direction, using the same relay.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/oposite/opposite/

@ghost
Copy link
Copy Markdown

ghost commented Feb 16, 2017

Awesome, thanks! Two tiny typos, LGTM 👍

relay/README.md Outdated
Apart from that, this relayed connection behaves just like a regular
connection would, but over an existing swarm stream with another peer
(instead of e.g. TCP.): One node asks a relay node to connect to another node
n its behalf. The relay node shortcircuits its streams to the two nodes,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/n/on/

relay/README.md Outdated
a circuit-relay makes the destination aware of the original source and
the circuit followed to stablish communication between the two. This provides
the destination side with the capacity of re-contacting the original source
by rebuilding the circuit in the oposite direction, using the same relay.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hsanjuan @lgierth can this part be clarified a little further, because the wording is explicit in saying that the connection is rebuilt using the same relay, which makes me ask why can't it be rebuilt using an alternative relay, in case the original one is unavailable. I guess this is just wording, and in case the original is unavailable a new one will be selected, or not?

@hsanjuan
Copy link
Copy Markdown
Contributor Author

@lgierth Thanks, fixed the typos. I need to pay more attention.

@dryajov I have changed the wording, does it sound better to you?

relay/README.md Outdated
original source), a circuit-relay makes the destination aware of the original
source and the circuit followed to establish communication between the two.
This provides the destination side with full knowledge of the circuit which,
if needed, could be rebuilt in the opposite direction using
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the key point that confused me and something worth highlighting here is that, the relay connection can be rebuilt using the same relay node or by asking the swarm to route it over some other relay peer. So I would perhaps word it as if needed, could be rebuilt either through the same relay node, or if unavailable by asking the swarm to route the connection over any other known relay.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But @dryajov, the spec does not really specify how to "ask the swarm" or do relay discovery. Therefore I find your wording more confusing (it opens more questions). I just want to highlight that in a tunnel the receiving node would not have information about the circuit, while in a relay like this it does. Perhaps I will just remove the sentence?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hsanjuan Fair enough. Maybe leaving the mention that the connection could be rebuilt and leaving out the details could make it more readable. Perhaps, something like this:

This provides the destination side with full knowledge of the circuit which, if needed, could be rebuilt in the opposite direction.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dryajov we have a deal! I have pushed it in the last form.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @hsanjuan, that looks much better!

It took me a while to realize that a relay it's not just
tunneling a stream to a destination through a proxy peer
but rather it is making a destination peer
aware that the source peer is reachable through the relaying
node. Hopefully this makes that more explicit.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
@daviddias daviddias merged commit 03e3fdc into master Mar 28, 2017
@daviddias daviddias deleted the relay-vs-tunnel branch March 28, 2017 13:34
jxs pushed a commit to jxs/specs that referenced this pull request Aug 8, 2025
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

Successfully merging this pull request may close these issues.

3 participants