| rfc9659.original | rfc9659.txt | |||
|---|---|---|---|---|
| HTTPBIS N. Jaju, Ed. | Internet Engineering Task Force (IETF) N. Jaju, Ed. | |||
| Internet-Draft Google | Request for Comments: 9659 Google | |||
| Updates: 8878 (if approved) F. Handte, Ed. | Updates: 8878 W. F. Handte, Ed. | |||
| Intended status: Informational Meta Platforms, Inc. | Category: Informational Meta Platforms, Inc. | |||
| Expires: 24 February 2025 23 August 2024 | ISSN: 2070-1721 September 2024 | |||
| Window Sizing for Zstandard Content Encoding | Window Sizing for Zstandard Content Encoding | |||
| draft-ietf-httpbis-zstd-window-size-03 | ||||
| Abstract | Abstract | |||
| Deployments of Zstandard, or "zstd", can use different window sizes | Deployments of Zstandard, or "zstd", can use different window sizes | |||
| to limit memory usage during compression and decompression. Some | to limit memory usage during compression and decompression. Some | |||
| browsers and user agents limit window sizes to mitigate memory usage | browsers and user agents limit window sizes to mitigate memory usage | |||
| concerns, causing interoperability issues. This document updates the | concerns, thereby causing interoperability issues. This document | |||
| window size limit in RFC8878 from a recommendation to a requirement | updates the window size limit in RFC 8878 from a recommendation to a | |||
| in HTTP contexts. | requirement in HTTP contexts. | |||
| About This Document | ||||
| This note is to be removed before publishing as an RFC. | ||||
| The latest revision of this draft can be found at https://httpwg.org/ | ||||
| http-extensions/draft-ietf-httpbis-zstd-window-size.html. Status | ||||
| information for this document may be found at | ||||
| https://datatracker.ietf.org/doc/draft-ietf-httpbis-zstd-window- | ||||
| size/. | ||||
| Discussion of this document takes place on the HTTP Working Group | ||||
| mailing list (mailto:ietf-http-wg@w3.org), which is archived at | ||||
| https://lists.w3.org/Archives/Public/ietf-http-wg/. | ||||
| Source for this draft and an issue tracker can be found at | ||||
| https://github.com/httpwg/http-extensions/labels/zstd-window-size. | ||||
| Status of This Memo | Status of This Memo | |||
| This Internet-Draft is submitted in full conformance with the | This document is not an Internet Standards Track specification; it is | |||
| provisions of BCP 78 and BCP 79. | published for informational purposes. | |||
| Internet-Drafts are working documents of the Internet Engineering | ||||
| Task Force (IETF). Note that other groups may also distribute | ||||
| working documents as Internet-Drafts. The list of current Internet- | ||||
| Drafts is at https://datatracker.ietf.org/drafts/current/. | ||||
| Internet-Drafts are draft documents valid for a maximum of six months | This document is a product of the Internet Engineering Task Force | |||
| and may be updated, replaced, or obsoleted by other documents at any | (IETF). It represents the consensus of the IETF community. It has | |||
| time. It is inappropriate to use Internet-Drafts as reference | received public review and has been approved for publication by the | |||
| material or to cite them other than as "work in progress." | Internet Engineering Steering Group (IESG). Not all documents | |||
| approved by the IESG are candidates for any level of Internet | ||||
| Standard; see Section 2 of RFC 7841. | ||||
| This Internet-Draft will expire on 24 February 2025. | Information about the current status of this document, any errata, | |||
| and how to provide feedback on it may be obtained at | ||||
| https://www.rfc-editor.org/info/rfc9659. | ||||
| Copyright Notice | Copyright Notice | |||
| Copyright (c) 2024 IETF Trust and the persons identified as the | Copyright (c) 2024 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 | |||
| license-info) in effect on the date of publication of this document. | (https://trustee.ietf.org/license-info) in effect on the date of | |||
| Please review these documents carefully, as they describe your rights | publication of this document. Please review these documents | |||
| and restrictions with respect to this document. Code Components | carefully, as they describe your rights and restrictions with respect | |||
| extracted from this document must include Revised BSD License text as | to this document. Code Components extracted from this document must | |||
| described in Section 4.e of the Trust Legal Provisions and are | include Revised BSD License text as described in Section 4.e of the | |||
| provided without warranty as described in the Revised BSD License. | Trust Legal Provisions and are provided without warranty as described | |||
| in the Revised BSD License. | ||||
| Table of Contents | Table of Contents | |||
| 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 | 1. Introduction | |||
| 2. Conventions and Definitions . . . . . . . . . . . . . . . . . 3 | 2. Conventions and Definitions | |||
| 3. Window Size . . . . . . . . . . . . . . . . . . . . . . . . . 3 | 3. Window Size | |||
| 4. Security Considerations . . . . . . . . . . . . . . . . . . . 3 | 4. Security Considerations | |||
| 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 3 | 5. IANA Considerations | |||
| 5.1. Content Encoding . . . . . . . . . . . . . . . . . . . . 4 | 5.1. Content Encoding | |||
| 6. Normative References . . . . . . . . . . . . . . . . . . . . 4 | 6. Normative References | |||
| Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 4 | Acknowledgments | |||
| Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 4 | Authors' Addresses | |||
| 1. Introduction | 1. Introduction | |||
| Zstandard, or "zstd", specified in [RFC8878], is a lossless data | Zstandard, or "zstd", specified in [RFC8878], is a lossless data | |||
| compression mechanism similar to gzip. When used with HTTP, the | compression mechanism similar to gzip. When used with HTTP, the | |||
| "zstd" content coding token signals to the decoder that the content | "zstd" content coding token signals to the decoder that the content | |||
| is Zstandard-compressed. | is Zstandard-compressed. | |||
| An important property of Zstandard-compressed content is its | An important property of Zstandard-compressed content is its | |||
| Window_Size ([RFC8878], Section 3.1.1.1.2), which describes the | Window_Size ([RFC8878], Section 3.1.1.1.2), which describes the | |||
| maximum distance for back-references and therefore how much of the | maximum distance for back-references and therefore how much of the | |||
| content must be kept in memory during decompression. | content must be kept in memory during decompression. | |||
| The minimum Window_Size is 1 KB. The maximum Window_Size is (1<<41) | The minimum Window_Size is 1 KB. The maximum Window_Size is (1<<41) | |||
| + 7*(1<<38) bytes, which is 3.75 TB. Larger Window_Size values tend | + 7*(1<<38) bytes, where "<<" denotes a bitwise left shift, which is | |||
| to improve the compression ratio, but at the cost of increased memory | 3.75 TB. Larger Window_Size values tend to improve the compression | |||
| usage. | ratio but at the cost of increased memory usage. | |||
| To protect against unreasonable memory usage, some browsers and user | To protect against unreasonable memory usage, some browsers and user | |||
| agents limit the maximum Window_Size they will handle. This causes | agents limit the maximum Window_Size they will handle. This causes | |||
| failures to decode responses when the content is compressed with a | failures to decode responses when the content is compressed with a | |||
| larger Window_Size than the recipient allows, leading to decreased | larger Window_Size than the recipient allows, leading to decreased | |||
| interoperability. | interoperability. | |||
| [RFC8878], Section 3.1.1.1.2 recommends that decoders support a | [RFC8878], Section 3.1.1.1.2 recommends that decoders support a | |||
| Window_Size of up to 8 MB, and that encoders not generate frames | Window_Size of up to 8 MB, and that encoders not generate frames | |||
| using a Window_Size larger than 8 MB. However, it imposes no | using a Window_Size larger than 8 MB. However, it imposes no | |||
| skipping to change at page 4, line 4 ¶ | skipping to change at line 119 ¶ | |||
| This document introduces no new security considerations beyond those | This document introduces no new security considerations beyond those | |||
| discussed in [RFC8878]. | discussed in [RFC8878]. | |||
| Note that decoders still need to take into account that they can | Note that decoders still need to take into account that they can | |||
| receive oversized frames that do not follow the window size limit | receive oversized frames that do not follow the window size limit | |||
| specified in this document and fail decoding when such invalid frames | specified in this document and fail decoding when such invalid frames | |||
| are received. | are received. | |||
| 5. IANA Considerations | 5. IANA Considerations | |||
| 5.1. Content Encoding | 5.1. Content Encoding | |||
| This document updates the entry added in [RFC8878] to the "HTTP | This document updates the following entry in the "HTTP Content Coding | |||
| Content Coding Registry" (https://www.iana.org/assignments/http- | Registry" in the "Hypertext Transfer Protocol (HTTP) Parameters" | |||
| parameters/http-parameters.xhtml#content-coding) within the | registry group (https://www.iana.org/assignments/http-parameters): | |||
| "Hypertext Transfer Protocol (HTTP) Parameters" | ||||
| (https://www.iana.org/assignments/http-parameters/http- | ||||
| parameters.xhtml) registry: | ||||
| Name: zstd | Name: zstd | |||
| Description: A stream of bytes compressed using the Zstandard | Description: A stream of bytes compressed using the Zstandard | |||
| protocol with a Window_Size of not more than 8 MB. | protocol with a Window_Size of not more than 8 MB. | |||
| Reference: This document and [RFC8878] | Reference: This document and [RFC8878] | |||
| 6. Normative References | 6. Normative References | |||
| [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/rfc/rfc2119>. | <https://www.rfc-editor.org/info/rfc2119>. | |||
| [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/rfc/rfc8174>. | May 2017, <https://www.rfc-editor.org/info/rfc8174>. | |||
| [RFC8878] Collet, Y. and M. Kucherawy, Ed., "Zstandard Compression | [RFC8878] Collet, Y. and M. Kucherawy, Ed., "Zstandard Compression | |||
| and the 'application/zstd' Media Type", RFC 8878, | and the 'application/zstd' Media Type", RFC 8878, | |||
| DOI 10.17487/RFC8878, February 2021, | DOI 10.17487/RFC8878, February 2021, | |||
| <https://www.rfc-editor.org/rfc/rfc8878>. | <https://www.rfc-editor.org/info/rfc8878>. | |||
| Acknowledgments | Acknowledgments | |||
| Zstandard was developed by Yann Collet. | Zstandard was developed by Yann Collet. | |||
| The authors would like to thank Yann Collet, Klaus Post, Adam Rice, | The authors would like to thank Yann Collet, Klaus Post, Adam Rice, | |||
| and members of the Web Performance Working Group in the W3C for | and members of the Web Performance Working Group in the W3C for | |||
| collaborating on the window size issue and helping to formulate a | collaborating on the window size issue and helping to formulate a | |||
| solution. Also, thank you to Nick Terrell for providing feedback | solution. | |||
| that went into RFC 8478 and RFC 8878. | ||||
| Authors' Addresses | Authors' Addresses | |||
| Nidhi Jaju (editor) | Nidhi Jaju (editor) | |||
| Shibuya Stream, 3 Chome-21-3 Shibuya, Shibuya City, Tokyo | Shibuya Stream, 3 Chome-21-3 Shibuya, Shibuya City, Tokyo | |||
| 150-0002 | 150-0002 | |||
| Japan | Japan | |||
| Email: nidhijaju@google.com | Email: nidhijaju@google.com | |||
| W. Felix P. Handte (editor) | W. Felix P. Handte (editor) | |||
| Meta Platforms, Inc. | Meta Platforms, Inc. | |||
| 380 W 33rd St | 380 W 33rd St | |||
| End of changes. 16 change blocks. | ||||
| 68 lines changed or deleted | 48 lines changed or added | |||
This html diff was produced by rfcdiff 1.48. | ||||