rfc-7753

Port Control Protocol (PCP) Extension for Port-Set Allocation

Q. Sun, M. Boucadair, S. Sivakumar, C. Zhou, T. Tsou, S. Perreault
date2016-02 streamIETF areaint wgpcp statusPROPOSED STANDARD pages19 canonicalhttps://www.rfc-editor.org/rfc/rfc7753 doi10.17487/RFC7753
In some use cases, e.g., Lightweight 4over6, the client may require not just one port, but a port set. This document defines an extension to the Port Control Protocol (PCP) that allows clients to manipulate a set of ports as a whole. This is accomplished using a new MAP option: PORT_SET.

Extracted elements (27)

design-rationale §6.3

Idempotence is preserved by the PORT_SET extension, but the order in which overlapping port-set requests arrive determines which mapping is created. Clients are therefore required to prevent overlapping requests rather than relying on server-side deduplication.

nat, pcp

design-rationale §4.3

No capability-discovery mechanism is defined for PORT_SET because the option code is in the 'optional to process' range, and a client cannot distinguish 'server does not support PORT_SET' from 'server chose to allocate only one port.' Adding discovery would add complexity without solving the ambiguity.

nat, pcp

design-rationale §2

PORT_SET includes a parity-preservation bit (P) because protocols such as RTP assign semantic meaning to port parity (even ports for media, odd for RTCP). Without parity preservation, mapping a port set for RTP/RTCP use would be functionally incorrect.

nat, pcp, rtp

design-rationale §2

PORT_SET is preferred over multiple individual MAP requests because it reduces network traffic and latency, enables server-side bulk allocation that improves data-plane efficiency (e.g., CGN bulk port schemes), and allows a single state-table entry per client, greatly improving scalability.

nat, pcp

interoperability-note §4.3

The absence of a PORT_SET option in a server response does not prove the server lacks PORT_SET support; the server may have simply chosen to allocate only one port. Clients wishing more ports MAY send additional MAP requests.

nat, pcp

interoperability-note §4

The PORT_SET option code 130 falls in the 'optional to process' range (128–191). A PCP server that does not support PORT_SET will silently ignore the option and process the request as a plain single-port MAP request, ensuring backward compatibility.

nat, pcp

normative-requirement §4.4 MUST

A PCP client attempting to refresh or delete a port-set mapping MUST include the PORT_SET option in its request so the server can identify the mapping as a port-set entity.

nat, pcp

normative-requirement §4.1 MUST NOT

A PCP client MUST NOT include more than one PORT_SET option in a PCP MAP request. If multiple port sets are needed, the client MUST issue separate MAP requests, each with a distinct Internal Port.

nat, pcp

normative-requirement §4.1 SHOULD NOT

A PCP client SHOULD NOT include a PORT_SET option in single-port PCP MAP requests (creation, renewal, or deletion) because doing so unnecessarily increases server processing load.

nat, pcp

normative-requirement §4.1 MUST

If parity preservation is required (even↔even, odd↔odd), the PCP client MUST set the parity bit (P=1) in the PORT_SET option to request that the PCP server preserve port parity.

nat, pcp

normative-requirement §4.2 MUST NOT

If the PCP server ends up mapping only a single port for any reason, the PORT_SET option MUST NOT be present in the response. A single-port MAP request with PORT_SET is silently treated as a plain single-port request.

nat, pcp

normative-requirement §4.2 SHOULD

If the requested port set cannot be fully satisfied, the PCP server SHOULD map as many ports as possible and SHOULD map at least one port (equivalent to Port Set Size = 1 behavior).

nat, pcp

normative-requirement §4 MUST

In a request, the First Internal Port field MUST be set equal to the Internal Port field in the MAP Opcode header. In a response it indicates the first port of the mapped internal port set, which may differ from the requested value.

nat, pcp

normative-requirement §6.1 RECOMMENDED

It is RECOMMENDED to configure the PCP server to assign the maximum allowed Port Set Size in a single response to minimize the number of mapping table entries; this policy SHOULD itself be configurable.

nat, pcp

normative-requirement §6.3 MUST

PCP clients MUST ensure that port-set mapping requests do not inadvertently overlap with each other, for example by arbitrating requests through a central PCP client process or by acquiring internal ports from the OS before requesting PCP mappings.

nat, pcp

normative-requirement §4.1 MUST NOT

PREFER_FAILURE MUST NOT appear in a PCP MAP request that includes a PORT_SET option; a server receiving such a combination returns a MALFORMED_OPTION error.

nat, pcp

normative-requirement §4 MUST

The maximum occurrences of the PORT_SET option in a single PCP MAP request MUST be limited to 1, because a second PORT_SET option would imply overlapping Suggested External Port Sets derived from the same MAP Opcode header.

nat, pcp

normative-requirement §4.2 MUST NOT

The PCP server MUST NOT map more ports than the client requested. Internal Ports outside the range of Port Set Size ports starting from the First Internal Port MUST NOT be mapped.

nat, pcp

normative-requirement §4 MUST NOT

The Port Set Size field MUST NOT be zero; a server receiving a zero value returns a MALFORMED_OPTION error.

nat, pcp

normative-requirement §6.1 SHOULD

When the PCP server is configured to allocate multiple port sets to a subscriber, the same Assigned External IP Address SHOULD be assigned across multiple port-set responses to that subscriber.

nat, pcp

protocol-element §4.4

Port-set mappings are renewed and deleted as a single entity: the Assigned Lifetime applies to all ports in the set simultaneously. Overlap with existing single-port or port-set mappings causes the server to treat the request as independent refresh requests, sending one Mapping Update message per affected mapping.

nat, pcp

protocol-element §4

The Internal Port Set is the contiguous range of Port Set Size ports starting from First Internal Port. The Suggested External Port Set, and correspondingly the Assigned External Port Set, are the Port Set Size ports starting from the Suggested/Assigned External Port respectively.

nat, pcp

protocol-element §4

The PORT_SET option (option code 130) is a new PCP MAP option that allows a client to request a set of ports in a single request. It is valid only for the MAP opcode, has a length of 5 bytes, and may appear at most once per request or response.

nat, pcp

registry §8

IANA has allocated value 130 in the 'PCP Options' registry for the PORT_SET option defined in this document.

nat, pcp, registry

security-consideration §7

A single PORT_SET MAP request can trigger multiple responses (one per overlapping existing mapping). An on-path attacker who eavesdrops a mapping nonce can exploit this to mount an amplification attack. Using PCP authentication (RFC 6887, Section 18) eliminates this vector.

nat, pcp, security

security-consideration §7

To prevent a PCP client from monopolizing all ports bound to a shared IP address, port quotas SHOULD be configured on the PCP server per RFC 6887, Section 17.2.

nat, pcp, security

wire-format §4

The PORT_SET option encodes: Option Code=130 (8-bit), Reserved (8-bit), Option Length=5 (16-bit), Port Set Size (16-bit unsigned integer), First Internal Port (16-bit), Reserved (7-bit), and parity bit P (1-bit). Total encoded length is 8 bytes including the 3-byte option header.

nat, pcp