idnits 2.17.1 draft-ietf-hybi-permessage-compression-27.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (August 6, 2015) is 3157 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Downref: Normative reference to an Informational RFC: RFC 1951 -- Possible downref: Non-RFC (?) normative reference: ref. 'LZ77' -- Possible downref: Non-RFC (?) normative reference: ref. 'CRIME' Summary: 1 error (**), 0 flaws (~~), 1 warning (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 HyBi Working Group T. Yoshino 3 Internet-Draft Google, Inc. 4 Intended status: Standards Track August 6, 2015 5 Expires: February 7, 2016 7 Compression Extensions for WebSocket 8 draft-ietf-hybi-permessage-compression-27 10 Abstract 12 This document defines a framework for creating WebSocket extensions 13 that add compression functionality to the WebSocket Protocol. An 14 extension based on this framework compresses the payload data portion 15 of WebSocket data messages on a per-message basis using parameters 16 negotiated during the opening handshake. This framework provides a 17 general method for applying a compression algorithm to the contents 18 of WebSocket messages. Each compression algorithm has to be defined 19 in a document defining the extension by specifying parameter 20 negotiation and payload transformation algorithm in detail. This 21 document also specifies one specific compression extension using the 22 DEFLATE algorithm. 24 Please send feedback to the hybi@ietf.org mailing list. 26 Status of this Memo 28 This Internet-Draft is submitted to IETF in full conformance with the 29 provisions of BCP 78 and BCP 79. 31 Internet-Drafts are working documents of the Internet Engineering 32 Task Force (IETF). Note that other groups may also distribute 33 working documents as Internet-Drafts. The list of current Internet- 34 Drafts is at http://datatracker.ietf.org/drafts/current. 36 Internet-Drafts are draft documents valid for a maximum of six months 37 and may be updated, replaced, or obsoleted by other documents at any 38 time. It is inappropriate to use Internet-Drafts as reference 39 material or to cite them other than as "work in progress." 41 This Internet-Draft will expire on February 7, 2016. 43 Copyright Notice 45 Copyright (c) 2015 IETF Trust and the persons identified as the 46 document authors. All rights reserved. 48 This document is subject to BCP 78 and the IETF Trust's Legal 49 Provisions Relating to IETF Documents 50 (http://trustee.ietf.org/license-info) in effect on the date of 51 publication of this document. Please review these documents 52 carefully, as they describe your rights and restrictions with respect 53 to this document. Code Components extracted from this document must 54 include Simplified BSD License text as described in Section 4.e of 55 the Trust Legal Provisions and are provided without warranty as 56 described in the Simplified BSD License. 58 Table of Contents 60 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 61 2. Conformance Requirements and Terminology . . . . . . . . . . . 4 62 3. Complementary Terminology . . . . . . . . . . . . . . . . . . 5 63 4. WebSocket Per-message Compression Extension . . . . . . . . . 6 64 5. Extension Negotiation . . . . . . . . . . . . . . . . . . . . 7 65 5.1. General Negotiation Flow . . . . . . . . . . . . . . . . . 9 66 5.2. Negotiation Examples . . . . . . . . . . . . . . . . . . . 10 67 6. Framing . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 68 6.1. Compression . . . . . . . . . . . . . . . . . . . . . . . 12 69 6.2. Decompression . . . . . . . . . . . . . . . . . . . . . . 13 70 7. The permessage-deflate extension . . . . . . . . . . . . . . . 15 71 7.1. Extension Parameters . . . . . . . . . . . . . . . . . . . 16 72 7.1.1. Context Takeover Control . . . . . . . . . . . . . . . 16 73 7.1.2. Limiting the LZ77 sliding window size . . . . . . . . 18 74 7.1.3. Examples . . . . . . . . . . . . . . . . . . . . . . . 20 75 7.2. Message Payload Transformation . . . . . . . . . . . . . . 21 76 7.2.1. Compression . . . . . . . . . . . . . . . . . . . . . 21 77 7.2.2. Decompression . . . . . . . . . . . . . . . . . . . . 22 78 7.2.3. Examples . . . . . . . . . . . . . . . . . . . . . . . 23 79 7.3. Implementation Notes . . . . . . . . . . . . . . . . . . . 27 80 8. Security Considerations . . . . . . . . . . . . . . . . . . . 28 81 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 29 82 9.1. Registration of the "permessage-deflate" WebSocket 83 Extension Name . . . . . . . . . . . . . . . . . . . . . . 29 84 9.2. Registration of the "Per-message Compressed" WebSocket 85 Framing Header Bit . . . . . . . . . . . . . . . . . . . . 29 86 10. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 30 87 11. References . . . . . . . . . . . . . . . . . . . . . . . . . . 31 88 11.1. Normative References . . . . . . . . . . . . . . . . . . . 31 89 11.2. Informative References . . . . . . . . . . . . . . . . . . 31 90 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 32 92 1. Introduction 94 This document specifies a framework for adding compression 95 functionality to the WebSocket Protocol [RFC6455]. The framework 96 specifies how to define WebSocket Per-message Compression Extensions 97 (PMCEs) for a compression algorithm based on the extension concept of 98 the WebSocket Protocol specified in Section 9 of [RFC6455]. A 99 WebSocket client and a peer WebSocket server negotiate the use of a 100 PMCE and determine the parameters required to configure the 101 compression algorithm during the WebSocket opening handshake. The 102 client and server can then exchange data messages whose frames 103 contain compressed data in the payload data portion. 105 This framework only specifies a general method for applying a 106 compression algorithm to the contents of WebSocket messages. Each 107 individual PMCE has to be specified in a document describing in 108 detail how to negotiate the configuration parameters for the specific 109 compression algorithm used by that PMCE and how to transform 110 (compress and decompress) data in the payload data portion. 112 A WebSocket client may offer multiple PMCEs during the WebSocket 113 opening handshake. A peer WebSocket server receiving the offer may 114 choose to accept the preferred PMCE or decline all of them. PMCEs 115 use the RSV1 bit of the WebSocket frame header to indicate whether a 116 message is compressed or not, so that an endpoint can choose not to 117 compress messages with incompressible contents. 119 This document also specifies one specific PMCE based on the DEFLATE 120 [RFC1951] algorithm. The DEFLATE algorithm is widely available on 121 various platforms and its overhead is small. The extension name of 122 this PMCE is "permessage-deflate". To align the end of compressed 123 data to an octet boundary, this extension uses the algorithm 124 described in Section 2.1 of [RFC1979]. Endpoints can take over the 125 LZ77 sliding window [LZ77] used to build frames for previous messages 126 to achieve a better compression ratio. For resource-limited devices, 127 this extension provides parameters to limit memory usage for 128 compression context. 130 2. Conformance Requirements and Terminology 132 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 133 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 134 document are to be interpreted as described in [RFC2119]. 136 Requirements phrased in the imperative as part of algorithms (such as 137 "strip any leading space characters" or "return false and abort these 138 steps") are to be interpreted with the meaning of the key word 139 ("MUST", "SHOULD", "MAY", etc.) used in introducing the algorithm. 141 Conformance requirements phrased as algorithms or specific steps can 142 be implemented in any manner, so long as the end result is 143 equivalent. In particular, the algorithms defined in this 144 specification are intended to be easy to understand and are not 145 intended to be performant. 147 This document references the procedure to _Fail the WebSocket 148 Connection_. This procedure is defined in Section 7.1.7 of 149 [RFC6455]. 151 This document references the event that _The WebSocket Connection is 152 Established_ and the event that _A WebSocket Message Has Been 153 Received_. These events are defined in Section 4.1 and Section 6.2, 154 respectively, of [RFC6455]. 156 This document uses the Augmented Backus-Naur Form (ABNF) notation of 157 [RFC5234]. The DIGIT (decimal 0-9) rule is included by reference, as 158 defined in the Appendix B.1 of [RFC5234]. 160 3. Complementary Terminology 162 This document defines some terms about WebSocket and WebSocket 163 Extension mechanisms that are underspecified or not defined at all in 164 [RFC6455]. 166 "A data message" means a message consisting of Data Frames as defined 167 in Section 5.6 of [RFC6455]. 169 "A message payload (or payload of a message)" means the concatenation 170 of the payload data portion of all Data Frames (see Section 6.2 of 171 [RFC6455]) representing a single message. 173 "An extension in use next to extension X" means the extension listed 174 next to X in the "Sec-WebSocket-Extensions" header in the server's 175 opening handshake as defined in Section 9.1 of [RFC6455]. Such an 176 extension is applied to outgoing data from the application right 177 after X on the sender side, but applied right before X to incoming 178 data from the underlying transport. 180 "An extension in use preceding extension X" means the extension 181 listed right before X in the "Sec-WebSocket-Extensions" header in the 182 server's opening handshake. Such an extension is applied to outgoing 183 data from the application right before X on the sender side, but 184 applied right after X to incoming data from the underlying transport. 186 "An extension negotiation offer" means each element in the 187 "Sec-WebSocket-Extensions" header in the client's opening handshake. 189 "An extension negotiation response" means each element in the 190 "Sec-WebSocket-Extensions" header in the server's opening handshake. 192 "A corresponding extension negotiation response for an extension 193 negotiation offer" means an extension negotiation response that a 194 server sends back to the peer client containing the same extension 195 name as the offer and meeting the requirements represented by the 196 offer. 198 "Accepting an extension negotiation offer" means including a 199 corresponding extension negotiation response for the offer in the 200 "Sec-WebSocket-Extensions" header in the server's opening handshake. 202 "Declining an extension negotiation offer" means not including a 203 corresponding extension negotiation response for the offer in the 204 "Sec-WebSocket-Extensions" header in the server's opening handshake. 206 4. WebSocket Per-message Compression Extension 208 WebSocket Per-message Compression Extensions (PMCEs) are extensions 209 to the WebSocket Protocol enabling compression functionality. PMCEs 210 are built based on the extension concept of the WebSocket Protocol 211 specified in Section 9 of [RFC6455]. PMCEs are individually defined 212 for each compression algorithm to be implemented, and are registered 213 in the WebSocket Extension Name Registry created in Section 11.4 of 214 [RFC6455]. Each PMCE referring to this framework MUST define the 215 following: 217 o The extension name of the PMCE and any applicable extension 218 parameters that MUST be included in the "Sec-WebSocket-Extensions" 219 header during the extension negotiation offer/response. 221 o How to interpret the extension parameters exchanged during the 222 opening handshake. 224 o How to transform the payload of a message. 226 One PMCE is defined in Section 7 of this document and is registered 227 in Section 9. Other PMCEs may be defined in the future in other 228 documents. 230 Section 5 describes the basic extension negotiation process. 231 Section 6 describes how to apply the compression algorithm with 232 negotiated parameters to the contents of WebSocket messages. 234 5. Extension Negotiation 236 To offer use of a PMCE, a client MUST include the extension name of 237 the PMCE in the "Sec-WebSocket-Extensions" header field of its 238 opening handshake of the WebSocket connection. Extension parameters 239 are used to specify the PMCE offer in detail. For example, a client 240 lists its preferred configuration parameter values for the 241 compression algorithm of the PMCE. A client may also offer multiple 242 PMCE choices to the server by including multiple elements in the 243 "Sec-WebSocket-Extensions" header, one for each PMCE offered. This 244 set of elements MAY include multiple PMCEs with the same extension 245 name to offer the possibility to use the same algorithm with 246 different configuration parameters. The order of elements is 247 important as it specifies the client's preference. An element 248 preceding another element has higher preference. It is recommended 249 that a server accepts PMCEs with higher preference if the server 250 supports them. 252 A PMCE negotiation offer provides requests and/or hints to the 253 server. 255 A request in a PMCE negotiation offer indicates constraints on the 256 server's behavior that must be satisfied if the server accepts the 257 offer. For example, suppose that a server sends data compressed with 258 the DEFLATE algorithm to a client. The server must keep the original 259 bytes of data that it recently compressed and sent to the client. 260 The client must keep the result of decompressing the bytes of data 261 that it recently received from the server. The amount of bytes of 262 data kept is called the LZ77 window size. The LZ77 window size of 263 the client must not be less than the LZ77 window size of the server. 264 In a PMCE negotiation offer, the client MUST inform the server of its 265 LZ77 window size so that the server uses an LZ77 window size that is 266 not greater than the LZ77 window size of the client. This 267 restriction on the LZ77 window size is an example of a request in a 268 PMCE negotiation offer. 270 A hint in a PMCE negotiation offer provides information about the 271 client's behavior that the server may either safely ignore or refer 272 to when the server decides its behavior. For example, suppose that a 273 client sends data compressed with the DEFLATE algorithm to a server. 274 The client must keep the original bytes of data that it recently 275 compressed and sent to the server. The server must keep the result 276 of decompressing the bytes of data that it recently received from the 277 client. The LZ77 window size of the server must not be less than the 278 LZ77 window size of the client. In a PMCE negotiation offer, the 279 client MAY inform the maximum LZ77 window size the client can afford 280 so that the server can choose to use an LZ77 window size that is not 281 greater than the maximum size of the client. This information is an 282 example of a hint in a PMCE negotiation offer. It's waste of memory 283 to use an LZ77 window size greater than the LZ77 window size the 284 client actually uses. Using the hint, the server can avoid the waste 285 of memory. Since the hint itself doesn't specify the constraints on 286 the endpoints, the server must use the "agreed parameters" (defined 287 below) to explicitly ask the client not to use an LZ77 window size 288 greater than the LZ77 window size of the server. 290 To accept the use of an offered PMCE, a server MUST include the 291 extension name of the PMCE in the "Sec-WebSocket-Extensions" header 292 field of its opening handshake of the WebSocket connection. 293 Extension parameters represent the detailed configuration parameters 294 of the PMCE to use. These extension parameters and their values are 295 called "agreed parameters". The element MUST represent a PMCE that 296 is fully supported by the server. The contents of the element don't 297 need to be exactly the same as those of the received extension 298 negotiation offers. For example, suppose that a server received a 299 PMCE extension negotiation offer with an extension parameter "X" 300 indicating that the client can enable an optional feature named X. 301 The server may accept the PMCE offer with an element without the 302 extension parameter "X" meaning that the server chose not to enable 303 the feature X. In this case, the offer contains the extension 304 parameter "X" but the "agreed parameters" don't contain the extension 305 parameter "X". 307 "Agreed parameters" must represent how the requests and hints in the 308 client's extension negotiation offer have been handled in addition to 309 the server's requests and hints on the client's behavior, so that the 310 client can configure its behavior without identifying exactly which 311 PMCE extension negotiation offer has been accepted. 313 For example, if a client sends an extension negotiation offer that 314 includes a parameter "enable_compression" and another without this 315 parameter, the server accepts the former and informs the client by 316 sending back an element that includes parameter(s) acknowledging 317 "enable_compression". The name of the acknowledging parameter 318 doesn't need to be exactly the same as the offer. For example, two 319 parameters "enable_strong_compression" and "enable_weak_compression" 320 may be defined as acknowledging parameters for "enable_compression". 322 Compression features can be applied differently for each direction. 323 For such features, the acknowledging parameter and the parameter in 324 the reverse direction must be chosen to distinguish them. For 325 example, in order to make parameters distinguishable, a "server_" 326 prefix can be added to parameters affecting data sent from a server 327 and a "client_" prefix can be added to parameters affecting data sent 328 from a client. 330 A server MUST NOT accept a PMCE extension negotiation offer together 331 with another extension if the PMCE will conflict with the extension 332 on their use of the RSV1 bit. A client that received a response 333 accepting a PMCE extension negotiation offer together with such an 334 extension MUST _Fail the WebSocket Connection_. 336 A server MUST NOT accept a PMCE extension negotiation offer together 337 with another extension if the PMCE will be applied to the output of 338 the extension and any of the following conditions applies to the 339 extension: 341 o The extension requires the boundary of frames to be preserved 342 between the output from the extension at the sender and the input 343 to the extension at the receiver. 345 o The extension uses the "Extension data" field or any of the 346 reserved bits on the WebSocket header as a per-frame attribute. 348 A client that receives a response accepting a PMCE extension 349 negotiation offer together with such an extension MUST _Fail the 350 WebSocket Connection_. 352 A server declining all offered PMCEs MUST NOT include any element 353 with PMCE names. If a server responds with no PMCE element in the 354 "Sec-WebSocket-Extensions" header, both endpoints proceed without 355 Per-message Compression once _the WebSocket Connection is 356 established_. 358 If a server gives an invalid response, such as accepting a PMCE that 359 the client did not offer, the client MUST _Fail the WebSocket 360 Connection_. 362 If a server responds with a valid PMCE element in the 363 "Sec-WebSocket-Extensions" header and _the WebSocket Connection is 364 established_, both endpoints MUST use the algorithm described in 365 Section 6 and the message payload transformation (compressing and 366 decompressing) procedure of the PMCE configured with the "agreed 367 parameters" returned by the server to exchange messages. 369 5.1. General Negotiation Flow 371 This section describes a general negotiation flow. How to handle 372 parameters in detail must be specified in the document specifying the 373 PMCE. 375 A client makes an offer including parameters identifying the 376 following: 378 o Hints about how the client is planning to compress data 380 o Requests about how the server compresses data 382 o Limitations concerning the client's compression functionality 384 The peer server makes a determination of its behavior based on these 385 parameters. If the server can and wants to proceed with this PMCE 386 enabled, the server responds to the client with parameters 387 identifying the following: 389 o Requests about how the client compresses data 391 o How the server will compress data 393 Based on these parameters received from the server, the client 394 determines its behavior and if it can and wants to proceed with this 395 PMCE enabled. Otherwise, the client starts closing handshake with 396 close code 1010. 398 5.2. Negotiation Examples 400 The following are example values for the "Sec-WebSocket-Extensions" 401 header offering PMCEs. permessage-foo and permessage-bar in the 402 examples are hypothetical extension names of PMCEs for compression 403 algorithm foo and bar. 405 o Offer the permessage-foo. 407 permessage-foo 409 o Offer the permessage-foo with a parameter x with a value of 10. 411 permessage-foo; x=10 413 The value may be quoted. 415 permessage-foo; x="10" 417 o Offer the permessage-foo as first choice and the permessage-bar as 418 a fallback plan. 420 permessage-foo, permessage-bar 422 o Offer the permessage-foo with a parameter use_y which enables a 423 feature y as first choice, and the permessage-foo without the 424 use_y parameter as a fallback plan. 426 permessage-foo; use_y, permessage-foo 428 6. Framing 430 PMCEs operate only on data messages. 432 This document allocates the RSV1 bit of the WebSocket header for 433 PMCEs, and calls the bit the "Per-message Compressed" bit. On a 434 WebSocket connection where a PMCE is in use, this bit indicates 435 whether a message is compressed or not. 437 A message with the "Per-message Compressed" bit set on the first 438 fragment of the message is called a "compressed message". Frames of 439 a compressed message have compressed data in the payload data 440 portion. An endpoint receiving a compressed message decompresses the 441 concatenation of the compressed data of the frames of the message by 442 following the decompression procedure specified by the PMCE in use. 443 The endpoint uses the bytes corresponding to the application data 444 portion in this decompressed data for the _A WebSocket Message Has 445 Been Received_ event instead of the received data as-is. 447 A message with the "Per-message Compressed" bit unset on the first 448 fragment of the message is called an "uncompressed message". Frames 449 of an uncompressed message have uncompressed original data as-is in 450 the payload data portion. An endpoint receiving an uncompressed 451 message uses the concatenation of the application data portion of the 452 frames of the message as-is for the _A WebSocket Message Has Been 453 Received_ event. 455 6.1. Compression 457 An endpoint MUST use the following algorithm to send a message in the 458 form of a compressed message. 460 1. Compress the message payload of the original message by following 461 the compression procedure of the PMCE. The original message may 462 be input from the application layer or output of another 463 WebSocket extension depending on which extensions were 464 negotiated. 466 2. Process the compressed data as follows: 468 * If this PMCE is the last extension to process of outgoing 469 messages, build frame(s) by using the compressed data instead 470 of the original data for the message payload, and set the 471 "Per-message Compressed" bit of the first frame, then send the 472 frame(s) as described in Section 6.1 of RFC6455. 474 * Otherwise, pass the transformed message payload and modified 475 header values including the "Per-message Compressed" bit value 476 set to 1 to the extension next to the PMCE. If the extension 477 expects frames for input, build a frame for the message and 478 pass it. 480 An endpoint MUST use the following algorithm to send a message in the 481 form of an uncompressed message. 483 1. Process the original data as follows: 485 * If this PMCE is the last extension to process of outgoing 486 messages, build frame(s) by using the original data for the 487 payload data portion as-is and unset the "Per-message 488 Compressed" bit of the first frame, then send the frame(s) as 489 described in Section 6.1 of RFC6455. 491 * Otherwise, pass the message payload and header values to the 492 extension next to the PMCE as-is. If the extension expects 493 frames for input, build a frame for the message and pass it. 495 An endpoint MUST NOT set the "Per-message Compressed" bit of control 496 frames and non-first fragments of a data message. An endpoint 497 receiving such a frame MUST _Fail the WebSocket Connection_. 499 PMCEs do not change the opcode field. The opcode of the first frame 500 of a compressed message indicates the opcode of the original message. 502 The payload data portion in frames generated by a PMCE is not subject 503 to the constraints for the original data type. For example, the 504 concatenation of the output data corresponding to the application 505 data portion of frames of a compressed text message is not required 506 to be valid UTF-8. At the receiver, the payload data portion after 507 decompression is subject to the constraints for the original data 508 type again. 510 6.2. Decompression 512 An endpoint MUST use the following algorithm to receive a message in 513 the form of a compressed message. 515 1. Concatenate the payload data portion of the received frames of 516 the compressed message. The received frames may be direct input 517 from the underlying transport or output of another WebSocket 518 extension depending on which extensions were negotiated. 520 2. Decompress the concatenation by following the decompression 521 procedure of the PMCE. 523 3. Process the decompressed message as follows: 525 * If this is the last extension to process incoming messages, 526 deliver the _A WebSocket Message Has Been Received_ event to 527 the application layer with the decompressed message payload 528 and header values including the "Per-message Compressed" bit 529 unset to 0. 531 * Otherwise, pass the decompressed message payload and header 532 values including the "Per-message Compressed" bit unset to 0 533 to the extension preceding the PMCE. If the extension expects 534 frames for input, build a frame for the message and pass it. 536 An endpoint MUST use the following algorithm to receive a message in 537 the form of an uncompressed message. 539 1. Process the received message as follows: 541 * If this PMCE is the last extension to process incoming 542 messages, deliver the _A WebSocket Message Has Been Received_ 543 event to the application layer with the received message 544 payload and header values as-is. 546 * Otherwise, pass the message payload and header values to the 547 extension preceding the PMCE as-is. If the extension expects 548 frames for input, build a frame for the message and pass it. 550 7. The permessage-deflate extension 552 This section defines a specific PMCE called "permessage-deflate". It 553 compresses the payload of a message using the DEFLATE algorithm 554 [RFC1951] and uses the byte boundary alignment method introduced in 555 [RFC1979]. 557 This section uses the term "byte" with the same meaning as RFC1951, 558 i.e. 8 bits stored or transmitted as a unit (same as an octet). 560 The registered extension name for this extension is 561 "permessage-deflate". 563 Four extension parameters are defined for "permessage-deflate" to 564 help endpoints manage per-connection resource usage. 566 o "server_no_context_takeover" 568 o "client_no_context_takeover" 570 o "server_max_window_bits" 572 o "client_max_window_bits" 574 These parameters enable two methods (no_context_takeover and 575 max_window_bits) of constraining memory usage that may be applied 576 independently to either direction of WebSocket traffic. The 577 extension parameters with the "client_" prefix are used by the client 578 to configure its compressor and by the server to configure its 579 decompressor. The extension parameters with the "server_" prefix are 580 used by the server to configure its compressor and by the client to 581 configure its decompressor. All four parameters are defined for both 582 a client's extension negotiation offer and a server's extension 583 negotiation response. 585 A server MUST decline an extension negotiation offer for this 586 extension if any of the following conditions are met: 588 o The negotiation offer contains an extension parameter not defined 589 for use in an offer. 591 o The negotiation offer contains an extension parameter with an 592 invalid value. 594 o The negotiation offer contains multiple extension parameters with 595 the same name. 597 o The server doesn't support the offered configuration. 599 A client MUST _Fail the WebSocket Connection_ if the peer server 600 accepted an extension negotiation offer for this extension with an 601 extension negotiation response meeting any of the following 602 conditions: 604 o The negotiation response contains an extension parameter not 605 defined for use in a response. 607 o The negotiation response contains an extension parameter with an 608 invalid value. 610 o The negotiation response contains multiple extension parameters 611 with the same name. 613 o The client does not support the configuration that the response 614 represents. 616 The term "LZ77 sliding window" [LZ77] used in this section means the 617 buffer used by the DEFLATE algorithm to store recently processed 618 input. The DEFLATE compression algorithm searches the buffer for a 619 match with the following input. 621 The term "use context take over" used in this section means that the 622 same LZ77 sliding window used by the endpoint to build frames of the 623 previous sent message is reused to build frames of the next message 624 to be sent. 626 7.1. Extension Parameters 628 7.1.1. Context Takeover Control 630 7.1.1.1. The server_no_context_takeover extension parameter 632 A client MAY include the "server_no_context_takeover" extension 633 parameter in an extension negotiation offer. This extension 634 parameter has no value. By including this extension parameter in an 635 extension negotiation offer, a client prevents the peer server from 636 using context take over. If the peer server doesn't use context take 637 over, the client doesn't need to reserve memory to retain the LZ77 638 sliding window between messages. 640 Absence of this extension parameter in an extension negotiation offer 641 indicates that the client can decompress a message which the server 642 built using context take over. 644 A server accepts an extension negotiation offer that includes the 645 "server_no_context_takeover" extension parameter by including the 646 "server_no_context_takeover" extension parameter in the corresponding 647 extension negotiation response to send back to the client. The 648 "server_no_context_takeover" extension parameter in an extension 649 negotiation response has no value. 651 It is RECOMMENDED that a server supports the 652 "server_no_context_takeover" extension parameter in an extension 653 negotiation offer. 655 A server MAY include the "server_no_context_takeover" extension 656 parameter in an extension negotiation response even if the extension 657 negotiation offer being accepted by the extension negotiation 658 response didn't include the "server_no_context_takeover" extension 659 parameter. 661 7.1.1.2. The client_no_context_takeover extension parameter 663 A client MAY include the "client_no_context_takeover" extension 664 parameter in an extension negotiation offer. This extension 665 parameter has no value. By including this extension parameter in an 666 extension negotiation offer, a client informs the peer server of a 667 hint that even if the server doesn't include the 668 "client_no_context_takeover" extension parameter in the corresponding 669 extension negotiation response to the offer, the client is not going 670 to use context take over. 672 A server MAY include the "client_no_context_takeover" extension 673 parameter in an extension negotiation response. If the received 674 extension negotiation offer includes the "client_no_context_takeover" 675 extension parameter, the server may either ignore the parameter or 676 use the parameter to avoid taking over the LZ77 sliding window 677 unnecessarily by including the "client_no_context_takeover" extension 678 parameter in the corresponding extension negotiation response to the 679 offer. The "client_no_context_takeover" extension parameter in an 680 extension negotiation response has no value. By including the 681 "client_no_context_takeover" extension parameter in an extension 682 negotiation response, a server prevents the peer client from using 683 context take over. This reduces the amount of memory that the server 684 has to reserve for the connection. 686 Absence of this extension parameter in an extension negotiation 687 response indicates that the server can decompress messages built by 688 the client using context take over. 690 A client MUST support the "client_no_context_takeover" extension 691 parameter in an extension negotiation response. 693 7.1.2. Limiting the LZ77 sliding window size 695 7.1.2.1. The server_max_window_bits extension parameter 697 A client MAY include the "server_max_window_bits" extension parameter 698 in an extension negotiation offer. This parameter has a decimal 699 integer value without leading zeroes between 8 to 15 inclusive 700 indicating the base-2 logarithm of the LZ77 sliding window size and 701 MUST conform to the ABNF below. 703 server_max_window_bits = 1*DIGIT 705 By including this parameter in an extension negotiation offer, a 706 client limits the LZ77 sliding window size that the server will use 707 to compress messages. If the peer server uses a small LZ77 sliding 708 window to compress messages, the client can reduce the memory needed 709 for the LZ77 sliding window. 711 A server declines an extension negotiation offer with this parameter 712 if the server doesn't support it. 714 Absence of this parameter in an extension negotiation offer indicates 715 that the client can receive messages compressed using an LZ77 sliding 716 window of up to 32,768 bytes. 718 A server accepts an extension negotiation offer with this parameter 719 by including the "server_max_window_bits" extension parameter in the 720 extension negotiation response to send back to the client with the 721 same or smaller value as the offer. The "server_max_window_bits" 722 extension parameter in an extension negotiation response has a 723 decimal integer value without leading zeroes between 8 to 15 724 inclusive indicating the base-2 logarithm of the LZ77 sliding window 725 size and MUST conform to the ABNF below. 727 server_max_window_bits = 1*DIGIT 729 A server MAY include the "server_max_window_bits" extension parameter 730 in an extension negotiation response even if the extension 731 negotiation offer being accepted by the response didn't include the 732 "server_max_window_bits" extension parameter. 734 7.1.2.2. The client_max_window_bits extension parameter 736 A client MAY include the "client_max_window_bits" extension parameter 737 in an extension negotiation offer. This parameter has no value or a 738 decimal integer value without leading zeroes between 8 to 15 739 inclusive indicating the base-2 logarithm of the LZ77 sliding window 740 size. If a value is specified for this parameter, the value MUST 741 conform to the ABNF below. 743 client_max_window_bits = 1*DIGIT 745 By including this parameter in an offer, a client informs the peer 746 server that the client supports the "client_max_window_bits" 747 extension parameter in an extension negotiation response, and 748 optionally a hint by attaching a value to the parameter. If the 749 "client_max_window_bits" extension parameter in an extension 750 negotiation offer has a value, the parameter also informs the peer 751 server of a hint that even if the server doesn't include the 752 "client_max_window_bits" extension parameter in the corresponding 753 extension negotiation response with a value greater than the one in 754 the extension negotiation offer or the server doesn't include the 755 extension parameter at all, the client is not going to use an LZ77 756 sliding window size greater than the size specified by the value in 757 the extension negotiation offer to compress messages. 759 If a received extension negotiation offer has the 760 "client_max_window_bits" extension parameter, the server MAY include 761 the "client_max_window_bits" extension parameter in the corresponding 762 extension negotiation response to the offer. If the 763 "client_max_window_bits" extension parameter in a received extension 764 negotiation offer has a value, the server may either ignore this 765 value or use this value to avoid allocating an unnecessarily big LZ77 766 sliding window by including the "client_max_window_bits" extension 767 parameter in the corresponding extension negotiation response to the 768 offer with a value equal to or smaller than the received value. The 769 "client_max_window_bits" extension parameter in an extension 770 negotiation response has a decimal integer value without leading 771 zeroes between 8 to 15 inclusive indicating the base-2 logarithm of 772 the LZ77 sliding window size and MUST conform to the ABNF below. 774 client_max_window_bits = 1*DIGIT 776 By including this extension parameter in an extension negotiation 777 response, a server limits the LZ77 sliding window size that the 778 client uses to compress messages. This reduces the amount of memory 779 for the decompression context that the server has to reserve for the 780 connection. 782 If a received extension negotiation offer doesn't have the 783 "client_max_window_bits" extension parameter, the corresponding 784 extension negotiation response to the offer MUST NOT include the 785 "client_max_window_bits" extension parameter. 787 Absence of this extension parameter in an extension negotiation 788 response indicates that the server can receive messages compressed 789 using an LZ77 sliding window of up to 32,768 bytes. 791 7.1.3. Examples 793 The simplest "Sec-WebSocket-Extensions" header in a client's opening 794 handshake to offer use of the permessage-deflate extension looks like 795 this: 797 Sec-WebSocket-Extensions: permessage-deflate 799 Since the "client_max_window_bits" extension parameter is not 800 included in this extension negotiation offer, the server must not 801 accept the offer with an extension negotiation response that includes 802 the "client_max_window_bits" extension parameter. The simplest 803 "Sec-WebSocket-Extensions" header in a server's opening handshake to 804 accept use of the permessage-deflate extension is the same: 806 Sec-WebSocket-Extensions: permessage-deflate 808 The following extension negotiation offer sent by a client is asking 809 the server to use an LZ77 sliding window with a size of 1,024 bytes 810 or less and declaring that the client supports the 811 "client_max_window_bits" extension parameter in an extension 812 negotiation response. 814 Sec-WebSocket-Extensions: 815 permessage-deflate; 816 client_max_window_bits; server_max_window_bits=10 818 This extension negotiation offer might be rejected by the server 819 because the server doesn't support the "server_max_window_bits" 820 extension parameter in an extension negotiation offer. This is fine 821 if the client cannot receive messages compressed using a larger 822 sliding window size, but if the client just prefers using a small 823 window but wants to fall back to the "permessage-deflate" without the 824 "server_max_window_bits" extension parameter, the client can make an 825 offer with the fallback option like this: 827 Sec-WebSocket-Extensions: 828 permessage-deflate; 829 client_max_window_bits; server_max_window_bits=10, 830 permessage-deflate; 831 client_max_window_bits 833 The server can accept permessage-deflate by picking any supported one 834 from the listed offers. To accept the first option, for example, the 835 server may send back a response as follows: 837 Sec-WebSocket-Extensions: 838 permessage-deflate; server_max_window_bits=10 840 To accept the second option, for example, the server may send back a 841 response as follows: 843 Sec-WebSocket-Extensions: permessage-deflate 845 7.2. Message Payload Transformation 847 7.2.1. Compression 849 An endpoint uses the following algorithm to compress a message. 851 1. Compress all the octets of the payload of the message using 852 DEFLATE. 854 2. If the resulting data does not end with an empty DEFLATE block 855 with no compression (the "BTYPE" bits are set to 00), append an 856 empty DEFLATE block with no compression to the tail end. 858 3. Remove 4 octets (that are 0x00 0x00 0xff 0xff) from the tail end. 859 After this step, the last octet of the compressed data contains 860 (possibly part of) the DEFLATE header bits with the "BTYPE" bits 861 set to 00. 863 When using DEFLATE in the first step above: 865 o An endpoint MAY use multiple DEFLATE blocks to compress one 866 message. 868 o An endpoint MAY use DEFLATE blocks of any type. 870 o An endpoint MAY use both DEFLATE blocks with the "BFINAL" bit set 871 to 0 and DEFLATE blocks with the "BFINAL" bit set to 1. 873 o When any DEFLATE block with the "BFINAL" bit set to 1 doesn't end 874 at a byte boundary, an endpoint MUST add minimal padding bits of 0 875 to make it end at a byte boundary. The next DEFLATE block follows 876 the padded data if any. 878 An endpoint fragments a compressed message by splitting the result of 879 running this algorithm. Even when only part of the payload is 880 available, a fragment can be built by compressing the available data 881 and choosing the block type appropriately so that the end of the 882 resulting compressed data is aligned at a byte boundary. Note that 883 for non-final fragments, the removal of 0x00 0x00 0xff 0xff MUST NOT 884 be done. 886 An endpoint MUST NOT use an LZ77 sliding window longer than 32,768 887 bytes to compress messages to send. 889 If the "agreed parameters" contain the "client_no_context_takeover" 890 extension parameter, the client MUST start compressing each new 891 message with an empty LZ77 sliding window. Otherwise, the client MAY 892 take over the LZ77 sliding window used to build the last compressed 893 message. Note that even if the client has included the 894 "client_no_context_takeover" extension parameter in its offer, the 895 client MAY take over the LZ77 sliding window used to build the last 896 compressed message if the "agreed parameters" don't contain the 897 "client_no_context_takeover" extension parameter. The client-to- 898 server "client_no_context_takeover" extension parameter is just a 899 hint for the server to build an extension negotiation response. 901 If the "agreed parameters" contain the "server_no_context_takeover" 902 extension parameter, the server MUST start compressing each new 903 message with an empty LZ77 sliding window. Otherwise, the server MAY 904 take over the LZ77 sliding window used to build the last compressed 905 message. 907 If the "agreed parameters" contain the "client_max_window_bits" 908 extension parameter with a value of w, the client MUST NOT use an 909 LZ77 sliding window longer than the w-th power of 2 bytes to compress 910 messages to send. Note that even if the client has included in its 911 offer the "client_max_window_bits" extension parameter with a value 912 smaller than one in the "agreed parameters", the client MAY use an 913 LZ77 sliding window with any size to compress messages to send as 914 long as the size conforms to the "agreed parameters". The client-to- 915 server "client_max_window_bits" extension parameter is just a hint 916 for the server to build an extension negotiation response. 918 If the "agreed parameters" contain the "server_max_window_bits" 919 extension parameter with a value of w, the server MUST NOT use an 920 LZ77 sliding window longer than the w-th power of 2 bytes to compress 921 messages to send. 923 7.2.2. Decompression 925 An endpoint uses the following algorithm to decompress a message. 927 1. Append 4 octets of 0x00 0x00 0xff 0xff to the tail end of the 928 payload of the message. 930 2. Decompress the resulting data using DEFLATE. 932 If the "agreed parameters" contain the "server_no_context_takeover" 933 extension parameter, the client MAY decompress each new message with 934 an empty LZ77 sliding window. Otherwise, the client MUST decompress 935 each new message using the LZ77 sliding window used to process the 936 last compressed message. 938 If the "agreed parameters" contain the "client_no_context_takeover" 939 extension parameter, the server MAY decompress each new message with 940 an empty LZ77 sliding window. Otherwise, the server MUST decompress 941 each new message using the LZ77 sliding window used to process the 942 last compressed message. Note that even if the client has included 943 the "client_no_context_takeover" extension parameter in its offer, 944 the server MUST decompress each new message using the LZ77 sliding 945 window used to process the last compressed message if the "agreed 946 parameters" don't contain the "client_no_context_takeover" extension 947 parameter. The client-to-server "client_no_context_takeover" 948 extension parameter is just a hint for the server to build an 949 extension negotiation response. 951 If the "agreed parameters" contain the "server_max_window_bits" 952 extension parameter with a value of w, the client MAY reduce the size 953 of its LZ77 sliding window to decompress received messages down to 954 the w-th power of 2 bytes. Otherwise, the client MUST use a 32,768 955 byte LZ77 sliding window to decompress received messages. 957 If the "agreed parameters" contain the "client_max_window_bits" 958 extension parameter with a value of w, the server MAY reduce the size 959 of its LZ77 sliding window to decompress received messages down to 960 the w-th power of 2 bytes. Otherwise, the server MUST use a 32,768 961 byte LZ77 sliding window to decompress received messages. Note that 962 even if the client has included in its offer the 963 "client_max_window_bits" extension parameter with a value smaller 964 than one in the "agreed parameters", the client MUST use an LZ77 965 sliding window of a size that conforms the "agreed parameters" to 966 compress messages to send. The client-to-server 967 "client_max_window_bits" extension parameter is just a hint for the 968 server to build an extension negotiation response. 970 7.2.3. Examples 972 This section introduces examples of how the permessage-deflate 973 extension transforms messages. 975 7.2.3.1. A message compressed using 1 compressed DEFLATE block 977 Suppose that an endpoint sends a text message "Hello". If the 978 endpoint uses 1 compressed DEFLATE block (compressed with fixed 979 Huffman code and the "BFINAL" bit not set) to compress the message, 980 the endpoint obtains the compressed data to use for the message 981 payload as follows. 983 The endpoint compresses "Hello" into 1 compressed DEFLATE block and 984 flushes the resulting data into a byte array using an empty DEFLATE 985 block with no compression: 987 0xf2 0x48 0xcd 0xc9 0xc9 0x07 0x00 0x00 0x00 0xff 0xff 989 By stripping 0x00 0x00 0xff 0xff from the tail end, the endpoint gets 990 the data to use for the message payload: 992 0xf2 0x48 0xcd 0xc9 0xc9 0x07 0x00 994 Suppose that the endpoint sends this compressed message without 995 fragmentation. The endpoint builds one frame by putting the whole 996 compressed data in the payload data portion of the frame: 998 0xc1 0x07 0xf2 0x48 0xcd 0xc9 0xc9 0x07 0x00 1000 The first 2 octets (0xc1 0x07) are the WebSocket frame header (FIN=1, 1001 RSV1=1, RSV2=0, RSV3=0, opcode=text, MASK=0, Payload length=7). The 1002 following figure shows what value is set in each field of the 1003 WebSocket frame header. 1005 0 1 1006 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 1007 +-+-+-+-+-------+-+-------------+ 1008 |F|R|R|R| opcode|M| Payload len | 1009 |I|S|S|S| |A| | 1010 |N|V|V|V| |S| | 1011 | |1|2|3| |K| | 1012 +-+-+-+-+-------+-+-------------+ 1013 |1|1|0|0| 1 |0| 7 | 1014 +-+-+-+-+-------+-+-------------+ 1016 Suppose that the endpoint sends the compressed message with 1017 fragmentation. The endpoint splits the compressed data into 1018 fragments and builds frames for each fragment. For example, if the 1019 fragments are 3 and 4 octet, the first frame is: 1021 0x41 0x03 0xf2 0x48 0xcd 1023 and the second frame is: 1025 0x80 0x04 0xc9 0xc9 0x07 0x00 1027 Note that the RSV1 bit is set only on the first frame. 1029 7.2.3.2. Sharing LZ77 Sliding Window 1031 Suppose that a client has sent a message "Hello" as a compressed 1032 message and will send the same message "Hello" again as a compressed 1033 message. 1035 0xf2 0x48 0xcd 0xc9 0xc9 0x07 0x00 1037 The above is the payload of the first message that the client has 1038 sent. If the "agreed parameters" contain the 1039 "client_no_context_takeover" extension parameter, the client 1040 compresses the payload of the next message into the same bytes (if 1041 the client uses the same "BTYPE" value and "BFINAL" value). So, the 1042 payload of the second message will be: 1044 0xf2 0x48 0xcd 0xc9 0xc9 0x07 0x00 1046 If the "agreed parameters" did not contain the 1047 "client_no_context_takeover" extension parameter, the client can 1048 compress the payload of the next message into less bytes by 1049 referencing the history in the LZ77 sliding window. So, the payload 1050 of the second message will be: 1052 0xf2 0x00 0x11 0x00 0x00 1054 So, 2 bytes are saved in total. 1056 Note that even if some uncompressed messages (with the RSV1 bit 1057 unset) are inserted between the two "Hello" messages, they don't 1058 affect the LZ77 sliding window. 1060 7.2.3.3. Using a DEFLATE Block with No Compression 1062 0xc1 0x0b 0x00 0x05 0x00 0xfa 0xff 0x48 0x65 0x6c 0x6c 0x6f 0x00 1064 This is a frame constituting a text message "Hello" built using a 1065 DEFLATE block with no compression. The first 2 octets (0xc1 0x0b) 1066 are the WebSocket frame header (FIN=1, RSV1=1, RSV2=0, RSV3=0, 1067 opcode=text, MASK=0, Payload length=7). Note that the RSV1 bit is 1068 set for this message (only on the first fragment if the message is 1069 fragmented) because the RSV1 bit is set when DEFLATE is applied to 1070 the message, including the case when only DEFLATE blocks with no 1071 compression are used. The 3rd to 13th octets consist the payload 1072 data containing "Hello" compressed using a DEFLATE block with no 1073 compression. 1075 7.2.3.4. Using a DEFLATE Block with BFINAL Set to 1 1077 On platforms on which the flush method using an empty DEFLATE block 1078 with no compression is not available, implementors can choose to 1079 flush data using DEFLATE blocks with "BFINAL" set to 1. 1081 0xf3 0x48 0xcd 0xc9 0xc9 0x07 0x00 0x00 1083 This is the payload of a message containing "Hello" compressed using 1084 a DEFLATE block with "BFINAL" set to 1. The first 7 octets 1085 constitute a DEFLATE block with "BFINAL" set to 1 and "BTYPE" set to 1086 01 containing "Hello". The last 1 octet (0x00) contains the header 1087 bits with "BFINAL" set to 0 and "BTYPE" set to 00, and 5 padding bits 1088 of 0. This octet is necessary to allow the payload to be 1089 decompressed in the same manner as messages flushed using DEFLATE 1090 blocks with BFINAL unset. 1092 7.2.3.5. Two DEFLATE Blocks in 1 Message 1094 Two or more DEFLATE blocks may be used in 1 message. 1096 0xf2 0x48 0x05 0x00 0x00 0x00 0xff 0xff 0xca 0xc9 0xc9 0x07 0x00 1098 The first 3 octets (0xf2 0x48 0x05) and the least significant two 1099 bits of the 4th octet (0x00) constitute one DEFLATE block with 1100 "BFINAL" set to 0 and "BTYPE" set to 01 containing "He". The rest of 1101 the 4th octet contains the header bits with "BFINAL" set to 0 and 1102 "BTYPE" set to 00, and the 3 padding bits of 0. Together with the 1103 following 4 octets (0x00 0x00 0xff 0xff), the header bits constitute 1104 an empty DEFLATE block with no compression. A DEFLATE block 1105 containing "llo" follows the empty DEFLATE block. 1107 7.2.3.6. Generating an Empty Fragment 1109 Suppose that an endpoint is sending data of unknown size. The 1110 endpoint may encounter the end of data signal from the data source 1111 when its buffer for uncompressed data is empty. In such a case, the 1112 endpoint just needs to send the last fragment with FIN bit set to 1 1113 and payload set to DEFLATE block(s) which contains 0 bytes of data. 1114 If the compression library being used doesn't generate any data when 1115 its buffer is empty, an empty uncompressed DEFLATE block can be built 1116 and used for this purpose as follows: 1118 0x00 1120 The only octet 0x00 contains the header bits with "BFINAL" set to 0 1121 and "BTYPE" set to 00, and 5 padding bits of 0. 1123 7.3. Implementation Notes 1125 On most common software development platforms, the DEFLATE 1126 compression library provides a method for aligning compressed data to 1127 byte boundaries using an empty DEFLATE block with no compression. 1128 For example, Zlib [Zlib] does this when "Z_SYNC_FLUSH" is passed to 1129 the deflate function. 1131 Some platforms may provide only methods to output and process 1132 compressed data with a ZLIB header and an Adler-32 checksum. On such 1133 platforms, developers need to write stub code to remove and 1134 complement them by themselves. 1136 To obtain a useful compression ratio, an LZ77 sliding window size of 1137 1,024 or more is RECOMMENDED. 1139 If a side disallows context takeover, its endpoint can easily figure 1140 out whether a certain message will be shorter if compressed or not. 1141 Otherwise, it's not easy to know whether future messages will benefit 1142 from having a certain message compressed. Implementors may employ 1143 some heuristics to determine this. 1145 8. Security Considerations 1147 There is a known exploit when history-based compression is combined 1148 with a secure transport [CRIME]. Implementors should pay attention 1149 to this point when integrating this extension with other extensions 1150 or protocols. 1152 9. IANA Considerations 1154 9.1. Registration of the "permessage-deflate" WebSocket Extension Name 1156 This section describes a WebSocket extension name registration in the 1157 WebSocket Extension Name Registry [RFC6455]. 1159 Extension Identifier 1160 permessage-deflate 1162 Extension Common Name 1163 WebSocket Per-message Deflate 1165 Extension Definition 1166 This document. 1168 Known Incompatible Extensions 1169 None 1171 The "permessage-deflate" extension name is used in the 1172 "Sec-WebSocket-Extensions" header in the WebSocket opening handshake 1173 to negotiate use of the permessage-deflate extension. 1175 9.2. Registration of the "Per-message Compressed" WebSocket Framing 1176 Header Bit 1178 This section describes a WebSocket framing header bit registration in 1179 the WebSocket Framing Header Bits Registry [RFC6455]. 1181 Value 1182 RSV1 1184 Description 1185 The message is compressed or not. RSV1 is set for compressed 1186 messages and unset for uncompressed messages. 1188 Reference 1189 Section 6 of this document. 1191 The "Per-message Compressed" framing header bit is used on the first 1192 fragment of data messages to indicate whether the payload of the 1193 message is compressed by the PMCE or not. 1195 10. Acknowledgements 1197 Special thanks to Patrick McManus who wrote up the initial 1198 specification of a DEFLATE-based compression extension for the 1199 WebSocket Protocol to which I referred to write this specification. 1201 Thanks to the following people who participated in discussions on the 1202 HyBi WG and contributed ideas and/or provided detailed reviews (the 1203 list is likely to be incomplete): Adam Rice, Alexander Philippou, 1204 Alexey Melnikov, Arman Djusupov, Bjoern Hoehrmann, Brian McKelvey, 1205 Dario Crivelli, Greg Wilkins, Inaki Baz Castillo, Jamie Lokier, 1206 Joakim Erdfelt, John A. Tamplin, Julian Reschke, Kenichi Ishibashi, 1207 Mark Nottingham, Peter Thorson, Roberto Peon, Salvatore Loreto, 1208 Simone Bordet, Tobias Oberstein and Yutaka Hirano. Note that people 1209 listed above didn't necessarily endorse the end result of this work. 1211 11. References 1213 11.1. Normative References 1215 [RFC1951] Deutsch, P., "DEFLATE Compressed Data Format Specification 1216 version 1.3", RFC 1951, May 1996. 1218 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 1219 Specifications: ABNF", STD 68, RFC 5234, January 2008. 1221 [RFC6455] Fette, I. and A. Melnikov, "The WebSocket Protocol", 1222 RFC 6455, December 2011. 1224 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1225 Requirement Levels", BCP 14, RFC 2119, March 1997. 1227 [LZ77] Ziv, J. and A. Lempel, "A Universal Algorithm for 1228 Sequential Data Compression", IEEE Transactions on 1229 Information Theory, Vol. 23, No. 3, pp. 337-343. 1231 [CRIME] Rizzo, J. and T. Duong, "The CRIME attack", Ekoparty 2012, 1232 September 2012. 1234 11.2. Informative References 1236 [RFC1979] Woods, J., "PPP Deflate Protocol", RFC 1979, August 1996. 1238 [Zlib] Gailly, J. and M. Adler, "Zlib", . 1240 Author's Address 1242 Takeshi Yoshino 1243 Google, Inc. 1245 Email: tyoshino@google.com