draft-ietf-hybi-permessage-compression-23.txt   draft-ietf-hybi-permessage-compression-24.txt 
HyBi Working Group T. Yoshino HyBi Working Group T. Yoshino
Internet-Draft Google, Inc. Internet-Draft Google, Inc.
Intended status: Standards Track June 24, 2015 Intended status: Standards Track June 24, 2015
Expires: December 26, 2015 Expires: December 26, 2015
Compression Extensions for WebSocket Compression Extensions for WebSocket
draft-ietf-hybi-permessage-compression-23 draft-ietf-hybi-permessage-compression-24
Abstract Abstract
This document defines a framework for creating WebSocket extensions This document defines a framework for creating WebSocket extensions
that add compression functionality to the WebSocket Protocol. An that add compression functionality to the WebSocket Protocol. An
extension based on this framework compresses the payload data portion extension based on this framework compresses the payload data portion
of WebSocket data messages on a per-message basis using parameters of WebSocket data messages on a per-message basis using parameters
negotiated during the opening handshake. This framework provides a negotiated during the opening handshake. This framework provides a
general method for applying a compression algorithm to the contents general method for applying a compression algorithm to the contents
of WebSocket messages. Each compression algorithm has to be defined of WebSocket messages. Each compression algorithm has to be defined
skipping to change at page 2, line 26 skipping to change at page 2, line 26
2. Conformance Requirements and Terminology . . . . . . . . . . . 4 2. Conformance Requirements and Terminology . . . . . . . . . . . 4
3. Complementary Terminology . . . . . . . . . . . . . . . . . . 5 3. Complementary Terminology . . . . . . . . . . . . . . . . . . 5
4. WebSocket Per-message Compression Extension . . . . . . . . . 6 4. WebSocket Per-message Compression Extension . . . . . . . . . 6
5. Extension Negotiation . . . . . . . . . . . . . . . . . . . . 7 5. Extension Negotiation . . . . . . . . . . . . . . . . . . . . 7
5.1. General Negotiation Flow . . . . . . . . . . . . . . . . . 9 5.1. General Negotiation Flow . . . . . . . . . . . . . . . . . 9
5.2. Negotiation Examples . . . . . . . . . . . . . . . . . . . 10 5.2. Negotiation Examples . . . . . . . . . . . . . . . . . . . 10
6. Framing . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 6. Framing . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
6.1. Compression . . . . . . . . . . . . . . . . . . . . . . . 12 6.1. Compression . . . . . . . . . . . . . . . . . . . . . . . 12
6.2. Decompression . . . . . . . . . . . . . . . . . . . . . . 13 6.2. Decompression . . . . . . . . . . . . . . . . . . . . . . 13
7. Intermediaries . . . . . . . . . . . . . . . . . . . . . . . . 15 7. Intermediaries . . . . . . . . . . . . . . . . . . . . . . . . 15
8. permessage-deflate extension . . . . . . . . . . . . . . . . . 16 8. The permessage-deflate extension . . . . . . . . . . . . . . . 16
8.1. Method Parameters . . . . . . . . . . . . . . . . . . . . 17 8.1. Extension Parameters . . . . . . . . . . . . . . . . . . . 17
8.1.1. Context Takeover Control . . . . . . . . . . . . . . . 17 8.1.1. Context Takeover Control . . . . . . . . . . . . . . . 17
8.1.2. Limiting the LZ77 sliding window size . . . . . . . . 19 8.1.2. Limiting the LZ77 sliding window size . . . . . . . . 19
8.1.3. Examples . . . . . . . . . . . . . . . . . . . . . . . 21 8.1.3. Examples . . . . . . . . . . . . . . . . . . . . . . . 21
8.2. Message Payload Transformation . . . . . . . . . . . . . . 22 8.2. Message Payload Transformation . . . . . . . . . . . . . . 22
8.2.1. Compression . . . . . . . . . . . . . . . . . . . . . 22 8.2.1. Compression . . . . . . . . . . . . . . . . . . . . . 22
8.2.2. Decompression . . . . . . . . . . . . . . . . . . . . 23 8.2.2. Decompression . . . . . . . . . . . . . . . . . . . . 23
8.2.3. Examples . . . . . . . . . . . . . . . . . . . . . . . 24 8.2.3. Examples . . . . . . . . . . . . . . . . . . . . . . . 24
8.3. Implementation Notes . . . . . . . . . . . . . . . . . . . 28 8.3. Implementation Notes . . . . . . . . . . . . . . . . . . . 28
8.4. Intermediaries . . . . . . . . . . . . . . . . . . . . . . 28 8.4. Intermediaries . . . . . . . . . . . . . . . . . . . . . . 28
9. Security Considerations . . . . . . . . . . . . . . . . . . . 29 9. Security Considerations . . . . . . . . . . . . . . . . . . . 29
skipping to change at page 16, line 5 skipping to change at page 16, line 5
in accordance with to the constraints of the new combination of in accordance with to the constraints of the new combination of
extensions. For example, if Per-message Compression is removed extensions. For example, if Per-message Compression is removed
from messages, the corresponding element in the from messages, the corresponding element in the
"Sec-WebSocket-Extensions" header in the opening handshake "Sec-WebSocket-Extensions" header in the opening handshake
response which enabled the Per-message Compression must also be response which enabled the Per-message Compression must also be
removed. removed.
Otherwise, the intermediary MUST NOT add, change or remove Per- Otherwise, the intermediary MUST NOT add, change or remove Per-
message Compression of proxied messages. message Compression of proxied messages.
8. permessage-deflate extension 8. The permessage-deflate extension
This section defines a specific PMCE called "permessage-deflate". It This section defines a specific PMCE called "permessage-deflate". It
compresses the payload of a message using the DEFLATE algorithm compresses the payload of a message using the DEFLATE algorithm
[RFC1951] and uses the byte boundary alignment method introduced in [RFC1951] and uses the byte boundary alignment method introduced in
[RFC1979]. [RFC1979].
This section uses the term "byte" with the same meaning as RFC1951, This section uses the term "byte" with the same meaning as RFC1951,
i.e. 8 bits stored or transmitted as a unit (same as an octet). i.e. 8 bits stored or transmitted as a unit (same as an octet).
The registered extension name for this extension is The registered extension name for this extension is
skipping to change at page 17, line 34 skipping to change at page 17, line 34
The term "LZ77 sliding window" used in this section means the buffer The term "LZ77 sliding window" used in this section means the buffer
used by the DEFLATE algorithm to store recently processed input. The used by the DEFLATE algorithm to store recently processed input. The
DEFLATE compression algorithm searches the buffer for a match with DEFLATE compression algorithm searches the buffer for a match with
the following input. the following input.
The term "use context take over" used in this section means that the The term "use context take over" used in this section means that the
same LZ77 sliding window used by the endpoint to build frames of the same LZ77 sliding window used by the endpoint to build frames of the
previous sent message is reused to build frames of the next message previous sent message is reused to build frames of the next message
to be sent. to be sent.
8.1. Method Parameters 8.1. Extension Parameters
8.1.1. Context Takeover Control 8.1.1. Context Takeover Control
8.1.1.1. server_no_context_takeover 8.1.1.1. The server_no_context_takeover extension parameter
A client MAY include the "server_no_context_takeover" extension A client MAY include the "server_no_context_takeover" extension
parameter in an extension negotiation offer. This extension parameter in an extension negotiation offer. This extension
parameter has no value. By including this extension parameter in an parameter has no value. By including this extension parameter in an
extension negotiation offer, a client prevents the peer server from extension negotiation offer, a client prevents the peer server from
using context take over. If the peer server doesn't use context take using context take over. If the peer server doesn't use context take
over, the client doesn't need to reserve memory to retain the LZ77 over, the client doesn't need to reserve memory to retain the LZ77
sliding window between messages. sliding window between messages.
Absence of this extension parameter in an extension negotiation offer Absence of this extension parameter in an extension negotiation offer
skipping to change at page 18, line 20 skipping to change at page 18, line 20
It is RECOMMENDED that a server supports the It is RECOMMENDED that a server supports the
"server_no_context_takeover" extension parameter in an extension "server_no_context_takeover" extension parameter in an extension
negotiation offer. negotiation offer.
A server MAY include the "server_no_context_takeover" extension A server MAY include the "server_no_context_takeover" extension
parameter in an extension negotiation response even if the extension parameter in an extension negotiation response even if the extension
negotiation offer being accepted by the extension negotiation negotiation offer being accepted by the extension negotiation
response didn't include the "server_no_context_takeover" extension response didn't include the "server_no_context_takeover" extension
parameter. parameter.
8.1.1.2. client_no_context_takeover 8.1.1.2. The client_no_context_takeover extension parameter
A client MAY include the "client_no_context_takeover" extension A client MAY include the "client_no_context_takeover" extension
parameter in an extension negotiation offer. This extension parameter in an extension negotiation offer. This extension
parameter has no value. By including this extension parameter in an parameter has no value. By including this extension parameter in an
extension negotiation offer, a client informs the peer server of a extension negotiation offer, a client informs the peer server of a
hint that even if the server doesn't include the hint that even if the server doesn't include the
"client_no_context_takeover" extension parameter in the corresponding "client_no_context_takeover" extension parameter in the corresponding
extension negotiation response to the offer, the client is not going extension negotiation response to the offer, the client is not going
to use context take over. to use context take over.
skipping to change at page 19, line 7 skipping to change at page 19, line 7
Absence of this extension parameter in an extension negotiation Absence of this extension parameter in an extension negotiation
response indicates that the server can decompress messages built by response indicates that the server can decompress messages built by
the client using context take over. the client using context take over.
A client MUST support the "client_no_context_takeover" extension A client MUST support the "client_no_context_takeover" extension
parameter in an extension negotiation response. parameter in an extension negotiation response.
8.1.2. Limiting the LZ77 sliding window size 8.1.2. Limiting the LZ77 sliding window size
8.1.2.1. server_max_window_bits 8.1.2.1. The server_max_window_bits extension parameter
A client MAY include the "server_max_window_bits" extension parameter A client MAY include the "server_max_window_bits" extension parameter
in an extension negotiation offer. This parameter has a decimal in an extension negotiation offer. This parameter has a decimal
integer value without leading zeroes between 8 to 15 inclusive integer value without leading zeroes between 8 to 15 inclusive
indicating the base-2 logarithm of the LZ77 sliding window size and indicating the base-2 logarithm of the LZ77 sliding window size and
MUST conform to the ABNF below. MUST conform to the ABNF below.
server_max_window_bits = 1*DIGIT server_max_window_bits = 1*DIGIT
By including this parameter in an extension negotiation offer, a By including this parameter in an extension negotiation offer, a
skipping to change at page 19, line 46 skipping to change at page 19, line 46
inclusive indicating the base-2 logarithm of the LZ77 sliding window inclusive indicating the base-2 logarithm of the LZ77 sliding window
size and MUST conform to the ABNF below. size and MUST conform to the ABNF below.
server_max_window_bits = 1*DIGIT server_max_window_bits = 1*DIGIT
A server MAY include the "server_max_window_bits" extension parameter A server MAY include the "server_max_window_bits" extension parameter
in an extension negotiation response even if the extension in an extension negotiation response even if the extension
negotiation offer being accepted by the response didn't include the negotiation offer being accepted by the response didn't include the
"server_max_window_bits" extension parameter. "server_max_window_bits" extension parameter.
8.1.2.2. client_max_window_bits 8.1.2.2. The client_max_window_bits extension parameter
A client MAY include the "client_max_window_bits" extension parameter A client MAY include the "client_max_window_bits" extension parameter
in an extension negotiation offer. This parameter has no value or a in an extension negotiation offer. This parameter has no value or a
decimal integer value without leading zeroes between 8 to 15 decimal integer value without leading zeroes between 8 to 15
inclusive indicating the base-2 logarithm of the LZ77 sliding window inclusive indicating the base-2 logarithm of the LZ77 sliding window
size. If a value is specified for this parameter, the value MUST size. If a value is specified for this parameter, the value MUST
conform to the ABNF below. conform to the ABNF below.
client_max_window_bits = 1*DIGIT client_max_window_bits = 1*DIGIT
 End of changes. 8 change blocks. 
9 lines changed or deleted 9 lines changed or added

This html diff was produced by rfcdiff 1.42. The latest version is available from http://tools.ietf.org/tools/rfcdiff/