RFC 9204 - QPACK: Field Compression for HTTP/3
发布日期: 2022年6月
状态: 标准跟踪 (Standards Track)
作者: C. Krasic, M. Bishop, A. Frindell (Meta)
摘要 (Abstract)
本规范定义了 QPACK, 一种用于压缩 HTTP 字段的格式,优化用于 HTTP/3. 这是 HPACK 的变体,旨在减少队头阻塞 (Head-of-Line Blocking).
目录 (Contents)
- 1. Introduction (简介)
- 1.1 Conventions and Definitions
- 1.2 Notational Conventions
- 2. Compression Process Overview (压缩过程概述)
- 2.1 Encoder (编码器)
- 2.2 Decoder (解码器)
- 3. Reference Tables (参考表)
- 3.1 Static Table (静态表)
- 3.2 Dynamic Table (动态表)
- 4. Wire Format (线路格式)
- 4.1 Primitives (原语)
- 4.2 Encoder and Decoder Streams
- 4.3 Encoder Instructions (编码器指令)
- 4.4 Decoder Instructions (解码器指令)
- 4.5 Field Line Representations (字段行表示)
- 5. Configuration (配置)
- 6. Error Handling (错误处理)
- 7. Security Considerations (安全考虑)
- 7.1 Probing Dynamic Table State
- 7.2 Static Huffman Encoding
- 7.3 Memory Consumption
- 7.4 Implementation Limits
- 8. IANA Considerations (IANA考虑)
- 9. References (参考文献)
附录 (Appendices)
- Appendix A. Static Table (静态表)
- Appendix B. Encoding and Decoding Examples (编码解码示例)
- Appendix C. Sample Single-Pass Encoding Algorithm (单遍编码算法示例)
相关资源
- 官方原文: RFC 9204
- 官方页面: RFC 9204 DataTracker
- 勘误表: RFC Editor Errata
快速参考
什么是QPACK?
QPACK 是 HTTP/3 的头部压缩格式,基于 HPACK 但针对 QUIC 的无序传输特性进行了优化。
核心改进
相比HPACK的主要变化:
- ✅ 减少队头阻塞 - 允许无序解码
- ✅ 独立流 - 编码器/解码器使用独立的单向流
- ✅ 灵活权衡 - 可在压缩率和延迟间平衡
- ✅ 动态表管理 - 更精细的控制机制
QPACK vs HPACK
| 特性 | HPACK (HTTP/2) | QPACK (HTTP/3) |
|---|---|---|
| 传输协议 | TCP | QUIC (UDP) |
| 队头阻塞 | 严重 | 显著减少 |
| 动态表 | 单一 | 编码器/解码器分离 |
| 压缩率 | 高 | 接近HPACK |
| 乱序处理 | 不支持 | 支持 |
| 参考模式 | 仅绝对索引 | 多种索引方式 |
应用场景
- 🌐 HTTP/3 - 新一代HTTP协议
- 🚀 QUIC协议 - 低延迟传输
- 📱 移动应用 - 不稳定网络环境
- ⚡ 实时通信 - WebRTC over HTTP/3