draft-ietf-hybi-permessage-compression-16.txt   draft-ietf-hybi-permessage-compression-17.txt 
HyBi Working Group T. Yoshino HyBi Working Group T. Yoshino
Internet-Draft Google, Inc. Internet-Draft Google, Inc.
Intended status: Standards Track January 14, 2014 Intended status: Standards Track January 22, 2014
Expires: July 18, 2014 Expires: July 26, 2014
Compression Extensions for WebSocket Compression Extensions for WebSocket
draft-ietf-hybi-permessage-compression-16 draft-ietf-hybi-permessage-compression-17
Abstract Abstract
This document specifies a framework for creating WebSocket extensions This document specifies 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 non-control WebSocket messages on a per-message basis using
parameters negotiated during the opening handshake. This framework parameters negotiated during the opening handshake. This framework
provides a general method to apply a compression algorithm to the provides a general method to apply a compression algorithm to the
contents of WebSocket messages. For each compression algorithm, an contents of WebSocket messages. For each compression algorithm, an
skipping to change at page 1, line 41 skipping to change at page 1, line 41
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 July 18, 2014. This Internet-Draft will expire on July 26, 2014.
Copyright Notice Copyright Notice
Copyright (c) 2014 IETF Trust and the persons identified as the Copyright (c) 2014 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
skipping to change at page 2, line 33 skipping to change at page 2, line 33
7. Intermediaries . . . . . . . . . . . . . . . . . . . . . . . . 14 7. Intermediaries . . . . . . . . . . . . . . . . . . . . . . . . 14
8. permessage-deflate extension . . . . . . . . . . . . . . . . . 15 8. permessage-deflate extension . . . . . . . . . . . . . . . . . 15
8.1. Method Parameters . . . . . . . . . . . . . . . . . . . . 16 8.1. Method Parameters . . . . . . . . . . . . . . . . . . . . 16
8.1.1. Context Takeover Control . . . . . . . . . . . . . . . 16 8.1.1. Context Takeover Control . . . . . . . . . . . . . . . 16
8.1.2. Limiting the LZ77 sliding window size . . . . . . . . 18 8.1.2. Limiting the LZ77 sliding window size . . . . . . . . 18
8.1.3. Example . . . . . . . . . . . . . . . . . . . . . . . 20 8.1.3. Example . . . . . . . . . . . . . . . . . . . . . . . 20
8.2. Message Payload Transformation . . . . . . . . . . . . . . 21 8.2. Message Payload Transformation . . . . . . . . . . . . . . 21
8.2.1. Compression . . . . . . . . . . . . . . . . . . . . . 21 8.2.1. Compression . . . . . . . . . . . . . . . . . . . . . 21
8.2.2. Decompression . . . . . . . . . . . . . . . . . . . . 22 8.2.2. Decompression . . . . . . . . . . . . . . . . . . . . 22
8.2.3. Examples . . . . . . . . . . . . . . . . . . . . . . . 23 8.2.3. Examples . . . . . . . . . . . . . . . . . . . . . . . 23
8.3. Implementation Notes . . . . . . . . . . . . . . . . . . . 26 8.3. Implementation Notes . . . . . . . . . . . . . . . . . . . 27
8.4. Intermediaries . . . . . . . . . . . . . . . . . . . . . . 27 8.4. Intermediaries . . . . . . . . . . . . . . . . . . . . . . 27
9. Security Considerations . . . . . . . . . . . . . . . . . . . 28 9. Security Considerations . . . . . . . . . . . . . . . . . . . 28
10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 29 10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 29
10.1. Registration of the "permessage-deflate" WebSocket 10.1. Registration of the "permessage-deflate" WebSocket
Extension Name . . . . . . . . . . . . . . . . . . . . . . 29 Extension Name . . . . . . . . . . . . . . . . . . . . . . 29
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 . . . . . . . . . . . . . . . . . . . . 29
11. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 30 11. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 30
12. References . . . . . . . . . . . . . . . . . . . . . . . . . . 31 12. References . . . . . . . . . . . . . . . . . . . . . . . . . . 31
12.1. Normative References . . . . . . . . . . . . . . . . . . . 31 12.1. Normative References . . . . . . . . . . . . . . . . . . . 31
skipping to change at page 26, line 38 skipping to change at page 26, line 38
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
Suppose that an endpoint is sending data with unknown size. The
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
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
the compression library being used doesn't generate any data when its
buffer is empty, an empty uncompressed DEFLATE block can be built
manually and used for this purpose as follows:
0x00
The only octet 0x00 contains the header bits with "BFINAL" set to 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, their DEFLATE
compression library provides a method to align compressed data to compression library provides a method to align 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 ZLIB header and Adler-32 checksum. On such
 End of changes. 5 change blocks. 
5 lines changed or deleted 21 lines changed or added

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