11. IANA 考虑 (IANA Considerations)
本规范为 HTTP/2 协议建立了若干注册表. 本节描述这些注册表及其相关注册策略.
11.1. HTTP/2 标识字符串注册 (Registration of HTTP/2 Identification Strings)
本文档为 HTTP/2 标识创建两个注册项: 字符串 "h2" 和 "h2c".
"h2" 字符串用于标识通过 TLS 使用的 HTTP/2, 如 Section 3.3 所述.
"h2c" 字符串用于标识通过明文 TCP 使用的 HTTP/2, 如 Section 3.2 所述.
这些标识字符串注册在 "Application-Layer Protocol Negotiation (ALPN) Protocol IDs" 注册表中 (由 [TLS-ALPN] 建立).
11.2. 帧类型注册表 (Frame Type Registry)
本文档为 HTTP/2 帧类型代码建立一个注册表. "HTTP/2 Frame Type" 注册表管理一个 8 位空间. "HTTP/2 Frame Type" 注册表按照 "Expert Review" 策略 [RFC8126] 运行, 并包含保留值.
新条目注册需要以下信息:
- Frame Type: 帧类型的名称或标签.
- Code: 分配给该帧类型的 8 位代码.
- Specification: 对包含该帧类型描述的规范的引用.
本文档注册的条目见 Table 1.
Table 1: 帧类型 (Frame Types)
| Frame Type | Code | Section | Reference |
|---|---|---|---|
| DATA | 0x00 | Section 6.1 | RFC 9113 |
| HEADERS | 0x01 | Section 6.2 | RFC 9113 |
| PRIORITY | 0x02 | Section 6.3 | RFC 9113 |
| RST_STREAM | 0x03 | Section 6.4 | RFC 9113 |
| SETTINGS | 0x04 | Section 6.5 | RFC 9113 |
| PUSH_PROMISE | 0x05 | Section 6.6 | RFC 9113 |
| PING | 0x06 | Section 6.7 | RFC 9113 |
| GOAWAY | 0x07 | Section 6.8 | RFC 9113 |
| WINDOW_UPDATE | 0x08 | Section 6.9 | RFC 9113 |
| CONTINUATION | 0x09 | Section 6.10 | RFC 9113 |
11.3. 设置注册表 (Settings Registry)
本文档为 HTTP/2 设置建立一个注册表. "HTTP/2 Settings" 注册表管理一个 16 位空间. "HTTP/2 Settings" 注册表按照 "Expert Review" 策略 [RFC8126] 运行, 并包含保留值.
新条目注册需要以下信息:
- Name: 设置的符号名称. 指定设置名称是可选的.
- Code: 分配给该设置的 16 位代码.
- Initial Value: 设置的初始值.
- Specification: 对包含该设置描述的规范的可选引用.
本文档注册的条目见 Table 2.
Table 2: 设置 (Settings)
| Name | Code | Initial Value | Section | Reference |
|---|---|---|---|---|
| SETTINGS_HEADER_TABLE_SIZE | 0x01 | 4096 | Section 6.5.2 | RFC 9113 |
| SETTINGS_ENABLE_PUSH | 0x02 | 1 | Section 6.5.2 | RFC 9113 |
| SETTINGS_MAX_CONCURRENT_STREAMS | 0x03 | (infinite) | Section 6.5.2 | RFC 9113 |
| SETTINGS_INITIAL_WINDOW_SIZE | 0x04 | 65535 | Section 6.5.2 | RFC 9113 |
| SETTINGS_MAX_FRAME_SIZE | 0x05 | 16384 | Section 6.5.2 | RFC 9113 |
| SETTINGS_MAX_HEADER_LIST_SIZE | 0x06 | (infinite) | Section 6.5.2 | RFC 9113 |
11.4. 错误代码注册表 (Error Code Registry)
本文档为 HTTP/2 错误代码建立一个注册表. "HTTP/2 Error Code" 注册表管理一个 32 位空间. "HTTP/2 Error Code" 注册表按照 "Expert Review" 策略 [RFC8126] 运行, 并包含保留值.
新条目注册需要以下信息:
- Name: 错误代码的名称. 指定错误代码名称是可选的.
- Code: 分配的 32 位错误代码.
- Description: 对错误条件的简要描述.
- Specification: 对定义该错误代码的规范的可选引用.
本文档注册的条目见 Table 3.
Table 3: 错误代码 (Error Codes)
| Name | Code | Description | Section | Reference |
|---|---|---|---|---|
| NO_ERROR | 0x00 | 优雅关闭 | Section 7 | RFC 9113 |
| PROTOCOL_ERROR | 0x01 | 检测到协议错误 | Section 7 | RFC 9113 |
| INTERNAL_ERROR | 0x02 | 实现故障 | Section 7 | RFC 9113 |
| FLOW_CONTROL_ERROR | 0x03 | 超出流量控制限制 | Section 7 | RFC 9113 |
| SETTINGS_TIMEOUT | 0x04 | 设置未确认 | Section 7 | RFC 9113 |
| STREAM_CLOSED | 0x05 | 在已关闭流上收到帧 | Section 7 | RFC 9113 |
| FRAME_SIZE_ERROR | 0x06 | 帧大小不正确 | Section 7 | RFC 9113 |
| REFUSED_STREAM | 0x07 | 流未处理 | Section 7 | RFC 9113 |
| CANCEL | 0x08 | 流已取消 | Section 7 | RFC 9113 |
| COMPRESSION_ERROR | 0x09 | 压缩状态未更新 | Section 7 | RFC 9113 |
| CONNECT_ERROR | 0x0a | CONNECT 方法的 TCP 连接错误 | Section 7 | RFC 9113 |
| ENHANCE_YOUR_CALM | 0x0b | 处理能力超出 | Section 7 | RFC 9113 |
| INADEQUATE_SECURITY | 0x0c | 协商的 TLS 参数不可接受 | Section 7 | RFC 9113 |
| HTTP_1_1_REQUIRED | 0x0d | 对该请求使用 HTTP/1.1 | Section 7 | RFC 9113 |
11.5. HTTP2-Settings 头部字段注册 (HTTP2-Settings Header Field Registration)
本节在 "Hypertext Transfer Protocol (HTTP) Field Name Registry" [HTTP] 中注册 HTTP2-Settings 头部字段.
- Header field name: HTTP2-Settings
- Applicable protocol: http
- Status: standard
- Author/Change controller: IETF
- Specification document(s): RFC 9113 的 Section 3.2.1
11.6. PRI 方法注册 (PRI Method Registration)
本节在 "HTTP Method Registry" [HTTP] 中注册 PRI 方法.
- Method Name: PRI
- Safe: No
- Idempotent: No
- Specification document(s): RFC 9113 的 Section 3.4
11.7. 421 (Misdirected Request) HTTP 状态码 (The 421 HTTP Status Code)
本节在 "HTTP Status Codes" 注册表 [HTTP] 中注册 421 (Misdirected Request) HTTP 状态码.
- Status Code: 421
- Short Description: Misdirected Request
- Specification document(s): RFC 9113 的 Section 9.1.2
11.8. h2c Upgrade Token
本节在 "HTTP Upgrade Token Registry" [HTTP] 中注册 "h2c" upgrade token.
- Name: h2c
- Description: Hypertext Transfer Protocol version 2 (HTTP/2)
- Expected Version Tokens: None
- References: RFC 9113 的 Section 3.2
第 11 章完成!
References
- [RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for Writing an IANA Considerations Section in RFCs", BCP 26, RFC 8126, June 2017.
- [HTTP] Fielding, R., Ed., Nottingham, M., Ed., and J. Reschke, Ed., "HTTP Semantics", STD 97, RFC 9110, June 2022.
- [TLS-ALPN] Friedl, S., Popov, A., Langley, A., and E. Stephan, "Transport Layer Security (TLS) Application-Layer Protocol Negotiation Extension", RFC 7301, July 2014.