| draft-ietf-quic-qpack-11.txt | draft-ietf-quic-qpack-12.txt | |||
|---|---|---|---|---|
| QUIC C. Krasic | QUIC C. Krasic | |||
| Internet-Draft Netflix | Internet-Draft Netflix | |||
| Intended status: Standards Track M. Bishop | Intended status: Standards Track M. Bishop | |||
| Expires: May 7, 2020 Akamai Technologies | Expires: 25 July 2020 Akamai Technologies | |||
| A. Frindell, Ed. | A. Frindell, Ed. | |||
| November 04, 2019 | 22 January 2020 | |||
| QPACK: Header Compression for HTTP/3 | QPACK: Header Compression for HTTP/3 | |||
| draft-ietf-quic-qpack-11 | draft-ietf-quic-qpack-12 | |||
| Abstract | Abstract | |||
| This specification defines QPACK, a compression format for | This specification defines QPACK, a compression format for | |||
| efficiently representing HTTP header fields, to be used in HTTP/3. | efficiently representing HTTP header fields, to be used in HTTP/3. | |||
| This is a variation of HPACK header compression that seeks to reduce | This is a variation of HPACK header compression that seeks to reduce | |||
| head-of-line blocking. | head-of-line blocking. | |||
| Note to Readers | Note to Readers | |||
| Discussion of this draft takes place on the QUIC working group | Discussion of this draft takes place on the QUIC working group | |||
| mailing list (quic@ietf.org), which is archived at | mailing list (quic@ietf.org), which is archived at | |||
| https://mailarchive.ietf.org/arch/search/?email_list=quic [1]. | https://mailarchive.ietf.org/arch/search/?email_list=quic | |||
| (https://mailarchive.ietf.org/arch/search/?email_list=quic). | ||||
| Working Group information can be found at https://github.com/quicwg | Working Group information can be found at https://github.com/quicwg | |||
| [2]; source code and issues list for this draft can be found at | (https://github.com/quicwg); source code and issues list for this | |||
| https://github.com/quicwg/base-drafts/labels/-qpack [3]. | draft can be found at https://github.com/quicwg/base-drafts/labels/- | |||
| qpack (https://github.com/quicwg/base-drafts/labels/-qpack). | ||||
| Status of This Memo | Status of This Memo | |||
| This Internet-Draft is submitted in full conformance with the | This Internet-Draft is submitted in full conformance with the | |||
| provisions of BCP 78 and BCP 79. | provisions of BCP 78 and BCP 79. | |||
| Internet-Drafts are working documents of the Internet Engineering | Internet-Drafts are working documents of the Internet Engineering | |||
| Task Force (IETF). Note that other groups may also distribute | Task Force (IETF). Note that other groups may also distribute | |||
| working documents as Internet-Drafts. The list of current Internet- | working documents as Internet-Drafts. The list of current Internet- | |||
| Drafts is at https://datatracker.ietf.org/drafts/current/. | Drafts is at https://datatracker.ietf.org/drafts/current/. | |||
| Internet-Drafts are draft documents valid for a maximum of six months | Internet-Drafts are draft documents valid for a maximum of six months | |||
| and may be updated, replaced, or obsoleted by other documents at any | and may be updated, replaced, or obsoleted by other documents at any | |||
| time. It is inappropriate to use Internet-Drafts as reference | time. It is inappropriate to use Internet-Drafts as reference | |||
| material or to cite them other than as "work in progress." | material or to cite them other than as "work in progress." | |||
| This Internet-Draft will expire on May 7, 2020. | This Internet-Draft will expire on 25 July 2020. | |||
| Copyright Notice | Copyright Notice | |||
| Copyright (c) 2019 IETF Trust and the persons identified as the | Copyright (c) 2020 IETF Trust and the persons identified as the | |||
| document authors. All rights reserved. | document authors. All rights reserved. | |||
| This document is subject to BCP 78 and the IETF Trust's Legal | This document is subject to BCP 78 and the IETF Trust's Legal | |||
| Provisions Relating to IETF Documents | Provisions Relating to IETF Documents (https://trustee.ietf.org/ | |||
| (https://trustee.ietf.org/license-info) in effect on the date of | license-info) in effect on the date of publication of this document. | |||
| publication of this document. Please review these documents | Please review these documents carefully, as they describe your rights | |||
| carefully, as they describe your rights and restrictions with respect | and restrictions with respect to this document. Code Components | |||
| to this document. Code Components extracted from this document must | extracted from this document must include Simplified BSD License text | |||
| include Simplified BSD License text as described in Section 4.e of | as described in Section 4.e of the Trust Legal Provisions and are | |||
| the Trust Legal Provisions and are provided without warranty as | provided without warranty as described in the Simplified BSD License. | |||
| described in the Simplified BSD License. | ||||
| Table of Contents | Table of Contents | |||
| 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 | 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 | |||
| 1.1. Conventions and Definitions . . . . . . . . . . . . . . . 4 | 1.1. Conventions and Definitions . . . . . . . . . . . . . . . 4 | |||
| 1.2. Notational Conventions . . . . . . . . . . . . . . . . . 4 | 1.2. Notational Conventions . . . . . . . . . . . . . . . . . 4 | |||
| 2. Compression Process Overview . . . . . . . . . . . . . . . . 5 | 2. Compression Process Overview . . . . . . . . . . . . . . . . 5 | |||
| 2.1. Encoder . . . . . . . . . . . . . . . . . . . . . . . . . 5 | 2.1. Encoder . . . . . . . . . . . . . . . . . . . . . . . . . 5 | |||
| 2.1.1. Reference Tracking . . . . . . . . . . . . . . . . . 5 | 2.1.1. Reference Tracking . . . . . . . . . . . . . . . . . 6 | |||
| 2.1.2. Blocked Dynamic Table Insertions . . . . . . . . . . 6 | 2.1.2. Limits on Dynamic Table Insertions . . . . . . . . . 6 | |||
| 2.1.3. Blocked Streams . . . . . . . . . . . . . . . . . . . 7 | 2.1.3. Blocked Streams . . . . . . . . . . . . . . . . . . . 7 | |||
| 2.1.4. Known Received Count . . . . . . . . . . . . . . . . 8 | 2.1.4. Known Received Count . . . . . . . . . . . . . . . . 8 | |||
| 2.2. Decoder . . . . . . . . . . . . . . . . . . . . . . . . . 8 | 2.2. Decoder . . . . . . . . . . . . . . . . . . . . . . . . . 8 | |||
| 2.2.1. Blocked Decoding . . . . . . . . . . . . . . . . . . 8 | 2.2.1. Blocked Decoding . . . . . . . . . . . . . . . . . . 8 | |||
| 2.2.2. State Synchronization . . . . . . . . . . . . . . . . 9 | 2.2.2. State Synchronization . . . . . . . . . . . . . . . . 9 | |||
| 2.2.3. Invalid References . . . . . . . . . . . . . . . . . 10 | 2.2.3. Invalid References . . . . . . . . . . . . . . . . . 10 | |||
| 3. Header Tables . . . . . . . . . . . . . . . . . . . . . . . . 10 | 3. Header Tables . . . . . . . . . . . . . . . . . . . . . . . . 10 | |||
| 3.1. Static Table . . . . . . . . . . . . . . . . . . . . . . 10 | 3.1. Static Table . . . . . . . . . . . . . . . . . . . . . . 10 | |||
| 3.2. Dynamic Table . . . . . . . . . . . . . . . . . . . . . . 11 | 3.2. Dynamic Table . . . . . . . . . . . . . . . . . . . . . . 11 | |||
| 3.2.1. Dynamic Table Size . . . . . . . . . . . . . . . . . 11 | 3.2.1. Dynamic Table Size . . . . . . . . . . . . . . . . . 11 | |||
| 3.2.2. Dynamic Table Capacity and Eviction . . . . . . . . . 11 | 3.2.2. Dynamic Table Capacity and Eviction . . . . . . . . . 11 | |||
| 3.2.3. Maximum Dynamic Table Capacity . . . . . . . . . . . 12 | 3.2.3. Maximum Dynamic Table Capacity . . . . . . . . . . . 12 | |||
| 3.2.4. Absolute Indexing . . . . . . . . . . . . . . . . . . 12 | 3.2.4. Absolute Indexing . . . . . . . . . . . . . . . . . . 12 | |||
| 3.2.5. Relative Indexing . . . . . . . . . . . . . . . . . . 12 | 3.2.5. Relative Indexing . . . . . . . . . . . . . . . . . . 12 | |||
| 3.2.6. Post-Base Indexing . . . . . . . . . . . . . . . . . 13 | 3.2.6. Post-Base Indexing . . . . . . . . . . . . . . . . . 14 | |||
| 4. Wire Format . . . . . . . . . . . . . . . . . . . . . . . . . 14 | 4. Wire Format . . . . . . . . . . . . . . . . . . . . . . . . . 14 | |||
| 4.1. Primitives . . . . . . . . . . . . . . . . . . . . . . . 14 | 4.1. Primitives . . . . . . . . . . . . . . . . . . . . . . . 14 | |||
| 4.1.1. Prefixed Integers . . . . . . . . . . . . . . . . . . 14 | 4.1.1. Prefixed Integers . . . . . . . . . . . . . . . . . . 14 | |||
| 4.1.2. String Literals . . . . . . . . . . . . . . . . . . . 14 | 4.1.2. String Literals . . . . . . . . . . . . . . . . . . . 14 | |||
| 4.2. Encoder and Decoder Streams . . . . . . . . . . . . . . . 15 | 4.2. Encoder and Decoder Streams . . . . . . . . . . . . . . . 15 | |||
| 4.3. Encoder Instructions . . . . . . . . . . . . . . . . . . 15 | 4.3. Encoder Instructions . . . . . . . . . . . . . . . . . . 16 | |||
| 4.3.1. Set Dynamic Table Capacity . . . . . . . . . . . . . 16 | 4.3.1. Set Dynamic Table Capacity . . . . . . . . . . . . . 16 | |||
| 4.3.2. Insert With Name Reference . . . . . . . . . . . . . 16 | 4.3.2. Insert With Name Reference . . . . . . . . . . . . . 16 | |||
| 4.3.3. Insert Without Name Reference . . . . . . . . . . . . 17 | 4.3.3. Insert Without Name Reference . . . . . . . . . . . . 17 | |||
| 4.3.4. Duplicate . . . . . . . . . . . . . . . . . . . . . . 17 | 4.3.4. Duplicate . . . . . . . . . . . . . . . . . . . . . . 17 | |||
| 4.4. Decoder Instructions . . . . . . . . . . . . . . . . . . 18 | 4.4. Decoder Instructions . . . . . . . . . . . . . . . . . . 18 | |||
| 4.4.1. Header Acknowledgement . . . . . . . . . . . . . . . 18 | 4.4.1. Header Acknowledgement . . . . . . . . . . . . . . . 18 | |||
| 4.4.2. Stream Cancellation . . . . . . . . . . . . . . . . . 18 | 4.4.2. Stream Cancellation . . . . . . . . . . . . . . . . . 19 | |||
| 4.4.3. Insert Count Increment . . . . . . . . . . . . . . . 19 | 4.4.3. Insert Count Increment . . . . . . . . . . . . . . . 19 | |||
| 4.5. Header Block Representations . . . . . . . . . . . . . . 19 | 4.5. Header Block Representations . . . . . . . . . . . . . . 19 | |||
| 4.5.1. Header Block Prefix . . . . . . . . . . . . . . . . . 19 | 4.5.1. Header Block Prefix . . . . . . . . . . . . . . . . . 20 | |||
| 4.5.2. Indexed Header Field . . . . . . . . . . . . . . . . 22 | 4.5.2. Indexed Header Field . . . . . . . . . . . . . . . . 22 | |||
| 4.5.3. Indexed Header Field With Post-Base Index . . . . . . 22 | 4.5.3. Indexed Header Field With Post-Base Index . . . . . . 23 | |||
| 4.5.4. Literal Header Field With Name Reference . . . . . . 23 | 4.5.4. Literal Header Field With Name Reference . . . . . . 23 | |||
| 4.5.5. Literal Header Field With Post-Base Name Reference . 24 | 4.5.5. Literal Header Field With Post-Base Name Reference . 24 | |||
| 4.5.6. Literal Header Field Without Name Reference . . . . . 24 | 4.5.6. Literal Header Field Without Name Reference . . . . . 24 | |||
| 5. Configuration . . . . . . . . . . . . . . . . . . . . . . . . 25 | 5. Configuration . . . . . . . . . . . . . . . . . . . . . . . . 25 | |||
| 6. Error Handling . . . . . . . . . . . . . . . . . . . . . . . 25 | 6. Error Handling . . . . . . . . . . . . . . . . . . . . . . . 25 | |||
| 7. Security Considerations . . . . . . . . . . . . . . . . . . . 26 | 7. Security Considerations . . . . . . . . . . . . . . . . . . . 26 | |||
| 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 26 | 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 26 | |||
| 8.1. Settings Registration . . . . . . . . . . . . . . . . . . 26 | 8.1. Settings Registration . . . . . . . . . . . . . . . . . . 26 | |||
| 8.2. Stream Type Registration . . . . . . . . . . . . . . . . 26 | 8.2. Stream Type Registration . . . . . . . . . . . . . . . . 26 | |||
| 8.3. Error Code Registration . . . . . . . . . . . . . . . . . 27 | 8.3. Error Code Registration . . . . . . . . . . . . . . . . . 27 | |||
| 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 27 | 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 27 | |||
| 9.1. Normative References . . . . . . . . . . . . . . . . . . 27 | 9.1. Normative References . . . . . . . . . . . . . . . . . . 27 | |||
| 9.2. Informative References . . . . . . . . . . . . . . . . . 28 | 9.2. Informative References . . . . . . . . . . . . . . . . . 28 | |||
| 9.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 28 | ||||
| Appendix A. Static Table . . . . . . . . . . . . . . . . . . . . 28 | Appendix A. Static Table . . . . . . . . . . . . . . . . . . . . 28 | |||
| Appendix B. Sample One Pass Encoding Algorithm . . . . . . . . . 33 | Appendix B. Sample One Pass Encoding Algorithm . . . . . . . . . 32 | |||
| Appendix C. Change Log . . . . . . . . . . . . . . . . . . . . . 35 | Appendix C. Change Log . . . . . . . . . . . . . . . . . . . . . 33 | |||
| C.1. Since draft-ietf-quic-qpack-10 . . . . . . . . . . . . . 35 | C.1. Since draft-ietf-quic-qpack-11 . . . . . . . . . . . . . 34 | |||
| C.2. Since draft-ietf-quic-qpack-09 . . . . . . . . . . . . . 35 | C.2. Since draft-ietf-quic-qpack-10 . . . . . . . . . . . . . 34 | |||
| C.3. Since draft-ietf-quic-qpack-08 . . . . . . . . . . . . . 35 | C.3. Since draft-ietf-quic-qpack-09 . . . . . . . . . . . . . 34 | |||
| C.4. Since draft-ietf-quic-qpack-06 . . . . . . . . . . . . . 35 | C.4. Since draft-ietf-quic-qpack-08 . . . . . . . . . . . . . 34 | |||
| C.5. Since draft-ietf-quic-qpack-05 . . . . . . . . . . . . . 35 | C.5. Since draft-ietf-quic-qpack-06 . . . . . . . . . . . . . 34 | |||
| C.6. Since draft-ietf-quic-qpack-04 . . . . . . . . . . . . . 35 | C.6. Since draft-ietf-quic-qpack-05 . . . . . . . . . . . . . 34 | |||
| C.7. Since draft-ietf-quic-qpack-03 . . . . . . . . . . . . . 35 | C.7. Since draft-ietf-quic-qpack-04 . . . . . . . . . . . . . 34 | |||
| C.8. Since draft-ietf-quic-qpack-02 . . . . . . . . . . . . . 36 | C.8. Since draft-ietf-quic-qpack-03 . . . . . . . . . . . . . 34 | |||
| C.9. Since draft-ietf-quic-qpack-01 . . . . . . . . . . . . . 36 | C.9. Since draft-ietf-quic-qpack-02 . . . . . . . . . . . . . 35 | |||
| C.10. Since draft-ietf-quic-qpack-00 . . . . . . . . . . . . . 36 | C.10. Since draft-ietf-quic-qpack-01 . . . . . . . . . . . . . 35 | |||
| C.11. Since draft-ietf-quic-qcram-00 . . . . . . . . . . . . . 36 | C.11. Since draft-ietf-quic-qpack-00 . . . . . . . . . . . . . 35 | |||
| Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 37 | C.12. Since draft-ietf-quic-qcram-00 . . . . . . . . . . . . . 35 | |||
| Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 37 | Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 36 | |||
| Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 36 | ||||
| 1. Introduction | 1. Introduction | |||
| The QUIC transport protocol [QUIC-TRANSPORT] is designed to support | The QUIC transport protocol [QUIC-TRANSPORT] is designed to support | |||
| HTTP semantics, and its design subsumes many of the features of | HTTP semantics, and its design subsumes many of the features of | |||
| HTTP/2 [RFC7540]. HTTP/2 uses HPACK [RFC7541] for header | HTTP/2 [RFC7540]. HTTP/2 uses HPACK [RFC7541] for header | |||
| compression. If HPACK were used for HTTP/3 [HTTP3], it would induce | compression. If HPACK were used for HTTP/3 [HTTP3], it would induce | |||
| head-of-line blocking due to built-in assumptions of a total ordering | head-of-line blocking due to built-in assumptions of a total ordering | |||
| across frames on all streams. | across frames on all streams. | |||
| skipping to change at page 5, line 16 ¶ | skipping to change at page 5, line 16 ¶ | |||
| x (A+) Indicates that x uses the prefixed integer encoding defined | x (A+) Indicates that x uses the prefixed integer encoding defined | |||
| in Section 4.1.1, beginning with an A-bit prefix. | in Section 4.1.1, beginning with an A-bit prefix. | |||
| x ... Indicates that x is variable-length and extends to the end of | x ... Indicates that x is variable-length and extends to the end of | |||
| the region. | the region. | |||
| 2. Compression Process Overview | 2. Compression Process Overview | |||
| Like HPACK, QPACK uses two tables for associating header fields to | Like HPACK, QPACK uses two tables for associating header fields to | |||
| indices. The static table (see Section 3.1) is predefined and | indices. The static table (Section 3.1) is predefined and contains | |||
| contains common header fields (some of them with an empty value). | common header fields (some of them with an empty value). The dynamic | |||
| The dynamic table (see Section 3.2) is built up over the course of | table (Section 3.2) is built up over the course of the connection and | |||
| the connection and can be used by the encoder to index header fields | can be used by the encoder to index header fields in the encoded | |||
| in the encoded header lists. | header lists. | |||
| QPACK defines unidirectional streams for sending instructions from | QPACK defines unidirectional streams for sending instructions from | |||
| encoder to decoder and vice versa. | encoder to decoder and vice versa. | |||
| 2.1. Encoder | 2.1. Encoder | |||
| An encoder converts a header list into a header block by emitting | An encoder converts a header list into a header block by emitting | |||
| either an indexed or a literal representation for each header field | either an indexed or a literal representation for each header field | |||
| in the list (see Section 4.5). Indexed representations achieve high | in the list; see Section 4.5. Indexed representations achieve high | |||
| compression by replacing the literal name and possibly the value with | compression by replacing the literal name and possibly the value with | |||
| an index to either the static or dynamic table. References to the | an index to either the static or dynamic table. References to the | |||
| static table and literal representations do not require any dynamic | static table and literal representations do not require any dynamic | |||
| state and never risk head-of-line blocking. References to the | state and never risk head-of-line blocking. References to the | |||
| dynamic table risk head-of-line blocking if the encoder has not | dynamic table risk head-of-line blocking if the encoder has not | |||
| received an acknowledgement indicating the entry is available at the | received an acknowledgement indicating the entry is available at the | |||
| decoder. | decoder. | |||
| An encoder MAY insert any entry in the dynamic table it chooses; it | An encoder MAY insert any entry in the dynamic table it chooses; it | |||
| is not limited to header fields it is compressing. | is not limited to header fields it is compressing. | |||
| skipping to change at page 6, line 5 ¶ | skipping to change at page 6, line 11 ¶ | |||
| QPACK is designed to contain the more complex state tracking to the | QPACK is designed to contain the more complex state tracking to the | |||
| encoder, while the decoder is relatively simple. | encoder, while the decoder is relatively simple. | |||
| 2.1.1. Reference Tracking | 2.1.1. Reference Tracking | |||
| An encoder MUST ensure that a header block which references a dynamic | An encoder MUST ensure that a header block which references a dynamic | |||
| table entry is not processed by the decoder after the referenced | table entry is not processed by the decoder after the referenced | |||
| entry has been evicted. Hence the encoder needs to retain | entry has been evicted. Hence the encoder needs to retain | |||
| information about each compressed header block that references the | information about each compressed header block that references the | |||
| dynamic table until that header block is acknowledged by the decoder | dynamic table until that header block is acknowledged by the decoder; | |||
| (see Section 4.4.1). | see Section 4.4.1. | |||
| 2.1.2. Blocked Dynamic Table Insertions | 2.1.2. Limits on Dynamic Table Insertions | |||
| A dynamic table entry is considered blocking and cannot be evicted | Inserting entries into the dynamic table might not be possible if the | |||
| until its insertion has been acknowledged and there are no | table contains entries which cannot be evicted. | |||
| outstanding unacknowledged references to the entry. In particular, a | ||||
| dynamic table entry that has never been referenced can still be | ||||
| blocking. | ||||
| An encoder MUST NOT insert an entry into the dynamic table (or | A dynamic table entry cannot be evicted immediately after insertion, | |||
| duplicate an existing entry) if doing so would evict a blocking | even if it has never been referenced. Once the insertion of a | |||
| entry. In order to avoid this, an encoder that uses the dynamic | dynamic table entry has been acknowledged and there are no | |||
| table has to keep track of blocking entries. | outstanding unacknowledged references to the entry, the entry becomes | |||
| evictable. | ||||
| Note: A blocking entry is unrelated to a blocked stream, see | If the dynamic table does not contain enough room for a new entry | |||
| Section 2.1.3. | without evicting other entries, and the entries which would be | |||
| evicted are not evictable, the encoder MUST NOT insert that entry | ||||
| into the dynamic table (including duplicates of existing entries). | ||||
| In order to avoid this, an encoder that uses the dynamic table has to | ||||
| keep track of whether each entry is currently evictable or not. | ||||
| 2.1.2.1. Avoiding Blocked Insertions | 2.1.2.1. Avoiding Prohibited Insertions | |||
| To ensure that the encoder is not prevented from adding new entries, | To ensure that the encoder is not prevented from adding new entries, | |||
| the encoder can avoid referencing entries that are close to eviction. | the encoder can avoid referencing entries that are close to eviction. | |||
| Rather than reference such an entry, the encoder can emit a Duplicate | Rather than reference such an entry, the encoder can emit a Duplicate | |||
| instruction (see Section 4.3.4), and reference the duplicate instead. | instruction (Section 4.3.4), and reference the duplicate instead. | |||
| Determining which entries are too close to eviction to reference is | Determining which entries are too close to eviction to reference is | |||
| an encoder preference. One heuristic is to target a fixed amount of | an encoder preference. One heuristic is to target a fixed amount of | |||
| available space in the dynamic table: either unused space or space | available space in the dynamic table: either unused space or space | |||
| that can be reclaimed by evicting non-blocking entries. To achieve | that can be reclaimed by evicting non-blocking entries. To achieve | |||
| this, the encoder can maintain a draining index, which is the | this, the encoder can maintain a draining index, which is the | |||
| smallest absolute index (see Section 3.2.4) in the dynamic table that | smallest absolute index (Section 3.2.4) in the dynamic table that it | |||
| it will emit a reference for. As new entries are inserted, the | will emit a reference for. As new entries are inserted, the encoder | |||
| encoder increases the draining index to maintain the section of the | increases the draining index to maintain the section of the table | |||
| table that it will not reference. If the encoder does not create new | that it will not reference. If the encoder does not create new | |||
| references to entries with an absolute index lower than the draining | references to entries with an absolute index lower than the draining | |||
| index, the number of unacknowledged references to those entries will | index, the number of unacknowledged references to those entries will | |||
| eventually become zero, allowing them to be evicted. | eventually become zero, allowing them to be evicted. | |||
| +----------+---------------------------------+--------+ | +----------+---------------------------------+--------+ | |||
| | Draining | Referenceable | Unused | | | Draining | Referenceable | Unused | | |||
| | Entries | Entries | Space | | | Entries | Entries | Space | | |||
| +----------+---------------------------------+--------+ | +----------+---------------------------------+--------+ | |||
| ^ ^ ^ | ^ ^ ^ | |||
| | | | | | | | | |||
| Dropping Draining Index Insertion Point | Dropping Draining Index Insertion Point | |||
| Point | Point | |||
| Figure 1: Draining Dynamic Table Entries | Figure 1: Draining Dynamic Table Entries | |||
| 2.1.3. Blocked Streams | 2.1.3. Blocked Streams | |||
| Because QUIC does not guarantee order between data on different | Because QUIC does not guarantee order between data on different | |||
| streams, a decoder might encounter a header block that references a | streams, a decoder might encounter a header block that references a | |||
| dynamic table entry that it has not yet received. | dynamic table entry that it has not yet received. | |||
| Each header block contains a Required Insert Count (see | Each header block contains a Required Insert Count (Section 4.5.1), | |||
| Section 4.5.1), the lowest possible value for the Insert Count with | the lowest possible value for the Insert Count with which the header | |||
| which the header block can be decoded. For a header block with | block can be decoded. For a header block with references to the | |||
| references to the dynamic table, the Required Insert Count is one | dynamic table, the Required Insert Count is one larger than the | |||
| larger than the largest absolute index of all referenced dynamic | largest absolute index of all referenced dynamic table entries. For | |||
| table entries. For a header block with no references to the dynamic | a header block with no references to the dynamic table, the Required | |||
| table, the Required Insert Count is zero. | Insert Count is zero. | |||
| When the decoder receives a header block with a Required Insert Count | When the decoder receives a header block with a Required Insert Count | |||
| greater than its own Insert Count, the stream cannot be processed | greater than its own Insert Count, the stream cannot be processed | |||
| immediately, and is considered "blocked" (see Section 2.2.1). | immediately, and is considered "blocked"; see Section 2.2.1. | |||
| The decoder specifies an upper bound on the number of streams which | The decoder specifies an upper bound on the number of streams which | |||
| can be blocked using the SETTINGS_QPACK_BLOCKED_STREAMS setting (see | can be blocked using the SETTINGS_QPACK_BLOCKED_STREAMS setting; see | |||
| Section 5). An encoder MUST limit the number of streams which could | Section 5. An encoder MUST limit the number of streams which could | |||
| become blocked to the value of SETTINGS_QPACK_BLOCKED_STREAMS at all | become blocked to the value of SETTINGS_QPACK_BLOCKED_STREAMS at all | |||
| times. If a decoder encounters more blocked streams than it promised | times. If a decoder encounters more blocked streams than it promised | |||
| to support, it MUST treat this as a connection error of type | to support, it MUST treat this as a connection error of type | |||
| HTTP_QPACK_DECOMPRESSION_FAILED. | HTTP_QPACK_DECOMPRESSION_FAILED. | |||
| Note that the decoder might not become blocked on every stream which | Note that the decoder might not become blocked on every stream which | |||
| risks becoming blocked. | risks becoming blocked. | |||
| An encoder can decide whether to risk having a stream become blocked. | An encoder can decide whether to risk having a stream become blocked. | |||
| If permitted by the value of SETTINGS_QPACK_BLOCKED_STREAMS, | If permitted by the value of SETTINGS_QPACK_BLOCKED_STREAMS, | |||
| skipping to change at page 8, line 14 ¶ | skipping to change at page 8, line 14 ¶ | |||
| result in the encoder becoming blocked on congestion or flow control | result in the encoder becoming blocked on congestion or flow control | |||
| limits. | limits. | |||
| 2.1.4. Known Received Count | 2.1.4. Known Received Count | |||
| The Known Received Count is the total number of dynamic table | The Known Received Count is the total number of dynamic table | |||
| insertions and duplications acknowledged by the decoder. The encoder | insertions and duplications acknowledged by the decoder. The encoder | |||
| tracks the Known Received Count in order to identify which dynamic | tracks the Known Received Count in order to identify which dynamic | |||
| table entries can be referenced without potentially blocking a | table entries can be referenced without potentially blocking a | |||
| stream. The decoder tracks the Known Received Count in order to be | stream. The decoder tracks the Known Received Count in order to be | |||
| able to send Insert Count Increment instructions (see Section 4.4.3). | able to send Insert Count Increment instructions. | |||
| If a header block was potentially blocking, the encoder infers from | A Header Acknowledgement instruction (Section 4.4.1) implies that the | |||
| receiving a Header Acknowledgement instruction (Section 4.4.1) that | decoder has received all dynamic table state necessary to process | |||
| the decoder has received all dynamic table state necessary to process | corresponding the header block. If the Required Insert Count of the | |||
| that header block. If the Required Insert Count of the acknowledged | acknowledged header block is greater than the current Known Received | |||
| header block is greater than the current Known Received Count, the | Count, Known Received Count is updated to the value of the Required | |||
| encoder updates the Known Received Count to the value of the Required | Insert Count. | |||
| Insert Count of the acknowledged header block. | ||||
| To acknowledge dynamic table entries which are not referenced by | An Insert Count Increment instruction Section 4.4.3 increases the | |||
| header blocks, for example because the encoder or the decoder have | Known Received Count by its Increment parameter. See Section 2.2.2.3 | |||
| chosen not to risk blocked streams, the decoder sends an Insert Count | for guidance. | |||
| Increment instruction (see Section 4.4.3). | ||||
| 2.2. Decoder | 2.2. Decoder | |||
| As in HPACK, the decoder processes header blocks and emits the | As in HPACK, the decoder processes header blocks and emits the | |||
| corresponding header lists. It also processes instructions received | corresponding header lists. It also processes instructions received | |||
| on the encoder stream that modify the dynamic table. Note that | on the encoder stream that modify the dynamic table. Note that | |||
| header blocks and encoder stream instructions arrive on separate | header blocks and encoder stream instructions arrive on separate | |||
| streams. This is unlike HPACK, where header blocks can contain | streams. This is unlike HPACK, where header blocks can contain | |||
| instructions that modify the dynamic table, and there is no dedicated | instructions that modify the dynamic table, and there is no dedicated | |||
| stream of HPACK instructions. | stream of HPACK instructions. | |||
| skipping to change at page 9, line 11 ¶ | skipping to change at page 9, line 10 ¶ | |||
| While blocked, header block data SHOULD remain in the blocked | While blocked, header block data SHOULD remain in the blocked | |||
| stream's flow control window. A stream becomes unblocked when the | stream's flow control window. A stream becomes unblocked when the | |||
| Insert Count becomes greater than or equal to the Required Insert | Insert Count becomes greater than or equal to the Required Insert | |||
| Count for all header blocks the decoder has started reading from the | Count for all header blocks the decoder has started reading from the | |||
| stream. | stream. | |||
| When processing header blocks, the decoder expects the Required | When processing header blocks, the decoder expects the Required | |||
| Insert Count to exactly match the value defined in Section 2.1.3. If | Insert Count to exactly match the value defined in Section 2.1.3. If | |||
| it encounters a smaller value than expected, it MUST treat this as a | it encounters a smaller value than expected, it MUST treat this as a | |||
| connection error of type HTTP_QPACK_DECOMPRESSION_FAILED (see | connection error of type HTTP_QPACK_DECOMPRESSION_FAILED; see | |||
| Section 2.2.3). If it encounters a larger value than expected, it | Section 2.2.3. If it encounters a larger value than expected, it MAY | |||
| MAY treat this as a connection error of type | treat this as a connection error of type | |||
| HTTP_QPACK_DECOMPRESSION_FAILED. | HTTP_QPACK_DECOMPRESSION_FAILED. | |||
| 2.2.2. State Synchronization | 2.2.2. State Synchronization | |||
| The decoder signals the following events by emitting decoder | The decoder signals the following events by emitting decoder | |||
| instructions (Section 4.4) on the decoder stream. | instructions (Section 4.4) on the decoder stream. | |||
| 2.2.2.1. Completed Processing of a Header Block | 2.2.2.1. Completed Processing of a Header Block | |||
| After the decoder finishes decoding a header block containing dynamic | After the decoder finishes decoding a header block containing dynamic | |||
| skipping to change at page 9, line 36 ¶ | skipping to change at page 9, line 35 ¶ | |||
| case of intermediate responses, trailers, and pushed requests. The | case of intermediate responses, trailers, and pushed requests. The | |||
| encoder interprets each Header Acknowledgement instruction as | encoder interprets each Header Acknowledgement instruction as | |||
| acknowledging the earliest unacknowledged header block containing | acknowledging the earliest unacknowledged header block containing | |||
| dynamic table references sent on the given stream. | dynamic table references sent on the given stream. | |||
| 2.2.2.2. Abandonment of a Stream | 2.2.2.2. Abandonment of a Stream | |||
| When an endpoint receives a stream reset before the end of a stream | When an endpoint receives a stream reset before the end of a stream | |||
| or before all header blocks are processed on that stream, or when it | or before all header blocks are processed on that stream, or when it | |||
| abandons reading of a stream, it generates a Stream Cancellation | abandons reading of a stream, it generates a Stream Cancellation | |||
| instruction (see Section 4.4.2). This signals to the encoder that | instruction; see Section 4.4.2. This signals to the encoder that all | |||
| all references to the dynamic table on that stream are no longer | references to the dynamic table on that stream are no longer | |||
| outstanding. A decoder with a maximum dynamic table capacity equal | outstanding. A decoder with a maximum dynamic table capacity | |||
| to zero (see Section 3.2.3) MAY omit sending Stream Cancellations, | (Section 3.2.3) equal to zero MAY omit sending Stream Cancellations, | |||
| because the encoder cannot have any dynamic table references. An | because the encoder cannot have any dynamic table references. An | |||
| encoder cannot infer from this instruction that any updates to the | encoder cannot infer from this instruction that any updates to the | |||
| dynamic table have been received. | dynamic table have been received. | |||
| The Header Acknowledgement and Stream Cancellation instructions | The Header Acknowledgement and Stream Cancellation instructions | |||
| permit the encoder to remove references to entries in the dynamic | permit the encoder to remove references to entries in the dynamic | |||
| table. When an entry with absolute index lower than the Known | table. When an entry with absolute index lower than the Known | |||
| Received Count has zero references, then it is no longer considered | Received Count has zero references, then it is considered evictable; | |||
| blocking (see Section 2.1.2). | see Section 2.1.2. | |||
| 2.2.2.3. New Table Entries | 2.2.2.3. New Table Entries | |||
| After receiving new table entries on the encoder stream, the decoder | After receiving new table entries on the encoder stream, the decoder | |||
| chooses when to emit Insert Count Increment instructions (see | chooses when to emit Insert Count Increment instructions; see | |||
| Section 4.4.3). Emitting this instruction after adding each new | Section 4.4.3. Emitting this instruction after adding each new | |||
| dynamic table entry will provide the timeliest feedback to the | dynamic table entry will provide the timeliest feedback to the | |||
| encoder, but could be redundant with other decoder feedback. By | encoder, but could be redundant with other decoder feedback. By | |||
| delaying an Insert Count Increment instruction, the decoder might be | delaying an Insert Count Increment instruction, the decoder might be | |||
| able to coalesce multiple Insert Count Increment instructions, or | able to coalesce multiple Insert Count Increment instructions, or | |||
| replace them entirely with Header Acknowledgements (see | replace them entirely with Header Acknowledgements; see | |||
| Section 4.4.1). However, delaying too long may lead to compression | Section 4.4.1. However, delaying too long may lead to compression | |||
| inefficiencies if the encoder waits for an entry to be acknowledged | inefficiencies if the encoder waits for an entry to be acknowledged | |||
| before using it. | before using it. | |||
| 2.2.3. Invalid References | 2.2.3. Invalid References | |||
| If the decoder encounters a reference in a header block | If the decoder encounters a reference in a header block | |||
| representation to a dynamic table entry which has already been | representation to a dynamic table entry which has already been | |||
| evicted or which has an absolute index greater than or equal to the | evicted or which has an absolute index greater than or equal to the | |||
| declared Required Insert Count (see Section 4.5.1), it MUST treat | declared Required Insert Count (Section 4.5.1), it MUST treat this as | |||
| this as a connection error of type "HTTP_QPACK_DECOMPRESSION_FAILED". | a connection error of type "HTTP_QPACK_DECOMPRESSION_FAILED". | |||
| If the decoder encounters a reference in an encoder instruction to a | If the decoder encounters a reference in an encoder instruction to a | |||
| dynamic table entry which has already been evicted, it MUST treat | dynamic table entry which has already been evicted, it MUST treat | |||
| this as a connection error of type "HTTP_QPACK_ENCODER_STREAM_ERROR". | this as a connection error of type "HTTP_QPACK_ENCODER_STREAM_ERROR". | |||
| 3. Header Tables | 3. Header Tables | |||
| Unlike in HPACK, entries in the QPACK static and dynamic tables are | Unlike in HPACK, entries in the QPACK static and dynamic tables are | |||
| addressed separately. The following sections describe how entries in | addressed separately. The following sections describe how entries in | |||
| each table are addressed. | each table are addressed. | |||
| skipping to change at page 11, line 12 ¶ | skipping to change at page 11, line 12 ¶ | |||
| block representation it MUST treat this as a connection error of type | block representation it MUST treat this as a connection error of type | |||
| "HTTP_QPACK_DECOMPRESSION_FAILED". If this index is received on the | "HTTP_QPACK_DECOMPRESSION_FAILED". If this index is received on the | |||
| encoder stream, this MUST be treated as a connection error of type | encoder stream, this MUST be treated as a connection error of type | |||
| "HTTP_QPACK_ENCODER_STREAM_ERROR". | "HTTP_QPACK_ENCODER_STREAM_ERROR". | |||
| 3.2. Dynamic Table | 3.2. Dynamic Table | |||
| The dynamic table consists of a list of header fields maintained in | The dynamic table consists of a list of header fields maintained in | |||
| first-in, first-out order. Each HTTP/3 endpoint holds a dynamic | first-in, first-out order. Each HTTP/3 endpoint holds a dynamic | |||
| table that is initially empty. Entries are added by encoder | table that is initially empty. Entries are added by encoder | |||
| instructions received on the encoder stream (see Section 4.3). | instructions received on the encoder stream; see Section 4.3. | |||
| The dynamic table can contain duplicate entries (i.e., entries with | The dynamic table can contain duplicate entries (i.e., entries with | |||
| the same name and same value). Therefore, duplicate entries MUST NOT | the same name and same value). Therefore, duplicate entries MUST NOT | |||
| be treated as an error by the decoder. | be treated as an error by the decoder. | |||
| Dynamic table entries can have empty values. | Dynamic table entries can have empty values. | |||
| 3.2.1. Dynamic Table Size | 3.2.1. Dynamic Table Size | |||
| The size of the dynamic table is the sum of the size of its entries. | The size of the dynamic table is the sum of the size of its entries. | |||
| skipping to change at page 11, line 40 ¶ | skipping to change at page 11, line 40 ¶ | |||
| The encoder sets the capacity of the dynamic table, which serves as | The encoder sets the capacity of the dynamic table, which serves as | |||
| the upper limit on its size. The initial capacity of the dynamic | the upper limit on its size. The initial capacity of the dynamic | |||
| table is zero. The encoder sends a Set Dynamic Table Capacity | table is zero. The encoder sends a Set Dynamic Table Capacity | |||
| instruction (Section 4.3.1) with a non-zero capacity to begin using | instruction (Section 4.3.1) with a non-zero capacity to begin using | |||
| the dynamic table. | the dynamic table. | |||
| Before a new entry is added to the dynamic table, entries are evicted | Before a new entry is added to the dynamic table, entries are evicted | |||
| from the end of the dynamic table until the size of the dynamic table | from the end of the dynamic table until the size of the dynamic table | |||
| is less than or equal to (table capacity - size of new entry). The | is less than or equal to (table capacity - size of new entry). The | |||
| encoder MUST NOT cause a blocking dynamic table entry to be evicted | encoder MUST NOT cause a dynamic table entry to be evicted unless | |||
| (see Section 2.1.2). The new entry is then added to the table. It | that entry is evictable; see Section 2.1.2. The new entry is then | |||
| is an error if the encoder attempts to add an entry that is larger | added to the table. It is an error if the encoder attempts to add an | |||
| than the dynamic table capacity; the decoder MUST treat this as a | entry that is larger than the dynamic table capacity; the decoder | |||
| connection error of type "HTTP_QPACK_ENCODER_STREAM_ERROR". | MUST treat this as a connection error of type | |||
| "HTTP_QPACK_ENCODER_STREAM_ERROR". | ||||
| A new entry can reference an entry in the dynamic table that will be | A new entry can reference an entry in the dynamic table that will be | |||
| evicted when adding this new entry into the dynamic table. | evicted when adding this new entry into the dynamic table. | |||
| Implementations are cautioned to avoid deleting the referenced name | Implementations are cautioned to avoid deleting the referenced name | |||
| or value if the referenced entry is evicted from the dynamic table | or value if the referenced entry is evicted from the dynamic table | |||
| prior to inserting the new entry. | prior to inserting the new entry. | |||
| Whenever the dynamic table capacity is reduced by the encoder (see | Whenever the dynamic table capacity is reduced by the encoder | |||
| Section 4.3.1), entries are evicted from the end of the dynamic table | (Section 4.3.1), entries are evicted from the end of the dynamic | |||
| until the size of the dynamic table is less than or equal to the new | table until the size of the dynamic table is less than or equal to | |||
| table capacity. This mechanism can be used to completely clear | the new table capacity. This mechanism can be used to completely | |||
| entries from the dynamic table by setting a capacity of 0, which can | clear entries from the dynamic table by setting a capacity of 0, | |||
| subsequently be restored. | which can subsequently be restored. | |||
| 3.2.3. Maximum Dynamic Table Capacity | 3.2.3. Maximum Dynamic Table Capacity | |||
| To bound the memory requirements of the decoder, the decoder limits | To bound the memory requirements of the decoder, the decoder limits | |||
| the maximum value the encoder is permitted to set for the dynamic | the maximum value the encoder is permitted to set for the dynamic | |||
| table capacity. In HTTP/3, this limit is determined by the value of | table capacity. In HTTP/3, this limit is determined by the value of | |||
| SETTINGS_QPACK_MAX_TABLE_CAPACITY sent by the decoder (see | SETTINGS_QPACK_MAX_TABLE_CAPACITY sent by the decoder; see Section 5. | |||
| Section 5). The encoder MUST not set a dynamic table capacity that | The encoder MUST not set a dynamic table capacity that exceeds this | |||
| exceeds this maximum, but it can choose to use a lower dynamic table | maximum, but it can choose to use a lower dynamic table capacity; see | |||
| capacity (see Section 4.3.1). | Section 4.3.1. | |||
| For clients using 0-RTT data in HTTP/3, the server's maximum table | For clients using 0-RTT data in HTTP/3, the server's maximum table | |||
| capacity is the remembered value of the setting, or zero if the value | capacity is the remembered value of the setting, or zero if the value | |||
| was not previously sent. When the client's 0-RTT value of the | was not previously sent. When the client's 0-RTT value of the | |||
| SETTING is zero, the server MAY set it to a non-zero value in its | SETTING is zero, the server MAY set it to a non-zero value in its | |||
| SETTINGS frame. If the remembered value is non-zero, the server MUST | SETTINGS frame. If the remembered value is non-zero, the server MUST | |||
| send the same non-zero value in its SETTINGS frame. If it specifies | send the same non-zero value in its SETTINGS frame. If it specifies | |||
| any other value, or omits SETTINGS_QPACK_MAX_TABLE_CAPACITY from | any other value, or omits SETTINGS_QPACK_MAX_TABLE_CAPACITY from | |||
| SETTINGS, the encoder must treat this as a connection error of type | SETTINGS, the encoder must treat this as a connection error of type | |||
| "HTTP_QPACK_DECODER_STREAM_ERROR". | "HTTP_QPACK_DECODER_STREAM_ERROR". | |||
| skipping to change at page 13, line 5 ¶ | skipping to change at page 13, line 5 ¶ | |||
| Each entry possesses an absolute index which is fixed for the | Each entry possesses an absolute index which is fixed for the | |||
| lifetime of that entry. The first entry inserted has an absolute | lifetime of that entry. The first entry inserted has an absolute | |||
| index of "0"; indices increase by one with each insertion. | index of "0"; indices increase by one with each insertion. | |||
| 3.2.5. Relative Indexing | 3.2.5. Relative Indexing | |||
| Relative indices begin at zero and increase in the opposite direction | Relative indices begin at zero and increase in the opposite direction | |||
| from the absolute index. Determining which entry has a relative | from the absolute index. Determining which entry has a relative | |||
| index of "0" depends on the context of the reference. | index of "0" depends on the context of the reference. | |||
| In encoder instructions (see Section 4.3), a relative index of "0" | In encoder instructions (Section 4.3), a relative index of "0" refers | |||
| refers to the most recently inserted value in the dynamic table. | to the most recently inserted value in the dynamic table. Note that | |||
| Note that this means the entry referenced by a given relative index | this means the entry referenced by a given relative index will change | |||
| will change while interpreting instructions on the encoder stream. | while interpreting instructions on the encoder stream. | |||
| +-----+---------------+-------+ | +-----+---------------+-------+ | |||
| | n-1 | ... | d | Absolute Index | | n-1 | ... | d | Absolute Index | |||
| + - - +---------------+ - - - + | + - - +---------------+ - - - + | |||
| | 0 | ... | n-d-1 | Relative Index | | 0 | ... | n-d-1 | Relative Index | |||
| +-----+---------------+-------+ | +-----+---------------+-------+ | |||
| ^ | | ^ | | |||
| | V | | V | |||
| Insertion Point Dropping Point | Insertion Point Dropping Point | |||
| n = count of entries inserted | n = count of entries inserted | |||
| d = count of entries dropped | d = count of entries dropped | |||
| Example Dynamic Table Indexing - Encoder Stream | Figure 2: Example Dynamic Table Indexing - Encoder Stream | |||
| Unlike in encoder instructions, relative indices in header block | Unlike in encoder instructions, relative indices in header block | |||
| representations are relative to the Base at the beginning of the | representations are relative to the Base at the beginning of the | |||
| header block (see Section 4.5.1). This ensures that references are | header block; see Section 4.5.1. This ensures that references are | |||
| stable even if header blocks and dynamic table updates are processed | stable even if header blocks and dynamic table updates are processed | |||
| out of order. | out of order. | |||
| In a header block a relative index of "0" refers to the entry with | In a header block a relative index of "0" refers to the entry with | |||
| absolute index equal to Base - 1. | absolute index equal to Base - 1. | |||
| Base | Base | |||
| | | | | |||
| V | V | |||
| +-----+-----+-----+-----+-------+ | +-----+-----+-----+-----+-------+ | |||
| | n-1 | n-2 | n-3 | ... | d | Absolute Index | | n-1 | n-2 | n-3 | ... | d | Absolute Index | |||
| +-----+-----+ - +-----+ - + | +-----+-----+ - +-----+ - + | |||
| | 0 | ... | n-d-3 | Relative Index | | 0 | ... | n-d-3 | Relative Index | |||
| +-----+-----+-------+ | +-----+-----+-------+ | |||
| n = count of entries inserted | n = count of entries inserted | |||
| d = count of entries dropped | d = count of entries dropped | |||
| In this example, Base = n - 2 | In this example, Base = n - 2 | |||
| Example Dynamic Table Indexing - Relative Index in Header Block | Figure 3: Example Dynamic Table Indexing - Relative Index in | |||
| Header Block | ||||
| 3.2.6. Post-Base Indexing | 3.2.6. Post-Base Indexing | |||
| Post-Base indices are used in header block instructions for entries | Post-Base indices are used in header block instructions for entries | |||
| with absolute indices greater than or equal to Base, starting at 0 | with absolute indices greater than or equal to Base, starting at 0 | |||
| for the entry with absolute index equal to Base, and increasing in | for the entry with absolute index equal to Base, and increasing in | |||
| the same direction as the absolute index. | the same direction as the absolute index. | |||
| Post-Base indices allow an encoder to process a header block in a | Post-Base indices allow an encoder to process a header block in a | |||
| single pass and include references to entries added while processing | single pass and include references to entries added while processing | |||
| skipping to change at page 14, line 24 ¶ | skipping to change at page 14, line 29 ¶ | |||
| +-----+-----+-----+-----+-----+ | +-----+-----+-----+-----+-----+ | |||
| | n-1 | n-2 | n-3 | ... | d | Absolute Index | | n-1 | n-2 | n-3 | ... | d | Absolute Index | |||
| +-----+-----+-----+-----+-----+ | +-----+-----+-----+-----+-----+ | |||
| | 1 | 0 | Post-Base Index | | 1 | 0 | Post-Base Index | |||
| +-----+-----+ | +-----+-----+ | |||
| n = count of entries inserted | n = count of entries inserted | |||
| d = count of entries dropped | d = count of entries dropped | |||
| In this example, Base = n - 2 | In this example, Base = n - 2 | |||
| Example Dynamic Table Indexing - Post-Base Index in Header Block | Figure 4: Example Dynamic Table Indexing - Post-Base Index in | |||
| Header Block | ||||
| 4. Wire Format | 4. Wire Format | |||
| 4.1. Primitives | 4.1. Primitives | |||
| 4.1.1. Prefixed Integers | 4.1.1. Prefixed Integers | |||
| The prefixed integer from Section 5.1 of [RFC7541] is used heavily | The prefixed integer from Section 5.1 of [RFC7541] is used heavily | |||
| throughout this document. The format from [RFC7541] is used | throughout this document. The format from [RFC7541] is used | |||
| unmodified. Note, however, that QPACK uses some prefix sizes not | unmodified. Note, however, that QPACK uses some prefix sizes not | |||
| skipping to change at page 15, line 20 ¶ | skipping to change at page 15, line 24 ¶ | |||
| literal is unmodified. | literal is unmodified. | |||
| A string literal without a prefix length noted is an 8-bit prefix | A string literal without a prefix length noted is an 8-bit prefix | |||
| string literal and follows the definitions in [RFC7541] without | string literal and follows the definitions in [RFC7541] without | |||
| modification. | modification. | |||
| 4.2. Encoder and Decoder Streams | 4.2. Encoder and Decoder Streams | |||
| QPACK defines two unidirectional stream types: | QPACK defines two unidirectional stream types: | |||
| o An encoder stream is a unidirectional stream of type "0x02". It | * An encoder stream is a unidirectional stream of type "0x02". It | |||
| carries an unframed sequence of encoder instructions from encoder | carries an unframed sequence of encoder instructions from encoder | |||
| to decoder. | to decoder. | |||
| o A decoder stream is a unidirectional stream of type "0x03". It | * A decoder stream is a unidirectional stream of type "0x03". It | |||
| carries an unframed sequence of decoder instructions from decoder | carries an unframed sequence of decoder instructions from decoder | |||
| to encoder. | to encoder. | |||
| HTTP/3 endpoints contain a QPACK encoder and decoder. Each endpoint | HTTP/3 endpoints contain a QPACK encoder and decoder. Each endpoint | |||
| MUST initiate at most one encoder stream and at most one decoder | MUST initiate at most one encoder stream and at most one decoder | |||
| stream. Receipt of a second instance of either stream type MUST be | stream. Receipt of a second instance of either stream type MUST be | |||
| treated as a connection error of type HTTP_STREAM_CREATION_ERROR. | treated as a connection error of type HTTP_STREAM_CREATION_ERROR. | |||
| These streams MUST NOT be closed. Closure of either unidirectional | These streams MUST NOT be closed. Closure of either unidirectional | |||
| stream type MUST be treated as a connection error of type | stream type MUST be treated as a connection error of type | |||
| HTTP_CLOSED_CRITICAL_STREAM. | HTTP_CLOSED_CRITICAL_STREAM. | |||
| skipping to change at page 16, line 16 ¶ | skipping to change at page 16, line 23 ¶ | |||
| table, the full entry can also be used by reference, creating a | table, the full entry can also be used by reference, creating a | |||
| duplicate entry. | duplicate entry. | |||
| This section specifies the following encoder instructions. | This section specifies the following encoder instructions. | |||
| 4.3.1. Set Dynamic Table Capacity | 4.3.1. Set Dynamic Table Capacity | |||
| An encoder informs the decoder of a change to the dynamic table | An encoder informs the decoder of a change to the dynamic table | |||
| capacity using an instruction which begins with the '001' three-bit | capacity using an instruction which begins with the '001' three-bit | |||
| pattern. This is followed by the new dynamic table capacity | pattern. This is followed by the new dynamic table capacity | |||
| represented as an integer with a 5-bit prefix (see Section 4.1.1). | represented as an integer with a 5-bit prefix; see Section 4.1.1. | |||
| 0 1 2 3 4 5 6 7 | 0 1 2 3 4 5 6 7 | |||
| +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ | |||
| | 0 | 0 | 1 | Capacity (5+) | | | 0 | 0 | 1 | Capacity (5+) | | |||
| +---+---+---+-------------------+ | +---+---+---+-------------------+ | |||
| Figure 2: Set Dynamic Table Capacity | Figure 5: Set Dynamic Table Capacity | |||
| The new capacity MUST be lower than or equal to the limit described | The new capacity MUST be lower than or equal to the limit described | |||
| in Section 3.2.3. In HTTP/3, this limit is the value of the | in Section 3.2.3. In HTTP/3, this limit is the value of the | |||
| SETTINGS_QPACK_MAX_TABLE_CAPACITY parameter (see Section 5) received | SETTINGS_QPACK_MAX_TABLE_CAPACITY parameter (Section 5) received from | |||
| from the decoder. The decoder MUST treat a new dynamic table | the decoder. The decoder MUST treat a new dynamic table capacity | |||
| capacity value that exceeds this limit as a connection error of type | value that exceeds this limit as a connection error of type | |||
| "HTTP_QPACK_ENCODER_STREAM_ERROR". | "HTTP_QPACK_ENCODER_STREAM_ERROR". | |||
| Reducing the dynamic table capacity can cause entries to be evicted | Reducing the dynamic table capacity can cause entries to be evicted; | |||
| (see Section 3.2.2). This MUST NOT cause the eviction of blocking | see Section 3.2.2. This MUST NOT cause the eviction of entries which | |||
| entries (see Section 2.1.2). Changing the capacity of the dynamic | are not evictable; see Section 2.1.2. Changing the capacity of the | |||
| table is not acknowledged as this instruction does not insert an | dynamic table is not acknowledged as this instruction does not insert | |||
| entry. | an entry. | |||
| 4.3.2. Insert With Name Reference | 4.3.2. Insert With Name Reference | |||
| An encoder adds an entry to the dynamic table where the header field | An encoder adds an entry to the dynamic table where the header field | |||
| name matches the header field name of an entry stored in the static | name matches the header field name of an entry stored in the static | |||
| or the dynamic table using an instruction that starts with the '1' | or the dynamic table using an instruction that starts with the '1' | |||
| one-bit pattern. The second ('T') bit indicates whether the | one-bit pattern. The second ('T') bit indicates whether the | |||
| reference is to the static or dynamic table. The 6-bit prefix | reference is to the static or dynamic table. The 6-bit prefix | |||
| integer (see Section 4.1.1) that follows is used to locate the table | integer (Section 4.1.1) that follows is used to locate the table | |||
| entry for the header name. When T=1, the number represents the | entry for the header name. When T=1, the number represents the | |||
| static table index; when T=0, the number is the relative index of the | static table index; when T=0, the number is the relative index of the | |||
| entry in the dynamic table. | entry in the dynamic table. | |||
| The header name reference is followed by the header field value | The header name reference is followed by the header field value | |||
| represented as a string literal (see Section 4.1.2). | represented as a string literal; see Section 4.1.2. | |||
| 0 1 2 3 4 5 6 7 | 0 1 2 3 4 5 6 7 | |||
| +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ | |||
| | 1 | T | Name Index (6+) | | | 1 | T | Name Index (6+) | | |||
| +---+---+-----------------------+ | +---+---+-----------------------+ | |||
| | H | Value Length (7+) | | | H | Value Length (7+) | | |||
| +---+---------------------------+ | +---+---------------------------+ | |||
| | Value String (Length bytes) | | | Value String (Length bytes) | | |||
| +-------------------------------+ | +-------------------------------+ | |||
| Insert Header Field -- Indexed Name | Figure 6: Insert Header Field -- Indexed Name | |||
| 4.3.3. Insert Without Name Reference | 4.3.3. Insert Without Name Reference | |||
| An encoder adds an entry to the dynamic table where both the header | An encoder adds an entry to the dynamic table where both the header | |||
| field name and the header field value are represented as string | field name and the header field value are represented as string | |||
| literals using an instruction that starts with the '01' two-bit | literals using an instruction that starts with the '01' two-bit | |||
| pattern. | pattern. | |||
| This is followed by the name represented as a 6-bit prefix string | This is followed by the name represented as a 6-bit prefix string | |||
| literal, and the value represented as an 8-bit prefix string literal | literal, and the value represented as an 8-bit prefix string literal; | |||
| (see Section 4.1.2). | see Section 4.1.2. | |||
| 0 1 2 3 4 5 6 7 | 0 1 2 3 4 5 6 7 | |||
| +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ | |||
| | 0 | 1 | H | Name Length (5+) | | | 0 | 1 | H | Name Length (5+) | | |||
| +---+---+---+-------------------+ | +---+---+---+-------------------+ | |||
| | Name String (Length bytes) | | | Name String (Length bytes) | | |||
| +---+---------------------------+ | +---+---------------------------+ | |||
| | H | Value Length (7+) | | | H | Value Length (7+) | | |||
| +---+---------------------------+ | +---+---------------------------+ | |||
| | Value String (Length bytes) | | | Value String (Length bytes) | | |||
| +-------------------------------+ | +-------------------------------+ | |||
| Insert Header Field -- New Name | Figure 7: Insert Header Field -- New Name | |||
| 4.3.4. Duplicate | 4.3.4. Duplicate | |||
| An encoder duplicates an existing entry in the dynamic table using an | An encoder duplicates an existing entry in the dynamic table using an | |||
| instruction that begins with the '000' three-bit pattern. This is | instruction that begins with the '000' three-bit pattern. This is | |||
| followed by the relative index of the existing entry represented as | followed by the relative index of the existing entry represented as | |||
| an integer with a 5-bit prefix (see Section 4.1.1. | an integer with a 5-bit prefix; see Section 4.1.1. | |||
| 0 1 2 3 4 5 6 7 | 0 1 2 3 4 5 6 7 | |||
| +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ | |||
| | 0 | 0 | 0 | Index (5+) | | | 0 | 0 | 0 | Index (5+) | | |||
| +---+---+---+-------------------+ | +---+---+---+-------------------+ | |||
| Figure 3: Duplicate | Figure 8: Duplicate | |||
| The existing entry is re-inserted into the dynamic table without | The existing entry is re-inserted into the dynamic table without | |||
| resending either the name or the value. This is useful to avoid | resending either the name or the value. This is useful to avoid | |||
| adding a reference to an older entry, which might block inserting new | adding a reference to an older entry, which might block inserting new | |||
| entries. | entries. | |||
| 4.4. Decoder Instructions | 4.4. Decoder Instructions | |||
| A decoder sends decoder instructions on the decoder stream to inform | A decoder sends decoder instructions on the decoder stream to inform | |||
| the encoder about the processing of header blocks and table updates | the encoder about the processing of header blocks and table updates | |||
| to ensure consistency of the dynamic table. | to ensure consistency of the dynamic table. | |||
| This section specifies the following decoder instructions. | This section specifies the following decoder instructions. | |||
| 4.4.1. Header Acknowledgement | 4.4.1. Header Acknowledgement | |||
| After processing a header block whose declared Required Insert Count | After processing a header block whose declared Required Insert Count | |||
| is not zero, the decoder emits a Header Acknowledgement instruction. | is not zero, the decoder emits a Header Acknowledgement instruction. | |||
| The instruction begins with the '1' one-bit pattern which is followed | The instruction begins with the '1' one-bit pattern which is followed | |||
| by the header block's associated stream ID encoded as a 7-bit prefix | by the header block's associated stream ID encoded as a 7-bit prefix | |||
| integer (see Section 4.1.1). | integer; see Section 4.1.1. | |||
| This instruction is used as described in Section 2.1.4 and in | This instruction is used as described in Section 2.1.4 and in | |||
| Section 2.2.2. | Section 2.2.2. | |||
| 0 1 2 3 4 5 6 7 | 0 1 2 3 4 5 6 7 | |||
| +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ | |||
| | 1 | Stream ID (7+) | | | 1 | Stream ID (7+) | | |||
| +---+---------------------------+ | +---+---------------------------+ | |||
| Figure 4: Header Acknowledgement | Figure 9: Header Acknowledgement | |||
| If an encoder receives a Header Acknowledgement instruction referring | If an encoder receives a Header Acknowledgement instruction referring | |||
| to a stream on which every header block with a non-zero Required | to a stream on which every header block with a non-zero Required | |||
| Insert Count has already been acknowledged, that MUST be treated as a | Insert Count has already been acknowledged, that MUST be treated as a | |||
| connection error of type "HTTP_QPACK_DECODER_STREAM_ERROR". | connection error of type "HTTP_QPACK_DECODER_STREAM_ERROR". | |||
| The Header Acknowledgement instruction might increase the Known | ||||
| Received Count; see Section 2.1.4. | ||||
| 4.4.2. Stream Cancellation | 4.4.2. Stream Cancellation | |||
| When a stream is reset or reading is abandoned, the decoder emits a | When a stream is reset or reading is abandoned, the decoder emits a | |||
| Stream Cancellation instruction. The instruction begins with the | Stream Cancellation instruction. The instruction begins with the | |||
| '01' two-bit pattern, which is followed by the stream ID of the | '01' two-bit pattern, which is followed by the stream ID of the | |||
| affected stream encoded as a 6-bit prefix integer. | affected stream encoded as a 6-bit prefix integer. | |||
| This instruction is used as described in Section 2.2.2. | This instruction is used as described in Section 2.2.2. | |||
| 0 1 2 3 4 5 6 7 | 0 1 2 3 4 5 6 7 | |||
| +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ | |||
| | 0 | 1 | Stream ID (6+) | | | 0 | 1 | Stream ID (6+) | | |||
| +---+---+-----------------------+ | +---+---+-----------------------+ | |||
| Figure 5: Stream Cancellation | Figure 10: Stream Cancellation | |||
| 4.4.3. Insert Count Increment | 4.4.3. Insert Count Increment | |||
| The Insert Count Increment instruction begins with the '00' two-bit | The Insert Count Increment instruction begins with the '00' two-bit | |||
| pattern, followed by the Increment encoded as a 6-bit prefix integer. | pattern, followed by the Increment encoded as a 6-bit prefix integer. | |||
| The value of the Increment is the total number of dynamic table | This instruction increases the Known Received Count (Section 2.1.4) | |||
| insertions and duplications processed by the decoder since the last | by the value of the Increment parameter. The decoder should send an | |||
| time it sent a Header Acknowledgement instruction that increased the | Increment value that increases the Known Received Count to the total | |||
| Known Received Count (see Section 2.1.4) or an Insert Count Increment | number of dynamic table insertions and duplications processed so far. | |||
| instruction. The encoder uses this value to update the Known | ||||
| Received Count, as described in Section 2.2.2. | ||||
| 0 1 2 3 4 5 6 7 | 0 1 2 3 4 5 6 7 | |||
| +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ | |||
| | 0 | 0 | Increment (6+) | | | 0 | 0 | Increment (6+) | | |||
| +---+---+-----------------------+ | +---+---+-----------------------+ | |||
| Figure 6: Insert Count Increment | Figure 11: Insert Count Increment | |||
| An encoder that receives an Increment field equal to zero, or one | An encoder that receives an Increment field equal to zero, or one | |||
| that increases the Known Received Count beyond what the encoder has | that increases the Known Received Count beyond what the encoder has | |||
| sent MUST treat this as a connection error of type | sent MUST treat this as a connection error of type | |||
| "HTTP_QPACK_DECODER_STREAM_ERROR". | "HTTP_QPACK_DECODER_STREAM_ERROR". | |||
| 4.5. Header Block Representations | 4.5. Header Block Representations | |||
| A header block consists of a prefix and a possibly empty sequence of | A header block consists of a prefix and a possibly empty sequence of | |||
| representations defined in this section. Each representation | representations defined in this section. Each representation | |||
| skipping to change at page 19, line 51 ¶ | skipping to change at page 20, line 10 ¶ | |||
| state, but do not modify that state. | state, but do not modify that state. | |||
| Header blocks are carried in frames on streams defined by the | Header blocks are carried in frames on streams defined by the | |||
| enclosing protocol. | enclosing protocol. | |||
| 4.5.1. Header Block Prefix | 4.5.1. Header Block Prefix | |||
| Each header block is prefixed with two integers. The Required Insert | Each header block is prefixed with two integers. The Required Insert | |||
| Count is encoded as an integer with an 8-bit prefix after the | Count is encoded as an integer with an 8-bit prefix after the | |||
| encoding described in Section 4.5.1.1). The Base is encoded as a | encoding described in Section 4.5.1.1). The Base is encoded as a | |||
| sign bit ('S') and a Delta Base value with a 7-bit prefix (see | sign bit ('S') and a Delta Base value with a 7-bit prefix; see | |||
| Section 4.5.1.2). | Section 4.5.1.2. | |||
| 0 1 2 3 4 5 6 7 | 0 1 2 3 4 5 6 7 | |||
| +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ | |||
| | Required Insert Count (8+) | | | Required Insert Count (8+) | | |||
| +---+---------------------------+ | +---+---------------------------+ | |||
| | S | Delta Base (7+) | | | S | Delta Base (7+) | | |||
| +---+---------------------------+ | +---+---------------------------+ | |||
| | Compressed Headers ... | | Compressed Headers ... | |||
| +-------------------------------+ | +-------------------------------+ | |||
| Figure 7: Header Block | Figure 12: Header Block | |||
| 4.5.1.1. Required Insert Count | 4.5.1.1. Required Insert Count | |||
| Required Insert Count identifies the state of the dynamic table | Required Insert Count identifies the state of the dynamic table | |||
| needed to process the header block. Blocking decoders use the | needed to process the header block. Blocking decoders use the | |||
| Required Insert Count to determine when it is safe to process the | Required Insert Count to determine when it is safe to process the | |||
| rest of the block. | rest of the block. | |||
| The encoder transforms the Required Insert Count as follows before | The encoder transforms the Required Insert Count as follows before | |||
| encoding: | encoding: | |||
| skipping to change at page 20, line 38 ¶ | skipping to change at page 20, line 46 ¶ | |||
| else: | else: | |||
| EncInsertCount = (ReqInsertCount mod (2 * MaxEntries)) + 1 | EncInsertCount = (ReqInsertCount mod (2 * MaxEntries)) + 1 | |||
| Here "MaxEntries" is the maximum number of entries that the dynamic | Here "MaxEntries" is the maximum number of entries that the dynamic | |||
| table can have. The smallest entry has empty name and value strings | table can have. The smallest entry has empty name and value strings | |||
| and has the size of 32. Hence "MaxEntries" is calculated as | and has the size of 32. Hence "MaxEntries" is calculated as | |||
| MaxEntries = floor( MaxTableCapacity / 32 ) | MaxEntries = floor( MaxTableCapacity / 32 ) | |||
| "MaxTableCapacity" is the maximum capacity of the dynamic table as | "MaxTableCapacity" is the maximum capacity of the dynamic table as | |||
| specified by the decoder (see Section 3.2.3). | specified by the decoder; see Section 3.2.3. | |||
| This encoding limits the length of the prefix on long-lived | This encoding limits the length of the prefix on long-lived | |||
| connections. | connections. | |||
| The decoder can reconstruct the Required Insert Count using an | The decoder can reconstruct the Required Insert Count using an | |||
| algorithm such as the following. If the decoder encounters a value | algorithm such as the following. If the decoder encounters a value | |||
| of EncodedInsertCount that could not have been produced by a | of EncodedInsertCount that could not have been produced by a | |||
| conformant encoder, it MUST treat this as a connection error of type | conformant encoder, it MUST treat this as a connection error of type | |||
| "HTTP_QPACK_DECOMPRESSION_FAILED". | "HTTP_QPACK_DECOMPRESSION_FAILED". | |||
| skipping to change at page 22, line 32 ¶ | skipping to change at page 22, line 39 ¶ | |||
| For example, with a Required Insert Count of 9, a decoder receives an | For example, with a Required Insert Count of 9, a decoder receives an | |||
| S bit of 1 and a Delta Base of 2. This sets the Base to 6 and | S bit of 1 and a Delta Base of 2. This sets the Base to 6 and | |||
| enables post-base indexing for three entries. In this example, a | enables post-base indexing for three entries. In this example, a | |||
| relative index of 1 refers to the 5th entry that was added to the | relative index of 1 refers to the 5th entry that was added to the | |||
| table; a post-base index of 1 refers to the 8th entry. | table; a post-base index of 1 refers to the 8th entry. | |||
| 4.5.2. Indexed Header Field | 4.5.2. Indexed Header Field | |||
| An indexed header field representation identifies an entry in the | An indexed header field representation identifies an entry in the | |||
| static table, or an entry in the dynamic table with an absolute index | static table, or an entry in the dynamic table with an absolute index | |||
| less than the Base. | less than the value of the Base. | |||
| 0 1 2 3 4 5 6 7 | 0 1 2 3 4 5 6 7 | |||
| +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ | |||
| | 1 | T | Index (6+) | | | 1 | T | Index (6+) | | |||
| +---+---+-----------------------+ | +---+---+-----------------------+ | |||
| Indexed Header Field | Figure 13: Indexed Header Field | |||
| This representation starts with the '1' 1-bit pattern, followed by | This representation starts with the '1' 1-bit pattern, followed by | |||
| the 'T' bit indicating whether the reference is into the static or | the 'T' bit indicating whether the reference is into the static or | |||
| dynamic table. The 6-bit prefix integer (see Section 4.1.1) that | dynamic table. The 6-bit prefix integer (Section 4.1.1) that follows | |||
| follows is used to locate the table entry for the header field. When | is used to locate the table entry for the header field. When T=1, | |||
| T=1, the number represents the static table index; when T=0, the | the number represents the static table index; when T=0, the number is | |||
| number is the relative index of the entry in the dynamic table. | the relative index of the entry in the dynamic table. | |||
| 4.5.3. Indexed Header Field With Post-Base Index | 4.5.3. Indexed Header Field With Post-Base Index | |||
| An indexed header field with post-base index representation | An indexed header field with post-base index representation | |||
| identifies an entry in the dynamic table with an absolute index | identifies an entry in the dynamic table with an absolute index | |||
| greater than or equal to the Base. | greater than or equal to the value of the Base. | |||
| 0 1 2 3 4 5 6 7 | 0 1 2 3 4 5 6 7 | |||
| +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ | |||
| | 0 | 0 | 0 | 1 | Index (4+) | | | 0 | 0 | 0 | 1 | Index (4+) | | |||
| +---+---+---+---+---------------+ | +---+---+---+---+---------------+ | |||
| Indexed Header Field with Post-Base Index | Figure 14: Indexed Header Field with Post-Base Index | |||
| This representation starts with the '0001' 4-bit pattern. This is | This representation starts with the '0001' 4-bit pattern. This is | |||
| followed by the post-base index (see Section 3.2.6) of the matching | followed by the post-base index (Section 3.2.6) of the matching | |||
| header field, represented as an integer with a 4-bit prefix (see | header field, represented as an integer with a 4-bit prefix; see | |||
| Section 4.1.1). | Section 4.1.1. | |||
| 4.5.4. Literal Header Field With Name Reference | 4.5.4. Literal Header Field With Name Reference | |||
| A literal header field with name reference representation encodes a | A literal header field with name reference representation encodes a | |||
| header field where the header field name matches the header field | header field where the header field name matches the header field | |||
| name of an entry in the static table, or the header field name of an | name of an entry in the static table, or the header field name of an | |||
| entry in the dynamic table with an absolute index less than the Base. | entry in the dynamic table with an absolute index less than the value | |||
| of the Base. | ||||
| 0 1 2 3 4 5 6 7 | 0 1 2 3 4 5 6 7 | |||
| +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ | |||
| | 0 | 1 | N | T |Name Index (4+)| | | 0 | 1 | N | T |Name Index (4+)| | |||
| +---+---+---+---+---------------+ | +---+---+---+---+---------------+ | |||
| | H | Value Length (7+) | | | H | Value Length (7+) | | |||
| +---+---------------------------+ | +---+---------------------------+ | |||
| | Value String (Length bytes) | | | Value String (Length bytes) | | |||
| +-------------------------------+ | +-------------------------------+ | |||
| Literal Header Field With Name Reference | Figure 15: Literal Header Field With Name Reference | |||
| This representation starts with the '01' two-bit pattern. The | This representation starts with the '01' two-bit pattern. The | |||
| following bit, 'N', indicates whether an intermediary is permitted to | following bit, 'N', indicates whether an intermediary is permitted to | |||
| add this header to the dynamic header table on subsequent hops. When | add this header to the dynamic header table on subsequent hops. When | |||
| the 'N' bit is set, the encoded header MUST always be encoded with a | the 'N' bit is set, the encoded header MUST always be encoded with a | |||
| literal representation. In particular, when a peer sends a header | literal representation. In particular, when a peer sends a header | |||
| field that it received represented as a literal header field with the | field that it received represented as a literal header field with the | |||
| 'N' bit set, it MUST use a literal representation to forward this | 'N' bit set, it MUST use a literal representation to forward this | |||
| header field. This bit is intended for protecting header field | header field. This bit is intended for protecting header field | |||
| values that are not to be put at risk by compressing them (see | values that are not to be put at risk by compressing them; see | |||
| Section 7 for more details). | Section 7 for more details. | |||
| The fourth ('T') bit indicates whether the reference is to the static | The fourth ('T') bit indicates whether the reference is to the static | |||
| or dynamic table. The 4-bit prefix integer (see Section 4.1.1) that | or dynamic table. The 4-bit prefix integer (Section 4.1.1) that | |||
| follows is used to locate the table entry for the header name. When | follows is used to locate the table entry for the header name. When | |||
| T=1, the number represents the static table index; when T=0, the | T=1, the number represents the static table index; when T=0, the | |||
| number is the relative index of the entry in the dynamic table. | number is the relative index of the entry in the dynamic table. | |||
| Only the header field name is taken from the dynamic table entry; the | Only the header field name is taken from the dynamic table entry; the | |||
| header field value is encoded as an 8-bit prefix string literal (see | header field value is encoded as an 8-bit prefix string literal; see | |||
| Section 4.1.2). | Section 4.1.2. | |||
| 4.5.5. Literal Header Field With Post-Base Name Reference | 4.5.5. Literal Header Field With Post-Base Name Reference | |||
| A literal header field with post-base name reference representation | A literal header field with post-base name reference representation | |||
| encodes a header field where the header field name matches the header | encodes a header field where the header field name matches the header | |||
| field name of a dynamic table entry with an absolute index greater | field name of a dynamic table entry with an absolute index greater | |||
| than or equal to the Base. | than or equal to the value of the Base. | |||
| 0 1 2 3 4 5 6 7 | 0 1 2 3 4 5 6 7 | |||
| +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ | |||
| | 0 | 0 | 0 | 0 | N |NameIdx(3+)| | | 0 | 0 | 0 | 0 | N |NameIdx(3+)| | |||
| +---+---+---+---+---+-----------+ | +---+---+---+---+---+-----------+ | |||
| | H | Value Length (7+) | | | H | Value Length (7+) | | |||
| +---+---------------------------+ | +---+---------------------------+ | |||
| | Value String (Length bytes) | | | Value String (Length bytes) | | |||
| +-------------------------------+ | +-------------------------------+ | |||
| Literal Header Field With Post-Base Name Reference | Figure 16: Literal Header Field With Post-Base Name Reference | |||
| This representation starts with the '0000' four-bit pattern. The | This representation starts with the '0000' four-bit pattern. The | |||
| fifth bit is the 'N' bit as described in Section 4.5.4. This is | fifth bit is the 'N' bit as described in Section 4.5.4. This is | |||
| followed by a post-base index of the dynamic table entry (see | followed by a post-base index of the dynamic table entry | |||
| Section 3.2.6) encoded as an integer with a 3-bit prefix (see | (Section 3.2.6) encoded as an integer with a 3-bit prefix; see | |||
| Section 4.1.1). | Section 4.1.1. | |||
| Only the header field name is taken from the dynamic table entry; the | Only the header field name is taken from the dynamic table entry; the | |||
| header field value is encoded as an 8-bit prefix string literal (see | header field value is encoded as an 8-bit prefix string literal; see | |||
| Section 4.1.2). | Section 4.1.2. | |||
| 4.5.6. Literal Header Field Without Name Reference | 4.5.6. Literal Header Field Without Name Reference | |||
| The literal header field without name reference representation | The literal header field without name reference representation | |||
| encodes a header field name and a header field value as string | encodes a header field name and a header field value as string | |||
| literals. | literals. | |||
| 0 1 2 3 4 5 6 7 | 0 1 2 3 4 5 6 7 | |||
| +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ | |||
| | 0 | 0 | 1 | N | H |NameLen(3+)| | | 0 | 0 | 1 | N | H |NameLen(3+)| | |||
| +---+---+---+---+---+-----------+ | +---+---+---+---+---+-----------+ | |||
| | Name String (Length bytes) | | | Name String (Length bytes) | | |||
| +---+---------------------------+ | +---+---------------------------+ | |||
| | H | Value Length (7+) | | | H | Value Length (7+) | | |||
| +---+---------------------------+ | +---+---------------------------+ | |||
| | Value String (Length bytes) | | | Value String (Length bytes) | | |||
| +-------------------------------+ | +-------------------------------+ | |||
| Literal Header Field Without Name Reference | Figure 17: Literal Header Field Without Name Reference | |||
| This representation begins with the '001' three-bit pattern. The | This representation begins with the '001' three-bit pattern. The | |||
| fourth bit is the 'N' bit as described in Section 4.5.4. The name | fourth bit is the 'N' bit as described in Section 4.5.4. The name | |||
| follows, represented as a 4-bit prefix string literal, then the | follows, represented as a 4-bit prefix string literal, then the | |||
| value, represented as an 8-bit prefix string literal (see | value, represented as an 8-bit prefix string literal; see | |||
| Section 4.1.2). | Section 4.1.2. | |||
| 5. Configuration | 5. Configuration | |||
| QPACK defines two settings which are included in the HTTP/3 SETTINGS | QPACK defines two settings which are included in the HTTP/3 SETTINGS | |||
| frame. | frame. | |||
| SETTINGS_QPACK_MAX_TABLE_CAPACITY (0x1): The default value is zero. | SETTINGS_QPACK_MAX_TABLE_CAPACITY (0x1): The default value is zero. | |||
| See Section 3.2 for usage. This is the equivalent of the | See Section 3.2 for usage. This is the equivalent of the | |||
| SETTINGS_HEADER_TABLE_SIZE from HTTP/2. | SETTINGS_HEADER_TABLE_SIZE from HTTP/2. | |||
| skipping to change at page 26, line 29 ¶ | skipping to change at page 26, line 29 ¶ | |||
| 8. IANA Considerations | 8. IANA Considerations | |||
| 8.1. Settings Registration | 8.1. Settings Registration | |||
| This document specifies two settings. The entries in the following | This document specifies two settings. The entries in the following | |||
| table are registered in the "HTTP/3 Settings" registry established in | table are registered in the "HTTP/3 Settings" registry established in | |||
| [HTTP3]. | [HTTP3]. | |||
| +--------------------------+------+---------------+---------+ | +--------------------------+------+---------------+---------+ | |||
| | Setting Name | Code | Specification | Default | | | Setting Name | Code | Specification | Default | | |||
| +--------------------------+------+---------------+---------+ | +==========================+======+===============+=========+ | |||
| | QPACK_MAX_TABLE_CAPACITY | 0x1 | Section 5 | 0 | | | QPACK_MAX_TABLE_CAPACITY | 0x1 | Section 5 | 0 | | |||
| | | | | | | +--------------------------+------+---------------+---------+ | |||
| | QPACK_BLOCKED_STREAMS | 0x7 | Section 5 | 0 | | | QPACK_BLOCKED_STREAMS | 0x7 | Section 5 | 0 | | |||
| +--------------------------+------+---------------+---------+ | +--------------------------+------+---------------+---------+ | |||
| Table 1 | ||||
| 8.2. Stream Type Registration | 8.2. Stream Type Registration | |||
| This document specifies two stream types. The entries in the | This document specifies two stream types. The entries in the | |||
| following table are registered in the "HTTP/3 Stream Type" registry | following table are registered in the "HTTP/3 Stream Type" registry | |||
| established in [HTTP3]. | established in [HTTP3]. | |||
| +----------------------+------+---------------+--------+ | +----------------------+------+---------------+--------+ | |||
| | Stream Type | Code | Specification | Sender | | | Stream Type | Code | Specification | Sender | | |||
| +----------------------+------+---------------+--------+ | +======================+======+===============+========+ | |||
| | QPACK Encoder Stream | 0x02 | Section 4.2 | Both | | | QPACK Encoder Stream | 0x02 | Section 4.2 | Both | | |||
| | | | | | | +----------------------+------+---------------+--------+ | |||
| | QPACK Decoder Stream | 0x03 | Section 4.2 | Both | | | QPACK Decoder Stream | 0x03 | Section 4.2 | Both | | |||
| +----------------------+------+---------------+--------+ | +----------------------+------+---------------+--------+ | |||
| Table 2 | ||||
| 8.3. Error Code Registration | 8.3. Error Code Registration | |||
| This document specifies three error codes. The entries in the | This document specifies three error codes. The entries in the | |||
| following table are registered in the "HTTP/3 Error Code" registry | following table are registered in the "HTTP/3 Error Code" registry | |||
| established in [HTTP3]. | established in [HTTP3]. | |||
| +-----------------------------+-------+--------------+--------------+ | +---------------------------------+-----+-------------+-------------+ | |||
| | Name | Code | Description | Specificatio | | | Name |Code | Description |Specification| | |||
| | | | | n | | +=================================+=====+=============+=============+ | |||
| +-----------------------------+-------+--------------+--------------+ | | HTTP_QPACK_DECOMPRESSION_FAILED |0x200|Decompression| Section 6 | | |||
| | HTTP_QPACK_DECOMPRESSION_FA | 0x200 | Decompressio | Section 6 | | | | | of a header | | | |||
| | ILED | | n of a | | | | | |block failed | | | |||
| | | | header block | | | +---------------------------------+-----+-------------+-------------+ | |||
| | | | failed | | | | HTTP_QPACK_ENCODER_STREAM_ERROR |0x201|Error on the | Section 6 | | |||
| | | | | | | | | | encoder | | | |||
| | HTTP_QPACK_ENCODER_STREAM_E | 0x201 | Error on the | Section 6 | | | | | stream | | | |||
| | RROR | | encoder | | | +---------------------------------+-----+-------------+-------------+ | |||
| | | | stream | | | | HTTP_QPACK_DECODER_STREAM_ERROR |0x202|Error on the | Section 6 | | |||
| | | | | | | | | | decoder | | | |||
| | HTTP_QPACK_DECODER_STREAM_E | 0x202 | Error on the | Section 6 | | | | | stream | | | |||
| | RROR | | decoder | | | +---------------------------------+-----+-------------+-------------+ | |||
| | | | stream | | | ||||
| +-----------------------------+-------+--------------+--------------+ | Table 3 | |||
| 9. References | 9. References | |||
| 9.1. Normative References | 9.1. Normative References | |||
| [HTTP3] Bishop, M., Ed., "Hypertext Transfer Protocol Version 3 | [HTTP3] Bishop, M., Ed., "Hypertext Transfer Protocol Version 3 | |||
| (HTTP/3)", draft-ietf-quic-http-24 (work in progress), | (HTTP/3)", Work in Progress, Internet-Draft, draft-ietf- | |||
| November 2019. | quic-http-25, 22 January 2020, | |||
| <https://tools.ietf.org/html/draft-ietf-quic-http-25>. | ||||
| [QUIC-TRANSPORT] | [QUIC-TRANSPORT] | |||
| Iyengar, J., Ed. and M. Thomson, Ed., "QUIC: A UDP-Based | Iyengar, J., Ed. and M. Thomson, Ed., "QUIC: A UDP-Based | |||
| Multiplexed and Secure Transport", draft-ietf-quic- | Multiplexed and Secure Transport", Work in Progress, | |||
| transport-24 (work in progress), November 2019. | Internet-Draft, draft-ietf-quic-transport-25, 22 January | |||
| 2020, <https://tools.ietf.org/html/draft-ietf-quic- | ||||
| transport-25>. | ||||
| [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate | [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate | |||
| Requirement Levels", BCP 14, RFC 2119, | Requirement Levels", BCP 14, RFC 2119, | |||
| DOI 10.17487/RFC2119, March 1997, | DOI 10.17487/RFC2119, March 1997, | |||
| <https://www.rfc-editor.org/info/rfc2119>. | <https://www.rfc-editor.org/info/rfc2119>. | |||
| [RFC7541] Peon, R. and H. Ruellan, "HPACK: Header Compression for | [RFC7541] Peon, R. and H. Ruellan, "HPACK: Header Compression for | |||
| HTTP/2", RFC 7541, DOI 10.17487/RFC7541, May 2015, | HTTP/2", RFC 7541, DOI 10.17487/RFC7541, May 2015, | |||
| <https://www.rfc-editor.org/info/rfc7541>. | <https://www.rfc-editor.org/info/rfc7541>. | |||
| skipping to change at page 28, line 20 ¶ | skipping to change at page 28, line 20 ¶ | |||
| [RFC2360] Scott, G., "Guide for Internet Standards Writers", BCP 22, | [RFC2360] Scott, G., "Guide for Internet Standards Writers", BCP 22, | |||
| RFC 2360, DOI 10.17487/RFC2360, June 1998, | RFC 2360, DOI 10.17487/RFC2360, June 1998, | |||
| <https://www.rfc-editor.org/info/rfc2360>. | <https://www.rfc-editor.org/info/rfc2360>. | |||
| [RFC7540] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext | [RFC7540] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext | |||
| Transfer Protocol Version 2 (HTTP/2)", RFC 7540, | Transfer Protocol Version 2 (HTTP/2)", RFC 7540, | |||
| DOI 10.17487/RFC7540, May 2015, | DOI 10.17487/RFC7540, May 2015, | |||
| <https://www.rfc-editor.org/info/rfc7540>. | <https://www.rfc-editor.org/info/rfc7540>. | |||
| 9.3. URIs | ||||
| [1] https://mailarchive.ietf.org/arch/search/?email_list=quic | ||||
| [2] https://github.com/quicwg | ||||
| [3] https://github.com/quicwg/base-drafts/labels/-qpack | ||||
| Appendix A. Static Table | Appendix A. Static Table | |||
| +------+-----------------------------+------------------------------+ | +-------+----------------------------------+-----------------------+ | |||
| | Inde | Name | Value | | | Index | Name | Value | | |||
| | x | | | | +=======+==================================+=======================+ | |||
| +------+-----------------------------+------------------------------+ | | 0 | :authority | | | |||
| | 0 | :authority | | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 1 | :path | / | | |||
| | 1 | :path | / | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 2 | age | 0 | | |||
| | 2 | age | 0 | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 3 | content-disposition | | | |||
| | 3 | content-disposition | | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 4 | content-length | 0 | | |||
| | 4 | content-length | 0 | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 5 | cookie | | | |||
| | 5 | cookie | | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 6 | date | | | |||
| | 6 | date | | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 7 | etag | | | |||
| | 7 | etag | | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 8 | if-modified-since | | | |||
| | 8 | if-modified-since | | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 9 | if-none-match | | | |||
| | 9 | if-none-match | | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 10 | last-modified | | | |||
| | 10 | last-modified | | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 11 | link | | | |||
| | 11 | link | | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 12 | location | | | |||
| | 12 | location | | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 13 | referer | | | |||
| | 13 | referer | | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 14 | set-cookie | | | |||
| | 14 | set-cookie | | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 15 | :method | CONNECT | | |||
| | 15 | :method | CONNECT | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 16 | :method | DELETE | | |||
| | 16 | :method | DELETE | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 17 | :method | GET | | |||
| | 17 | :method | GET | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 18 | :method | HEAD | | |||
| | 18 | :method | HEAD | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 19 | :method | OPTIONS | | |||
| | 19 | :method | OPTIONS | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 20 | :method | POST | | |||
| | 20 | :method | POST | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 21 | :method | PUT | | |||
| | 21 | :method | PUT | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 22 | :scheme | http | | |||
| | 22 | :scheme | http | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 23 | :scheme | https | | |||
| | 23 | :scheme | https | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 24 | :status | 103 | | |||
| | 24 | :status | 103 | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 25 | :status | 200 | | |||
| | 25 | :status | 200 | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 26 | :status | 304 | | |||
| | 26 | :status | 304 | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 27 | :status | 404 | | |||
| | 27 | :status | 404 | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 28 | :status | 503 | | |||
| | 28 | :status | 503 | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 29 | accept | */* | | |||
| | 29 | accept | */* | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 30 | accept | application/dns- | | |||
| | 30 | accept | application/dns-message | | | | | message | | |||
| | | | | | +-------+----------------------------------+-----------------------+ | |||
| | 31 | accept-encoding | gzip, deflate, br | | | 31 | accept-encoding | gzip, deflate, br | | |||
| | | | | | +-------+----------------------------------+-----------------------+ | |||
| | 32 | accept-ranges | bytes | | | 32 | accept-ranges | bytes | | |||
| | | | | | +-------+----------------------------------+-----------------------+ | |||
| | 33 | access-control-allow- | cache-control | | | 33 | access-control-allow-headers | cache-control | | |||
| | | headers | | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 34 | access-control-allow-headers | content-type | | |||
| | 34 | access-control-allow- | content-type | | +-------+----------------------------------+-----------------------+ | |||
| | | headers | | | | 35 | access-control-allow-origin | * | | |||
| | | | | | +-------+----------------------------------+-----------------------+ | |||
| | 35 | access-control-allow-origin | * | | | 36 | cache-control | max-age=0 | | |||
| | | | | | +-------+----------------------------------+-----------------------+ | |||
| | 36 | cache-control | max-age=0 | | | 37 | cache-control | max-age=2592000 | | |||
| | | | | | +-------+----------------------------------+-----------------------+ | |||
| | 37 | cache-control | max-age=2592000 | | | 38 | cache-control | max-age=604800 | | |||
| | | | | | +-------+----------------------------------+-----------------------+ | |||
| | 38 | cache-control | max-age=604800 | | | 39 | cache-control | no-cache | | |||
| | | | | | +-------+----------------------------------+-----------------------+ | |||
| | 39 | cache-control | no-cache | | | 40 | cache-control | no-store | | |||
| | | | | | +-------+----------------------------------+-----------------------+ | |||
| | 40 | cache-control | no-store | | | 41 | cache-control | public, max- | | |||
| | | | | | | | | age=31536000 | | |||
| | 41 | cache-control | public, max-age=31536000 | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 42 | content-encoding | br | | |||
| | 42 | content-encoding | br | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 43 | content-encoding | gzip | | |||
| | 43 | content-encoding | gzip | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 44 | content-type | application/dns- | | |||
| | 44 | content-type | application/dns-message | | | | | message | | |||
| | | | | | +-------+----------------------------------+-----------------------+ | |||
| | 45 | content-type | application/javascript | | | 45 | content-type | application/ | | |||
| | | | | | | | | javascript | | |||
| | 46 | content-type | application/json | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 46 | content-type | application/json | | |||
| | 47 | content-type | application/x-www-form- | | +-------+----------------------------------+-----------------------+ | |||
| | | | urlencoded | | | 47 | content-type | application/x-www- | | |||
| | | | | | | | | form-urlencoded | | |||
| | 48 | content-type | image/gif | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 48 | content-type | image/gif | | |||
| | 49 | content-type | image/jpeg | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 49 | content-type | image/jpeg | | |||
| | 50 | content-type | image/png | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 50 | content-type | image/png | | |||
| | 51 | content-type | text/css | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 51 | content-type | text/css | | |||
| | 52 | content-type | text/html; charset=utf-8 | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 52 | content-type | text/html; | | |||
| | 53 | content-type | text/plain | | | | | charset=utf-8 | | |||
| | | | | | +-------+----------------------------------+-----------------------+ | |||
| | 54 | content-type | text/plain;charset=utf-8 | | | 53 | content-type | text/plain | | |||
| | | | | | +-------+----------------------------------+-----------------------+ | |||
| | 55 | range | bytes=0- | | | 54 | content-type | text/ | | |||
| | | | | | | | | plain;charset=utf-8 | | |||
| | 56 | strict-transport-security | max-age=31536000 | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 55 | range | bytes=0- | | |||
| | 57 | strict-transport-security | max-age=31536000; | | +-------+----------------------------------+-----------------------+ | |||
| | | | includesubdomains | | | 56 | strict-transport-security | max-age=31536000 | | |||
| | | | | | +-------+----------------------------------+-----------------------+ | |||
| | 58 | strict-transport-security | max-age=31536000; | | | 57 | strict-transport-security | max-age=31536000; | | |||
| | | | includesubdomains; preload | | | | | includesubdomains | | |||
| | | | | | +-------+----------------------------------+-----------------------+ | |||
| | 59 | vary | accept-encoding | | | 58 | strict-transport-security | max-age=31536000; | | |||
| | | | | | | | | includesubdomains; | | |||
| | 60 | vary | origin | | | | | preload | | |||
| | | | | | +-------+----------------------------------+-----------------------+ | |||
| | 61 | x-content-type-options | nosniff | | | 59 | vary | accept-encoding | | |||
| | | | | | +-------+----------------------------------+-----------------------+ | |||
| | 62 | x-xss-protection | 1; mode=block | | | 60 | vary | origin | | |||
| | | | | | +-------+----------------------------------+-----------------------+ | |||
| | 63 | :status | 100 | | | 61 | x-content-type-options | nosniff | | |||
| | | | | | +-------+----------------------------------+-----------------------+ | |||
| | 64 | :status | 204 | | | 62 | x-xss-protection | 1; mode=block | | |||
| | | | | | +-------+----------------------------------+-----------------------+ | |||
| | 65 | :status | 206 | | | 63 | :status | 100 | | |||
| | | | | | +-------+----------------------------------+-----------------------+ | |||
| | 66 | :status | 302 | | | 64 | :status | 204 | | |||
| | | | | | +-------+----------------------------------+-----------------------+ | |||
| | 67 | :status | 400 | | | 65 | :status | 206 | | |||
| | | | | | +-------+----------------------------------+-----------------------+ | |||
| | 68 | :status | 403 | | | 66 | :status | 302 | | |||
| | | | | | +-------+----------------------------------+-----------------------+ | |||
| | 69 | :status | 421 | | | 67 | :status | 400 | | |||
| | | | | | +-------+----------------------------------+-----------------------+ | |||
| | 70 | :status | 425 | | | 68 | :status | 403 | | |||
| | | | | | +-------+----------------------------------+-----------------------+ | |||
| | 71 | :status | 500 | | | 69 | :status | 421 | | |||
| | | | | | +-------+----------------------------------+-----------------------+ | |||
| | 72 | accept-language | | | | 70 | :status | 425 | | |||
| | | | | | +-------+----------------------------------+-----------------------+ | |||
| | 73 | access-control-allow- | FALSE | | | 71 | :status | 500 | | |||
| | | credentials | | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 72 | accept-language | | | |||
| | 74 | access-control-allow- | TRUE | | +-------+----------------------------------+-----------------------+ | |||
| | | credentials | | | | 73 | access-control-allow-credentials | FALSE | | |||
| | | | | | +-------+----------------------------------+-----------------------+ | |||
| | 75 | access-control-allow- | * | | | 74 | access-control-allow-credentials | TRUE | | |||
| | | headers | | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 75 | access-control-allow-headers | * | | |||
| | 76 | access-control-allow- | get | | +-------+----------------------------------+-----------------------+ | |||
| | | methods | | | | 76 | access-control-allow-methods | get | | |||
| | | | | | +-------+----------------------------------+-----------------------+ | |||
| | 77 | access-control-allow- | get, post, options | | | 77 | access-control-allow-methods | get, post, options | | |||
| | | methods | | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 78 | access-control-allow-methods | options | | |||
| | 78 | access-control-allow- | options | | +-------+----------------------------------+-----------------------+ | |||
| | | methods | | | | 79 | access-control-expose-headers | content-length | | |||
| | | | | | +-------+----------------------------------+-----------------------+ | |||
| | 79 | access-control-expose- | content-length | | | 80 | access-control-request-headers | content-type | | |||
| | | headers | | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 81 | access-control-request-method | get | | |||
| | 80 | access-control-request- | content-type | | +-------+----------------------------------+-----------------------+ | |||
| | | headers | | | | 82 | access-control-request-method | post | | |||
| | | | | | +-------+----------------------------------+-----------------------+ | |||
| | 81 | access-control-request- | get | | | 83 | alt-svc | clear | | |||
| | | method | | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 84 | authorization | | | |||
| | 82 | access-control-request- | post | | +-------+----------------------------------+-----------------------+ | |||
| | | method | | | | 85 | content-security-policy | script-src 'none'; | | |||
| | | | | | | | | object-src 'none'; | | |||
| | 83 | alt-svc | clear | | | | | base-uri 'none' | | |||
| | | | | | +-------+----------------------------------+-----------------------+ | |||
| | 84 | authorization | | | | 86 | early-data | 1 | | |||
| | | | | | +-------+----------------------------------+-----------------------+ | |||
| | 85 | content-security-policy | script-src 'none'; object- | | | 87 | expect-ct | | | |||
| | | | src 'none'; base-uri 'none' | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 88 | forwarded | | | |||
| | 86 | early-data | 1 | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 89 | if-range | | | |||
| | 87 | expect-ct | | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 90 | origin | | | |||
| | 88 | forwarded | | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 91 | purpose | prefetch | | |||
| | 89 | if-range | | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 92 | server | | | |||
| | 90 | origin | | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 93 | timing-allow-origin | * | | |||
| | 91 | purpose | prefetch | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 94 | upgrade-insecure-requests | 1 | | |||
| | 92 | server | | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 95 | user-agent | | | |||
| | 93 | timing-allow-origin | * | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 96 | x-forwarded-for | | | |||
| | 94 | upgrade-insecure-requests | 1 | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 97 | x-frame-options | deny | | |||
| | 95 | user-agent | | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | | 98 | x-frame-options | sameorigin | | |||
| | 96 | x-forwarded-for | | | +-------+----------------------------------+-----------------------+ | |||
| | | | | | ||||
| | 97 | x-frame-options | deny | | Table 4 | |||
| | | | | | ||||
| | 98 | x-frame-options | sameorigin | | ||||
| +------+-----------------------------+------------------------------+ | ||||
| Appendix B. Sample One Pass Encoding Algorithm | Appendix B. Sample One Pass Encoding Algorithm | |||
| Pseudo-code for single pass encoding, excluding handling of | Pseudo-code for single pass encoding, excluding handling of | |||
| duplicates, non-blocking mode, and reference tracking. | duplicates, non-blocking mode, and reference tracking. | |||
| baseIndex = dynamicTable.baseIndex | baseIndex = dynamicTable.baseIndex | |||
| largestReference = 0 | largestReference = 0 | |||
| for header in headers: | for header in headers: | |||
| staticIdx = staticTable.getIndex(header) | staticIdx = staticTable.getIndex(header) | |||
| skipping to change at page 35, line 6 ¶ | skipping to change at page 34, line 4 ¶ | |||
| encodeInteger(prefixBuffer, 0x00, largestReference, 8) | encodeInteger(prefixBuffer, 0x00, largestReference, 8) | |||
| if baseIndex >= largestReference: | if baseIndex >= largestReference: | |||
| encodeInteger(prefixBuffer, 0, baseIndex - largestReference, 7) | encodeInteger(prefixBuffer, 0, baseIndex - largestReference, 7) | |||
| else: | else: | |||
| encodeInteger(prefixBuffer, 0x80, | encodeInteger(prefixBuffer, 0x80, | |||
| largestReference - baseIndex, 7) | largestReference - baseIndex, 7) | |||
| return controlBuffer, prefixBuffer + streamBuffer | return controlBuffer, prefixBuffer + streamBuffer | |||
| Appendix C. Change Log | Appendix C. Change Log | |||
| *RFC Editor's Note:* Please remove this section prior to | *RFC Editor's Note:* Please remove this section prior to | |||
| publication of a final version of this document. | publication of a final version of this document. | |||
| C.1. Since draft-ietf-quic-qpack-10 | C.1. Since draft-ietf-quic-qpack-11 | |||
| Editorial changes | Editorial changes only | |||
| C.2. Since draft-ietf-quic-qpack-09 | C.2. Since draft-ietf-quic-qpack-10 | |||
| o Decoders MUST emit Header Acknowledgements (#2939) | Editorial changes only | |||
| o Updated error code for multiple encoder or decoder streams (#2970) | C.3. Since draft-ietf-quic-qpack-09 | |||
| o Added explicit defaults for new SETTINGS (#2974) | * Decoders MUST emit Header Acknowledgements (#2939) | |||
| C.3. Since draft-ietf-quic-qpack-08 | * Updated error code for multiple encoder or decoder streams (#2970) | |||
| o Endpoints are permitted to create encoder and decoder streams even | * Added explicit defaults for new SETTINGS (#2974) | |||
| C.4. Since draft-ietf-quic-qpack-08 | ||||
| * Endpoints are permitted to create encoder and decoder streams even | ||||
| if they can't use them (#2100, #2529) | if they can't use them (#2100, #2529) | |||
| o Maximum values for settings removed (#2766, #2767) | * Maximum values for settings removed (#2766, #2767) | |||
| C.4. Since draft-ietf-quic-qpack-06 | C.5. Since draft-ietf-quic-qpack-06 | |||
| o Clarify initial dynamic table capacity maximums (#2276, #2330, | * Clarify initial dynamic table capacity maximums (#2276, #2330, | |||
| #2330) | #2330) | |||
| C.5. Since draft-ietf-quic-qpack-05 | C.6. Since draft-ietf-quic-qpack-05 | |||
| o Introduced the terms dynamic table capacity and maximum dynamic | * Introduced the terms dynamic table capacity and maximum dynamic | |||
| table capacity. | table capacity. | |||
| o Renamed SETTINGS_HEADER_TABLE_SIZE to | * Renamed SETTINGS_HEADER_TABLE_SIZE to | |||
| SETTINGS_QPACK_MAX_TABLE_CAPACITY. | SETTINGS_QPACK_MAX_TABLE_CAPACITY. | |||
| C.6. Since draft-ietf-quic-qpack-04 | C.7. Since draft-ietf-quic-qpack-04 | |||
| o Changed calculation of Delta Base Index to avoid an illegal value | * Changed calculation of Delta Base Index to avoid an illegal value | |||
| (#2002, #2005) | (#2002, #2005) | |||
| C.7. Since draft-ietf-quic-qpack-03 | C.8. Since draft-ietf-quic-qpack-03 | |||
| o Change HTTP settings defaults (#2038) | ||||
| o Substantial editorial reorganization | * Change HTTP settings defaults (#2038) | |||
| * Substantial editorial reorganization | ||||
| C.8. Since draft-ietf-quic-qpack-02 | C.9. Since draft-ietf-quic-qpack-02 | |||
| o Largest Reference encoded modulo MaxEntries (#1763) | * Largest Reference encoded modulo MaxEntries (#1763) | |||
| o New Static Table (#1355) | * New Static Table (#1355) | |||
| o Table Size Update with Insert Count=0 is a connection error | * Table Size Update with Insert Count=0 is a connection error | |||
| (#1762) | (#1762) | |||
| o Stream Cancellations are optional when | * Stream Cancellations are optional when | |||
| SETTINGS_HEADER_TABLE_SIZE=0 (#1761) | SETTINGS_HEADER_TABLE_SIZE=0 (#1761) | |||
| o Implementations must handle 62 bit integers (#1760) | * Implementations must handle 62 bit integers (#1760) | |||
| o Different error types for each QPACK stream, other changes to | * Different error types for each QPACK stream, other changes to | |||
| error handling (#1726) | error handling (#1726) | |||
| o Preserve header field order (#1725) | * Preserve header field order (#1725) | |||
| o Initial table size is the maximum permitted when table is first | * Initial table size is the maximum permitted when table is first | |||
| usable (#1642) | usable (#1642) | |||
| C.9. Since draft-ietf-quic-qpack-01 | C.10. Since draft-ietf-quic-qpack-01 | |||
| o Only header blocks that reference the dynamic table are | * Only header blocks that reference the dynamic table are | |||
| acknowledged (#1603, #1605) | acknowledged (#1603, #1605) | |||
| C.10. Since draft-ietf-quic-qpack-00 | C.11. Since draft-ietf-quic-qpack-00 | |||
| o Renumbered instructions for consistency (#1471, #1472) | * Renumbered instructions for consistency (#1471, #1472) | |||
| o Decoder is allowed to validate largest reference (#1404, #1469) | * Decoder is allowed to validate largest reference (#1404, #1469) | |||
| o Header block acknowledgments also acknowledge the associated | * Header block acknowledgments also acknowledge the associated | |||
| largest reference (#1370, #1400) | largest reference (#1370, #1400) | |||
| o Added an acknowledgment for unread streams (#1371, #1400) | * Added an acknowledgment for unread streams (#1371, #1400) | |||
| o Removed framing from encoder stream (#1361,#1467) | * Removed framing from encoder stream (#1361,#1467) | |||
| o Control streams use typed unidirectional streams rather than fixed | * Control streams use typed unidirectional streams rather than fixed | |||
| stream IDs (#910,#1359) | stream IDs (#910,#1359) | |||
| C.11. Since draft-ietf-quic-qcram-00 | C.12. Since draft-ietf-quic-qcram-00 | |||
| * Separate instruction sets for table updates and header blocks | ||||
| o Separate instruction sets for table updates and header blocks | ||||
| (#1235, #1142, #1141) | (#1235, #1142, #1141) | |||
| o Reworked indexing scheme (#1176, #1145, #1136, #1130, #1125, | * Reworked indexing scheme (#1176, #1145, #1136, #1130, #1125, | |||
| #1314) | #1314) | |||
| o Added mechanisms that support one-pass encoding (#1138, #1320) | * Added mechanisms that support one-pass encoding (#1138, #1320) | |||
| o Added a setting to control the number of blocked decoders (#238, | * Added a setting to control the number of blocked decoders (#238, | |||
| #1140, #1143) | #1140, #1143) | |||
| o Moved table updates and acknowledgments to dedicated streams | * Moved table updates and acknowledgments to dedicated streams | |||
| (#1121, #1122, #1238) | (#1121, #1122, #1238) | |||
| Acknowledgments | Acknowledgments | |||
| This draft draws heavily on the text of [RFC7541]. The indirect | This draft draws heavily on the text of [RFC7541]. The indirect | |||
| input of those authors is gratefully acknowledged, as well as ideas | input of those authors is gratefully acknowledged, as well as ideas | |||
| from: | from: | |||
| o Ryan Hamilton | * Ryan Hamilton | |||
| o Patrick McManus | * Patrick McManus | |||
| o Kazuho Oku | * Kazuho Oku | |||
| o Biren Roy | * Biren Roy | |||
| o Ian Swett | * Ian Swett | |||
| o Dmitri Tikhonov | * Dmitri Tikhonov | |||
| Buck's contribution was supported by Google during his employment | Buck's contribution was supported by Google during his employment | |||
| there. | there. | |||
| A substantial portion of Mike's contribution was supported by | A substantial portion of Mike's contribution was supported by | |||
| Microsoft during his employment there. | Microsoft during his employment there. | |||
| Authors' Addresses | Authors' Addresses | |||
| Charles 'Buck' Krasic | Charles 'Buck' Krasic | |||
| End of changes. 147 change blocks. | ||||
| 492 lines changed or deleted | 496 lines changed or added | |||
This html diff was produced by rfcdiff 1.45. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ | ||||