TooTallNate / node-nat-pmp

Node.js implementation of the NAT Port Mapping Protocol
132 stars 16 forks source link

Implement PCP (Port Control Protocol) #12

Open TooTallNate opened 8 years ago

TooTallNate commented 8 years ago

From RFC 6886:

1.1. Transition to Port Control Protocol

NAT-PMP enjoyed almost a decade of useful service, and operational experience with NAT-PMP informed the design of its IETF Standards Track successor, Port Control Protocol (PCP) [RFC6887]. PCP builds on NAT-PMP, using the same UDP ports 5350 and 5351, and a compatible packet format. PCP also adds 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.

Because of the significant enhancements in PCP, all existing NAT-PMP implementations are encouraged to migrate to PCP. The version number in the packet header is 0 for NAT-PMP and 2 for PCP, so the packets are easily distinguished. (Version number 1 was used by a vendor that shipped products that use a protocol that is incompatible with the IETF Standard. PCP implementations MUST NOT use version number 1.)

PCP is RFC 6887.

stokito commented 2 years ago

The https://github.com/freedomjs/freedom-port-control library has a support of the PCP