-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transport hole punching #873
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: diegomrsantos <diego@status.im>
# Conflicts: # libp2p/connmanager.nim # libp2p/protocols/connectivity/autonat/service.nim # tests/testconnmngr.nim
# Conflicts: # libp2p/peerstore.nim
Closed
diegomrsantos
force-pushed
the
transport-hole-punching
branch
from
March 10, 2023 11:52
fe05760
to
8c72c63
Compare
diegomrsantos
force-pushed
the
transport-hole-punching
branch
from
March 10, 2023 14:27
8c72c63
to
66334d9
Compare
diegomrsantos
force-pushed
the
transport-hole-punching
branch
from
March 10, 2023 14:49
66334d9
to
c9a00a7
Compare
diegomrsantos
force-pushed
the
transport-hole-punching
branch
from
March 14, 2023 12:30
c9a00a7
to
2289e82
Compare
# Conflicts: # .pinned # libp2p/observedaddrmanager.nim # libp2p/peerstore.nim # libp2p/protocols/connectivity/autonat/service.nim # libp2p/protocols/identify.nim # tests/testautonatservice.nim # tests/testobservedaddrmanager.nim
Menduist
reviewed
Mar 27, 2023
Menduist
reviewed
Mar 27, 2023
Menduist
reviewed
Mar 27, 2023
Co-authored-by: Tanguy <tanguy@status.im>
Menduist
approved these changes
Apr 6, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, when dialing a peer using the TcpTransport, the OS randomly chose the socket local port. It means that when an internal peer dials a remote one, the latter will always observe a random port. But to do TCP hole punching, we need a stable and predictable public port that will be advertised to the peers we want to create a TCP simultaneous open. This is known as the NAT port prediction problem.
To solve this problem, we add the possibility of binding to the TCP listening port before dialing remote peers in this PR. The TCP transport will always bind when the peer's network reachability is "not reachable" and not bind otherwise. We assume the NAT uses the port preservation scheme, i.e. it maps the source port of the internal peer to the same public port.
More info: