| draft-ietf-quic-qpack-17.txt | draft-ietf-quic-qpack-18.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: March 14, 2021 Akamai Technologies | Expires: 29 March 2021 Akamai Technologies | |||
| A. Frindell, Ed. | A. Frindell, Ed. | |||
| September 10, 2020 | 25 September 2020 | |||
| QPACK: Header Compression for HTTP/3 | QPACK: Header Compression for HTTP/3 | |||
| draft-ietf-quic-qpack-17 | draft-ietf-quic-qpack-18 | |||
| Abstract | Abstract | |||
| This specification defines QPACK, a compression format for | This specification defines QPACK, a compression format for | |||
| efficiently representing HTTP fields, to be used in HTTP/3. This is | efficiently representing HTTP fields, to be used in HTTP/3. This is | |||
| a variation of HPACK compression that seeks to reduce head-of-line | a variation of HPACK compression that seeks to reduce head-of-line | |||
| blocking. | blocking. | |||
| Note to Readers | Note to Readers | |||
| skipping to change at page 1, line 47 ¶ | skipping to change at page 1, line 47 ¶ | |||
| 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 March 14, 2021. | This Internet-Draft will expire on 29 March 2021. | |||
| Copyright Notice | Copyright Notice | |||
| Copyright (c) 2020 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 (https://trustee.ietf.org/ | Provisions Relating to IETF Documents (https://trustee.ietf.org/ | |||
| license-info) in effect on the date of publication of this document. | license-info) in effect on the date of publication of this document. | |||
| Please review these documents carefully, as they describe your rights | Please review these documents carefully, as they describe your rights | |||
| skipping to change at page 2, line 51 ¶ | skipping to change at page 2, line 51 ¶ | |||
| 3.2.5. Relative Indexing . . . . . . . . . . . . . . . . . . 14 | 3.2.5. Relative Indexing . . . . . . . . . . . . . . . . . . 14 | |||
| 3.2.6. Post-Base Indexing . . . . . . . . . . . . . . . . . 15 | 3.2.6. Post-Base Indexing . . . . . . . . . . . . . . . . . 15 | |||
| 4. Wire Format . . . . . . . . . . . . . . . . . . . . . . . . . 15 | 4. Wire Format . . . . . . . . . . . . . . . . . . . . . . . . . 15 | |||
| 4.1. Primitives . . . . . . . . . . . . . . . . . . . . . . . 15 | 4.1. Primitives . . . . . . . . . . . . . . . . . . . . . . . 15 | |||
| 4.1.1. Prefixed Integers . . . . . . . . . . . . . . . . . . 15 | 4.1.1. Prefixed Integers . . . . . . . . . . . . . . . . . . 15 | |||
| 4.1.2. String Literals . . . . . . . . . . . . . . . . . . . 15 | 4.1.2. String Literals . . . . . . . . . . . . . . . . . . . 15 | |||
| 4.2. Encoder and Decoder Streams . . . . . . . . . . . . . . . 16 | 4.2. Encoder and Decoder Streams . . . . . . . . . . . . . . . 16 | |||
| 4.3. Encoder Instructions . . . . . . . . . . . . . . . . . . 17 | 4.3. Encoder Instructions . . . . . . . . . . . . . . . . . . 17 | |||
| 4.3.1. Set Dynamic Table Capacity . . . . . . . . . . . . . 17 | 4.3.1. Set Dynamic Table Capacity . . . . . . . . . . . . . 17 | |||
| 4.3.2. Insert With Name Reference . . . . . . . . . . . . . 18 | 4.3.2. Insert With Name Reference . . . . . . . . . . . . . 18 | |||
| 4.3.3. Insert Without Name Reference . . . . . . . . . . . . 18 | 4.3.3. Insert With Literal Name . . . . . . . . . . . . . . 18 | |||
| 4.3.4. Duplicate . . . . . . . . . . . . . . . . . . . . . . 19 | 4.3.4. Duplicate . . . . . . . . . . . . . . . . . . . . . . 19 | |||
| 4.4. Decoder Instructions . . . . . . . . . . . . . . . . . . 19 | 4.4. Decoder Instructions . . . . . . . . . . . . . . . . . . 19 | |||
| 4.4.1. Section Acknowledgement . . . . . . . . . . . . . . . 19 | 4.4.1. Section Acknowledgement . . . . . . . . . . . . . . . 19 | |||
| 4.4.2. Stream Cancellation . . . . . . . . . . . . . . . . . 20 | 4.4.2. Stream Cancellation . . . . . . . . . . . . . . . . . 20 | |||
| 4.4.3. Insert Count Increment . . . . . . . . . . . . . . . 20 | 4.4.3. Insert Count Increment . . . . . . . . . . . . . . . 20 | |||
| 4.5. Field Line Representations . . . . . . . . . . . . . . . 20 | 4.5. Field Line Representations . . . . . . . . . . . . . . . 20 | |||
| 4.5.1. Encoded Field Section Prefix . . . . . . . . . . . . 21 | 4.5.1. Encoded Field Section Prefix . . . . . . . . . . . . 21 | |||
| 4.5.2. Indexed Field Line . . . . . . . . . . . . . . . . . 23 | 4.5.2. Indexed Field Line . . . . . . . . . . . . . . . . . 23 | |||
| 4.5.3. Indexed Field Line With Post-Base Index . . . . . . . 24 | 4.5.3. Indexed Field Line With Post-Base Index . . . . . . . 24 | |||
| 4.5.4. Literal Field Line With Name Reference . . . . . . . 24 | 4.5.4. Literal Field Line With Name Reference . . . . . . . 24 | |||
| 4.5.5. Literal Field Line With Post-Base Name Reference . . 25 | 4.5.5. Literal Field Line With Post-Base Name Reference . . 25 | |||
| 4.5.6. Literal Field Line Without Name Reference . . . . . . 25 | 4.5.6. Literal Field Line With Literal Name . . . . . . . . 25 | |||
| 5. Configuration . . . . . . . . . . . . . . . . . . . . . . . . 26 | 5. Configuration . . . . . . . . . . . . . . . . . . . . . . . . 26 | |||
| 6. Error Handling . . . . . . . . . . . . . . . . . . . . . . . 26 | 6. Error Handling . . . . . . . . . . . . . . . . . . . . . . . 26 | |||
| 7. Security Considerations . . . . . . . . . . . . . . . . . . . 27 | 7. Security Considerations . . . . . . . . . . . . . . . . . . . 27 | |||
| 7.1. Probing Dynamic Table State . . . . . . . . . . . . . . . 27 | 7.1. Probing Dynamic Table State . . . . . . . . . . . . . . . 27 | |||
| 7.2. Applicability to QPACK and HTTP . . . . . . . . . . . . . 28 | 7.2. Applicability to QPACK and HTTP . . . . . . . . . . . . . 28 | |||
| 7.3. Mitigation . . . . . . . . . . . . . . . . . . . . . . . 28 | 7.3. Mitigation . . . . . . . . . . . . . . . . . . . . . . . 28 | |||
| 7.4. Never-Indexed Literals . . . . . . . . . . . . . . . . . 29 | 7.4. Never-Indexed Literals . . . . . . . . . . . . . . . . . 29 | |||
| 7.5. Static Huffman Encoding . . . . . . . . . . . . . . . . . 30 | 7.5. Static Huffman Encoding . . . . . . . . . . . . . . . . . 30 | |||
| 7.6. Memory Consumption . . . . . . . . . . . . . . . . . . . 30 | 7.6. Memory Consumption . . . . . . . . . . . . . . . . . . . 30 | |||
| 7.7. Implementation Limits . . . . . . . . . . . . . . . . . . 31 | 7.7. Implementation Limits . . . . . . . . . . . . . . . . . . 31 | |||
| 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 32 | 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 32 | |||
| 8.1. Settings Registration . . . . . . . . . . . . . . . . . . 32 | 8.1. Settings Registration . . . . . . . . . . . . . . . . . . 32 | |||
| 8.2. Stream Type Registration . . . . . . . . . . . . . . . . 32 | 8.2. Stream Type Registration . . . . . . . . . . . . . . . . 32 | |||
| 8.3. Error Code Registration . . . . . . . . . . . . . . . . . 32 | 8.3. Error Code Registration . . . . . . . . . . . . . . . . . 32 | |||
| 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 33 | 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 33 | |||
| 9.1. Normative References . . . . . . . . . . . . . . . . . . 33 | 9.1. Normative References . . . . . . . . . . . . . . . . . . 33 | |||
| 9.2. Informative References . . . . . . . . . . . . . . . . . 34 | 9.2. Informative References . . . . . . . . . . . . . . . . . 34 | |||
| Appendix A. Static Table . . . . . . . . . . . . . . . . . . . . 34 | Appendix A. Static Table . . . . . . . . . . . . . . . . . . . . 34 | |||
| Appendix B. Sample One Pass Encoding Algorithm . . . . . . . . . 39 | Appendix B. Encoding and Decoding Examples . . . . . . . . . . . 39 | |||
| Appendix C. Change Log . . . . . . . . . . . . . . . . . . . . . 40 | B.1. Literal Field Line With Name Reference . . . . . . . . . 39 | |||
| C.1. Since draft-ietf-quic-qpack-16 . . . . . . . . . . . . . 40 | B.2. Dynamic Table . . . . . . . . . . . . . . . . . . . . . . 40 | |||
| C.2. Since draft-ietf-quic-qpack-15 . . . . . . . . . . . . . 41 | B.3. Speculative Insert . . . . . . . . . . . . . . . . . . . 41 | |||
| C.3. Since draft-ietf-quic-qpack-14 . . . . . . . . . . . . . 41 | B.4. Duplicate Instruction, Stream Cancellation . . . . . . . 42 | |||
| C.4. Since draft-ietf-quic-qpack-13 . . . . . . . . . . . . . 41 | B.5. Dynamic Table Insert, Eviction . . . . . . . . . . . . . 43 | |||
| C.5. Since draft-ietf-quic-qpack-12 . . . . . . . . . . . . . 41 | Appendix C. Sample One Pass Encoding Algorithm . . . . . . . . . 44 | |||
| C.6. Since draft-ietf-quic-qpack-11 . . . . . . . . . . . . . 41 | Appendix D. Change Log . . . . . . . . . . . . . . . . . . . . . 45 | |||
| C.7. Since draft-ietf-quic-qpack-10 . . . . . . . . . . . . . 41 | D.1. Since draft-ietf-quic-qpack-17 . . . . . . . . . . . . . 45 | |||
| C.8. Since draft-ietf-quic-qpack-09 . . . . . . . . . . . . . 41 | D.2. Since draft-ietf-quic-qpack-16 . . . . . . . . . . . . . 45 | |||
| C.9. Since draft-ietf-quic-qpack-08 . . . . . . . . . . . . . 41 | D.3. Since draft-ietf-quic-qpack-15 . . . . . . . . . . . . . 45 | |||
| C.10. Since draft-ietf-quic-qpack-06 . . . . . . . . . . . . . 41 | D.4. Since draft-ietf-quic-qpack-14 . . . . . . . . . . . . . 45 | |||
| C.11. Since draft-ietf-quic-qpack-05 . . . . . . . . . . . . . 41 | D.5. Since draft-ietf-quic-qpack-13 . . . . . . . . . . . . . 46 | |||
| C.12. Since draft-ietf-quic-qpack-04 . . . . . . . . . . . . . 42 | D.6. Since draft-ietf-quic-qpack-12 . . . . . . . . . . . . . 46 | |||
| C.13. Since draft-ietf-quic-qpack-03 . . . . . . . . . . . . . 42 | D.7. Since draft-ietf-quic-qpack-11 . . . . . . . . . . . . . 46 | |||
| C.14. Since draft-ietf-quic-qpack-02 . . . . . . . . . . . . . 42 | D.8. Since draft-ietf-quic-qpack-10 . . . . . . . . . . . . . 46 | |||
| C.15. Since draft-ietf-quic-qpack-01 . . . . . . . . . . . . . 42 | D.9. Since draft-ietf-quic-qpack-09 . . . . . . . . . . . . . 46 | |||
| C.16. Since draft-ietf-quic-qpack-00 . . . . . . . . . . . . . 42 | D.10. Since draft-ietf-quic-qpack-08 . . . . . . . . . . . . . 46 | |||
| C.17. Since draft-ietf-quic-qcram-00 . . . . . . . . . . . . . 43 | D.11. Since draft-ietf-quic-qpack-06 . . . . . . . . . . . . . 46 | |||
| D.12. Since draft-ietf-quic-qpack-05 . . . . . . . . . . . . . 46 | ||||
| Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 43 | D.13. Since draft-ietf-quic-qpack-04 . . . . . . . . . . . . . 46 | |||
| Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 44 | D.14. Since draft-ietf-quic-qpack-03 . . . . . . . . . . . . . 47 | |||
| D.15. Since draft-ietf-quic-qpack-02 . . . . . . . . . . . . . 47 | ||||
| D.16. Since draft-ietf-quic-qpack-01 . . . . . . . . . . . . . 47 | ||||
| D.17. Since draft-ietf-quic-qpack-00 . . . . . . . . . . . . . 47 | ||||
| D.18. Since draft-ietf-quic-qcram-00 . . . . . . . . . . . . . 48 | ||||
| Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 48 | ||||
| Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 49 | ||||
| 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 compression of | HTTP/2 ([RFC7540]). HTTP/2 uses HPACK ([RFC7541]) for compression of | |||
| the header and trailer sections. If HPACK were used for HTTP/3 | the header and trailer sections. If HPACK were used for HTTP/3 | |||
| ([HTTP3]), it would induce head-of-line blocking for field sections | ([HTTP3]), it would induce head-of-line blocking for field sections | |||
| due to built-in assumptions of a total ordering across frames on all | due to built-in assumptions of a total ordering across frames on all | |||
| streams. | streams. | |||
| skipping to change at page 18, line 31 ¶ | skipping to change at page 18, line 31 ¶ | |||
| +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ | |||
| | 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) | | |||
| +-------------------------------+ | +-------------------------------+ | |||
| Figure 6: Insert Field Line -- Indexed Name | Figure 6: Insert Field Line -- Indexed Name | |||
| 4.3.3. Insert Without Name Reference | 4.3.3. Insert With Literal Name | |||
| An encoder adds an entry to the dynamic table where both the field | An encoder adds an entry to the dynamic table where both the field | |||
| name and the field value are represented as string literals using an | name and the field value are represented as string literals using an | |||
| instruction that starts with the '01' two-bit pattern. | instruction that starts with the '01' two-bit 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 | |||
| skipping to change at page 25, line 48 ¶ | skipping to change at page 25, line 48 ¶ | |||
| 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 | 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 field name is taken from the dynamic table entry; the field | Only the field name is taken from the dynamic table entry; the field | |||
| value is encoded as an 8-bit prefix string literal; see | value is encoded as an 8-bit prefix string literal; see | |||
| Section 4.1.2. | Section 4.1.2. | |||
| 4.5.6. Literal Field Line Without Name Reference | 4.5.6. Literal Field Line With Literal Name | |||
| The literal field line without name reference representation encodes | The literal field line with literal name representation encodes a | |||
| a field name and a field value as string literals. | field name and a field value as string 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) | | |||
| +-------------------------------+ | +-------------------------------+ | |||
| Figure 17: Literal Field Line Without Name Reference | Figure 17: Literal Field Line With Literal Name | |||
| 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 for the HTTP/3 SETTINGS frame: | QPACK defines two settings for the HTTP/3 SETTINGS frame: | |||
| skipping to change at page 27, line 33 ¶ | skipping to change at page 27, line 33 ¶ | |||
| The compression context used to encode header and trailer fields can | The compression context used to encode header and trailer fields can | |||
| be probed by an attacker who can both define fields to be encoded and | be probed by an attacker who can both define fields to be encoded and | |||
| transmitted and observe the length of those fields once they are | transmitted and observe the length of those fields once they are | |||
| encoded. When an attacker can do both, they can adaptively modify | encoded. When an attacker can do both, they can adaptively modify | |||
| requests in order to confirm guesses about the dynamic table state. | requests in order to confirm guesses about the dynamic table state. | |||
| If a guess is compressed into a shorter length, the attacker can | If a guess is compressed into a shorter length, the attacker can | |||
| observe the encoded length and infer that the guess was correct. | observe the encoded length and infer that the guess was correct. | |||
| This is possible even over the Transport Layer Security Protocol | This is possible even over the Transport Layer Security Protocol | |||
| (TLS, see [RFC5246]), because while TLS provides confidentiality | (TLS, see [TLS]), because while TLS provides confidentiality | |||
| protection for content, it only provides a limited amount of | protection for content, it only provides a limited amount of | |||
| protection for the length of that content. | protection for the length of that content. | |||
| Note: Padding schemes only provide limited protection against an | Note: Padding schemes only provide limited protection against an | |||
| attacker with these capabilities, potentially only forcing an | attacker with these capabilities, potentially only forcing an | |||
| increased number of guesses to learn the length associated with a | increased number of guesses to learn the length associated with a | |||
| given guess. Padding schemes also work directly against | given guess. Padding schemes also work directly against | |||
| compression by increasing the number of bits that are transmitted. | compression by increasing the number of bits that are transmitted. | |||
| Attacks like CRIME ([CRIME]) demonstrated the existence of these | Attacks like CRIME ([CRIME]) demonstrated the existence of these | |||
| skipping to change at page 33, line 30 ¶ | skipping to change at page 33, line 30 ¶ | |||
| +----------------------------+-------+-------------+---------------+ | +----------------------------+-------+-------------+---------------+ | |||
| Table 3 | 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)", Work in Progress, Internet-Draft, draft-ietf- | (HTTP/3)", Work in Progress, Internet-Draft, draft-ietf- | |||
| quic-http-30, September 10, 2020, | quic-http-31, 25 September 2020, | |||
| <https://tools.ietf.org/html/draft-ietf-quic-http-30>. | <https://tools.ietf.org/html/draft-ietf-quic-http-31>. | |||
| [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", Work in Progress, | Multiplexed and Secure Transport", Work in Progress, | |||
| Internet-Draft, draft-ietf-quic-transport-30, September | Internet-Draft, draft-ietf-quic-transport-31, 25 September | |||
| 10, 2020, <https://tools.ietf.org/html/draft-ietf-quic- | 2020, <https://tools.ietf.org/html/draft-ietf-quic- | |||
| transport-30>. | transport-31>. | |||
| [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>. | |||
| [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC | [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC | |||
| 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, | 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, | |||
| May 2017, <https://www.rfc-editor.org/info/rfc8174>. | May 2017, <https://www.rfc-editor.org/info/rfc8174>. | |||
| [SEMANTICS] | [SEMANTICS] | |||
| Fielding, R., Nottingham, M., and J. Reschke, "HTTP | Fielding, R., Nottingham, M., and J. Reschke, "HTTP | |||
| Semantics", Work in Progress, Internet-Draft, draft-ietf- | Semantics", Work in Progress, Internet-Draft, draft-ietf- | |||
| httpbis-semantics-11, August 27, 2020, | httpbis-semantics-11, 27 August 2020, | |||
| <http://www.ietf.org/internet-drafts/draft-ietf-httpbis- | <http://www.ietf.org/internet-drafts/draft-ietf-httpbis- | |||
| semantics-11.txt>. | semantics-11.txt>. | |||
| 9.2. Informative References | 9.2. Informative References | |||
| [CRIME] Wikipedia, "CRIME", May 2015, <http://en.wikipedia.org/w/ | [CRIME] Wikipedia, "CRIME", May 2015, <http://en.wikipedia.org/w/ | |||
| index.php?title=CRIME&oldid=660948120>. | index.php?title=CRIME&oldid=660948120>. | |||
| [PETAL] Tan, J. and J. Nahata, "PETAL: Preset Encoding | [PETAL] Tan, J. and J. Nahata, "PETAL: Preset Encoding | |||
| Table Information Leakage", April 2013, | Table Information Leakage", April 2013, | |||
| skipping to change at page 34, line 30 ¶ | skipping to change at page 34, line 30 ¶ | |||
| 13-106.pdf>. | 13-106.pdf>. | |||
| [RFC1951] Deutsch, P., "DEFLATE Compressed Data Format Specification | [RFC1951] Deutsch, P., "DEFLATE Compressed Data Format Specification | |||
| version 1.3", RFC 1951, DOI 10.17487/RFC1951, May 1996, | version 1.3", RFC 1951, DOI 10.17487/RFC1951, May 1996, | |||
| <https://www.rfc-editor.org/info/rfc1951>. | <https://www.rfc-editor.org/info/rfc1951>. | |||
| [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>. | |||
| [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security | ||||
| (TLS) Protocol Version 1.2", RFC 5246, | ||||
| DOI 10.17487/RFC5246, August 2008, | ||||
| <https://www.rfc-editor.org/info/rfc5246>. | ||||
| [RFC6454] Barth, A., "The Web Origin Concept", RFC 6454, | [RFC6454] Barth, A., "The Web Origin Concept", RFC 6454, | |||
| DOI 10.17487/RFC6454, December 2011, | DOI 10.17487/RFC6454, December 2011, | |||
| <https://www.rfc-editor.org/info/rfc6454>. | <https://www.rfc-editor.org/info/rfc6454>. | |||
| [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>. | |||
| [TLS] Rescorla, E., "The Transport Layer Security (TLS) Protocol | ||||
| Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, | ||||
| <https://www.rfc-editor.org/info/rfc8446>. | ||||
| Appendix A. Static Table | Appendix A. Static Table | |||
| This table was generated by analyzing actual Internet traffic in 2018 | This table was generated by analyzing actual Internet traffic in 2018 | |||
| and including the most common header fields, after filtering out some | and including the most common header fields, after filtering out some | |||
| unsupported and non-standard values. Due to this methodology, some | unsupported and non-standard values. Due to this methodology, some | |||
| of the entries may be inconsistent or appear multiple times with | of the entries may be inconsistent or appear multiple times with | |||
| similar but not identical values. The order of the entries is | similar but not identical values. The order of the entries is | |||
| optimized to encode the most common header fields with the smallest | optimized to encode the most common header fields with the smallest | |||
| number of bytes. | number of bytes. | |||
| skipping to change at page 39, line 28 ¶ | skipping to change at page 39, line 28 ¶ | |||
| +-------+----------------------------------+-----------------------+ | +-------+----------------------------------+-----------------------+ | |||
| | 96 | x-forwarded-for | | | | 96 | x-forwarded-for | | | |||
| +-------+----------------------------------+-----------------------+ | +-------+----------------------------------+-----------------------+ | |||
| | 97 | x-frame-options | deny | | | 97 | x-frame-options | deny | | |||
| +-------+----------------------------------+-----------------------+ | +-------+----------------------------------+-----------------------+ | |||
| | 98 | x-frame-options | sameorigin | | | 98 | x-frame-options | sameorigin | | |||
| +-------+----------------------------------+-----------------------+ | +-------+----------------------------------+-----------------------+ | |||
| Table 4 | Table 4 | |||
| Appendix B. Sample One Pass Encoding Algorithm | Appendix B. Encoding and Decoding Examples | |||
| The following examples represent a series of exchanges between an | ||||
| encoder and a decoder. The exchanges are designed to exercise most | ||||
| QPACK instructions, and highlight potentially common patterns and | ||||
| their impact on dynamic table state. The encoder sends three encoded | ||||
| field sections containing one field line each, as wells as two | ||||
| speculative inserts that are not referenced. | ||||
| The state of the encoder's dynamic table is shown, along with its | ||||
| current size. Each entry is shown with the Absolute Index of the | ||||
| entry (Abs), the current number of outstanding encoded field sections | ||||
| with references to that entry (Ref), along with the name and value. | ||||
| Entries above the 'acknowledged' line have been acknowledged by the | ||||
| decoder. | ||||
| B.1. Literal Field Line With Name Reference | ||||
| The encoder sends an encoded field section containing a literal | ||||
| representation of a field with a static name reference. | ||||
| Data | Interpretation | ||||
| | Encoder's Dynamic Table | ||||
| Stream: 0 | ||||
| 0000 | Required Insert Count = 0, Base = 0 | ||||
| 510b 2f69 6e64 6578 | Literal Field Line with Name Reference | ||||
| 2e68 746d 6c | Static Table, Index=1 | ||||
| | (:path=/index.html) | ||||
| Abs Ref Name Value | ||||
| ^-- acknowledged --^ | ||||
| Size=0 | ||||
| B.2. Dynamic Table | ||||
| The encoder sets the dynamic table capacity, inserts a header with a | ||||
| dynamic name reference, then sends a potentially blocking, encoded | ||||
| field section referencing this new entry. The decoder acknowledges | ||||
| processing the encoded field section, which implicitly acknowledges | ||||
| all dynamic table insertions up to the Required Insert Count. | ||||
| Stream: Encoder | ||||
| 3fbd01 | Set Dynamic Table Capacity=220 | ||||
| c00f 7777 772e 6578 | Insert With Name Reference | ||||
| 616d 706c 652e 636f | Static Table, Index=0 | ||||
| 6d | (:authority=www.example.com) | ||||
| c10c 2f73 616d 706c | Insert With Name Reference | ||||
| 652f 7061 7468 | Static Table, Index=1 | ||||
| | (:path=/sample/path) | ||||
| Abs Ref Name Value | ||||
| ^-- acknowledged --^ | ||||
| 1 0 :authority www.example.com | ||||
| 2 0 :path /sample/path | ||||
| Size=106 | ||||
| Stream: 4 | ||||
| 0381 | Required Insert Count = 2, Base = 0 | ||||
| 10 | Indexed Field Line With Post-Base Index | ||||
| | Absolute Index = Base(0) + Index(0) + 1 = 1 | ||||
| | (:authority=www.example.com) | ||||
| 11 | Indexed Field Line With Post-Base Index | ||||
| | Absolute Index = Base(0) + Index(1) + 1 = 2 | ||||
| | (:path=/sample/path) | ||||
| Abs Ref Name Value | ||||
| ^-- acknowledged --^ | ||||
| 1 1 :authority www.example.com | ||||
| 2 1 :path /sample/path | ||||
| Size=106 | ||||
| Stream: Decoder | ||||
| 84 | Section Acknowledgement (stream=4) | ||||
| Abs Ref Name Value | ||||
| 1 0 :authority www.example.com | ||||
| 2 0 :path /sample/path | ||||
| ^-- acknowledged --^ | ||||
| Size=106 | ||||
| B.3. Speculative Insert | ||||
| The encoder inserts a header into the dynamic table with a literal | ||||
| name. The decoder acknowledges receipt of the entry. The encoder | ||||
| does not send any encoded field sections. | ||||
| Stream: Encoder | ||||
| 4a63 7573 746f 6d2d | Insert With Literal Name | ||||
| 6b65 790c 6375 7374 | (custom-key=custom-value) | ||||
| 6f6d 2d76 616c 7565 | | ||||
| Abs Ref Name Value | ||||
| 1 0 :authority www.example.com | ||||
| 2 0 :path /sample/path | ||||
| ^-- acknowledged --^ | ||||
| 3 0 custom-key custom-value | ||||
| Size=160 | ||||
| Stream: Decoder | ||||
| 01 | Insert Count Increment (1) | ||||
| Abs Ref Name Value | ||||
| 1 0 :authority www.example.com | ||||
| 2 0 :path /sample/path | ||||
| 3 0 custom-key custom-value | ||||
| ^-- acknowledged --^ | ||||
| Size=160 | ||||
| B.4. Duplicate Instruction, Stream Cancellation | ||||
| The encoder duplicates an existing entry in the dynamic table, then | ||||
| sends an encoded field section referencing the dynamic table entries | ||||
| including the duplicated entry. The decoder notifies the encoder | ||||
| that the encoded field section was not processed by sending a stream | ||||
| cancellation. | ||||
| Stream: Encoder | ||||
| 02 | Duplicate (Relative Index=2) | ||||
| Abs Ref Name Value | ||||
| 1 0 :authority www.example.com | ||||
| 2 0 :path /sample/path | ||||
| 3 0 custom-key custom-value | ||||
| ^-- acknowledged --^ | ||||
| 4 0 :authority www.example.com | ||||
| Size=217 | ||||
| Stream: 8 | ||||
| 0500 | Required Insert Count = 4, Base = 4 | ||||
| 80 | Indexed Field Line, Dynamic Table | ||||
| | Absolute Index = Base(4) - Index(0) = 4 | ||||
| | (:authority=www.example.com) | ||||
| c1 | Indexed Field Line, Static Table Index = 1 | ||||
| | (:path=/) | ||||
| 81 | Indexed Field Line, Dynamic Table | ||||
| | Absolute Index = Base(4) - Index(1) = 3 | ||||
| | (custom-key=custom-value) | ||||
| Abs Ref Name Value | ||||
| 1 0 :authority www.example.com | ||||
| 2 0 :path /sample/path | ||||
| 3 1 custom-key custom-value | ||||
| ^-- acknowledged --^ | ||||
| 4 1 :authority www.example.com | ||||
| Size=217 | ||||
| Stream: Decoder | ||||
| 48 | Stream Cancellation (Stream=8) | ||||
| Abs Ref Name Value | ||||
| 1 0 :authority www.example.com | ||||
| 2 0 :path /sample/path | ||||
| 3 0 custom-key custom-value | ||||
| ^-- acknowledged --^ | ||||
| 4 0 :authority www.example.com | ||||
| Size=215 | ||||
| B.5. Dynamic Table Insert, Eviction | ||||
| The encoder inserts another header into the dynamic table, which | ||||
| evicts the oldest entry. The encoder does not send any encoded field | ||||
| sections. | ||||
| Stream: Encoder | ||||
| 810d 6375 7374 6f6d | Insert With Name Reference | ||||
| 2d76 616c 7565 32 | Dynamic Table, Absolute Index=2 | ||||
| | (custom-key=custom-value2) | ||||
| Abs Ref Name Value | ||||
| 2 0 :path /sample/path | ||||
| 3 0 custom-key custom-value | ||||
| ^-- acknowledged --^ | ||||
| 4 0 :authority www.example.com | ||||
| 5 0 custom-key custom-value2 | ||||
| Size=215 | ||||
| Appendix C. 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, available encoder stream flow control | duplicates, non-blocking mode, available encoder stream flow control | |||
| and reference tracking. | and reference tracking. | |||
| base = dynamicTable.getInsertCount() | base = dynamicTable.getInsertCount() | |||
| requiredInsertCount = 0 | requiredInsertCount = 0 | |||
| for line in field_lines: | for line in field_lines: | |||
| staticIndex = staticTable.findIndex(line) | staticIndex = staticTable.findIndex(line) | |||
| if staticIndex is not None: | if staticIndex is not None: | |||
| skipping to change at page 40, line 43 ¶ | skipping to change at page 45, line 32 ¶ | |||
| ) + 1; | ) + 1; | |||
| encodeInteger(prefixBuffer, 0x00, wireRIC, 8) | encodeInteger(prefixBuffer, 0x00, wireRIC, 8) | |||
| if base >= requiredInsertCount: | if base >= requiredInsertCount: | |||
| encodeInteger(prefixBuffer, 0, base - requiredInsertCount, 7) | encodeInteger(prefixBuffer, 0, base - requiredInsertCount, 7) | |||
| else: | else: | |||
| encodeInteger(prefixBuffer, 0x80, | encodeInteger(prefixBuffer, 0x80, | |||
| requiredInsertCount - base - 1, 7) | requiredInsertCount - base - 1, 7) | |||
| return encoderBuffer, prefixBuffer + streamBuffer | return encoderBuffer, prefixBuffer + streamBuffer | |||
| Appendix C. Change Log | Appendix D. 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-16 | D.1. Since draft-ietf-quic-qpack-17 | |||
| Editorial changes only | Editorial changes only | |||
| C.2. Since draft-ietf-quic-qpack-15 | D.2. Since draft-ietf-quic-qpack-16 | |||
| Editorial changes only | ||||
| D.3. Since draft-ietf-quic-qpack-15 | ||||
| No changes | No changes | |||
| C.3. Since draft-ietf-quic-qpack-14 | D.4. Since draft-ietf-quic-qpack-14 | |||
| Added security considerations | Added security considerations | |||
| C.4. Since draft-ietf-quic-qpack-13 | D.5. Since draft-ietf-quic-qpack-13 | |||
| No changes | No changes | |||
| C.5. Since draft-ietf-quic-qpack-12 | D.6. Since draft-ietf-quic-qpack-12 | |||
| Editorial changes only | Editorial changes only | |||
| C.6. Since draft-ietf-quic-qpack-11 | D.7. Since draft-ietf-quic-qpack-11 | |||
| Editorial changes only | Editorial changes only | |||
| C.7. Since draft-ietf-quic-qpack-10 | D.8. Since draft-ietf-quic-qpack-10 | |||
| Editorial changes only | Editorial changes only | |||
| C.8. Since draft-ietf-quic-qpack-09 | D.9. Since draft-ietf-quic-qpack-09 | |||
| * Decoders MUST emit Header Acknowledgements (#2939) | * Decoders MUST emit Header Acknowledgements (#2939) | |||
| * Updated error code for multiple encoder or decoder streams (#2970) | * Updated error code for multiple encoder or decoder streams (#2970) | |||
| * Added explicit defaults for new SETTINGS (#2974) | * Added explicit defaults for new SETTINGS (#2974) | |||
| C.9. Since draft-ietf-quic-qpack-08 | D.10. Since draft-ietf-quic-qpack-08 | |||
| * Endpoints are permitted to create encoder and decoder streams even | * 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) | |||
| * Maximum values for settings removed (#2766, #2767) | * Maximum values for settings removed (#2766, #2767) | |||
| C.10. Since draft-ietf-quic-qpack-06 | D.11. Since draft-ietf-quic-qpack-06 | |||
| * Clarify initial dynamic table capacity maximums (#2276, #2330, | * Clarify initial dynamic table capacity maximums (#2276, #2330, | |||
| #2330) | #2330) | |||
| C.11. Since draft-ietf-quic-qpack-05 | D.12. Since draft-ietf-quic-qpack-05 | |||
| * Introduced the terms dynamic table capacity and maximum dynamic | * Introduced the terms dynamic table capacity and maximum dynamic | |||
| table capacity. | table capacity. | |||
| * Renamed SETTINGS_HEADER_TABLE_SIZE to | * Renamed SETTINGS_HEADER_TABLE_SIZE to | |||
| SETTINGS_QPACK_MAX_TABLE_CAPACITY. | SETTINGS_QPACK_MAX_TABLE_CAPACITY. | |||
| C.12. Since draft-ietf-quic-qpack-04 | D.13. Since draft-ietf-quic-qpack-04 | |||
| * 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.13. Since draft-ietf-quic-qpack-03 | D.14. Since draft-ietf-quic-qpack-03 | |||
| * Change HTTP settings defaults (#2038) | * Change HTTP settings defaults (#2038) | |||
| * Substantial editorial reorganization | * Substantial editorial reorganization | |||
| C.14. Since draft-ietf-quic-qpack-02 | D.15. Since draft-ietf-quic-qpack-02 | |||
| * Largest Reference encoded modulo MaxEntries (#1763) | * Largest Reference encoded modulo MaxEntries (#1763) | |||
| * New Static Table (#1355) | * New Static Table (#1355) | |||
| * Table Size Update with Insert Count=0 is a connection error | * Table Size Update with Insert Count=0 is a connection error | |||
| (#1762) | (#1762) | |||
| * Stream Cancellations are optional when | * Stream Cancellations are optional when | |||
| SETTINGS_HEADER_TABLE_SIZE=0 (#1761) | SETTINGS_HEADER_TABLE_SIZE=0 (#1761) | |||
| skipping to change at page 42, line 41 ¶ | skipping to change at page 47, line 33 ¶ | |||
| * Implementations must handle 62 bit integers (#1760) | * Implementations must handle 62 bit integers (#1760) | |||
| * 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) | |||
| * Preserve header field order (#1725) | * Preserve header field order (#1725) | |||
| * 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.15. Since draft-ietf-quic-qpack-01 | D.16. Since draft-ietf-quic-qpack-01 | |||
| * 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.16. Since draft-ietf-quic-qpack-00 | D.17. Since draft-ietf-quic-qpack-00 | |||
| * Renumbered instructions for consistency (#1471, #1472) | * Renumbered instructions for consistency (#1471, #1472) | |||
| * Decoder is allowed to validate largest reference (#1404, #1469) | * Decoder is allowed to validate largest reference (#1404, #1469) | |||
| * Header block acknowledgments also acknowledge the associated | * Header block acknowledgments also acknowledge the associated | |||
| largest reference (#1370, #1400) | largest reference (#1370, #1400) | |||
| * Added an acknowledgment for unread streams (#1371, #1400) | * Added an acknowledgment for unread streams (#1371, #1400) | |||
| * Removed framing from encoder stream (#1361,#1467) | * Removed framing from encoder stream (#1361,#1467) | |||
| * 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.17. Since draft-ietf-quic-qcram-00 | D.18. Since draft-ietf-quic-qcram-00 | |||
| * Separate instruction sets for table updates and header blocks | * Separate instruction sets for table updates and header blocks | |||
| (#1235, #1142, #1141) | (#1235, #1142, #1141) | |||
| * Reworked indexing scheme (#1176, #1145, #1136, #1130, #1125, | * Reworked indexing scheme (#1176, #1145, #1136, #1130, #1125, | |||
| #1314) | #1314) | |||
| * Added mechanisms that support one-pass encoding (#1138, #1320) | * Added mechanisms that support one-pass encoding (#1138, #1320) | |||
| * Added a setting to control the number of blocked decoders (#238, | * Added a setting to control the number of blocked decoders (#238, | |||
| End of changes. 37 change blocks. | ||||
| 64 lines changed or deleted | 251 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/ | ||||