@@ -346,30 +346,30 @@ as follows:
346
346
- hm - [ handshake message packet]
347
347
- s - [ session message packet]
348
348
349
- ``` mermaid
350
- sequenceDiagram
351
- participant Alice
352
- participant Relay
353
- participant Bob
354
-
355
- Relay-->>Alice: m(NODES[Bob's ENR])
356
- Alice->>Bob: m(nonce,FINDNODE)
357
- Note left of Alice:Hole punched in Alice's NAT for Bob
358
- Note left of Alice:FINDNODE timed out
359
- Alice->>Relay: s(RELAYINIT[nonce])
360
- Relay->>Bob: s(RELAYMSG[nonce])
361
- Bob-->>Alice: whoareyou(nonce)
362
- Note right of Bob: Hole punched in Bob's NAT for Alice
363
- Alice-->>Bob: hm(FINDNODE)
364
- ```
349
+ ``` mermaid
350
+ sequenceDiagram
351
+ participant Alice
352
+ participant Relay
353
+ participant Bob
354
+
355
+ Relay-->>Alice: m(NODES[Bob's ENR])
356
+ Alice->>Bob: m(nonce,FINDNODE)
357
+ Note left of Alice:Hole punched in Alice's NAT for Bob
358
+ Note left of Alice:FINDNODE timed out
359
+ Alice->>Relay: s(RELAYINIT[nonce])
360
+ Relay->>Bob: s(RELAYMSG[nonce])
361
+ Bob-->>Alice: whoareyou(nonce)
362
+ Note right of Bob: Hole punched in Bob's NAT for Alice
363
+ Alice-->>Bob: hm(FINDNODE)
364
+ ```
365
365
366
366
Bob is behind a NAT. Bob is in Relay's kbuckets, they have a session together and Bob has
367
367
sent a packet to Relay in the last ~20 seconds hence Relay can get through Bob's NAT[^1].
368
368
369
369
As part of recursive query for peers, Alice sends a [FINDNODE] request to Bob, who's ENR
370
370
it received from Relay. By making an outgoing request to Bob, if Alice is behind a NAT,
371
371
Alice's NAT adds the filtering rule `(Alice's-LAN-ip, Alice's-LAN-port, Bob's-WAN-ip,
372
- Bob's-WAN-port, entry-lifetime)` to it's UDP session table[ ^ 2 ] [ ^ 3 ] . This means a hole now
372
+ Bob's-WAN-port, entry-lifetime)` to it's UDP session table[^2] [^3]. This means a hole now
373
373
is punched for Bob in Alice's NAT for the duration of `entry-lifetime`. The request to Bob
374
374
times out as Bob is behind a NAT.
375
375
388
388
Bob disassembles the [RELAYMSG] and uses the `nonce` to assemble a [WHOAREYOU packet],
389
389
then sends it to Alice using the address in the `initiator-enr`. Bob's NAT adds the
390
390
filtering rule `(Bob's-LAN-ip, Bob's-LAN-port, Alice's-WAN-ip, Alice's-WAN-port,
391
- entry-lifetime)` to it's UDP session table[ ^ 2 ] [ ^ 3 ] . A hole is punched in Bob's NAT for
391
+ entry-lifetime)` to it's UDP session table[^2] [^3]. A hole is punched in Bob's NAT for
392
392
Alice for the duration of `entry-lifetime`.
393
393
394
394
From here on it's business as usual. See [Sessions].
0 commit comments