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

Add support for PCP #2

Closed
zorun opened this issue Apr 18, 2015 · 4 comments
Closed

Add support for PCP #2

zorun opened this issue Apr 18, 2015 · 4 comments

Comments

@zorun
Copy link

zorun commented Apr 18, 2015

It would be nice to have support for PCP, which is the successor of NAT-PMP (basically NAT-PMP v1).

PCP basically extends NAT-PMP to be able to control stateful firewalls (IPv4 or IPv6), without necessarily involving NAT. Stateful firewalls are the real issue when applications need incoming connectivity (especially in an IPv6 world), NAT is just an artifact of the limited IPv4 address space.

From RFC 6886:

In 2013, NAT-PMP was superseded by the IETF Standards Track Port
Control Protocol [RFC6887].  PCP builds on NAT-PMP and uses a
compatible packet format, and adds a number of significant
enhancements, including IPv6 support, management of outbound
mappings, management of firewall rules, full compatibility with
large-scale NATs with a pool of external addresses, error lifetimes,
and an extension mechanism to enable future enhancements.

The on-wire format and UDP ports are the same, and there is support to facilitate the interoperability between the two protocols, see: https://tools.ietf.org/html/rfc6887#page-87

@jackpal
Copy link
Owner

jackpal commented Apr 18, 2015

What common routers support PCP? Apple? EdgeRouter?

@chmduquesne
Copy link

Apple products and other common routers (the "Fritzbox", a super common router in Germany is one of them). According to this ticket on syncthing, some custom built routers also support it.

I am attaching a link to the RFC, just in case: http://datatracker.ietf.org/doc/rfc6887/?include_text=1

@jackpal
Copy link
Owner

jackpal commented Oct 21, 2018

PCP is a neat protocol, but it's significantly larger in scope than NAT-PNP. PCP is upwards compatible with NAT-PNP at the network packet layer, but I think a good Golang API for PCP would look different than the current go-nat-pmp API. I think it would be better to have a separate go-PCP library with a PCP-centered API.

I am not currently working on golang networking code, so unfortunately I don't have any plans to implement a golang PCP library.

But it's totally a good idea!

@stokito
Copy link

stokito commented Jan 23, 2022

JFYI: guys from IPFS created a fork and working of adding a support ipfs/kubo#2797
There is also a PoC https://github.com/sashahilton00/go-pcp

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

No branches or pull requests

4 participants