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

UPnP in the TcpConfig #558

Closed
tomaka opened this issue Oct 11, 2018 · 10 comments
Closed

UPnP in the TcpConfig #558

tomaka opened this issue Oct 11, 2018 · 10 comments
Labels
difficulty:moderate getting-started Issues that can be tackled if you don't know the internals of libp2p very well help wanted priority:nicetohave

Comments

@tomaka
Copy link
Member

tomaka commented Oct 11, 2018

Add attempt_upnp: bool in the TcpConfig, and implement it!

@tomaka
Copy link
Member Author

tomaka commented Oct 11, 2018

Some references:

One issue is that listen_on is only allowed to produce one listened address, while in practice if we traverse a NAT we are actually listening on two addresses: the one on the LAN and the on on the WAN.
Maybe listen_on should return an Iterator<Item = Multiaddr> instead of a Multiaddr.

@twittner
Copy link
Contributor

How about PCP instead of IGD?

@tomaka
Copy link
Member Author

tomaka commented Oct 16, 2018

Whatever works!

@dvdplm
Copy link
Contributor

dvdplm commented Nov 12, 2018

@twittner I couldn't find any rust lib that implements PCP – do you know of any?

@Isan-Rivkin
Copy link
Contributor

@dvdplm
Maybe this one pcp_mmv-rs
Or you could maybe use FFI

@twittner
Copy link
Contributor

@dvdplm: No, I do not. FYI, I have started a small UPNP-IGD implementation at https://github.com/paritytech/upnp-igdp but it is currently using a fork of tokio and I am reluctant to test it, given the security implications of opening port mappings available to the outside world.

@dvdplm
Copy link
Contributor

dvdplm commented Nov 12, 2018

fork of tokio

Curious: why did you have to fork it?

@tomaka
Copy link
Member Author

tomaka commented Nov 12, 2018

Curious: why did you have to fork it?

tokio-rs/tokio#710

@tomaka tomaka mentioned this issue Jan 7, 2019
@tomaka tomaka added getting-started Issues that can be tackled if you don't know the internals of libp2p very well and removed getting-started Issues that can be tackled if you don't know the internals of libp2p very well labels Feb 21, 2019
@tomaka
Copy link
Member Author

tomaka commented Feb 25, 2019

I'm kind of conflicted whether this is a good "getting-started" issue.

The problem we encountered is that opening on the router is not instantaneous.
When one calls listen_on on TcpConfig, it needs to open ports. However the listen_on method is expected to immediately return the listened address, which depends on opening ports.

This also raises the question of making listen_on report known external addresses, for example the IP addresses of the local network interfaces.

@thomaseizinger
Copy link
Contributor

Closed as stale.

@thomaseizinger thomaseizinger closed this as not planned Won't fix, can't repro, duplicate, stale Mar 29, 2023
jxs pushed a commit to jxs/rust-libp2p that referenced this issue Dec 18, 2023
* Add metrics for queue lenghts

* Add changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty:moderate getting-started Issues that can be tackled if you don't know the internals of libp2p very well help wanted priority:nicetohave
Projects
None yet
Development

No branches or pull requests

7 participants