Repository navigation
NAT traversal tracking issue #312
Copy link
Copy link
Open
Description
This GitHub issue tracks the status of NAT traversal capabilities across libp2p implementations and platforms.
See Hole Punching document for greater picture.
Please comment below to suggest additions or corrections.
Projects
The following projects combine various protocols from the table below to achieve NAT traversal:
- Project Flare - project proposal, Golang tracking issue and high level architecture
- Transport Protocols
- TCP
- QUIC
- TURN-like Protocols
- circuit relay v2
- Signaling Protocols
- Direct Connection Upgrade through Relay
- STUN-like Protocols
- AutoNAT
- Other Protocols:
- multistream-select v1 simulataneous open
- AutoRelay
- Transport Protocols
- WebRTC star
- Transport Protocols
- WebRTC star flavour
- Signaling Protocols
- WebRTC star signaling protocol
- Transport Protocols
- HOPR Connect
- Transport Protocols
- WebRTC HOPR connect flavour
- STUN-like Protols
- STUN
- TURN-like Protocols
- circuit relay inspired HOPR connect flavoured
- Signaling Protocols
- HOPR signaling messages
- Transport Protocols
- Project proposal: browser nodes can connect to any node out of the box
- Transport Protocols
- Websockets for signaling communication
- WebRTC for data communication
- TURN-like Protocols
- circuit relay v2
- STUN-like Protols
- STUN
- Signaling Protocols
- ?
- Transport Protocols
Protocols
None of the Protocols below enable NAT traversal by themselves. Instead combinations of these protocols do.
Keywords for search engines: hole punching, TCP, QUIC, WebRTC, UPnP, ICE, STUN, TURN, meta
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
- StatusShow more project fieldsTriage
Activity
robertkiel commentedon Apr 9, 2021
Hi @mxinden,
thanks for the overview.
Remarks concerning hopr-connect:
Signaling ProtocolsintoTURN-like protocolsI think the description misses one of the main issues when reasoning about NAT traversal: there is a bunch of smaller protocols such as STUN, TURN, UPnP, TCP, and QUIC. Each of them is able to solve their main purpose for example STUN allows the discovery of public IPv4 addresses.
But the main issue is that a combination of these protocols is required to successfully bypass NATs, and this makes handling unsuccessful attempts and automatic fallbacks necessary. Otherwise you end up with a transport module that always fails on certain internet setups. Unfortunately, this is the most tricky part.
mxinden commentedon Apr 9, 2021
Updated the description:
I am not quite sure I follow. Each of these are listed in the table. An individual protocol in itself can not achieve NAT traversal by itself. Instead Projects, like HOPR connect, are combining various protocols to overcome a NAT.
Correct. This should be handled by the individual libp2p implementations. Today, if none of the direct connection approaches succeed, the fallback would be the circuit relay v1 protocol.
mxinden commentedon Apr 20, 2021
Changelog
Added Project Flare(decentralised Hole Punching) Phase1 Meta Issue go-libp2p#1039 to project Flare as another reading resource.
Added @vasco-santos's proposal ([WIP] propose: browser nodes can connect to any node out of the box protocol/web3-dev-team#70) as one of the projects involved in NAT traversal.
mxinden commentedon Apr 27, 2021
Changelog
mxinden commentedon May 5, 2021
Changelog
mxinden commentedon May 11, 2021
Changelog
mxinden commentedon May 25, 2021
Changelog
mxinden commentedon Jun 29, 2021
Changelog
0xjjpa commentedon Jul 9, 2021
Thanks for the update @mxinden!
@andreykiryushkin worth for you to take a dive on this now that you are exploring hopr-connect
mxinden commentedon Jul 15, 2021
Below sequence diagram depicts the process of Hole Punching with Project Flare. I have yet to find the right place for this to live long-term. Still I am posting it here in case others are looking for a high level overview already today.
To reproduce via plantuml.com
mxinden commentedon Aug 25, 2021
Changelog
cheako commentedon Nov 10, 2021
https://discuss.libp2p.io/t/nat-traversal-with-libp2p/295
https://discuss.libp2p.io/t/how-to-construct-relay-peer/1112
cheako commentedon Nov 10, 2021
https://gitlab.torproject.org/tpo/core/torspec/-/issues/64
cheako commentedon Nov 11, 2021
There is also a transport that "talks" to a running instance of tor and configures it: https://github.com/berty/go-libp2p-tor-transport
mxinden commentedon Jan 14, 2022
Changelog
mxinden commentedon Feb 9, 2022
Changelog
Thus all protocols for basic hole punching in rust-libp2p are in
masternow 🎉 If you want to punch holes yourself, check out libp2p/rust-libp2p#2460.0xjjpa commentedon Feb 10, 2022
Hey @mxinden, seems like a lot of work has been done lately around the
rustimplementation. Would it be safe to say that teams looking to implement hole-punching from scratch usinglibp2pAPI would be better off doing it via Rust?vyzo commentedon Feb 10, 2022
go-libp2p is further ahead and supports QUIC which has better penetration succeess rate, so no this isnt an accurate statement.
mxinden commentedon Feb 10, 2022
Yes, a lot of progress in regards to hole punching.
rust-libp2p does not yet have support for QUIC (see libp2p/rust-libp2p#2289) which bears higher hole punchings success rates given that it is based on UDP. For now, rust-libp2p only supports TCP hole punching. As mentioned above by @vyzo, go-libp2p is further ahead with QUIC support and a more battle tested hole punching stack.
TheRook commentedon Feb 7, 2023
IPFS developed Delegate routers which can help connect nodes behind NAT as well as browser-based clients:
https://github.com/ipfs/js-ipfs/blob/master/docs/DELEGATE_ROUTERS.md
Something like delegates could be ported to the libp2p core and a side-channel like DNS, or another bootstrap can be used to identify delegate nodes which can facilitate connectivity. IPFS Delegates do not support the full range of libp2p features like pub/sub.