ietf-corpus

rfc-5595

The Datagram Congestion Control Protocol (DCCP) Service Codes

G. Fairhurst
date2009-09 streamIETF areatsv wgdccp statusPROPOSED STANDARD pages19 canonicalhttps://www.rfc-editor.org/rfc/rfc5595 doi10.17487/RFC5595 errataview
This document describes the usage of Service Codes by the Datagram Congestion Control Protocol, RFC 4340. It motivates the setting of a Service Code by applications. Service Codes provide a method to identify the intended service/application to process a DCCP connection request. This provides improved flexibility in the use and assignment of port numbers for connection multiplexing. The use of a DCCP Service Code can also enable more explicit coordination of services with middleboxes (e.g., network address translators and firewalls). This document updates the specification provided in RFC 4340. [STANDARDS-TRACK]

updated by

updates

Extracted elements (27)

design-rationale §1.1

A 32-bit Service Code was chosen instead of a 32-bit port space because overhead was a concern for low-rate applications; placing the value only in the DCCP-Request packet adds no per-packet overhead to the data flow while still giving middleboxes and endpoints enough information to identify the intended service.

congestion

design-rationale §1.1

An early DCCP design used the Service Code as the sole socket identifier at the server, eliminating traditional ports entirely. This was abandoned because it prevented two server instances for the same service on one host and raised concerns about compatibility with NATs and other middleboxes that understand port-based demultiplexing.

congestion, nat

design-rationale §1.1

The 16-bit port space is too small for trivial, unregulated allocation; applications collide on unregistered ports and port-based firewalls incentivize disguising traffic. The 32-bit Service Code space is large enough that every application can obtain a unique value easily, decoupling service identification from demultiplexing.

congestion, security

interoperability-note §2.6

Methods that signal destination port numbers, such as SDP, require an extension to also carry DCCP Service Codes. Existing SDP usage does not convey Service Code information without such an extension.

congestion, realtime

normative-requirement §3.1 MUST

A client application MUST associate every DCCP connection (and hence every DCCP active socket) with a single Service Code value; this value is used in the corresponding DCCP-Request packet.

congestion

normative-requirement §3.3 MUST

A DCCP implementation MUST disallow two server applications from using the same Service Code bound to the same server port simultaneously, since there would be no way to direct a new connection to the correct application.

congestion

normative-requirement §3.2 MUST NOT

A middlebox that does not modify the intended application (e.g., NATs and firewalls) MUST NOT change the Service Code.

congestion, nat

normative-requirement §3.2 SHOULD

A middlebox that intends to differentiate applications SHOULD test the Service Code in addition to the destination or source port of a DCCP-Request or DCCP-Response packet.

congestion, nat

normative-requirement §3.3 SHOULD

An implementation SHOULD allow more than one Service Code to be associated with a passive server port, enabling multiple applications or multiple versions of an application to listen on the same port differentiated by Service Code. It SHOULD also provide a method to inform the server of the Service Code selected by an active connection.

congestion

normative-requirement §2.4 SHOULD NOT

Applications SHOULD NOT use a Service Code of zero. Application writers needing a temporary value SHOULD choose a value from the private range; applications intended for Internet deployment are encouraged to request an IANA-assigned Service Code.

congestion

normative-requirement §2.1 MUST

Each Registered DCCP port MUST be associated with at least one pre-defined Service Code.

congestion, registry

normative-requirement §2.2 MUST

Endpoints MUST associate a Service Code with every DCCP socket, both actively and passively opened. The application generally supplies this Service Code.

congestion

normative-requirement §3.3.1 SHOULD

If the server port is not associated with the requested Service Code, the server SHOULD reject the request with a DCCP-Reset using Reset Code 8 ('Bad Service Code'), but MAY use 'Connection Refused' instead.

congestion

normative-requirement §2.5 MUST NOT

Implementations MUST NOT accept a DCCP-Request carrying the invalid Service Code value 4294967295 (0xFFFFFFFF), and SHOULD NOT allow applications to bind to this value.

congestion

normative-requirement §2.2.1 SHOULD

New versions of applications/protocols that include version negotiation SHOULD continue to use the same Service Code. They MAY allocate a new Service Code if significant new capabilities warrant it; if that new code is associated with a Well Known or Registered port, the DCCP Ports registry MUST be updated.

congestion, registry

normative-requirement §3.3.1 MUST

When a DCCP-Request arrives for a destination port not bound to any server, the host MUST reject the connection by issuing a DCCP-Reset with Reset Code 'Connection Refused'. A host MAY also use Reset Code 'Too Busy'.

congestion

protocol-element §1

A DCCP Service Code is a 4-byte (32-bit) value included in DCCP-Request and DCCP-Response packets that identifies the application-level service to which a client wishes to connect. It is carried only in those two packet types (and potentially new packet types), adding no overhead to the data flow.

realtime, congestion

protocol-element §2.4

A Service Code of zero is permanently reserved and represents the absence of a meaningful Service Code. RFC 4340 permits applications to be associated with it, but RFC 5595 discourages this use.

congestion

protocol-element §2.7

An optional hash method derives a Dynamic port from a Service Code: s_port = ((sc[0]<<7)^(sc[1]<<5)^(sc[2]<<3)^sc[3]) | 0xC000, with a special case avoiding 0xFFFF. This allows client and server to agree on a port without out-of-band signalling.

congestion

protocol-element §2.3

Private Service Codes occupy the decimal range 1056964608–1073741823 (32-bit values whose high-order byte equals 63, the ASCII character '?'). They are not centrally allocated and need not follow the ASCII representability requirement.

congestion, registry

protocol-element §2.5

The Service Code value 4294967295 (0xFFFFFFFF) is defined as 'invalid', providing a special 4-byte sentinel that implementations can use to indicate 'no valid Service Code'. DCCP-Requests carrying this value must be rejected.

congestion

registry §2.1

IANA maintains the DCCP Port Numbers registry for Well Known (0–1023) and Registered (1024–49151) ports. Each Registered DCCP port must be associated with at least one predefined Service Code; the registry records these associations.

registry, congestion

registry §5

IANA maintains the DCCP Service Codes registry, originally defined in RFC 4340. RFC 5595 does not change the allocation procedures but clarifies that a published RFC is not required to apply for a Service Code; a specification is required only for codes using the restricted ASCII character subset.

registry, congestion

security-consideration §4.2

A server that responds with a 'Bad Service Code' reset immediately confirms or denies that a particular service is present, which may assist port scanning and reconnaissance. Care is needed when interpreting Service Code-to-service mappings, as a service may use multiple codes or a private code may shadow an IANA-assigned one.

security, congestion

security-consideration §4.1

Because Service Codes allow multiple applications to safely share a single server port, port number reuse in DCCP may be more common than in TCP/UDP. Security policies and middlebox rules that rely solely on port numbers may therefore be less effective.

security, congestion, nat

security-consideration §4.3

IPsec (all modes) protects the integrity of the DCCP header, including the Service Code. ESP additionally encrypts the Service Code, hiding it from middleboxes. IKEv2 does not currently specify a method to use Service Codes in IPsec security-association setup; firewall and IPsec policies should not rely solely on ports or Service Codes to identify a service.

security, ipsec, congestion

wire-format §2.2

The Service Code is a 4-byte field represented in one of three forms: a decimal number (canonical), a 4-character ASCII string, or an 8-digit hexadecimal number. All IANA-assigned Service Codes must be representable using a subset of the ASCII character set.

congestion