Skip to content

Commit cde37b5

Browse files
committed
content/concepts/circuit-relay: Describe relay process
1 parent 8e00768 commit cde37b5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

content/concepts/circuit-relay.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,17 @@ By giving the full relay path to my friend `QmBob`, they're able to quickly esta
4747
When [advertising your address](/concepts/peer-routing/), it's best to provide relay addresses that include the transport address of the relay peer. If the relay has many transport addresses, you can advertise a `p2p-circuit` through each of them.
4848
{{% /notice %}}
4949

50+
#### Process
51+
52+
The below sequence diagram depicts a sample relay process:
53+
54+
![Circuit v2 Protocol Interaction](https://github.com/libp2p/specs/blob/master/relay/circuit-v2.svg)
55+
56+
1. Node `A` is behind a NAT and/or firewall, e.g. detected via the [AutoNAT service](/concepts/nat/#autonat).
57+
2. Node `A` therefore requests a reservation with relay `R`. I.e. node `A` asks relay `R` to listen for incoming connections on its behalf.
58+
3. Node `B` wants to establish a connection to node `A`. Given that node `A` does not advertise any direct addresses but only a relay address, node `B` connects to relay `R`, asking relay `R` to relay a connection to `A`.
59+
4. Relay `R` forwards the connection request to node `A` and eventually relays all data send by `A` and `B`.
60+
5061
#### Autorelay
5162

5263
The circuit relay protocol is only effective if peers can discover willing relay peers that are accessible to both sides of the relayed connection.

0 commit comments

Comments
 (0)