Draft Hirano Httpbis Websocket Over http2 00
Draft Hirano Httpbis Websocket Over http2 00
Hirano
Internet-Draft Google, Inc.
Intended status: Standards Track February 14, 2014
Expires: August 18, 2014
Abstract
Copyright Notice
Copyright (c) 2014 IETF Trust and the persons identified as the
document authors. All rights reserved.
Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1. Document Organization . . . . . . . . . . . . . . . . . . 3
2. Conformance Requirements and Terminology . . . . . . . . . . . 4
3. Cross Protocol Negotiation . . . . . . . . . . . . . . . . . . 5
3.1. Supported scheme negotiation using SETTINGS frame . . . . 6
4. Opening Handshake . . . . . . . . . . . . . . . . . . . . . . 8
4.1. Handshake Request . . . . . . . . . . . . . . . . . . . . 8
4.2. Handshake Response . . . . . . . . . . . . . . . . . . . . 8
5. Data Framing . . . . . . . . . . . . . . . . . . . . . . . . . 10
5.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . . 10
5.2. Frame representation . . . . . . . . . . . . . . . . . . . 10
5.2.1. Tunneling RFC6455 framing (Plan D) . . . . . . . . . . 10
5.2.2. Tunneling RFC6455 framing with END_SEGMENT mark
(Plan A) . . . . . . . . . . . . . . . . . . . . . . . 10
5.2.3. HEADERS + DATAs (Plan C) . . . . . . . . . . . . . . . 10
5.3. Masking . . . . . . . . . . . . . . . . . . . . . . . . . 11
6. Closing the Connection . . . . . . . . . . . . . . . . . . . . 12
6.1. Definitions . . . . . . . . . . . . . . . . . . . . . . . 12
6.1.1. Close the WebSocket Connection . . . . . . . . . . . . 12
6.1.2. Start the WebSocket Closing Handshake . . . . . . . . 12
6.1.3. The WebSocket Closing Handshake is Started . . . . . . 12
6.1.4. The WebSocket Connection is Closed . . . . . . . . . . 12
6.1.5. The WebSocket Connection Close Code . . . . . . . . . 12
6.1.6. The WebSocket Connection Close Reason . . . . . . . . 12
6.1.7. Fail the WebSocket Connection . . . . . . . . . . . . 13
6.2. Abnormal Closures . . . . . . . . . . . . . . . . . . . . 13
6.2.1. Client-Initiated Closure . . . . . . . . . . . . . . . 13
6.2.2. Server-initiated closure . . . . . . . . . . . . . . . 13
6.2.3. Recovering from Abnormal Closure . . . . . . . . . . . 13
6.3. Normal Closure of Connections . . . . . . . . . . . . . . 13
6.4. Status Codes . . . . . . . . . . . . . . . . . . . . . . . 13
7. Security Considerations . . . . . . . . . . . . . . . . . . . 14
8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 15
9. References . . . . . . . . . . . . . . . . . . . . . . . . . . 16
9.1. Normative References . . . . . . . . . . . . . . . . . . . 16
9.2. Informative References . . . . . . . . . . . . . . . . . . 16
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 17
Internet-Draft WebSocket over HTTP/2.0 February 2014
1. Introduction
For the HTTP/1.1, there has been effort to multiplex HTTP traffic
into one TCP connection called HTTP/2.0. The HTTP/2.0 defines a
general multiplexed transport on which not only HTTP but other
messaging application protocol may be layered onto. We can address
the scalability issue of WebSocket by using HTTP/2.0 framing's
multiplexing functionality.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in [RFC2119].
"Frame" has two meanings, WebSocket frame and HTTP/2.0 frame. When
it is obvious "WebSocket" and "HTTP/2.0" can be omitted. For
example, "DATA frame" means "HTTP/2.0 DATA frame" and "Close frame"
means "WebSocket Close frame".
Internet-Draft WebSocket over HTTP/2.0 February 2014
If the server does not support ALPN, the client SHOULD establish
a TLS connection and start a native WebSocket opening handshake.
If the server returns "no_application_protocol" alert, the client
MUST _Fail the WebSocket connection_. If the server selects
"HTTP/1.1[wss]" protocol, the client SHOULD establish a TLS
connection and start a native WebSocket opening handshake. If
the server selects "HTTP/2.0[wss]" protocol, the client SHOULD
create an HTTP/2.0 connection, create an HTTP/2.0 stream on it
and start the WebSocket opening handshake on the stream with the
"wss" scheme.
EXAMPLE:
Internet-Draft WebSocket over HTTP/2.0 February 2014
bit 0: http
bit 1: https
bit 2: ws
bit 3: wss
4. Opening Handshake
has not completed and that the semantics of HTTP still apply. The
client MAY send some data to the server before receiving the
successful response. The server MUST ignore this data when opening
handshake fails. After sending successful response, the server can
send arbitrary data frames at any time. The response status line is
unfolded into name/value pairs like other WebSocket handshake headers
and MUST be present: ":status" - The WebSocket or fallback HTTP
response status code (e.g. "101" or "101 Switching Protocols". See
[RFC6455]). In addition, the following OPTIONAL name/value pairs MAY
be present:
5. Data Framing
5.1. Overview
The HEADERS frame MUST contain this field with the hexadecimal
text representation of the payload length represented by
"Payload len" WebSocket header field and "Extended payload
length" WebSocket header field" if present, without leading
zeros.
5.3. Masking
6.1. Definitions
7. Security Considerations
8. IANA Considerations
9. References
[HTTP/2.0 draft]
Belshe, M., Peon, R., Thomson, M., and A. Melnikov,
"Hypertext Transfer Protocol version 2.0", September 2012.
[ALPN draft]
Friedl, S., Popov, A., Langley, A., and E. Stephan,
"Transport Layer Security (TLS) Application Layer Protocol
Negotiation Extension", January 2014.
Author's Address
Yutaka Hirano
Google, Inc.
Email: [email protected]