跳到主要内容

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 TypeCodeSectionReference
DATA0x00Section 6.1RFC 9113
HEADERS0x01Section 6.2RFC 9113
PRIORITY0x02Section 6.3RFC 9113
RST_STREAM0x03Section 6.4RFC 9113
SETTINGS0x04Section 6.5RFC 9113
PUSH_PROMISE0x05Section 6.6RFC 9113
PING0x06Section 6.7RFC 9113
GOAWAY0x07Section 6.8RFC 9113
WINDOW_UPDATE0x08Section 6.9RFC 9113
CONTINUATION0x09Section 6.10RFC 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)

NameCodeInitial ValueSectionReference
SETTINGS_HEADER_TABLE_SIZE0x014096Section 6.5.2RFC 9113
SETTINGS_ENABLE_PUSH0x021Section 6.5.2RFC 9113
SETTINGS_MAX_CONCURRENT_STREAMS0x03(infinite)Section 6.5.2RFC 9113
SETTINGS_INITIAL_WINDOW_SIZE0x0465535Section 6.5.2RFC 9113
SETTINGS_MAX_FRAME_SIZE0x0516384Section 6.5.2RFC 9113
SETTINGS_MAX_HEADER_LIST_SIZE0x06(infinite)Section 6.5.2RFC 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)

NameCodeDescriptionSectionReference
NO_ERROR0x00优雅关闭Section 7RFC 9113
PROTOCOL_ERROR0x01检测到协议错误Section 7RFC 9113
INTERNAL_ERROR0x02实现故障Section 7RFC 9113
FLOW_CONTROL_ERROR0x03超出流量控制限制Section 7RFC 9113
SETTINGS_TIMEOUT0x04设置未确认Section 7RFC 9113
STREAM_CLOSED0x05在已关闭流上收到帧Section 7RFC 9113
FRAME_SIZE_ERROR0x06帧大小不正确Section 7RFC 9113
REFUSED_STREAM0x07流未处理Section 7RFC 9113
CANCEL0x08流已取消Section 7RFC 9113
COMPRESSION_ERROR0x09压缩状态未更新Section 7RFC 9113
CONNECT_ERROR0x0aCONNECT 方法的 TCP 连接错误Section 7RFC 9113
ENHANCE_YOUR_CALM0x0b处理能力超出Section 7RFC 9113
INADEQUATE_SECURITY0x0c协商的 TLS 参数不可接受Section 7RFC 9113
HTTP_1_1_REQUIRED0x0d对该请求使用 HTTP/1.1Section 7RFC 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.