Port Control Protocol (PCP) is a
computer networking
A computer network is a set of computers sharing resources located on or provided by network nodes. The computers use common communication protocols over digital interconnections to communicate with each other. These interconnections ar ...
protocol that allows
hosts on
IPv4
Internet Protocol version 4 (IPv4) is the fourth version of the Internet Protocol (IP). It is one of the core protocols of standards-based internetworking methods in the Internet and other packet-switched networks. IPv4 was the first version d ...
or
IPv6
Internet Protocol version 6 (IPv6) is the most recent version of the Internet Protocol (IP), the communications protocol that provides an identification and location system for computers on networks and routes traffic across the Internet. I ...
networks to control how the incoming IPv4 or IPv6
packets are translated and forwarded by an upstream
router that performs
network address translation (NAT) or
packet filter
In computing, a firewall is a network security system that monitors and controls incoming and outgoing network traffic based on predetermined security rules. A firewall typically establishes a barrier between a trusted network and an untrusted n ...
ing. By allowing hosts to create explicit
port forwarding rules, handling of the network traffic can be easily configured to make hosts placed behind NATs or
firewalls reachable from the rest of the Internet (so they can also act as
network servers), which is a requirement for many applications.
Additionally, explicit port forwarding rules available through PCP allow hosts to reduce the amount of generated traffic by eliminating
workaround
A workaround is a bypass of a recognized problem or limitation in a system or policy. A workaround is typically a temporary fix that implies that a genuine solution to the problem is needed. But workarounds are frequently as creative as true solut ...
s in form of outgoing NAT
keepalive messages, which are required for maintaining connections to servers and for various
NAT traversal
Network address translation traversal is a computer networking technique of establishing and maintaining Internet protocol connections across gateways that implement network address translation (NAT).
NAT traversal techniques are required for m ...
techniques such as
TCP hole punching. At the same time, less generated traffic reduces the
power consumption, directly improving the
battery runtime for
mobile device
A mobile device (or handheld computer) is a computer small enough to hold and operate in the hand. Mobile devices typically have a flat LCD or OLED screen, a touchscreen interface, and digital or physical buttons. They may also have a physical ...
s.
PCP was standardized in 2013 as a successor to the
NAT Port Mapping Protocol
NAT Port Mapping Protocol (NAT-PMP) is a network protocol for establishing network address translation (NAT) settings and port forwarding configurations automatically without user effort. The protocol automatically determines the external IPv4 ...
(NAT-PMP), with which it shares similar protocol concepts and packet formats.
In environments where a Universal Plug and Play Internet Gateway Device (UPnP IGD) is used in the local network, an interworking function between the UPnP IGD and PCP is required to be embedded in the IGD. The UPnP IGD-PCP Interworking Function is specified in RFC6970.
DHCP (IPv4 and IPv6) options to configure hosts with Port Control Protocol (PCP) server IP addresses are specified in RFC7291. The procedure to follow for selecting a server among a list of PCP servers is discussed in RFC7488.
In environments where NAT64 is deployed, PCP allows to learn the IPv6 prefix(es) used by a PCP-controlled NAT64 device to build IPv4-converted IPv6 addresses by the NAT64 (RFC7225).
Overview
Many applications and
network equipment deployments require their network locations to be reachable from outside their
local networks, following the originally envisioned model of
IP end-to-end connectivity across the Internet, so they can operate as network servers and accept connections from remote
clients. An example of such equipment is an
IP camera
An Internet Protocol camera, or IP camera, is a type of digital video camera that receives control data and sends image data via an IP network. They are commonly used for surveillance, but, unlike analog closed-circuit television (CCTV) camer ...
, which includes a network server that provides remote
surveillance over IP networks.
Usually, network equipment deployments place the devices behind routers or firewalls that perform NAT (to enable sharing of an
IPv4 address, for example) or packet filtering (for improved
network security
Network security consists of the policies, processes and practices adopted to prevent, detect and monitor unauthorized access, misuse, modification, or denial of a computer network and network-accessible resources. Network security involves th ...
and protection), ending up with breaking the end-to-end connectivity and rendering the equipment and applications inaccessible from the rest of the Internet.
The problem
Making the deployed equipment accessible, by extending its server role beyond the local network, requires either manual configuration of port forwarding at the
network gateway (which is usually a
CPE), or application-level workarounds that initiate connections from the deployed equipment to additional intermediate servers used for "merging" those "firewall punching" connections and connections from the actual clients. Both approaches have their downsides manual CPE configuration is usually either inconvenient or not possible, while using additional intermediate servers increases complexity and cost.
For example, an
online computer game
An online game is a video game that is either partially or primarily played through the Internet or any other computer network available. Online games are ubiquitous on modern gaming platforms, including PCs, consoles and mobile devices, and s ...
(which acts as a client) requires communication with a game server for exchanging
gameplay
Gameplay is the specific way in which players interact with a game, and in particular with video games. Gameplay is the pattern defined through the game rules, connection between player and the game, challenges and overcoming them, plot and pla ...
data. In order to make it possible for a game server to provide data to its clients, those clients must be made accessible to the server. Usually, clients initiate connections to the game server to open communication channels. However, such open connections can become idle and can subsequently be closed by network gateways, leading to the necessity of maintaining them by using a form of keepalive messages.
Keepalive messages are small messages that are sent between client and server that create traffic over a communication channel and therefore prevent gateway servers from closing it. Thus, keeping a connection alive requires a constant exchange of empty messages between client and server. This increases network chatter, wastes
network bandwidth and
CPU cycle
The instruction cycle (also known as the fetch–decode–execute cycle, or simply the fetch-execute cycle) is the cycle that the central processing unit (CPU) follows from boot-up until the computer has shut down in order to process instructions ...
s, and decreases the autonomy of
battery-powered devices.
Additionally, some network applications (for example,
FTP) require dynamic opening of multiple connections, which involves
application-level gateway
An application-level gateway (ALG, also known as application layer gateway, application gateway, application proxy, or application-level proxy) is a security component that augments a firewall or NAT employed in a computer network. It allows cus ...
s (ALGs) and additionally increases complexity.
PCP as a solution
PCP allows equipment and applications to create explicit mappings between an external
IP address
An Internet Protocol address (IP address) is a numerical label such as that is connected to a computer network that uses the Internet Protocol for communication.. Updated by . An IP address serves two main functions: network interface ident ...
,
protocol and
port
A port is a maritime facility comprising one or more wharves or loading areas, where ships load and discharge cargo and passengers. Although usually situated on a sea coast or estuary, ports can also be found far inland, such as ...
, and an internal IP address, protocol and port. With such explicit mappings in place, inbound communication can reach the hosts behind a NAT or firewall, which either expands their server roles beyond boundaries of local networks, or makes use of various services simplified and less resource-consuming. Created mappings are permanent to the extent of having a known lifetime that can be extended, which is similar to the way
Dynamic Host Configuration Protocol
The Dynamic Host Configuration Protocol (DHCP) is a network management protocol used on Internet Protocol (IP) networks for automatically assigning IP addresses and other communication parameters to devices connected to the network using a cli ...
(DHCP) implements its
leases
A lease is a contractual arrangement calling for the user (referred to as the ''lessee'') to pay the owner (referred to as the ''lessor'') for the use of an asset. Property, buildings and vehicles are common assets that are leased. Industrial ...
. At the same time, PCP allows applications to create additional mappings dynamically as required, which reduces or eliminates the need for having
ALG-enabled NAT devices and firewalls.
Created explicit mappings have a known lifetime, commonly several hours, with no need for application-level keepalive messages to be exchanged between hosts and servers for the purpose of preserving the mapping. As a result, network usage and power consumption are reduced, and application-level keepalive logic no longer needs to be implemented at client and server sides. The PCP mapping response provides the application with associated externally visible parameters (IP address, protocol and port) that can then be announced to other clients in application-specific ways so incoming connections can be established. Additionally, PCP can inform applications when the external IP address is changed while a mapping is already established.
Various types of NAT can be handled by PCP, providing support for
NAT64,
NAT66
IPv6-to-IPv6 Network Prefix Translation (NPTv6) is a specification for IPv6 to achieve address-independence at the network edge, similar to network address translation (NAT) in Internet Protocol version 4 (IPv4). It has fewer architectural problem ...
, and
NAT44; inclusion of PCP into IPv4 and IPv6 firewall devices is also supported. PCP is designed to be used on both large-scale aggregation points (for example, as part of
carrier-grade NATs), and inside less expensive
consumer-grade devices. Both long-term (for an IP camera or a temperature sensor acting as a server, for example) and short-term mappings (while playing an online computer game, for example) are supported.
PCP supports
transport layer
In computer networking, the transport layer is a conceptual division of methods in the layered architecture of protocols in the network stack in the Internet protocol suite and the OSI model. The protocols of this layer provide end-to-end ...
protocols that use 16-bit port numbers (for example,
TCP
TCP may refer to:
Science and technology
* Transformer coupled plasma
* Tool Center Point, see Robot end effector
Computing
* Transmission Control Protocol, a fundamental Internet standard
* Telephony control protocol, a Bluetooth communication s ...
,
UDP,
Stream Control Transmission Protocol (SCTP) or
Datagram Congestion Control Protocol
In computer networking, the Datagram Congestion Control Protocol (DCCP) is a message-oriented transport layer protocol. DCCP implements reliable connection setup, teardown, Explicit Congestion Notification (ECN), congestion control, and featu ...
(DCCP). Protocols that do not use port numbers (for example,
Resource Reservation Protocol (RSVP),
Encapsulating Security Payload (ESP),
ICMP or
ICMPv6
Internet Control Message Protocol version 6 (ICMPv6) is the implementation of the Internet Control Message Protocol (ICMP) for Internet Protocol version 6 (IPv6). ICMPv6 is an integral part of IPv6 and performs error reporting and diagnostic fu ...
) are supported for IPv4 firewall, IPv6 firewall and
NPTv6
IPv6-to-IPv6 Network Prefix Translation (NPTv6) is a specification for IPv6 to achieve address-independence at the network edge, similar to network address translation (NAT) in IPv4, Internet Protocol version 4 (IPv4). It has fewer architectural pr ...
(IPv6 prefix translation) functions, but cannot be supported by more than one client per external IP address in the case of NAT.
The PCP specification does not define a mechanism for dealing with
multi-homed networks (which have multiple network gateways or
default route
In computer networking, the default route is a configuration of the Internet Protocol (IP) that establishes a forwarding rule for packets when no specific address of a next-hop host is available from the routing table or other routing mechani ...
s). It is nonetheless possible to implement PCP in such networks using a coordination mechanism such as
conntrackd. However, if the different networks each have their own external IP address(es), a given PCP mapping can only use one or the other because the protocol requires one specific external IP address to be provided to the client. If that network should then become unavailable the PCP mapping would have to be updated to use an external IP address from the other network.
The PCP specification does not define a mechanism for dealing how to inform remote computers about the IP address, protocol, and port for
the incoming connection. RFC6887 states, that PCP does not provide any rendezvous function and this has to been done in an application-specific manner, like using external nameservice servers.
History
PCP was standardized in 2013 as a successor to the NAT Port Mapping Protocol (
NAT-PMP), sharing similar protocol concepts and packet formats with it. As one of the design differences, NAT-PMP is pretty much limited to the deployment on consumer-grade devices, while PCP is designed to also support
carrier-grade In telecommunication, a "carrier grade" or "carrier class" refers to a system, or a hardware or software component that is extremely reliable, well tested and proven in its capabilities. Carrier grade systems are tested and engineered to meet or ...
equipment.
Since 2005, NAT-PMP has been implemented in various
Apple
An apple is an edible fruit produced by an apple tree (''Malus domestica''). Apple trees are cultivated worldwide and are the most widely grown species in the genus '' Malus''. The tree originated in Central Asia, where its wild ances ...
products.
PCP relates to the
Internet Gateway Device Protocol (IGDP), which was standardized in 2001 as part of the
Universal Plug and Play
Universal Plug and Play (UPnP) is a set of networking protocols that permits networked devices, such as personal computers, printers, Internet gateways, Wi-Fi access points and mobile devices to seamlessly discover each other's presence on the ...
(UPnP) specification. While the IGDP is complex and tailored toward manual configuration, PCP is designed for simplicity and automated use within software applications. The NAT-PMP specification contains a list of the problems with IGDP that prompted the creation of NAT-PMP, and subsequently, its successor PCP.
Security
Excluding the
attackers
is a Japanese adult video (AV) production company located in Tokyo, Japan.
History
Attackers started as an independent ("indie") studio but is now one of the companies that make up the large AV group, the Hokuto Corporation, which distribute ...
capable of altering network packets exchanged while an explicit PCP mapping is created (packets that contain negotiation required for establishing an explicit mapping, which is exchanged between hosts and PCP-enabled NAT devices or firewalls), PCP is considered to be secure as long as created explicit mappings do not exceed the domain of implicit mappings. In other words, implicit mappings are created as a result of the way NAT devices and firewalls are handling regular outbound client connections, meaning that PCP is safe as long as no new mapping possibilities are introduced through the explicit mapping mechanism.
From the
security" \n\n\nsecurity.txt is a proposed standard for websites' security information that is meant to allow security researchers to easily report security vulnerabilities. The standard prescribes a text file called \"security.txt\" in the well known locat ...
standpoint, an important PCP feature is the mapping
request option. When used, this option signifies that the IP address specified additionally as part of the mapping request should be used as the internal address for the created explicit mapping, rather than following the default behavior of using source IP address of the actual mapping request packet for that purpose. Such mapping requests can end up with a PCP-enabled NAT device or firewall granting explicit mapping privileges higher than allowed by implicit mappings due to unknown rules imposed elsewhere for the specified IP address, allowing that way an attacker to steal some traffic, or to conduct a
denial-of-service
In computing, a denial-of-service attack (DoS attack) is a cyber-attack in which the perpetrator seeks to make a machine or network resource unavailable to its intended users by temporarily or indefinitely disrupting services of a host conn ...
(DoS) attack.
Additionally, explicit PCP security mechanisms are available as extensions to the PCP protocol, providing
authentication
Authentication (from ''authentikos'', "real, genuine", from αὐθέντης ''authentes'', "author") is the act of proving an assertion, such as the identity of a computer system user. In contrast with identification, the act of indicat ...
and
access control
In the fields of physical security and information security, access control (AC) is the selective restriction of access to a place or other resource, while access management describes the process. The act of ''accessing'' may mean consuming ...
mechanisms by using an authenticated and integrity-protected
in-band signalling
In telecommunications, in-band signaling is the sending of control information within the same band or channel used for data such as voice or video. This is in contrast to out-of-band signaling which is sent over a different channel, or even ov ...
channel, which relies on
Extensible Authentication Protocol (EAP) to perform the authentication between devices involved in a PCP negotiation session. Such PCP-enabled NAT devices or firewalls may still accept unauthenticated mapping requests; at the same time, all previously described explicit mapping constraints still apply.
Internals
Internally, PCP works by exchanging control messages between hosts and PCP-enabled NAT devices or firewalls (referred to as servers), using
User Datagram Protocol
In computer networking, the User Datagram Protocol (UDP) is one of the core communication protocols of the Internet protocol suite used to send messages (transported as datagrams in packets) to other hosts on an Internet Protocol (IP) networ ...
(UDP) as the underlying protocol. This communication consists of port mapping requests created by the hosts that result in
responses once submitted to and processed by the servers. Following UDP's nature of unreliability, which means that UDP
datagrams can be lost, duplicated or reordered, after submitting a request there is no guarantee for a response of any kind, thus host requests are also referred to as "hints". In addition to direct responses, servers also generate gratuitous notifications for example,
unicast
Unicast is data transmission from a single sender (red) to a single receiver (green). Other devices on the network (yellow) do not participate in the communication.
In computer networking, unicast is a one-to-one transmission from one point in ...
notifications to inform hosts of changes in the external IP address.
Exchanged messages contain no means for determining either the transaction they belong to, or which stage of a "session" they represent. Such a simplified design is based on having all messages self-describing and complete, with no additional
context required for each message to be successfully processed. Servers may decide to silently ignore host requests, in case they are unable to process them at the moment; in such cases, hosts need to
retransmit the request. Also, hosts may safely decide to silently ignore any unwanted mapping responses.
For the purpose of creating PCP requests, IP address of the server is either manually configured on the host, found as part of the host's
DHCP lease
The Dynamic Host Configuration Protocol (DHCP) is a network management protocol used on Internet Protocol (IP) networks for automatically assigning IP addresses and other communication parameters to devices connected to the network using a c ...
, or set to the host's configured
default gateway. Host request messages are sent from any source UDP port on a client to the server's UDP port 5351 that it listens to; unsolicited
multicast
In computer networking, multicast is group communication where data transmission is addressed to a group of destination computers simultaneously. Multicast can be one-to-many or many-to-many distribution. Multicast should not be confused wit ...
server notifications (such as server restart announcements) are sent from the server's UDP port 5351 to the UDP port 5350 on hosts which they listen to.
Maximum UDP
payload
Payload is the object or the entity which is being carried by an aircraft or launch vehicle. Sometimes payload also refers to the carrying capacity of an aircraft or launch vehicle, usually measured in terms of weight. Depending on the nature of ...
length for all PCP messages is 1100
octets. Each PCP message consists of a request or response header containing an
opcode
In computing, an opcode (abbreviated from operation code, also known as instruction machine code, instruction code, instruction syllable, instruction parcel or opstring) is the portion of a machine language instruction that specifies the opera ...
that determines the associated operation, any relevant opcode-specific information (such as which ports are to be mapped), and zero or more options (such as the option described
above). Result codes are returned as part of server responses; each result code has an associated lifetime, which tells the hosts when certain operations may be retried or should be repeated. For example, result lifetimes can specify how long a failure condition is expected to persist, or how long the created mapping will last.
See also
*
DMZ (computing) a subnetwork that contains and exposes one's external-facing services to a larger and untrusted network
*
Hole punching (networking) establishing direct connections between two networked parties residing behind firewalls or NAT-enabled routers
*
Universal Plug and Play
Universal Plug and Play (UPnP) is a set of networking protocols that permits networked devices, such as personal computers, printers, Internet gateways, Wi-Fi access points and mobile devices to seamlessly discover each other's presence on the ...
*
Internet Gateway Device Protocol
References
{{Reflist, 30em
External links
Port Control Protocol (PCP): Related documents(IETF)
Port Control Protocol (PCP): Charter for Working Group(IETF)
Internet architecture
Internet protocols
Network address translation
Network protocols