draft-ietf-hybi-permessage-compression-19.txt   draft-ietf-hybi-permessage-compression-20.txt 
HyBi Working Group T. Yoshino HyBi Working Group T. Yoshino
Internet-Draft Google, Inc. Internet-Draft Google, Inc.
Intended status: Standards Track November 12, 2014 Intended status: Standards Track March 24, 2015
Expires: May 16, 2015 Expires: September 25, 2015
Compression Extensions for WebSocket Compression Extensions for WebSocket
draft-ietf-hybi-permessage-compression-19 draft-ietf-hybi-permessage-compression-20
Abstract Abstract
This document specifies 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 non-control WebSocket messages on a per-message basis using of WebSocket data messages on a per-message basis using parameters
parameters negotiated during the opening handshake. This framework negotiated during the opening handshake. This framework provides a
provides a general method to apply a compression algorithm to the general method for applying a compression algorithm to the contents
contents of WebSocket messages. For each compression algorithm, an of WebSocket messages. Each compression algorithm has to be defined
extension is defined by specifying parameter negotiation and payload in a document defining the extension by specifying parameter
transformation algorithm in detail. This document also specifies one negotiation and payload transformation algorithm in detail. This
specific compression extension using the DEFLATE algorithm. document also specifies one specific compression extension using the
DEFLATE algorithm.
Please send feedback to the hybi@ietf.org mailing list. Please send feedback to the hybi@ietf.org mailing list.
Status of this Memo Status of this Memo
This Internet-Draft is submitted to IETF in full conformance with the This Internet-Draft is submitted to IETF in full conformance with the
provisions of BCP 78 and BCP 79. provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current. Drafts is at http://datatracker.ietf.org/drafts/current.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on May 16, 2015. This Internet-Draft will expire on September 25, 2015.
Copyright Notice Copyright Notice
Copyright (c) 2014 IETF Trust and the persons identified as the Copyright (c) 2015 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of (http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3
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. Negotiation Examples . . . . . . . . . . . . . . . . . . . 9 5.1. General Negotiation Flow . . . . . . . . . . . . . . . . . 9
6. Framing . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 5.2. Negotiation Examples . . . . . . . . . . . . . . . . . . . 10
6.1. Compression . . . . . . . . . . . . . . . . . . . . . . . 11 6. Framing . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
6.2. Decompression . . . . . . . . . . . . . . . . . . . . . . 12 6.1. Compression . . . . . . . . . . . . . . . . . . . . . . . 12
7. Intermediaries . . . . . . . . . . . . . . . . . . . . . . . . 14 6.2. Decompression . . . . . . . . . . . . . . . . . . . . . . 13
8. permessage-deflate extension . . . . . . . . . . . . . . . . . 15 7. Intermediaries . . . . . . . . . . . . . . . . . . . . . . . . 15
8.1. Method Parameters . . . . . . . . . . . . . . . . . . . . 16 8. permessage-deflate extension . . . . . . . . . . . . . . . . . 16
8.1.1. Context Takeover Control . . . . . . . . . . . . . . . 16 8.1. Method Parameters . . . . . . . . . . . . . . . . . . . . 17
8.1.2. Limiting the LZ77 sliding window size . . . . . . . . 18 8.1.1. Context Takeover Control . . . . . . . . . . . . . . . 17
8.1.3. Example . . . . . . . . . . . . . . . . . . . . . . . 20 8.1.2. Limiting the LZ77 sliding window size . . . . . . . . 19
8.2. Message Payload Transformation . . . . . . . . . . . . . . 21 8.1.3. Examples . . . . . . . . . . . . . . . . . . . . . . . 21
8.2.1. Compression . . . . . . . . . . . . . . . . . . . . . 21 8.2. Message Payload Transformation . . . . . . . . . . . . . . 22
8.2.2. Decompression . . . . . . . . . . . . . . . . . . . . 22 8.2.1. Compression . . . . . . . . . . . . . . . . . . . . . 22
8.2.3. Examples . . . . . . . . . . . . . . . . . . . . . . . 23 8.2.2. Decompression . . . . . . . . . . . . . . . . . . . . 23
8.3. Implementation Notes . . . . . . . . . . . . . . . . . . . 26 8.2.3. Examples . . . . . . . . . . . . . . . . . . . . . . . 24
8.4. Intermediaries . . . . . . . . . . . . . . . . . . . . . . 27 8.3. Implementation Notes . . . . . . . . . . . . . . . . . . . 28
9. Security Considerations . . . . . . . . . . . . . . . . . . . 28 8.4. Intermediaries . . . . . . . . . . . . . . . . . . . . . . 28
10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 29 9. Security Considerations . . . . . . . . . . . . . . . . . . . 29
10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 30
10.1. Registration of the "permessage-deflate" WebSocket 10.1. Registration of the "permessage-deflate" WebSocket
Extension Name . . . . . . . . . . . . . . . . . . . . . . 29 Extension Name . . . . . . . . . . . . . . . . . . . . . . 30
10.2. Registration of the "Per-message Compressed" WebSocket 10.2. Registration of the "Per-message Compressed" WebSocket
Framing Header Bit . . . . . . . . . . . . . . . . . . . . 29 Framing Header Bit . . . . . . . . . . . . . . . . . . . . 30
11. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 30 11. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 31
12. References . . . . . . . . . . . . . . . . . . . . . . . . . . 31 12. References . . . . . . . . . . . . . . . . . . . . . . . . . . 32
12.1. Normative References . . . . . . . . . . . . . . . . . . . 31 12.1. Normative References . . . . . . . . . . . . . . . . . . . 32
12.2. Informative References . . . . . . . . . . . . . . . . . . 31 12.2. Informative References . . . . . . . . . . . . . . . . . . 32
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 32 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 33
1. Introduction 1. Introduction
This document specifies a framework to add compression functionality This document specifies a framework for adding compression
to the WebSocket Protocol [RFC6455]. This framework specifies how to functionality to the WebSocket Protocol [RFC6455]. The framework
define WebSocket Per-message Compression Extensions (PMCEs) specifies how to define WebSocket Per-message Compression Extensions
individually for various compression algorithms based on the (PMCEs) for a compression algorithm based on the extension concept of
extension concept of the WebSocket Protocol specified in Section 9 of the WebSocket Protocol specified in Section 9 of [RFC6455]. A
[RFC6455]. A WebSocket client and a peer WebSocket server negotiate WebSocket client and a peer WebSocket server negotiate the use of a
use of a PMCE and determine parameters to configure the compression PMCE and determine the parameters required to configure the
algorithm during the WebSocket opening handshake. The client and compression algorithm during the WebSocket opening handshake. The
server can then exchange non-control messages using frames with client and server can then exchange data messages whose frames
compressed data in the payload data portion. contain compressed data in the payload data portion.
This framework only specifies a general method to apply a compression This framework only specifies a general method for applying a
algorithm to the contents of WebSocket messages. A document compression algorithm to the contents of WebSocket messages. Each
specifying an individual PMCE describes how to negotiate individual PMCE has to be specified in a document describing in
configuration parameters for the compression algorithm and how to detail how to negotiate the configuration parameters for the specific
transform (compress and decompress) data in the payload data portion compression algorithm used by that PMCE and how to transform
in detail. (compress and decompress) data in the payload data portion.
A WebSocket client may offer multiple PMCEs during the WebSocket A WebSocket client may offer multiple PMCEs during the WebSocket
opening handshake. A peer WebSocket server received those offers may opening handshake. A peer WebSocket server receiving the offer may
choose and accept preferred one or decline all of them. PMCEs use choose to accept the preferred PMCE or decline all of them. PMCEs
the RSV1 bit of the WebSocket frame header to indicate whether a use the RSV1 bit of the WebSocket frame header to indicate whether a
message is compressed or not, so that an endpoint can choose not to message is compressed or not, so that an endpoint can choose not to
compress messages with incompressible contents. compress messages with incompressible contents.
This document also specifies one specific PMCE based on the DEFLATE This document also specifies one specific PMCE based on the DEFLATE
[RFC1951] algorithm. The extension name of the PMCE is "permessage- [RFC1951] algorithm. The DEFLATE algorithm is widely available on
deflate". We chose DEFLATE since it's widely available as a library various platforms and its overhead is small. The extension name of
on various platforms and the overhead is small. To align the end of this PMCE is "permessage-deflate". To align the end of compressed
compressed data to an octet boundary, this extension uses the data to an octet boundary, this extension uses the algorithm
algorithm described in Section 2.1 of [RFC1979]. Endpoints can take described in Section 2.1 of [RFC1979]. Endpoints can take over the
over the LZ77 sliding window [LZ77] used to build frames for previous LZ77 sliding window [LZ77] used to build frames for previous messages
messages to get better compression ratio. For resource-limited to achieve a better compression ratio. For resource-limited devices,
devices, this extension provides parameters to limit memory usage for this extension provides parameters to limit memory usage for
compression context. compression context.
2. Conformance Requirements and Terminology 2. Conformance Requirements and Terminology
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in [RFC2119]. document are to be interpreted as described in [RFC2119].
Requirements phrased in the imperative as part of algorithms (such as Requirements phrased in the imperative as part of algorithms (such as
"strip any leading space characters" or "return false and abort these "strip any leading space characters" or "return false and abort these
skipping to change at page 5, line 8 skipping to change at page 5, line 8
Received_. These events are defined in Section 4.1 and Section 6.2, Received_. These events are defined in Section 4.1 and Section 6.2,
respectively, of [RFC6455]. respectively, of [RFC6455].
This document uses the Augmented Backus-Naur Form (ABNF) notation of This document uses the Augmented Backus-Naur Form (ABNF) notation of
[RFC5234]. The DIGIT (decimal 0-9) rule is included by reference, as [RFC5234]. The DIGIT (decimal 0-9) rule is included by reference, as
defined in the Appendix B.1 of [RFC5234]. defined in the Appendix B.1 of [RFC5234].
3. Complementary Terminology 3. Complementary Terminology
This document defines some terms about WebSocket and WebSocket This document defines some terms about WebSocket and WebSocket
Extension mechanism that are underspecified or not defined at all in Extension mechanisms that are underspecified or not defined at all in
[RFC6455]. This terminology is effective only in this document and [RFC6455]. This terminology is effective only in this document and
any other documents that refer to this section. any other documents explicitly referring to this section.
"A non-control message" means a message that consists of non-control "A data message" means a message consisting of Data Frames as defined
frames as defined in Section 5.6 of [RFC6455]. in Section 5.6 of [RFC6455].
"A message payload (or payload of a message)" means concatenation of "A message payload (or payload of a message)" means the concatenation
the payload data portion of all frames representing a single message, of the payload data portion of all Data Frames (see Section 6.2 of
as well as how /data/ is formed from in Section 6.2 of [RFC6455]. [RFC6455]) representing a single message.
"An extension in use next to extension X" means the extension listed "An extension in use next to extension X" means the extension listed
next to X in the "Sec-WebSocket-Extensions" header in the server's next to X in the "Sec-WebSocket-Extensions" header in the server's
opening handshake as defined in Section 9.1 of [RFC6455]. Such an opening handshake as defined in Section 9.1 of [RFC6455]. Such an
extension is applied to outgoing data from the application right extension is applied to outgoing data from the application right
after X on sender side but applied right before X to incoming data after X on the sender side, but applied right before X to incoming
from the underlying transport. data from the underlying transport.
"An extension in use preceding extension X" means the extension "An extension in use preceding extension X" means the extension
listed right before X in the "Sec-WebSocket-Extensions" header in the listed right before X in the "Sec-WebSocket-Extensions" header in the
server's opening handshake. Such an extension is applied to outgoing server's opening handshake. Such an extension is applied to outgoing
data from the application right before X on sender side but applied data from the application right before X on the sender side, but
right after X to incoming data from the underlying transport. applied right after X to incoming data from the underlying transport.
"An extension negotiation offer" means each element in the "An extension negotiation offer" means each element in the
"Sec-WebSocket-Extensions" header in the client's opening handshake. "Sec-WebSocket-Extensions" header in the client's opening handshake.
"An extension negotiation response" means each element in the "An extension negotiation response" means each element in the
"Sec-WebSocket-Extensions" header in the server's opening handshake. "Sec-WebSocket-Extensions" header in the server's opening handshake.
"A corresponding extension negotiation response for an extension "A corresponding extension negotiation response for an extension
negotiation offer" means an extension negotiation response a server negotiation offer" means an extension negotiation response that a
sends back to the peer client that contains the same extension name server sends back to the peer client containing the same extension
as the offer and meets the requirements represented by the offer. name as the offer and meeting the requirements represented by the
offer.
"Accepting an extension negotiation offer" means including a "Accepting an extension negotiation offer" means including a
corresponding extension negotiation response for the offer in the corresponding extension negotiation response for the offer in the
"Sec-WebSocket-Extensions" header in the server's opening handshake. "Sec-WebSocket-Extensions" header in the server's opening handshake.
"Declining an extension negotiation offer" means not including a "Declining an extension negotiation offer" means not including a
corresponding extension negotiation response for the offer in the corresponding extension negotiation response for the offer in the
"Sec-WebSocket-Extensions" header in the server's opening handshake. "Sec-WebSocket-Extensions" header in the server's opening handshake.
4. WebSocket Per-message Compression Extension 4. WebSocket Per-message Compression Extension
WebSocket Per-message Compression Extensions (PMCEs) are extensions WebSocket Per-message Compression Extensions (PMCEs) are extensions
to the WebSocket Protocol enabling compression functionality. PMCEs to the WebSocket Protocol enabling compression functionality. PMCEs
are built based on the extension concept of the WebSocket Protocol are built based on the extension concept of the WebSocket Protocol
specified in Section 9 of [RFC6455]. PMCEs are individually defined specified in Section 9 of [RFC6455]. PMCEs are individually defined
for each compression algorithm to be implemented, and are registered for each compression algorithm to be implemented, and are registered
in the WebSocket Extension Name Registry created in Section 11.4 of in the WebSocket Extension Name Registry created in Section 11.4 of
[RFC6455]. Each PMCE refers to this framework and defines the [RFC6455]. Each PMCE referring to this framework MUST define the
following: following:
o The contents of its extension negotiation offer/response to o The extension name of the PMCE and any applicable extension
include in the "Sec-WebSocket-Extensions" header. The contents parameters that MUST be included in the "Sec-WebSocket-Extensions"
include the extension name of the PMCE and any applicable header during the extension negotiation offer/response.
extension parameters.
o How to interpret the extension parameters exchanged during the o How to interpret the extension parameters exchanged during the
opening handshake opening handshake.
o How to transform the payload of a message. o How to transform the payload of a message.
One such extension is defined in Section 8 of this document and is One PMCE extension is defined in Section 8 of this document and is
registered in Section 10. Other PMCEs may be defined in other registered in Section 10. Other PMCEs may be defined in the future
documents. in other documents.
Section 5 describes the basic extension negotiation process. Section 5 describes the basic extension negotiation process.
Section 6 describes how to apply the compression algorithm with Section 6 describes how to apply the compression algorithm with
negotiated parameters to the contents of WebSocket messages. negotiated parameters to the contents of WebSocket messages.
5. Extension Negotiation 5. Extension Negotiation
To offer use of a PMCE, a client includes a To offer use of a PMCE, a client MUST include the extension name of
"Sec-WebSocket-Extensions" header element with the extension name of the PMCE in the "Sec-WebSocket-Extensions" header field of its
the PMCE in the "Sec-WebSocket-Extensions" header in the client's
opening handshake of the WebSocket connection. Extension parameters opening handshake of the WebSocket connection. Extension parameters
in the element represent the PMCE offer in detail. For example, a are used to specify the PMCE offer in detail. For example, a client
client lists preferred configuration parameter values for the lists its preferred configuration parameter values for the
compression algorithm of the PMCE. A client offers multiple PMCE compression algorithm of the PMCE. A client may also offer multiple
choices to the server by including multiple elements in the PMCE choices to the server by including multiple elements in the
"Sec-WebSocket-Extensions" header, one for each PMCE offered. The "Sec-WebSocket-Extensions" header, one for each PMCE offered. This
set of elements MAY include multiple PMCEs with the same extension set of elements MAY include multiple PMCEs with the same extension
name to offer use of the same algorithm with different configuration name to offer the possibility to use the same algorithm with
parameters. The order of elements means the client's preference. An different configuration parameters. The order of elements is
element precedes another element has higher preference. It is important as it specifies the client's preference. An element
RECOMMENDED that a server accepts PMCEs with higher preference if the preceding another element has higher preference. It is recommended
server supports it. that a server accepts PMCEs with higher preference if the server
supports them.
A PMCE negotiation offer provides requests and/or hints to the
server.
A PMCE negotiation offer informs requests and/or hints to the server.
A request in a PMCE negotiation offer indicates constraints on the A request in a PMCE negotiation offer indicates constraints on the
server's behavior that must be satisfied if the server accepts the server's behavior that must be satisfied if the server accepts the
offer. A hint in a PMCE negotiation offer indicates information offer. For example, suppose that a server sends data compressed with
about the client's behavior that the server may either safely ignore the DEFLATE algorithm to a client. The server must keep the original
or refer to when the server decides its behavior. bytes of data that it recently compressed and sent to the client.
The client must keep the result of decompressing the bytes of data
that it recently received from the server. The amount of bytes of
data kept is called the LZ77 window size. The LZ77 window size of
the client must not be less than the LZ77 window size of the server.
In a PMCE negotiation offer, the client must inform the server of its
LZ77 window size so that the server uses an LZ77 window size that is
not greater than the LZ77 window size of the client. This
restriction on the LZ77 window size is an example of a request in a
PMCE negotiation offer.
To accept use of an offered PMCE, a server includes a A hint in a PMCE negotiation offer provides information about the
"Sec-WebSocket-Extensions" header element with the extension name of client's behavior that the server may either safely ignore or refer
the PMCE in the "Sec-WebSocket-Extensions" header in the server's to when the server decides its behavior. For example, suppose that a
opening handshake of the WebSocket connection. Extension parameters client sends data compressed with the DEFLATE algorithm to a server.
in the element represent the configuration parameters of the PMCE to The client must keep the original bytes of data that it recently
use in detail. We call these extension parameters and their values compressed and sent to the server. The server must keep the result
"agreed parameters". The element MUST represent a PMCE that is fully of decompressing the bytes of data that it recently received from the
supported by the server. The contents of the element doesn't need to client. The LZ77 window size of the server must not be less than the
be exactly the same as one of the received extension negotiation LZ77 window size of the client. In a PMCE negotiation offer, the
offers. For example, an extension negotiation offer with an client may inform the maximum LZ77 window size the client can afford
extension parameter "X" indicating availability of the feature X may so that the server can choose to use an LZ77 window size that is
be accepted with an element without the extension parameter meaning greater than the maximum size of the client. This information is an
that the server declined use of the feature. example of a hint in a PMCE negotiation offer. It's waste of memory
to use an LZ77 window size greater than the LZ77 window size the
client actually uses. Using the hint, the server can avoid the waste
of memory. Since the hint itself doesn't specify the constraints on
the endpoints, the server must use the "agreed parameters" (defined
below) to explicitly ask the client not to use an LZ77 window size
greater than the LZ77 window size of the server.
To accept the use of an offered PMCE, a server MUST include the
extension name of the PMCE in the "Sec-WebSocket-Extensions" header
field of its opening handshake of the WebSocket connection.
Extension parameters represent the detailed configuration parameters
of the PMCE to use. These extension parameters and their values are
called "agreed parameters". The element MUST represent a PMCE that
is fully supported by the server. The contents of the element don't
need to be exactly the same as those of the received extension
negotiation offers. For example, suppose that a server received a
PMCE extension negotiation offer with an extension parameter "X"
indicating that the client can enable an optional feature named X.
The server may accept the PMCE offer with an element without the
extension parameter "X" meaning that the server chose not to enable
the feature X. In this case, the offer contains the extension
parameter "X" but the "agreed parameters" don't contain the extension
parameter "X".
"Agreed parameters" MUST represent how the requests and hints in the "Agreed parameters" MUST represent how the requests and hints in the
client's extension negotiation offer have been handled in addition to client's extension negotiation offer have been handled in addition to
the server's requests and hints on the client's behavior, so that the the server's requests and hints on the client's behavior, so that the
client can configure its behavior without identifying which PMCE client can configure its behavior without identifying exactly which
extension negotiation offer has been accepted. PMCE extension negotiation offer has been accepted.
For example, if a client sends an extension negotiation offer For example, if a client sends an extension negotiation offer that
including a parameter "enable_compression" and another without the includes a parameter "enable_compression" and another without this
parameter, the server accepts the former and tell that to the client parameter, the server accepts the former and informs the client by
by sending back an element including a parameter that acknowledges sending back an element that includes parameter(s) acknowledging
"enable_compression". The name of the acknowledging parameter "enable_compression". The name of the acknowledging parameter
doesn't need to be the same as the offer. doesn't need to be exactly the same as the offer. For example, two
parameters "enable_strong_compression" and "enable_weak_compression"
General negotiation flow will be like the following. How to handle may be defined as acknowledging parameters for "enable_compression".
parameters in detail will be specified in the specifications for each
PMCE.
A client makes an offer including parameters identifying the
following:
o Hints about how the client is planning to compress data
o Requests about how the server compresses data
o Limitation of the client's compression functionality
The peer server makes a determination of its behavior based on these
parameters if it can and wants to proceed with this PMCE enabled, and
responds to the client with parameters identifying the following:
o Requests about how the client compresses data
o How the server will compress data
The client makes a determination of its behavior based on these
parameters from the server if it can and wants to proceed with this
PMCE enabled. Otherwise, the client starts closing handshake with
close code 1010.
There can be compression features that can be applied separately for Compression features can be applied differently for each direction.
each direction. For such features, the acknowledging parameter and For such features, the acknowledging parameter and the parameter in
the parameter for the reverse direction must be chosen to be the reverse direction must be chosen to distinguish them. For
distinguishable from each other. For example, we can add "server_" example, in order to make parameters distinguishable, a "server_"
prefix to parameters affecting data sent from a server and "client_" prefix can be added to parameters affecting data sent from a server
prefix to ones affecting data sent from a client to make them and a "client_" prefix can be added to parameters affecting data sent
distinguishable. from a client.
A server MUST NOT accept a PMCE extension negotiation offer together A server MUST NOT accept a PMCE extension negotiation offer together
with another extension if the PMCE will conflict with the extension with another extension if the PMCE will conflict with the extension
on use of the RSV1 bit. A client that received a response accepting on their use of the RSV1 bit. A client that received a response
a PMCE extension negotiation offer together with such an extension accepting a PMCE extension negotiation offer together with such an
MUST _Fail the WebSocket Connection_. extension MUST _Fail the WebSocket Connection_.
A server MUST NOT accept a PMCE extension negotiation offer together A server MUST NOT accept a PMCE extension negotiation offer together
with another extension if the PMCE will be applied to output of the with another extension if the PMCE will be applied to the output of
extension and any of the following conditions applies to the the extension and any of the following conditions applies to the
extension: extension:
o The extension requires boundary of fragments to be preserved o The extension requires the boundary of frames to be preserved
between output from the extension at the sender and input to the between the output from the extension at the sender and the input
extension at the receiver. to the extension at the receiver.
o The extension uses the "Extension data" field or any of the o The extension uses the "Extension data" field or any of the
reserved bits on the WebSocket header as a per-frame attribute. reserved bits on the WebSocket header as a per-frame attribute.
A client that received a response accepting a PMCE extension A client that receives a response accepting a PMCE extension
negotiation offer together with such an extension MUST _Fail the negotiation offer together with such an extension MUST _Fail the
WebSocket Connection_. WebSocket Connection_.
A server declines all offered PMCEs by not including any element with A server declining all offered PMCEs MUST not include any element
PMCE names. If a server responds with no PMCE element in the with PMCE names. If a server responds with no PMCE element in the
"Sec-WebSocket-Extensions" header, both endpoints proceed without "Sec-WebSocket-Extensions" header, both endpoints proceed without
Per-message Compression once _the WebSocket Connection is Per-message Compression once _the WebSocket Connection is
established_. established_.
If a server gives an invalid response, such as accepting a PMCE that If a server gives an invalid response, such as accepting a PMCE that
the client did not offer, the client MUST _Fail the WebSocket the client did not offer, the client MUST _Fail the WebSocket
Connection_. Connection_.
If a server responds with a valid PMCE element in the If a server responds with a valid PMCE element in the
"Sec-WebSocket-Extensions" header and _the WebSocket Connection is "Sec-WebSocket-Extensions" header and _the WebSocket Connection is
established_, both endpoints MUST use the algorithm described in established_, both endpoints MUST use the algorithm described in
Section 6 and the message payload transformation (compressing and Section 6 and the message payload transformation (compressing and
decompressing) procedure of the PMCE configured with the "agreed decompressing) procedure of the PMCE configured with the "agreed
parameters" returned by the server to exchange messages. parameters" returned by the server to exchange messages.
5.1. Negotiation Examples 5.1. General Negotiation Flow
This section describes a general negotiation flow. How to handle
parameters in detail must be specified in the document specifying the
PMCE.
A client makes an offer including parameters identifying the
following:
o Hints about how the client is planning to compress data
o Requests about how the server compresses data
o Limitations concerning the client's compression functionality
The peer server makes a determination of its behavior based on these
parameters. If the server can and wants to proceed with this PMCE
enabled, the server responds to the client with parameters
identifying the following:
o Requests about how the client compresses data
o How the server will compress data
Based on these parameters received from the server, the client
determines its behavior and if it can and wants to proceed with this
PMCE enabled. Otherwise, the client starts closing handshake with
close code 1010.
5.2. Negotiation Examples
The following are example values for the "Sec-WebSocket-Extensions" The following are example values for the "Sec-WebSocket-Extensions"
header offering PMCEs. permessage-foo and permessage-bar in the header offering PMCEs. permessage-foo and permessage-bar in the
examples are hypothetical extension names of PMCEs for compression examples are hypothetical extension names of PMCEs for compression
algorithm foo and bar. algorithm foo and bar.
o Offer the permessage-foo. o Offer the permessage-foo.
permessage-foo permessage-foo
skipping to change at page 11, line 7 skipping to change at page 12, line 7
permessage-foo, permessage-bar permessage-foo, permessage-bar
o Offer the permessage-foo with a parameter use_y which enables a o Offer the permessage-foo with a parameter use_y which enables a
feature y as first choice, and the permessage-foo without the feature y as first choice, and the permessage-foo without the
use_y parameter as a fallback plan. use_y parameter as a fallback plan.
permessage-foo; use_y, permessage-foo permessage-foo; use_y, permessage-foo
6. Framing 6. Framing
PMCEs operate only on non-control messages. PMCEs operate only on data messages.
This document allocates the RSV1 bit of the WebSocket header for This document allocates the RSV1 bit of the WebSocket header for
PMCEs, and calls the bit the "Per-message Compressed" bit. On a PMCEs, and calls the bit the "Per-message Compressed" bit. On a
WebSocket connection where a PMCE is in use, this bit indicates WebSocket connection where a PMCE is in use, this bit indicates
whether a message is compressed or not. whether a message is compressed or not.
A message with the "Per-message Compressed" bit set on the first A message with the "Per-message Compressed" bit set on the first
fragment of the message is called a "compressed message". Frames of fragment of the message is called a "compressed message". Frames of
a compressed message have compressed data in the payload data a compressed message have compressed data in the payload data
portion. An endpoint received a compressed message decompresses the portion. An endpoint receiving a compressed message decompresses the
concatenation of the compressed data of the frames of the message by concatenation of the compressed data of the frames of the message by
following the decompression procedure specified by the PMCE in use. following the decompression procedure specified by the PMCE in use.
The endpoint uses the bytes corresponding to the application data The endpoint uses the bytes corresponding to the application data
portion in this decompressed data for the _A WebSocket Message Has portion in this decompressed data for the _A WebSocket Message Has
Been Received_ event instead of the received data as-is. Been Received_ event instead of the received data as-is.
A message with the "Per-message Compressed" bit unset on the first A message with the "Per-message Compressed" bit unset on the first
fragment of the message is called an "uncompressed message". Frames fragment of the message is called an "uncompressed message". Frames
of an uncompressed message have uncompressed original data as-is in of an uncompressed message have uncompressed original data as-is in
the payload data portion. An endpoint received an uncompressed the payload data portion. An endpoint receiving an uncompressed
message uses the concatenation of the application data portion of the message uses the concatenation of the application data portion of the
frames of the message as-is for the _A WebSocket Message Has Been frames of the message as-is for the _A WebSocket Message Has Been
Received_ event. Received_ event.
6.1. Compression 6.1. Compression
An endpoint MUST use the following algorithm to send a message in the An endpoint MUST use the following algorithm to send a message in the
form of a compressed message. form of a compressed message.
1. Compress the message payload of the original message by following 1. Compress the message payload of the original message by following
the compression procedure of the PMCE. The original message may the compression procedure of the PMCE. The original message may
be input from the application layer or output of another be input from the application layer or output of another
WebSocket extension depending on what extensions were negotiated. WebSocket extension depending on which extensions were
negotiated.
2. If this PMCE is the last extension to process outgoing messages, 2. If this PMCE is the last extension to process of outgoing
build frame(s) by using the compressed data instead of the messages, build frame(s) by using the compressed data instead of
original data for the message payload, and setting the the original data for the message payload, and set the
"Per-message Compressed" bit of the first frame, then send the "Per-message Compressed" bit of the first frame, then send the
frame(s) as described in Section 6.1 of RFC6455. Otherwise, pass frame(s) as described in Section 6.1 of RFC6455. Otherwise, pass
the transformed message payload and modified header values the transformed message payload and modified header values
including "Per-message Compressed" bit value set to 1 to the including the "Per-message Compressed" bit value set to 1 to the
extension next to the PMCE. If the extension expects frames for extension next to the PMCE. If the extension expects frames for
input, build a frame for the message and pass it. input, build a frame for the message and pass it.
An endpoint MUST use the following algorithm to send a message in the An endpoint MUST use the following algorithm to send a message in the
form of an uncompressed message. If this PMCE is the last extension form of an uncompressed message. If this PMCE is the last extension
to process outgoing messages, build frame(s) by using the original to process of outgoing messages, build frame(s) by using the original
data for the payload data portion as-is and unsetting the data for the payload data portion as-is and unset the "Per-message
"Per-message Compressed" bit of the first frame, then send the Compressed" bit of the first frame, then send the frame(s) as
frame(s) as described in Section 6.1 of RFC6455. Otherwise, pass the described in Section 6.1 of RFC6455. Otherwise, pass the message
message payload and header values to the extension next to the PMCE payload and header values to the extension next to the PMCE as-is.
as-is. If the extension expects frames for input, build a frame for If the extension expects frames for input, build a frame for the
the message and pass it. message and pass it.
An endpoint MUST NOT set the "Per-message Compressed" bit of control An endpoint MUST NOT set the "Per-message Compressed" bit of control
frames and non-first fragments of a data message. An endpoint frames and non-first fragments of a data message. An endpoint
received such a frame MUST _Fail the WebSocket Connection_. receiving such a frame MUST _Fail the WebSocket Connection_.
PMCEs don't change the opcode field. The opcode of the first frame PMCEs do not change the opcode field. The opcode of the first frame
of a compress message indicates the opcode of the original message. of a compressed message indicates the opcode of the original message.
The payload data portion in frames generated by a PMCE is not subject The payload data portion in frames generated by a PMCE is not subject
to the constraints for the original data type. For example, the to the constraints for the original data type. For example, the
concatenation of the output data corresponding to the application concatenation of the output data corresponding to the application
data portion of frames of a compressed text message is not required data portion of frames of a compressed text message is not required
to be valid UTF-8. At the receiver, the payload data portion after to be valid UTF-8. At the receiver, the payload data portion after
decompression is subject to the constraints for the original data decompression is subject to the constraints for the original data
type again. type again.
6.2. Decompression 6.2. Decompression
An endpoint MUST use the following algorithm to receive a message in An endpoint MUST use the following algorithm to receive a message in
the form of a compressed message. the form of a compressed message.
1. Concatenate the payload data portion of the received frames of 1. Concatenate the payload data portion of the received frames of
the compressed message. The received frames may be direct input the compressed message. The received frames may be direct input
from the underlying transport or output of another WebSocket from the underlying transport or output of another WebSocket
extension depending on what extensions were negotiated. extension depending on which extensions were negotiated.
2. Decompress the concatenation by following the decompression 2. Decompress the concatenation by following the decompression
procedure of the PMCE. procedure of the PMCE.
3. If this is the last extension to process incoming messages, 3. If this is the last extension to process incoming messages,
deliver the _A WebSocket Message Has Been Received_ event to the deliver the _A WebSocket Message Has Been Received_ event to the
application layer with the decompressed message payload and application layer with the decompressed message payload and
header values including the "Per-message Compressed" bit unset to header values including the "Per-message Compressed" bit unset to
0. Otherwise, pass the decompressed message payload and header 0. Otherwise, pass the decompressed message payload and header
values including the "Per-message Compressed" bit unset to 0 to values including the "Per-message Compressed" bit unset to 0 to
skipping to change at page 14, line 8 skipping to change at page 15, line 8
extension to process incoming messages, deliver the _A WebSocket extension to process incoming messages, deliver the _A WebSocket
Message Has Been Received_ event to the application layer with the Message Has Been Received_ event to the application layer with the
received message payload and header values as-is. Otherwise, pass received message payload and header values as-is. Otherwise, pass
the message payload and header values to the extension preceding the the message payload and header values to the extension preceding the
PMCE as-is. If the extension expects frames for input, build a frame PMCE as-is. If the extension expects frames for input, build a frame
for the message and pass it. for the message and pass it.
7. Intermediaries 7. Intermediaries
When an intermediary proxies a WebSocket connection, the intermediary When an intermediary proxies a WebSocket connection, the intermediary
MAY add, change or remove Per-message Compression on proxied messages MAY add, change or remove Per-message Compression of proxied messages
if the intermediary meets all of the following requirements: if the intermediary meets all of the following requirements:
o The intermediary understands that Per-message Compression. o The intermediary understands the PMCE.
o The intermediary can read all data of the proxied WebSocket o The intermediary can read all data of the proxied WebSocket
connection including the opening handshake request, opening connection including the opening handshake request, opening
handshake response, and messages. handshake response, and messages.
o The intermediary can alter the proxied data before forwarding them o The intermediary can alter the proxied data before forwarding them
accordingly to conform to the constraints of the new combination in accordance with to the constraints of the new combination of
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" in the opening handshake response which "Sec-WebSocket-Extensions" header in the opening handshake
enabled the Per-message Compression must also be removed. response which enabled the Per-message Compression must also be
removed.
Otherwise, the intermediary MUST NOT add, change or remove Per- Otherwise, the intermediary MUST NOT add, change or remove Per-
message Compression on proxied messages. message Compression of proxied messages.
8. permessage-deflate extension 8. permessage-deflate extension
This section specifies a specific PMCE called "permessage-deflate". This section defines a specific PMCE called "permessage-deflate". It
It compresses the payload of a message using the DEFLATE algorithm compresses the payload of a message using the DEFLATE algorithm
[RFC1951] and the byte boundary aligning 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
"permessage-deflate". "permessage-deflate".
Four extension parameters are defined for permessage-deflate to help Four extension parameters are defined for "permessage-deflate" to
endpoints manage per-connection resource usage. help endpoints manage per-connection resource usage.
o "server_no_context_takeover" o "server_no_context_takeover"
o "client_no_context_takeover" o "client_no_context_takeover"
o "server_max_window_bits" o "server_max_window_bits"
o "client_max_window_bits" o "client_max_window_bits"
These parameters enable two methods (no_context_takeover and These parameters enable two methods (no_context_takeover and
max_window_bits) of constraining memory usage that may be applied max_window_bits) of constraining memory usage that may be applied
independently to either direction of WebSocket traffic. The independently to either direction of WebSocket traffic. The
extension parameters with the "client_" prefix are used to negotiate extension parameters with the "client_" prefix are used by the client
DEFLATE parameters to control compression on messages sent by a to configure its compressor and by the server to configure its
client and received by a server. The client refers to parameters decompressor. The extension parameters with the "server_" prefix are
with the "client_" prefix to configure its compressor, while the used by the server to configure its compressor and by the client to
server refers to them to configure its decompressor. The extension configure its decompressor. All four parameters are defined for both
parameters with the "server_" prefix are used to negotiate DEFLATE a client's extension negotiation offer and a server's extension
parameters to control compression on messages sent by a server and negotiation response.
received by a client. The server refers to parameters with the
"server_" prefix to configure its compressor, while the client refers
to them to configure its decompressor. All of these four parameters
are defined for both a client's extension negotiation offer and a
server's extension negotiation response.
A server MUST decline an extension negotiation offer for this A server MUST decline an extension negotiation offer for this
extension if any of the following conditions is met: extension if any of the following conditions are met:
o The offer has any extension parameter not defined for use in an o The negotiation offer contains an extension parameter not defined
offer. for use in an offer.
o The offer has any extension parameter with an invalid value. o The negotiation offer contains an extension parameter with an
invalid value.
o The offer has multiple extension parameters with the same name. o The negotiation offer contains multiple extension parameters with
the same name.
o The server doesn't support the offered configuration. o The server doesn't support the offered configuration.
A client MUST _Fail the WebSocket Connection_ if the peer server A client MUST _Fail the WebSocket Connection_ if the peer server
accepted an extension negotiation offer for this extension with an accepted an extension negotiation offer for this extension with an
extension negotiation response meeting any of the following extension negotiation response meeting any of the following
condition: conditions:
o The response has any extension parameter not defined for use in a o The negotiation response contains an extension parameter not
response. defined for use in a response.
o The response has any extension parameter with an invalid value. o The negotiation response contains an extension parameter with an
invalid value.
o The response has multiple extension parameters with the same name. o The negotiation response contains multiple extension parameters
with the same name.
o The client doesn't support the configuration that the response o The client does not support the configuration that the response
represents. represents.
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 match with the DEFLATE compression algorithm searches the buffer for a match with
next input. the following input.
The term "use context take over" used in this section means to use The term "use context take over" used in this section means that the
the same LZ77 sliding window the endpoint used to build frames of the same LZ77 sliding window used by the endpoint to build frames of the
last sent message to build frames of the next message. previous sent message is reused to build frames of the next message
to be sent.
8.1. Method Parameters 8.1. Method 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. server_no_context_takeover
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 in 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
indicates that the client can receive a message which the server indicates that the client can decompress a message which the server
built using context take over. built using context take over.
A server accepts an extension negotiation offer including the A server accepts an extension negotiation offer that includes the
"server_no_context_takeover" extension parameter by including the "server_no_context_takeover" extension parameter by including the
"server_no_context_takeover" extension parameter in the corresponding "server_no_context_takeover" extension parameter in the corresponding
extension negotiation response to send back to the client. The extension negotiation response to send back to the client. The
"server_no_context_takeover" extension parameter in an extension "server_no_context_takeover" extension parameter in an extension
negotiation response has no value. negotiation response has no value.
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 have 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. client_no_context_takeover
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 won'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.
A server MAY include the "client_no_context_takeover" extension A server MAY include the "client_no_context_takeover" extension
parameter in an extension negotiation response. If the received parameter in an extension negotiation response. If the received
extension negotiation offer includes the "client_no_context_takeover" extension negotiation offer includes the "client_no_context_takeover"
extension parameter, the server may either ignore the parameter or extension parameter, the server may either ignore the parameter or
use the parameter to avoid taking over an LZ77 sliding window use the parameter to avoid taking over the LZ77 sliding window
unnecessarily by including "client_no_context_takeover" extension unnecessarily by including the "client_no_context_takeover" extension
parameter in the corresponding extension negotiation response to the parameter in the corresponding extension negotiation response to the
offer. The "client_no_context_takeover" extension parameter in an offer. The "client_no_context_takeover" extension parameter in an
extension negotiation response has no value. By including the extension negotiation response has no value. By including the
"client_no_context_takeover" extension parameter in an extension "client_no_context_takeover" extension parameter in an extension
negotiation response, a server prevents the peer client from using negotiation response, a server prevents the peer client from using
context take over. This reduces the amount of memory that the server context take over. This reduces the amount of memory that the server
has to reserve for the connection. has to reserve for the connection.
Absence of this extension parameter in an extension negotiation Absence of this extension parameter in an extension negotiation
response indicates that the server can receive messages built by the response indicates that the server can decompress messages built by
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. server_max_window_bits
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
client limits the LZ77 sliding window size that the server uses to client limits the LZ77 sliding window size that the server will use
compress messages. If the peer server uses small LZ77 sliding window to compress messages. If the peer server uses a small LZ77 sliding
to compress messages, the client can reduce the memory for the LZ77 window to compress messages, the client can reduce the memory needed
sliding window. for the LZ77 sliding window.
A server declines an extension negotiation offer with this parameter A server declines an extension negotiation offer with this parameter
if the server doesn't support it. if the server doesn't support it.
Absence of this parameter in an extension negotiation offer indicates Absence of this parameter in an extension negotiation offer indicates
that the client can receive messages compressed using an LZ77 sliding that the client can receive messages compressed using an LZ77 sliding
window of up to 32,768 bytes. window of up to 32,768 bytes.
A server accepts an extension negotiation offer with this parameter A server accepts an extension negotiation offer with this parameter
by including the "server_max_window_bits" extension parameter in the by including the "server_max_window_bits" extension parameter in the
skipping to change at page 19, line 9 skipping to change at page 20, line 9
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
By including this parameter in an offer, a client informs the peer By including this parameter in an offer, a client informs the peer
server of that the client supports the "client_max_window_bits" server that the client supports the "client_max_window_bits"
extension parameter in an extension negotiation response, and extension parameter in an extension negotiation response, and
optionally a hint by attaching a value to the parameter. If the optionally a hint by attaching a value to the parameter. If the
"client_max_window_bits" extension parameter in an extension "client_max_window_bits" extension parameter in an extension
negotiation offer has a value, the parameter also informs the peer negotiation offer has a value, the parameter also informs the peer
server of a hint that even if the server won't include the server of a hint that even if the server doesn't include the
"client_max_window_bits" extension parameter in the corresponding "client_max_window_bits" extension parameter in the corresponding
extension negotiation response with a value greater than one in the extension negotiation response with a value greater than the one in
extension negotiation offer or the server doesn't include the the extension negotiation offer or the server doesn't include the
extension parameter at all, the client is not going to use LZ77 extension parameter at all, the client is not going to use an LZ77
sliding window size greater than the size specified by the value in sliding window size greater than the size specified by the value in
the extension negotiation offer to compress messages. the extension negotiation offer to compress messages.
If a received extension negotiation offer has the If a received extension negotiation offer has the
"client_max_window_bits" extension parameter, the server MAY include "client_max_window_bits" extension parameter, the server MAY include
the "client_max_window_bits" extension parameter in the corresponding the "client_max_window_bits" extension parameter in the corresponding
extension negotiation response to the offer. If the extension negotiation response to the offer. If the
"client_max_window_bits" extension parameter in a received extension "client_max_window_bits" extension parameter in a received extension
negotiation offer has a value, the server may either ignore this negotiation offer has a value, the server may either ignore this
value or use this value to avoid allocating an unnecessarily big LZ77 value or use this value to avoid allocating an unnecessarily big LZ77
skipping to change at page 19, line 42 skipping to change at page 20, line 42
"client_max_window_bits" extension parameter in an extension "client_max_window_bits" extension parameter in an extension
negotiation response has a decimal integer value without leading negotiation response has a decimal integer value without leading
zeroes between 8 to 15 inclusive indicating the base-2 logarithm of zeroes between 8 to 15 inclusive indicating the base-2 logarithm of
the LZ77 sliding window size and MUST conform to the ABNF below. the LZ77 sliding window size and MUST conform to the ABNF below.
client_max_window_bits = 1*DIGIT client_max_window_bits = 1*DIGIT
By including this extension parameter in an extension negotiation By including this extension parameter in an extension negotiation
response, a server limits the LZ77 sliding window size that the response, a server limits the LZ77 sliding window size that the
client uses to compress messages. This reduces the amount of memory client uses to compress messages. This reduces the amount of memory
for decompression context that the server has to reserve for the for the decompression context that the server has to reserve for the
connection. connection.
If a received extension negotiation offer doesn't have the If a received extension negotiation offer doesn't have the
"client_max_window_bits" extension parameter, the corresponding "client_max_window_bits" extension parameter, the corresponding
extension negotiation response to the offer MUST NOT include the extension negotiation response to the offer MUST NOT include the
"client_max_window_bits" extension parameter. "client_max_window_bits" extension parameter.
Absence of this extension parameter in an extension negotiation Absence of this extension parameter in an extension negotiation
response indicates that the server can receive messages compressed response indicates that the server can receive messages compressed
using an LZ77 sliding window of up to 32,768 bytes. using an LZ77 sliding window of up to 32,768 bytes.
8.1.3. Example 8.1.3. Examples
The simplest "Sec-WebSocket-Extensions" header in a client's opening The simplest "Sec-WebSocket-Extensions" header in a client's opening
handshake to offer use of the permessage-deflate is as follows: handshake to offer use of the permessage-deflate extension looks like
this:
Sec-WebSocket-Extensions: permessage-deflate Sec-WebSocket-Extensions: permessage-deflate
Since the "client_max_window_bits" extension parameter is not Since the "client_max_window_bits" extension parameter is not
included in this extension negotiation offer, the server must not included in this extension negotiation offer, the server must not
accept the offer with an extension negotiation response including the accept the offer with an extension negotiation response that includes
"client_max_window_bits" extension parameter. The simplest the "client_max_window_bits" extension parameter. The simplest
"Sec-WebSocket-Extensions" header in a server's opening handshake to "Sec-WebSocket-Extensions" header in a server's opening handshake to
accept use of the permessage-deflate is the same. accept use of the permessage-deflate extension is the same:
Sec-WebSocket-Extensions: permessage-deflate
The following extension negotiation offer sent by a client is asking The following extension negotiation offer sent by a client is asking
the server to use the LZ77 sliding window size of 1,024 bytes or less the server to use an LZ77 sliding window with a size of 1,024 bytes
and declaring that the client supports the "client_max_window_bits" or less and declaring that the client supports the
extension parameter in an extension negotiation response. "client_max_window_bits" extension parameter in an extension
negotiation response.
Sec-WebSocket-Extensions: Sec-WebSocket-Extensions:
permessage-deflate; permessage-deflate;
client_max_window_bits; server_max_window_bits=10 client_max_window_bits; server_max_window_bits=10
This extension negotiation offer might be rejected by the server This extension negotiation offer might be rejected by the server
because the server doesn't support the "server_max_window_bits" because the server doesn't support the "server_max_window_bits"
extension parameter in an extension negotiation offer. This is fine extension parameter in an extension negotiation offer. This is fine
if the client cannot receive messages compressed using a larger if the client cannot receive messages compressed using a larger
sliding window size, but if the client just prefers using a small sliding window size, but if the client just prefers using a small
window but wants to fallback to the "permessage-deflate" without the window but wants to fall back to the "permessage-deflate" without the
"server_max_window_bits" extension parameter, the client can make an "server_max_window_bits" extension parameter, the client can make an
offer with the fallback option like this: offer with the fallback option like this:
Sec-WebSocket-Extensions: Sec-WebSocket-Extensions:
permessage-deflate; permessage-deflate;
client_max_window_bits; server_max_window_bits=10, client_max_window_bits; server_max_window_bits=10,
permessage-deflate; permessage-deflate;
client_max_window_bits client_max_window_bits
The server can accept permessage-deflate by picking the supported one The server can accept permessage-deflate by picking any supported one
from the listed offers. To accept the first option, for example, the from the listed offers. To accept the first option, for example, the
server may send back a response as follows: server may send back a response as follows:
Sec-WebSocket-Extensions: Sec-WebSocket-Extensions:
permessage-deflate; server_max_window_bits=10 permessage-deflate; server_max_window_bits=10
To accept the second option, for example, the server may send back a To accept the second option, for example, the server may send back a
response as follows: response as follows:
Sec-WebSocket-Extensions: permessage-deflate Sec-WebSocket-Extensions: permessage-deflate
skipping to change at page 21, line 42 skipping to change at page 22, line 47
o An endpoint MAY use both DEFLATE blocks with the "BFINAL" bit set o An endpoint MAY use both DEFLATE blocks with the "BFINAL" bit set
to 0 and DEFLATE blocks with the "BFINAL" bit set to 1. to 0 and DEFLATE blocks with the "BFINAL" bit set to 1.
o When any DEFLATE block with the "BFINAL" bit set to 1 doesn't end o When any DEFLATE block with the "BFINAL" bit set to 1 doesn't end
at a byte boundary, an endpoint MUST add minimal padding bits of 0 at a byte boundary, an endpoint MUST add minimal padding bits of 0
to make it end at a byte boundary. The next DEFLATE block follows to make it end at a byte boundary. The next DEFLATE block follows
the padded data if any. the padded data if any.
An endpoint fragments a compressed message by splitting the result of An endpoint fragments a compressed message by splitting the result of
running this algorithm. Even when only a part of payload is running this algorithm. Even when only part of the payload is
available, a fragment can be built by compressing the available data available, a fragment can be built by compressing the available data
and choosing block type appropriately so that the end of the and choosing the block type appropriately so that the end of the
resulting compressed data is aligned at a byte boundary. Note that resulting compressed data is aligned at a byte boundary. Note that
for non-final fragments, the removal of 0x00 0x00 0xff 0xff must not for non-final fragments, the removal of 0x00 0x00 0xff 0xff must not
be done. be done.
An endpoint MUST NOT use an LZ77 sliding window longer than 32,768 An endpoint MUST NOT use an LZ77 sliding window longer than 32,768
bytes to compress messages to send. bytes to compress messages to send.
If the "agreed parameters" contain the "client_no_context_takeover" If the "agreed parameters" contain the "client_no_context_takeover"
extension parameter, the client MUST start compressing each new extension parameter, the client MUST start compressing each new
message with an empty LZ77 sliding window. Otherwise, the client MAY message with an empty LZ77 sliding window. Otherwise, the client MAY
skipping to change at page 23, line 40 skipping to change at page 24, line 43
"client_max_window_bits" extension parameter with a value smaller "client_max_window_bits" extension parameter with a value smaller
than one in the "agreed parameters", the client MUST use an LZ77 than one in the "agreed parameters", the client MUST use an LZ77
sliding window of a size that conforms the "agreed parameters" to sliding window of a size that conforms the "agreed parameters" to
compress messages to send. The client-to-server compress messages to send. The client-to-server
"client_max_window_bits" extension parameter is just a hint for the "client_max_window_bits" extension parameter is just a hint for the
server to build an extension negotiation response. server to build an extension negotiation response.
8.2.3. Examples 8.2.3. Examples
This section introduces examples of how the permessage-deflate This section introduces examples of how the permessage-deflate
transforms messages. extension transforms messages.
8.2.3.1. A message compressed using 1 compressed DEFLATE block 8.2.3.1. A message compressed using 1 compressed DEFLATE block
Suppose that an endpoint sends a text message "Hello". If the Suppose that an endpoint sends a text message "Hello". If the
endpoint uses 1 compressed DEFLATE block (compressed with fixed endpoint uses 1 compressed DEFLATE block (compressed with fixed
Huffman code and the "BFINAL" bit is not set) to compress the Huffman code and the "BFINAL" bit not set) to compress the message,
message, the endpoint obtains the compressed data to use for the the endpoint obtains the compressed data to use for the message
message payload as follows. payload as follows.
The endpoint compresses "Hello" into 1 compressed DEFLATE block and The endpoint compresses "Hello" into 1 compressed DEFLATE block and
flushes the resulting data into a byte array using an empty DEFLATE flushes the resulting data into a byte array using an empty DEFLATE
block with no compression: block with no compression:
0xf2 0x48 0xcd 0xc9 0xc9 0x07 0x00 0x00 0x00 0xff 0xff 0xf2 0x48 0xcd 0xc9 0xc9 0x07 0x00 0x00 0x00 0xff 0xff
By stripping 0x00 0x00 0xff 0xff from the tail end, the endpoint gets By stripping 0x00 0x00 0xff 0xff from the tail end, the endpoint gets
the data to use for the message payload: the data to use for the message payload:
skipping to change at page 25, line 7 skipping to change at page 26, line 13
Note that the RSV1 bit is set only on the first frame. Note that the RSV1 bit is set only on the first frame.
8.2.3.2. Sharing LZ77 Sliding Window 8.2.3.2. Sharing LZ77 Sliding Window
Suppose that a client has sent a message "Hello" as a compressed Suppose that a client has sent a message "Hello" as a compressed
message and will send the same message "Hello" again as a compressed message and will send the same message "Hello" again as a compressed
message. message.
0xf2 0x48 0xcd 0xc9 0xc9 0x07 0x00 0xf2 0x48 0xcd 0xc9 0xc9 0x07 0x00
This is the payload of the first message the client has sent. If the The above is the payload of the first message that the client has
"agreed parameters" contain the "client_no_context_takeover" sent. If the "agreed parameters" contain the
extension parameter, the client compresses the payload of the next "client_no_context_takeover" extension parameter, the client
message into the same bytes (if the client uses the same "BTYPE" compresses the payload of the next message into the same bytes (if
value and "BFINAL" value). So, the payload of the second message the client uses the same "BTYPE" value and "BFINAL" value). So, the
will be: payload of the second message will be:
0xf2 0x48 0xcd 0xc9 0xc9 0x07 0x00 0xf2 0x48 0xcd 0xc9 0xc9 0x07 0x00
If the "agreed parameters" did not contain the If the "agreed parameters" did not contain the
"client_no_context_takeover" extension parameter, the client can "client_no_context_takeover" extension parameter, the client can
compress the payload of the next message into shorter bytes by compress the payload of the next message into less bytes by
referencing the history in the LZ77 sliding window. So, the payload referencing the history in the LZ77 sliding window. So, the payload
of the second message will be: of the second message will be:
0xf2 0x00 0x11 0x00 0x00 0xf2 0x00 0x11 0x00 0x00
So, 2 bytes are saved in total. So, 2 bytes are saved in total.
Note that even if some uncompressed messages (with the RSV1 bit Note that even if some uncompressed messages (with the RSV1 bit
unset) are inserted between the two "Hello" messages, they don't unset) are inserted between the two "Hello" messages, they don't
affect the LZ77 sliding window. affect the LZ77 sliding window.
skipping to change at page 25, line 41 skipping to change at page 26, line 47
0xc1 0x0b 0x00 0x05 0x00 0xfa 0xff 0x48 0x65 0x6c 0x6c 0x6f 0x00 0xc1 0x0b 0x00 0x05 0x00 0xfa 0xff 0x48 0x65 0x6c 0x6c 0x6f 0x00
This is a frame constituting a text message "Hello" built using a This is a frame constituting a text message "Hello" built using a
DEFLATE block with no compression. The first 2 octets (0xc1 0x0b) DEFLATE block with no compression. The first 2 octets (0xc1 0x0b)
are the WebSocket frame header (FIN=1, RSV1=1, RSV2=0, RSV3=0, are the WebSocket frame header (FIN=1, RSV1=1, RSV2=0, RSV3=0,
opcode=text, MASK=0, Payload length=7). Note that the RSV1 bit is opcode=text, MASK=0, Payload length=7). Note that the RSV1 bit is
set for this message (only on the first fragment if the message is set for this message (only on the first fragment if the message is
fragmented) because the RSV1 bit is set when DEFLATE is applied to fragmented) because the RSV1 bit is set when DEFLATE is applied to
the message, including the case when only DEFLATE blocks with no the message, including the case when only DEFLATE blocks with no
compression are used. The third to 13th octet consists a payload compression are used. The 3rd to 13th octets consist the payload
data containing "Hello" compressed using a DEFLATE block with no data containing "Hello" compressed using a DEFLATE block with no
compression. compression.
8.2.3.4. Using a DEFLATE Block with BFINAL Set to 1 8.2.3.4. Using a DEFLATE Block with BFINAL Set to 1
On platform where the flush method using an empty DEFLATE block with On platforms on which the flush method using an empty DEFLATE block
no compression is not available, implementors can choose to flush with no compression is not available, implementors can choose to
data using DEFLATE blocks with "BFINAL" set to 1. flush data using DEFLATE blocks with "BFINAL" set to 1.
0xf3 0x48 0xcd 0xc9 0xc9 0x07 0x00 0x00 0xf3 0x48 0xcd 0xc9 0xc9 0x07 0x00 0x00
This is a payload of a message containing "Hello" compressed using a This is the payload of a message containing "Hello" compressed using
DEFLATE block with "BFINAL" set to 1. The first 7 octets constitute a DEFLATE block with "BFINAL" set to 1. The first 7 octets
a DEFLATE block with "BFINAL" set to 1 and "BTYPE" set to 01 constitute a DEFLATE block with "BFINAL" set to 1 and "BTYPE" set to
containing "Hello". The last 1 octet (0x00) contains the header bits 01 containing "Hello". The last 1 octet (0x00) contains the header
with "BFINAL" set to 0 and "BTYPE" set to 00, and 5 padding bits of bits with "BFINAL" set to 0 and "BTYPE" set to 00, and 5 padding bits
0. This octet is necessary to allow the payload to be decompressed of 0. This octet is necessary to allow the payload to be
in the same manner as messages flushed using DEFLATE blocks with decompressed in the same manner as messages flushed using DEFLATE
BFINAL unset. blocks with BFINAL unset.
8.2.3.5. Two DEFLATE Blocks in 1 Message 8.2.3.5. Two DEFLATE Blocks in 1 Message
Two or more DEFLATE blocks may be used in 1 message. Two or more DEFLATE blocks may be used in 1 message.
0xf2 0x48 0x05 0x00 0x00 0x00 0xff 0xff 0xca 0xc9 0xc9 0x07 0x00 0xf2 0x48 0x05 0x00 0x00 0x00 0xff 0xff 0xca 0xc9 0xc9 0x07 0x00
The first 3 octets (0xf2 0x48 0x05) and the least significant two The first 3 octets (0xf2 0x48 0x05) and the least significant two
bits of the 4th octet (0x00) constitute one DEFLATE block with bits of the 4th octet (0x00) constitute one DEFLATE block with
"BFINAL" set to 0 and "BTYPE" set to 01 containing "He". The rest of "BFINAL" set to 0 and "BTYPE" set to 01 containing "He". The rest of
the 4th octet contains the header bits with "BFINAL" set to 0 and the 4th octet contains the header bits with "BFINAL" set to 0 and
"BTYPE" set to 00, and the 3 padding bits of 0. Together with the "BTYPE" set to 00, and the 3 padding bits of 0. Together with the
following 4 octets (0x00 0x00 0xff 0xff), the header bits constitute following 4 octets (0x00 0x00 0xff 0xff), the header bits constitute
an empty DEFLATE block with no compression. A DEFLATE block an empty DEFLATE block with no compression. A DEFLATE block
containing "llo" follows the empty DEFLATE block. containing "llo" follows the empty DEFLATE block.
8.2.3.6. Generating an Empty Fragment Manually 8.2.3.6. Generating an Empty Fragment Manually
Suppose that an endpoint is sending data with unknown size. The Suppose that an endpoint is sending data of unknown size. The
endpoint may encounter the end of data signal from the data source endpoint may encounter the end of data signal from the data source
when its buffer for uncompressed data is empty. In such a case, the when its buffer for uncompressed data is empty. In such a case, the
endpoint just needs to send the last fragment with FIN bit set to 1 endpoint just needs to send the last fragment with FIN bit set to 1
and payload set to DEFLATE block(s) which contains 0 byte data. If and payload set to DEFLATE block(s) which contains 0 bytes of data.
the compression library being used doesn't generate any data when its If the compression library being used doesn't generate any data when
buffer is empty, an empty uncompressed DEFLATE block can be built its buffer is empty, an empty uncompressed DEFLATE block can be built
manually and used for this purpose as follows: manually and used for this purpose as follows:
0x00 0x00
The only octet 0x00 contains the header bits with "BFINAL" set to 0 The only octet 0x00 contains the header bits with "BFINAL" set to 0
and "BTYPE" set to 00, and 5 padding bits of 0. and "BTYPE" set to 00, and 5 padding bits of 0.
8.3. Implementation Notes 8.3. Implementation Notes
On most common software development platforms, their DEFLATE On most common software development platforms, the DEFLATE
compression library provides a method to align compressed data to compression library provides a method for aligning compressed data to
byte boundaries using an empty DEFLATE block with no compression. byte boundaries using an empty DEFLATE block with no compression.
For example, Zlib [Zlib] does this when "Z_SYNC_FLUSH" is passed to For example, Zlib [Zlib] does this when "Z_SYNC_FLUSH" is passed to
the deflate function. the deflate function.
Some platforms may provide only methods to output and process Some platforms may provide only methods to output and process
compressed data with ZLIB header and Adler-32 checksum. On such compressed data with a ZLIB header and an Adler-32 checksum. On such
platforms, developers need to write stub code to remove and platforms, developers need to write stub code to remove and
complement them manually. complement them manually.
To obtain a useful compression ratio, an LZ77 sliding window size of To obtain a useful compression ratio, an LZ77 sliding window size of
1,024 or more is RECOMMENDED. 1,024 or more is RECOMMENDED.
On the direction where context takeover is disallowed, an endpoint If a side disallows context takeover, its endpoint can easily figure
can easily figure out whether a certain message will be shorter if out whether a certain message will be shorter if compressed or not.
compressed or not.. Otherwise, it's not easy to know whether future Otherwise, it's not easy to know whether future messages will benefit
messages will benefit from having a certain message compressed. from having a certain message compressed. Implementors may employ
Implementor may employ some heuristics to determine this. some heuristics to determine this.
8.4. Intermediaries 8.4. Intermediaries
When an intermediary forwards a message, the intermediary MAY change When an intermediary forwards a message, the intermediary MAY change
compression on the messages as far as the resulting sequence of the compression of messages provided that the resulting sequence of
messages conforms to the constraints based on the "agreed messages conforms to the constraints based on the "agreed
parameters". For example, an intermediary may decompress a received parameters". For example, an intermediary may decompress a received
message, unset the "Per-message Compressed" bit and forward it to the message, unset the "Per-message Compressed" bit and forward it to the
other peer. Since such a compression change may affect the LZ77 other peer. Since such a compression change may affect the LZ77
sliding window, the intermediary may need to parse and transform the sliding window, the intermediary may need to parse and transform the
following messages, too. following messages, too.
9. Security Considerations 9. Security Considerations
There is a known exploit for combination of a secure transport There is a known exploit when history-based compression is combined
protocol and history-based compression [CRIME]. Implementors should with a secure transport [CRIME]. Implementors should pay attention
give attention to this point when integrating this extension with to this point when integrating this extension with other extensions
other extensions or protocols. or protocols.
10. IANA Considerations 10. IANA Considerations
10.1. Registration of the "permessage-deflate" WebSocket Extension Name 10.1. Registration of the "permessage-deflate" WebSocket Extension Name
This section describes a WebSocket extension name registration in the This section describes a WebSocket extension name registration in the
WebSocket Extension Name Registry [RFC6455]. WebSocket Extension Name Registry [RFC6455].
Extension Identifier Extension Identifier
permessage-deflate permessage-deflate
skipping to change at page 29, line 47 skipping to change at page 30, line 47
Common Name Common Name
Per-message Compressed Per-message Compressed
Meaning Meaning
The message is compressed or not. The message is compressed or not.
Reference Reference
Section 6 of this document. Section 6 of this document.
The "Per-message Compressed" framing header bit is used on the first The "Per-message Compressed" framing header bit is used on the first
fragment of non-control messages to indicate whether the payload of fragment of data messages to indicate whether the payload of the
the message is compressed by the PMCE or not. message is compressed by the PMCE or not.
11. Acknowledgements 11. Acknowledgements
Special thanks to Patrick McManus who wrote up the initial Special thanks to Patrick McManus who wrote up the initial
specification of a DEFLATE-based compression extension for the specification of a DEFLATE-based compression extension for the
WebSocket Protocol to which I referred to write this specification. WebSocket Protocol to which I referred to write this specification.
Thank you to the following people who participated in discussions on Thank you to the following people who participated in discussions on
the HyBi WG and contributed ideas and/or provided detailed reviews the HyBi WG and contributed ideas and/or provided detailed reviews
(the list is likely to be incomplete): Adam Rice, Alexey Melnikov, (the list is likely to be incomplete): Adam Rice, Alexander
Arman Djusupov, Bjoern Hoehrmann, Brian McKelvey, Dario Crivelli, Philippou, Alexey Melnikov, Arman Djusupov, Bjoern Hoehrmann, Brian
Greg Wilkins, Inaki Baz Castillo, Jamie Lokier, Joakim Erdfelt, John McKelvey, Dario Crivelli, Greg Wilkins, Inaki Baz Castillo, Jamie
A. Tamplin, Julian Reschke, Kenichi Ishibashi, Mark Nottingham, Peter Lokier, Joakim Erdfelt, John A. Tamplin, Julian Reschke, Kenichi
Thorson, Roberto Peon, Simone Bordet, Tobias Oberstein and Yutaka Ishibashi, Mark Nottingham, Peter Thorson, Roberto Peon, Salvatore
Hirano. Note that people listed above didn't necessarily endorse the Loreto, Simone Bordet, Tobias Oberstein and Yutaka Hirano. Note that
end result of this work. people listed above didn't necessarily endorse the end result of this
work.
12. References 12. References
12.1. Normative References 12.1. Normative References
[RFC1951] Deutsch, P., "DEFLATE Compressed Data Format Specification [RFC1951] Deutsch, P., "DEFLATE Compressed Data Format Specification
version 1.3", RFC 1951, May 1996. version 1.3", RFC 1951, May 1996.
[RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax
Specifications: ABNF", STD 68, RFC 5234, January 2008. Specifications: ABNF", STD 68, RFC 5234, January 2008.
 End of changes. 106 change blocks. 
309 lines changed or deleted 357 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/