ietf-corpus

rfc-7977

The WebSocket Protocol as a Transport for the Message Session Relay Protocol (MSRP)

P. Dunkley, G. Llewellyn, V. Pascual, G. Salgueiro, R. Ravindranath
date2016-09 streamIETF wgnon working group statusPROPOSED STANDARD pages28 canonicalhttps://www.rfc-editor.org/rfc/rfc7977 doi10.17487/RFC7977
The WebSocket protocol enables two-way real-time communication between clients and servers in situations where direct access to TCP and UDP is not available (for example, from within JavaScript in a web browser). This document specifies a new WebSocket subprotocol as a reliable transport mechanism between Message Session Relay Protocol (MSRP) clients and relays to enable usage of MSRP in new scenarios. This document normatively updates RFCs 4975 and 4976.

updates

Extracted elements (25)

design-rationale §5.1

All MSRP-over-WebSocket messages must be routed via an MSRP WebSocket Server because WebSocket clients are architecturally incapable of accepting inbound connections from other WebSocket clients or servers, making direct client-to-client MSRP communication impossible without a relay.

websocket, realtime

design-rationale §A

MSRP WebSocket Clients use a random token followed by the ".invalid" TLD (RFC 2606) in the hostpart of their From-Path URI because the JavaScript WebSocket API in browsers cannot discover the local transport address used for the WebSocket connection.

websocket, realtime

design-rationale §5.2.2

No new SDP transport protocol is defined for MSRP over WebSocket. Because all traffic goes through a relay, the client specifies "TCP/TLS/MSRP" in the SDP m-line (the protocol used between relays and non-WebSocket clients), while the "ws" transport appears only in the SDP path attribute URI.

websocket, realtime

interoperability-note §5.2.2

The "ws" transport parameter appears in the endpoint URI in the SDP "path" attribute but not in the SDP m-line; MSRP was designed to allow unrecognized transports provided implementations do not need to establish a direct connection to such URIs.

websocket, realtime

interoperability-note §8.3.2

When the same MSRP WebSocket Server appears twice in the To-Path (because both sender and receiver use the same relay), the server can handle this internally or loop the SEND request back to itself as if it were two separate relays.

websocket, realtime

normative-requirement §5.1 MUST

All MSRP-over-WebSocket messages MUST be routed via an MSRP WebSocket Server, since WebSocket clients cannot receive connections initiated by other WebSocket clients or servers.

websocket, realtime

normative-requirement §7 SHOULD

An MSRP WebSocket Client SHOULD support HTTP Digest authentication as stated in RFC 4976, since authentication MAY be requested at the MSRP protocol level via a 401 challenge to AUTH requests.

websocket, realtime, security

normative-requirement §5.2.2 MUST

Because all MSRP-over-WebSocket messages MUST be routed via an MSRP WebSocket Server, the MSRP WebSocket Client MUST specify "TCP/TLS/MSRP" protocols in the SDP m-line rather than a new WebSocket-specific SDP transport protocol.

websocket, realtime

normative-requirement §5.1 MUST

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

websocket, realtime

normative-requirement §7 SHOULD

If the HTTP GET request contains an Origin header, the MSRP WebSocket Server SHOULD indicate Cross-Origin Resource Sharing (CORS) by adding an Access-Control-Allow-Origin header to the 101 response.

websocket, http, security

normative-requirement §6 RECOMMENDED

It is RECOMMENDED that MSRP WebSocket Clients and Servers keep their connections open by sending periodic WebSocket Ping frames as described in RFC 6455 Section 5.5.2.

websocket, realtime

normative-requirement §5.1 MUST

MSRP traffic transported over WebSockets MUST be protected by using a Secure WebSocket (WSS) connection (using TLS over TCP).

websocket, tls, security

normative-requirement §4.2 MUST

MSRP WebSocket Clients and Servers MUST accept both text and binary WebSocket frames. The content of text frames MUST be interpreted as binary by WebSocket Clients and Servers.

websocket, realtime

normative-requirement §5.3.1 REQUIRED

The AUTH request remains a required event even when authentication occurs at the WebSocket connection level, because the "Use-Path:" header needed to create an SDP offer is returned in the 200 OK response to the AUTH request.

websocket, realtime

normative-requirement §4.1 MUST

The MSRP WebSocket Client MUST include the value "msrp" in the Sec-WebSocket-Protocol header in its handshake request, and the server's 101 reply MUST contain "msrp" in the corresponding Sec-WebSocket-Protocol header.

websocket, realtime

normative-requirement §5.3.1 MUST

This document modifies RFC 4976 to require that all connections between MSRP clients and relays MUST be authenticated, not just AUTH requests. Three mechanisms are permitted: HTTP Digest in AUTH, cookie-based or HTTP Digest in the WebSocket handshake, or mutual TLS.

websocket, realtime, security

normative-requirement §5.1 MUST

When large messages are sent by a non-WebSocket peer, MSRP chunking (per RFC 4975 Section 5.1) MUST be used by the WebSocket MSRP Server to split the message into several smaller MSRP chunks.

websocket, realtime

normative-requirement §6 MUST

When WebSocket Ping frames cannot be used, an MSRP implementation MAY use bodiless SEND requests for keepalive, and MSRP WebSocket Clients and Servers MUST be prepared to receive bodiless SEND requests.

websocket, realtime

protocol-element §2.1

An MSRP WebSocket Client is an MSRP entity capable of opening outbound connections to MSRP relays that are WebSocket servers and communicating using the WebSocket MSRP subprotocol. An MSRP WebSocket Server is an MSRP relay capable of listening for inbound connections from WebSocket clients.

websocket, realtime

protocol-element §5.2.1

This document defines the value "ws" as the transport parameter for an MSRP URI to indicate use of the MSRP WebSocket subprotocol. The updated ABNF is: transport = "tcp" / "ws" / 1*ALPHANUM.

websocket, realtime

protocol-element §5.3.1

Three authentication mechanisms are defined for MSRP WebSocket Clients connecting to a relay: (1) HTTP Digest authentication in AUTH per RFC 4976, (2) cookie-based or HTTP Digest in the WebSocket handshake, and (3) mutual TLS between the WebSocket client and server.

websocket, realtime, security

registry §10

This document registers the WebSocket MSRP subprotocol in the IANA "WebSocket Subprotocol Name Registry" with identifier "msrp", common name "WebSocket Transport for MSRP (Message Session Relay Protocol)", and definition RFC 7977.

websocket, registry, realtime

security-consideration §9 MUST

MSRP traffic transported over WebSockets MUST be protected by a secure WebSocket connection (WSS/TLS). The client MUST authenticate the server using the server's certificate according to the WebSocket validation procedure in RFC 6455.

websocket, tls, security

security-consideration §9 SHOULD NOT

Since TLS is always terminated at the MSRP WebSocket Server and the server sees the plain text, the MSRP client (e.g., a browser) SHOULD NOT indicate end-to-end security to the user.

websocket, tls, security

security-consideration §9

TLS, as used in this document, should follow the best current practices defined in RFC 7525.

tls, security