draft-ietf-httpbis-header-compression-04.txt   draft-ietf-httpbis-header-compression-05.txt 
HTTPbis Working Group R. Peon HTTPbis Working Group R. Peon
Internet-Draft Google, Inc Internet-Draft Google, Inc
Intended status: Informational H. Ruellan Intended status: Informational H. Ruellan
Expires: April 24, 2014 Canon CRF Expires: June 7, 2014 Canon CRF
October 21, 2013 December 4, 2013
HPACK - Header Compression for HTTP/2.0 HPACK - Header Compression for HTTP/2.0
draft-ietf-httpbis-header-compression-04 draft-ietf-httpbis-header-compression-05
Abstract Abstract
This document describes HPACK, a format adapted to efficiently This document describes HPACK, a format adapted to efficiently
represent HTTP header fields in the context of HTTP/2.0. represent HTTP header fields in the context of HTTP/2.0.
Editorial Note (To be removed by RFC Editor) Editorial Note (To be removed by RFC Editor)
Discussion of this draft takes place on the HTTPBIS working group Discussion of this draft takes place on the HTTPBIS working group
mailing list (ietf-http-wg@w3.org), which is archived at mailing list (ietf-http-wg@w3.org), which is archived at
skipping to change at page 1, line 45 skipping to change at page 1, line 45
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 April 24, 2014. This Internet-Draft will expire on June 7, 2014.
Copyright Notice Copyright Notice
Copyright (c) 2013 IETF Trust and the persons identified as the Copyright (c) 2013 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 3, line 19 skipping to change at page 2, line 30
2.1. Outline . . . . . . . . . . . . . . . . . . . . . . . . . 4 2.1. Outline . . . . . . . . . . . . . . . . . . . . . . . . . 4
3. Header Field Encoding . . . . . . . . . . . . . . . . . . . . 5 3. Header Field Encoding . . . . . . . . . . . . . . . . . . . . 5
3.1. Encoding Concepts . . . . . . . . . . . . . . . . . . . . 5 3.1. Encoding Concepts . . . . . . . . . . . . . . . . . . . . 5
3.1.1. Encoding Context . . . . . . . . . . . . . . . . . . . 5 3.1.1. Encoding Context . . . . . . . . . . . . . . . . . . . 5
3.1.2. Header Table . . . . . . . . . . . . . . . . . . . . . 6 3.1.2. Header Table . . . . . . . . . . . . . . . . . . . . . 6
3.1.3. Reference Set . . . . . . . . . . . . . . . . . . . . 6 3.1.3. Reference Set . . . . . . . . . . . . . . . . . . . . 6
3.1.4. Header Field Representation . . . . . . . . . . . . . 7 3.1.4. Header Field Representation . . . . . . . . . . . . . 7
3.1.5. Header Field Emission . . . . . . . . . . . . . . . . 8 3.1.5. Header Field Emission . . . . . . . . . . . . . . . . 8
3.2. Header Block Decoding . . . . . . . . . . . . . . . . . . 8 3.2. Header Block Decoding . . . . . . . . . . . . . . . . . . 8
3.2.1. Header Field Representation Processing . . . . . . . . 8 3.2.1. Header Field Representation Processing . . . . . . . . 8
3.2.2. Reference Set Emission . . . . . . . . . . . . . . . . 9 3.2.2. Reference Set Emission . . . . . . . . . . . . . . . . 10
3.2.3. Header Set Completion . . . . . . . . . . . . . . . . 9 3.2.3. Header Set Completion . . . . . . . . . . . . . . . . 10
3.3. Header Table Management . . . . . . . . . . . . . . . . . 9 3.3. Header Table Management . . . . . . . . . . . . . . . . . 10
3.3.1. Maximum Table Size . . . . . . . . . . . . . . . . . . 9 3.3.1. Maximum Table Size . . . . . . . . . . . . . . . . . . 10
3.3.2. Entry Eviction When Header Table Size Changes . . . . 10 3.3.2. Entry Eviction When Header Table Size Changes . . . . 10
3.3.3. Entry Eviction when Adding New Entries . . . . . . . . 10 3.3.3. Entry Eviction when Adding New Entries . . . . . . . . 11
4. Detailed Format . . . . . . . . . . . . . . . . . . . . . . . 10 4. Detailed Format . . . . . . . . . . . . . . . . . . . . . . . 11
4.1. Low-level representations . . . . . . . . . . . . . . . . 10 4.1. Low-level representations . . . . . . . . . . . . . . . . 11
4.1.1. Integer representation . . . . . . . . . . . . . . . . 11 4.1.1. Integer representation . . . . . . . . . . . . . . . . 11
4.1.2. String Literal Representation . . . . . . . . . . . . 13 4.1.2. String Literal Representation . . . . . . . . . . . . 13
4.2. Indexed Header Field Representation . . . . . . . . . . . 14 4.2. Indexed Header Field Representation . . . . . . . . . . . 15
4.3. Literal Header Field Representation . . . . . . . . . . . 15 4.3. Literal Header Field Representation . . . . . . . . . . . 15
4.3.1. Literal Header Field without Indexing . . . . . . . . 15 4.3.1. Literal Header Field without Indexing . . . . . . . . 15
4.3.2. Literal Header Field with Incremental Indexing . . . . 16 4.3.2. Literal Header Field with Incremental Indexing . . . . 16
5. Security Considerations . . . . . . . . . . . . . . . . . . . 17 5. Security Considerations . . . . . . . . . . . . . . . . . . . 18
6. References . . . . . . . . . . . . . . . . . . . . . . . . . . 18 6. References . . . . . . . . . . . . . . . . . . . . . . . . . . 18
6.1. Normative References . . . . . . . . . . . . . . . . . . . 18 6.1. Normative References . . . . . . . . . . . . . . . . . . . 18
6.2. Informative References . . . . . . . . . . . . . . . . . . 18 6.2. Informative References . . . . . . . . . . . . . . . . . . 19
Appendix A. Change Log (to be removed by RFC Editor before Appendix A. Change Log (to be removed by RFC Editor before
publication . . . . . . . . . . . . . . . . . . . . . 19 publication . . . . . . . . . . . . . . . . . . . . . 19
A.1. Since draft-ietf-httpbis-header-compression-03 . . . . . . 19 A.1. Since draft-ietf-httpbis-header-compression-04 . . . . . . 19
A.2. Since draft-ietf-httpbis-header-compression-02 . . . . . . 19 A.2. Since draft-ietf-httpbis-header-compression-03 . . . . . . 20
A.3. Since draft-ietf-httpbis-header-compression-01 . . . . . . 19 A.3. Since draft-ietf-httpbis-header-compression-02 . . . . . . 20
A.4. Since draft-ietf-httpbis-header-compression-01 . . . . . . 19 A.4. Since draft-ietf-httpbis-header-compression-01 . . . . . . 20
Appendix B. Static Table . . . . . . . . . . . . . . . . . . . . 20 A.5. Since draft-ietf-httpbis-header-compression-01 . . . . . . 21
Appendix C. Huffman Codes For Requests . . . . . . . . . . . . . 22 Appendix B. Static Table . . . . . . . . . . . . . . . . . . . . 21
Appendix D. Huffman Codes for Responses . . . . . . . . . . . . . 28 Appendix C. Huffman Codes For Requests . . . . . . . . . . . . . 23
Appendix E. Examples . . . . . . . . . . . . . . . . . . . . . . 33 Appendix D. Huffman Codes for Responses . . . . . . . . . . . . . 29
E.1. Request Decoding Example With Huffman . . . . . . . . . . 33 Appendix E. Examples . . . . . . . . . . . . . . . . . . . . . . 34
E.2. Request Decoding Example Without Huffman . . . . . . . . . 38 E.1. Header Field Representation Examples . . . . . . . . . . . 34
E.3. Response Decoding Example With Huffman . . . . . . . . . . 43 E.1.1. Literal Header Field with Indexing . . . . . . . . . . 34
E.4. Response Decoding Example Without Huffman . . . . . . . . 51 E.1.2. Literal Header Field without Indexing . . . . . . . . 35
E.1.3. Indexed Header Field . . . . . . . . . . . . . . . . . 36
E.1.4. Indexed Header Field from Static Table . . . . . . . . 37
E.2. Request Examples without Huffman . . . . . . . . . . . . . 37
E.2.1. First request . . . . . . . . . . . . . . . . . . . . 37
E.2.2. Second request . . . . . . . . . . . . . . . . . . . . 38
E.2.3. Third request . . . . . . . . . . . . . . . . . . . . 40
E.3. Request Examples with Huffman . . . . . . . . . . . . . . 42
E.3.1. First request . . . . . . . . . . . . . . . . . . . . 42
E.3.2. Second request . . . . . . . . . . . . . . . . . . . . 43
E.3.3. Third request . . . . . . . . . . . . . . . . . . . . 44
E.4. Response Examples without Huffman . . . . . . . . . . . . 46
E.4.1. First response . . . . . . . . . . . . . . . . . . . . 46
E.4.2. Second response . . . . . . . . . . . . . . . . . . . 48
E.4.3. Third response . . . . . . . . . . . . . . . . . . . . 49
E.5. Response Examples with Huffman . . . . . . . . . . . . . . 51
E.5.1. First response . . . . . . . . . . . . . . . . . . . . 51
E.5.2. Second response . . . . . . . . . . . . . . . . . . . 53
E.5.3. Third response . . . . . . . . . . . . . . . . . . . . 54
1. Introduction 1. Introduction
This document describes HPACK, a format adapted to efficiently This document describes HPACK, a format adapted to efficiently
represent HTTP header fields in the context of HTTP/2.0 (see represent HTTP header fields in the context of HTTP/2.0 (see
[HTTP2]). [HTTP2]).
2. Overview 2. Overview
In HTTP/1.X (see [HTTP-p1]), header fields are sent without any form In HTTP (see [HTTP-p1]), header fields are sent without any form of
of compression. As web pages have grown to include dozens to compression. As web pages have grown to include dozens to hundreds
hundreds of requests, the redundant header fields in these requests of requests, the redundant header fields in these requests now pose a
now pose a problem of measurable latency and unnecessary bandwidth problem of measurable latency and unnecessary bandwidth (see [PERF1]
(see [PERF1] and [PERF2]). and [PERF2]).
SPDY [SPDY] initially addressed this redundancy by compressing header SPDY [SPDY] initially addressed this redundancy by compressing header
fields with Deflate, which proved very effective at eliminating the fields with Deflate, which proved very effective at eliminating the
redundant header fields. However, that aproach exposed a security redundant header fields. However, that approach exposed a security
risk as demonstrated by the CRIME [CRIME]. risk as demonstrated by the CRIME [CRIME].
In this document, we propose a new compressor for header fields which This document describes HPACK, a new compressor for header fields
eliminates redundant header fields, is not vulnerable to CRIME style which eliminates redundant header fields, is not vulnerable to known
attacks, and which also has a bounded memory cost for use in security attacks, and which also has a bounded memory cost for use in
constrained environments. constrained environments.
2.1. Outline 2.1. Outline
The HTTP header field encoding described in this document is based on The HTTP header field encoding described in this document is based on
a header table that map (name, value) pairs to index values. Header a header table that map name-value pairs to index values. Header
tables are incrementally updated during the HTTP/2.0 session. tables are incrementally updated during the HTTP/2.0 session.
The encoder is responsible for deciding which header fields to insert The encoder is responsible for deciding which header fields to insert
as new entries in the header table. The decoder then does exactly as new entries in the header table. The decoder then does exactly
what the encoder prescribes, ending in a state that exactly matches what the encoder prescribes, ending in a state that exactly matches
the encoder's state. This enables decoders to remain simple and the encoder's state. This enables decoders to remain simple and
understand a wide variety of encoders. understand a wide variety of encoders.
As two consecutive sets of header fields often have header fields in As two consecutive sets of header fields often have header fields in
common, each set of header fields is coded as a difference from the common, each set of header fields is coded as a difference from the
previous set of header fields. The goal is to only encode the previous set of header fields. The goal is to only encode the
changes (header fields present in one of the set and not in the changes (header fields present in one of the set and not in the
other) between the two sets of header fields. other) between the two sets of header fields.
HTTP header field compression treats a set of header fields as an
unordered collection of name-value pairs. Names and values are
opaque sequences of octets. The order of header fields is not
guaranteed to be preserved after being compression and decompression.
Examples illustrating the use of these different mechanisms to Examples illustrating the use of these different mechanisms to
represent header fields are available in Appendix E. represent header fields are available in Appendix E.
3. Header Field Encoding 3. Header Field Encoding
3.1. Encoding Concepts 3.1. Encoding Concepts
The encoding and decoding of header fields relies on some components The encoding and decoding of header fields relies on some components
and concepts: and concepts:
Header Field: A key, value pair. HPACK allows a header field value Header Field: A name-value pair. Both name and value are sequences
to be either a value as specified by HTTP/1.X (see [HTTP-p1]), or of octets.
a NULL-separated ordered list of HTTP/1.X values.
Header Table: The header table (see Section 3.1.2) is a component Header Table: The header table (see Section 3.1.2) is a component
used to associate stored header fields to index values. The data used to associate stored header fields to index values. The data
stored in this table is in first-in, first-out order. stored in this table is in first-in, first-out order.
Static Table: The static table (see Appendix B) is a component used Static Table: The static table (see Appendix B) is a component used
to associate static header fields to index values. This data is to associate static header fields to index values. This data is
ordered, read-only, always accessible, and may be shared amongst ordered, read-only, always accessible, and may be shared amongst
all encoding contexts. all encoding contexts.
Reference Set: The reference set (see Section 3.1.3) is a component Reference Set: The reference set (see Section 3.1.3) is a component
containing an unordered set of references to entries in the header containing an unordered set of references to entries in the header
table or static table. This is used for the differential encoding table. This is used for the differential encoding of a new header
of a new header set. set.
Header Set: A header set is a potentially ordered group of header Header Set: A header set is a potentially ordered group of header
fields that are encoded jointly. A complete set of key-value fields that are encoded jointly. A complete set of key-value
pairs contained in a HTTP request or response is a header set. pairs contained in a HTTP request or response is a header set.
Header Field Representation: A header field can be represented in Header Field Representation: A header field can be represented in
encoded form either as a literal or as an index (see encoded form either as a literal or as an index (see
Section 3.1.4). Section 3.1.4).
Header Block: The entire set of encoded header field representations Header Block: The entire set of encoded header field representations
which, when decoded, yield a complete header set. which, when decoded, yield a complete header set.
Header Field Emission: When decoding a set of header field Header Field Emission: When decoding a set of header field
representations, some operations emit a header field (see representations, some operations emit a header field (see
Section 3.1.5). Emitted headers can be safely passed to the upper Section 3.1.5). Emitted header fields can be safely passed to the
processing layers as part of the current Header Set. upper processing layers as part of the current Header Set.
3.1.1. Encoding Context 3.1.1. Encoding Context
The set of mutable structures used within an encoding context include The set of mutable structures used within an encoding context include
a header table and a reference set. Everything else is either a header table and a reference set. Everything else is either
immutable or conceptual. immutable or conceptual.
Using HTTP, messages are exchanged between a client and a server in Using HTTP, messages are exchanged between a client and a server in
both direction. To keep the encoding of header fields in each both direction. To keep the encoding of header fields in each
direction independent from the other direction, there is one encoding direction independent from the other direction, there is one encoding
skipping to change at page 6, line 17 skipping to change at page 6, line 19
The header fields contained in a PUSH_PROMISE frame sent by a server The header fields contained in a PUSH_PROMISE frame sent by a server
to a client are encoded within the same context as the header fields to a client are encoded within the same context as the header fields
contained in the HEADERS frame corresponding to a response sent from contained in the HEADERS frame corresponding to a response sent from
the server to the client. the server to the client.
3.1.2. Header Table 3.1.2. Header Table
A header table consists of a list of header fields maintained in A header table consists of a list of header fields maintained in
first-in, first-out order. The first and newest entry in a header first-in, first-out order. The first and newest entry in a header
table is always at index 0, and the oldest entry of a header table is table is always at index 1, and the oldest entry of a header table is
at the index len(header table)-1. at the index len(header table).
The header table is initially empty. The header table is initially empty.
There is typically no need for the header table to contain duplicate There is typically no need for the header table to contain duplicate
entries. However, duplicate entries MUST NOT be treated as an error entries. However, duplicate entries MUST NOT be treated as an error
by a decoder. by a decoder.
The encoder decides how to update the header table and as such can The encoder decides how to update the header table and as such can
control how much memory is used by the header table. To limit the control how much memory is used by the header table. To limit the
memory requirements on the decoder side, the header table size is memory requirements on the decoder side, the header table size is
strictly bounded (see Section 3.3.1). strictly bounded (see Section 3.3.1).
The header table is updated during the processing of a set of header The header table is updated during the processing of a set of header
field representations (see header field representation processing field representations (see header field representation processing
(Section 3.2.1). (Section 3.2.1)).
3.1.3. Reference Set 3.1.3. Reference Set
A reference set is an unordered set of references to entries either A reference set is an unordered set of references to entries of the
within the header table or the static table. header table.
The reference set is initially empty. The reference set is initially empty.
The reference set is updated during the processing of a set of header The reference set is updated during the processing of a set of header
field representations (see header field representation processing field representations (see header field representation processing
(Section 3.2.1). (Section 3.2.1)).
The reference set enables differential encoding, whereby only The reference set enables differential encoding, whereby only
differences between the previous header set and the current header differences between the previous header set and the current header
set need to be encoded. set need to be encoded. The use of differential encoding is optional
for any header set.
When an entry is evicted from the header table, if it was referenced When an entry is evicted from the header table, if it was referenced
from the reference set, its reference is removed from the reference from the reference set, its reference is removed from the reference
set. set.
To limit the memory requirements on the decoder side for handling the
reference set, only entries within the header table can be contained
in the reference set. To still allow entries from the static table
to take advantage of the differential encoding, when a header field
is represented as a reference to an entry of the static table, this
entry is inserted into the header table ((see Section 3.2.1).
3.1.4. Header Field Representation 3.1.4. Header Field Representation
An encoded header field can be represented either as a literal or as An encoded header field can be represented either as a literal or as
an index. an index.
Literal Representation: A literal representation defines a new Literal Representation: A literal representation defines a new
header field. The header field name is represented either header field. The header field name is represented either
literally or as a reference to an entry of the header table. The literally or as a reference to an entry of the header table. The
header field value is represented literally. header field value is represented literally.
skipping to change at page 7, line 31 skipping to change at page 7, line 41
* A literal representation that adds the header field as a new * A literal representation that adds the header field as a new
entry at the beginning of the header table (see Section 4.3.2). entry at the beginning of the header table (see Section 4.3.2).
Indexed Representation: The indexed representation defines a header Indexed Representation: The indexed representation defines a header
field as a reference to an entry in either the header table or the field as a reference to an entry in either the header table or the
static table(see Section 4.2). static table(see Section 4.2).
<---------- Index Address Space ----------> <---------- Index Address Space ---------->
<-- Header Table --> <-- Static Table --> <-- Header Table --> <-- Static Table -->
+---+-----------+---+ +---+-----------+---+ +---+-----------+---+ +---+-----------+---+
| 0 | ... | k | |k+1| ... | n | | 1 | ... | k | |k+1| ... | n |
+---+-----------+---+ +---+-----------+---+ +---+-----------+---+ +---+-----------+---+
^ | ^ |
| V | V
Insertion Point Drop Point Insertion Point Drop Point
Index Address Space Index Address Space
Indices between 0 and len(header table)-1, inclusive, refer to Indices between 1 and len(header table), inclusive, refer to
elements in the header table, with index 0 referring to the elements in the header table, with index 1 referring to the
beginning of the table. beginning of the table.
Indices between len(header table) and len(header table)+ Indices between len(header table)+1 and len(header table)+
len(static table)-1, inclusive, refer to elements in the static len(static table), inclusive, refer to elements in the static
table, where the index len(header table) refers to the first table, where the index len(header table)+1 refers to the first
entry in the static table. entry in the static table.
Index 0 signals that the reference set MUST be emptied.
Any other indices MUST be treated as erroneous, and the Any other indices MUST be treated as erroneous, and the
compression context considered corrupt and unusable. compression context considered corrupt and unusable.
3.1.5. Header Field Emission 3.1.5. Header Field Emission
The emission of a header field is the process of passing that header The emission of a header field is the process of marking a header
field to the application, so that the application can process and field as belonging to the current header set. Once a header has been
react to header field data. emitted, it cannot be removed from the current header set.
By emitting header fields instead of emitting header sets, the On the decoding side, an emitted header field can be safely passed to
decoder can be implemented in a streaming way, and as such must only the upper processing layer as part of the current header set. The
keep in memory the header table and the reference set. This bounds decoder MAY pass the emitted header fields to the upper processing
the amount of memory used by the decoder, even in presence of a very layer in any order.
large set of header fields. The management of memory for handling
very large sets of header fields can therefore be deferred to the
application.
When a header field is a NULL-separated list of values, each value By emitting header fields instead of emitting header sets, the
within the list MAY be emitted separately, with the same header field decoder can be implemented in a streaming way, and as such has only
name, and the order of emission MUST be the order of appearance in to keep in memory the header table and the reference set. This
the list. bounds the amount of memory used by the decoder, even in presence of
a very large set of header fields. The management of memory for
handling very large sets of header fields can therefore be deferred
to the upper processing layers.
3.2. Header Block Decoding 3.2. Header Block Decoding
The processing of a header block to obtain a header set is defined in The processing of a header block to obtain a header set is defined in
this section. To ensure that the decoding will successfully produce this section. To ensure that the decoding will successfully produce
a header set, a decoder MUST obey the following rules. a header set, a decoder MUST obey the following rules.
3.2.1. Header Field Representation Processing 3.2.1. Header Field Representation Processing
All the header field representations contained in a header block are All the header field representations contained in a header block are
processed in the order in which they are presented, as specified processed in the order in which they are presented, as specified
below. below.
An _indexed representation_ with an index value of 0 entails the
following actions:
o The reference set is emptied.
An _indexed representation_ corresponding to an entry _present_ in An _indexed representation_ corresponding to an entry _present_ in
the reference set entails the following actions: the reference set entails the following actions:
o The reference to the entry is removed from the reference set. o The entry is removed from the reference set.
An _indexed representation_ corresponding to an entry _not present_ An _indexed representation_ corresponding to an entry _not present_
in the reference set entails the following actions: in the reference set entails the following actions:
o If referencing an element of the static table: o If referencing an element of the static table:
* The header field corresponding to the referenced entry is * The header field corresponding to the referenced entry is
emitted. emitted.
* The referenced static entry is added to the header table. * The referenced static entry is inserted at the beginning of the
header table.
* If the new entry fits within the header table, a reference to * A reference to this new header table entry is added to the
the header table entry is added to the reference set. reference set (except if this new entry didn't fit in the
header table).
o If referencing an element of the header table: o If referencing an element of the header table:
* The header field corresponding to the referenced entry is * The header field corresponding to the referenced entry is
emitted. emitted.
* The referenced header table entry is added to the header table. * The referenced header table entry is added to the reference
set.
A _literal representation_ that is _not added_ to the header table A _literal representation_ that is _not added_ to the header table
entails the following action: entails the following action:
o The header field is emitted. o The header field is emitted.
A _literal representation_ that is _added_ to the header table A _literal representation_ that is _added_ to the header table
entails the following actions: entails the following actions:
o The header field is inserted at the beginning of the header table. o The header field is emitted.
o A reference to the new entry is added to the reference set. o The header field is inserted at the beginning of the header table.
o The header field is emitted. o A reference to the new entry is added to the reference set (except
if this new entry didn't fit in the header table).
3.2.2. Reference Set Emission 3.2.2. Reference Set Emission
Once all the representations contained in a header block have been Once all the representations contained in a header block have been
processed, the header fields referenced in the reference set which processed, the header fields referenced in the reference set which
have not previously been emitted during this processing are emitted. have not previously been emitted during this processing are emitted.
3.2.3. Header Set Completion 3.2.3. Header Set Completion
Once all of the header field representations have been processed, and Once all of the header field representations have been processed, and
the remaining items in the reference set have been emitted, the the remaining items in the reference set have been emitted, the
header set is complete. header set is complete.
3.3. Header Table Management 3.3. Header Table Management
3.3.1. Maximum Table Size 3.3.1. Maximum Table Size
To limit the memory requirements on the decoder side, the size of the To limit the memory requirements on the decoder side, the size of the
the header table is bounded. The size of the header table MUST stay header table is bounded. The size of the header table MUST stay
lower than or equal to the value of the HTTP/2.0 setting lower than or equal to the value of the HTTP/2.0 setting
SETTINGS_HEADER_TABLE_SIZE (see [HTTP2]). SETTINGS_HEADER_TABLE_SIZE (see [HTTP2]).
The size of the the header table is the sum of the size of its The size of the header table is the sum of the size of its entries.
entries.
The size of an entry is the sum of its name's length in bytes (as The size of an entry is the sum of its name's length in octets (as
defined in Section 4.1.2), of its value's length in bytes defined in Section 4.1.2), of its value's length in octets
(Section 4.1.2) and of 32 bytes. (Section 4.1.2) and of 32 octets.
The lengths are measured on the non-encoded entry name and entry The lengths are measured on the non-encoded entry name and entry
value (for the case when a Huffman encoding is used to transmit value (for the case when a Huffman encoding is used to transmit
string values). string values).
The 32 bytes are an accounting for the entry structure overhead. For The 32 octets are an accounting for the entry structure overhead.
example, an entry structure using two 64-bits pointers to reference For example, an entry structure using two 64-bits pointers to
the name and the value and the entry, and two 64-bits integer for reference the name and the value and the entry, and two 64-bits
counting the number of references to these name and value would use integer for counting the number of references to these name and value
32 bytes. would use 32 octets.
3.3.2. Entry Eviction When Header Table Size Changes 3.3.2. Entry Eviction When Header Table Size Changes
Whenever an entry is evicted from the header table, any reference to Whenever an entry is evicted from the header table, any reference to
that entry contained by the reference set is removed. that entry contained by the reference set is removed.
Whenever SETTINGS_HEADER_TABLE_SIZE is made smaller, entries are Whenever SETTINGS_HEADER_TABLE_SIZE is made smaller, entries are
evicted from the end of the header table until the size of the header evicted from the end of the header table until the size of the header
table is less than or equal to SETTINGS_HEADER_TABLE_SIZE. table is less than or equal to SETTINGS_HEADER_TABLE_SIZE.
The eviction of an entry from the header table causes the index of The eviction of an entry from the header table causes the index of
the entries in the static table to be reduced by one. the entries in the static table to be reduced by one.
3.3.3. Entry Eviction when Adding New Entries 3.3.3. Entry Eviction when Adding New Entries
Whenever a new entry is to be added to the table, any name referenced Whenever a new entry is to be added to the table, any name referenced
by the representation is cached, and then entries are evicted from by the representation of this new entry is cached, and then entries
the end of the header table until the size of the header table is are evicted from the end of the header table until the size of the
less than or equal to SETTINGS_HEADER_TABLE_SIZE - new entry size, or header table is less than or equal to SETTINGS_HEADER_TABLE_SIZE -
until the table is empty. new entry size, or until the table is empty.
If the size of the new entry is less than or equal to If the size of the new entry is less than or equal to
SETTINGS_HEADER_TABLE_SIZE, that entry is added to the table. It is SETTINGS_HEADER_TABLE_SIZE, that entry is added to the table. It is
not an error to attempt to add an entry that is larger than not an error to attempt to add an entry that is larger than
SETTINGS_HEADER_TABLE_SIZE. SETTINGS_HEADER_TABLE_SIZE.
4. Detailed Format 4. Detailed Format
4.1. Low-level representations 4.1. Low-level representations
4.1.1. Integer representation 4.1.1. Integer representation
Integers are used to represent name indexes, pair indexes or string Integers are used to represent name indexes, pair indexes or string
lengths. To allow for optimized processing, an integer lengths. To allow for optimized processing, an integer
representation always finishes at the end of a byte. representation always finishes at the end of an octet.
An integer is represented in two parts: a prefix that fills the An integer is represented in two parts: a prefix that fills the
current byte and an optional list of bytes that are used if the current octet and an optional list of octets that are used if the
integer value does not fit within the prefix. The number of bits of integer value does not fit within the prefix. The number of bits of
the prefix (called N) is a parameter of the integer representation. the prefix (called N) is a parameter of the integer representation.
The N-bit prefix allows filling the current byte. If the value is The N-bit prefix allows filling the current octet. If the value is
small enough (strictly less than 2^N-1), it is encoded within the small enough (strictly less than 2^N-1), it is encoded within the
N-bit prefix. Otherwise all the bits of the prefix are set to 1 and N-bit prefix. Otherwise all the bits of the prefix are set to 1 and
the value is encoded using an unsigned variable length integer [1] the value is encoded using an unsigned variable length integer [1]
representation. N is always between 1 and 8 bits. An integer representation. N is always between 1 and 8 bits. An integer
starting at a byte-boundary will have an 8-bit prefix. starting at an octet-boundary will have an 8-bit prefix.
The algorithm to represent an integer I is as follows: The algorithm to represent an integer I is as follows:
If I < 2^N - 1, encode I on N bits If I < 2^N - 1, encode I on N bits
Else Else
encode 2^N - 1 on N bits encode 2^N - 1 on N bits
I = I - (2^N - 1) I = I - (2^N - 1)
While I >= 128 While I >= 128
Encode (I % 128 + 128) on 8 bits Encode (I % 128 + 128) on 8 bits
I = I / 128 I = I / 128
encode (I) on 8 bits encode (I) on 8 bits
This integer representation allows for values of indefinite size. It This integer representation allows for values of indefinite size. It
is also possible for an encoder to send a large number of zero is also possible for an encoder to send a large number of zero
values, which can waste bytes and could be used to overflow integer values, which can waste octets and could be used to overflow integer
values. Excessively large integer encodings - in value or octet values. Excessively large integer encodings - in value or octet
length - MUST be treated as a decoding error. Different limits can length - MUST be treated as a decoding error. Different limits can
be set for each of the different uses of integers, based on be set for each of the different uses of integers, based on
implementation constraints. implementation constraints.
4.1.1.1. Example 1: Encoding 10 using a 5-bit prefix 4.1.1.1. Example 1: Encoding 10 using a 5-bit prefix
The value 10 is to be encoded with a 5-bit prefix. The value 10 is to be encoded with a 5-bit prefix.
o 10 is less than 31 (= 2^5 - 1) and is represented using the 5-bit o 10 is less than 31 (= 2^5 - 1) and is represented using the 5-bit
skipping to change at page 13, line 5 skipping to change at page 13, line 16
The process ends. The process ends.
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
+---+---+---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+
| X | X | X | 1 | 1 | 1 | 1 | 1 | Prefix = 31, I = 1306 | X | X | X | 1 | 1 | 1 | 1 | 1 | Prefix = 31, I = 1306
| 1 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 1306>=128, encode(154), I=1306/128 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 1306>=128, encode(154), I=1306/128
| 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 10<128, encode(10), done | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 10<128, encode(10), done
+---+---+---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+
4.1.1.3. Example 3: Encoding 42 starting at an
octet-boundary
The value 42 is to be encoded starting at an octet-boundary. This
implies that a 8-bit prefix is used.
o 42 is less than 255 (= 2^8 - 1) and is represented using the 8-bit
prefix.
0 1 2 3 4 5 6 7
+---+---+---+---+---+---+---+---+
| 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 42 stored on 8 bits
+---+---+---+---+---+---+---+---+
4.1.2. String Literal Representation 4.1.2. String Literal Representation
Header field names and header field values are encoded as sequences Header field names and header field values are encoded as sequences
of bytes. A header field name or a header field value is encoded in of octets. A header field name or a header field value is encoded in
three parts: three parts:
1. One bit, H, indicating whether or not the bytes are huffman 1. One bit, H, indicating whether or not the octets are Huffman
encoded. encoded.
2. The number of bytes required to hold the result of the next step, 2. The number of octets required to hold the result of the next
represented as a variable-length-quantity (Section 4.1.1), step, represented as a variable-length-quantity (Section 4.1.1),
starting with a 7-bit prefix immediately following the first bit. starting with a 7-bit prefix immediately following the first bit.
3. The encoded data of the string: 3. The encoded data of the string:
1. If H is true, then the the encoded string data is the bitwise 1. If H is true, then the encoded string data is the bitwise
concatenation of the canonical [CANON]huffman code [HUFF] concatenation of the canonical [CANON]Huffman code [HUFF]
corresponding to each character of the data, followed by corresponding to each octet of the data, followed by between
between 0-7 bits of padding. 0-7 bits of padding.
2. If H is false, then the encoded string is the bytes of the 2. If H is false, then the encoded string is the octets of the
field value without modification. field value without modification.
Padding is necessary when doing huffman encoding to ensure that the Padding is necessary when doing Huffman encoding to ensure that the
remaining bits between the actual end of the data and the next byte remaining bits between the actual end of the data and the next octet
boundary are not misinterpreted as part of the input data. boundary are not misinterpreted as part of the input data.
When padding for huffman encoding, use the bits from the EOS (end-of- When padding for Huffman encoding, use the bits from the EOS (end-of-
string) entry in the Huffman table, starting with the MSB. This string) entry in the Huffman table, starting with the MSB (most
entry is guaranteed to be at least 8 bits long. significant bit). This entry is guaranteed to be at least 8 bits
long.
String literals sent in the client to server direction which use String literals sent in the client to server direction which use
huffman encoding are encoded with the codes within the request Huffman encoding are encoded with the codes within the request
huffman code table (Appendix C) (see Request Decoding With Huffman Huffman code table (Appendix C) (see Request Examples With Huffman
Example (Appendix E.3)). (Appendix E.3)).
String literals sent in the server to client direction which use String literals sent in the server to client direction which use
huffman encoding are encoded with the codes within the response Huffman encoding are encoded with the codes within the response
huffman code table (Appendix D) (see Response Decoding With Huffman Huffman code table (Appendix D) (see Response Examples With Huffman
Example (Appendix E.3)). (Appendix E.5)).
The EOS symbol is represented with value 256, and is used solely to The EOS symbol is represented with value 256, and is used solely to
signal the end of the huffman-encoded key data or the end of the signal the end of the Huffman-encoded key data or the end of the
huffman-encoded value data. Given that only between 0-7 bits of the Huffman-encoded value data. Given that only between 0-7 bits of the
EOS symbol is included in any huffman-encoded string, and given that EOS symbol is included in any Huffman-encoded string, and given that
the EOS symbol is at least 8 bits long, it is expected that it should the EOS symbol is at least 8 bits long, it is expected that it should
never be successfully decoded. never be successfully decoded.
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
+---+---+---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+
| 1 | Value Length Prefix (7) | | 1 | Value Length Prefix (7) |
+---+---+---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+
| Value Length (0-N bytes) | | Value Length (0-N octets) |
+---+---+---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+
... ...
+---+---+---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+
| Huffman Encoded Data |Padding| | Huffman Encoded Data |Padding|
+---+---+---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+
String Literal With Huffman Encoding String Literal With Huffman Encoding
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
+---+---+---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+
| 0 | Value Length Prefix (7) | | 0 | Value Length Prefix (7) |
+---+---+---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+
| Value Length (0-N bytes) | | Value Length (0-N octets) |
+---+---+---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+
... ...
+---+---+---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+
| Field Bytes Without Encoding | | Field Bytes Without Encoding |
+---+---+---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+
String Literal Without Huffman Encoding String Literal Without Huffman Encoding
4.2. Indexed Header Field Representation 4.2. Indexed Header Field Representation
An indexed header field representation either identifies an entry in An indexed header field representation either identifies an entry in
the header table or static table. The specified entry is emitted and the header table or static table. The processing of an indexed
a reference to that entry is added to the reference set if it is not header field representation is described in Section 3.2.1.
currently in the reference set. If it is present in the reference
set then the reference is removed and the entry is not emitted.
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
+---+---+---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+
| 1 | Index (7+) | | 1 | Index (7+) |
+---+---------------------------+ +---+---------------------------+
Indexed Header Field Indexed Header Field
This representation starts with the '1' 1-bit pattern, followed by This representation starts with the '1' 1-bit pattern, followed by
the index of the matching pair, represented as an integer with a the index of the matching pair, represented as an integer with a
7-bit prefix. 7-bit prefix.
The index value of 0 is reserved for signalling that the reference
set is emptied.
4.3. Literal Header Field Representation 4.3. Literal Header Field Representation
Literal header field representations contain a literal header field Literal header field representations contain a literal header field
value. Header field names are either provided as a literal or by value. Header field names are either provided as a literal or by
reference to an existing header table or static table entry. reference to an existing header table or static table entry.
Literal representations all result in the emission of a header field Literal representations all result in the emission of a header field
when decoded. when decoded.
4.3.1. Literal Header Field without Indexing 4.3.1. Literal Header Field without Indexing
skipping to change at page 15, line 48 skipping to change at page 16, line 34
| Value Length (8+) | | Value Length (8+) |
+-------------------------------+ +-------------------------------+
| Value String (Length octets) | | Value String (Length octets) |
+-------------------------------+ +-------------------------------+
Literal Header Field without Indexing - New Name Literal Header Field without Indexing - New Name
This representation starts with the '01' 2-bit pattern. This representation starts with the '01' 2-bit pattern.
If the header field name matches the header field name of a (name, If the header field name matches the header field name of a (name,
value) pair stored in the Header Table or Static Table, the index of value) pair stored in the Header Table or Static Table, the header
that entry, increased by one (index + 1), is represented as an field name can be represented using the index of that entry. In this
integer with a 6-bit prefix. Note that if the index is strictly case, the index of the entry, index (which is strictly greater than
below 63, only one byte is used for this representation. 0), is represented as an integer with a 6-bit prefix (see
Section 4.1.1).
If the header field name does not match a header field name entry, Otherwise, the header field name is represented as a literal. The
the value 0 is represented on 6 bits followed by the header field value 0 is represented on 6 bits followed by the header field name
name (Section 4.1.2). (see Section 4.1.2).
The header field name representation is followed by the header field The header field name representation is followed by the header field
value represented as a literal string as described in Section 4.1.2. value represented as a literal string as described in Section 4.1.2.
4.3.2. Literal Header Field with Incremental Indexing 4.3.2. Literal Header Field with Incremental Indexing
A literal header field with incremental indexing adds a new entry to A literal header field with incremental indexing adds a new entry to
the header table. the header table.
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
skipping to change at page 16, line 48 skipping to change at page 17, line 36
+-------------------------------+ +-------------------------------+
| Value String (Length octets) | | Value String (Length octets) |
+-------------------------------+ +-------------------------------+
Literal Header Field with Incremental Indexing - Literal Header Field with Incremental Indexing -
New Name New Name
This representation starts with the '00' 2-bit pattern. This representation starts with the '00' 2-bit pattern.
If the header field name matches the header field name of a (name, If the header field name matches the header field name of a (name,
value) pair stored in the header table or static table, the index of value) pair stored in the Header Table or Static Table, the header
the pair increased by one (index + 1) is represented as an integer field name can be represented using the index of that entry. In this
with a 6-bit prefix. case, the index of the entry, index (which is strictly greater than
0), is represented as an integer with a 6-bit prefix (see
Section 4.1.1).
If the header field name does not match a header field name entry, Otherwise, the header field name is represented as a literal. The
the value 0 is represented on 6 bits followed by the header field value 0 is represented on 6 bits followed by the header field name
name (Section 4.1.2). (see Section 4.1.2).
The header field name representation is followed by the header field The header field name representation is followed by the header field
value represented as a literal string as described in Section 4.1.2. value represented as a literal string as described in Section 4.1.2.
5. Security Considerations 5. Security Considerations
This compressor exists to solve security issues present in stream This compressor exists to solve security issues present in stream
compressors such as DEFLATE whereby the compression context can be compressors such as DEFLATE whereby the compression context can be
efficiently probed to reveal secrets. A conformant implementation of efficiently probed to reveal secrets. A conformant implementation of
this specification should be fairly safe against that kind of attack, this specification should be fairly safe against that kind of attack,
as the reaping of any information from the compression context as the reaping of any information from the compression context
requires more work than guessing and verifying the plaintext data requires more work than guessing and verifying the plain text data
directly with the server. As with any secret, however, the longer directly with the server. As with any secret, however, the longer
the length of the secret, the more difficult the secret is to guess. the length of the secret, the more difficult the secret is to guess.
It is inadvisable to have short cookies that are relied upon to It is inadvisable to have short cookies that are relied upon to
remain secret for any duration of time. remain secret for any duration of time.
A proper security-conscious implementation will also need to prevent A proper security-conscious implementation will also need to prevent
timing attacks by ensuring that the amount of time it takes to do timing attacks by ensuring that the amount of time it takes to do
string comparisons is always a function of the total length of the string comparisons is always a function of the total length of the
strings, and not a function of the number of matched characters. strings, and not a function of the number of matched characters.
skipping to change at page 18, line 4 skipping to change at page 18, line 43
application to consume/flush the emitted header fields in small application to consume/flush the emitted header fields in small
chunks, and by considering overhead in the state size calculation. chunks, and by considering overhead in the state size calculation.
Implementors must still be careful in the creation of APIs to an Implementors must still be careful in the creation of APIs to an
implementation of this compressor by ensuring that header field keys implementation of this compressor by ensuring that header field keys
and values are either emitted as a stream, or that the compression and values are either emitted as a stream, or that the compression
implementation have a limit on the maximum size of a key or value. implementation have a limit on the maximum size of a key or value.
Failure to implement these kinds of safeguards may still result in a Failure to implement these kinds of safeguards may still result in a
scenario where the local endpoint exhausts its memory. scenario where the local endpoint exhausts its memory.
6. References 6. References
6.1. Normative References 6.1. Normative References
[HTTP-p1] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer [HTTP-p1] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer
Protocol (HTTP/1.1): Message Syntax and Routing", Protocol (HTTP/1.1): Message Syntax and Routing",
draft-ietf-httpbis-p1-messaging-24 (work in progress), draft-ietf-httpbis-p1-messaging-25 (work in progress),
September 2013. November 2013.
[HTTP2] Belshe, M., Peon, R., Thomson, M., and A. Melnikov, [HTTP2] Belshe, M., Peon, R., Thomson, M., Ed., and A. Melnikov,
"Hypertext Transfer Protocol version 2.0", Ed., "Hypertext Transfer Protocol version 2.0",
draft-ietf-httpbis-http2-06 (work in progress), draft-ietf-httpbis-http2-08 (work in progress),
August 2013. November 2013.
6.2. Informative References 6.2. Informative References
[CANON] Schwartz, E. and B. Kallick, "Generating a canonical [CANON] Schwartz, E. and B. Kallick, "Generating a canonical
prefix encoding", Communications of the ACM Volume 7 Issue prefix encoding", Communications of the ACM Volume 7 Issue
3, pp. 166-169, March 1964, 3, pp. 166-169, March 1964,
<http://dl.acm.org/citation.cfm?id=363991>. <http://dl.acm.org/citation.cfm?id=363991>.
[CRIME] Rizzo, J. and T. Duong, "The Crime Attack", [CRIME] Rizzo, J. and T. Duong, "The Crime Attack",
September 2012, <https://docs.google.com/a/twist.com/ September 2012, <https://docs.google.com/a/twist.com/
presentation/d/ presentation/d/
11eBmGiHbYcHR9gL5nDyZChu_-lCa2GizeuOfaLU2HOU/ 11eBmGiHbYcHR9gL5nDyZChu_-lCa2GizeuOfaLU2HOU/
edit#slide=id.g1eb6c1b5_3_6>. edit#slide=id.g1eb6c1b5_3_6>.
[HUFF] Huffman, D., "A Method for the Construction of Minimim [HUFF] Huffman, D., "A Method for the Construction of Minimum
Redundancy Codes", Proceedings of the Institute of Radio Redundancy Codes", Proceedings of the Institute of Radio
Engineers Volume 40, Number 9, pp. 1098-1101, Engineers Volume 40, Number 9, pp. 1098-1101,
September 1952, <http://ieeexplore.ieee.org/xpl/ September 1952, <http://ieeexplore.ieee.org/xpl/
articleDetails.jsp?arnumber=4051119>. articleDetails.jsp?arnumber=4051119>.
[PERF1] Belshe, M., "IETF83: SPDY and What to Consider for [PERF1] Belshe, M., "IETF83: SPDY and What to Consider for
HTTP/2.0", March 2012, <http://www.ietf.org/proceedings/ HTTP/2.0", March 2012, <http://www.ietf.org/proceedings/
83/slides/slides-83-httpbis-3>. 83/slides/slides-83-httpbis-3>.
[PERF2] McManus, P., "SPDY: What I Like About You", [PERF2] McManus, P., "SPDY: What I Like About You",
skipping to change at page 19, line 7 skipping to change at page 19, line 44
[SPDY] Belshe, M. and R. Peon, "SPDY Protocol", [SPDY] Belshe, M. and R. Peon, "SPDY Protocol",
draft-mbelshe-httpbis-spdy-00 (work in progress), draft-mbelshe-httpbis-spdy-00 (work in progress),
February 2012. February 2012.
URIs URIs
[1] <http://en.wikipedia.org/wiki/Variable-length_quantity> [1] <http://en.wikipedia.org/wiki/Variable-length_quantity>
Appendix A. Change Log (to be removed by RFC Editor before publication Appendix A. Change Log (to be removed by RFC Editor before publication
A.1. Since draft-ietf-httpbis-header-compression-03 A.1. Since draft-ietf-httpbis-header-compression-04
o Updated examples: take into account changes in the spec, and show
more features.
o Use 'octet' everywhere instead of having both 'byte' and 'octet'.
o Added reference set emptying.
o Editorial changes and clarifications.
o Added "host" header to the static table.
o Ordering for list of values (either NULL- or comma-separated).
A.2. Since draft-ietf-httpbis-header-compression-03
o A large number of editorial changes; changed the description of o A large number of editorial changes; changed the description of
evicting/adding new entries. evicting/adding new entries.
o Removed substitution indexing o Removed substitution indexing
o Changed 'initial headers' to 'static headers', as per issue #258 o Changed 'initial headers' to 'static headers', as per issue #258
o Merged 'request' and 'response' static headers, as per issue #259 o Merged 'request' and 'response' static headers, as per issue #259
o Changed text to indicate that new headers are added at index 0 and o Changed text to indicate that new headers are added at index 0 and
expire from the largest index, as per issue #233 expire from the largest index, as per issue #233
A.2. Since draft-ietf-httpbis-header-compression-02 A.3. Since draft-ietf-httpbis-header-compression-02
o Corrected error in integer encoding pseudocode. o Corrected error in integer encoding pseudocode.
A.3. Since draft-ietf-httpbis-header-compression-01 A.4. Since draft-ietf-httpbis-header-compression-01
o Refactored of Header Encoding Section: split definitions and o Refactored of Header Encoding Section: split definitions and
processing rule. processing rule.
o Backward incompatible change: Updated reference set management as o Backward incompatible change: Updated reference set management as
per issue #214. This changes how the interaction between the per issue #214. This changes how the interaction between the
reference set and eviction works. This also changes the working reference set and eviction works. This also changes the working
of the reference set in some specific cases. of the reference set in some specific cases.
o Backward incompatible change: modified initial header list, as per o Backward incompatible change: modified initial header list, as per
issue #188. issue #188.
o Added example of 32 bytes entry structure (issue #191). o Added example of 32 octets entry structure (issue #191).
o Added Header Set Completion section. Reflowed some text. o Added Header Set Completion section. Reflowed some text.
Clarified some writing which was akward. Added text about Clarified some writing which was akward. Added text about
duplicate header entry encoding. Clarified some language w.r.t duplicate header entry encoding. Clarified some language w.r.t
Header Set. Changed x-my-header to mynewheader. Added text in the Header Set. Changed x-my-header to mynewheader. Added text in the
HeaderEmission section indicating that the application may also be HeaderEmission section indicating that the application may also be
able to free up memory more quickly. Added information in able to free up memory more quickly. Added information in
Security Considerations section. Security Considerations section.
A.4. Since draft-ietf-httpbis-header-compression-01 A.5. Since draft-ietf-httpbis-header-compression-01
Fixed bug/omission in integer representation algorithm. Fixed bug/omission in integer representation algorithm.
Changed the document title. Changed the document title.
Header matching text rewritten. Header matching text rewritten.
Changed the definition of header emission. Changed the definition of header emission.
Changed the name of the setting which dictates how much memory the Changed the name of the setting which dictates how much memory the
compression context should use. compression context should use.
Removed "specific use cases" section Removed "specific use cases" section
Corrected erroneous statement about what index can be contained in Corrected erroneous statement about what index can be contained in
one byte one octet
Added descriptions of opcodes Added descriptions of opcodes
Removed security claims from introduction. Removed security claims from introduction.
Appendix B. Static Table Appendix B. Static Table
The static table consists of an unchangable ordered list of (name, The static table consists of an unchangeable ordered list of (name,
value) pairs. The first entry in the table is always represented by value) pairs. The first entry in the table is always represented by
the index len(header table), and the last entry in the table is the index len(header table)+1, and the last entry in the table is
represented by the index len(header table)+len(static table)-1. represented by the index len(header table)+len(static table).
[[anchor9: The ordering of these tables is currently arbitrary. The [[anchor9: The ordering of these tables is currently arbitrary. The
tables in this section should be updated and ordered such that the tables in this section should be updated and ordered such that the
table entries with the smallest indices are those which, based on a table entries with the smallest indices are those which, based on a
statistical analysis of the frequency of use weighted by size, statistical analysis of the frequency of use weighted by size,
achieve the largest decrease in bytes transmitted subject to HTTP 2.0 achieve the largest decrease in octets transmitted subject to HTTP
header field rules (like removal of some header fields). This set of 2.0 header field rules (like removal of some header fields). This
header fields is currently very likely incomplete, and should be made set of header fields is currently very likely incomplete, and should
complete.]] be made complete.]]
The following table lists the pre-defined header fields that make-up The following table lists the pre-defined header fields that make-up
the static header table. the static header table.
+-------+-----------------------------+--------------+ +-------+-----------------------------+--------------+
| Index | Header Name | Header Value | | Index | Header Name | Header Value |
+-------+-----------------------------+--------------+ +-------+-----------------------------+--------------+
| 0 | :authority | | | 1 | :authority | |
| 1 | :method | GET | | 2 | :method | GET |
| 2 | :method | POST | | 3 | :method | POST |
| 3 | :path | / | | 4 | :path | / |
| 4 | :path | /index.html | | 5 | :path | /index.html |
| 5 | :scheme | http | | 6 | :scheme | http |
| 6 | :scheme | https | | 7 | :scheme | https |
| 7 | :status | 200 | | 8 | :status | 200 |
| 8 | :status | 500 | | 9 | :status | 500 |
| 9 | :status | 404 | | 10 | :status | 404 |
| 10 | :status | 403 | | 11 | :status | 403 |
| 11 | :status | 400 | | 12 | :status | 400 |
| 12 | :status | 401 | | 13 | :status | 401 |
| 13 | accept-charset | | | 14 | accept-charset | |
| 14 | accept-encoding | | | 15 | accept-encoding | |
| 15 | accept-language | | | 16 | accept-language | |
| 16 | accept-ranges | | | 17 | accept-ranges | |
| 17 | accept | | | 18 | accept | |
| 18 | access-control-allow-origin | | | 19 | access-control-allow-origin | |
| 19 | age | | | 20 | age | |
| 20 | allow | | | 21 | allow | |
| 21 | authorization | | | 22 | authorization | |
| 22 | cache-control | | | 23 | cache-control | |
| 23 | content-disposition | | | 24 | content-disposition | |
| 24 | content-encoding | | | 25 | content-encoding | |
| 25 | content-language | | | 26 | content-language | |
| 26 | content-length | | | 27 | content-length | |
| 27 | content-location | | | 28 | content-location | |
| 28 | content-range | | | 29 | content-range | |
| 29 | content-type | | | 30 | content-type | |
| 30 | cookie | | | 31 | cookie | |
| 31 | date | | | 32 | date | |
| 32 | etag | | | 33 | etag | |
| 33 | expect | | | 34 | expect | |
| 34 | expires | | | 35 | expires | |
| 35 | from | | | 36 | from | |
| 36 | if-match | | | 37 | host | |
| 37 | if-modified-since | | | 38 | if-match | |
| 38 | if-none-match | | | 39 | if-modified-since | |
| 39 | if-range | | | 40 | if-none-match | |
| 40 | if-unmodified-since | | | 41 | if-range | |
| 41 | last-modified | | | 42 | if-unmodified-since | |
| 42 | link | | | 43 | last-modified | |
| 43 | location | | | 44 | link | |
| 44 | max-forwards | | | 45 | location | |
| 45 | proxy-authenticate | | | 46 | max-forwards | |
| 46 | proxy-authorization | | | 47 | proxy-authenticate | |
| 47 | range | | | 48 | proxy-authorization | |
| 48 | referer | | | 49 | range | |
| 49 | refresh | | | 50 | referer | |
| 50 | retry-after | | | 51 | refresh | |
| 51 | server | | | 52 | retry-after | |
| 52 | set-cookie | | | 53 | server | |
| 53 | strict-transport-security | | | 54 | set-cookie | |
| 54 | transfer-encoding | | | 55 | strict-transport-security | |
| 55 | user-agent | | | 56 | transfer-encoding | |
| 56 | vary | | | 57 | user-agent | |
| 57 | via | | | 58 | vary | |
| 58 | www-authenticate | | | 59 | via | |
| 60 | www-authenticate | |
+-------+-----------------------------+--------------+ +-------+-----------------------------+--------------+
Table 1: Static Table Entries Table 1: Static Table Entries
The table give the index of each entry in the static table. The full The table give the index of each entry in the static table. The full
index of each entry, to be used for encoding a reference to this index of each entry, to be used for encoding a reference to this
entry, is computed by adding the number of entries in the header entry, is computed by adding the number of entries in the header
table to this index. table to this index.
Appendix C. Huffman Codes For Requests Appendix C. Huffman Codes For Requests
The following Huffman codes are used when encoding string literals in The following Huffman codes are used when encoding string literals in
the client to server direction. the client to server direction.
[[anchor10: This table is out of date and needs updating. In [[anchor10: This table may need to be regenerated.]]
particular, EOS needs to be at least 7-bits long and currently is
not.]]
aligned aligned aligned aligned
to len to len to len to len
MSB in LSB in MSB in LSB in
sym as bits bits as hex bits sym as bits bits as hex bits
( 0) |11111111|11111111|11110111|010 [27] 7ffffba [27] ( 0) |11111111|11111111|11110111|010 [27] 7ffffba [27]
( 1) |11111111|11111111|11110111|011 [27] 7ffffbb [27] ( 1) |11111111|11111111|11110111|011 [27] 7ffffbb [27]
( 2) |11111111|11111111|11110111|100 [27] 7ffffbc [27] ( 2) |11111111|11111111|11110111|100 [27] 7ffffbc [27]
( 3) |11111111|11111111|11110111|101 [27] 7ffffbd [27] ( 3) |11111111|11111111|11110111|101 [27] 7ffffbd [27]
( 4) |11111111|11111111|11110111|110 [27] 7ffffbe [27] ( 4) |11111111|11111111|11110111|110 [27] 7ffffbe [27]
skipping to change at page 28, line 8 skipping to change at page 29, line 8
(251) |11111111|11111111|11110101|11 [26] 3ffffd7 [26] (251) |11111111|11111111|11110101|11 [26] 3ffffd7 [26]
(252) |11111111|11111111|11110110|00 [26] 3ffffd8 [26] (252) |11111111|11111111|11110110|00 [26] 3ffffd8 [26]
(253) |11111111|11111111|11110110|01 [26] 3ffffd9 [26] (253) |11111111|11111111|11110110|01 [26] 3ffffd9 [26]
(254) |11111111|11111111|11110110|10 [26] 3ffffda [26] (254) |11111111|11111111|11110110|10 [26] 3ffffda [26]
(255) |11111111|11111111|11110110|11 [26] 3ffffdb [26] (255) |11111111|11111111|11110110|11 [26] 3ffffdb [26]
EOS (256) |11111111|11111111|11110111|00 [26] 3ffffdc [26] EOS (256) |11111111|11111111|11110111|00 [26] 3ffffdc [26]
Appendix D. Huffman Codes for Responses Appendix D. Huffman Codes for Responses
The following Huffman codes are used when encoding string literals in The following Huffman codes are used when encoding string literals in
the server to client direction. the server to client direction. These codes apply for both responses
to client requests and for push-promises.
[[anchor11: This table is out of date and needs updating. In [[anchor11: This table may need to be regenerated.]]
particular, EOS needs to be at least 7-bits long and currently is
not.]]
aligned aligned aligned aligned
to len to len to len to len
MSB in LSB in MSB in LSB in
sym as bits bits as hex bits sym as bits bits as hex bits
( 0) |11111111|11111111|11011110|0 [25] 1ffffbc [25] ( 0) |11111111|11111111|11011110|0 [25] 1ffffbc [25]
( 1) |11111111|11111111|11011110|1 [25] 1ffffbd [25] ( 1) |11111111|11111111|11011110|1 [25] 1ffffbd [25]
( 2) |11111111|11111111|11011111|0 [25] 1ffffbe [25] ( 2) |11111111|11111111|11011111|0 [25] 1ffffbe [25]
( 3) |11111111|11111111|11011111|1 [25] 1ffffbf [25] ( 3) |11111111|11111111|11011111|1 [25] 1ffffbf [25]
( 4) |11111111|11111111|11100000|0 [25] 1ffffc0 [25] ( 4) |11111111|11111111|11100000|0 [25] 1ffffc0 [25]
skipping to change at page 33, line 39 skipping to change at page 34, line 38
(251) |11111111|11111111|11011000| [24] ffffd8 [24] (251) |11111111|11111111|11011000| [24] ffffd8 [24]
(252) |11111111|11111111|11011001| [24] ffffd9 [24] (252) |11111111|11111111|11011001| [24] ffffd9 [24]
(253) |11111111|11111111|11011010| [24] ffffda [24] (253) |11111111|11111111|11011010| [24] ffffda [24]
(254) |11111111|11111111|11011011| [24] ffffdb [24] (254) |11111111|11111111|11011011| [24] ffffdb [24]
(255) |11111111|11111111|11011100| [24] ffffdc [24] (255) |11111111|11111111|11011100| [24] ffffdc [24]
EOS (256) |11111111|11111111|11011101| [24] ffffdd [24] EOS (256) |11111111|11111111|11011101| [24] ffffdd [24]
Appendix E. Examples Appendix E. Examples
A number of examples are worked through here, for both requests and A number of examples are worked through here, for both requests and
responses, and with and without huffman coding. responses, and with and without Huffman coding.
E.1. Request Decoding Example With Huffman E.1. Header Field Representation Examples
This section show several independent representation examples.
E.1.1. Literal Header Field with Indexing
The header field representation uses a literal name and a literal
value.
Header set to encode:
custom-key: custom-header
Reference set: empty.
Hex dump of encoded data:
000a 6375 7374 6f6d 2d6b 6579 0d63 7573 | ..custom-key.cus
746f 6d2d 6865 6164 6572 | tom-header
Decoding process:
00 | == Literal indexed ==
0a | Literal name (len = 10)
6375 7374 6f6d 2d6b 6579 | custom-key
0d | Literal value (len = 13)
6375 7374 6f6d 2d68 6561 6465 72 | custom-header
| -> custom-key: custom-head\
| er
Header Table (after decoding):
[ 1] (s = 55) custom-key: custom-header
Table size: 55
Decoded header set:
custom-key: custom-header
E.1.2. Literal Header Field without Indexing
The header field representation uses an indexed name and a literal
value.
Header set to encode:
:path: /sample/path
Reference set: empty.
Hex dump of encoded data:
440c 2f73 616d 706c 652f 7061 7468 | D./sample/path
Decoding process:
44 | == Literal not indexed ==
| Indexed name (idx = 4)
| :path
0c | Literal value (len = 12)
2f73 616d 706c 652f 7061 7468 | /sample/path
| -> :path: /sample/path
Header table (after decoding): empty.
Decoded header set:
:path: /sample/path
E.1.3. Indexed Header Field
The header field representation uses an indexed header field, from
the static table. Upon using it, the static table entry is copied
into the header table.
Header set to encode:
:method: GET
Reference set: empty.
Hex dump of encoded data:
82 | .
Decoding process:
82 | == Indexed - Add ==
| idx = 2
| -> :method: GET
Header Table (after decoding):
[ 1] (s = 42) :method: GET
Table size: 42
Decoded header set:
:method: GET
E.1.4. Indexed Header Field from Static Table
The header field representation uses an indexed header field, from
the static table. In this example, the SETTINGS_HEADER_TABLE_SIZE is
set to 0, therefore, the entry is not copied into the header table.
Header set to encode:
:method: GET
Reference set: empty.
Hex dump of encoded data:
82 | .
Decoding process:
82 | == Indexed - Add ==
| idx = 2
| -> :method: GET
Header table (after decoding): empty.
Decoded header set:
:method: GET
E.2. Request Examples without Huffman
This section shows several consecutive header sets, corresponding to
HTTP requests, on the same connection.
E.2.1. First request
Header set to encode:
# Header set to be encoded
:method: GET :method: GET
:scheme: http :scheme: http
:path: / :path: /
:authority: www.foo.com :authority: www.example.com
# Hexdump of encoded data which will be decoded
02 84 f7 77 78 ff 07 83 ce 31 77 06 81 0f 04 88 | ...wx....1w.....
db 6d 89 8b 5a 44 b7 4f | .m..ZD.O
# Decoded opcodes Reference set: empty.
LITERAL_INCREMENTAL_OPCODE:
opcodeLengthInBits: 2
discoveredFromPeekingAtByte: '02'
name_index:
encoded: "02"
decoded: 2
value_data_length:
encoded: "84"
decoded: 4
value_data:
is_huffman_encoded: 1
encoded: "f77778ff"
decoded: "GET"
LITERAL_INCREMENTAL_OPCODE: Hex dump of encoded data:
opcodeLengthInBits: 2
discoveredFromPeekingAtByte: '07'
name_index:
encoded: "07"
decoded: 7
value_data_length:
encoded: "83"
decoded: 3
value_data:
is_huffman_encoded: 1
encoded: "ce3177"
decoded: "http"
LITERAL_INCREMENTAL_OPCODE: 8287 8604 0f77 7777 2e65 7861 6d70 6c65 | .....www.example
opcodeLengthInBits: 2 2e63 6f6d | .com
discoveredFromPeekingAtByte: '06'
name_index:
encoded: "06"
decoded: 6
value_data_length:
encoded: "81"
decoded: 1
value_data:
is_huffman_encoded: 1
encoded: "0f"
decoded: "/"
LITERAL_INCREMENTAL_OPCODE: Decoding process:
opcodeLengthInBits: 2 82 | == Indexed - Add ==
discoveredFromPeekingAtByte: '04' | idx = 2
name_index: | -> :method: GET
encoded: "04" 87 | == Indexed - Add ==
decoded: 4 | idx = 7
value_data_length: | -> :scheme: http
encoded: "88" 86 | == Indexed - Add ==
decoded: 8 | idx = 6
value_data: | -> :path: /
is_huffman_encoded: 1 04 | == Literal indexed ==
encoded: "db6d898b5a44b74f" | Indexed name (idx = 4)
decoded: "www.foo.com" | :authority
0f | Literal value (len = 15)
7777 772e 6578 616d 706c 652e 636f 6d | www.example.com
| -> :authority: www.example\
| .com
Header Table (after decoding):
[ 1] (s = 57) :authority: www.example.com
[ 2] (s = 38) :path: /
[ 3] (s = 43) :scheme: http
[ 4] (s = 42) :method: GET
Table size: 180
Decoded header set:
# Decoded header set
:authority: www.foo.com
:method: GET :method: GET
:path: /
:scheme: http :scheme: http
:path: /
:authority: www.example.com
######################### E.2.2. Second request
This request takes advantage of the differential encoding of header
sets.
Header set to encode:
# Header set to be encoded
:method: GET :method: GET
:scheme: https :scheme: http
:path: / :path: /
:authority: www.bar.com :authority: www.example.com
cache-control: no-cache cache-control: no-cache
# Hexdump of encoded data which will be decoded Reference set:
03 84 ce 31 74 3f 02 88 db 6d 89 7a 1e 44 b7 4f | ...1t?...m.z.D.O
1d 86 63 65 4a 13 98 ff 83 85 | ..ceJ.....
# Decoded opcodes [ 1] :authority: www.example.com
LITERAL_INCREMENTAL_OPCODE: [ 2] :path: /
opcodeLengthInBits: 2 [ 3] :scheme: http
discoveredFromPeekingAtByte: '03' [ 4] :method: GET
name_index:
encoded: "03"
decoded: 3
value_data_length:
encoded: "84"
decoded: 4
value_data:
is_huffman_encoded: 1
encoded: "ce31743f"
decoded: "https"
LITERAL_INCREMENTAL_OPCODE: Hex dump of encoded data:
opcodeLengthInBits: 2
discoveredFromPeekingAtByte: '02'
name_index:
encoded: "02"
decoded: 2
value_data_length:
encoded: "88"
decoded: 8
value_data:
is_huffman_encoded: 1
encoded: "db6d897a1e44b74f"
decoded: "www.bar.com"
LITERAL_INCREMENTAL_OPCODE: 1b08 6e6f 2d63 6163 6865 | ..no-cache
opcodeLengthInBits: 2
discoveredFromPeekingAtByte: '1d'
name_index:
encoded: "1d"
decoded: 29
value_data_length:
encoded: "86"
decoded: 6
value_data:
is_huffman_encoded: 1
encoded: "63654a1398ff"
decoded: "no-cache"
INDEX_OPCODE: Decoding process:
opcodeLengthInBits: 1
discoveredFromPeekingAtByte: '83'
entry_index:
encoded: "83"
decoded: 3
INDEX_OPCODE: 1b | == Literal indexed ==
opcodeLengthInBits: 1 | Indexed name (idx = 27)
discoveredFromPeekingAtByte: '85' | cache-control
entry_index: 08 | Literal value (len = 8)
encoded: "85" 6e6f 2d63 6163 6865 | no-cache
decoded: 5 | -> cache-control: no-cache
Header Table (after decoding):
[ 1] (s = 53) cache-control: no-cache
[ 2] (s = 57) :authority: www.example.com
[ 3] (s = 38) :path: /
[ 4] (s = 43) :scheme: http
[ 5] (s = 42) :method: GET
Table size: 233
Decoded header set:
# Decoded header set
:authority: www.bar.com
:method: GET
:path: /
:scheme: https
cache-control: no-cache cache-control: no-cache
:authority: www.example.com
:path: /
:scheme: http
:method: GET
######################### E.2.3. Third request
This request has not enough headers in common with the previous
request to take advantage of the differential encoding. Therefore,
the reference set is emptied before encoding the header fields.
Header set to encode:
# Header set to be encoded
:method: GET :method: GET
:scheme: https :scheme: https
:path: /custom-path.css :path: /index.html
:authority: www.bar.com :authority: www.example.com
custom-key: custom-value custom-key: custom-value
# Hexdump of encoded data which will be decoded Reference set:
05 8b 04 eb 08 b7 49 5c 88 e6 44 c2 1f 00 88 4e | ......I\..D....N
b0 8b 74 97 90 fa 7f 89 4e b0 8b 74 97 9a 17 a8 | ..t.....N..t....
ff 82 86 | ...
# Decoded opcodes [ 1] cache-control: no-cache
LITERAL_INCREMENTAL_OPCODE: [ 2] :authority: www.example.com
opcodeLengthInBits: 2 [ 3] :path: /
discoveredFromPeekingAtByte: '05' [ 4] :scheme: http
name_index: [ 5] :method: GET
encoded: "05"
decoded: 5
value_data_length:
encoded: "8b"
decoded: 11
value_data:
is_huffman_encoded: 1
encoded: "04eb08b7495c88e644c21f"
decoded: "/custom-path.css"
LITERAL_INCREMENTAL_OPCODE: Hex dump of encoded data:
opcodeLengthInBits: 2
discoveredFromPeekingAtByte: '00'
name_index:
encoded: "00"
decoded: 0
name_data_length:
encoded: "88"
decoded: 8
name_data:
is_huffman_encoded: 1
encoded: "4eb08b749790fa7f"
decoded: "custom-key"
value_data_length:
encoded: "89"
decoded: 9
value_data:
is_huffman_encoded: 1 8085 8c8b 8400 0a63 7573 746f 6d2d 6b65 | .......custom-ke
encoded: "4eb08b74979a17a8ff" 790c 6375 7374 6f6d 2d76 616c 7565 | y.custom-value
decoded: "custom-value" Decoding process:
INDEX_OPCODE: 80 | == Empty reference set ==
opcodeLengthInBits: 1 | idx = 0
discoveredFromPeekingAtByte: '82' 85 | == Indexed - Add ==
entry_index: | idx = 5
encoded: "82" | -> :method: GET
decoded: 2 8c | == Indexed - Add ==
| idx = 12
| -> :scheme: https
8b | == Indexed - Add ==
| idx = 11
| -> :path: /index.html
84 | == Indexed - Add ==
| idx = 4
| -> :authority: www.example\
| .com
00 | == Literal indexed ==
0a | Literal name (len = 10)
6375 7374 6f6d 2d6b 6579 | custom-key
0c | Literal value (len = 12)
6375 7374 6f6d 2d76 616c 7565 | custom-value
| -> custom-key: custom-valu\
| e
INDEX_OPCODE: Header Table (after decoding):
opcodeLengthInBits: 1
discoveredFromPeekingAtByte: '86' [ 1] (s = 54) custom-key: custom-value
entry_index: [ 2] (s = 48) :path: /index.html
encoded: "86" [ 3] (s = 44) :scheme: https
decoded: 6 [ 4] (s = 53) cache-control: no-cache
[ 5] (s = 57) :authority: www.example.com
[ 6] (s = 38) :path: /
[ 7] (s = 43) :scheme: http
[ 8] (s = 42) :method: GET
Table size: 379
Decoded header set:
# Decoded header set
:authority: www.bar.com
:method: GET :method: GET
:path: /custom-path.css
:scheme: https :scheme: https
:path: /index.html
:authority: www.example.com
custom-key: custom-value custom-key: custom-value
######################### E.3. Request Examples with Huffman
E.2. Request Decoding Example Without Huffman This section shows the same examples as the previous section, but
using Huffman encoding for the literal values.
E.3.1. First request
Header set to encode:
# Header set to be encoded
:method: GET :method: GET
:scheme: http :scheme: http
:path: / :path: /
:authority: www.foo.com :authority: www.example.com
# Hexdump of encoded data which will be decoded Reference set: empty.
02 03 47 45 54 07 04 68 74 74 70 06 01 2f 04 0b | ..GET..http../..
77 77 77 2e 66 6f 6f 2e 63 6f 6d | www.foo.com
# Decoded opcodes Hex dump of encoded data:
LITERAL_INCREMENTAL_OPCODE:
opcodeLengthInBits: 2
discoveredFromPeekingAtByte: '02'
name_index:
encoded: "02" 8287 8604 8bdb 6d88 3e68 d1cb 1225 ba7f | ......m..h...%..
decoded: 2
value_data_length:
encoded: "03"
decoded: 3
value_data:
is_huffman_encoded: 0
encoded: "474554"
decoded: "GET"
LITERAL_INCREMENTAL_OPCODE: Decoding process:
opcodeLengthInBits: 2
discoveredFromPeekingAtByte: '07'
name_index:
encoded: "07"
decoded: 7
value_data_length:
encoded: "04"
decoded: 4
value_data:
is_huffman_encoded: 0
encoded: "68747470"
decoded: "http"
LITERAL_INCREMENTAL_OPCODE: 82 | == Indexed - Add ==
opcodeLengthInBits: 2 | idx = 2
discoveredFromPeekingAtByte: '06' | -> :method: GET
name_index: 87 | == Indexed - Add ==
encoded: "06" | idx = 7
decoded: 6 | -> :scheme: http
value_data_length: 86 | == Indexed - Add ==
encoded: "01" | idx = 6
decoded: 1 | -> :path: /
value_data: 04 | == Literal indexed ==
is_huffman_encoded: 0 | Indexed name (idx = 4)
encoded: "2f" | :authority
decoded: "/" 8b | Literal value (len = 15)
| Huffman encoded:
db6d 883e 68d1 cb12 25ba 7f | .m..h...%..
| Decoded:
| www.example.com
| -> :authority: www.example\
| .com
LITERAL_INCREMENTAL_OPCODE: Header Table (after decoding):
opcodeLengthInBits: 2
discoveredFromPeekingAtByte: '04'
name_index:
encoded: "04"
decoded: 4
value_data_length:
encoded: "0b"
decoded: 11
value_data:
is_huffman_encoded: 0 [ 1] (s = 57) :authority: www.example.com
encoded: "7777772e666f6f2e636f6d" [ 2] (s = 38) :path: /
decoded: "www.foo.com" [ 3] (s = 43) :scheme: http
[ 4] (s = 42) :method: GET
Table size: 180
Decoded header set:
# Decoded header set
:authority: www.foo.com
:method: GET :method: GET
:path: /
:scheme: http :scheme: http
:path: /
:authority: www.example.com
######################### E.3.2. Second request
This request takes advantage of the differential encoding of header
sets.
Header set to encode:
# Header set to be encoded
:method: GET :method: GET
:scheme: https :scheme: http
:path: / :path: /
:authority: www.bar.com :authority: www.example.com
cache-control: no-cache cache-control: no-cache
# Hexdump of encoded data which will be decoded Reference set:
03 05 68 74 74 70 73 02 0b 77 77 77 2e 62 61 72 | ..https..www.bar
2e 63 6f 6d 1d 08 6e 6f 2d 63 61 63 68 65 83 85 | .com..no-cache..
# Decoded opcodes [ 1] :authority: www.example.com
LITERAL_INCREMENTAL_OPCODE: [ 2] :path: /
opcodeLengthInBits: 2 [ 3] :scheme: http
discoveredFromPeekingAtByte: '03' [ 4] :method: GET
name_index:
encoded: "03"
decoded: 3
value_data_length:
encoded: "05"
decoded: 5
value_data:
is_huffman_encoded: 0
encoded: "6874747073"
decoded: "https"
LITERAL_INCREMENTAL_OPCODE: Hex dump of encoded data:
opcodeLengthInBits: 2
discoveredFromPeekingAtByte: '02'
name_index:
encoded: "02"
decoded: 2
value_data_length:
encoded: "0b"
decoded: 11
value_data: 1b86 6365 4a13 98ff | ..ceJ...
is_huffman_encoded: 0
encoded: "7777772e6261722e636f6d"
decoded: "www.bar.com"
LITERAL_INCREMENTAL_OPCODE: Decoding process:
opcodeLengthInBits: 2
discoveredFromPeekingAtByte: '1d'
name_index:
encoded: "1d"
decoded: 29
value_data_length:
encoded: "08"
decoded: 8
value_data:
is_huffman_encoded: 0
encoded: "6e6f2d6361636865"
decoded: "no-cache"
INDEX_OPCODE: 1b | == Literal indexed ==
opcodeLengthInBits: 1 | Indexed name (idx = 27)
discoveredFromPeekingAtByte: '83' | cache-control
entry_index: 86 | Literal value (len = 8)
encoded: "83" | Huffman encoded:
decoded: 3 6365 4a13 98ff | ceJ...
| Decoded:
| no-cache
| -> cache-control: no-cache
INDEX_OPCODE: Header Table (after decoding):
opcodeLengthInBits: 1
discoveredFromPeekingAtByte: '85' [ 1] (s = 53) cache-control: no-cache
entry_index: [ 2] (s = 57) :authority: www.example.com
encoded: "85" [ 3] (s = 38) :path: /
decoded: 5 [ 4] (s = 43) :scheme: http
[ 5] (s = 42) :method: GET
Table size: 233
Decoded header set:
# Decoded header set
:authority: www.bar.com
:method: GET
:path: /
:scheme: https
cache-control: no-cache cache-control: no-cache
:authority: www.example.com
:path: /
:scheme: http
:method: GET
######################### E.3.3. Third request
This request has not enough headers in common with the previous
request to take advantage of the differential encoding. Therefore,
the reference set is emptied before encoding the header fields.
Header set to encode:
# Header set to be encoded
:method: GET :method: GET
:scheme: https :scheme: https
:path: /custom-path.css :path: /index.html
:authority: www.bar.com :authority: www.example.com
custom-key: custom-value custom-key: custom-value
Reference set:
# Hexdump of encoded data which will be decoded [ 1] cache-control: no-cache
05 10 2f 63 75 73 74 6f 6d 2d 70 61 74 68 2e 63 | ../custom-path.c [ 2] :authority: www.example.com
73 73 00 0a 63 75 73 74 6f 6d 2d 6b 65 79 0c 63 | ss..custom-key.c [ 3] :path: /
75 73 74 6f 6d 2d 76 61 6c 75 65 82 86 | ustom-value.. [ 4] :scheme: http
[ 5] :method: GET
# Decoded opcodes Hex dump of encoded data:
LITERAL_INCREMENTAL_OPCODE:
opcodeLengthInBits: 2
discoveredFromPeekingAtByte: '05'
name_index:
encoded: "05"
decoded: 5
value_data_length:
encoded: "10"
decoded: 16
value_data:
is_huffman_encoded: 0
encoded: "2f637573746f6d2d706174682e637373"
decoded: "/custom-path.css"
LITERAL_INCREMENTAL_OPCODE: 8085 8c8b 8400 884e b08b 7497 90fa 7f89 | .......N..t.....
opcodeLengthInBits: 2 4eb0 8b74 979a 17a8 ff | N..t.....
discoveredFromPeekingAtByte: '00'
name_index:
encoded: "00"
decoded: 0
name_data_length:
encoded: "0a"
decoded: 10
name_data:
is_huffman_encoded: 0
encoded: "637573746f6d2d6b6579"
decoded: "custom-key"
value_data_length:
encoded: "0c"
decoded: 12
value_data:
is_huffman_encoded: 0
encoded: "637573746f6d2d76616c7565"
decoded: "custom-value"
INDEX_OPCODE: Decoding process:
opcodeLengthInBits: 1
discoveredFromPeekingAtByte: '82'
entry_index:
encoded: "82"
decoded: 2
INDEX_OPCODE: 80 | == Empty reference set ==
opcodeLengthInBits: 1 | idx = 0
discoveredFromPeekingAtByte: '86' 85 | == Indexed - Add ==
entry_index: | idx = 5
encoded: "86" | -> :method: GET
decoded: 6 8c | == Indexed - Add ==
| idx = 12
| -> :scheme: https
8b | == Indexed - Add ==
| idx = 11
| -> :path: /index.html
84 | == Indexed - Add ==
| idx = 4
| -> :authority: www.example\
| .com
00 | == Literal indexed ==
88 | Literal name (len = 10)
| Huffman encoded:
4eb0 8b74 9790 fa7f | N..t....
| Decoded:
| custom-key
89 | Literal value (len = 12)
| Huffman encoded:
4eb0 8b74 979a 17a8 ff | N..t.....
| Decoded:
| custom-value
| -> custom-key: custom-valu\
| e
Header Table (after decoding):
[ 1] (s = 54) custom-key: custom-value
[ 2] (s = 48) :path: /index.html
[ 3] (s = 44) :scheme: https
[ 4] (s = 53) cache-control: no-cache
[ 5] (s = 57) :authority: www.example.com
[ 6] (s = 38) :path: /
[ 7] (s = 43) :scheme: http
[ 8] (s = 42) :method: GET
Table size: 379
Decoded header set:
# Decoded header set
:authority: www.bar.com
:method: GET :method: GET
:path: /custom-path.css
:scheme: https :scheme: https
:path: /index.html
:authority: www.example.com
custom-key: custom-value custom-key: custom-value
######################### E.4. Response Examples without Huffman
E.3. Response Decoding Example With Huffman This section shows several consecutive header sets, corresponding to
HTTP responses, on the same connection. SETTINGS_HEADER_TABLE_SIZE
is set to the value of 256 octets, causing some evictions to occur.
# Header set to be encoded E.4.1. First response
:status: 302
cache-control: private
date: Mon, 21 OCt 2013 20:13:21 GMT
location: : https://www.bar.com
# Hexdump of encoded data which will be decoded Header set to encode:
08 82 40 9f 18 86 c3 1b 39 bf 38 7f 22 92 a2 fb | ..@.....9.8."...
a2 03 20 f2 eb cc 0c 49 00 62 d2 43 4c 82 7a 1d | .. ....I.b.CL.z.
2f 91 68 71 cf 3c 32 6e bd 7e 9e 9e 92 6e 7e 32 | /.hq.<2n.~...n~2
55 7d bf | U}.
# Decoded opcodes :status: 302
LITERAL_INCREMENTAL_OPCODE: cache-control: private
opcodeLengthInBits: 2 date: Mon, 21 Oct 2013 20:13:21 GMT
discoveredFromPeekingAtByte: '08' location: https://www.example.com
name_index:
encoded: "08"
decoded: 8
value_data_length:
encoded: "82"
decoded: 2
value_data:
is_huffman_encoded: 1
encoded: "409f"
decoded: "302"
LITERAL_INCREMENTAL_OPCODE: Reference set: empty.
opcodeLengthInBits: 2
discoveredFromPeekingAtByte: '18'
name_index:
encoded: "18"
decoded: 24
value_data_length:
encoded: "86"
decoded: 6
value_data:
is_huffman_encoded: 1
encoded: "c31b39bf387f"
decoded: "private"
LITERAL_INCREMENTAL_OPCODE: Hex dump of encoded data:
opcodeLengthInBits: 2
discoveredFromPeekingAtByte: '22'
name_index:
encoded: "22"
decoded: 34
value_data_length:
encoded: "92"
decoded: 18
value_data:
is_huffman_encoded: 1
encoded: "a2fba20320f2ebcc0c490062d2434c827a1d"
decoded: "Mon, 21 OCt 2013 20:13:21 GMT"
LITERAL_INCREMENTAL_OPCODE: 0803 3330 3218 0770 7269 7661 7465 221d | ..302..private".
opcodeLengthInBits: 2 4d6f 6e2c 2032 3120 4f63 7420 3230 3133 | Mon, 21 Oct 2013
discoveredFromPeekingAtByte: '2f' 2032 303a 3133 3a32 3120 474d 5430 1768 | 20:13:21 GMT0.h
name_index: 7474 7073 3a2f 2f77 7777 2e65 7861 6d70 | ttps://www.examp
encoded: "2f" 6c65 2e63 6f6d | le.com
decoded: 47 Decoding process:
value_data_length:
encoded: "91"
decoded: 17
value_data:
is_huffman_encoded: 1
encoded: "6871cf3c326ebd7e9e9e926e7e32557dbf"
decoded: ": https://www.bar.com"
# Decoded header set 08 | == Literal indexed ==
:status: 302 | Indexed name (idx = 8)
cache-control: private | :status
date: Mon, 21 OCt 2013 20:13:21 GMT 03 | Literal value (len = 3)
location: : https://www.bar.com 3330 32 | 302
| -> :status: 302
18 | == Literal indexed ==
| Indexed name (idx = 24)
| cache-control
07 | Literal value (len = 7)
7072 6976 6174 65 | private
| -> cache-control: private
22 | == Literal indexed ==
| Indexed name (idx = 34)
| date
1d | Literal value (len = 29)
4d6f 6e2c 2032 3120 4f63 7420 3230 3133 | Mon, 21 Oct 2013
2032 303a 3133 3a32 3120 474d 54 | 20:13:21 GMT
| -> date: Mon, 21 Oct 2013 \
| 20:13:21 GMT
30 | == Literal indexed ==
| Indexed name (idx = 48)
| location
17 | Literal value (len = 23)
6874 7470 733a 2f2f 7777 772e 6578 616d | https://www.exam
706c 652e 636f 6d | ple.com
| -> location: https://www.e\
| xample.com
######################### Header Table (after decoding):
# Header set to be encoded [ 1] (s = 63) location: https://www.example.com
:status: 200 [ 2] (s = 65) date: Mon, 21 Oct 2013 20:13:21 GMT
cache-control: private [ 3] (s = 52) cache-control: private
date: Mon, 21 OCt 2013 20:13:22 GMT [ 4] (s = 42) :status: 302
location: https://www.bar.com Table size: 222
content-encoding: gzip
set-cookie: foo=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\
AAAAAAAAAAAAAAAAALASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEIUALQWEOIUAXLQEU\
AXLLKJASDQWEOUIAXN1234LASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEIUALQWEOIUA\
XLQEUAXLLKJASDQWEOUIAXN1234LASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEIUALQW\
EOIUAXLQEUAXLLKJASDQWEOUIAXN1234LASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEI\
UALQWEOIUAXLQEUAXLLKJASDQWEOUIAXN1234ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ\
ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ1234 max-age=3600; version=1
# Hexdump of encoded data which will be decoded Decoded header set:
04 82 31 1f 03 92 a2 fb a2 03 20 f2 eb cc 0c 49 | ..1....... ....I
00 62 d2 43 4c c2 7a 1d 03 90 e3 9e 78 64 dd 7a | .b.CL.z.....xd.z
fd 3d 3d 24 dc fc 64 aa fb 7f 20 84 e1 fb b3 0f | .==$..d... .....
3d ff ee 02 df 7d fb 36 ed db b7 6e dd bb 76 ed | =....}.6...n..v.
db b7 6e dd bb 76 ed db b7 6e dd bb 76 ed db b7 | ..n..v...n..v...
6e dd bb 76 ed db b7 6e dd bb 76 ed db b7 6e dd | n..v...n..v...n.
bb 76 ed db b7 6e dd bb 76 ed db b7 6e dd bb 76 | .v...n..v...n..v
ed db b7 6e dd bb 7e 3b 69 ec f0 fe 7e 1f d7 f3 | ...n..~;i...~...
d5 fe 7f 7e 5f d7 9f 6f 97 cb bf e9 b7 fb fe bc | ...~_..o........
fb 7c bb fe 9b 7f bf 8f 87 f3 f0 fe bc fc bb 7b | .|.............{
fe 9b 7e 3f d7 9f 6f 97 7f d3 6f f7 f1 fe bb 7e | ..~?..o...o....~
9b 7f bf 8f c7 f9 f0 db 4f 67 f5 e7 db e5 f4 ef | ........Og......
db fd f8 91 a1 3f 1d b4 f6 78 7f 3f 0f eb f9 ea | .....?...x.?....
ff 3f bf 2f eb cf b7 cb e5 df f4 db fd ff 5e 7d | .?./..........^}
be 5d ff 4d bf df c7 c3 f9 f8 7f 5e 7e 5d bd ff | .].M.......^~]..
4d bf 1f eb cf b7 cb bf e9 b7 fb f8 ff 5d bf 4d | M............].M
bf df c7 e3 fc f8 6d a7 b3 fa f3 ed f2 fa 77 ed | ......m.......w.
fe fc 48 d0 9f 8e da 7b 3c 3f 9f 87 f5 fc f5 7f | ..H....{<?......
9f df 97 f5 e7 db e5 f2 ef fa 6d fe ff af 3e df | ..........m...>.
2e ff a6 df ef e3 e1 fc fc 3f af 3f 2e de ff a6 | .........?.?....
df 8f f5 e7 db e5 df f4 db fd fc 7f ae df a6 df | ................
ef e3 f1 fe 7c 36 d3 d9 fd 79 f6 f9 7d 3b f6 ff | ....|6...y..};..
7e 24 68 4f c7 6d 3d 9e 1f cf c3 fa fe 7a bf cf | ~$hO.m=......z..
ef cb fa f3 ed f2 f9 77 fd 36 ff 7f d7 9f 6f 97 | .......w.6....o.
7f d3 6f f7 f1 f0 fe 7e 1f d7 9f 97 6f 7f d3 6f | ..o....~....o..o
c7 fa f3 ed f2 ef fa 6d fe fe 3f d7 6f d3 6f f7 | .......m..?.o.o.
f1 f8 ff 3e 1b 69 ec fe bc fb 7c be 9d fb 7f bf | ...>.i....|.....
12 34 27 fc ff 3f cf f3 fc ff 3f cf f3 fc ff 3f | .4'..?....?....? :status: 302
cf f3 fc ff 3f cf f3 fc ff 3f cf f3 fc ff 3f cf | ....?....?....?. cache-control: private
f3 fc ff 3f cf f3 fc ff 3f cf f3 fc ff 3f cf f3 | ...?....?....?.. date: Mon, 21 Oct 2013 20:13:21 GMT
fc ff 3f cf f3 fc ff 3f cf f3 fc ff 3f cf f3 fc | ..?....?....?... location: https://www.example.com
ff 3f cf f3 fc ff 3f cf f3 fc ff 3f cf f3 fc ff | .?....?....?....
3f cf f3 fc ff 3f cf f3 fc ff 3f cf f0 8d 09 0b | ?....?....?.....
5f d2 37 f0 86 c4 4a 23 ef 0e 70 c7 2b 2f bb 61 | _.7...J#..p.+/.a
7f 85 86 88 | ....
# Decoded opcodes E.4.2. Second response
LITERAL_INCREMENTAL_OPCODE:
opcodeLengthInBits: 2
discoveredFromPeekingAtByte: '04'
name_index:
encoded: "04"
decoded: 4
value_data_length:
encoded: "82"
decoded: 2
value_data:
is_huffman_encoded: 1
encoded: "311f"
decoded: "200"
LITERAL_INCREMENTAL_OPCODE: The (":status", "302") header field is evicted from the header table
opcodeLengthInBits: 2 to free space to allow adding the (":status", "200") header field to
discoveredFromPeekingAtByte: '03' be copied from the static table into the header table.
name_index:
encoded: "03"
decoded: 3
value_data_length:
encoded: "92"
decoded: 18
value_data:
is_huffman_encoded: 1
encoded: "a2fba20320f2ebcc0c490062d2434cc27a1d"
decoded: "Mon, 21 OCt 2013 20:13:22 GMT"
LITERAL_INCREMENTAL_OPCODE: Header set to encode:
opcodeLengthInBits: 2
discoveredFromPeekingAtByte: '03'
name_index:
encoded: "03"
decoded: 3
value_data_length:
encoded: "90"
decoded: 16
value_data:
is_huffman_encoded: 1 :status: 200
encoded: "e39e7864dd7afd3d3d24dcfc64aafb7f" cache-control: private
decoded: "https://www.bar.com" date: Mon, 21 Oct 2013 20:13:21 GMT
location: https://www.example.com
LITERAL_INCREMENTAL_OPCODE: Reference set:
opcodeLengthInBits: 2
discoveredFromPeekingAtByte: '20'
name_index:
encoded: "20"
decoded: 32
value_data_length:
encoded: "84"
decoded: 4
value_data:
is_huffman_encoded: 1
encoded: "e1fbb30f"
decoded: "gzip"
LITERAL_INCREMENTAL_OPCODE: [ 1] location: https://www.example.com
opcodeLengthInBits: 2 [ 2] date: Mon, 21 Oct 2013 20:13:21 GMT
discoveredFromPeekingAtByte: '3d' [ 3] cache-control: private
name_index: [ 4] :status: 302
encoded: "3d"
decoded: 61
value_data_length:
encoded: "ffee02"
decoded: 493
value_data:
is_huffman_encoded: 1
encoded: "df7dfb36eddbb76eddbb76eddbb76eddbb76eddbb76eddbb76edd\
bb76eddbb76eddbb76eddbb76eddbb76eddbb76eddbb76eddbb76eddbb76eddbb76eddb\
b76eddbb7e3b69ecf0fe7e1fd7f3d5fe7f7e5fd79f6f97cbbfe9b7fbfebcfb7cbbfe9b7\
fbf8f87f3f0febcfcbb7bfe9b7e3fd79f6f977fd36ff7f1febb7e9b7fbf8fc7f9f0db4f\
67f5e7dbe5f4efdbfdf891a13f1db4f6787f3f0febf9eaff3fbf2febcfb7cbe5dff4dbf\
dff5e7dbe5dff4dbfdfc7c3f9f87f5e7e5dbdff4dbf1febcfb7cbbfe9b7fbf8ff5dbf4d\
bfdfc7e3fcf86da7b3faf3edf2fa77edfefc48d09f8eda7b3c3f9f87f5fcf57f9fdf97f\
5e7dbe5f2effa6dfeffaf3edf2effa6dfefe3e1fcfc3faf3f2edeffa6df8ff5e7dbe5df\
f4dbfdfc7faedfa6dfefe3f1fe7c36d3d9fd79f6f97d3bf6ff7e24684fc76d3d9e1fcfc\
3fafe7abfcfefcbfaf3edf2f977fd36ff7fd79f6f977fd36ff7f1f0fe7e1fd79f976f7f\
d36fc7faf3edf2effa6dfefe3fd76fd36ff7f1f8ff3e1b69ecfebcfb7cbe9dfb7fbf123\
427fcff3fcff3fcff3fcff3fcff3fcff3fcff3fcff3fcff3fcff3fcff3fcff3fcff3fcf\
f3fcff3fcff3fcff3fcff3fcff3fcff3fcff3fcff3fcff3fcff3fcff3fcff3fcff3fcff\
3fcff3fcff3fcff3fcff3fcff3fcff3fcff3fcff08d090b5fd237f086c44a23ef0e70c7\
2b2fbb617f"
decoded: "foo=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\
AAAAAAAAAAAAAAAAAAAAAAALASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEIUALQWEOIU\
AXLQEUAXLLKJASDQWEOUIAXN1234LASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEIUALQ\
WEOIUAXLQEUAXLLKJASDQWEOUIAXN1234LASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOE\
IUALQWEOIUAXLQEUAXLLKJASDQWEOUIAXN1234LASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJK\
HQWOEIUALQWEOIUAXLQEUAXLLKJASDQWEOUIAXN1234ZZZZZZZZZZZZZZZZZZZZZZZZZZZZ\
ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ1234max-age=3600; version=1\
"
INDEX_OPCODE: Hex dump of encoded data:
opcodeLengthInBits: 1
discoveredFromPeekingAtByte: '85'
entry_index:
encoded: "85"
decoded: 5
INDEX_OPCODE: 848c | ..
opcodeLengthInBits: 1
discoveredFromPeekingAtByte: '86'
entry_index:
encoded: "86"
decoded: 6
INDEX_OPCODE: Decoding process:
opcodeLengthInBits: 1
discoveredFromPeekingAtByte: '88'
entry_index:
encoded: "88"
decoded: 8
# Decoded header set 84 | == Indexed - Remove ==
:status: 200 | idx = 4
cache-control: private | -> :status: 302
content-encoding: gzip 8c | == Indexed - Add ==
date: Mon, 21 OCt 2013 20:13:22 GMT | idx = 12
location: https://www.bar.com | - evict: :status: 302
set-cookie: foo=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\ | -> :status: 200
AAAAAAAAAAAAAAAAALASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEIUALQWEOIUAXLQEU\
AXLLKJASDQWEOUIAXN1234LASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEIUALQWEOIUA\
XLQEUAXLLKJASDQWEOUIAXN1234LASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEIUALQW\
EOIUAXLQEUAXLLKJASDQWEOUIAXN1234LASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEI\
UALQWEOIUAXLQEUAXLLKJASDQWEOUIAXN1234ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ\
ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ1234 max-age=3600; version=1
######################### Header Table (after decoding):
# Header set to be encoded [ 1] (s = 42) :status: 200
:status: 200 [ 2] (s = 63) location: https://www.example.com
cache-control: private [ 3] (s = 65) date: Mon, 21 Oct 2013 20:13:21 GMT
date: Mon, 21 OCt 2013 20:13:22 GMT [ 4] (s = 52) cache-control: private
location: https://www.bar.com Table size: 222
content-encoding: gzip
set-cookie: foo=ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ\
ZZZZZZZZZZZZZZZZZLASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEIUALQWEOIUAXLQEU\
AXLLKJASDQWEOUIAXN1234LASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEIUALQWEOIUA\
XLQEUAXLLKJASDQWEOUIAXN1234LASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEIUALQW\
EOIUAXLQEUAXLLKJASDQWEOUIAXN1234LASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEI\
UALQWEOIUAXLQEUAXLLKJASDQWEOUIAXN1234AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA1234 max-age=3600; version=1
# Hexdump of encoded data which will be decoded Decoded header set:
01 ff ee 02 df 7d fb 3f cf f3 fc ff 3f cf f3 fc | .....}.?....?...
ff 3f cf f3 fc ff 3f cf f3 fc ff 3f cf f3 fc ff | .?....?....?....
3f cf f3 fc ff 3f cf f3 fc ff 3f cf f3 fc ff 3f | ?....?....?....?
cf f3 fc ff 3f cf f3 fc ff 3f cf f3 fc ff 3f cf | ....?....?....?.
f3 fc ff 3f cf f3 fc ff 3f cf f3 fc ff 3f cf f3 | ...?....?....?..
fc ff 3f cf f3 fc ff 3f cf f3 fc ff 3f cf f3 fc | ..?....?....?...
ff 3e 3b 69 ec f0 fe 7e 1f d7 f3 d5 fe 7f 7e 5f | .>;i...~......~_
d7 9f 6f 97 cb bf e9 b7 fb fe bc fb 7c bb fe 9b | ..o.........|...
7f bf 8f 87 f3 f0 fe bc fc bb 7b fe 9b 7e 3f d7 | ..........{..~?.
9f 6f 97 7f d3 6f f7 f1 fe bb 7e 9b 7f bf 8f c7 | .o...o....~.....
f9 f0 db 4f 67 f5 e7 db e5 f4 ef db fd f8 91 a1 | ...Og...........
3f 1d b4 f6 78 7f 3f 0f eb f9 ea ff 3f bf 2f eb | ?...x.?.....?./.
cf b7 cb e5 df f4 db fd ff 5e 7d be 5d ff 4d bf | .........^}.].M.
df c7 c3 f9 f8 7f 5e 7e 5d bd ff 4d bf 1f eb cf | ......^~]..M....
b7 cb bf e9 b7 fb f8 ff 5d bf 4d bf df c7 e3 fc | ........].M.....
f8 6d a7 b3 fa f3 ed f2 fa 77 ed fe fc 48 d0 9f | .m.......w...H..
8e da 7b 3c 3f 9f 87 f5 fc f5 7f 9f df 97 f5 e7 | ..{<?...........
db e5 f2 ef fa 6d fe ff af 3e df 2e ff a6 df ef | .....m...>......
e3 e1 fc fc 3f af 3f 2e de ff a6 df 8f f5 e7 db | ....?.?.........
e5 df f4 db fd fc 7f ae df a6 df ef e3 f1 fe 7c | ...............|
36 d3 d9 fd 79 f6 f9 7d 3b f6 ff 7e 24 68 4f c7 | 6...y..};..~$hO.
6d 3d 9e 1f cf c3 fa fe 7a bf cf ef cb fa f3 ed | m=......z.......
f2 f9 77 fd 36 ff 7f d7 9f 6f 97 7f d3 6f f7 f1 | ..w.6....o...o..
f0 fe 7e 1f d7 9f 97 6f 7f d3 6f c7 fa f3 ed f2 | ..~....o..o.....
ef fa 6d fe fe 3f d7 6f d3 6f f7 f1 f8 ff 3e 1b | ..m..?.o.o....>.
69 ec fe bc fb 7c be 9d fb 7f bf 12 34 27 6e dd | i....|......4'n.
bb 76 ed db b7 6e dd bb 76 ed db b7 6e dd bb 76 | .v...n..v...n..v
ed db b7 6e dd bb 76 ed db b7 6e dd bb 76 ed db | ...n..v...n..v..
b7 6e dd bb 76 ed db b7 6e dd bb 76 ed db b7 6e | .n..v...n..v...n
dd bb 76 ed db b7 6e dd bb 76 ed db b4 8d 09 0b | ..v...n..v......
5f d2 37 f0 86 c4 4a 23 ef 0e 70 c7 2b 2f bb 61 | _.7...J#..p.+/.a
7f 81 | ..
# Decoded opcodes :status: 200
LITERAL_INCREMENTAL_OPCODE: location: https://www.example.com
opcodeLengthInBits: 2 date: Mon, 21 Oct 2013 20:13:21 GMT
discoveredFromPeekingAtByte: '01' cache-control: private
name_index:
encoded: "01" E.4.3. Third response
decoded: 1
value_data_length:
encoded: "ffee02"
decoded: 493
value_data:
is_huffman_encoded: 1
encoded: "df7dfb3fcff3fcff3fcff3fcff3fcff3fcff3fcff3fcff3fcff3f\
cff3fcff3fcff3fcff3fcff3fcff3fcff3fcff3fcff3fcff3fcff3fcff3fcff3fcff3fc\
ff3fcff3fcff3fcff3fcff3fcff3fcff3fcff3fcff3fcff3fcff3fcff3fcff3e3b69ecf\
0fe7e1fd7f3d5fe7f7e5fd79f6f97cbbfe9b7fbfebcfb7cbbfe9b7fbf8f87f3f0febcfc\
bb7bfe9b7e3fd79f6f977fd36ff7f1febb7e9b7fbf8fc7f9f0db4f67f5e7dbe5f4efdbf\
df891a13f1db4f6787f3f0febf9eaff3fbf2febcfb7cbe5dff4dbfdff5e7dbe5dff4dbf\
dfc7c3f9f87f5e7e5dbdff4dbf1febcfb7cbbfe9b7fbf8ff5dbf4dbfdfc7e3fcf86da7b\
3faf3edf2fa77edfefc48d09f8eda7b3c3f9f87f5fcf57f9fdf97f5e7dbe5f2effa6dfe\
ffaf3edf2effa6dfefe3e1fcfc3faf3f2edeffa6df8ff5e7dbe5dff4dbfdfc7faedfa6d\
fefe3f1fe7c36d3d9fd79f6f97d3bf6ff7e24684fc76d3d9e1fcfc3fafe7abfcfefcbfa\
f3edf2f977fd36ff7fd79f6f977fd36ff7f1f0fe7e1fd79f976f7fd36fc7faf3edf2eff\
a6dfefe3fd76fd36ff7f1f8ff3e1b69ecfebcfb7cbe9dfb7fbf1234276eddbb76eddbb7\
6eddbb76eddbb76eddbb76eddbb76eddbb76eddbb76eddbb76eddbb76eddbb76eddbb76\
eddbb76eddbb76eddbb76eddbb76eddbb76eddbb48d090b5fd237f086c44a23ef0e70c7\
2b2fbb617f"
decoded: "foo=ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ\
ZZZZZZZZZZZZZZZZZZZZZZZLASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEIUALQWEOIU\
AXLQEUAXLLKJASDQWEOUIAXN1234LASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEIUALQ\
WEOIUAXLQEUAXLLKJASDQWEOUIAXN1234LASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOE\
IUALQWEOIUAXLQEUAXLLKJASDQWEOUIAXN1234LASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJK\
HQWOEIUALQWEOIUAXLQEUAXLLKJASDQWEOUIAXN1234AAAAAAAAAAAAAAAAAAAAAAAAAAAA\
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA1234max-age=3600; version=1\
"
INDEX_OPCODE: Several header fields are evicted from the header table during the
opcodeLengthInBits: 1 processing of this header set. Before evicting a header belonging to
discoveredFromPeekingAtByte: '81' the reference set, it is emitted, by coding it twice as an Indexed
entry_index: Representation. The first representation removes the header field
encoded: "81" from the reference set, the second one adds it again to the reference
decoded: 1 set, also emitting it.
# Decoded header set Header set to encode:
:status: 200
cache-control: private
content-encoding: gzip
date: Mon, 21 OCt 2013 20:13:22 GMT
location: https://www.bar.com
set-cookie: foo=ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ\
ZZZZZZZZZZZZZZZZZLASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEIUALQWEOIUAXLQEU\
AXLLKJASDQWEOUIAXN1234LASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEIUALQWEOIUA\
XLQEUAXLLKJASDQWEOUIAXN1234LASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEIUALQW\
EOIUAXLQEUAXLLKJASDQWEOUIAXN1234LASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEI\
UALQWEOIUAXLQEUAXLLKJASDQWEOUIAXN1234AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA1234 max-age=3600; version=1
######################### :status: 200
cache-control: private
date: Mon, 21 Oct 2013 20:13:22 GMT
location: https://www.example.com
content-encoding: gzip
set-cookie: foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU; max-age=3600; version=1
E.4. Response Decoding Example Without Huffman Reference set:
# Header set to be encoded [ 1] :status: 200
:status: 302 [ 2] location: https://www.example.com
cache-control: private [ 3] date: Mon, 21 Oct 2013 20:13:21 GMT
date: Mon, 21 OCt 2013 20:13:21 GMT [ 4] cache-control: private
location: : https://www.bar.com
# Hexdump of encoded data which will be decoded Hex dump of encoded data:
08 03 33 30 32 18 07 70 72 69 76 61 74 65 22 1d | ..302..private".
4d 6f 6e 2c 20 32 31 20 4f 43 74 20 32 30 31 33 | Mon, 21 OCt 2013
20 32 30 3a 31 33 3a 32 31 20 47 4d 54 2f 15 3a | 20:13:21 GMT/.:
20 68 74 74 70 73 3a 2f 2f 77 77 77 2e 62 61 72 | https://www.bar
2e 63 6f 6d | .com
# Decoded opcodes 8384 8403 1d4d 6f6e 2c20 3231 204f 6374 | .....Mon, 21 Oct
LITERAL_INCREMENTAL_OPCODE: 2032 3031 3320 3230 3a31 333a 3232 2047 | 2013 20:13:22 G
opcodeLengthInBits: 2 4d54 1d04 677a 6970 8484 8383 3a38 666f | MT..gzip....:8fo
discoveredFromPeekingAtByte: '08' 6f3d 4153 444a 4b48 514b 425a 584f 5157 | o=ASDJKHQKBZXOQW
name_index: 454f 5049 5541 5851 5745 4f49 553b 206d | EOPIUAXQWEOIU; m
encoded: "08" 6178 2d61 6765 3d33 3630 303b 2076 6572 | ax-age=3600; ver
decoded: 8 7369 6f6e 3d31 | sion=1
value_data_length:
encoded: "03"
decoded: 3
value_data:
is_huffman_encoded: 0
encoded: "333032"
decoded: "302"
LITERAL_INCREMENTAL_OPCODE: Decoding process:
opcodeLengthInBits: 2
discoveredFromPeekingAtByte: '18'
name_index:
encoded: "18"
decoded: 24
value_data_length:
encoded: "07"
decoded: 7
value_data:
is_huffman_encoded: 0
encoded: "70726976617465"
decoded: "private"
LITERAL_INCREMENTAL_OPCODE: 83 | == Indexed - Remove ==
opcodeLengthInBits: 2 | idx = 3
discoveredFromPeekingAtByte: '22' | -> date: Mon, 21 Oct 2013 \
name_index: | 20:13:21 GMT
encoded: "22"
decoded: 34
value_data_length:
encoded: "1d"
decoded: 29
value_data:
is_huffman_encoded: 0
encoded: "4d6f6e2c203231204f437420323031332032303a31333a3231204\
74d54"
decoded: "Mon, 21 OCt 2013 20:13:21 GMT"
LITERAL_INCREMENTAL_OPCODE: 84 | == Indexed - Remove ==
opcodeLengthInBits: 2 | idx = 4
discoveredFromPeekingAtByte: '2f' | -> cache-control: private
name_index: 84 | == Indexed - Add ==
encoded: "2f" | idx = 4
decoded: 47 | -> cache-control: private
value_data_length: 03 | == Literal indexed ==
encoded: "15" | Indexed name (idx = 3)
decoded: 21 | date
value_data: 1d | Literal value (len = 29)
is_huffman_encoded: 0 4d6f 6e2c 2032 3120 4f63 7420 3230 3133 | Mon, 21 Oct 2013
encoded: "3a2068747470733a2f2f7777772e6261722e636f6d" 2032 303a 3133 3a32 3220 474d 54 | 20:13:22 GMT
decoded: ": https://www.bar.com" | - evict: cache-control: pr\
| ivate
| -> date: Mon, 21 Oct 2013 \
| 20:13:22 GMT
1d | == Literal indexed ==
| Indexed name (idx = 29)
| content-encoding
04 | Literal value (len = 4)
677a 6970 | gzip
| - evict: date: Mon, 21 Oct\
| 2013 20:13:21 GMT
| -> content-encoding: gzip
84 | == Indexed - Remove ==
| idx = 4
| -> location: https://www.e\
| xample.com
84 | == Indexed - Add ==
| idx = 4
| -> location: https://www.e\
| xample.com
83 | == Indexed - Remove ==
| idx = 3
| -> :status: 200
83 | == Indexed - Add ==
| idx = 3
| -> :status: 200
3a | == Literal indexed ==
| Indexed name (idx = 58)
| set-cookie
38 | Literal value (len = 56)
666f 6f3d 4153 444a 4b48 514b 425a 584f | foo=ASDJKHQKBZXO
5157 454f 5049 5541 5851 5745 4f49 553b | QWEOPIUAXQWEOIU;
206d 6178 2d61 6765 3d33 3630 303b 2076 | max-age=3600; v
6572 7369 6f6e 3d31 | ersion=1
| - evict: location: https:/\
| /www.example.com
| - evict: :status: 200
| -> set-cookie: foo=ASDJKHQ\
| KBZXOQWEOPIUAXQWEOIU; ma\
| x-age=3600; version=1
# Decoded header set Header Table (after decoding):
:status: 302
cache-control: private
date: Mon, 21 OCt 2013 20:13:21 GMT
location: : https://www.bar.com
######################### [ 1] (s = 98) set-cookie: foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU; max-age\
=3600; version=1
[ 2] (s = 52) content-encoding: gzip
[ 3] (s = 65) date: Mon, 21 Oct 2013 20:13:22 GMT
Table size: 215
# Header set to be encoded Decoded header set:
:status: 200
cache-control: private
date: Mon, 21 OCt 2013 20:13:22 GMT
location: https://www.bar.com
content-encoding: gzip
set-cookie: foo=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\
AAAAAAAAAAAAAAAAALASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEIUALQWEOIUAXLQEU\
AXLLKJASDQWEOUIAXN1234LASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEIUALQWEOIUA\
XLQEUAXLLKJASDQWEOUIAXN1234LASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEIUALQW\
EOIUAXLQEUAXLLKJASDQWEOUIAXN1234LASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEI\
UALQWEOIUAXLQEUAXLLKJASDQWEOUIAXN1234ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ\
ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ1234 max-age=3600; version=1
# Hexdump of encoded data which will be decoded cache-control: private
04 03 32 30 30 03 1d 4d 6f 6e 2c 20 32 31 20 4f | ..200..Mon, 21 O date: Mon, 21 Oct 2013 20:13:22 GMT
43 74 20 32 30 31 33 20 32 30 3a 31 33 3a 32 32 | Ct 2013 20:13:22 content-encoding: gzip
20 47 4d 54 03 13 68 74 74 70 73 3a 2f 2f 77 77 | GMT..https://ww location: https://www.example.com
77 2e 62 61 72 2e 63 6f 6d 20 04 67 7a 69 70 3d | w.bar.com .gzip= :status: 200
7f e1 02 66 6f 6f 3d 41 41 41 41 41 41 41 41 41 | ...foo=AAAAAAAAA set-cookie: foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU; max-age=3600; version=1
41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 | AAAAAAAAAAAAAAAA
41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 | AAAAAAAAAAAAAAAA
41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 | AAAAAAAAAAAAAAAA
41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 4c | AAAAAAAAAAAAAAAL
41 53 44 4a 4b 48 51 4b 42 5a 58 4f 51 57 45 4f | ASDJKHQKBZXOQWEO
50 49 55 41 58 51 57 45 4f 49 55 41 58 4c 4a 4b | PIUAXQWEOIUAXLJK
48 51 57 4f 45 49 55 41 4c 51 57 45 4f 49 55 41 | HQWOEIUALQWEOIUA
58 4c 51 45 55 41 58 4c 4c 4b 4a 41 53 44 51 57 | XLQEUAXLLKJASDQW
45 4f 55 49 41 58 4e 31 32 33 34 4c 41 53 44 4a | EOUIAXN1234LASDJ
4b 48 51 4b 42 5a 58 4f 51 57 45 4f 50 49 55 41 | KHQKBZXOQWEOPIUA
58 51 57 45 4f 49 55 41 58 4c 4a 4b 48 51 57 4f | XQWEOIUAXLJKHQWO
45 49 55 41 4c 51 57 45 4f 49 55 41 58 4c 51 45 | EIUALQWEOIUAXLQE
55 41 58 4c 4c 4b 4a 41 53 44 51 57 45 4f 55 49 | UAXLLKJASDQWEOUI
41 58 4e 31 32 33 34 4c 41 53 44 4a 4b 48 51 4b | AXN1234LASDJKHQK
42 5a 58 4f 51 57 45 4f 50 49 55 41 58 51 57 45 | BZXOQWEOPIUAXQWE
4f 49 55 41 58 4c 4a 4b 48 51 57 4f 45 49 55 41 | OIUAXLJKHQWOEIUA
4c 51 57 45 4f 49 55 41 58 4c 51 45 55 41 58 4c | LQWEOIUAXLQEUAXL
4c 4b 4a 41 53 44 51 57 45 4f 55 49 41 58 4e 31 | LKJASDQWEOUIAXN1
32 33 34 4c 41 53 44 4a 4b 48 51 4b 42 5a 58 4f | 234LASDJKHQKBZXO
51 57 45 4f 50 49 55 41 58 51 57 45 4f 49 55 41 | QWEOPIUAXQWEOIUA
58 4c 4a 4b 48 51 57 4f 45 49 55 41 4c 51 57 45 | XLJKHQWOEIUALQWE
4f 49 55 41 58 4c 51 45 55 41 58 4c 4c 4b 4a 41 | OIUAXLQEUAXLLKJA
53 44 51 57 45 4f 55 49 41 58 4e 31 32 33 34 5a | SDQWEOUIAXN1234Z
5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a | ZZZZZZZZZZZZZZZZ
5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a | ZZZZZZZZZZZZZZZZ
5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a | ZZZZZZZZZZZZZZZZ
5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a | ZZZZZZZZZZZZZZZZ
5a 5a 5a 5a 5a 5a 5a 31 32 33 34 20 6d 61 78 2d | ZZZZZZZ1234 max-
61 67 65 3d 33 36 30 30 3b 20 76 65 72 73 69 6f | age=3600; versio
6e 3d 31 85 86 88 | n=1...
# Decoded opcodes E.5. Response Examples with Huffman
LITERAL_INCREMENTAL_OPCODE:
opcodeLengthInBits: 2
discoveredFromPeekingAtByte: '04'
name_index:
encoded: "04"
decoded: 4
value_data_length:
encoded: "03"
decoded: 3
value_data:
is_huffman_encoded: 0
encoded: "323030"
decoded: "200"
LITERAL_INCREMENTAL_OPCODE: This section shows the same examples as the previous section, but
opcodeLengthInBits: 2 using Huffman encoding for the literal values. The eviction
discoveredFromPeekingAtByte: '03' mechanism uses the length of the decoded literal values, so the same
name_index: evictions occurs as in the previous section.
encoded: "03"
decoded: 3
value_data_length:
encoded: "1d"
decoded: 29
value_data:
is_huffman_encoded: 0
encoded: "4d6f6e2c203231204f437420323031332032303a31333a3232204\
74d54"
decoded: "Mon, 21 OCt 2013 20:13:22 GMT"
LITERAL_INCREMENTAL_OPCODE: E.5.1. First response
opcodeLengthInBits: 2
discoveredFromPeekingAtByte: '03'
name_index:
encoded: "03"
decoded: 3
value_data_length:
encoded: "13"
decoded: 19
value_data:
is_huffman_encoded: 0
encoded: "68747470733a2f2f7777772e6261722e636f6d"
decoded: "https://www.bar.com"
LITERAL_INCREMENTAL_OPCODE: Header set to encode:
opcodeLengthInBits: 2
discoveredFromPeekingAtByte: '20'
name_index:
encoded: "20"
decoded: 32
value_data_length:
encoded: "04"
decoded: 4
value_data:
is_huffman_encoded: 0
encoded: "677a6970"
decoded: "gzip"
LITERAL_INCREMENTAL_OPCODE: :status: 302
opcodeLengthInBits: 2 cache-control: private
discoveredFromPeekingAtByte: '3d' date: Mon, 21 Oct 2013 20:13:21 GMT
name_index: location: https://www.example.com
encoded: "3d"
decoded: 61
value_data_length:
encoded: "7fe102"
decoded: 480
value_data:
is_huffman_encoded: 0
encoded: "666f6f3d414141414141414141414141414141414141414141414\
14141414141414141414141414141414141414141414141414141414141414141414141\
41414141414141414141414141414c4153444a4b48514b425a584f5157454f504955415\
85157454f495541584c4a4b4851574f454955414c5157454f495541584c51455541584c\
4c4b4a4153445157454f554941584e313233344c4153444a4b48514b425a584f5157454\
f50495541585157454f495541584c4a4b4851574f454955414c5157454f495541584c51\
455541584c4c4b4a4153445157454f554941584e313233344c4153444a4b48514b425a5\
84f5157454f50495541585157454f495541584c4a4b4851574f454955414c5157454f49\
5541584c51455541584c4c4b4a4153445157454f554941584e313233344c4153444a4b4\
8514b425a584f5157454f50495541585157454f495541584c4a4b4851574f454955414c\
5157454f495541584c51455541584c4c4b4a4153445157454f554941584e313233345a5\
a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a\
5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a3\
1323334206d61782d6167653d333630303b2076657273696f6e3d31"
decoded: "foo=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\
AAAAAAAAAAAAAAAAAAAAAAALASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEIUALQWEOIU\
AXLQEUAXLLKJASDQWEOUIAXN1234LASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEIUALQ\
WEOIUAXLQEUAXLLKJASDQWEOUIAXN1234LASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOE\
IUALQWEOIUAXLQEUAXLLKJASDQWEOUIAXN1234LASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJK\
HQWOEIUALQWEOIUAXLQEUAXLLKJASDQWEOUIAXN1234ZZZZZZZZZZZZZZZZZZZZZZZZZZZZ\
ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ1234max-age=3600; version=1\
"
INDEX_OPCODE: Reference set: empty.
opcodeLengthInBits: 1
discoveredFromPeekingAtByte: '85'
entry_index:
encoded: "85"
decoded: 5
INDEX_OPCODE: Hex dump of encoded data:
opcodeLengthInBits: 1
discoveredFromPeekingAtByte: '86'
entry_index:
encoded: "86"
decoded: 6
INDEX_OPCODE: 0882 409f 1886 c31b 39bf 387f 2292 a2fb | ..@.....9.8."...
opcodeLengthInBits: 1 a203 20f2 ab30 3124 018b 490d 3209 e877 | .. ..01$..I.2..w
discoveredFromPeekingAtByte: '88' 3093 e39e 7864 dd7a fd3d 3d24 8747 db87 | 0...xd.z.==$.G..
entry_index: 2849 55f6 ff | (IU..
encoded: "88"
decoded: 8
# Decoded header set Decoding process:
:status: 200
cache-control: private
content-encoding: gzip
date: Mon, 21 OCt 2013 20:13:22 GMT
location: https://www.bar.com
set-cookie: foo=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\
AAAAAAAAAAAAAAAAALASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEIUALQWEOIUAXLQEU\
AXLLKJASDQWEOUIAXN1234LASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEIUALQWEOIUA\
XLQEUAXLLKJASDQWEOUIAXN1234LASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEIUALQW\
EOIUAXLQEUAXLLKJASDQWEOUIAXN1234LASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEI\
UALQWEOIUAXLQEUAXLLKJASDQWEOUIAXN1234ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ\
ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ1234 max-age=3600; version=1
######################### 08 | == Literal indexed ==
| Indexed name (idx = 8)
| :status
82 | Literal value (len = 3)
| Huffman encoded:
409f | @.
| Decoded:
| 302
| -> :status: 302
18 | == Literal indexed ==
| Indexed name (idx = 24)
| cache-control
86 | Literal value (len = 7)
| Huffman encoded:
c31b 39bf 387f | ..9.8.
| Decoded:
| private
| -> cache-control: private
22 | == Literal indexed ==
| Indexed name (idx = 34)
| date
92 | Literal value (len = 29)
| Huffman encoded:
a2fb a203 20f2 ab30 3124 018b 490d 3209 | .... ..01$..I.2.
e877 | .w
| Decoded:
| Mon, 21 Oct 2013 20:13:21 \
| GMT
| -> date: Mon, 21 Oct 2013 \
| 20:13:21 GMT
30 | == Literal indexed ==
| Indexed name (idx = 48)
| location
93 | Literal value (len = 23)
| Huffman encoded:
e39e 7864 dd7a fd3d 3d24 8747 db87 2849 | ..xd.z.==$.G..(I
55f6 ff | U..
| Decoded:
| https://www.example.com
| -> location: https://www.e\
| xample.com
# Header set to be encoded Header Table (after decoding):
:status: 200
cache-control: private
date: Mon, 21 OCt 2013 20:13:22 GMT
location: https://www.bar.com
content-encoding: gzip
set-cookie: foo=ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ\
ZZZZZZZZZZZZZZZZZLASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEIUALQWEOIUAXLQEU\
AXLLKJASDQWEOUIAXN1234LASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEIUALQWEOIUA\
XLQEUAXLLKJASDQWEOUIAXN1234LASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEIUALQW\
EOIUAXLQEUAXLLKJASDQWEOUIAXN1234LASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEI\
UALQWEOIUAXLQEUAXLLKJASDQWEOUIAXN1234AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA1234 max-age=3600; version=1
# Hexdump of encoded data which will be decoded [ 1] (s = 63) location: https://www.example.com
01 7f e1 02 66 6f 6f 3d 5a 5a 5a 5a 5a 5a 5a 5a | ....foo=ZZZZZZZZ [ 2] (s = 65) date: Mon, 21 Oct 2013 20:13:21 GMT
5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a | ZZZZZZZZZZZZZZZZ [ 3] (s = 52) cache-control: private
5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a | ZZZZZZZZZZZZZZZZ [ 4] (s = 42) :status: 302
5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a | ZZZZZZZZZZZZZZZZ Table size: 222
5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a | ZZZZZZZZZZZZZZZZ
4c 41 53 44 4a 4b 48 51 4b 42 5a 58 4f 51 57 45 | LASDJKHQKBZXOQWE
4f 50 49 55 41 58 51 57 45 4f 49 55 41 58 4c 4a | OPIUAXQWEOIUAXLJ
4b 48 51 57 4f 45 49 55 41 4c 51 57 45 4f 49 55 | KHQWOEIUALQWEOIU
41 58 4c 51 45 55 41 58 4c 4c 4b 4a 41 53 44 51 | AXLQEUAXLLKJASDQ
57 45 4f 55 49 41 58 4e 31 32 33 34 4c 41 53 44 | WEOUIAXN1234LASD
4a 4b 48 51 4b 42 5a 58 4f 51 57 45 4f 50 49 55 | JKHQKBZXOQWEOPIU
41 58 51 57 45 4f 49 55 41 58 4c 4a 4b 48 51 57 | AXQWEOIUAXLJKHQW
4f 45 49 55 41 4c 51 57 45 4f 49 55 41 58 4c 51 | OEIUALQWEOIUAXLQ
45 55 41 58 4c 4c 4b 4a 41 53 44 51 57 45 4f 55 | EUAXLLKJASDQWEOU
49 41 58 4e 31 32 33 34 4c 41 53 44 4a 4b 48 51 | IAXN1234LASDJKHQ
4b 42 5a 58 4f 51 57 45 4f 50 49 55 41 58 51 57 | KBZXOQWEOPIUAXQW
45 4f 49 55 41 58 4c 4a 4b 48 51 57 4f 45 49 55 | EOIUAXLJKHQWOEIU
41 4c 51 57 45 4f 49 55 41 58 4c 51 45 55 41 58 | ALQWEOIUAXLQEUAX
4c 4c 4b 4a 41 53 44 51 57 45 4f 55 49 41 58 4e | LLKJASDQWEOUIAXN
31 32 33 34 4c 41 53 44 4a 4b 48 51 4b 42 5a 58 | 1234LASDJKHQKBZX
4f 51 57 45 4f 50 49 55 41 58 51 57 45 4f 49 55 | OQWEOPIUAXQWEOIU
41 58 4c 4a 4b 48 51 57 4f 45 49 55 41 4c 51 57 | AXLJKHQWOEIUALQW
45 4f 49 55 41 58 4c 51 45 55 41 58 4c 4c 4b 4a | EOIUAXLQEUAXLLKJ
41 53 44 51 57 45 4f 55 49 41 58 4e 31 32 33 34 | ASDQWEOUIAXN1234
41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 | AAAAAAAAAAAAAAAA
41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 | AAAAAAAAAAAAAAAA
41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 | AAAAAAAAAAAAAAAA
41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 | AAAAAAAAAAAAAAAA
41 41 41 41 41 41 41 41 31 32 33 34 20 6d 61 78 | AAAAAAAA1234 max
2d 61 67 65 3d 33 36 30 30 3b 20 76 65 72 73 69 | -age=3600; versi
6f 6e 3d 31 81 | on=1.
# Decoded opcodes Decoded header set:
LITERAL_INCREMENTAL_OPCODE:
opcodeLengthInBits: 2
discoveredFromPeekingAtByte: '01'
name_index:
encoded: "01"
decoded: 1
value_data_length:
encoded: "7fe102"
decoded: 480
value_data:
is_huffman_encoded: 0
encoded: "666f6f3d5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5\
a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a\
5a5a5a5a5a5a5a5a5a5a5a5a5a5a4c4153444a4b48514b425a584f5157454f504955415\
85157454f495541584c4a4b4851574f454955414c5157454f495541584c51455541584c\
4c4b4a4153445157454f554941584e313233344c4153444a4b48514b425a584f5157454\
f50495541585157454f495541584c4a4b4851574f454955414c5157454f495541584c51\
455541584c4c4b4a4153445157454f554941584e313233344c4153444a4b48514b425a5\
84f5157454f50495541585157454f495541584c4a4b4851574f454955414c5157454f49\
5541584c51455541584c4c4b4a4153445157454f554941584e313233344c4153444a4b4\
8514b425a584f5157454f50495541585157454f495541584c4a4b4851574f454955414c\
5157454f495541584c51455541584c4c4b4a4153445157454f554941584e31323334414\
14141414141414141414141414141414141414141414141414141414141414141414141\
41414141414141414141414141414141414141414141414141414141414141414141413\
1323334206d61782d6167653d333630303b2076657273696f6e3d31"
decoded: "foo=ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ\
ZZZZZZZZZZZZZZZZZZZZZZZLASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEIUALQWEOIU\
AXLQEUAXLLKJASDQWEOUIAXN1234LASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEIUALQ\
WEOIUAXLQEUAXLLKJASDQWEOUIAXN1234LASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOE\
IUALQWEOIUAXLQEUAXLLKJASDQWEOUIAXN1234LASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJK\
HQWOEIUALQWEOIUAXLQEUAXLLKJASDQWEOUIAXN1234AAAAAAAAAAAAAAAAAAAAAAAAAAAA\
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA1234max-age=3600; version=1\
"
INDEX_OPCODE: :status: 302
opcodeLengthInBits: 1 cache-control: private
discoveredFromPeekingAtByte: '81' date: Mon, 21 Oct 2013 20:13:21 GMT
entry_index: location: https://www.example.com
encoded: "81"
decoded: 1
# Decoded header set E.5.2. Second response
:status: 200
cache-control: private The (":status", "302") header field is evicted from the header table
content-encoding: gzip to free space to allow adding the (":status", "200") header field to
date: Mon, 21 OCt 2013 20:13:22 GMT be copied from the static table into the header table.
location: https://www.bar.com
set-cookie: foo=ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ\ Header set to encode:
ZZZZZZZZZZZZZZZZZLASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEIUALQWEOIUAXLQEU\
AXLLKJASDQWEOUIAXN1234LASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEIUALQWEOIUA\ :status: 200
XLQEUAXLLKJASDQWEOUIAXN1234LASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEIUALQW\ cache-control: private
EOIUAXLQEUAXLLKJASDQWEOUIAXN1234LASDJKHQKBZXOQWEOPIUAXQWEOIUAXLJKHQWOEI\ date: Mon, 21 Oct 2013 20:13:21 GMT
UALQWEOIUAXLQEUAXLLKJASDQWEOUIAXN1234AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\ location: https://www.example.com
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA1234 max-age=3600; version=1
Reference set:
[ 1] location: https://www.example.com
[ 2] date: Mon, 21 Oct 2013 20:13:21 GMT
[ 3] cache-control: private
[ 4] :status: 302
Hex dump of encoded data:
848c | ..
Decoding process:
84 | == Indexed - Remove ==
| idx = 4
| -> :status: 302
8c | == Indexed - Add ==
| idx = 12
| - evict: :status: 302
| -> :status: 200
Header Table (after decoding):
[ 1] (s = 42) :status: 200
[ 2] (s = 63) location: https://www.example.com
[ 3] (s = 65) date: Mon, 21 Oct 2013 20:13:21 GMT
[ 4] (s = 52) cache-control: private
Table size: 222
Decoded header set:
:status: 200
location: https://www.example.com
date: Mon, 21 Oct 2013 20:13:21 GMT
cache-control: private
E.5.3. Third response
Several header fields are evicted from the header table during the
processing of this header set. Before evicting a header belonging to
the reference set, it is emitted, by coding it twice as an Indexed
Representation. The first representation removes the header field
from the reference set, the second one adds it again to the reference
set, also emitting it.
Header set to encode:
:status: 200
cache-control: private
date: Mon, 21 Oct 2013 20:13:22 GMT
location: https://www.example.com
content-encoding: gzip
set-cookie: foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU; max-age=3600; version=1
Reference set:
[ 1] :status: 200
[ 2] location: https://www.example.com
[ 3] date: Mon, 21 Oct 2013 20:13:21 GMT
[ 4] cache-control: private
Hex dump of encoded data:
8384 8403 92a2 fba2 0320 f2ab 3031 2401 | ......... ..01$.
8b49 0d33 09e8 771d 84e1 fbb3 0f84 8483 | .I.3..w.........
833a b3df 7dfb 36d3 d9e1 fcfc 3faf e7ab | .:..}.6.....?...
fcfe fcbf af3e df2f 977f d36f f7fd 79f6 | ......./...o..y.
f977 fd3d e16b fa46 fe10 d889 447d e1ce | .w.=.k.F....D}..
18e5 65f7 6c2f | ..e.l/
Decoding process:
83 | == Indexed - Remove ==
| idx = 3
| -> date: Mon, 21 Oct 2013 \
| 20:13:21 GMT
84 | == Indexed - Remove ==
| idx = 4
| -> cache-control: private
84 | == Indexed - Add ==
| idx = 4
| -> cache-control: private
03 | == Literal indexed ==
| Indexed name (idx = 3)
| date
92 | Literal value (len = 29)
| Huffman encoded:
a2fb a203 20f2 ab30 3124 018b 490d 3309 | .... ..01$..I.3.
e877 | .w
| Decoded:
| Mon, 21 Oct 2013 20:13:22 \
| GMT
| - evict: cache-control: pr\
| ivate
| -> date: Mon, 21 Oct 2013 \
| 20:13:22 GMT
1d | == Literal indexed ==
| Indexed name (idx = 29)
| content-encoding
84 | Literal value (len = 4)
| Huffman encoded:
e1fb b30f | ....
| Decoded:
| gzip
| - evict: date: Mon, 21 Oct\
| 2013 20:13:21 GMT
| -> content-encoding: gzip
84 | == Indexed - Remove ==
| idx = 4
| -> location: https://www.e\
| xample.com
84 | == Indexed - Add ==
| idx = 4
| -> location: https://www.e\
| xample.com
83 | == Indexed - Remove ==
| idx = 3
| -> :status: 200
83 | == Indexed - Add ==
| idx = 3
| -> :status: 200
3a | == Literal indexed ==
| Indexed name (idx = 58)
| set-cookie
b3 | Literal value (len = 56)
| Huffman encoded:
df7d fb36 d3d9 e1fc fc3f afe7 abfc fefc | .}.6.....?......
bfaf 3edf 2f97 7fd3 6ff7 fd79 f6f9 77fd | ..../...o..y..w.
3de1 6bfa 46fe 10d8 8944 7de1 ce18 e565 | =.k.F....D}....e
f76c 2f | .l/
| Decoded:
| foo=ASDJKHQKBZXOQWEOPIUAXQ\
| WEOIU; max-age=3600; versi\
| on=1
| - evict: location: https:/\
| /www.example.com
| - evict: :status: 200
| -> set-cookie: foo=ASDJKHQ\
| KBZXOQWEOPIUAXQWEOIU; ma\
| x-age=3600; version=1
Header Table (after decoding):
[ 1] (s = 98) set-cookie: foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU; max-age\
=3600; version=1
[ 2] (s = 52) content-encoding: gzip
[ 3] (s = 65) date: Mon, 21 Oct 2013 20:13:22 GMT
Table size: 215
Decoded header set:
cache-control: private
date: Mon, 21 Oct 2013 20:13:22 GMT
content-encoding: gzip
location: https://www.example.com
:status: 200
set-cookie: foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU; max-age=3600; version=1
#########################
Authors' Addresses Authors' Addresses
Roberto Peon Roberto Peon
Google, Inc Google, Inc
EMail: fenix@google.com EMail: fenix@google.com
Herve Ruellan Herve Ruellan
Canon CRF Canon CRF
 End of changes. 219 change blocks. 
1274 lines changed or deleted 1136 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/