HTTP/3 : 框架分析

HTTP/3 : frame analysis

我得到一个 HTTP/3 帧 0x 00 40 78 5f 82.

根据 https://datatracker.ietf.org/doc/html/draft-ietf-quic-http-27#page-28

帧布局应为 32 位(类型)、32 位(长度字段)、32 位(有效负载)。

我不认为该帧有 96 位。

我误会了什么?

我要查找帧类型、长度字段和有效负载的长度。

如何找到它?

根据第 28 页:

Type: A variable-length integer that identifies the frame type.

Length: A variable-length integer that describes the length in bytes of the Frame Payload.

Frame Payload: A payload, the semantics of which are determined by the Type field.

根据标准,Length 字段包含 Payload 字段的长度。长度和类型字段每个都是至少 8 位和最多 64 位的 variable length integer,其中前两位确定字段的长度。因此,有效负载长度最多可达 2^62 字节。因此最小值是 1byte+1byte(在你的例子中是 2,因为前两位是 01)+payload(在你的例子中是 2)。