ietf-corpus

rfc-5626

Managing Client-Initiated Connections in the Session Initiation Protocol (SIP)

C. Jennings (Editor), R. Mahy (Editor), F. Audet (Editor)
date2009-10 streamIETF arearai wgsip statusPROPOSED STANDARD pages50 canonicalhttps://www.rfc-editor.org/rfc/rfc5626 doi10.17487/RFC5626
The Session Initiation Protocol (SIP) allows proxy servers to initiate TCP connections or to send asynchronous UDP datagrams to User Agents in order to deliver requests. However, in a large number of real deployments, many practical considerations, such as the existence of firewalls and Network Address Translators (NATs) or the use of TLS with server-provided certificates, prevent servers from connecting to User Agents in this way. This specification defines behaviors for User Agents, registrars, and proxy servers that allow requests to be delivered on existing connections established by the User Agent. It also defines keep-alive behaviors needed to keep NAT bindings open and specifies the usage of multiple connections from the User Agent to its registrar. [STANDARDS-TRACK]

updates

Extracted elements (31)

design-rationale §3.3

Multiple flows to different servers reduce the avalanche restart problem: when a server fails, UAs with only that flow reconnect simultaneously causing load spikes, but UAs with a surviving secondary flow delay reconnection by a backoff period, spreading reconnect load across time.

sip, nat

design-rationale §3.5.2

STUN was chosen for UDP keep-alives over SIP-request-based approaches because the SIP Working Group concluded that achieving both good performance and full backwards compatibility with SIP-based keep-alives were mutually exclusive goals. STUN is robust and can detect changed IP address and port mappings.

sip, nat

interoperability-note §3.5.1

Sending a double-CRLF over a connection-oriented transport is backwards compatible with RFC 3261 Section 7.5; however, only implementations that support RFC 5626 will respond to a ping with a pong. A UA that did not register using outbound procedures cannot expect a CRLF pong unless explicitly indicated.

sip, tcp

interoperability-note §8

Sending STUN binary data on the same UDP ports used for SIP is a significant non-backwards-compatible change to RFC 3261. A SIP node MUST NOT send STUN requests to a next-hop SIP node that has not explicitly indicated support; doing so could cause the node to be blacklisted for UDP traffic.

sip, udp, nat

normative-requirement §8 MUST NOT

A SIP node MUST NOT send STUN requests over a flow unless it has an explicit indication that the target next-hop SIP server claims to support this specification. UACs MUST NOT use ambiguous configuration options to imply next-hop STUN support.

sip, nat, security

normative-requirement §4.2.1 MUST

A UA MUST support outbound-proxy-sets with at least two outbound proxy URIs and SHOULD support sets with up to four URIs. If the set has more than one URI, the UAC MUST send a REGISTER request to at least two of the default outbound proxies.

sip

normative-requirement §4.1 SHOULD

A UA SHOULD create a UUID URN (RFC 4122) as its instance-id. If a URN scheme other than UUID is used, the UA MUST only use URNs for which an RFC from the IETF stream defines how the URN is constructed and used in the '+sip.instance' Contact header field parameter.

sip

normative-requirement §5.4 MUST

All edge proxies compliant with this specification MUST implement support for STUN NAT keep-alives on their SIP UDP ports. When a server receives a double CRLF sequence between SIP messages on a connection-oriented transport, it MUST immediately respond with a single CRLF over the same connection.

sip, nat

normative-requirement §4.1 MUST

Each UA MUST have an Instance Identifier URN that uniquely identifies the device. This URN MUST be persistent across power cycles and MUST NOT change as the device moves from one network to another.

sip, security

normative-requirement §4.4.1 MUST

If a pong is not received within 10 seconds after sending a ping (or immediately after processing any incoming message being received when that 10 seconds expires), then the client MUST treat the flow as failed.

sip, nat

normative-requirement §7 MUST

If a proxy receives information indicating no future messages will be delivered on a specific flow (e.g., a TCP socket closing or a destination-unreachable ICMP error), the proxy MUST invalidate all bindings in the target set that use that flow, regardless of AOR.

sip, nat

normative-requirement §4.2.3 MUST NOT

In a third-party registration, a UA MUST NOT include a 'reg-id' header field parameter if the registering UA is not the same instance as the UA referred to by the target Contact header field. A UAC also MUST NOT include an instance-id feature tag or reg-id parameter in a request to un-register all Contacts.

sip

normative-requirement §4.2.1 MUST

REGISTER requests MUST include an instance-id media feature tag. A UAC conforming to this specification MUST include a 'reg-id' parameter in the Contact header field that is distinct from other reg-id parameters used in other registrations with the same '+sip.instance' and AOR.

sip

normative-requirement §7 MUST NOT

The authoritative proxy MUST NOT populate the target set with more than one contact with the same AOR and instance-id at a time. If a request fails with a 430 (Flow Failed) response, the proxy SHOULD replace the failed branch with another target with the same AOR and instance-id but a different reg-id.

sip

normative-requirement §4.4.1 MUST

The CRLF keep-alive MUST only be used with connection-oriented transports such as TCP or SCTP; it MUST NOT be used with connection-less transports such as UDP. Clients MUST support CRLF keep-alives.

sip, tcp, nat

normative-requirement §4.2.1 MUST

The sequence of reg-id values MUST be exactly the same each time the UA instance power cycles or reboots, so that the reg-id values will collide with previously used values, enabling the registrar to replace older registrations.

sip

normative-requirement §4.4.2 MUST

The STUN keep-alive MUST only be used with connection-less transports such as UDP; it MUST NOT be used for connection-oriented transports. If the XOR-MAPPED-ADDRESS in the STUN Binding Response changes, the UA MUST treat this event as a failure on the flow. Clients MUST support STUN-based keep-alives.

sip, udp, nat

normative-requirement §4.4 MUST

When a successful registration response contains the Flow-Timer header field, the UA MUST send keep-alives at least as often as the number of seconds indicated. If using the server-recommended frequency, the UA SHOULD send keep-alives with interval randomly distributed between 80% and 100% of the server-provided time.

sip, nat

normative-requirement §5.1 MUST

When an edge proxy is the first SIP node after the UAC, it either MUST store a flow token (containing information about the flow from the previous hop) in its Path URI or reject the request. The flow token MUST be an identifier that is unique to this network flow, and the first node MUST include an 'ob' URI parameter in its Path header field value.

sip, nat

normative-requirement §6 MUST NOT

When receiving a REGISTER, if the registrar is not the first hop and the Path header is missing or the first URI does not have an 'ob' URI parameter, outbound processing MUST NOT be applied. If the REGISTER contains reg-id and the outbound option tag in a Supported header field, the registrar MUST respond with 439 (First Hop Lacks Outbound Support).

sip

protocol-element §2.1

A Flow Token is an identifier placed in the user portion of a SIP URI (typically in the Path header) by the first edge proxy that uniquely identifies a transport-layer flow. It allows the edge proxy to map future requests back to the correct flow and provides indirect authentication via the registrar.

sip, nat

protocol-element §4.4

The Flow-Timer header field, included in a successful 2xx registration response when the outbound option-tag is present in Require, conveys the number of seconds the server is prepared to wait without receiving keep-alives before considering the flow dead.

sip, nat

protocol-element §2.1

The 'ob' URI parameter has context-dependent meaning: in a Path header value it indicates the first edge proxy added a flow token; in a Contact or Route header field value it indicates the UA wants subsequent dialog requests routed over the same flow.

sip, nat

protocol-element §2.1

The 'reg-id' Contact header field parameter distinguishes concurrent registrations from the same UA instance over different flows for the same AOR. The registrar uses instance-id plus reg-id together as the binding key instead of the Contact URI.

sip

protocol-element §4.1

The 'sip.instance' media feature tag (encoded as '+sip.instance' in the Contact header field parameter) carries a URN uniquely identifying a UA instance. It is used by registrars to associate multiple registrations over different flows with the same UA.

sip

registry §11

RFC 5626 registers the 'Flow-Timer' SIP header field, the 'reg-id' Contact header field parameter, the 'ob' SIP/SIPS URI parameter, the 'outbound' SIP option tag, the 430 (Flow Failed) response code, the 439 (First Hop Lacks Outbound Support) response code, and the 'sip.instance' media feature tag.

sip, registry

security-consideration §4.1

A UA that makes an anonymous request or has other privacy concerns MAY omit the 'sip.instance' media feature tag from its Contact header field, since the instance-id provides a persistent, globally unique identifier that can be used to track the UA across registrations.

sip, privacy, security

security-consideration §5.2

Flow tokens MUST be unforgeable: the example algorithm uses an HMAC-SHA1-80 keyed by a 20-octet per-proxy secret over the flow's protocol, local address/port, and remote address/port, then base64-encodes the HMAC concatenated with the input. If the HMAC check fails, the proxy SHOULD send a 403 (Forbidden).

sip, security, crypto

state-machine §4.5

Flow recovery uses exponential backoff: upper-bound wait W = min(max-time, base-time × 2^consecutive-failures). If all flows have failed, base-time defaults to 30s; if at least one flow is active, base-time defaults to 90s; max-time defaults to 1800s. The actual retry delay is a uniform random value between 50% and 100% of W.

sip, nat

wire-format §8

STUN Binding Requests used for keep-alives require no STUN attributes; corresponding Binding Responses MUST include the XOR-MAPPED-ADDRESS attribute. STUN packets are distinguished from SIP on UDP because the first octet of a STUN Binding method is 0 or 1, while SIP first octets are never 0 or 1.

sip, udp, nat

wire-format §4.4.1

The CRLF keep-alive ping is a double-CRLF sequence (CR LF CR LF, 4 octets); the pong is a single CRLF (CR LF, 2 octets). These sequences must be sent between SIP messages and not in the middle of a SIP message; when sent over TLS or SigComp they are inside those channels.

sip, tcp, nat