draft-ietf-httpbis-header-compression.xml 98 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <?xml-stylesheet type='text/xsl' href='lib/rfc2629.xslt' ?>
  3. <?rfc toc="yes"?>
  4. <?rfc symrefs="yes"?>
  5. <?rfc sortrefs="yes"?>
  6. <?rfc compact="yes"?>
  7. <?rfc subcompact="no"?>
  8. <?rfc linkmailto="no"?>
  9. <?rfc editing="no"?>
  10. <?rfc comments="yes"?>
  11. <?rfc inline="yes"?>
  12. <?rfc rfcedstyle="yes"?>
  13. <?rfc-ext allow-markup-in-artwork="yes" ?>
  14. <?rfc-ext include-index="no" ?>
  15. <rfc category="info"
  16. ipr="trust200902"
  17. docName="draft-ietf-httpbis-header-compression-latest"
  18. x:maturity-level="proposed"
  19. xmlns:x="http://purl.org/net/xml2rfc/ext">
  20. <x:feedback template="mailto:ietf-http-wg@w3.org?subject={docname},%20%22{section}%22&amp;body=&lt;{ref}&gt;:"/>
  21. <front>
  22. <title abbrev="HPACK">HPACK - Header Compression for HTTP/2.0 </title>
  23. <author initials="R." surname="Peon" fullname="Roberto Peon">
  24. <organization>Google, Inc</organization>
  25. <address>
  26. <email>fenix@google.com</email>
  27. </address>
  28. </author>
  29. <author initials="H." surname="Ruellan" fullname="Hervé Ruellan">
  30. <organization>Canon CRF</organization>
  31. <address>
  32. <email>herve.ruellan@crf.canon.fr</email>
  33. </address>
  34. </author>
  35. <date year="2013"/>
  36. <area>Applications</area>
  37. <workgroup>HTTPbis Working Group</workgroup>
  38. <keyword>HTTP</keyword>
  39. <keyword>Header</keyword>
  40. <abstract>
  41. <t>
  42. This document describes HPACK, a format adapted to efficiently
  43. represent HTTP header fields in the context of HTTP/2.0.
  44. </t>
  45. </abstract>
  46. <note title="Editorial Note (To be removed by RFC Editor)">
  47. <t>
  48. Discussion of this draft takes place on the HTTPBIS working group
  49. mailing list (ietf-http-wg@w3.org), which is archived at <eref
  50. target="http://lists.w3.org/Archives/Public/ietf-http-wg/"/>.
  51. </t>
  52. <t>
  53. Working Group information and related documents can be found at
  54. <eref target="http://tools.ietf.org/wg/httpbis/"/> (Wiki) and <eref
  55. target="https://github.com/http2/http2-spec"/> (source code and
  56. issues tracker).
  57. </t>
  58. <t>
  59. The changes in this draft are summarized in <xref
  60. target="changes.since.draft-ietf-httpbis-header-compression-03"/>.
  61. </t>
  62. </note>
  63. </front>
  64. <middle>
  65. <section title="Introduction">
  66. <t>
  67. This document describes HPACK, a format adapted to efficiently
  68. represent HTTP header fields in the context of HTTP/2.0 (see <xref
  69. target="HTTP2"/>).
  70. </t>
  71. </section>
  72. <section title="Overview" anchor="overview">
  73. <t>
  74. In HTTP/1.X, header fields are sent without any form of
  75. compression. As web pages have grown to include dozens to
  76. hundreds of requests, the redundant header fields in these
  77. requests now pose a problem of measurable latency and
  78. unnecessary bandwidth (see <xref target="PERF1"/> and <xref
  79. target="PERF2"/>).
  80. </t>
  81. <t>
  82. <xref target="SPDY">SPDY</xref> initially addressed this
  83. redundancy by compressing header fields with Deflate, which
  84. proved very effective at eliminating the redundant header
  85. fields. However, that aproach exposed a security risk as
  86. demonstrated by the <xref target="CRIME">CRIME</xref>.
  87. </t>
  88. <t>
  89. In this document, we propose a new compressor for headers
  90. which eliminates redundant headers, is not vulnerable to CRIME
  91. style attacks, and which also has a bounded memory cost for
  92. use in constrained environments.
  93. </t>
  94. <section title="Outline">
  95. <t>
  96. The HTTP header field encoding described in this document
  97. is based on a header table that map (name, value) pairs to
  98. index values. Header tables are incrementally updated
  99. during the HTTP/2.0 session.
  100. </t>
  101. <t>
  102. The encoder is responsible for deciding which header
  103. fields to insert as new entries in the header table. The
  104. decoder then does exactly what the encoder prescribes,
  105. ending in a state that exactly matches the encoder's
  106. state. This enables decoders to remain simple and
  107. understand a wide variety of encoders.
  108. </t>
  109. <t>
  110. As two consecutive sets of header fields often have header
  111. fields in common, each set of header fields is coded as a
  112. difference from the previous set of header fields. The
  113. goal is to only encode the changes (header fields present
  114. in one of the set and not in the other) between the two
  115. sets of header fields.
  116. </t>
  117. <t>
  118. An example illustrating the use of these different
  119. mechanisms to represent header fields is available in
  120. <xref target="example"/>.
  121. </t>
  122. </section>
  123. </section>
  124. <section title="Header Field Encoding" anchor="header.encoding">
  125. <section title="Encoding Concepts" anchor="encoding.concepts">
  126. <t>
  127. The encoding and decoding of headers relies on some
  128. components and concepts:
  129. <list style="hanging">
  130. <t hangText="Header Field">
  131. A key, value-list pair where the value-list is a NULL
  132. separated ordered list of values.
  133. </t>
  134. <t hangText="Header Table:">
  135. The header table (see <xref
  136. target="header.table"/>) is a component used
  137. to associate stored header fields to index values.
  138. The data stored in this table is in first-in,
  139. first-out order.
  140. </t>
  141. <t hangText="Static Table:">
  142. The static table (see <xref
  143. target="static.table"/>) is a component used
  144. to associate static header fields to index values.
  145. This data is ordered, read-only, always
  146. accessible, and may be shared amongst all encoding
  147. contexts.
  148. </t>
  149. <t hangText="Reference Set:">
  150. The reference set (see <xref
  151. target="reference.set"/>) is a component
  152. containing an unordered set of references to
  153. entries in the header table or static table.
  154. This is used for the differential encoding of a new
  155. header set.
  156. </t>
  157. <t hangText="Header Set:">
  158. A header set is a potentially ordered group of
  159. header fields that are encoded jointly. A complete
  160. set of key-value pairs as encoded in a HTTP
  161. request or response is a header set.
  162. </t>
  163. <t hangText="Header Representation:">
  164. A header can be represented in encoded form either
  165. as a literal or as an index (see <xref
  166. target="header.representation"/>).
  167. </t>
  168. <t hangText="Header Block:">
  169. The entire set of encoded header representations
  170. which, when decoded, yield a complete header set.
  171. </t>
  172. <t hangText="Header Field Emission:">
  173. When decoding a set of header representations, some
  174. operations emit a header field (see <xref
  175. target="header.emission"/>). All emitted
  176. header fields which are considered to be part of
  177. the same header set comprise an HTTP request or
  178. response.
  179. </t>
  180. </list>
  181. </t>
  182. <section title="Encoding Context" anchor="encoding.context">
  183. <t>
  184. The set of mutable structures used within an encoding
  185. context include a header table and a reference set.
  186. Everything else is either immutable or conceptual.
  187. </t>
  188. <t>
  189. Using HTTP, messages are exchanged between a client
  190. and a server in both direction. To keep the encoding
  191. of header fields in each direction independent from the
  192. other direction, there is one encoding context for
  193. each direction.
  194. </t>
  195. <t>
  196. The header fields contained in a PUSH_PROMISE frame
  197. sent by a server to a client are encoded within the
  198. same context as the header fields contained in the
  199. HEADERS frame corresponding to a response sent from
  200. the server to the client.
  201. </t>
  202. </section>
  203. <section title="Header Table" anchor="header.table">
  204. <t>
  205. A header table consists of a list of header fields
  206. maintained in first-in, first-out order.
  207. The first and newest entry in a header table is always
  208. at index 0, and the oldest entry of a header table is
  209. at the index len(header table)-1.
  210. </t>
  211. <t>
  212. The header table is initially empty.
  213. </t>
  214. <t>
  215. There is typically no need for the header table to
  216. contain duplicate entries. However, duplicate entries
  217. MUST NOT be treated as an error by a decoder.
  218. </t>
  219. <t>
  220. The encoder decides how to update the header table and
  221. as such can control how much memory is used by the
  222. header table. To limit the memory requirements on the
  223. decoder side, the header table size is strictly
  224. bounded (see <xref target="maximum.table.size"/>).
  225. </t>
  226. <t>
  227. The header table is updated during the processing of
  228. a set of header representations (see <xref
  229. target="header.representation.processing"> header
  230. representation processing</xref>.
  231. </t>
  232. </section>
  233. <section title="Reference Set" anchor="reference.set">
  234. <t>
  235. A reference set is an unordered set of references to
  236. entries either within the header table or the static
  237. table.
  238. </t>
  239. <t>
  240. The reference set is initially empty.
  241. </t>
  242. <t>
  243. The reference set is updated during the processing of
  244. a set of header representations (see <xref
  245. target="header.representation.processing"> header
  246. representation processing</xref>.
  247. </t>
  248. <t>
  249. The reference set enables differential encoding,
  250. whereby only differences between the previous header
  251. set and the current header set need to be encoded.
  252. </t>
  253. </section>
  254. <section title="Header Field Representation"
  255. anchor="header.representation">
  256. <t>
  257. An encoded header field can be represented either as a
  258. literal or as an index.
  259. </t>
  260. <t>
  261. All key data and value-list data present in an encoded
  262. header field representation is <xref
  263. target="HUFF">huffman encoded</xref> byte-by-byte
  264. using a <xref target="CANON">canonical huffman
  265. coding</xref>, appended with an EOF symbol, and
  266. padded with zeroes to the nearest byte boundary.
  267. </t>
  268. <t>
  269. Header fields sent in the client to server direction
  270. are encoded with the codes within the <xref
  271. target="request.huffman.codes"> request huffman
  272. code table</xref> (see <xref
  273. target="response.huffman.encoding.example">Request
  274. Huffman Encoding Example</xref>).
  275. </t>
  276. <t>
  277. Header fields sent in the server to client direction
  278. are encoded with the codes within the <xref
  279. target="response.huffman.codes"> response huffman
  280. code table</xref> (see <xref
  281. target="response.huffman.encoding.example">
  282. Response Huffman Enoding Example</xref>).
  283. </t>
  284. <t>
  285. The EOF symbol is represented with value 256, and is
  286. used solely to signal the end of the huffman-encoded
  287. key data or the end of the huffman-encoded value-list
  288. data.
  289. </t>
  290. <t>
  291. <list style="hanging">
  292. <t hangText="Literal Representation:">
  293. A literal representation defines a new header
  294. field. The header field name is represented
  295. either literally or as a reference to an entry
  296. of the header table. The header field value is
  297. represented literally.
  298. </t>
  299. <t>
  300. Two different literal representations are
  301. provided:
  302. <list style="symbols">
  303. <t>
  304. A literal representation that does not
  305. add the header field to the header
  306. table (see <xref
  307. target="literal.header.without.indexing"/>).
  308. </t>
  309. <t>
  310. A literal representation that adds the
  311. header field as a new entry at the
  312. beginning of the header table (see
  313. <xref
  314. target="literal.header.with.incremental.indexing"/>).
  315. </t>
  316. </list>
  317. </t>
  318. <t hangText="Indexed Representation:">
  319. The indexed representation defines a header
  320. field as a reference to an entry in either the
  321. header table or the static table(see <xref
  322. target="indexed.header.representation"/>).
  323. <figure title="Index Address Space">
  324. <artwork type="drawing">
  325. <![CDATA[
  326. <---------- Index Address Space ---------->
  327. <-- Header Table --> <-- Static Table -->
  328. +---+-----------+---+ +---+-----------+---+
  329. | 0 | ... | k | |k+1| ... | n |
  330. +---+-----------+---+ +---+-----------+---+
  331. ^ |
  332. | V
  333. Insertion Point Drop Point
  334. ]]>
  335. </artwork>
  336. </figure>
  337. <list>
  338. <t>
  339. Indices between 0 and len(header
  340. table)-1, inclusive, refer to elements
  341. in the header table, with index 0
  342. referring to the beginning of the
  343. table.
  344. </t>
  345. <t>
  346. Indices between len(header table) and
  347. len(header table)+len(static table)-1,
  348. inclusive, refer to elements in the
  349. static table, where the index
  350. len(header table) refers to the first
  351. entry in the static table.
  352. </t>
  353. <t>
  354. Any other indices MUST be treated as
  355. erroneous, and the compression context
  356. considered corrupt and unusable.
  357. </t>
  358. </list>
  359. </t>
  360. </list>
  361. </t>
  362. </section>
  363. <section title="Header Field Emission" anchor="header.emission">
  364. <t>
  365. The emission of header field is the process of passing
  366. that header field to the application, so that the
  367. application can process and react to header field data.
  368. </t>
  369. <t>
  370. By emitting headers instead of emitting header sets,
  371. the decoder may be implemented in a streaming way, and
  372. as such must only keep in memory the header table and
  373. the reference set. This bounds the amount of memory
  374. used by the decoder, even in presence of a very large
  375. set of header fields. The management of memory for
  376. handling very large sets of header fields can
  377. therefore be deferred to the application.
  378. </t>
  379. <t>
  380. When a header field includes a value-list which
  381. has a NULL, each value within the value-list
  382. may be emitted with the name separately in the
  383. order in which it appears in the value-list.
  384. </t>
  385. </section>
  386. </section>
  387. <section title="Header Block Decoding"
  388. anchor="header.block.decoding">
  389. <t>
  390. The processing of a header block to obtain a header set is
  391. defined in this section. To ensure that the decoding will
  392. successfully produce a header set, a decoder MUST obey the
  393. following rules.
  394. </t>
  395. <section title="Header Field Representation Processing"
  396. anchor="header.representation.processing">
  397. <t>
  398. All the header field representations contained in a
  399. header block are processed in the order in which they
  400. are presented, as specified below.
  401. </t>
  402. <t>
  403. An <spanx>indexed representation</spanx> corresponding
  404. to an entry <spanx>not present</spanx> in the
  405. reference set entails the following actions:
  406. <list style="symbols">
  407. <t>A reference to the entry is added to the
  408. reference set.</t>
  409. <t>The header field corresponding to the entry is
  410. emitted.</t>
  411. </list>
  412. </t>
  413. <t>
  414. An <spanx>indexed representation</spanx> corresponding
  415. to an entry <spanx>present</spanx> in the
  416. reference set entails the following actions:
  417. <list style="symbols">
  418. <t>The reference to the entry is removed from the
  419. reference set.</t>
  420. </list>
  421. </t>
  422. <t>
  423. A <spanx>literal representation</spanx> that is
  424. <spanx>not added</spanx> to the header table entails
  425. the following action:
  426. <list style="symbols">
  427. <t>The header field is emitted.</t>
  428. </list>
  429. </t>
  430. <t>
  431. A <spanx>literal representation</spanx> that is
  432. <spanx>added</spanx> to the header table entails
  433. the following actions:
  434. <list style="symbols">
  435. <t>The header field is inserted at the beginning
  436. of the header table.</t>
  437. <t>A reference to the new entry is added to the
  438. reference set.</t>
  439. <t>The header is emitted.</t>
  440. </list>
  441. </t>
  442. </section>
  443. <section title="Reference Set Emission"
  444. anchor="reference.set.emission">
  445. <t>
  446. Once all the representations contained in a header
  447. block have been processed, the header fields referenced in
  448. the reference set which have not previously been
  449. emitted during this processing are emitted.
  450. </t>
  451. </section>
  452. <section title="Header Set Completion"
  453. anchor="header.set.completion">
  454. <t>
  455. Once all of the header field representations have been
  456. processed, and the remaining items in the reference
  457. set have been emitted, the header set is complete.
  458. </t>
  459. </section>
  460. </section>
  461. <section title="Header Table Management"
  462. anchor="header.table.management">
  463. <section title="Maximum Table Size"
  464. anchor="maximum.table.size">
  465. <t>
  466. To limit the memory requirements on the decoder side,
  467. the size of the the header table is bounded. The size
  468. of the header table MUST stay lower than or equal to
  469. the value of the HTTP/2.0 setting
  470. SETTINGS_HEADER_TABLE_SIZE (see <xref
  471. target="HTTP2"/>).
  472. </t>
  473. <t>
  474. The size of the the header table is the sum of the
  475. size of its entries.
  476. </t>
  477. <t>
  478. The size of an entry is the sum of its name's length
  479. in bytes (as defined in <xref
  480. target="string.literal.representation" />), of its
  481. value's length in bytes (<xref
  482. target="string.literal.representation" />) and of
  483. 32 bytes. The 32 bytes are an accounting for the entry
  484. structure overhead. For example, an entry structure
  485. using two 64-bits pointers to reference the name and
  486. the value and the entry, and two 64-bits integer for
  487. counting the number of references to these name and
  488. value would use 32 bytes.
  489. </t>
  490. </section>
  491. <section title="Entry Eviction" anchor="entry.eviction">
  492. <t>
  493. Whenever an entry is evicted from the header table,
  494. any reference to that entry contained by the reference
  495. set is removed.
  496. </t>
  497. <t>
  498. Whenever SETTINGS_HEADER_TABLE_SIZE is made smaller,
  499. entries are evicted from the end of the header table
  500. until the size of the header table is less than or
  501. equal to SETTINGS_HEADER_TABLE_SIZE.
  502. </t>
  503. <t>
  504. The eviction of an entry from the header
  505. table causes the index of the entries in the static
  506. table to be reduced by one.
  507. </t>
  508. </section>
  509. <section title="Entry Addition" anchor="entry.addition">
  510. <t>
  511. Whenever a new entry is to be added to the table,
  512. entries are first evicted from the end of the header
  513. table until the size of the header table is less than
  514. or equal to SETTINGS_HEADER_TABLE_SIZE - new entry size, or
  515. until the table is empty.
  516. </t>
  517. <t>
  518. If the size of the new entry is less than or equal to
  519. SETTINGS_HEADER_TABLE_SIZE, that entry is added to the
  520. table. It is not an error to attempt to add an entry
  521. that is larger than SETTINGS_HEADER_TABLE_SIZE.
  522. </t>
  523. </section>
  524. </section>
  525. </section>
  526. <section title="Detailed Format" anchor="detailed.format">
  527. <section title="Low-level representations"
  528. anchor="low-level.representation">
  529. <section title="Integer representation"
  530. anchor="integer.representation">
  531. <t>
  532. Integers are used to represent name indexes, pair
  533. indexes or string lengths. To allow for optimized
  534. processing, an integer representation always finishes
  535. at the end of a byte.
  536. </t>
  537. <t>
  538. An integer is represented in two parts: a prefix that
  539. fills the current byte and an optional list of bytes
  540. that are used if the integer value does not fit in the
  541. prefix. The number of bits of the prefix (called N)
  542. is a parameter of the integer representation.
  543. </t>
  544. <t>
  545. The N-bit prefix allows filling the current byte. If
  546. the value is small enough (strictly less than
  547. 2<x:sup>N</x:sup>-1), it is encoded within the N-bit
  548. prefix. Otherwise all the bits of the prefix are set
  549. to 1 and the value is encoded using an <eref
  550. target="http://en.wikipedia.org/wiki/Variable-length_quantity">
  551. unsigned variable length integer</eref>
  552. representation.
  553. </t>
  554. <t>
  555. The algorithm to represent an integer I is as follows:
  556. <figure><artwork type = "inline">
  557. If I &lt; 2^N - 1, encode I on N bits
  558. Else
  559. encode 2^N - 1 on N bits
  560. I = I - (2^N - 1)
  561. While I >= 128
  562. Encode (I % 128 + 128) on 8 bits
  563. I = I / 128
  564. encode (I) on 8 bits
  565. </artwork></figure>
  566. </t>
  567. <section title="Example 1: Encoding 10 using a 5-bit prefix"
  568. anchor="integer.representation.example1">
  569. <t>
  570. The value 10 is to be encoded with a 5-bit prefix.
  571. <list style="symbols">
  572. <t>
  573. 10 is less than 31 (= 2<x:sup>5</x:sup> -
  574. 1) and is represented using the 5-bit
  575. prefix.
  576. </t>
  577. </list>
  578. </t>
  579. <figure>
  580. <artwork type="inline">
  581. 0 1 2 3 4 5 6 7
  582. +---+---+---+---+---+---+---+---+
  583. | X | X | X | 0 | 1 | 0 | 1 | 0 | 10 stored on 5 bits
  584. +---+---+---+---+---+---+---+---+
  585. </artwork>
  586. </figure>
  587. </section>
  588. <section title="Example 2: Encoding 1337 using a 5-bit prefix"
  589. anchor="integer.representation.example2">
  590. <t>
  591. The value I=1337 is to be encoded with a 5-bit
  592. prefix.
  593. <list>
  594. <t>
  595. 1337 is greater than 31 (=
  596. 2<x:sup>5</x:sup> - 1).
  597. </t>
  598. <t>
  599. <list>
  600. <t>The 5-bit prefix is filled with its
  601. max value (31).</t>
  602. </list>
  603. </t>
  604. <t>I = 1337 - (2<x:sup>5</x:sup> - 1) =
  605. 1306.</t>
  606. <t>
  607. <list>
  608. <t>I (1306) is greater than or equal
  609. to 128, the while loop body
  610. executes:</t>
  611. <t>
  612. <list>
  613. <t>I % 128 == 26</t>
  614. <t>26 + 128 == 154</t>
  615. <t>154 is encoded in 8 bits as:
  616. 10011010</t>
  617. <t>I is set to 10 (1306 / 128 ==
  618. 10)</t>
  619. <t>I is no longer greater than
  620. or equal to 128, the while
  621. loop terminates.</t>
  622. </list>
  623. </t>
  624. <t>
  625. I, now 10, is encoded on 8 bits
  626. as: 00001010
  627. </t>
  628. </list>
  629. </t>
  630. <t>The process ends.</t>
  631. </list>
  632. </t>
  633. <figure>
  634. <artwork type="inline">
  635. 0 1 2 3 4 5 6 7
  636. +---+---+---+---+---+---+---+---+
  637. | X | X | X | 1 | 1 | 1 | 1 | 1 | Prefix = 31, I = 1306
  638. | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 1306>=128, encode(154), I=1306/128
  639. | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 10&lt;128, encode(10), done
  640. +---+---+---+---+---+---+---+---+
  641. </artwork>
  642. </figure>
  643. </section>
  644. </section>
  645. <section title="String Literal Representation"
  646. anchor="string.literal.representation">
  647. <t>
  648. Header field names and header field values are encoded
  649. as sequences of bytes. A header field name or a header
  650. field value is encoded in two parts:
  651. <list style="numbers">
  652. <t>The number of bytes in the sequence, represented
  653. as a <xref target="integer.representation">
  654. variable-length-quantity </xref>.
  655. </t>
  656. <t>
  657. The sequence of bytes representing the header
  658. field name or value.
  659. </t>
  660. </list>
  661. </t>
  662. </section>
  663. </section>
  664. <section title="Indexed Header Field Representation"
  665. anchor="indexed.header.representation">
  666. <t>
  667. An indexed header representation either identifies an
  668. entry in the header table or static table. The specified
  669. entry is emitted and a reference to that entry is added to
  670. the reference set if it is not currently in the reference
  671. set. If it is present in the reference set then the
  672. reference is removed and the entry is not emitted.
  673. </t>
  674. <figure title="Indexed Header">
  675. <artwork type="inline">
  676. 0 1 2 3 4 5 6 7
  677. +---+---+---+---+---+---+---+---+
  678. | 1 | Index (7+) |
  679. +---+---------------------------+
  680. </artwork>
  681. </figure>
  682. <t>
  683. This representation starts with the '1' 1-bit pattern,
  684. followed by the index of the matching pair, represented as
  685. an integer with a 7-bit prefix.
  686. </t>
  687. </section>
  688. <section title="Literal Header Field Representation"
  689. anchor="literal.header.representation">
  690. <t>
  691. Literal header field representations contain a literal
  692. header field value. Header field names are either
  693. provided as a literal or by reference to an existing
  694. header table or static table entry.
  695. </t>
  696. <t>
  697. Literal representations all result in the emission of a
  698. header field when decoded.
  699. </t>
  700. <section title="Literal Header Field without Indexing"
  701. anchor="literal.header.without.indexing">
  702. <t>
  703. A literal header field without indexing causes the
  704. emission of a header field without altering the header
  705. table.
  706. </t>
  707. <figure title="Literal Header Field without Indexing - Indexed Name">
  708. <artwork type="inline">
  709. 0 1 2 3 4 5 6 7
  710. +---+---+---+---+---+---+---+---+
  711. | 0 | 1 | Index (6+) |
  712. +---+---+---+-------------------+
  713. | Value Length (8+) |
  714. +-------------------------------+
  715. | Value String (Length octets) |
  716. +-------------------------------+
  717. </artwork>
  718. </figure>
  719. <figure title="Literal Header Field without Indexing - New Name">
  720. <artwork type="inline">
  721. 0 1 2 3 4 5 6 7
  722. +---+---+---+---+---+---+---+---+
  723. | 0 | 1 | 0 |
  724. +---+---+---+-------------------+
  725. | Name Length (8+) |
  726. +-------------------------------+
  727. | Name String (Length octets) |
  728. +-------------------------------+
  729. | Value Length (8+) |
  730. +-------------------------------+
  731. | Value String (Length octets) |
  732. +-------------------------------+
  733. </artwork>
  734. </figure>
  735. <t>
  736. This representation starts with the '01' 2-bit pattern.
  737. </t>
  738. <t>
  739. If the header name matches the header name of a (name,
  740. value) pair stored in the Header Table or Static
  741. Table, the index of that entry, increased by one
  742. (index + 1), is represented as an integer with a 6-bit
  743. prefix. Note that if the index is strictly below 63,
  744. only one byte is used for this representation.
  745. </t>
  746. <t>
  747. If the header field name does not match a header field
  748. name entry, the value 0 is represented on 6 bits
  749. followed by the header field name (<xref
  750. target="string.literal.representation" />).
  751. </t>
  752. <t>
  753. The header field name representation is followed by
  754. the header field value represented as a literal string
  755. as described in <xref
  756. target="string.literal.representation" />.
  757. </t>
  758. </section>
  759. <section title="Literal Header Field with Incremental Indexing"
  760. anchor="literal.header.with.incremental.indexing">
  761. <t>
  762. A literal header field with incremental indexing adds
  763. a new entry to the header table.
  764. </t>
  765. <figure title="Literal Header Field with Incremental Indexing -
  766. Indexed Name">
  767. <artwork type="inline">
  768. 0 1 2 3 4 5 6 7
  769. +---+---+---+---+---+---+---+---+
  770. | 0 | 0 | Index (6+) |
  771. +---+---+---+-------------------+
  772. | Value Length (8+) |
  773. +-------------------------------+
  774. | Value String (Length octets) |
  775. +-------------------------------+
  776. </artwork>
  777. </figure>
  778. <figure title="Literal Header Field with Incremental Indexing -
  779. New Name">
  780. <artwork type="inline">
  781. 0 1 2 3 4 5 6 7
  782. +---+---+---+---+---+---+---+---+
  783. | 0 | 0 | 0 |
  784. +---+---+---+-------------------+
  785. | Name Length (8+) |
  786. +-------------------------------+
  787. | Name String (Length octets) |
  788. +-------------------------------+
  789. | Value Length (8+) |
  790. +-------------------------------+
  791. | Value String (Length octets) |
  792. +-------------------------------+
  793. </artwork>
  794. </figure>
  795. <t>
  796. This representation starts with the '00' 2-bit
  797. pattern.
  798. </t>
  799. <t>
  800. If the header name matches the header name of a (name,
  801. value) pair stored in the header table or static
  802. table, the index of the pair increased by one (index +
  803. 1) is represented as an integer with a 6-bit prefix.
  804. </t>
  805. <t>
  806. If the header field name does not match a header field
  807. name entry, the value 0 is represented on 6 bits
  808. followed by the header field name (<xref
  809. target="string.literal.representation" />).
  810. </t>
  811. <t>
  812. The header field name representation is followed by
  813. the header field value represented as a literal string
  814. as described in <xref
  815. target="string.literal.representation" />.
  816. </t>
  817. </section>
  818. </section>
  819. </section>
  820. <section anchor="Security" title="Security Considerations">
  821. <t>
  822. This compressor exists to solve security issues present in
  823. stream compressors such as DEFLATE whereby the compression
  824. context can be efficiently probed to reveal secrets.
  825. A conformant implementation of this specification should be
  826. fairly safe against that kind of attack, as the reaping of any
  827. information from the compression context requires more work than
  828. guessing and verifying the plaintext data directly with the
  829. server. As with any secret, however, the longer the length
  830. of the secret, the more difficult the secret is to guess. It
  831. is inadvisable to have short cookies that are relied upon to
  832. remain secret for any duration of time.
  833. </t>
  834. <t>
  835. A proper security-conscious implementation will also need to
  836. prevent timing attacks by ensuring that the amount of time it
  837. takes to do string comparisons is always a function of the
  838. total length of the strings, and not a function of the number
  839. of matched characters.
  840. </t>
  841. <t>
  842. Another common security problem is when the remote endpoint
  843. successfully causes the local endpoint to exhaust its memory.
  844. This compressor attempts to deal with the most obvious ways
  845. that this could occur by limiting both the peak and the
  846. steady-state amount of memory consumed in the compressor
  847. state, by providing ways for the application to consume/flush
  848. the emitted header fields in small chunks, and by considering
  849. overhead in the state size calculation. Implementors must
  850. still be careful in the creation of APIs to an implementation
  851. of this compressor by ensuring that header field keys and
  852. values are either emitted as a stream, or that the compression
  853. implementation have a limit on the maximum size of a key or
  854. value. Failure to implement these kinds of safeguards may
  855. still result in a scenario where the local endpoint exhausts
  856. its memory.
  857. </t>
  858. </section>
  859. </middle>
  860. <back>
  861. <references title="Normative References">
  862. <reference anchor="HTTP2">
  863. <front>
  864. <title>Hypertext Transfer Protocol version 2.0</title>
  865. <author initials="M." surname="Belshe" fullname="Mike Belshe">
  866. <organization>Twist</organization>
  867. </author>
  868. <author initials="R." surname="Peon" fullname="Roberto Peon">
  869. <organization>Google</organization>
  870. </author>
  871. <author initials="M." surname="Thomson" fullname="Martin Thomson">
  872. <organization></organization>
  873. </author>
  874. <author initials="A." surname="Melnikov" fullname="Alexey Melnikov">
  875. <organization></organization>
  876. </author>
  877. <date month="August" year="2013"/>
  878. </front>
  879. <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-http2-06"/>
  880. </reference>
  881. </references>
  882. <references title="Informative References">
  883. <reference anchor="SPDY" target="http://tools.ietf.org/html/draft-mbelshe-httpbis-spdy">
  884. <front>
  885. <title>SPDY Protocol</title>
  886. <author initials="M." surname="Belshe" fullname="Mike Belshe">
  887. <organization>Twist</organization>
  888. </author>
  889. <author initials="R." surname="Peon" fullname="Roberto Peon">
  890. <organization>Google</organization>
  891. </author>
  892. <date month="February" year="2012"/>
  893. </front>
  894. </reference>
  895. <reference anchor="CRIME" target="https://docs.google.com/a/twist.com/presentation/d/11eBmGiHbYcHR9gL5nDyZChu_-lCa2GizeuOfaLU2HOU/edit#slide=id.g1eb6c1b5_3_6">
  896. <front>
  897. <title>The Crime Attack</title>
  898. <author initials="J." surname="Rizzo" fullname="Juliano Rizzo"></author>
  899. <author initials="T." surname="Duong" fullname="Thai Duong"></author>
  900. <date month="September" year="2012"/>
  901. </front>
  902. </reference>
  903. <reference anchor="PERF1" target="http://www.ietf.org/proceedings/83/slides/slides-83-httpbis-3">
  904. <front>
  905. <title>IETF83: SPDY and What to Consider for HTTP/2.0</title>
  906. <author initials="M." surname="Belshe" fullname="Mike Belshe">
  907. </author>
  908. <date month="March" year="2012"/>
  909. </front>
  910. </reference>
  911. <reference anchor="PERF2" target="http://bitsup.blogspot.com/2011/09/spdy-what-i-like-about-you.html">
  912. <front>
  913. <title>SPDY: What I Like About You</title>
  914. <author initials="P." surname="McManus" fullname="Patrick McManus">
  915. </author>
  916. <date month="September" year="2011"/>
  917. </front>
  918. </reference>
  919. <reference anchor="HUFF" target="">
  920. <front>
  921. <title>A Method for the Construction of Minimim Redundancy Codes</title>
  922. <author surname="Huffman, D. A." fullname="David A. Huffman">
  923. </author>
  924. <date month="Proceedings of the Institute of Radio Engineers, September 1952, Volume 40, Number 9, pp. 1098-1101"/>
  925. </front>
  926. </reference>
  927. <reference anchor="CANON" target="">
  928. <front>
  929. <title>Generating a canonical prefix encoding</title>
  930. <author surname="Schwartz, E. S."> </author>
  931. <author surname="Kallick, B."> </author>
  932. <date month="Comm. ACM, 7,3 (March 1964), pp 166-169"/>
  933. </front>
  934. </reference>
  935. </references>
  936. <section title="Change Log (to be removed by RFC Editor before publication">
  937. <section title="Since draft-ietf-httpbis-header-compression-03" anchor="changes.since.draft-ietf-httpbis-header-compression-03">
  938. <t><list style="symbols">
  939. <t>
  940. A large number of editorial changes; changed the
  941. description of evicting/adding new entries.
  942. </t>
  943. <t>
  944. Removed substitution indexing
  945. </t>
  946. <t>
  947. Changed 'initial headers' to 'static headers', as per
  948. issue #258
  949. </t>
  950. <t>
  951. Merged 'request' and 'response' static headers, as per
  952. issue #259
  953. </t>
  954. <t>
  955. Changed text to indicate that new headers are added at
  956. index 0 and expire from the largest index, as per
  957. issue #233
  958. </t>
  959. </list></t>
  960. </section>
  961. <section title="Since draft-ietf-httpbis-header-compression-02">
  962. <t><list style="symbols">
  963. <t>
  964. Corrected error in integer encoding pseudocode.
  965. </t>
  966. </list></t>
  967. </section>
  968. <section title="Since draft-ietf-httpbis-header-compression-01">
  969. <t>
  970. <list style="symbols">
  971. <t>
  972. Refactored of Header Encoding Section: split
  973. definitions and processing rule.
  974. </t>
  975. <t>
  976. Backward incompatible change: Updated
  977. reference set management as per issue #214. This
  978. changes how the interaction between the reference
  979. set and eviction works. This also changes the
  980. working of the reference set in some specific
  981. cases.
  982. </t>
  983. <t>
  984. Backward incompatible change: modified initial
  985. header list, as per issue #188.
  986. </t>
  987. <t>
  988. Added example of 32 bytes entry structure (issue
  989. #191).
  990. </t>
  991. <t>
  992. Added Header Set Completion section. Reflowed
  993. some text. Clarified some writing which was
  994. akward. Added text about duplicate header entry
  995. encoding. Clarified some language w.r.t Header
  996. Set. Changed x-my-header to mynewheader. Added
  997. text in the HeaderEmission section indicating that
  998. the application may also be able to free up memory
  999. more quickly. Added information in Security
  1000. Considerations section.
  1001. </t>
  1002. </list>
  1003. </t>
  1004. </section>
  1005. <section title="Since draft-ietf-httpbis-header-compression-01">
  1006. <t>
  1007. <list>
  1008. <t>Fixed bug/omission in integer representation algorithm.</t>
  1009. <t>Changed the document title.</t>
  1010. <t>Header matching text rewritten.</t>
  1011. <t>Changed the definition of header emission.</t>
  1012. <t>Changed the name of the setting which dictates how
  1013. much memory the compression context should
  1014. use.</t>
  1015. <t>Removed "specific use cases" section</t>
  1016. <t>Corrected erroneous statement about what index can
  1017. be contained in one byte</t>
  1018. <t>Added descriptions of opcodes</t>
  1019. <t>Removed security claims from introduction.</t>
  1020. </list>
  1021. </t>
  1022. </section>
  1023. </section>
  1024. <section title="Static Table" anchor="static.table">
  1025. <t>
  1026. The static table consists of an unchangable ordered list of
  1027. (name, value) pairs. The first entry in the table is always
  1028. represented by the index len(header table), and the last entry
  1029. in the table is represented by the index len(header
  1030. table)+len(static table)-1.
  1031. </t>
  1032. <t>
  1033. <cref>
  1034. The ordering of these tables is currently arbitrary.
  1035. The tables in this section should be updated and ordered
  1036. such that the table entries with the smallest indices are
  1037. those which, based on a statistical analysis of the
  1038. frequency of use weighted by size, achieve the largest
  1039. decrease in bytes transmitted subject to HTTP 2.0 header
  1040. rules (like removal of some headers). This set of headers
  1041. is currently very likely incomplete, and should be made
  1042. complete.
  1043. </cref>
  1044. <vspace blankLines="0"/>
  1045. </t>
  1046. <t>
  1047. The following table lists the pre-defined header fields that
  1048. make-up the static header table.
  1049. </t>
  1050. <texttable title="Static Table Entries"
  1051. anchor="static.table.entries">
  1052. <!-- An easy way to renumber these in vim:
  1053. :let @a=0 | 'a,'bs/>[0-9 ][0-9 ]*</\='>'.(@a+setreg('a',@a+1)).'<'/
  1054. -->
  1055. <ttcol>Index</ttcol>
  1056. <ttcol>Header Name</ttcol>
  1057. <ttcol>Header Value</ttcol>
  1058. <c>0</c><c>:host</c><c></c>
  1059. <c>1</c><c>:method</c><c>GET</c>
  1060. <c>2</c><c>:method</c><c>POST</c>
  1061. <c>3</c><c>:path</c><c>/</c>
  1062. <c>4</c><c>:path</c><c>/index.html</c>
  1063. <c>5</c><c>:scheme</c><c>http</c>
  1064. <c>6</c><c>:scheme</c><c>https</c>
  1065. <c>7</c><c>:status</c><c>200</c>
  1066. <c>8</c><c>:status</c><c>500</c>
  1067. <c>9</c><c>:status</c><c>404</c>
  1068. <c>10</c><c>:status</c><c>403</c>
  1069. <c>11</c><c>:status</c><c>400</c>
  1070. <c>12</c><c>:status</c><c>401</c>
  1071. <c>13</c><c>accept-charset</c><c></c>
  1072. <c>14</c><c>accept-encoding</c><c></c>
  1073. <c>15</c><c>accept-language</c><c></c>
  1074. <c>16</c><c>accept-ranges</c><c></c>
  1075. <c>17</c><c>accept</c><c></c>
  1076. <c>18</c><c>access-control-allow-origin</c><c></c>
  1077. <c>19</c><c>age</c><c></c>
  1078. <c>20</c><c>allow</c><c></c>
  1079. <c>21</c><c>authorization</c><c></c>
  1080. <c>22</c><c>cache-control</c><c></c>
  1081. <c>23</c><c>content-disposition</c><c></c>
  1082. <c>24</c><c>content-encoding</c><c></c>
  1083. <c>25</c><c>content-language</c><c></c>
  1084. <c>26</c><c>content-length</c><c></c>
  1085. <c>27</c><c>content-location</c><c></c>
  1086. <c>28</c><c>content-range</c><c></c>
  1087. <c>29</c><c>content-type</c><c></c>
  1088. <c>30</c><c>cookie</c><c></c>
  1089. <c>31</c><c>date</c><c></c>
  1090. <c>32</c><c>etag</c><c></c>
  1091. <c>33</c><c>expect</c><c></c>
  1092. <c>34</c><c>expires</c><c></c>
  1093. <c>35</c><c>from</c><c></c>
  1094. <c>36</c><c>if-match</c><c></c>
  1095. <c>37</c><c>if-modified-since</c><c></c>
  1096. <c>38</c><c>if-none-match</c><c></c>
  1097. <c>39</c><c>if-range</c><c></c>
  1098. <c>40</c><c>if-unmodified-since</c><c></c>
  1099. <c>41</c><c>last-modified</c><c></c>
  1100. <c>42</c><c>link</c><c></c>
  1101. <c>43</c><c>location</c><c></c>
  1102. <c>44</c><c>max-forwards</c><c></c>
  1103. <c>45</c><c>proxy-authenticate</c><c></c>
  1104. <c>46</c><c>proxy-authorization</c><c></c>
  1105. <c>47</c><c>range</c><c></c>
  1106. <c>48</c><c>referer</c><c></c>
  1107. <c>49</c><c>refresh</c><c></c>
  1108. <c>50</c><c>retry-after</c><c></c>
  1109. <c>51</c><c>server</c><c></c>
  1110. <c>52</c><c>set-cookie</c><c></c>
  1111. <c>53</c><c>strict-transport-security</c><c></c>
  1112. <c>54</c><c>transfer-encoding</c><c></c>
  1113. <c>55</c><c>user-agent</c><c></c>
  1114. <c>56</c><c>vary</c><c></c>
  1115. <c>57</c><c>via</c><c></c>
  1116. <c>58</c><c>www-authenticate</c><c></c>
  1117. </texttable>
  1118. <t>
  1119. The table give the index of each entry in the static table.
  1120. The full index of each entry, to be used for encoding a
  1121. reference to this entry, is computed by adding the number of
  1122. entries in the header table to this index.
  1123. </t>
  1124. </section>
  1125. <section title="Huffman Codes For Requests" anchor="request.huffman.codes">
  1126. <t>The following Huffman codes are used when encoding requests.</t>
  1127. <t>
  1128. <figure>
  1129. <artwork><![CDATA[
  1130. aligned aligned
  1131. to to
  1132. MSB LSB
  1133. sym as bits len as hex len
  1134. ( 0) |11111111|11111111|11110111|100 [27] 7ffffbc [27]
  1135. ( 1) |11111111|11111111|11110111|101 [27] 7ffffbd [27]
  1136. ( 2) |11111111|11111111|11110111|110 [27] 7ffffbe [27]
  1137. ( 3) |11111111|11111111|11110111|111 [27] 7ffffbf [27]
  1138. ( 4) |11111111|11111111|11111000|000 [27] 7ffffc0 [27]
  1139. ( 5) |11111111|11111111|11111000|001 [27] 7ffffc1 [27]
  1140. ( 6) |11111111|11111111|11111000|010 [27] 7ffffc2 [27]
  1141. ( 7) |11111111|11111111|11111000|011 [27] 7ffffc3 [27]
  1142. ( 8) |11111111|11111111|11111000|100 [27] 7ffffc4 [27]
  1143. ( 9) |11111111|11111111|11111000|101 [27] 7ffffc5 [27]
  1144. ( 10) |11111111|11111111|11111000|110 [27] 7ffffc6 [27]
  1145. ( 11) |11111111|11111111|11111000|111 [27] 7ffffc7 [27]
  1146. ( 12) |11111111|11111111|11111001|000 [27] 7ffffc8 [27]
  1147. ( 13) |11111111|11111111|11111001|001 [27] 7ffffc9 [27]
  1148. ( 14) |11111111|11111111|11111001|010 [27] 7ffffca [27]
  1149. ( 15) |11111111|11111111|11111001|011 [27] 7ffffcb [27]
  1150. ( 16) |11111111|11111111|11111001|100 [27] 7ffffcc [27]
  1151. ( 17) |11111111|11111111|11111001|101 [27] 7ffffcd [27]
  1152. ( 18) |11111111|11111111|11111001|110 [27] 7ffffce [27]
  1153. ( 19) |11111111|11111111|11111001|111 [27] 7ffffcf [27]
  1154. ( 20) |11111111|11111111|11111010|000 [27] 7ffffd0 [27]
  1155. ( 21) |11111111|11111111|11111010|001 [27] 7ffffd1 [27]
  1156. ( 22) |11111111|11111111|11111010|010 [27] 7ffffd2 [27]
  1157. ( 23) |11111111|11111111|11111010|011 [27] 7ffffd3 [27]
  1158. ( 24) |11111111|11111111|11111010|100 [27] 7ffffd4 [27]
  1159. ( 25) |11111111|11111111|11111010|101 [27] 7ffffd5 [27]
  1160. ( 26) |11111111|11111111|11111010|110 [27] 7ffffd6 [27]
  1161. ( 27) |11111111|11111111|11111010|111 [27] 7ffffd7 [27]
  1162. ( 28) |11111111|11111111|11111011|000 [27] 7ffffd8 [27]
  1163. ( 29) |11111111|11111111|11111011|001 [27] 7ffffd9 [27]
  1164. ( 30) |11111111|11111111|11111011|010 [27] 7ffffda [27]
  1165. ( 31) |11111111|11111111|11111011|011 [27] 7ffffdb [27]
  1166. ' ' ( 32) |11111111|0110 [12] ff6 [12]
  1167. '!' ( 33) |11111111|0111 [12] ff7 [12]
  1168. '"' ( 34) |11111111|111010 [14] 3ffa [14]
  1169. '#' ( 35) |11111111|1111100 [15] 7ffc [15]
  1170. '$' ( 36) |11111111|1111101 [15] 7ffd [15]
  1171. '%' ( 37) |100110 [6] 26 [6]
  1172. '&' ( 38) |1110000 [7] 70 [7]
  1173. ''' ( 39) |11111111|1111110 [15] 7ffe [15]
  1174. '(' ( 40) |11111111|1000 [12] ff8 [12]
  1175. ')' ( 41) |11111111|1001 [12] ff9 [12]
  1176. '*' ( 42) |11111111|1010 [12] ffa [12]
  1177. '+' ( 43) |11111111|1011 [12] ffb [12]
  1178. ',' ( 44) |11111110|00 [10] 3f8 [10]
  1179. '-' ( 45) |100111 [6] 27 [6]
  1180. '.' ( 46) |00110 [5] 6 [5]
  1181. '/' ( 47) |0000 [4] 0 [4]
  1182. '0' ( 48) |00111 [5] 7 [5]
  1183. '1' ( 49) |01000 [5] 8 [5]
  1184. '2' ( 50) |01001 [5] 9 [5]
  1185. '3' ( 51) |101000 [6] 28 [6]
  1186. '4' ( 52) |1110001 [7] 71 [7]
  1187. '5' ( 53) |101001 [6] 29 [6]
  1188. '6' ( 54) |1110010 [7] 72 [7]
  1189. '7' ( 55) |101010 [6] 2a [6]
  1190. '8' ( 56) |1110011 [7] 73 [7]
  1191. '9' ( 57) |101011 [6] 2b [6]
  1192. ':' ( 58) |101100 [6] 2c [6]
  1193. ';' ( 59) |11110100|0 [9] 1e8 [9]
  1194. '<' ( 60) |11111111|11111111|10 [18] 3fffe [18]
  1195. '=' ( 61) |101101 [6] 2d [6]
  1196. '>' ( 62) |11111111|11111110|0 [17] 1fffc [17]
  1197. '?' ( 63) |11110100|1 [9] 1e9 [9]
  1198. '@' ( 64) |11111111|11100 [13] 1ffc [13]
  1199. 'A' ( 65) |11101100 [8] ec [8]
  1200. 'B' ( 66) |11101101 [8] ed [8]
  1201. 'C' ( 67) |11101110 [8] ee [8]
  1202. 'D' ( 68) |11101111 [8] ef [8]
  1203. 'E' ( 69) |11110101|0 [9] 1ea [9]
  1204. 'F' ( 70) |1110100 [7] 74 [7]
  1205. 'G' ( 71) |11110101|1 [9] 1eb [9]
  1206. 'H' ( 72) |11110110|0 [9] 1ec [9]
  1207. 'I' ( 73) |11110110|1 [9] 1ed [9]
  1208. 'J' ( 74) |11111110|01 [10] 3f9 [10]
  1209. 'K' ( 75) |11111111|010 [11] 7fa [11]
  1210. 'L' ( 76) |11110111|0 [9] 1ee [9]
  1211. 'M' ( 77) |11110111|1 [9] 1ef [9]
  1212. 'N' ( 78) |11111000|0 [9] 1f0 [9]
  1213. 'O' ( 79) |11111000|1 [9] 1f1 [9]
  1214. 'P' ( 80) |11111001|0 [9] 1f2 [9]
  1215. 'Q' ( 81) |11111110|10 [10] 3fa [10]
  1216. 'R' ( 82) |11111001|1 [9] 1f3 [9]
  1217. 'S' ( 83) |11111010|0 [9] 1f4 [9]
  1218. 'T' ( 84) |11111010|1 [9] 1f5 [9]
  1219. 'U' ( 85) |11111011|0 [9] 1f6 [9]
  1220. 'V' ( 86) |11111011|1 [9] 1f7 [9]
  1221. 'W' ( 87) |11111100|0 [9] 1f8 [9]
  1222. 'X' ( 88) |11111100|1 [9] 1f9 [9]
  1223. 'Y' ( 89) |11111110|11 [10] 3fb [10]
  1224. 'Z' ( 90) |11111111|00 [10] 3fc [10]
  1225. '[' ( 91) |11111111|111011 [14] 3ffb [14]
  1226. '\' ( 92) |11111111|11111111|11111011|100 [27] 7ffffdc [27]
  1227. ']' ( 93) |11111111|111100 [14] 3ffc [14]
  1228. '^' ( 94) |11111111|111101 [14] 3ffd [14]
  1229. '_' ( 95) |101110 [6] 2e [6]
  1230. '`' ( 96) |11111111|11111111|110 [19] 7fffe [19]
  1231. 'a' ( 97) |01010 [5] a [5]
  1232. 'b' ( 98) |101111 [6] 2f [6]
  1233. 'c' ( 99) |01011 [5] b [5]
  1234. 'd' (100) |110000 [6] 30 [6]
  1235. 'e' (101) |0001 [4] 1 [4]
  1236. 'f' (102) |110001 [6] 31 [6]
  1237. 'g' (103) |110010 [6] 32 [6]
  1238. 'h' (104) |110011 [6] 33 [6]
  1239. 'i' (105) |01100 [5] c [5]
  1240. 'j' (106) |1110101 [7] 75 [7]
  1241. 'k' (107) |11110000 [8] f0 [8]
  1242. 'l' (108) |110100 [6] 34 [6]
  1243. 'm' (109) |110101 [6] 35 [6]
  1244. 'n' (110) |01101 [5] d [5]
  1245. 'o' (111) |01110 [5] e [5]
  1246. 'p' (112) |01111 [5] f [5]
  1247. 'q' (113) |11111101|0 [9] 1fa [9]
  1248. 'r' (114) |10000 [5] 10 [5]
  1249. 's' (115) |10001 [5] 11 [5]
  1250. 't' (116) |0010 [4] 2 [4]
  1251. 'u' (117) |110110 [6] 36 [6]
  1252. 'v' (118) |11110001 [8] f1 [8]
  1253. 'w' (119) |110111 [6] 37 [6]
  1254. 'x' (120) |11110010 [8] f2 [8]
  1255. 'y' (121) |11110011 [8] f3 [8]
  1256. 'z' (122) |11111101|1 [9] 1fb [9]
  1257. '{' (123) |11111111|11111110|1 [17] 1fffd [17]
  1258. '|' (124) |11111111|1100 [12] ffc [12]
  1259. '}' (125) |11111111|11111111|0 [17] 1fffe [17]
  1260. '~' (126) |11111111|1101 [12] ffd [12]
  1261. (127) |11111111|11111111|11111011|101 [27] 7ffffdd [27]
  1262. (128) |11111111|11111111|11111011|110 [27] 7ffffde [27]
  1263. (129) |11111111|11111111|11111011|111 [27] 7ffffdf [27]
  1264. (130) |11111111|11111111|11111100|000 [27] 7ffffe0 [27]
  1265. (131) |11111111|11111111|11111100|001 [27] 7ffffe1 [27]
  1266. (132) |11111111|11111111|11111100|010 [27] 7ffffe2 [27]
  1267. (133) |11111111|11111111|11111100|011 [27] 7ffffe3 [27]
  1268. (134) |11111111|11111111|11111100|100 [27] 7ffffe4 [27]
  1269. (135) |11111111|11111111|11111100|101 [27] 7ffffe5 [27]
  1270. (136) |11111111|11111111|11111100|110 [27] 7ffffe6 [27]
  1271. (137) |11111111|11111111|11111100|111 [27] 7ffffe7 [27]
  1272. (138) |11111111|11111111|11111101|000 [27] 7ffffe8 [27]
  1273. (139) |11111111|11111111|11111101|001 [27] 7ffffe9 [27]
  1274. (140) |11111111|11111111|11111101|010 [27] 7ffffea [27]
  1275. (141) |11111111|11111111|11111101|011 [27] 7ffffeb [27]
  1276. (142) |11111111|11111111|11111101|100 [27] 7ffffec [27]
  1277. (143) |11111111|11111111|11111101|101 [27] 7ffffed [27]
  1278. (144) |11111111|11111111|11111101|110 [27] 7ffffee [27]
  1279. (145) |11111111|11111111|11111101|111 [27] 7ffffef [27]
  1280. (146) |11111111|11111111|11111110|000 [27] 7fffff0 [27]
  1281. (147) |11111111|11111111|11111110|001 [27] 7fffff1 [27]
  1282. (148) |11111111|11111111|11111110|010 [27] 7fffff2 [27]
  1283. (149) |11111111|11111111|11111110|011 [27] 7fffff3 [27]
  1284. (150) |11111111|11111111|11111110|100 [27] 7fffff4 [27]
  1285. (151) |11111111|11111111|11111110|101 [27] 7fffff5 [27]
  1286. (152) |11111111|11111111|11111110|110 [27] 7fffff6 [27]
  1287. (153) |11111111|11111111|11111110|111 [27] 7fffff7 [27]
  1288. (154) |11111111|11111111|11111111|000 [27] 7fffff8 [27]
  1289. (155) |11111111|11111111|11111111|001 [27] 7fffff9 [27]
  1290. (156) |11111111|11111111|11111111|010 [27] 7fffffa [27]
  1291. (157) |11111111|11111111|11111111|011 [27] 7fffffb [27]
  1292. (158) |11111111|11111111|11111111|100 [27] 7fffffc [27]
  1293. (159) |11111111|11111111|11111111|101 [27] 7fffffd [27]
  1294. (160) |11111111|11111111|11111111|110 [27] 7fffffe [27]
  1295. (161) |11111111|11111111|11111111|111 [27] 7ffffff [27]
  1296. (162) |11111111|11111111|11100000|00 [26] 3ffff80 [26]
  1297. (163) |11111111|11111111|11100000|01 [26] 3ffff81 [26]
  1298. (164) |11111111|11111111|11100000|10 [26] 3ffff82 [26]
  1299. (165) |11111111|11111111|11100000|11 [26] 3ffff83 [26]
  1300. (166) |11111111|11111111|11100001|00 [26] 3ffff84 [26]
  1301. (167) |11111111|11111111|11100001|01 [26] 3ffff85 [26]
  1302. (168) |11111111|11111111|11100001|10 [26] 3ffff86 [26]
  1303. (169) |11111111|11111111|11100001|11 [26] 3ffff87 [26]
  1304. (170) |11111111|11111111|11100010|00 [26] 3ffff88 [26]
  1305. (171) |11111111|11111111|11100010|01 [26] 3ffff89 [26]
  1306. (172) |11111111|11111111|11100010|10 [26] 3ffff8a [26]
  1307. (173) |11111111|11111111|11100010|11 [26] 3ffff8b [26]
  1308. (174) |11111111|11111111|11100011|00 [26] 3ffff8c [26]
  1309. (175) |11111111|11111111|11100011|01 [26] 3ffff8d [26]
  1310. (176) |11111111|11111111|11100011|10 [26] 3ffff8e [26]
  1311. (177) |11111111|11111111|11100011|11 [26] 3ffff8f [26]
  1312. (178) |11111111|11111111|11100100|00 [26] 3ffff90 [26]
  1313. (179) |11111111|11111111|11100100|01 [26] 3ffff91 [26]
  1314. (180) |11111111|11111111|11100100|10 [26] 3ffff92 [26]
  1315. (181) |11111111|11111111|11100100|11 [26] 3ffff93 [26]
  1316. (182) |11111111|11111111|11100101|00 [26] 3ffff94 [26]
  1317. (183) |11111111|11111111|11100101|01 [26] 3ffff95 [26]
  1318. (184) |11111111|11111111|11100101|10 [26] 3ffff96 [26]
  1319. (185) |11111111|11111111|11100101|11 [26] 3ffff97 [26]
  1320. (186) |11111111|11111111|11100110|00 [26] 3ffff98 [26]
  1321. (187) |11111111|11111111|11100110|01 [26] 3ffff99 [26]
  1322. (188) |11111111|11111111|11100110|10 [26] 3ffff9a [26]
  1323. (189) |11111111|11111111|11100110|11 [26] 3ffff9b [26]
  1324. (190) |11111111|11111111|11100111|00 [26] 3ffff9c [26]
  1325. (191) |11111111|11111111|11100111|01 [26] 3ffff9d [26]
  1326. (192) |11111111|11111111|11100111|10 [26] 3ffff9e [26]
  1327. (193) |11111111|11111111|11100111|11 [26] 3ffff9f [26]
  1328. (194) |11111111|11111111|11101000|00 [26] 3ffffa0 [26]
  1329. (195) |11111111|11111111|11101000|01 [26] 3ffffa1 [26]
  1330. (196) |11111111|11111111|11101000|10 [26] 3ffffa2 [26]
  1331. (197) |11111111|11111111|11101000|11 [26] 3ffffa3 [26]
  1332. (198) |11111111|11111111|11101001|00 [26] 3ffffa4 [26]
  1333. (199) |11111111|11111111|11101001|01 [26] 3ffffa5 [26]
  1334. (200) |11111111|11111111|11101001|10 [26] 3ffffa6 [26]
  1335. (201) |11111111|11111111|11101001|11 [26] 3ffffa7 [26]
  1336. (202) |11111111|11111111|11101010|00 [26] 3ffffa8 [26]
  1337. (203) |11111111|11111111|11101010|01 [26] 3ffffa9 [26]
  1338. (204) |11111111|11111111|11101010|10 [26] 3ffffaa [26]
  1339. (205) |11111111|11111111|11101010|11 [26] 3ffffab [26]
  1340. (206) |11111111|11111111|11101011|00 [26] 3ffffac [26]
  1341. (207) |11111111|11111111|11101011|01 [26] 3ffffad [26]
  1342. (208) |11111111|11111111|11101011|10 [26] 3ffffae [26]
  1343. (209) |11111111|11111111|11101011|11 [26] 3ffffaf [26]
  1344. (210) |11111111|11111111|11101100|00 [26] 3ffffb0 [26]
  1345. (211) |11111111|11111111|11101100|01 [26] 3ffffb1 [26]
  1346. (212) |11111111|11111111|11101100|10 [26] 3ffffb2 [26]
  1347. (213) |11111111|11111111|11101100|11 [26] 3ffffb3 [26]
  1348. (214) |11111111|11111111|11101101|00 [26] 3ffffb4 [26]
  1349. (215) |11111111|11111111|11101101|01 [26] 3ffffb5 [26]
  1350. (216) |11111111|11111111|11101101|10 [26] 3ffffb6 [26]
  1351. (217) |11111111|11111111|11101101|11 [26] 3ffffb7 [26]
  1352. (218) |11111111|11111111|11101110|00 [26] 3ffffb8 [26]
  1353. (219) |11111111|11111111|11101110|01 [26] 3ffffb9 [26]
  1354. (220) |11111111|11111111|11101110|10 [26] 3ffffba [26]
  1355. (221) |11111111|11111111|11101110|11 [26] 3ffffbb [26]
  1356. (222) |11111111|11111111|11101111|00 [26] 3ffffbc [26]
  1357. (223) |11111111|11111111|11101111|01 [26] 3ffffbd [26]
  1358. (224) |11111111|11111111|11101111|10 [26] 3ffffbe [26]
  1359. (225) |11111111|11111111|11101111|11 [26] 3ffffbf [26]
  1360. (226) |11111111|11111111|11110000|00 [26] 3ffffc0 [26]
  1361. (227) |11111111|11111111|11110000|01 [26] 3ffffc1 [26]
  1362. (228) |11111111|11111111|11110000|10 [26] 3ffffc2 [26]
  1363. (229) |11111111|11111111|11110000|11 [26] 3ffffc3 [26]
  1364. (230) |11111111|11111111|11110001|00 [26] 3ffffc4 [26]
  1365. (231) |11111111|11111111|11110001|01 [26] 3ffffc5 [26]
  1366. (232) |11111111|11111111|11110001|10 [26] 3ffffc6 [26]
  1367. (233) |11111111|11111111|11110001|11 [26] 3ffffc7 [26]
  1368. (234) |11111111|11111111|11110010|00 [26] 3ffffc8 [26]
  1369. (235) |11111111|11111111|11110010|01 [26] 3ffffc9 [26]
  1370. (236) |11111111|11111111|11110010|10 [26] 3ffffca [26]
  1371. (237) |11111111|11111111|11110010|11 [26] 3ffffcb [26]
  1372. (238) |11111111|11111111|11110011|00 [26] 3ffffcc [26]
  1373. (239) |11111111|11111111|11110011|01 [26] 3ffffcd [26]
  1374. (240) |11111111|11111111|11110011|10 [26] 3ffffce [26]
  1375. (241) |11111111|11111111|11110011|11 [26] 3ffffcf [26]
  1376. (242) |11111111|11111111|11110100|00 [26] 3ffffd0 [26]
  1377. (243) |11111111|11111111|11110100|01 [26] 3ffffd1 [26]
  1378. (244) |11111111|11111111|11110100|10 [26] 3ffffd2 [26]
  1379. (245) |11111111|11111111|11110100|11 [26] 3ffffd3 [26]
  1380. (246) |11111111|11111111|11110101|00 [26] 3ffffd4 [26]
  1381. (247) |11111111|11111111|11110101|01 [26] 3ffffd5 [26]
  1382. (248) |11111111|11111111|11110101|10 [26] 3ffffd6 [26]
  1383. (249) |11111111|11111111|11110101|11 [26] 3ffffd7 [26]
  1384. (250) |11111111|11111111|11110110|00 [26] 3ffffd8 [26]
  1385. (251) |11111111|11111111|11110110|01 [26] 3ffffd9 [26]
  1386. (252) |11111111|11111111|11110110|10 [26] 3ffffda [26]
  1387. (253) |11111111|11111111|11110110|11 [26] 3ffffdb [26]
  1388. (254) |11111111|11111111|11110111|00 [26] 3ffffdc [26]
  1389. (255) |11111111|11111111|11110111|01 [26] 3ffffdd [26]
  1390. (256) |10010 [5] 12 [5]
  1391. ]]>
  1392. </artwork>
  1393. </figure>
  1394. </t>
  1395. </section>
  1396. <section title="Huffman Codes for Responses" anchor="response.huffman.codes">
  1397. <t>The following Huffman codes are used when encoding responses.</t>
  1398. <t>
  1399. <figure>
  1400. <artwork><![CDATA[
  1401. aligned aligned
  1402. to to
  1403. MSB LSB
  1404. sym as bits len as hex len
  1405. ( 0) |11111111|11111111|11101111|10 [26] 3ffffbe [26]
  1406. ( 1) |11111111|11111111|11101111|11 [26] 3ffffbf [26]
  1407. ( 2) |11111111|11111111|11110000|00 [26] 3ffffc0 [26]
  1408. ( 3) |11111111|11111111|11110000|01 [26] 3ffffc1 [26]
  1409. ( 4) |11111111|11111111|11110000|10 [26] 3ffffc2 [26]
  1410. ( 5) |11111111|11111111|11110000|11 [26] 3ffffc3 [26]
  1411. ( 6) |11111111|11111111|11110001|00 [26] 3ffffc4 [26]
  1412. ( 7) |11111111|11111111|11110001|01 [26] 3ffffc5 [26]
  1413. ( 8) |11111111|11111111|11110001|10 [26] 3ffffc6 [26]
  1414. ( 9) |11111111|11111111|11110001|11 [26] 3ffffc7 [26]
  1415. ( 10) |11111111|11111111|11110010|00 [26] 3ffffc8 [26]
  1416. ( 11) |11111111|11111111|11110010|01 [26] 3ffffc9 [26]
  1417. ( 12) |11111111|11111111|11110010|10 [26] 3ffffca [26]
  1418. ( 13) |11111111|11111111|11110010|11 [26] 3ffffcb [26]
  1419. ( 14) |11111111|11111111|11110011|00 [26] 3ffffcc [26]
  1420. ( 15) |11111111|11111111|11110011|01 [26] 3ffffcd [26]
  1421. ( 16) |11111111|11111111|11110011|10 [26] 3ffffce [26]
  1422. ( 17) |11111111|11111111|11110011|11 [26] 3ffffcf [26]
  1423. ( 18) |11111111|11111111|11110100|00 [26] 3ffffd0 [26]
  1424. ( 19) |11111111|11111111|11110100|01 [26] 3ffffd1 [26]
  1425. ( 20) |11111111|11111111|11110100|10 [26] 3ffffd2 [26]
  1426. ( 21) |11111111|11111111|11110100|11 [26] 3ffffd3 [26]
  1427. ( 22) |11111111|11111111|11110101|00 [26] 3ffffd4 [26]
  1428. ( 23) |11111111|11111111|11110101|01 [26] 3ffffd5 [26]
  1429. ( 24) |11111111|11111111|11110101|10 [26] 3ffffd6 [26]
  1430. ( 25) |11111111|11111111|11110101|11 [26] 3ffffd7 [26]
  1431. ( 26) |11111111|11111111|11110110|00 [26] 3ffffd8 [26]
  1432. ( 27) |11111111|11111111|11110110|01 [26] 3ffffd9 [26]
  1433. ( 28) |11111111|11111111|11110110|10 [26] 3ffffda [26]
  1434. ( 29) |11111111|11111111|11110110|11 [26] 3ffffdb [26]
  1435. ( 30) |11111111|11111111|11110111|00 [26] 3ffffdc [26]
  1436. ( 31) |11111111|11111111|11110111|01 [26] 3ffffdd [26]
  1437. ' ' ( 32) |0000 [4] 0 [4]
  1438. '!' ( 33) |11111111|1010 [12] ffa [12]
  1439. '"' ( 34) |1101000 [7] 68 [7]
  1440. '#' ( 35) |11111111|111010 [14] 3ffa [14]
  1441. '$' ( 36) |11111111|1111100 [15] 7ffc [15]
  1442. '%' ( 37) |11110101|0 [9] 1ea [9]
  1443. '&' ( 38) |11111110|00 [10] 3f8 [10]
  1444. ''' ( 39) |11111111|11100 [13] 1ffc [13]
  1445. '(' ( 40) |11110101|1 [9] 1eb [9]
  1446. ')' ( 41) |11110110|0 [9] 1ec [9]
  1447. '*' ( 42) |11111111|1011 [12] ffb [12]
  1448. '+' ( 43) |11111110|01 [10] 3f9 [10]
  1449. ',' ( 44) |100110 [6] 26 [6]
  1450. '-' ( 45) |100111 [6] 27 [6]
  1451. '.' ( 46) |1101001 [7] 69 [7]
  1452. '/' ( 47) |11101000 [8] e8 [8]
  1453. '0' ( 48) |0001 [4] 1 [4]
  1454. '1' ( 49) |0010 [4] 2 [4]
  1455. '2' ( 50) |0011 [4] 3 [4]
  1456. '3' ( 51) |01000 [5] 8 [5]
  1457. '4' ( 52) |01001 [5] 9 [5]
  1458. '5' ( 53) |01010 [5] a [5]
  1459. '6' ( 54) |101000 [6] 28 [6]
  1460. '7' ( 55) |01011 [5] b [5]
  1461. '8' ( 56) |01100 [5] c [5]
  1462. '9' ( 57) |01101 [5] d [5]
  1463. ':' ( 58) |01110 [5] e [5]
  1464. ';' ( 59) |11110110|1 [9] 1ed [9]
  1465. '<' ( 60) |11111111|11111100 [16] fffc [16]
  1466. '=' ( 61) |1101010 [7] 6a [7]
  1467. '>' ( 62) |11111111|111011 [14] 3ffb [14]
  1468. '?' ( 63) |11111111|1100 [12] ffc [12]
  1469. '@' ( 64) |11111111|11111110|0 [17] 1fffc [17]
  1470. 'A' ( 65) |1101011 [7] 6b [7]
  1471. 'B' ( 66) |11110111|0 [9] 1ee [9]
  1472. 'C' ( 67) |11101001 [8] e9 [8]
  1473. 'D' ( 68) |11101010 [8] ea [8]
  1474. 'E' ( 69) |11101011 [8] eb [8]
  1475. 'F' ( 70) |11101100 [8] ec [8]
  1476. 'G' ( 71) |101001 [6] 29 [6]
  1477. 'H' ( 72) |11110111|1 [9] 1ef [9]
  1478. 'I' ( 73) |11111000|0 [9] 1f0 [9]
  1479. 'J' ( 74) |11101101 [8] ed [8]
  1480. 'K' ( 75) |11111110|10 [10] 3fa [10]
  1481. 'L' ( 76) |11111000|1 [9] 1f1 [9]
  1482. 'M' ( 77) |101010 [6] 2a [6]
  1483. 'N' ( 78) |11101110 [8] ee [8]
  1484. 'O' ( 79) |11101111 [8] ef [8]
  1485. 'P' ( 80) |11111001|0 [9] 1f2 [9]
  1486. 'Q' ( 81) |11111001|1 [9] 1f3 [9]
  1487. 'R' ( 82) |11111010|0 [9] 1f4 [9]
  1488. 'S' ( 83) |1101100 [7] 6c [7]
  1489. 'T' ( 84) |01111 [5] f [5]
  1490. 'U' ( 85) |11111010|1 [9] 1f5 [9]
  1491. 'V' ( 86) |11111011|0 [9] 1f6 [9]
  1492. 'W' ( 87) |11110000 [8] f0 [8]
  1493. 'X' ( 88) |11111110|11 [10] 3fb [10]
  1494. 'Y' ( 89) |11111111|00 [10] 3fc [10]
  1495. 'Z' ( 90) |11111111|01 [10] 3fd [10]
  1496. '[' ( 91) |11111111|1101 [12] ffd [12]
  1497. '\' ( 92) |11111111|111100 [14] 3ffc [14]
  1498. ']' ( 93) |11111111|100 [11] 7fc [11]
  1499. '^' ( 94) |11111111|1111101 [15] 7ffd [15]
  1500. '_' ( 95) |11111011|1 [9] 1f7 [9]
  1501. '`' ( 96) |11111111|11111111|10 [18] 3fffe [18]
  1502. 'a' ( 97) |10000 [5] 10 [5]
  1503. 'b' ( 98) |1101101 [7] 6d [7]
  1504. 'c' ( 99) |101011 [6] 2b [6]
  1505. 'd' (100) |101100 [6] 2c [6]
  1506. 'e' (101) |10001 [5] 11 [5]
  1507. 'f' (102) |1101110 [7] 6e [7]
  1508. 'g' (103) |1101111 [7] 6f [7]
  1509. 'h' (104) |1110000 [7] 70 [7]
  1510. 'i' (105) |101101 [6] 2d [6]
  1511. 'j' (106) |11111100|0 [9] 1f8 [9]
  1512. 'k' (107) |11111100|1 [9] 1f9 [9]
  1513. 'l' (108) |1110001 [7] 71 [7]
  1514. 'm' (109) |1110010 [7] 72 [7]
  1515. 'n' (110) |101110 [6] 2e [6]
  1516. 'o' (111) |101111 [6] 2f [6]
  1517. 'p' (112) |110000 [6] 30 [6]
  1518. 'q' (113) |11111101|0 [9] 1fa [9]
  1519. 'r' (114) |110001 [6] 31 [6]
  1520. 's' (115) |1110011 [7] 73 [7]
  1521. 't' (116) |110010 [6] 32 [6]
  1522. 'u' (117) |110011 [6] 33 [6]
  1523. 'v' (118) |11110001 [8] f1 [8]
  1524. 'w' (119) |11110010 [8] f2 [8]
  1525. 'x' (120) |11110011 [8] f3 [8]
  1526. 'y' (121) |11110100 [8] f4 [8]
  1527. 'z' (122) |11111101|1 [9] 1fb [9]
  1528. '{' (123) |11111111|11111110|1 [17] 1fffd [17]
  1529. '|' (124) |11111111|111101 [14] 3ffd [14]
  1530. '}' (125) |11111111|11111111|0 [17] 1fffe [17]
  1531. '~' (126) |11111111|11111101 [16] fffd [16]
  1532. (127) |11111111|11111111|11110111|10 [26] 3ffffde [26]
  1533. (128) |11111111|11111111|11110111|11 [26] 3ffffdf [26]
  1534. (129) |11111111|11111111|11111000|00 [26] 3ffffe0 [26]
  1535. (130) |11111111|11111111|11111000|01 [26] 3ffffe1 [26]
  1536. (131) |11111111|11111111|11111000|10 [26] 3ffffe2 [26]
  1537. (132) |11111111|11111111|11111000|11 [26] 3ffffe3 [26]
  1538. (133) |11111111|11111111|11111001|00 [26] 3ffffe4 [26]
  1539. (134) |11111111|11111111|11111001|01 [26] 3ffffe5 [26]
  1540. (135) |11111111|11111111|11111001|10 [26] 3ffffe6 [26]
  1541. (136) |11111111|11111111|11111001|11 [26] 3ffffe7 [26]
  1542. (137) |11111111|11111111|11111010|00 [26] 3ffffe8 [26]
  1543. (138) |11111111|11111111|11111010|01 [26] 3ffffe9 [26]
  1544. (139) |11111111|11111111|11111010|10 [26] 3ffffea [26]
  1545. (140) |11111111|11111111|11111010|11 [26] 3ffffeb [26]
  1546. (141) |11111111|11111111|11111011|00 [26] 3ffffec [26]
  1547. (142) |11111111|11111111|11111011|01 [26] 3ffffed [26]
  1548. (143) |11111111|11111111|11111011|10 [26] 3ffffee [26]
  1549. (144) |11111111|11111111|11111011|11 [26] 3ffffef [26]
  1550. (145) |11111111|11111111|11111100|00 [26] 3fffff0 [26]
  1551. (146) |11111111|11111111|11111100|01 [26] 3fffff1 [26]
  1552. (147) |11111111|11111111|11111100|10 [26] 3fffff2 [26]
  1553. (148) |11111111|11111111|11111100|11 [26] 3fffff3 [26]
  1554. (149) |11111111|11111111|11111101|00 [26] 3fffff4 [26]
  1555. (150) |11111111|11111111|11111101|01 [26] 3fffff5 [26]
  1556. (151) |11111111|11111111|11111101|10 [26] 3fffff6 [26]
  1557. (152) |11111111|11111111|11111101|11 [26] 3fffff7 [26]
  1558. (153) |11111111|11111111|11111110|00 [26] 3fffff8 [26]
  1559. (154) |11111111|11111111|11111110|01 [26] 3fffff9 [26]
  1560. (155) |11111111|11111111|11111110|10 [26] 3fffffa [26]
  1561. (156) |11111111|11111111|11111110|11 [26] 3fffffb [26]
  1562. (157) |11111111|11111111|11111111|00 [26] 3fffffc [26]
  1563. (158) |11111111|11111111|11111111|01 [26] 3fffffd [26]
  1564. (159) |11111111|11111111|11111111|10 [26] 3fffffe [26]
  1565. (160) |11111111|11111111|11111111|11 [26] 3ffffff [26]
  1566. (161) |11111111|11111111|11000000|0 [25] 1ffff80 [25]
  1567. (162) |11111111|11111111|11000000|1 [25] 1ffff81 [25]
  1568. (163) |11111111|11111111|11000001|0 [25] 1ffff82 [25]
  1569. (164) |11111111|11111111|11000001|1 [25] 1ffff83 [25]
  1570. (165) |11111111|11111111|11000010|0 [25] 1ffff84 [25]
  1571. (166) |11111111|11111111|11000010|1 [25] 1ffff85 [25]
  1572. (167) |11111111|11111111|11000011|0 [25] 1ffff86 [25]
  1573. (168) |11111111|11111111|11000011|1 [25] 1ffff87 [25]
  1574. (169) |11111111|11111111|11000100|0 [25] 1ffff88 [25]
  1575. (170) |11111111|11111111|11000100|1 [25] 1ffff89 [25]
  1576. (171) |11111111|11111111|11000101|0 [25] 1ffff8a [25]
  1577. (172) |11111111|11111111|11000101|1 [25] 1ffff8b [25]
  1578. (173) |11111111|11111111|11000110|0 [25] 1ffff8c [25]
  1579. (174) |11111111|11111111|11000110|1 [25] 1ffff8d [25]
  1580. (175) |11111111|11111111|11000111|0 [25] 1ffff8e [25]
  1581. (176) |11111111|11111111|11000111|1 [25] 1ffff8f [25]
  1582. (177) |11111111|11111111|11001000|0 [25] 1ffff90 [25]
  1583. (178) |11111111|11111111|11001000|1 [25] 1ffff91 [25]
  1584. (179) |11111111|11111111|11001001|0 [25] 1ffff92 [25]
  1585. (180) |11111111|11111111|11001001|1 [25] 1ffff93 [25]
  1586. (181) |11111111|11111111|11001010|0 [25] 1ffff94 [25]
  1587. (182) |11111111|11111111|11001010|1 [25] 1ffff95 [25]
  1588. (183) |11111111|11111111|11001011|0 [25] 1ffff96 [25]
  1589. (184) |11111111|11111111|11001011|1 [25] 1ffff97 [25]
  1590. (185) |11111111|11111111|11001100|0 [25] 1ffff98 [25]
  1591. (186) |11111111|11111111|11001100|1 [25] 1ffff99 [25]
  1592. (187) |11111111|11111111|11001101|0 [25] 1ffff9a [25]
  1593. (188) |11111111|11111111|11001101|1 [25] 1ffff9b [25]
  1594. (189) |11111111|11111111|11001110|0 [25] 1ffff9c [25]
  1595. (190) |11111111|11111111|11001110|1 [25] 1ffff9d [25]
  1596. (191) |11111111|11111111|11001111|0 [25] 1ffff9e [25]
  1597. (192) |11111111|11111111|11001111|1 [25] 1ffff9f [25]
  1598. (193) |11111111|11111111|11010000|0 [25] 1ffffa0 [25]
  1599. (194) |11111111|11111111|11010000|1 [25] 1ffffa1 [25]
  1600. (195) |11111111|11111111|11010001|0 [25] 1ffffa2 [25]
  1601. (196) |11111111|11111111|11010001|1 [25] 1ffffa3 [25]
  1602. (197) |11111111|11111111|11010010|0 [25] 1ffffa4 [25]
  1603. (198) |11111111|11111111|11010010|1 [25] 1ffffa5 [25]
  1604. (199) |11111111|11111111|11010011|0 [25] 1ffffa6 [25]
  1605. (200) |11111111|11111111|11010011|1 [25] 1ffffa7 [25]
  1606. (201) |11111111|11111111|11010100|0 [25] 1ffffa8 [25]
  1607. (202) |11111111|11111111|11010100|1 [25] 1ffffa9 [25]
  1608. (203) |11111111|11111111|11010101|0 [25] 1ffffaa [25]
  1609. (204) |11111111|11111111|11010101|1 [25] 1ffffab [25]
  1610. (205) |11111111|11111111|11010110|0 [25] 1ffffac [25]
  1611. (206) |11111111|11111111|11010110|1 [25] 1ffffad [25]
  1612. (207) |11111111|11111111|11010111|0 [25] 1ffffae [25]
  1613. (208) |11111111|11111111|11010111|1 [25] 1ffffaf [25]
  1614. (209) |11111111|11111111|11011000|0 [25] 1ffffb0 [25]
  1615. (210) |11111111|11111111|11011000|1 [25] 1ffffb1 [25]
  1616. (211) |11111111|11111111|11011001|0 [25] 1ffffb2 [25]
  1617. (212) |11111111|11111111|11011001|1 [25] 1ffffb3 [25]
  1618. (213) |11111111|11111111|11011010|0 [25] 1ffffb4 [25]
  1619. (214) |11111111|11111111|11011010|1 [25] 1ffffb5 [25]
  1620. (215) |11111111|11111111|11011011|0 [25] 1ffffb6 [25]
  1621. (216) |11111111|11111111|11011011|1 [25] 1ffffb7 [25]
  1622. (217) |11111111|11111111|11011100|0 [25] 1ffffb8 [25]
  1623. (218) |11111111|11111111|11011100|1 [25] 1ffffb9 [25]
  1624. (219) |11111111|11111111|11011101|0 [25] 1ffffba [25]
  1625. (220) |11111111|11111111|11011101|1 [25] 1ffffbb [25]
  1626. (221) |11111111|11111111|11011110|0 [25] 1ffffbc [25]
  1627. (222) |11111111|11111111|11011110|1 [25] 1ffffbd [25]
  1628. (223) |11111111|11111111|11011111|0 [25] 1ffffbe [25]
  1629. (224) |11111111|11111111|11011111|1 [25] 1ffffbf [25]
  1630. (225) |11111111|11111111|11100000|0 [25] 1ffffc0 [25]
  1631. (226) |11111111|11111111|11100000|1 [25] 1ffffc1 [25]
  1632. (227) |11111111|11111111|11100001|0 [25] 1ffffc2 [25]
  1633. (228) |11111111|11111111|11100001|1 [25] 1ffffc3 [25]
  1634. (229) |11111111|11111111|11100010|0 [25] 1ffffc4 [25]
  1635. (230) |11111111|11111111|11100010|1 [25] 1ffffc5 [25]
  1636. (231) |11111111|11111111|11100011|0 [25] 1ffffc6 [25]
  1637. (232) |11111111|11111111|11100011|1 [25] 1ffffc7 [25]
  1638. (233) |11111111|11111111|11100100|0 [25] 1ffffc8 [25]
  1639. (234) |11111111|11111111|11100100|1 [25] 1ffffc9 [25]
  1640. (235) |11111111|11111111|11100101|0 [25] 1ffffca [25]
  1641. (236) |11111111|11111111|11100101|1 [25] 1ffffcb [25]
  1642. (237) |11111111|11111111|11100110|0 [25] 1ffffcc [25]
  1643. (238) |11111111|11111111|11100110|1 [25] 1ffffcd [25]
  1644. (239) |11111111|11111111|11100111|0 [25] 1ffffce [25]
  1645. (240) |11111111|11111111|11100111|1 [25] 1ffffcf [25]
  1646. (241) |11111111|11111111|11101000|0 [25] 1ffffd0 [25]
  1647. (242) |11111111|11111111|11101000|1 [25] 1ffffd1 [25]
  1648. (243) |11111111|11111111|11101001|0 [25] 1ffffd2 [25]
  1649. (244) |11111111|11111111|11101001|1 [25] 1ffffd3 [25]
  1650. (245) |11111111|11111111|11101010|0 [25] 1ffffd4 [25]
  1651. (246) |11111111|11111111|11101010|1 [25] 1ffffd5 [25]
  1652. (247) |11111111|11111111|11101011|0 [25] 1ffffd6 [25]
  1653. (248) |11111111|11111111|11101011|1 [25] 1ffffd7 [25]
  1654. (249) |11111111|11111111|11101100|0 [25] 1ffffd8 [25]
  1655. (250) |11111111|11111111|11101100|1 [25] 1ffffd9 [25]
  1656. (251) |11111111|11111111|11101101|0 [25] 1ffffda [25]
  1657. (252) |11111111|11111111|11101101|1 [25] 1ffffdb [25]
  1658. (253) |11111111|11111111|11101110|0 [25] 1ffffdc [25]
  1659. (254) |11111111|11111111|11101110|1 [25] 1ffffdd [25]
  1660. (255) |11111111|11111111|11101111|0 [25] 1ffffde [25]
  1661. (256) |10010 [5] 12 [5]
  1662. ]]>
  1663. </artwork>
  1664. </figure>
  1665. </t>
  1666. </section>
  1667. <section title="Request Huffman Encoding Example" anchor="request.huffman.encoding.example">
  1668. <t>
  1669. TBD: Fill this in.
  1670. </t>
  1671. </section>
  1672. <section title="Response Huffman Encoding Example" anchor="response.huffman.encoding.example">
  1673. <t>
  1674. TBD: Fill this in.
  1675. </t>
  1676. </section>
  1677. <section title="Example" anchor="example">
  1678. <t>
  1679. Here is an example that illustrates different representations
  1680. and how tables are updated.
  1681. <cref>This section needs to be updated to better reflect the
  1682. new processing of header fields, and include more
  1683. examples.</cref>
  1684. </t>
  1685. <section title="First header set">
  1686. <t>
  1687. The first header set to represent is the following:
  1688. <figure><artwork type="message/http">
  1689. :path, /my-example/index.html
  1690. user-agent, my-user-agent
  1691. mynewheader, first
  1692. </artwork></figure>
  1693. The header table is empty, all header fields are
  1694. represented as literal header fields with indexing. The
  1695. 'mynewheader' header field name is not in the header table
  1696. and is encoded literally. This gives the following
  1697. representation:
  1698. <figure><artwork type="message/http">
  1699. 0x04 (literal header with incremental indexing, name index = 3)
  1700. 0x16 (header field value string length = 22)
  1701. /my-example/index.html
  1702. 0x0D (literal header with incremental indexing, name index = 12)
  1703. 0x0D (header field value string length = 13)
  1704. my-user-agent
  1705. 0x00 (literal header with incremental indexing, new name)
  1706. 0x0B (header field name string length = 11)
  1707. mynewheader
  1708. 0x05 (header field value string length = 5)
  1709. first
  1710. </artwork></figure>
  1711. The header table is as follows after the processing of
  1712. these header fields:
  1713. <figure><artwork type="inline">
  1714. Header table
  1715. +---------+----------------+---------------------------+
  1716. | Index | Header Name | Header Value |
  1717. +---------+----------------+---------------------------+
  1718. | 0 | mynewheader | first | added header
  1719. +---------+----------------+---------------------------+
  1720. | 1 | user-agent | my-user-agent | added header
  1721. +---------+----------------+---------------------------+
  1722. | 2 | :path | /my-example/index.html | added header
  1723. +---------+----------------+---------------------------+
  1724. | 3 | :scheme | http |
  1725. +---------+----------------+---------------------------+
  1726. | 4 | :scheme | https |
  1727. +---------+----------------+---------------------------+
  1728. | ... | ... | ... |
  1729. +---------+----------------+---------------------------+
  1730. | 32 | via | |
  1731. +---------+----------------+---------------------------+
  1732. </artwork></figure>
  1733. As all the header fields in the first header set are
  1734. indexed in the header table, all are kept in the reference
  1735. set of header fields, which is:
  1736. <figure><artwork type="inline">
  1737. Reference Set:
  1738. :path, /my-example/index.html
  1739. user-agent, my-user-agent
  1740. mynewheader, first
  1741. </artwork></figure>
  1742. </t>
  1743. </section>
  1744. <section title="Second header set">
  1745. <t>
  1746. The second header set to represent is the following:
  1747. <figure><artwork type="message/http">
  1748. :path, /my-example/resources/script.js
  1749. user-agent, my-user-agent
  1750. mynewheader, second
  1751. </artwork></figure>
  1752. Comparing this second header set to the reference set, the
  1753. first and third header fields are from the reference set
  1754. are not present in this second header set and must be
  1755. removed. In addition, in this new set, the first and third
  1756. header fields have to be encoded. The path header field
  1757. is represented as a literal header field without indexing.
  1758. The mynewheader will be represented as a literal header
  1759. field with incremental indexing.
  1760. <figure><artwork type="message/http">
  1761. 0x80 (indexed header, index = 0: removal from reference set)
  1762. 0x82 (indexed header, index = 2: removal from reference set)
  1763. 0x43 (literal header, without indexing, name index = 2)
  1764. 0x1f (header field value string length = 31)
  1765. /my-example/resources/script.js
  1766. 0x01 (literal header, incremental indexing, name index = 0)
  1767. 0x06 (header field value string length = 6)
  1768. second
  1769. </artwork></figure>
  1770. The header table is updated as follow:
  1771. <figure><artwork type="inline">
  1772. Header table
  1773. +---------+----------------+---------------------------+
  1774. | Index | Header Name | Header Value |
  1775. +---------+----------------+---------------------------+
  1776. | 0 | mynewheader | second | added header
  1777. +---------+----------------+---------------------------+
  1778. | 1 | mynewheader | first |
  1779. +---------+----------------+---------------------------+
  1780. | 2 | user-agent | my-user-agent |
  1781. +---------+----------------+---------------------------+
  1782. | 3 | :path | /my-example/index.html |
  1783. +---------+----------------+---------------------------+
  1784. | 4 | :scheme | http |
  1785. +---------+----------------+---------------------------+
  1786. | 5 | :scheme | https |
  1787. +---------+----------------+---------------------------+
  1788. | ... | ... | ... |
  1789. +---------+----------------+---------------------------+
  1790. | 33 | via | |
  1791. +---------+----------------+---------------------------+
  1792. </artwork></figure>
  1793. All the header fields in this second header set are
  1794. indexed in the header table, therefore, all are kept in
  1795. the reference set of header fields, which becomes:
  1796. <figure><artwork type="inline">
  1797. Reference Set:
  1798. :path, /my-example/resources/script.js
  1799. user-agent, my-user-agent
  1800. mynewheader, second
  1801. </artwork></figure>
  1802. </t>
  1803. </section>
  1804. </section>
  1805. </back>
  1806. </rfc>
  1807. <!--
  1808. vim:et:tw=78:sw=4:
  1809. -->