Skip to content
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

NAT Traversal: Tell users if they are behind a symmetric NAT and document UPnP setup and port forwarding on Routers to help users #1017

Open
aarshkshah1992 opened this issue Nov 5, 2020 · 10 comments
Assignees

Comments

@aarshkshah1992
Copy link
Contributor

aarshkshah1992 commented Nov 5, 2020

  • A go-libp2p node should be able to tell it's user if it's behind a symmetric NAT.
  • To assist the users with options if hole punching fails, we should document how to configure/use the UPnP support in libp2p and add an example in go-libp2p-examples.
  • As discussed with @aschmahmann , it's also a good idea to document how users can manually setup port forwarding in their local hardware Router to get a public IP/port (if possible and if UPnP is NOT supported).
@aarshkshah1992 aarshkshah1992 self-assigned this Nov 5, 2020
@aarshkshah1992 aarshkshah1992 changed the title NAT Traversal: NAT Traversal: Validate UPnP flow and document setup Nov 5, 2020
@aarshkshah1992 aarshkshah1992 changed the title NAT Traversal: Validate UPnP flow and document setup NAT Traversal: Validate UPnP flow and document setup for users Nov 5, 2020
@Stebalien
Copy link
Member

This is done.

We should also document how to setup and validate the UPnP setup for users.

This can be enabled with the NATPortMap option. But I don't think this is enabled by default or well documented.

@aarshkshah1992
Copy link
Contributor Author

@jacobheun Let's create a nice document on everything address discovery, address advertisement and NAT traversal once we're done with Hole punching and publish the document to the world.

Even the UPnP documentation would go there..

@aarshkshah1992 aarshkshah1992 changed the title NAT Traversal: Validate UPnP flow and document setup for users NAT Traversal: Tell users if they are behind a symmetric NAT and document UPnP setup and port forwarding on Routers to help users Jan 27, 2021
@FelipeRosa
Copy link

FelipeRosa commented Feb 5, 2021

Would love to help with this.

Just found out that NATPortMap option is deprecated (as stated here) in flavor of this.

Edit: Guess this is what was being referred: https://github.com/libp2p/go-libp2p/blob/master/options.go#L399

@aarshkshah1992
Copy link
Contributor Author

@FelipeRosa Thanks for reaching out. It would be great if you can create a document explaining how UPnP in libp2p works currently, how to enable it on home routers and how to do port forwarding on home routers. Does that sound good ?

@FelipeRosa
Copy link

@aarshkshah1992 sounds good.

Where should this document be created?

@aarshkshah1992
Copy link
Contributor Author

@FelipeRosa Feel free to create a Pull Request against https://github.com/libp2p/docs. It already has a NAT traversal page. You can add the content there.

If that sounds like too much work, you can simply add it all to a Github issue and I'll ensure it makes it's way to the libp2p docs site.

@FelipeRosa
Copy link

Not too much work at all! Really like the library.

@aarshkshah1992
Copy link
Contributor Author

Hey @FelipeRosa

How's it going ? Is there any way I can help you out with this ?

@aarshkshah1992
Copy link
Contributor Author

cc @vyzo @raulk

Will need help from Dev Onboarding team for this.

@FelipeRosa
Copy link

Hey @aarshkshah1992, sorry for the long delay. I've been a bit busy in the past couple of weeks (and probably will be until Monday).

I'm having some difficulties trying to wrap everything in my head. I've read part of the code for the NAT stuff.

What I'm trying to figure out is the "how UPnP works currently in libp2p". Currently I'm trying to find a way of testing how the NAT port map, etc. would work (because my router does not support it). I'm wondering if I could emulate that with containers or VMs in my computer. Do you have any suggestions?

Other than that, feel free to guide me if you think I'm steering in the wrong direction here too :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants