rfc-7118

The WebSocket Protocol as a Transport for the Session Initiation Protocol (SIP)

I. Baz Castillo, J. Millan Villegas, V. Pascual
date2014-01 streamIETF areaart wgsipcore statusPROPOSED STANDARD pages25 canonicalhttps://www.rfc-editor.org/rfc/rfc7118 doi10.17487/RFC7118 errataview
The WebSocket protocol enables two-way real-time communication between clients and servers in web-based applications. This document specifies a WebSocket subprotocol as a reliable transport mechanism between Session Initiation Protocol (SIP) entities to enable use of SIP in web-oriented deployments.

Extracted elements (26)

design-rationale §5.3

The RFC 3261 requirement to add a "received" parameter to the top Via header is relaxed for WebSocket because HTTP proxies and TCP load balancers may sit between client and server, making the recorded source address that of an intermediary rather than the client—potentially revealing sensitive internal topology information.

websocket, sip, security

design-rationale §B

The SIP Outbound extension (RFC 5626) and GRUU (RFC 5627) are recommended for WebSocket SIP deployments because WebSocket clients behind NAT are only reachable through the proxy to which they are connected, making them analogous to SIP UAs that must reuse a TCP connection for incoming requests.

websocket, sip, nat

design-rationale §4.2

UTF-8 encoding is RECOMMENDED for SIP messages over WebSocket because JavaScript and the WebSocket API are natively oriented toward text; the entire SIP message (including headers and body) must be sent as a binary frame if any non-UTF-8 byte is present.

websocket, sip

interoperability-note §5.5

At the time of writing, DNS NAPTR/SRV queries could not be performed by commonly available WebSocket client stacks (JavaScript engines and web browsers), making direct connection using default ports the practical deployment approach.

websocket, sip, dns

interoperability-note §5

Because the WebSocket transport preserves message boundaries, the Content-Length header in SIP messages is not necessary when transported using the WebSocket subprotocol, simplifying parsing for both clients and servers.

websocket, sip

interoperability-note §B.1

SIP WebSocket Clients running in web browsers, which cannot discover the local transport address used for WebSocket connections, SHOULD use a random token followed by the ".invalid" top-level domain for Via and Contact header "sent-by" and hostport values.

websocket, sip

normative-requirement §5.4 MAY

A SIP element acting as a SIP WebSocket Client is not mandated to implement UDP and TCP, relaxing the RFC 3261 requirement, because some environments do not enable SIP elements to use UDP and TCP as transport protocols.

websocket, sip

normative-requirement §7 MUST

A SIP WebSocket Client MUST be ready to be challenged with an HTTP 401 status code (RFC 2617) by the SIP WebSocket Server when performing the WebSocket handshake.

websocket, sip, security

normative-requirement §7 MUST

A SIP WebSocket Server MUST be ready to read session cookies when present in the WebSocket handshake request and use the cookie value to determine whether the connection was initiated by an HTTP client navigating a website in the same domain.

websocket, sip, security

normative-requirement §7 SHOULD

A SIP WebSocket Server SHOULD be able to reject a WebSocket handshake request with an HTTP 401 status code by providing a Basic/Digest challenge as defined for HTTP.

websocket, sip, security

normative-requirement §5 MUST

Client and server transactions using WebSocket for transport MUST follow the procedures and timer values for reliable transports as defined in RFC 3261, since WebSocket is a reliable protocol.

websocket, sip

normative-requirement §5 MUST

Each SIP message MUST be carried within a single WebSocket message, and a WebSocket message MUST NOT contain more than one SIP message.

websocket, sip

normative-requirement §4.1 MUST NOT

Messages other than SIP requests and responses MUST NOT be transmitted over a WebSocket connection using the SIP subprotocol.

websocket, sip

normative-requirement §4.2 MUST

SIP WebSocket Clients and SIP WebSocket Servers MUST accept both text and binary WebSocket frames. If there is at least one non-UTF-8 symbol in the SIP message, the whole message MUST be sent within a WebSocket binary message.

websocket, sip

normative-requirement §4.1 MUST

The SIP WebSocket Client MUST include the value "sip" in the Sec-WebSocket-Protocol header in its handshake request, and the 101 reply from the server MUST contain "sip" in its corresponding Sec-WebSocket-Protocol header.

websocket, sip

normative-requirement §5.3 MUST

When a SIP WebSocket Server receives a request, it MAY decide not to add a "received" parameter to the top Via header. SIP WebSocket Clients MUST accept responses without such a parameter in the top Via header regardless of whether the Via "sent-by" field contains a domain name.

websocket, sip

protocol-element §5.5

Default port for a SIP URI using the "sip" scheme and "ws" transport parameter is 80; default port for the "sips" scheme with "ws" transport parameter is 443.

websocket, sip

protocol-element §5.5

NAPTR service values "SIP+D2W" and "SIPS+D2W" are defined for locating SIP WebSocket Servers supporting plain and secure WebSocket connections, respectively, per RFC 3263 procedures.

websocket, sip, dns

protocol-element §5.2

The SIP URI transport parameter value "ws" is defined for contacting a SIP entity using the WebSocket SIP subprotocol. The augmented BNF extension is: transport-param =/ "transport=" "ws".

websocket, sip

protocol-element §5.1

The Via transport parameter values "WS" and "WSS" are defined for SIP requests over plain and secure WebSocket connections, respectively. The augmented BNF extension is: transport =/ "WS" / "WSS".

websocket, sip

registry §10.6

IANA created a new "SIP Transport" subregistry within the "Session Initiation Protocol (SIP) Parameters" registry, with initial values UDP, TCP, TLS, SCTP, TLS-SCTP, WS, and WSS; policy for new registrations is "Standards Action".

sip, registry

registry §10.1

IANA registered the WebSocket SIP subprotocol under the "WebSocket Subprotocol Name" registry with subprotocol identifier "sip", common name "WebSocket Transport for SIP", and definition reference RFC 7118.

websocket, sip, registry

registry §10.2

IANA registered two new NAPTR service field values "SIP+D2W" (WS protocol) and "SIPS+D2W" (WS protocol) under the "Registry for the Session Initiation Protocol (SIP) NAPTR Resource Record Services Field".

sip, dns, registry

security-consideration §9.2

If the "sips" URI scheme is used, dictating that the entire request path to the target be secure, any WebSocket connection in that path MUST be a secure WebSocket connection.

websocket, sip, security

security-consideration §9.1

It is RECOMMENDED that SIP traffic over WebSocket be protected using a secure WebSocket connection (TLS over TCP). When establishing a connection using SIP over secure WebSocket, the client MUST authenticate the server using the server's certificate according to the WebSocket validation procedure in RFC 6455.

websocket, sip, security, tls

security-consideration §9.1

Server operators should note that TLS certificate authentication for SIP over WebSocket follows WebSocket (RFC 6455) validation procedures, which differ from SIP domain certificate procedures in RFC 5922; certificates valid for SIP over TLS/TCP may not be appropriate for SIP over secure WebSocket.

websocket, sip, security, tls, pkix