5.1 Use of WebSocket

This binding makes use of the WebSocket protocol IETF RFC 6455 [1] to transport serialized representations of oneM2M request and response primitives over the Mca or Mcc reference points.

Establishment of a WebSocket connection shall be initiated by a WebSocket client by sending a handshake to a WebSocket server as specified in section 4 of IETF RFC 6455 [1]. Once the WebSocket connection is established, both oneM2M request and response primitives can be exchanged bi-directionally between the two endpoints of the connection. Serialized representations of the request and response primitives shall be mapped in the Payload Data field of the WebSocket base framing protocol, as defined in section 5.2 of IETF RFC 6455 [1].

A WebSocket connection employs either a TCP/IP or a TLS over TCP/IP connection. The underlying TCP and TLS connections are established prior to sending the WebSocket client handshake as the first step (see example in Annex A).