idnits 2.17.1 draft-ietf-httpbis-header-compression-05.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) ** The document seems to lack a both a reference to RFC 2119 and the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. RFC 2119 keyword, line 242: '...uplicate entries MUST NOT be treated a...' RFC 2119 keyword, line 323: '...hat the reference set MUST be emptied....' RFC 2119 keyword, line 325: '...ny other indices MUST be treated as er...' RFC 2119 keyword, line 336: '... decoder MAY pass the emitted header...' RFC 2119 keyword, line 351: '...r set, a decoder MUST obey the followi...' (3 more instances...) Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 1038 has weird spacing: '... sym as ...' == Line 1308 has weird spacing: '... sym as ...' -- The document date (December 4, 2013) is 3794 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- == Missing Reference: '27' is mentioned on line 1202, but not defined == Missing Reference: '8' is mentioned on line 1430, but not defined == Missing Reference: '12' is mentioned on line 1372, but not defined == Missing Reference: '14' is mentioned on line 1433, but not defined == Missing Reference: '15' is mentioned on line 1403, but not defined == Missing Reference: '6' is mentioned on line 1426, but not defined == Missing Reference: '7' is mentioned on line 1429, but not defined == Missing Reference: '11' is mentioned on line 1402, but not defined == Missing Reference: '10' is mentioned on line 1399, but not defined == Missing Reference: '5' is mentioned on line 1410, but not defined == Missing Reference: '4' is mentioned on line 1359, but not defined == Missing Reference: '9' is mentioned on line 1431, but not defined == Missing Reference: '18' is mentioned on line 1099, but not defined == Missing Reference: '17' is mentioned on line 1405, but not defined == Missing Reference: '13' is mentioned on line 1401, but not defined == Missing Reference: '19' is mentioned on line 1135, but not defined == Missing Reference: '26' is mentioned on line 1295, but not defined == Missing Reference: '25' is mentioned on line 1471, but not defined == Missing Reference: '16' is mentioned on line 1435, but not defined == Missing Reference: '24' is mentioned on line 1565, but not defined == Outdated reference: A later version (-26) exists of draft-ietf-httpbis-p1-messaging-25 == Outdated reference: A later version (-17) exists of draft-ietf-httpbis-http2-08 Summary: 2 errors (**), 0 flaws (~~), 25 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 HTTPbis Working Group R. Peon 3 Internet-Draft Google, Inc 4 Intended status: Informational H. Ruellan 5 Expires: June 7, 2014 Canon CRF 6 December 4, 2013 8 HPACK - Header Compression for HTTP/2.0 9 draft-ietf-httpbis-header-compression-05 11 Abstract 13 This document describes HPACK, a format adapted to efficiently 14 represent HTTP header fields in the context of HTTP/2.0. 16 Editorial Note (To be removed by RFC Editor) 18 Discussion of this draft takes place on the HTTPBIS working group 19 mailing list (ietf-http-wg@w3.org), which is archived at 20 . 22 Working Group information and related documents can be found at 23 (Wiki) and 24 (source code and issues 25 tracker). 27 The changes in this draft are summarized in Appendix A.1. 29 Status of This Memo 31 This Internet-Draft is submitted in full conformance with the 32 provisions of BCP 78 and BCP 79. 34 Internet-Drafts are working documents of the Internet Engineering 35 Task Force (IETF). Note that other groups may also distribute 36 working documents as Internet-Drafts. The list of current Internet- 37 Drafts is at http://datatracker.ietf.org/drafts/current/. 39 Internet-Drafts are draft documents valid for a maximum of six months 40 and may be updated, replaced, or obsoleted by other documents at any 41 time. It is inappropriate to use Internet-Drafts as reference 42 material or to cite them other than as "work in progress." 44 This Internet-Draft will expire on June 7, 2014. 46 Copyright Notice 48 Copyright (c) 2013 IETF Trust and the persons identified as the 49 document authors. All rights reserved. 51 This document is subject to BCP 78 and the IETF Trust's Legal 52 Provisions Relating to IETF Documents 53 (http://trustee.ietf.org/license-info) in effect on the date of 54 publication of this document. Please review these documents 55 carefully, as they describe your rights and restrictions with respect 56 to this document. Code Components extracted from this document must 57 include Simplified BSD License text as described in Section 4.e of 58 the Trust Legal Provisions and are provided without warranty as 59 described in the Simplified BSD License. 61 Table of Contents 63 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 64 2. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 65 2.1. Outline . . . . . . . . . . . . . . . . . . . . . . . . . 4 66 3. Header Field Encoding . . . . . . . . . . . . . . . . . . . . 5 67 3.1. Encoding Concepts . . . . . . . . . . . . . . . . . . . . 5 68 3.1.1. Encoding Context . . . . . . . . . . . . . . . . . . . 5 69 3.1.2. Header Table . . . . . . . . . . . . . . . . . . . . . 6 70 3.1.3. Reference Set . . . . . . . . . . . . . . . . . . . . 6 71 3.1.4. Header Field Representation . . . . . . . . . . . . . 7 72 3.1.5. Header Field Emission . . . . . . . . . . . . . . . . 8 73 3.2. Header Block Decoding . . . . . . . . . . . . . . . . . . 8 74 3.2.1. Header Field Representation Processing . . . . . . . . 8 75 3.2.2. Reference Set Emission . . . . . . . . . . . . . . . . 10 76 3.2.3. Header Set Completion . . . . . . . . . . . . . . . . 10 77 3.3. Header Table Management . . . . . . . . . . . . . . . . . 10 78 3.3.1. Maximum Table Size . . . . . . . . . . . . . . . . . . 10 79 3.3.2. Entry Eviction When Header Table Size Changes . . . . 10 80 3.3.3. Entry Eviction when Adding New Entries . . . . . . . . 11 81 4. Detailed Format . . . . . . . . . . . . . . . . . . . . . . . 11 82 4.1. Low-level representations . . . . . . . . . . . . . . . . 11 83 4.1.1. Integer representation . . . . . . . . . . . . . . . . 11 84 4.1.2. String Literal Representation . . . . . . . . . . . . 13 85 4.2. Indexed Header Field Representation . . . . . . . . . . . 15 86 4.3. Literal Header Field Representation . . . . . . . . . . . 15 87 4.3.1. Literal Header Field without Indexing . . . . . . . . 15 88 4.3.2. Literal Header Field with Incremental Indexing . . . . 16 89 5. Security Considerations . . . . . . . . . . . . . . . . . . . 18 90 6. References . . . . . . . . . . . . . . . . . . . . . . . . . . 18 91 6.1. Normative References . . . . . . . . . . . . . . . . . . . 18 92 6.2. Informative References . . . . . . . . . . . . . . . . . . 19 93 Appendix A. Change Log (to be removed by RFC Editor before 94 publication . . . . . . . . . . . . . . . . . . . . . 19 95 A.1. Since draft-ietf-httpbis-header-compression-04 . . . . . . 19 96 A.2. Since draft-ietf-httpbis-header-compression-03 . . . . . . 20 97 A.3. Since draft-ietf-httpbis-header-compression-02 . . . . . . 20 98 A.4. Since draft-ietf-httpbis-header-compression-01 . . . . . . 20 99 A.5. Since draft-ietf-httpbis-header-compression-01 . . . . . . 21 100 Appendix B. Static Table . . . . . . . . . . . . . . . . . . . . 21 101 Appendix C. Huffman Codes For Requests . . . . . . . . . . . . . 23 102 Appendix D. Huffman Codes for Responses . . . . . . . . . . . . . 29 103 Appendix E. Examples . . . . . . . . . . . . . . . . . . . . . . 34 104 E.1. Header Field Representation Examples . . . . . . . . . . . 34 105 E.1.1. Literal Header Field with Indexing . . . . . . . . . . 34 106 E.1.2. Literal Header Field without Indexing . . . . . . . . 35 107 E.1.3. Indexed Header Field . . . . . . . . . . . . . . . . . 36 108 E.1.4. Indexed Header Field from Static Table . . . . . . . . 37 109 E.2. Request Examples without Huffman . . . . . . . . . . . . . 37 110 E.2.1. First request . . . . . . . . . . . . . . . . . . . . 37 111 E.2.2. Second request . . . . . . . . . . . . . . . . . . . . 38 112 E.2.3. Third request . . . . . . . . . . . . . . . . . . . . 40 113 E.3. Request Examples with Huffman . . . . . . . . . . . . . . 42 114 E.3.1. First request . . . . . . . . . . . . . . . . . . . . 42 115 E.3.2. Second request . . . . . . . . . . . . . . . . . . . . 43 116 E.3.3. Third request . . . . . . . . . . . . . . . . . . . . 44 117 E.4. Response Examples without Huffman . . . . . . . . . . . . 46 118 E.4.1. First response . . . . . . . . . . . . . . . . . . . . 46 119 E.4.2. Second response . . . . . . . . . . . . . . . . . . . 48 120 E.4.3. Third response . . . . . . . . . . . . . . . . . . . . 49 121 E.5. Response Examples with Huffman . . . . . . . . . . . . . . 51 122 E.5.1. First response . . . . . . . . . . . . . . . . . . . . 51 123 E.5.2. Second response . . . . . . . . . . . . . . . . . . . 53 124 E.5.3. Third response . . . . . . . . . . . . . . . . . . . . 54 126 1. Introduction 128 This document describes HPACK, a format adapted to efficiently 129 represent HTTP header fields in the context of HTTP/2.0 (see 130 [HTTP2]). 132 2. Overview 134 In HTTP (see [HTTP-p1]), header fields are sent without any form of 135 compression. As web pages have grown to include dozens to hundreds 136 of requests, the redundant header fields in these requests now pose a 137 problem of measurable latency and unnecessary bandwidth (see [PERF1] 138 and [PERF2]). 140 SPDY [SPDY] initially addressed this redundancy by compressing header 141 fields with Deflate, which proved very effective at eliminating the 142 redundant header fields. However, that approach exposed a security 143 risk as demonstrated by the CRIME [CRIME]. 145 This document describes HPACK, a new compressor for header fields 146 which eliminates redundant header fields, is not vulnerable to known 147 security attacks, and which also has a bounded memory cost for use in 148 constrained environments. 150 2.1. Outline 152 The HTTP header field encoding described in this document is based on 153 a header table that map name-value pairs to index values. Header 154 tables are incrementally updated during the HTTP/2.0 session. 156 The encoder is responsible for deciding which header fields to insert 157 as new entries in the header table. The decoder then does exactly 158 what the encoder prescribes, ending in a state that exactly matches 159 the encoder's state. This enables decoders to remain simple and 160 understand a wide variety of encoders. 162 As two consecutive sets of header fields often have header fields in 163 common, each set of header fields is coded as a difference from the 164 previous set of header fields. The goal is to only encode the 165 changes (header fields present in one of the set and not in the 166 other) between the two sets of header fields. 168 HTTP header field compression treats a set of header fields as an 169 unordered collection of name-value pairs. Names and values are 170 opaque sequences of octets. The order of header fields is not 171 guaranteed to be preserved after being compression and decompression. 173 Examples illustrating the use of these different mechanisms to 174 represent header fields are available in Appendix E. 176 3. Header Field Encoding 178 3.1. Encoding Concepts 180 The encoding and decoding of header fields relies on some components 181 and concepts: 183 Header Field: A name-value pair. Both name and value are sequences 184 of octets. 186 Header Table: The header table (see Section 3.1.2) is a component 187 used to associate stored header fields to index values. The data 188 stored in this table is in first-in, first-out order. 190 Static Table: The static table (see Appendix B) is a component used 191 to associate static header fields to index values. This data is 192 ordered, read-only, always accessible, and may be shared amongst 193 all encoding contexts. 195 Reference Set: The reference set (see Section 3.1.3) is a component 196 containing an unordered set of references to entries in the header 197 table. This is used for the differential encoding of a new header 198 set. 200 Header Set: A header set is a potentially ordered group of header 201 fields that are encoded jointly. A complete set of key-value 202 pairs contained in a HTTP request or response is a header set. 204 Header Field Representation: A header field can be represented in 205 encoded form either as a literal or as an index (see 206 Section 3.1.4). 208 Header Block: The entire set of encoded header field representations 209 which, when decoded, yield a complete header set. 211 Header Field Emission: When decoding a set of header field 212 representations, some operations emit a header field (see 213 Section 3.1.5). Emitted header fields can be safely passed to the 214 upper processing layers as part of the current Header Set. 216 3.1.1. Encoding Context 218 The set of mutable structures used within an encoding context include 219 a header table and a reference set. Everything else is either 220 immutable or conceptual. 222 Using HTTP, messages are exchanged between a client and a server in 223 both direction. To keep the encoding of header fields in each 224 direction independent from the other direction, there is one encoding 225 context for each direction. 227 The header fields contained in a PUSH_PROMISE frame sent by a server 228 to a client are encoded within the same context as the header fields 229 contained in the HEADERS frame corresponding to a response sent from 230 the server to the client. 232 3.1.2. Header Table 234 A header table consists of a list of header fields maintained in 235 first-in, first-out order. The first and newest entry in a header 236 table is always at index 1, and the oldest entry of a header table is 237 at the index len(header table). 239 The header table is initially empty. 241 There is typically no need for the header table to contain duplicate 242 entries. However, duplicate entries MUST NOT be treated as an error 243 by a decoder. 245 The encoder decides how to update the header table and as such can 246 control how much memory is used by the header table. To limit the 247 memory requirements on the decoder side, the header table size is 248 strictly bounded (see Section 3.3.1). 250 The header table is updated during the processing of a set of header 251 field representations (see header field representation processing 252 (Section 3.2.1)). 254 3.1.3. Reference Set 256 A reference set is an unordered set of references to entries of the 257 header table. 259 The reference set is initially empty. 261 The reference set is updated during the processing of a set of header 262 field representations (see header field representation processing 263 (Section 3.2.1)). 265 The reference set enables differential encoding, whereby only 266 differences between the previous header set and the current header 267 set need to be encoded. The use of differential encoding is optional 268 for any header set. 270 When an entry is evicted from the header table, if it was referenced 271 from the reference set, its reference is removed from the reference 272 set. 274 To limit the memory requirements on the decoder side for handling the 275 reference set, only entries within the header table can be contained 276 in the reference set. To still allow entries from the static table 277 to take advantage of the differential encoding, when a header field 278 is represented as a reference to an entry of the static table, this 279 entry is inserted into the header table ((see Section 3.2.1). 281 3.1.4. Header Field Representation 283 An encoded header field can be represented either as a literal or as 284 an index. 286 Literal Representation: A literal representation defines a new 287 header field. The header field name is represented either 288 literally or as a reference to an entry of the header table. The 289 header field value is represented literally. 291 Two different literal representations are provided: 293 * A literal representation that does not add the header field to 294 the header table (see Section 4.3.1). 296 * A literal representation that adds the header field as a new 297 entry at the beginning of the header table (see Section 4.3.2). 299 Indexed Representation: The indexed representation defines a header 300 field as a reference to an entry in either the header table or the 301 static table(see Section 4.2). 303 <---------- Index Address Space ----------> 304 <-- Header Table --> <-- Static Table --> 305 +---+-----------+---+ +---+-----------+---+ 306 | 1 | ... | k | |k+1| ... | n | 307 +---+-----------+---+ +---+-----------+---+ 308 ^ | 309 | V 310 Insertion Point Drop Point 312 Index Address Space 314 Indices between 1 and len(header table), inclusive, refer to 315 elements in the header table, with index 1 referring to the 316 beginning of the table. 318 Indices between len(header table)+1 and len(header table)+ 319 len(static table), inclusive, refer to elements in the static 320 table, where the index len(header table)+1 refers to the first 321 entry in the static table. 323 Index 0 signals that the reference set MUST be emptied. 325 Any other indices MUST be treated as erroneous, and the 326 compression context considered corrupt and unusable. 328 3.1.5. Header Field Emission 330 The emission of a header field is the process of marking a header 331 field as belonging to the current header set. Once a header has been 332 emitted, it cannot be removed from the current header set. 334 On the decoding side, an emitted header field can be safely passed to 335 the upper processing layer as part of the current header set. The 336 decoder MAY pass the emitted header fields to the upper processing 337 layer in any order. 339 By emitting header fields instead of emitting header sets, the 340 decoder can be implemented in a streaming way, and as such has only 341 to keep in memory the header table and the reference set. This 342 bounds the amount of memory used by the decoder, even in presence of 343 a very large set of header fields. The management of memory for 344 handling very large sets of header fields can therefore be deferred 345 to the upper processing layers. 347 3.2. Header Block Decoding 349 The processing of a header block to obtain a header set is defined in 350 this section. To ensure that the decoding will successfully produce 351 a header set, a decoder MUST obey the following rules. 353 3.2.1. Header Field Representation Processing 355 All the header field representations contained in a header block are 356 processed in the order in which they are presented, as specified 357 below. 359 An _indexed representation_ with an index value of 0 entails the 360 following actions: 362 o The reference set is emptied. 364 An _indexed representation_ corresponding to an entry _present_ in 365 the reference set entails the following actions: 367 o The entry is removed from the reference set. 369 An _indexed representation_ corresponding to an entry _not present_ 370 in the reference set entails the following actions: 372 o If referencing an element of the static table: 374 * The header field corresponding to the referenced entry is 375 emitted. 377 * The referenced static entry is inserted at the beginning of the 378 header table. 380 * A reference to this new header table entry is added to the 381 reference set (except if this new entry didn't fit in the 382 header table). 384 o If referencing an element of the header table: 386 * The header field corresponding to the referenced entry is 387 emitted. 389 * The referenced header table entry is added to the reference 390 set. 392 A _literal representation_ that is _not added_ to the header table 393 entails the following action: 395 o The header field is emitted. 397 A _literal representation_ that is _added_ to the header table 398 entails the following actions: 400 o The header field is emitted. 402 o The header field is inserted at the beginning of the header table. 404 o A reference to the new entry is added to the reference set (except 405 if this new entry didn't fit in the header table). 407 3.2.2. Reference Set Emission 409 Once all the representations contained in a header block have been 410 processed, the header fields referenced in the reference set which 411 have not previously been emitted during this processing are emitted. 413 3.2.3. Header Set Completion 415 Once all of the header field representations have been processed, and 416 the remaining items in the reference set have been emitted, the 417 header set is complete. 419 3.3. Header Table Management 421 3.3.1. Maximum Table Size 423 To limit the memory requirements on the decoder side, the size of the 424 header table is bounded. The size of the header table MUST stay 425 lower than or equal to the value of the HTTP/2.0 setting 426 SETTINGS_HEADER_TABLE_SIZE (see [HTTP2]). 428 The size of the header table is the sum of the size of its entries. 430 The size of an entry is the sum of its name's length in octets (as 431 defined in Section 4.1.2), of its value's length in octets 432 (Section 4.1.2) and of 32 octets. 434 The lengths are measured on the non-encoded entry name and entry 435 value (for the case when a Huffman encoding is used to transmit 436 string values). 438 The 32 octets are an accounting for the entry structure overhead. 439 For example, an entry structure using two 64-bits pointers to 440 reference the name and the value and the entry, and two 64-bits 441 integer for counting the number of references to these name and value 442 would use 32 octets. 444 3.3.2. Entry Eviction When Header Table Size Changes 446 Whenever an entry is evicted from the header table, any reference to 447 that entry contained by the reference set is removed. 449 Whenever SETTINGS_HEADER_TABLE_SIZE is made smaller, entries are 450 evicted from the end of the header table until the size of the header 451 table is less than or equal to SETTINGS_HEADER_TABLE_SIZE. 453 The eviction of an entry from the header table causes the index of 454 the entries in the static table to be reduced by one. 456 3.3.3. Entry Eviction when Adding New Entries 458 Whenever a new entry is to be added to the table, any name referenced 459 by the representation of this new entry is cached, and then entries 460 are evicted from the end of the header table until the size of the 461 header table is less than or equal to SETTINGS_HEADER_TABLE_SIZE - 462 new entry size, or until the table is empty. 464 If the size of the new entry is less than or equal to 465 SETTINGS_HEADER_TABLE_SIZE, that entry is added to the table. It is 466 not an error to attempt to add an entry that is larger than 467 SETTINGS_HEADER_TABLE_SIZE. 469 4. Detailed Format 471 4.1. Low-level representations 473 4.1.1. Integer representation 475 Integers are used to represent name indexes, pair indexes or string 476 lengths. To allow for optimized processing, an integer 477 representation always finishes at the end of an octet. 479 An integer is represented in two parts: a prefix that fills the 480 current octet and an optional list of octets that are used if the 481 integer value does not fit within the prefix. The number of bits of 482 the prefix (called N) is a parameter of the integer representation. 484 The N-bit prefix allows filling the current octet. If the value is 485 small enough (strictly less than 2^N-1), it is encoded within the 486 N-bit prefix. Otherwise all the bits of the prefix are set to 1 and 487 the value is encoded using an unsigned variable length integer [1] 488 representation. N is always between 1 and 8 bits. An integer 489 starting at an octet-boundary will have an 8-bit prefix. 491 The algorithm to represent an integer I is as follows: 493 If I < 2^N - 1, encode I on N bits 494 Else 495 encode 2^N - 1 on N bits 496 I = I - (2^N - 1) 497 While I >= 128 498 Encode (I % 128 + 128) on 8 bits 499 I = I / 128 500 encode (I) on 8 bits 502 This integer representation allows for values of indefinite size. It 503 is also possible for an encoder to send a large number of zero 504 values, which can waste octets and could be used to overflow integer 505 values. Excessively large integer encodings - in value or octet 506 length - MUST be treated as a decoding error. Different limits can 507 be set for each of the different uses of integers, based on 508 implementation constraints. 510 4.1.1.1. Example 1: Encoding 10 using a 5-bit prefix 512 The value 10 is to be encoded with a 5-bit prefix. 514 o 10 is less than 31 (= 2^5 - 1) and is represented using the 5-bit 515 prefix. 517 0 1 2 3 4 5 6 7 518 +---+---+---+---+---+---+---+---+ 519 | X | X | X | 0 | 1 | 0 | 1 | 0 | 10 stored on 5 bits 520 +---+---+---+---+---+---+---+---+ 522 4.1.1.2. Example 2: Encoding 1337 using a 5-bit prefix 524 The value I=1337 is to be encoded with a 5-bit prefix. 526 1337 is greater than 31 (= 2^5 - 1). 528 The 5-bit prefix is filled with its max value (31). 530 I = 1337 - (2^5 - 1) = 1306. 532 I (1306) is greater than or equal to 128, the while loop body 533 executes: 535 I % 128 == 26 537 26 + 128 == 154 539 154 is encoded in 8 bits as: 10011010 541 I is set to 10 (1306 / 128 == 10) 543 I is no longer greater than or equal to 128, the while loop 544 terminates. 546 I, now 10, is encoded on 8 bits as: 00001010 548 The process ends. 550 0 1 2 3 4 5 6 7 551 +---+---+---+---+---+---+---+---+ 552 | X | X | X | 1 | 1 | 1 | 1 | 1 | Prefix = 31, I = 1306 553 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 1306>=128, encode(154), I=1306/128 554 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 10<128, encode(10), done 555 +---+---+---+---+---+---+---+---+ 557 4.1.1.3. Example 3: Encoding 42 starting at an 558 octet-boundary 560 The value 42 is to be encoded starting at an octet-boundary. This 561 implies that a 8-bit prefix is used. 563 o 42 is less than 255 (= 2^8 - 1) and is represented using the 8-bit 564 prefix. 566 0 1 2 3 4 5 6 7 567 +---+---+---+---+---+---+---+---+ 568 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 42 stored on 8 bits 569 +---+---+---+---+---+---+---+---+ 571 4.1.2. String Literal Representation 573 Header field names and header field values are encoded as sequences 574 of octets. A header field name or a header field value is encoded in 575 three parts: 577 1. One bit, H, indicating whether or not the octets are Huffman 578 encoded. 580 2. The number of octets required to hold the result of the next 581 step, represented as a variable-length-quantity (Section 4.1.1), 582 starting with a 7-bit prefix immediately following the first bit. 584 3. The encoded data of the string: 586 1. If H is true, then the encoded string data is the bitwise 587 concatenation of the canonical [CANON]Huffman code [HUFF] 588 corresponding to each octet of the data, followed by between 589 0-7 bits of padding. 591 2. If H is false, then the encoded string is the octets of the 592 field value without modification. 594 Padding is necessary when doing Huffman encoding to ensure that the 595 remaining bits between the actual end of the data and the next octet 596 boundary are not misinterpreted as part of the input data. 598 When padding for Huffman encoding, use the bits from the EOS (end-of- 599 string) entry in the Huffman table, starting with the MSB (most 600 significant bit). This entry is guaranteed to be at least 8 bits 601 long. 603 String literals sent in the client to server direction which use 604 Huffman encoding are encoded with the codes within the request 605 Huffman code table (Appendix C) (see Request Examples With Huffman 606 (Appendix E.3)). 608 String literals sent in the server to client direction which use 609 Huffman encoding are encoded with the codes within the response 610 Huffman code table (Appendix D) (see Response Examples With Huffman 611 (Appendix E.5)). 613 The EOS symbol is represented with value 256, and is used solely to 614 signal the end of the Huffman-encoded key data or the end of the 615 Huffman-encoded value data. Given that only between 0-7 bits of the 616 EOS symbol is included in any Huffman-encoded string, and given that 617 the EOS symbol is at least 8 bits long, it is expected that it should 618 never be successfully decoded. 620 0 1 2 3 4 5 6 7 621 +---+---+---+---+---+---+---+---+ 622 | 1 | Value Length Prefix (7) | 623 +---+---+---+---+---+---+---+---+ 624 | Value Length (0-N octets) | 625 +---+---+---+---+---+---+---+---+ 626 ... 627 +---+---+---+---+---+---+---+---+ 628 | Huffman Encoded Data |Padding| 629 +---+---+---+---+---+---+---+---+ 631 String Literal With Huffman Encoding 633 0 1 2 3 4 5 6 7 634 +---+---+---+---+---+---+---+---+ 635 | 0 | Value Length Prefix (7) | 636 +---+---+---+---+---+---+---+---+ 637 | Value Length (0-N octets) | 638 +---+---+---+---+---+---+---+---+ 639 ... 640 +---+---+---+---+---+---+---+---+ 641 | Field Bytes Without Encoding | 642 +---+---+---+---+---+---+---+---+ 644 String Literal Without Huffman Encoding 646 4.2. Indexed Header Field Representation 648 An indexed header field representation either identifies an entry in 649 the header table or static table. The processing of an indexed 650 header field representation is described in Section 3.2.1. 652 0 1 2 3 4 5 6 7 653 +---+---+---+---+---+---+---+---+ 654 | 1 | Index (7+) | 655 +---+---------------------------+ 657 Indexed Header Field 659 This representation starts with the '1' 1-bit pattern, followed by 660 the index of the matching pair, represented as an integer with a 661 7-bit prefix. 663 The index value of 0 is reserved for signalling that the reference 664 set is emptied. 666 4.3. Literal Header Field Representation 668 Literal header field representations contain a literal header field 669 value. Header field names are either provided as a literal or by 670 reference to an existing header table or static table entry. 672 Literal representations all result in the emission of a header field 673 when decoded. 675 4.3.1. Literal Header Field without Indexing 677 A literal header field without indexing causes the emission of a 678 header field without altering the header table. 680 0 1 2 3 4 5 6 7 681 +---+---+---+---+---+---+---+---+ 682 | 0 | 1 | Index (6+) | 683 +---+---+---+-------------------+ 684 | Value Length (8+) | 685 +-------------------------------+ 686 | Value String (Length octets) | 687 +-------------------------------+ 689 Literal Header Field without Indexing - Indexed Name 691 0 1 2 3 4 5 6 7 692 +---+---+---+---+---+---+---+---+ 693 | 0 | 1 | 0 | 694 +---+---+---+-------------------+ 695 | Name Length (8+) | 696 +-------------------------------+ 697 | Name String (Length octets) | 698 +-------------------------------+ 699 | Value Length (8+) | 700 +-------------------------------+ 701 | Value String (Length octets) | 702 +-------------------------------+ 704 Literal Header Field without Indexing - New Name 706 This representation starts with the '01' 2-bit pattern. 708 If the header field name matches the header field name of a (name, 709 value) pair stored in the Header Table or Static Table, the header 710 field name can be represented using the index of that entry. In this 711 case, the index of the entry, index (which is strictly greater than 712 0), is represented as an integer with a 6-bit prefix (see 713 Section 4.1.1). 715 Otherwise, the header field name is represented as a literal. The 716 value 0 is represented on 6 bits followed by the header field name 717 (see Section 4.1.2). 719 The header field name representation is followed by the header field 720 value represented as a literal string as described in Section 4.1.2. 722 4.3.2. Literal Header Field with Incremental Indexing 724 A literal header field with incremental indexing adds a new entry to 725 the header table. 727 0 1 2 3 4 5 6 7 728 +---+---+---+---+---+---+---+---+ 729 | 0 | 0 | Index (6+) | 730 +---+---+---+-------------------+ 731 | Value Length (8+) | 732 +-------------------------------+ 733 | Value String (Length octets) | 734 +-------------------------------+ 736 Literal Header Field with Incremental Indexing - 737 Indexed Name 739 0 1 2 3 4 5 6 7 740 +---+---+---+---+---+---+---+---+ 741 | 0 | 0 | 0 | 742 +---+---+---+-------------------+ 743 | Name Length (8+) | 744 +-------------------------------+ 745 | Name String (Length octets) | 746 +-------------------------------+ 747 | Value Length (8+) | 748 +-------------------------------+ 749 | Value String (Length octets) | 750 +-------------------------------+ 752 Literal Header Field with Incremental Indexing - 753 New Name 755 This representation starts with the '00' 2-bit pattern. 757 If the header field name matches the header field name of a (name, 758 value) pair stored in the Header Table or Static Table, the header 759 field name can be represented using the index of that entry. In this 760 case, the index of the entry, index (which is strictly greater than 761 0), is represented as an integer with a 6-bit prefix (see 762 Section 4.1.1). 764 Otherwise, the header field name is represented as a literal. The 765 value 0 is represented on 6 bits followed by the header field name 766 (see Section 4.1.2). 768 The header field name representation is followed by the header field 769 value represented as a literal string as described in Section 4.1.2. 771 5. Security Considerations 773 This compressor exists to solve security issues present in stream 774 compressors such as DEFLATE whereby the compression context can be 775 efficiently probed to reveal secrets. A conformant implementation of 776 this specification should be fairly safe against that kind of attack, 777 as the reaping of any information from the compression context 778 requires more work than guessing and verifying the plain text data 779 directly with the server. As with any secret, however, the longer 780 the length of the secret, the more difficult the secret is to guess. 781 It is inadvisable to have short cookies that are relied upon to 782 remain secret for any duration of time. 784 A proper security-conscious implementation will also need to prevent 785 timing attacks by ensuring that the amount of time it takes to do 786 string comparisons is always a function of the total length of the 787 strings, and not a function of the number of matched characters. 789 A decoder needs to ensure that larger values or encodings of integers 790 do not permit exploitation. Decoders MUST limit the size of 791 integers, both in value and encoded length, that it accepts (see 792 Section 4.1.1). 794 Another common security problem is when the remote endpoint 795 successfully causes the local endpoint to exhaust its memory. This 796 compressor attempts to deal with the most obvious ways that this 797 could occur by limiting both the peak and the steady-state amount of 798 memory consumed in the compressor state, by providing ways for the 799 application to consume/flush the emitted header fields in small 800 chunks, and by considering overhead in the state size calculation. 801 Implementors must still be careful in the creation of APIs to an 802 implementation of this compressor by ensuring that header field keys 803 and values are either emitted as a stream, or that the compression 804 implementation have a limit on the maximum size of a key or value. 805 Failure to implement these kinds of safeguards may still result in a 806 scenario where the local endpoint exhausts its memory. 808 6. References 810 6.1. Normative References 812 [HTTP-p1] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 813 Protocol (HTTP/1.1): Message Syntax and Routing", 814 draft-ietf-httpbis-p1-messaging-25 (work in progress), 815 November 2013. 817 [HTTP2] Belshe, M., Peon, R., Thomson, M., Ed., and A. Melnikov, 818 Ed., "Hypertext Transfer Protocol version 2.0", 819 draft-ietf-httpbis-http2-08 (work in progress), 820 November 2013. 822 6.2. Informative References 824 [CANON] Schwartz, E. and B. Kallick, "Generating a canonical 825 prefix encoding", Communications of the ACM Volume 7 Issue 826 3, pp. 166-169, March 1964, 827 . 829 [CRIME] Rizzo, J. and T. Duong, "The Crime Attack", 830 September 2012, . 835 [HUFF] Huffman, D., "A Method for the Construction of Minimum 836 Redundancy Codes", Proceedings of the Institute of Radio 837 Engineers Volume 40, Number 9, pp. 1098-1101, 838 September 1952, . 841 [PERF1] Belshe, M., "IETF83: SPDY and What to Consider for 842 HTTP/2.0", March 2012, . 845 [PERF2] McManus, P., "SPDY: What I Like About You", 846 September 2011, . 849 [SPDY] Belshe, M. and R. Peon, "SPDY Protocol", 850 draft-mbelshe-httpbis-spdy-00 (work in progress), 851 February 2012. 853 URIs 855 [1] 857 Appendix A. Change Log (to be removed by RFC Editor before publication 859 A.1. Since draft-ietf-httpbis-header-compression-04 861 o Updated examples: take into account changes in the spec, and show 862 more features. 864 o Use 'octet' everywhere instead of having both 'byte' and 'octet'. 866 o Added reference set emptying. 868 o Editorial changes and clarifications. 870 o Added "host" header to the static table. 872 o Ordering for list of values (either NULL- or comma-separated). 874 A.2. Since draft-ietf-httpbis-header-compression-03 876 o A large number of editorial changes; changed the description of 877 evicting/adding new entries. 879 o Removed substitution indexing 881 o Changed 'initial headers' to 'static headers', as per issue #258 883 o Merged 'request' and 'response' static headers, as per issue #259 885 o Changed text to indicate that new headers are added at index 0 and 886 expire from the largest index, as per issue #233 888 A.3. Since draft-ietf-httpbis-header-compression-02 890 o Corrected error in integer encoding pseudocode. 892 A.4. Since draft-ietf-httpbis-header-compression-01 894 o Refactored of Header Encoding Section: split definitions and 895 processing rule. 897 o Backward incompatible change: Updated reference set management as 898 per issue #214. This changes how the interaction between the 899 reference set and eviction works. This also changes the working 900 of the reference set in some specific cases. 902 o Backward incompatible change: modified initial header list, as per 903 issue #188. 905 o Added example of 32 octets entry structure (issue #191). 907 o Added Header Set Completion section. Reflowed some text. 908 Clarified some writing which was akward. Added text about 909 duplicate header entry encoding. Clarified some language w.r.t 910 Header Set. Changed x-my-header to mynewheader. Added text in the 911 HeaderEmission section indicating that the application may also be 912 able to free up memory more quickly. Added information in 913 Security Considerations section. 915 A.5. Since draft-ietf-httpbis-header-compression-01 917 Fixed bug/omission in integer representation algorithm. 919 Changed the document title. 921 Header matching text rewritten. 923 Changed the definition of header emission. 925 Changed the name of the setting which dictates how much memory the 926 compression context should use. 928 Removed "specific use cases" section 930 Corrected erroneous statement about what index can be contained in 931 one octet 933 Added descriptions of opcodes 935 Removed security claims from introduction. 937 Appendix B. Static Table 939 The static table consists of an unchangeable ordered list of (name, 940 value) pairs. The first entry in the table is always represented by 941 the index len(header table)+1, and the last entry in the table is 942 represented by the index len(header table)+len(static table). 944 [[anchor9: The ordering of these tables is currently arbitrary. The 945 tables in this section should be updated and ordered such that the 946 table entries with the smallest indices are those which, based on a 947 statistical analysis of the frequency of use weighted by size, 948 achieve the largest decrease in octets transmitted subject to HTTP 949 2.0 header field rules (like removal of some header fields). This 950 set of header fields is currently very likely incomplete, and should 951 be made complete.]] 953 The following table lists the pre-defined header fields that make-up 954 the static header table. 956 +-------+-----------------------------+--------------+ 957 | Index | Header Name | Header Value | 958 +-------+-----------------------------+--------------+ 959 | 1 | :authority | | 960 | 2 | :method | GET | 961 | 3 | :method | POST | 962 | 4 | :path | / | 963 | 5 | :path | /index.html | 964 | 6 | :scheme | http | 965 | 7 | :scheme | https | 966 | 8 | :status | 200 | 967 | 9 | :status | 500 | 968 | 10 | :status | 404 | 969 | 11 | :status | 403 | 970 | 12 | :status | 400 | 971 | 13 | :status | 401 | 972 | 14 | accept-charset | | 973 | 15 | accept-encoding | | 974 | 16 | accept-language | | 975 | 17 | accept-ranges | | 976 | 18 | accept | | 977 | 19 | access-control-allow-origin | | 978 | 20 | age | | 979 | 21 | allow | | 980 | 22 | authorization | | 981 | 23 | cache-control | | 982 | 24 | content-disposition | | 983 | 25 | content-encoding | | 984 | 26 | content-language | | 985 | 27 | content-length | | 986 | 28 | content-location | | 987 | 29 | content-range | | 988 | 30 | content-type | | 989 | 31 | cookie | | 990 | 32 | date | | 991 | 33 | etag | | 992 | 34 | expect | | 993 | 35 | expires | | 994 | 36 | from | | 995 | 37 | host | | 996 | 38 | if-match | | 997 | 39 | if-modified-since | | 998 | 40 | if-none-match | | 999 | 41 | if-range | | 1000 | 42 | if-unmodified-since | | 1001 | 43 | last-modified | | 1002 | 44 | link | | 1003 | 45 | location | | 1004 | 46 | max-forwards | | 1005 | 47 | proxy-authenticate | | 1006 | 48 | proxy-authorization | | 1007 | 49 | range | | 1008 | 50 | referer | | 1009 | 51 | refresh | | 1010 | 52 | retry-after | | 1011 | 53 | server | | 1012 | 54 | set-cookie | | 1013 | 55 | strict-transport-security | | 1014 | 56 | transfer-encoding | | 1015 | 57 | user-agent | | 1016 | 58 | vary | | 1017 | 59 | via | | 1018 | 60 | www-authenticate | | 1019 +-------+-----------------------------+--------------+ 1021 Table 1: Static Table Entries 1023 The table give the index of each entry in the static table. The full 1024 index of each entry, to be used for encoding a reference to this 1025 entry, is computed by adding the number of entries in the header 1026 table to this index. 1028 Appendix C. Huffman Codes For Requests 1030 The following Huffman codes are used when encoding string literals in 1031 the client to server direction. 1033 [[anchor10: This table may need to be regenerated.]] 1035 aligned aligned 1036 to len to len 1037 MSB in LSB in 1038 sym as bits bits as hex bits 1039 ( 0) |11111111|11111111|11110111|010 [27] 7ffffba [27] 1040 ( 1) |11111111|11111111|11110111|011 [27] 7ffffbb [27] 1041 ( 2) |11111111|11111111|11110111|100 [27] 7ffffbc [27] 1042 ( 3) |11111111|11111111|11110111|101 [27] 7ffffbd [27] 1043 ( 4) |11111111|11111111|11110111|110 [27] 7ffffbe [27] 1044 ( 5) |11111111|11111111|11110111|111 [27] 7ffffbf [27] 1045 ( 6) |11111111|11111111|11111000|000 [27] 7ffffc0 [27] 1046 ( 7) |11111111|11111111|11111000|001 [27] 7ffffc1 [27] 1047 ( 8) |11111111|11111111|11111000|010 [27] 7ffffc2 [27] 1048 ( 9) |11111111|11111111|11111000|011 [27] 7ffffc3 [27] 1049 ( 10) |11111111|11111111|11111000|100 [27] 7ffffc4 [27] 1050 ( 11) |11111111|11111111|11111000|101 [27] 7ffffc5 [27] 1051 ( 12) |11111111|11111111|11111000|110 [27] 7ffffc6 [27] 1052 ( 13) |11111111|11111111|11111000|111 [27] 7ffffc7 [27] 1053 ( 14) |11111111|11111111|11111001|000 [27] 7ffffc8 [27] 1054 ( 15) |11111111|11111111|11111001|001 [27] 7ffffc9 [27] 1055 ( 16) |11111111|11111111|11111001|010 [27] 7ffffca [27] 1056 ( 17) |11111111|11111111|11111001|011 [27] 7ffffcb [27] 1057 ( 18) |11111111|11111111|11111001|100 [27] 7ffffcc [27] 1058 ( 19) |11111111|11111111|11111001|101 [27] 7ffffcd [27] 1059 ( 20) |11111111|11111111|11111001|110 [27] 7ffffce [27] 1060 ( 21) |11111111|11111111|11111001|111 [27] 7ffffcf [27] 1061 ( 22) |11111111|11111111|11111010|000 [27] 7ffffd0 [27] 1062 ( 23) |11111111|11111111|11111010|001 [27] 7ffffd1 [27] 1063 ( 24) |11111111|11111111|11111010|010 [27] 7ffffd2 [27] 1064 ( 25) |11111111|11111111|11111010|011 [27] 7ffffd3 [27] 1065 ( 26) |11111111|11111111|11111010|100 [27] 7ffffd4 [27] 1066 ( 27) |11111111|11111111|11111010|101 [27] 7ffffd5 [27] 1067 ( 28) |11111111|11111111|11111010|110 [27] 7ffffd6 [27] 1068 ( 29) |11111111|11111111|11111010|111 [27] 7ffffd7 [27] 1069 ( 30) |11111111|11111111|11111011|000 [27] 7ffffd8 [27] 1070 ( 31) |11111111|11111111|11111011|001 [27] 7ffffd9 [27] 1071 ' ' ( 32) |11101000| [8] e8 [8] 1072 '!' ( 33) |11111111|1100 [12] ffc [12] 1073 '"' ( 34) |11111111|111010 [14] 3ffa [14] 1074 '#' ( 35) |11111111|1111100 [15] 7ffc [15] 1075 '$' ( 36) |11111111|1111101 [15] 7ffd [15] 1076 '%' ( 37) |100100 [6] 24 [6] 1077 '&' ( 38) |1101110 [7] 6e [7] 1078 ''' ( 39) |11111111|1111110 [15] 7ffe [15] 1079 '(' ( 40) |11111111|010 [11] 7fa [11] 1080 ')' ( 41) |11111111|011 [11] 7fb [11] 1081 '*' ( 42) |11111110|10 [10] 3fa [10] 1082 '+' ( 43) |11111111|100 [11] 7fc [11] 1083 ',' ( 44) |11101001| [8] e9 [8] 1084 '-' ( 45) |100101 [6] 25 [6] 1085 '.' ( 46) |00100 [5] 4 [5] 1086 '/' ( 47) |0000 [4] 0 [4] 1087 '0' ( 48) |00101 [5] 5 [5] 1088 '1' ( 49) |00110 [5] 6 [5] 1089 '2' ( 50) |00111 [5] 7 [5] 1090 '3' ( 51) |100110 [6] 26 [6] 1091 '4' ( 52) |100111 [6] 27 [6] 1092 '5' ( 53) |101000 [6] 28 [6] 1093 '6' ( 54) |101001 [6] 29 [6] 1094 '7' ( 55) |101010 [6] 2a [6] 1095 '8' ( 56) |101011 [6] 2b [6] 1096 '9' ( 57) |101100 [6] 2c [6] 1097 ':' ( 58) |11110110|0 [9] 1ec [9] 1098 ';' ( 59) |11101010| [8] ea [8] 1099 '<' ( 60) |11111111|11111111|10 [18] 3fffe [18] 1100 '=' ( 61) |101101 [6] 2d [6] 1101 '>' ( 62) |11111111|11111110|0 [17] 1fffc [17] 1102 '?' ( 63) |11110110|1 [9] 1ed [9] 1103 '@' ( 64) |11111111|111011 [14] 3ffb [14] 1104 'A' ( 65) |1101111 [7] 6f [7] 1105 'B' ( 66) |11101011| [8] eb [8] 1106 'C' ( 67) |11101100| [8] ec [8] 1107 'D' ( 68) |11101101| [8] ed [8] 1108 'E' ( 69) |11101110| [8] ee [8] 1109 'F' ( 70) |1110000 [7] 70 [7] 1110 'G' ( 71) |11110111|0 [9] 1ee [9] 1111 'H' ( 72) |11110111|1 [9] 1ef [9] 1112 'I' ( 73) |11111000|0 [9] 1f0 [9] 1113 'J' ( 74) |11111000|1 [9] 1f1 [9] 1114 'K' ( 75) |11111110|11 [10] 3fb [10] 1115 'L' ( 76) |11111001|0 [9] 1f2 [9] 1116 'M' ( 77) |11101111| [8] ef [8] 1117 'N' ( 78) |11111001|1 [9] 1f3 [9] 1118 'O' ( 79) |11111010|0 [9] 1f4 [9] 1119 'P' ( 80) |11111010|1 [9] 1f5 [9] 1120 'Q' ( 81) |11111011|0 [9] 1f6 [9] 1121 'R' ( 82) |11111011|1 [9] 1f7 [9] 1122 'S' ( 83) |11110000| [8] f0 [8] 1123 'T' ( 84) |11110001| [8] f1 [8] 1124 'U' ( 85) |11111100|0 [9] 1f8 [9] 1125 'V' ( 86) |11111100|1 [9] 1f9 [9] 1126 'W' ( 87) |11111101|0 [9] 1fa [9] 1127 'X' ( 88) |11111101|1 [9] 1fb [9] 1128 'Y' ( 89) |11111110|0 [9] 1fc [9] 1129 'Z' ( 90) |11111111|00 [10] 3fc [10] 1130 '[' ( 91) |11111111|111100 [14] 3ffc [14] 1131 '\' ( 92) |11111111|11111111|11111011|010 [27] 7ffffda [27] 1132 ']' ( 93) |11111111|11100 [13] 1ffc [13] 1133 '^' ( 94) |11111111|111101 [14] 3ffd [14] 1134 '_' ( 95) |101110 [6] 2e [6] 1135 '`' ( 96) |11111111|11111111|110 [19] 7fffe [19] 1136 'a' ( 97) |01000 [5] 8 [5] 1137 'b' ( 98) |101111 [6] 2f [6] 1138 'c' ( 99) |01001 [5] 9 [5] 1139 'd' (100) |110000 [6] 30 [6] 1140 'e' (101) |0001 [4] 1 [4] 1141 'f' (102) |110001 [6] 31 [6] 1142 'g' (103) |110010 [6] 32 [6] 1143 'h' (104) |110011 [6] 33 [6] 1144 'i' (105) |01010 [5] a [5] 1145 'j' (106) |1110001 [7] 71 [7] 1146 'k' (107) |1110010 [7] 72 [7] 1147 'l' (108) |01011 [5] b [5] 1148 'm' (109) |110100 [6] 34 [6] 1149 'n' (110) |01100 [5] c [5] 1150 'o' (111) |01101 [5] d [5] 1151 'p' (112) |01110 [5] e [5] 1152 'q' (113) |11110010| [8] f2 [8] 1153 'r' (114) |01111 [5] f [5] 1154 's' (115) |10000 [5] 10 [5] 1155 't' (116) |10001 [5] 11 [5] 1156 'u' (117) |110101 [6] 35 [6] 1157 'v' (118) |1110011 [7] 73 [7] 1158 'w' (119) |110110 [6] 36 [6] 1159 'x' (120) |11110011| [8] f3 [8] 1160 'y' (121) |11110100| [8] f4 [8] 1161 'z' (122) |11110101| [8] f5 [8] 1162 '{' (123) |11111111|11111110|1 [17] 1fffd [17] 1163 '|' (124) |11111111|101 [11] 7fd [11] 1164 '}' (125) |11111111|11111111|0 [17] 1fffe [17] 1165 '~' (126) |11111111|1101 [12] ffd [12] 1166 (127) |11111111|11111111|11111011|011 [27] 7ffffdb [27] 1167 (128) |11111111|11111111|11111011|100 [27] 7ffffdc [27] 1168 (129) |11111111|11111111|11111011|101 [27] 7ffffdd [27] 1169 (130) |11111111|11111111|11111011|110 [27] 7ffffde [27] 1170 (131) |11111111|11111111|11111011|111 [27] 7ffffdf [27] 1171 (132) |11111111|11111111|11111100|000 [27] 7ffffe0 [27] 1172 (133) |11111111|11111111|11111100|001 [27] 7ffffe1 [27] 1173 (134) |11111111|11111111|11111100|010 [27] 7ffffe2 [27] 1174 (135) |11111111|11111111|11111100|011 [27] 7ffffe3 [27] 1175 (136) |11111111|11111111|11111100|100 [27] 7ffffe4 [27] 1176 (137) |11111111|11111111|11111100|101 [27] 7ffffe5 [27] 1177 (138) |11111111|11111111|11111100|110 [27] 7ffffe6 [27] 1178 (139) |11111111|11111111|11111100|111 [27] 7ffffe7 [27] 1179 (140) |11111111|11111111|11111101|000 [27] 7ffffe8 [27] 1180 (141) |11111111|11111111|11111101|001 [27] 7ffffe9 [27] 1181 (142) |11111111|11111111|11111101|010 [27] 7ffffea [27] 1182 (143) |11111111|11111111|11111101|011 [27] 7ffffeb [27] 1183 (144) |11111111|11111111|11111101|100 [27] 7ffffec [27] 1184 (145) |11111111|11111111|11111101|101 [27] 7ffffed [27] 1185 (146) |11111111|11111111|11111101|110 [27] 7ffffee [27] 1186 (147) |11111111|11111111|11111101|111 [27] 7ffffef [27] 1187 (148) |11111111|11111111|11111110|000 [27] 7fffff0 [27] 1188 (149) |11111111|11111111|11111110|001 [27] 7fffff1 [27] 1189 (150) |11111111|11111111|11111110|010 [27] 7fffff2 [27] 1190 (151) |11111111|11111111|11111110|011 [27] 7fffff3 [27] 1191 (152) |11111111|11111111|11111110|100 [27] 7fffff4 [27] 1192 (153) |11111111|11111111|11111110|101 [27] 7fffff5 [27] 1193 (154) |11111111|11111111|11111110|110 [27] 7fffff6 [27] 1194 (155) |11111111|11111111|11111110|111 [27] 7fffff7 [27] 1195 (156) |11111111|11111111|11111111|000 [27] 7fffff8 [27] 1196 (157) |11111111|11111111|11111111|001 [27] 7fffff9 [27] 1197 (158) |11111111|11111111|11111111|010 [27] 7fffffa [27] 1198 (159) |11111111|11111111|11111111|011 [27] 7fffffb [27] 1199 (160) |11111111|11111111|11111111|100 [27] 7fffffc [27] 1200 (161) |11111111|11111111|11111111|101 [27] 7fffffd [27] 1201 (162) |11111111|11111111|11111111|110 [27] 7fffffe [27] 1202 (163) |11111111|11111111|11111111|111 [27] 7ffffff [27] 1203 (164) |11111111|11111111|11100000|00 [26] 3ffff80 [26] 1204 (165) |11111111|11111111|11100000|01 [26] 3ffff81 [26] 1205 (166) |11111111|11111111|11100000|10 [26] 3ffff82 [26] 1206 (167) |11111111|11111111|11100000|11 [26] 3ffff83 [26] 1207 (168) |11111111|11111111|11100001|00 [26] 3ffff84 [26] 1208 (169) |11111111|11111111|11100001|01 [26] 3ffff85 [26] 1209 (170) |11111111|11111111|11100001|10 [26] 3ffff86 [26] 1210 (171) |11111111|11111111|11100001|11 [26] 3ffff87 [26] 1211 (172) |11111111|11111111|11100010|00 [26] 3ffff88 [26] 1212 (173) |11111111|11111111|11100010|01 [26] 3ffff89 [26] 1213 (174) |11111111|11111111|11100010|10 [26] 3ffff8a [26] 1214 (175) |11111111|11111111|11100010|11 [26] 3ffff8b [26] 1215 (176) |11111111|11111111|11100011|00 [26] 3ffff8c [26] 1216 (177) |11111111|11111111|11100011|01 [26] 3ffff8d [26] 1217 (178) |11111111|11111111|11100011|10 [26] 3ffff8e [26] 1218 (179) |11111111|11111111|11100011|11 [26] 3ffff8f [26] 1219 (180) |11111111|11111111|11100100|00 [26] 3ffff90 [26] 1220 (181) |11111111|11111111|11100100|01 [26] 3ffff91 [26] 1221 (182) |11111111|11111111|11100100|10 [26] 3ffff92 [26] 1222 (183) |11111111|11111111|11100100|11 [26] 3ffff93 [26] 1223 (184) |11111111|11111111|11100101|00 [26] 3ffff94 [26] 1224 (185) |11111111|11111111|11100101|01 [26] 3ffff95 [26] 1225 (186) |11111111|11111111|11100101|10 [26] 3ffff96 [26] 1226 (187) |11111111|11111111|11100101|11 [26] 3ffff97 [26] 1227 (188) |11111111|11111111|11100110|00 [26] 3ffff98 [26] 1228 (189) |11111111|11111111|11100110|01 [26] 3ffff99 [26] 1229 (190) |11111111|11111111|11100110|10 [26] 3ffff9a [26] 1230 (191) |11111111|11111111|11100110|11 [26] 3ffff9b [26] 1231 (192) |11111111|11111111|11100111|00 [26] 3ffff9c [26] 1232 (193) |11111111|11111111|11100111|01 [26] 3ffff9d [26] 1233 (194) |11111111|11111111|11100111|10 [26] 3ffff9e [26] 1234 (195) |11111111|11111111|11100111|11 [26] 3ffff9f [26] 1235 (196) |11111111|11111111|11101000|00 [26] 3ffffa0 [26] 1236 (197) |11111111|11111111|11101000|01 [26] 3ffffa1 [26] 1237 (198) |11111111|11111111|11101000|10 [26] 3ffffa2 [26] 1238 (199) |11111111|11111111|11101000|11 [26] 3ffffa3 [26] 1239 (200) |11111111|11111111|11101001|00 [26] 3ffffa4 [26] 1240 (201) |11111111|11111111|11101001|01 [26] 3ffffa5 [26] 1241 (202) |11111111|11111111|11101001|10 [26] 3ffffa6 [26] 1242 (203) |11111111|11111111|11101001|11 [26] 3ffffa7 [26] 1243 (204) |11111111|11111111|11101010|00 [26] 3ffffa8 [26] 1244 (205) |11111111|11111111|11101010|01 [26] 3ffffa9 [26] 1245 (206) |11111111|11111111|11101010|10 [26] 3ffffaa [26] 1246 (207) |11111111|11111111|11101010|11 [26] 3ffffab [26] 1247 (208) |11111111|11111111|11101011|00 [26] 3ffffac [26] 1248 (209) |11111111|11111111|11101011|01 [26] 3ffffad [26] 1249 (210) |11111111|11111111|11101011|10 [26] 3ffffae [26] 1250 (211) |11111111|11111111|11101011|11 [26] 3ffffaf [26] 1251 (212) |11111111|11111111|11101100|00 [26] 3ffffb0 [26] 1252 (213) |11111111|11111111|11101100|01 [26] 3ffffb1 [26] 1253 (214) |11111111|11111111|11101100|10 [26] 3ffffb2 [26] 1254 (215) |11111111|11111111|11101100|11 [26] 3ffffb3 [26] 1255 (216) |11111111|11111111|11101101|00 [26] 3ffffb4 [26] 1256 (217) |11111111|11111111|11101101|01 [26] 3ffffb5 [26] 1257 (218) |11111111|11111111|11101101|10 [26] 3ffffb6 [26] 1258 (219) |11111111|11111111|11101101|11 [26] 3ffffb7 [26] 1259 (220) |11111111|11111111|11101110|00 [26] 3ffffb8 [26] 1260 (221) |11111111|11111111|11101110|01 [26] 3ffffb9 [26] 1261 (222) |11111111|11111111|11101110|10 [26] 3ffffba [26] 1262 (223) |11111111|11111111|11101110|11 [26] 3ffffbb [26] 1263 (224) |11111111|11111111|11101111|00 [26] 3ffffbc [26] 1264 (225) |11111111|11111111|11101111|01 [26] 3ffffbd [26] 1265 (226) |11111111|11111111|11101111|10 [26] 3ffffbe [26] 1266 (227) |11111111|11111111|11101111|11 [26] 3ffffbf [26] 1267 (228) |11111111|11111111|11110000|00 [26] 3ffffc0 [26] 1268 (229) |11111111|11111111|11110000|01 [26] 3ffffc1 [26] 1269 (230) |11111111|11111111|11110000|10 [26] 3ffffc2 [26] 1270 (231) |11111111|11111111|11110000|11 [26] 3ffffc3 [26] 1271 (232) |11111111|11111111|11110001|00 [26] 3ffffc4 [26] 1272 (233) |11111111|11111111|11110001|01 [26] 3ffffc5 [26] 1273 (234) |11111111|11111111|11110001|10 [26] 3ffffc6 [26] 1274 (235) |11111111|11111111|11110001|11 [26] 3ffffc7 [26] 1275 (236) |11111111|11111111|11110010|00 [26] 3ffffc8 [26] 1276 (237) |11111111|11111111|11110010|01 [26] 3ffffc9 [26] 1277 (238) |11111111|11111111|11110010|10 [26] 3ffffca [26] 1278 (239) |11111111|11111111|11110010|11 [26] 3ffffcb [26] 1279 (240) |11111111|11111111|11110011|00 [26] 3ffffcc [26] 1280 (241) |11111111|11111111|11110011|01 [26] 3ffffcd [26] 1281 (242) |11111111|11111111|11110011|10 [26] 3ffffce [26] 1282 (243) |11111111|11111111|11110011|11 [26] 3ffffcf [26] 1283 (244) |11111111|11111111|11110100|00 [26] 3ffffd0 [26] 1284 (245) |11111111|11111111|11110100|01 [26] 3ffffd1 [26] 1285 (246) |11111111|11111111|11110100|10 [26] 3ffffd2 [26] 1286 (247) |11111111|11111111|11110100|11 [26] 3ffffd3 [26] 1287 (248) |11111111|11111111|11110101|00 [26] 3ffffd4 [26] 1288 (249) |11111111|11111111|11110101|01 [26] 3ffffd5 [26] 1289 (250) |11111111|11111111|11110101|10 [26] 3ffffd6 [26] 1290 (251) |11111111|11111111|11110101|11 [26] 3ffffd7 [26] 1291 (252) |11111111|11111111|11110110|00 [26] 3ffffd8 [26] 1292 (253) |11111111|11111111|11110110|01 [26] 3ffffd9 [26] 1293 (254) |11111111|11111111|11110110|10 [26] 3ffffda [26] 1294 (255) |11111111|11111111|11110110|11 [26] 3ffffdb [26] 1295 EOS (256) |11111111|11111111|11110111|00 [26] 3ffffdc [26] 1297 Appendix D. Huffman Codes for Responses 1299 The following Huffman codes are used when encoding string literals in 1300 the server to client direction. These codes apply for both responses 1301 to client requests and for push-promises. 1303 [[anchor11: This table may need to be regenerated.]] 1305 aligned aligned 1306 to len to len 1307 MSB in LSB in 1308 sym as bits bits as hex bits 1309 ( 0) |11111111|11111111|11011110|0 [25] 1ffffbc [25] 1310 ( 1) |11111111|11111111|11011110|1 [25] 1ffffbd [25] 1311 ( 2) |11111111|11111111|11011111|0 [25] 1ffffbe [25] 1312 ( 3) |11111111|11111111|11011111|1 [25] 1ffffbf [25] 1313 ( 4) |11111111|11111111|11100000|0 [25] 1ffffc0 [25] 1314 ( 5) |11111111|11111111|11100000|1 [25] 1ffffc1 [25] 1315 ( 6) |11111111|11111111|11100001|0 [25] 1ffffc2 [25] 1316 ( 7) |11111111|11111111|11100001|1 [25] 1ffffc3 [25] 1317 ( 8) |11111111|11111111|11100010|0 [25] 1ffffc4 [25] 1318 ( 9) |11111111|11111111|11100010|1 [25] 1ffffc5 [25] 1319 ( 10) |11111111|11111111|11100011|0 [25] 1ffffc6 [25] 1320 ( 11) |11111111|11111111|11100011|1 [25] 1ffffc7 [25] 1321 ( 12) |11111111|11111111|11100100|0 [25] 1ffffc8 [25] 1322 ( 13) |11111111|11111111|11100100|1 [25] 1ffffc9 [25] 1323 ( 14) |11111111|11111111|11100101|0 [25] 1ffffca [25] 1324 ( 15) |11111111|11111111|11100101|1 [25] 1ffffcb [25] 1325 ( 16) |11111111|11111111|11100110|0 [25] 1ffffcc [25] 1326 ( 17) |11111111|11111111|11100110|1 [25] 1ffffcd [25] 1327 ( 18) |11111111|11111111|11100111|0 [25] 1ffffce [25] 1328 ( 19) |11111111|11111111|11100111|1 [25] 1ffffcf [25] 1329 ( 20) |11111111|11111111|11101000|0 [25] 1ffffd0 [25] 1330 ( 21) |11111111|11111111|11101000|1 [25] 1ffffd1 [25] 1331 ( 22) |11111111|11111111|11101001|0 [25] 1ffffd2 [25] 1332 ( 23) |11111111|11111111|11101001|1 [25] 1ffffd3 [25] 1333 ( 24) |11111111|11111111|11101010|0 [25] 1ffffd4 [25] 1334 ( 25) |11111111|11111111|11101010|1 [25] 1ffffd5 [25] 1335 ( 26) |11111111|11111111|11101011|0 [25] 1ffffd6 [25] 1336 ( 27) |11111111|11111111|11101011|1 [25] 1ffffd7 [25] 1337 ( 28) |11111111|11111111|11101100|0 [25] 1ffffd8 [25] 1338 ( 29) |11111111|11111111|11101100|1 [25] 1ffffd9 [25] 1339 ( 30) |11111111|11111111|11101101|0 [25] 1ffffda [25] 1340 ( 31) |11111111|11111111|11101101|1 [25] 1ffffdb [25] 1341 ' ' ( 32) |0000 [4] 0 [4] 1342 '!' ( 33) |11111111|1010 [12] ffa [12] 1343 '"' ( 34) |1101010 [7] 6a [7] 1344 '#' ( 35) |11111111|11010 [13] 1ffa [13] 1345 '$' ( 36) |11111111|111100 [14] 3ffc [14] 1346 '%' ( 37) |11110110|0 [9] 1ec [9] 1347 '&' ( 38) |11111110|00 [10] 3f8 [10] 1348 ''' ( 39) |11111111|11011 [13] 1ffb [13] 1349 '(' ( 40) |11110110|1 [9] 1ed [9] 1350 ')' ( 41) |11110111|0 [9] 1ee [9] 1351 '*' ( 42) |11111111|1011 [12] ffb [12] 1352 '+' ( 43) |11111111|010 [11] 7fa [11] 1353 ',' ( 44) |100010 [6] 22 [6] 1354 '-' ( 45) |100011 [6] 23 [6] 1355 '.' ( 46) |100100 [6] 24 [6] 1356 '/' ( 47) |1101011 [7] 6b [7] 1357 '0' ( 48) |0001 [4] 1 [4] 1358 '1' ( 49) |0010 [4] 2 [4] 1359 '2' ( 50) |0011 [4] 3 [4] 1360 '3' ( 51) |01000 [5] 8 [5] 1361 '4' ( 52) |01001 [5] 9 [5] 1362 '5' ( 53) |01010 [5] a [5] 1363 '6' ( 54) |100101 [6] 25 [6] 1364 '7' ( 55) |100110 [6] 26 [6] 1365 '8' ( 56) |01011 [5] b [5] 1366 '9' ( 57) |01100 [5] c [5] 1367 ':' ( 58) |01101 [5] d [5] 1368 ';' ( 59) |11110111|1 [9] 1ef [9] 1369 '<' ( 60) |11111111|11111010| [16] fffa [16] 1370 '=' ( 61) |1101100 [7] 6c [7] 1371 '>' ( 62) |11111111|11100 [13] 1ffc [13] 1372 '?' ( 63) |11111111|1100 [12] ffc [12] 1373 '@' ( 64) |11111111|11111011| [16] fffb [16] 1374 'A' ( 65) |1101101 [7] 6d [7] 1375 'B' ( 66) |11101010| [8] ea [8] 1376 'C' ( 67) |11101011| [8] eb [8] 1377 'D' ( 68) |11101100| [8] ec [8] 1378 'E' ( 69) |11101101| [8] ed [8] 1379 'F' ( 70) |11101110| [8] ee [8] 1380 'G' ( 71) |100111 [6] 27 [6] 1381 'H' ( 72) |11111000|0 [9] 1f0 [9] 1382 'I' ( 73) |11101111| [8] ef [8] 1383 'J' ( 74) |11110000| [8] f0 [8] 1384 'K' ( 75) |11111110|01 [10] 3f9 [10] 1385 'L' ( 76) |11111000|1 [9] 1f1 [9] 1386 'M' ( 77) |101000 [6] 28 [6] 1387 'N' ( 78) |11110001| [8] f1 [8] 1388 'O' ( 79) |11110010| [8] f2 [8] 1389 'P' ( 80) |11111001|0 [9] 1f2 [9] 1390 'Q' ( 81) |11111110|10 [10] 3fa [10] 1391 'R' ( 82) |11111001|1 [9] 1f3 [9] 1392 'S' ( 83) |101001 [6] 29 [6] 1393 'T' ( 84) |01110 [5] e [5] 1394 'U' ( 85) |11111010|0 [9] 1f4 [9] 1395 'V' ( 86) |11111010|1 [9] 1f5 [9] 1396 'W' ( 87) |11110011| [8] f3 [8] 1397 'X' ( 88) |11111110|11 [10] 3fb [10] 1398 'Y' ( 89) |11111011|0 [9] 1f6 [9] 1399 'Z' ( 90) |11111111|00 [10] 3fc [10] 1400 '[' ( 91) |11111111|011 [11] 7fb [11] 1401 '\' ( 92) |11111111|11101 [13] 1ffd [13] 1402 ']' ( 93) |11111111|100 [11] 7fc [11] 1403 '^' ( 94) |11111111|1111100 [15] 7ffc [15] 1404 '_' ( 95) |11111011|1 [9] 1f7 [9] 1405 '`' ( 96) |11111111|11111111|0 [17] 1fffe [17] 1406 'a' ( 97) |01111 [5] f [5] 1407 'b' ( 98) |1101110 [7] 6e [7] 1408 'c' ( 99) |101010 [6] 2a [6] 1409 'd' (100) |101011 [6] 2b [6] 1410 'e' (101) |10000 [5] 10 [5] 1411 'f' (102) |1101111 [7] 6f [7] 1412 'g' (103) |1110000 [7] 70 [7] 1413 'h' (104) |1110001 [7] 71 [7] 1414 'i' (105) |101100 [6] 2c [6] 1415 'j' (106) |11111100|0 [9] 1f8 [9] 1416 'k' (107) |11111100|1 [9] 1f9 [9] 1417 'l' (108) |1110010 [7] 72 [7] 1418 'm' (109) |101101 [6] 2d [6] 1419 'n' (110) |101110 [6] 2e [6] 1420 'o' (111) |101111 [6] 2f [6] 1421 'p' (112) |110000 [6] 30 [6] 1422 'q' (113) |11111101|0 [9] 1fa [9] 1423 'r' (114) |110001 [6] 31 [6] 1424 's' (115) |110010 [6] 32 [6] 1425 't' (116) |110011 [6] 33 [6] 1426 'u' (117) |110100 [6] 34 [6] 1427 'v' (118) |1110011 [7] 73 [7] 1428 'w' (119) |11110100| [8] f4 [8] 1429 'x' (120) |1110100 [7] 74 [7] 1430 'y' (121) |11110101| [8] f5 [8] 1431 'z' (122) |11111101|1 [9] 1fb [9] 1432 '{' (123) |11111111|11111100| [16] fffc [16] 1433 '|' (124) |11111111|111101 [14] 3ffd [14] 1434 '}' (125) |11111111|11111101| [16] fffd [16] 1435 '~' (126) |11111111|11111110| [16] fffe [16] 1436 (127) |11111111|11111111|11101110|0 [25] 1ffffdc [25] 1437 (128) |11111111|11111111|11101110|1 [25] 1ffffdd [25] 1438 (129) |11111111|11111111|11101111|0 [25] 1ffffde [25] 1439 (130) |11111111|11111111|11101111|1 [25] 1ffffdf [25] 1440 (131) |11111111|11111111|11110000|0 [25] 1ffffe0 [25] 1441 (132) |11111111|11111111|11110000|1 [25] 1ffffe1 [25] 1442 (133) |11111111|11111111|11110001|0 [25] 1ffffe2 [25] 1443 (134) |11111111|11111111|11110001|1 [25] 1ffffe3 [25] 1444 (135) |11111111|11111111|11110010|0 [25] 1ffffe4 [25] 1445 (136) |11111111|11111111|11110010|1 [25] 1ffffe5 [25] 1446 (137) |11111111|11111111|11110011|0 [25] 1ffffe6 [25] 1447 (138) |11111111|11111111|11110011|1 [25] 1ffffe7 [25] 1448 (139) |11111111|11111111|11110100|0 [25] 1ffffe8 [25] 1449 (140) |11111111|11111111|11110100|1 [25] 1ffffe9 [25] 1450 (141) |11111111|11111111|11110101|0 [25] 1ffffea [25] 1451 (142) |11111111|11111111|11110101|1 [25] 1ffffeb [25] 1452 (143) |11111111|11111111|11110110|0 [25] 1ffffec [25] 1453 (144) |11111111|11111111|11110110|1 [25] 1ffffed [25] 1454 (145) |11111111|11111111|11110111|0 [25] 1ffffee [25] 1455 (146) |11111111|11111111|11110111|1 [25] 1ffffef [25] 1456 (147) |11111111|11111111|11111000|0 [25] 1fffff0 [25] 1457 (148) |11111111|11111111|11111000|1 [25] 1fffff1 [25] 1458 (149) |11111111|11111111|11111001|0 [25] 1fffff2 [25] 1459 (150) |11111111|11111111|11111001|1 [25] 1fffff3 [25] 1460 (151) |11111111|11111111|11111010|0 [25] 1fffff4 [25] 1461 (152) |11111111|11111111|11111010|1 [25] 1fffff5 [25] 1462 (153) |11111111|11111111|11111011|0 [25] 1fffff6 [25] 1463 (154) |11111111|11111111|11111011|1 [25] 1fffff7 [25] 1464 (155) |11111111|11111111|11111100|0 [25] 1fffff8 [25] 1465 (156) |11111111|11111111|11111100|1 [25] 1fffff9 [25] 1466 (157) |11111111|11111111|11111101|0 [25] 1fffffa [25] 1467 (158) |11111111|11111111|11111101|1 [25] 1fffffb [25] 1468 (159) |11111111|11111111|11111110|0 [25] 1fffffc [25] 1469 (160) |11111111|11111111|11111110|1 [25] 1fffffd [25] 1470 (161) |11111111|11111111|11111111|0 [25] 1fffffe [25] 1471 (162) |11111111|11111111|11111111|1 [25] 1ffffff [25] 1472 (163) |11111111|11111111|10000000| [24] ffff80 [24] 1473 (164) |11111111|11111111|10000001| [24] ffff81 [24] 1474 (165) |11111111|11111111|10000010| [24] ffff82 [24] 1475 (166) |11111111|11111111|10000011| [24] ffff83 [24] 1476 (167) |11111111|11111111|10000100| [24] ffff84 [24] 1477 (168) |11111111|11111111|10000101| [24] ffff85 [24] 1478 (169) |11111111|11111111|10000110| [24] ffff86 [24] 1479 (170) |11111111|11111111|10000111| [24] ffff87 [24] 1480 (171) |11111111|11111111|10001000| [24] ffff88 [24] 1481 (172) |11111111|11111111|10001001| [24] ffff89 [24] 1482 (173) |11111111|11111111|10001010| [24] ffff8a [24] 1483 (174) |11111111|11111111|10001011| [24] ffff8b [24] 1484 (175) |11111111|11111111|10001100| [24] ffff8c [24] 1485 (176) |11111111|11111111|10001101| [24] ffff8d [24] 1486 (177) |11111111|11111111|10001110| [24] ffff8e [24] 1487 (178) |11111111|11111111|10001111| [24] ffff8f [24] 1488 (179) |11111111|11111111|10010000| [24] ffff90 [24] 1489 (180) |11111111|11111111|10010001| [24] ffff91 [24] 1490 (181) |11111111|11111111|10010010| [24] ffff92 [24] 1491 (182) |11111111|11111111|10010011| [24] ffff93 [24] 1492 (183) |11111111|11111111|10010100| [24] ffff94 [24] 1493 (184) |11111111|11111111|10010101| [24] ffff95 [24] 1494 (185) |11111111|11111111|10010110| [24] ffff96 [24] 1495 (186) |11111111|11111111|10010111| [24] ffff97 [24] 1496 (187) |11111111|11111111|10011000| [24] ffff98 [24] 1497 (188) |11111111|11111111|10011001| [24] ffff99 [24] 1498 (189) |11111111|11111111|10011010| [24] ffff9a [24] 1499 (190) |11111111|11111111|10011011| [24] ffff9b [24] 1500 (191) |11111111|11111111|10011100| [24] ffff9c [24] 1501 (192) |11111111|11111111|10011101| [24] ffff9d [24] 1502 (193) |11111111|11111111|10011110| [24] ffff9e [24] 1503 (194) |11111111|11111111|10011111| [24] ffff9f [24] 1504 (195) |11111111|11111111|10100000| [24] ffffa0 [24] 1505 (196) |11111111|11111111|10100001| [24] ffffa1 [24] 1506 (197) |11111111|11111111|10100010| [24] ffffa2 [24] 1507 (198) |11111111|11111111|10100011| [24] ffffa3 [24] 1508 (199) |11111111|11111111|10100100| [24] ffffa4 [24] 1509 (200) |11111111|11111111|10100101| [24] ffffa5 [24] 1510 (201) |11111111|11111111|10100110| [24] ffffa6 [24] 1511 (202) |11111111|11111111|10100111| [24] ffffa7 [24] 1512 (203) |11111111|11111111|10101000| [24] ffffa8 [24] 1513 (204) |11111111|11111111|10101001| [24] ffffa9 [24] 1514 (205) |11111111|11111111|10101010| [24] ffffaa [24] 1515 (206) |11111111|11111111|10101011| [24] ffffab [24] 1516 (207) |11111111|11111111|10101100| [24] ffffac [24] 1517 (208) |11111111|11111111|10101101| [24] ffffad [24] 1518 (209) |11111111|11111111|10101110| [24] ffffae [24] 1519 (210) |11111111|11111111|10101111| [24] ffffaf [24] 1520 (211) |11111111|11111111|10110000| [24] ffffb0 [24] 1521 (212) |11111111|11111111|10110001| [24] ffffb1 [24] 1522 (213) |11111111|11111111|10110010| [24] ffffb2 [24] 1523 (214) |11111111|11111111|10110011| [24] ffffb3 [24] 1524 (215) |11111111|11111111|10110100| [24] ffffb4 [24] 1525 (216) |11111111|11111111|10110101| [24] ffffb5 [24] 1526 (217) |11111111|11111111|10110110| [24] ffffb6 [24] 1527 (218) |11111111|11111111|10110111| [24] ffffb7 [24] 1528 (219) |11111111|11111111|10111000| [24] ffffb8 [24] 1529 (220) |11111111|11111111|10111001| [24] ffffb9 [24] 1530 (221) |11111111|11111111|10111010| [24] ffffba [24] 1531 (222) |11111111|11111111|10111011| [24] ffffbb [24] 1532 (223) |11111111|11111111|10111100| [24] ffffbc [24] 1533 (224) |11111111|11111111|10111101| [24] ffffbd [24] 1534 (225) |11111111|11111111|10111110| [24] ffffbe [24] 1535 (226) |11111111|11111111|10111111| [24] ffffbf [24] 1536 (227) |11111111|11111111|11000000| [24] ffffc0 [24] 1537 (228) |11111111|11111111|11000001| [24] ffffc1 [24] 1538 (229) |11111111|11111111|11000010| [24] ffffc2 [24] 1539 (230) |11111111|11111111|11000011| [24] ffffc3 [24] 1540 (231) |11111111|11111111|11000100| [24] ffffc4 [24] 1541 (232) |11111111|11111111|11000101| [24] ffffc5 [24] 1542 (233) |11111111|11111111|11000110| [24] ffffc6 [24] 1543 (234) |11111111|11111111|11000111| [24] ffffc7 [24] 1544 (235) |11111111|11111111|11001000| [24] ffffc8 [24] 1545 (236) |11111111|11111111|11001001| [24] ffffc9 [24] 1546 (237) |11111111|11111111|11001010| [24] ffffca [24] 1547 (238) |11111111|11111111|11001011| [24] ffffcb [24] 1548 (239) |11111111|11111111|11001100| [24] ffffcc [24] 1549 (240) |11111111|11111111|11001101| [24] ffffcd [24] 1550 (241) |11111111|11111111|11001110| [24] ffffce [24] 1551 (242) |11111111|11111111|11001111| [24] ffffcf [24] 1552 (243) |11111111|11111111|11010000| [24] ffffd0 [24] 1553 (244) |11111111|11111111|11010001| [24] ffffd1 [24] 1554 (245) |11111111|11111111|11010010| [24] ffffd2 [24] 1555 (246) |11111111|11111111|11010011| [24] ffffd3 [24] 1556 (247) |11111111|11111111|11010100| [24] ffffd4 [24] 1557 (248) |11111111|11111111|11010101| [24] ffffd5 [24] 1558 (249) |11111111|11111111|11010110| [24] ffffd6 [24] 1559 (250) |11111111|11111111|11010111| [24] ffffd7 [24] 1560 (251) |11111111|11111111|11011000| [24] ffffd8 [24] 1561 (252) |11111111|11111111|11011001| [24] ffffd9 [24] 1562 (253) |11111111|11111111|11011010| [24] ffffda [24] 1563 (254) |11111111|11111111|11011011| [24] ffffdb [24] 1564 (255) |11111111|11111111|11011100| [24] ffffdc [24] 1565 EOS (256) |11111111|11111111|11011101| [24] ffffdd [24] 1567 Appendix E. Examples 1569 A number of examples are worked through here, for both requests and 1570 responses, and with and without Huffman coding. 1572 E.1. Header Field Representation Examples 1574 This section show several independent representation examples. 1576 E.1.1. Literal Header Field with Indexing 1578 The header field representation uses a literal name and a literal 1579 value. 1581 Header set to encode: 1583 custom-key: custom-header 1585 Reference set: empty. 1587 Hex dump of encoded data: 1589 000a 6375 7374 6f6d 2d6b 6579 0d63 7573 | ..custom-key.cus 1590 746f 6d2d 6865 6164 6572 | tom-header 1592 Decoding process: 1594 00 | == Literal indexed == 1595 0a | Literal name (len = 10) 1596 6375 7374 6f6d 2d6b 6579 | custom-key 1597 0d | Literal value (len = 13) 1598 6375 7374 6f6d 2d68 6561 6465 72 | custom-header 1599 | -> custom-key: custom-head\ 1600 | er 1602 Header Table (after decoding): 1604 [ 1] (s = 55) custom-key: custom-header 1605 Table size: 55 1607 Decoded header set: 1609 custom-key: custom-header 1611 E.1.2. Literal Header Field without Indexing 1613 The header field representation uses an indexed name and a literal 1614 value. 1616 Header set to encode: 1618 :path: /sample/path 1620 Reference set: empty. 1622 Hex dump of encoded data: 1624 440c 2f73 616d 706c 652f 7061 7468 | D./sample/path 1625 Decoding process: 1627 44 | == Literal not indexed == 1628 | Indexed name (idx = 4) 1629 | :path 1630 0c | Literal value (len = 12) 1631 2f73 616d 706c 652f 7061 7468 | /sample/path 1632 | -> :path: /sample/path 1634 Header table (after decoding): empty. 1636 Decoded header set: 1638 :path: /sample/path 1640 E.1.3. Indexed Header Field 1642 The header field representation uses an indexed header field, from 1643 the static table. Upon using it, the static table entry is copied 1644 into the header table. 1646 Header set to encode: 1648 :method: GET 1650 Reference set: empty. 1652 Hex dump of encoded data: 1654 82 | . 1656 Decoding process: 1658 82 | == Indexed - Add == 1659 | idx = 2 1660 | -> :method: GET 1662 Header Table (after decoding): 1664 [ 1] (s = 42) :method: GET 1665 Table size: 42 1667 Decoded header set: 1669 :method: GET 1671 E.1.4. Indexed Header Field from Static Table 1673 The header field representation uses an indexed header field, from 1674 the static table. In this example, the SETTINGS_HEADER_TABLE_SIZE is 1675 set to 0, therefore, the entry is not copied into the header table. 1677 Header set to encode: 1679 :method: GET 1681 Reference set: empty. 1683 Hex dump of encoded data: 1685 82 | . 1687 Decoding process: 1689 82 | == Indexed - Add == 1690 | idx = 2 1691 | -> :method: GET 1693 Header table (after decoding): empty. 1695 Decoded header set: 1697 :method: GET 1699 E.2. Request Examples without Huffman 1701 This section shows several consecutive header sets, corresponding to 1702 HTTP requests, on the same connection. 1704 E.2.1. First request 1706 Header set to encode: 1708 :method: GET 1709 :scheme: http 1710 :path: / 1711 :authority: www.example.com 1713 Reference set: empty. 1715 Hex dump of encoded data: 1717 8287 8604 0f77 7777 2e65 7861 6d70 6c65 | .....www.example 1718 2e63 6f6d | .com 1720 Decoding process: 1722 82 | == Indexed - Add == 1723 | idx = 2 1724 | -> :method: GET 1725 87 | == Indexed - Add == 1726 | idx = 7 1727 | -> :scheme: http 1728 86 | == Indexed - Add == 1729 | idx = 6 1730 | -> :path: / 1731 04 | == Literal indexed == 1732 | Indexed name (idx = 4) 1733 | :authority 1734 0f | Literal value (len = 15) 1735 7777 772e 6578 616d 706c 652e 636f 6d | www.example.com 1736 | -> :authority: www.example\ 1737 | .com 1739 Header Table (after decoding): 1741 [ 1] (s = 57) :authority: www.example.com 1742 [ 2] (s = 38) :path: / 1743 [ 3] (s = 43) :scheme: http 1744 [ 4] (s = 42) :method: GET 1745 Table size: 180 1747 Decoded header set: 1749 :method: GET 1750 :scheme: http 1751 :path: / 1752 :authority: www.example.com 1754 E.2.2. Second request 1756 This request takes advantage of the differential encoding of header 1757 sets. 1759 Header set to encode: 1761 :method: GET 1762 :scheme: http 1763 :path: / 1764 :authority: www.example.com 1765 cache-control: no-cache 1767 Reference set: 1769 [ 1] :authority: www.example.com 1770 [ 2] :path: / 1771 [ 3] :scheme: http 1772 [ 4] :method: GET 1774 Hex dump of encoded data: 1776 1b08 6e6f 2d63 6163 6865 | ..no-cache 1778 Decoding process: 1780 1b | == Literal indexed == 1781 | Indexed name (idx = 27) 1782 | cache-control 1783 08 | Literal value (len = 8) 1784 6e6f 2d63 6163 6865 | no-cache 1785 | -> cache-control: no-cache 1787 Header Table (after decoding): 1789 [ 1] (s = 53) cache-control: no-cache 1790 [ 2] (s = 57) :authority: www.example.com 1791 [ 3] (s = 38) :path: / 1792 [ 4] (s = 43) :scheme: http 1793 [ 5] (s = 42) :method: GET 1794 Table size: 233 1796 Decoded header set: 1798 cache-control: no-cache 1799 :authority: www.example.com 1800 :path: / 1801 :scheme: http 1802 :method: GET 1804 E.2.3. Third request 1806 This request has not enough headers in common with the previous 1807 request to take advantage of the differential encoding. Therefore, 1808 the reference set is emptied before encoding the header fields. 1810 Header set to encode: 1812 :method: GET 1813 :scheme: https 1814 :path: /index.html 1815 :authority: www.example.com 1816 custom-key: custom-value 1818 Reference set: 1820 [ 1] cache-control: no-cache 1821 [ 2] :authority: www.example.com 1822 [ 3] :path: / 1823 [ 4] :scheme: http 1824 [ 5] :method: GET 1826 Hex dump of encoded data: 1828 8085 8c8b 8400 0a63 7573 746f 6d2d 6b65 | .......custom-ke 1829 790c 6375 7374 6f6d 2d76 616c 7565 | y.custom-value 1830 Decoding process: 1832 80 | == Empty reference set == 1833 | idx = 0 1834 85 | == Indexed - Add == 1835 | idx = 5 1836 | -> :method: GET 1837 8c | == Indexed - Add == 1838 | idx = 12 1839 | -> :scheme: https 1840 8b | == Indexed - Add == 1841 | idx = 11 1842 | -> :path: /index.html 1843 84 | == Indexed - Add == 1844 | idx = 4 1845 | -> :authority: www.example\ 1846 | .com 1847 00 | == Literal indexed == 1848 0a | Literal name (len = 10) 1849 6375 7374 6f6d 2d6b 6579 | custom-key 1850 0c | Literal value (len = 12) 1851 6375 7374 6f6d 2d76 616c 7565 | custom-value 1852 | -> custom-key: custom-valu\ 1853 | e 1855 Header Table (after decoding): 1857 [ 1] (s = 54) custom-key: custom-value 1858 [ 2] (s = 48) :path: /index.html 1859 [ 3] (s = 44) :scheme: https 1860 [ 4] (s = 53) cache-control: no-cache 1861 [ 5] (s = 57) :authority: www.example.com 1862 [ 6] (s = 38) :path: / 1863 [ 7] (s = 43) :scheme: http 1864 [ 8] (s = 42) :method: GET 1865 Table size: 379 1867 Decoded header set: 1869 :method: GET 1870 :scheme: https 1871 :path: /index.html 1872 :authority: www.example.com 1873 custom-key: custom-value 1875 E.3. Request Examples with Huffman 1877 This section shows the same examples as the previous section, but 1878 using Huffman encoding for the literal values. 1880 E.3.1. First request 1882 Header set to encode: 1884 :method: GET 1885 :scheme: http 1886 :path: / 1887 :authority: www.example.com 1889 Reference set: empty. 1891 Hex dump of encoded data: 1893 8287 8604 8bdb 6d88 3e68 d1cb 1225 ba7f | ......m..h...%.. 1895 Decoding process: 1897 82 | == Indexed - Add == 1898 | idx = 2 1899 | -> :method: GET 1900 87 | == Indexed - Add == 1901 | idx = 7 1902 | -> :scheme: http 1903 86 | == Indexed - Add == 1904 | idx = 6 1905 | -> :path: / 1906 04 | == Literal indexed == 1907 | Indexed name (idx = 4) 1908 | :authority 1909 8b | Literal value (len = 15) 1910 | Huffman encoded: 1911 db6d 883e 68d1 cb12 25ba 7f | .m..h...%.. 1912 | Decoded: 1913 | www.example.com 1914 | -> :authority: www.example\ 1915 | .com 1917 Header Table (after decoding): 1919 [ 1] (s = 57) :authority: www.example.com 1920 [ 2] (s = 38) :path: / 1921 [ 3] (s = 43) :scheme: http 1922 [ 4] (s = 42) :method: GET 1923 Table size: 180 1925 Decoded header set: 1927 :method: GET 1928 :scheme: http 1929 :path: / 1930 :authority: www.example.com 1932 E.3.2. Second request 1934 This request takes advantage of the differential encoding of header 1935 sets. 1937 Header set to encode: 1939 :method: GET 1940 :scheme: http 1941 :path: / 1942 :authority: www.example.com 1943 cache-control: no-cache 1945 Reference set: 1947 [ 1] :authority: www.example.com 1948 [ 2] :path: / 1949 [ 3] :scheme: http 1950 [ 4] :method: GET 1952 Hex dump of encoded data: 1954 1b86 6365 4a13 98ff | ..ceJ... 1956 Decoding process: 1958 1b | == Literal indexed == 1959 | Indexed name (idx = 27) 1960 | cache-control 1961 86 | Literal value (len = 8) 1962 | Huffman encoded: 1963 6365 4a13 98ff | ceJ... 1964 | Decoded: 1965 | no-cache 1966 | -> cache-control: no-cache 1968 Header Table (after decoding): 1970 [ 1] (s = 53) cache-control: no-cache 1971 [ 2] (s = 57) :authority: www.example.com 1972 [ 3] (s = 38) :path: / 1973 [ 4] (s = 43) :scheme: http 1974 [ 5] (s = 42) :method: GET 1975 Table size: 233 1977 Decoded header set: 1979 cache-control: no-cache 1980 :authority: www.example.com 1981 :path: / 1982 :scheme: http 1983 :method: GET 1985 E.3.3. Third request 1987 This request has not enough headers in common with the previous 1988 request to take advantage of the differential encoding. Therefore, 1989 the reference set is emptied before encoding the header fields. 1991 Header set to encode: 1993 :method: GET 1994 :scheme: https 1995 :path: /index.html 1996 :authority: www.example.com 1997 custom-key: custom-value 1998 Reference set: 2000 [ 1] cache-control: no-cache 2001 [ 2] :authority: www.example.com 2002 [ 3] :path: / 2003 [ 4] :scheme: http 2004 [ 5] :method: GET 2006 Hex dump of encoded data: 2008 8085 8c8b 8400 884e b08b 7497 90fa 7f89 | .......N..t..... 2009 4eb0 8b74 979a 17a8 ff | N..t..... 2011 Decoding process: 2013 80 | == Empty reference set == 2014 | idx = 0 2015 85 | == Indexed - Add == 2016 | idx = 5 2017 | -> :method: GET 2018 8c | == Indexed - Add == 2019 | idx = 12 2020 | -> :scheme: https 2021 8b | == Indexed - Add == 2022 | idx = 11 2023 | -> :path: /index.html 2024 84 | == Indexed - Add == 2025 | idx = 4 2026 | -> :authority: www.example\ 2027 | .com 2028 00 | == Literal indexed == 2029 88 | Literal name (len = 10) 2030 | Huffman encoded: 2031 4eb0 8b74 9790 fa7f | N..t.... 2032 | Decoded: 2033 | custom-key 2034 89 | Literal value (len = 12) 2035 | Huffman encoded: 2036 4eb0 8b74 979a 17a8 ff | N..t..... 2037 | Decoded: 2038 | custom-value 2039 | -> custom-key: custom-valu\ 2040 | e 2042 Header Table (after decoding): 2044 [ 1] (s = 54) custom-key: custom-value 2045 [ 2] (s = 48) :path: /index.html 2046 [ 3] (s = 44) :scheme: https 2047 [ 4] (s = 53) cache-control: no-cache 2048 [ 5] (s = 57) :authority: www.example.com 2049 [ 6] (s = 38) :path: / 2050 [ 7] (s = 43) :scheme: http 2051 [ 8] (s = 42) :method: GET 2052 Table size: 379 2054 Decoded header set: 2056 :method: GET 2057 :scheme: https 2058 :path: /index.html 2059 :authority: www.example.com 2060 custom-key: custom-value 2062 E.4. Response Examples without Huffman 2064 This section shows several consecutive header sets, corresponding to 2065 HTTP responses, on the same connection. SETTINGS_HEADER_TABLE_SIZE 2066 is set to the value of 256 octets, causing some evictions to occur. 2068 E.4.1. First response 2070 Header set to encode: 2072 :status: 302 2073 cache-control: private 2074 date: Mon, 21 Oct 2013 20:13:21 GMT 2075 location: https://www.example.com 2077 Reference set: empty. 2079 Hex dump of encoded data: 2081 0803 3330 3218 0770 7269 7661 7465 221d | ..302..private". 2082 4d6f 6e2c 2032 3120 4f63 7420 3230 3133 | Mon, 21 Oct 2013 2083 2032 303a 3133 3a32 3120 474d 5430 1768 | 20:13:21 GMT0.h 2084 7474 7073 3a2f 2f77 7777 2e65 7861 6d70 | ttps://www.examp 2085 6c65 2e63 6f6d | le.com 2086 Decoding process: 2088 08 | == Literal indexed == 2089 | Indexed name (idx = 8) 2090 | :status 2091 03 | Literal value (len = 3) 2092 3330 32 | 302 2093 | -> :status: 302 2094 18 | == Literal indexed == 2095 | Indexed name (idx = 24) 2096 | cache-control 2097 07 | Literal value (len = 7) 2098 7072 6976 6174 65 | private 2099 | -> cache-control: private 2100 22 | == Literal indexed == 2101 | Indexed name (idx = 34) 2102 | date 2103 1d | Literal value (len = 29) 2104 4d6f 6e2c 2032 3120 4f63 7420 3230 3133 | Mon, 21 Oct 2013 2105 2032 303a 3133 3a32 3120 474d 54 | 20:13:21 GMT 2106 | -> date: Mon, 21 Oct 2013 \ 2107 | 20:13:21 GMT 2108 30 | == Literal indexed == 2109 | Indexed name (idx = 48) 2110 | location 2111 17 | Literal value (len = 23) 2112 6874 7470 733a 2f2f 7777 772e 6578 616d | https://www.exam 2113 706c 652e 636f 6d | ple.com 2114 | -> location: https://www.e\ 2115 | xample.com 2117 Header Table (after decoding): 2119 [ 1] (s = 63) location: https://www.example.com 2120 [ 2] (s = 65) date: Mon, 21 Oct 2013 20:13:21 GMT 2121 [ 3] (s = 52) cache-control: private 2122 [ 4] (s = 42) :status: 302 2123 Table size: 222 2125 Decoded header set: 2127 :status: 302 2128 cache-control: private 2129 date: Mon, 21 Oct 2013 20:13:21 GMT 2130 location: https://www.example.com 2132 E.4.2. Second response 2134 The (":status", "302") header field is evicted from the header table 2135 to free space to allow adding the (":status", "200") header field to 2136 be copied from the static table into the header table. 2138 Header set to encode: 2140 :status: 200 2141 cache-control: private 2142 date: Mon, 21 Oct 2013 20:13:21 GMT 2143 location: https://www.example.com 2145 Reference set: 2147 [ 1] location: https://www.example.com 2148 [ 2] date: Mon, 21 Oct 2013 20:13:21 GMT 2149 [ 3] cache-control: private 2150 [ 4] :status: 302 2152 Hex dump of encoded data: 2154 848c | .. 2156 Decoding process: 2158 84 | == Indexed - Remove == 2159 | idx = 4 2160 | -> :status: 302 2161 8c | == Indexed - Add == 2162 | idx = 12 2163 | - evict: :status: 302 2164 | -> :status: 200 2166 Header Table (after decoding): 2168 [ 1] (s = 42) :status: 200 2169 [ 2] (s = 63) location: https://www.example.com 2170 [ 3] (s = 65) date: Mon, 21 Oct 2013 20:13:21 GMT 2171 [ 4] (s = 52) cache-control: private 2172 Table size: 222 2174 Decoded header set: 2176 :status: 200 2177 location: https://www.example.com 2178 date: Mon, 21 Oct 2013 20:13:21 GMT 2179 cache-control: private 2181 E.4.3. Third response 2183 Several header fields are evicted from the header table during the 2184 processing of this header set. Before evicting a header belonging to 2185 the reference set, it is emitted, by coding it twice as an Indexed 2186 Representation. The first representation removes the header field 2187 from the reference set, the second one adds it again to the reference 2188 set, also emitting it. 2190 Header set to encode: 2192 :status: 200 2193 cache-control: private 2194 date: Mon, 21 Oct 2013 20:13:22 GMT 2195 location: https://www.example.com 2196 content-encoding: gzip 2197 set-cookie: foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU; max-age=3600; version=1 2199 Reference set: 2201 [ 1] :status: 200 2202 [ 2] location: https://www.example.com 2203 [ 3] date: Mon, 21 Oct 2013 20:13:21 GMT 2204 [ 4] cache-control: private 2206 Hex dump of encoded data: 2208 8384 8403 1d4d 6f6e 2c20 3231 204f 6374 | .....Mon, 21 Oct 2209 2032 3031 3320 3230 3a31 333a 3232 2047 | 2013 20:13:22 G 2210 4d54 1d04 677a 6970 8484 8383 3a38 666f | MT..gzip....:8fo 2211 6f3d 4153 444a 4b48 514b 425a 584f 5157 | o=ASDJKHQKBZXOQW 2212 454f 5049 5541 5851 5745 4f49 553b 206d | EOPIUAXQWEOIU; m 2213 6178 2d61 6765 3d33 3630 303b 2076 6572 | ax-age=3600; ver 2214 7369 6f6e 3d31 | sion=1 2216 Decoding process: 2218 83 | == Indexed - Remove == 2219 | idx = 3 2220 | -> date: Mon, 21 Oct 2013 \ 2221 | 20:13:21 GMT 2223 84 | == Indexed - Remove == 2224 | idx = 4 2225 | -> cache-control: private 2226 84 | == Indexed - Add == 2227 | idx = 4 2228 | -> cache-control: private 2229 03 | == Literal indexed == 2230 | Indexed name (idx = 3) 2231 | date 2232 1d | Literal value (len = 29) 2233 4d6f 6e2c 2032 3120 4f63 7420 3230 3133 | Mon, 21 Oct 2013 2234 2032 303a 3133 3a32 3220 474d 54 | 20:13:22 GMT 2235 | - evict: cache-control: pr\ 2236 | ivate 2237 | -> date: Mon, 21 Oct 2013 \ 2238 | 20:13:22 GMT 2239 1d | == Literal indexed == 2240 | Indexed name (idx = 29) 2241 | content-encoding 2242 04 | Literal value (len = 4) 2243 677a 6970 | gzip 2244 | - evict: date: Mon, 21 Oct\ 2245 | 2013 20:13:21 GMT 2246 | -> content-encoding: gzip 2247 84 | == Indexed - Remove == 2248 | idx = 4 2249 | -> location: https://www.e\ 2250 | xample.com 2251 84 | == Indexed - Add == 2252 | idx = 4 2253 | -> location: https://www.e\ 2254 | xample.com 2255 83 | == Indexed - Remove == 2256 | idx = 3 2257 | -> :status: 200 2258 83 | == Indexed - Add == 2259 | idx = 3 2260 | -> :status: 200 2261 3a | == Literal indexed == 2262 | Indexed name (idx = 58) 2263 | set-cookie 2264 38 | Literal value (len = 56) 2265 666f 6f3d 4153 444a 4b48 514b 425a 584f | foo=ASDJKHQKBZXO 2266 5157 454f 5049 5541 5851 5745 4f49 553b | QWEOPIUAXQWEOIU; 2267 206d 6178 2d61 6765 3d33 3630 303b 2076 | max-age=3600; v 2268 6572 7369 6f6e 3d31 | ersion=1 2269 | - evict: location: https:/\ 2270 | /www.example.com 2271 | - evict: :status: 200 2272 | -> set-cookie: foo=ASDJKHQ\ 2273 | KBZXOQWEOPIUAXQWEOIU; ma\ 2274 | x-age=3600; version=1 2276 Header Table (after decoding): 2278 [ 1] (s = 98) set-cookie: foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU; max-age\ 2279 =3600; version=1 2280 [ 2] (s = 52) content-encoding: gzip 2281 [ 3] (s = 65) date: Mon, 21 Oct 2013 20:13:22 GMT 2282 Table size: 215 2284 Decoded header set: 2286 cache-control: private 2287 date: Mon, 21 Oct 2013 20:13:22 GMT 2288 content-encoding: gzip 2289 location: https://www.example.com 2290 :status: 200 2291 set-cookie: foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU; max-age=3600; version=1 2293 E.5. Response Examples with Huffman 2295 This section shows the same examples as the previous section, but 2296 using Huffman encoding for the literal values. The eviction 2297 mechanism uses the length of the decoded literal values, so the same 2298 evictions occurs as in the previous section. 2300 E.5.1. First response 2302 Header set to encode: 2304 :status: 302 2305 cache-control: private 2306 date: Mon, 21 Oct 2013 20:13:21 GMT 2307 location: https://www.example.com 2309 Reference set: empty. 2311 Hex dump of encoded data: 2313 0882 409f 1886 c31b 39bf 387f 2292 a2fb | ..@.....9.8."... 2314 a203 20f2 ab30 3124 018b 490d 3209 e877 | .. ..01$..I.2..w 2315 3093 e39e 7864 dd7a fd3d 3d24 8747 db87 | 0...xd.z.==$.G.. 2316 2849 55f6 ff | (IU.. 2318 Decoding process: 2320 08 | == Literal indexed == 2321 | Indexed name (idx = 8) 2322 | :status 2323 82 | Literal value (len = 3) 2324 | Huffman encoded: 2325 409f | @. 2326 | Decoded: 2327 | 302 2328 | -> :status: 302 2329 18 | == Literal indexed == 2330 | Indexed name (idx = 24) 2331 | cache-control 2332 86 | Literal value (len = 7) 2333 | Huffman encoded: 2334 c31b 39bf 387f | ..9.8. 2335 | Decoded: 2336 | private 2337 | -> cache-control: private 2338 22 | == Literal indexed == 2339 | Indexed name (idx = 34) 2340 | date 2341 92 | Literal value (len = 29) 2342 | Huffman encoded: 2343 a2fb a203 20f2 ab30 3124 018b 490d 3209 | .... ..01$..I.2. 2344 e877 | .w 2345 | Decoded: 2346 | Mon, 21 Oct 2013 20:13:21 \ 2347 | GMT 2348 | -> date: Mon, 21 Oct 2013 \ 2349 | 20:13:21 GMT 2350 30 | == Literal indexed == 2351 | Indexed name (idx = 48) 2352 | location 2353 93 | Literal value (len = 23) 2354 | Huffman encoded: 2355 e39e 7864 dd7a fd3d 3d24 8747 db87 2849 | ..xd.z.==$.G..(I 2356 55f6 ff | U.. 2357 | Decoded: 2358 | https://www.example.com 2359 | -> location: https://www.e\ 2360 | xample.com 2362 Header Table (after decoding): 2364 [ 1] (s = 63) location: https://www.example.com 2365 [ 2] (s = 65) date: Mon, 21 Oct 2013 20:13:21 GMT 2366 [ 3] (s = 52) cache-control: private 2367 [ 4] (s = 42) :status: 302 2368 Table size: 222 2370 Decoded header set: 2372 :status: 302 2373 cache-control: private 2374 date: Mon, 21 Oct 2013 20:13:21 GMT 2375 location: https://www.example.com 2377 E.5.2. Second response 2379 The (":status", "302") header field is evicted from the header table 2380 to free space to allow adding the (":status", "200") header field to 2381 be copied from the static table into the header table. 2383 Header set to encode: 2385 :status: 200 2386 cache-control: private 2387 date: Mon, 21 Oct 2013 20:13:21 GMT 2388 location: https://www.example.com 2390 Reference set: 2392 [ 1] location: https://www.example.com 2393 [ 2] date: Mon, 21 Oct 2013 20:13:21 GMT 2394 [ 3] cache-control: private 2395 [ 4] :status: 302 2397 Hex dump of encoded data: 2399 848c | .. 2401 Decoding process: 2403 84 | == Indexed - Remove == 2404 | idx = 4 2405 | -> :status: 302 2406 8c | == Indexed - Add == 2407 | idx = 12 2408 | - evict: :status: 302 2409 | -> :status: 200 2411 Header Table (after decoding): 2413 [ 1] (s = 42) :status: 200 2414 [ 2] (s = 63) location: https://www.example.com 2415 [ 3] (s = 65) date: Mon, 21 Oct 2013 20:13:21 GMT 2416 [ 4] (s = 52) cache-control: private 2417 Table size: 222 2419 Decoded header set: 2421 :status: 200 2422 location: https://www.example.com 2423 date: Mon, 21 Oct 2013 20:13:21 GMT 2424 cache-control: private 2426 E.5.3. Third response 2428 Several header fields are evicted from the header table during the 2429 processing of this header set. Before evicting a header belonging to 2430 the reference set, it is emitted, by coding it twice as an Indexed 2431 Representation. The first representation removes the header field 2432 from the reference set, the second one adds it again to the reference 2433 set, also emitting it. 2435 Header set to encode: 2437 :status: 200 2438 cache-control: private 2439 date: Mon, 21 Oct 2013 20:13:22 GMT 2440 location: https://www.example.com 2441 content-encoding: gzip 2442 set-cookie: foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU; max-age=3600; version=1 2443 Reference set: 2445 [ 1] :status: 200 2446 [ 2] location: https://www.example.com 2447 [ 3] date: Mon, 21 Oct 2013 20:13:21 GMT 2448 [ 4] cache-control: private 2450 Hex dump of encoded data: 2452 8384 8403 92a2 fba2 0320 f2ab 3031 2401 | ......... ..01$. 2453 8b49 0d33 09e8 771d 84e1 fbb3 0f84 8483 | .I.3..w......... 2454 833a b3df 7dfb 36d3 d9e1 fcfc 3faf e7ab | .:..}.6.....?... 2455 fcfe fcbf af3e df2f 977f d36f f7fd 79f6 | ......./...o..y. 2456 f977 fd3d e16b fa46 fe10 d889 447d e1ce | .w.=.k.F....D}.. 2457 18e5 65f7 6c2f | ..e.l/ 2459 Decoding process: 2461 83 | == Indexed - Remove == 2462 | idx = 3 2463 | -> date: Mon, 21 Oct 2013 \ 2464 | 20:13:21 GMT 2465 84 | == Indexed - Remove == 2466 | idx = 4 2467 | -> cache-control: private 2468 84 | == Indexed - Add == 2469 | idx = 4 2470 | -> cache-control: private 2471 03 | == Literal indexed == 2472 | Indexed name (idx = 3) 2473 | date 2474 92 | Literal value (len = 29) 2475 | Huffman encoded: 2476 a2fb a203 20f2 ab30 3124 018b 490d 3309 | .... ..01$..I.3. 2477 e877 | .w 2478 | Decoded: 2479 | Mon, 21 Oct 2013 20:13:22 \ 2480 | GMT 2481 | - evict: cache-control: pr\ 2482 | ivate 2483 | -> date: Mon, 21 Oct 2013 \ 2484 | 20:13:22 GMT 2485 1d | == Literal indexed == 2486 | Indexed name (idx = 29) 2487 | content-encoding 2488 84 | Literal value (len = 4) 2489 | Huffman encoded: 2490 e1fb b30f | .... 2492 | Decoded: 2493 | gzip 2494 | - evict: date: Mon, 21 Oct\ 2495 | 2013 20:13:21 GMT 2496 | -> content-encoding: gzip 2497 84 | == Indexed - Remove == 2498 | idx = 4 2499 | -> location: https://www.e\ 2500 | xample.com 2501 84 | == Indexed - Add == 2502 | idx = 4 2503 | -> location: https://www.e\ 2504 | xample.com 2505 83 | == Indexed - Remove == 2506 | idx = 3 2507 | -> :status: 200 2508 83 | == Indexed - Add == 2509 | idx = 3 2510 | -> :status: 200 2511 3a | == Literal indexed == 2512 | Indexed name (idx = 58) 2513 | set-cookie 2514 b3 | Literal value (len = 56) 2515 | Huffman encoded: 2516 df7d fb36 d3d9 e1fc fc3f afe7 abfc fefc | .}.6.....?...... 2517 bfaf 3edf 2f97 7fd3 6ff7 fd79 f6f9 77fd | ..../...o..y..w. 2518 3de1 6bfa 46fe 10d8 8944 7de1 ce18 e565 | =.k.F....D}....e 2519 f76c 2f | .l/ 2520 | Decoded: 2521 | foo=ASDJKHQKBZXOQWEOPIUAXQ\ 2522 | WEOIU; max-age=3600; versi\ 2523 | on=1 2524 | - evict: location: https:/\ 2525 | /www.example.com 2526 | - evict: :status: 200 2527 | -> set-cookie: foo=ASDJKHQ\ 2528 | KBZXOQWEOPIUAXQWEOIU; ma\ 2529 | x-age=3600; version=1 2531 Header Table (after decoding): 2533 [ 1] (s = 98) set-cookie: foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU; max-age\ 2534 =3600; version=1 2535 [ 2] (s = 52) content-encoding: gzip 2536 [ 3] (s = 65) date: Mon, 21 Oct 2013 20:13:22 GMT 2537 Table size: 215 2539 Decoded header set: 2541 cache-control: private 2542 date: Mon, 21 Oct 2013 20:13:22 GMT 2543 content-encoding: gzip 2544 location: https://www.example.com 2545 :status: 200 2546 set-cookie: foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU; max-age=3600; version=1 2548 Authors' Addresses 2550 Roberto Peon 2551 Google, Inc 2553 EMail: fenix@google.com 2555 Herve Ruellan 2556 Canon CRF 2558 EMail: herve.ruellan@crf.canon.fr