-
Notifications
You must be signed in to change notification settings - Fork 1k
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
How can I use libp2p simply for NAT traversal? #1861
Comments
Hi @actuday6418, I think the concept of NAT is too complex to summarize in a single Github issue. As a first introduction I would propose reading through the Wiki article. As Today In case you control the routers in front of both machines you might be able to open and forward specific ports from those routers to your machines. For details see the port forwarding article. |
@mxinden Unfortunately, I don't control the routers. What I said originally was a simplified version of the truth. My ISP has got NAT too other than that in my router (router's WAN address was different from my public address). So port forwarding won't help. I'll definitely look into TCP hole punching. Thanks for the info. As an afterthought, does
mean there is no way for two peers behind NAT not controlled by them to communicate using libp2p? Or is that specific to the Rust implementation? |
This is specific to the Rust implementation, which does not support NAT traversal yet. Take a look at the general libp2p docs to find out more about other implementations. |
I don't think (TCP) hole punching works with any libp2p implementation beyond very simple cases of NAT (libp2p/specs#196). Related discussions include #1690 (comment) and #1563. |
There is a recent effort to revive the libp2p relay protocol (#1838), which is practically speaking the option for NAT traversal that has the highest chance of success in many network setups. As alluded to earlier, sophisticated hole punching techniques that function without intermediate relays are not really possible with |
Out of curiosity is there a link to a discussion on why this is not possible in rust? Is it a language issue (it would be possible in other languages) or an architectural issue? |
@lukebelbina the important bit is "with |
Following up here for future readers: Progress is tracked in #2052. |
Disclaimer: I don't have an education in networking, so please forgive my naivety.
Hey,
I want to send data over the internet from one computer behind a router to another also behind a router. I don't need this data to be encrypted or anything. I don't need the computers to discover each other either.
The way I understand it, NAT works by forwarding traffic from the router's public address to a device's private one. If there is a way for the router to know that the incoming data must go to a particular node in it's private network, shouldn't there be some way of identifying to which node within a private network a data packet must go? So then the data packet will have some identifying characteristic ( address, port? ). Can I determine this address and then use that to send data from one computer to another?
The text was updated successfully, but these errors were encountered: