一个先拒绝、后相信的帧
规范解读 · 第 28 篇 · 本文引证来源 · 逐句读的文本:draft-li-rttp-iqa-addressing-02(全文) · 系列页与修订史:datatracker · 进入主线的家族:pulse-header 家族页(密封记录) · 合并记录:lab PR #222 · 双柱姊妹:RTTP(rttp://,CRI 27)· IQA(iqa://,CRI 28)
一个协议帧只有一次自我介绍的机会,而多数介绍都把机会浪费在赞美上。我们的帧养了一个古怪的习惯:pulse-header 家族的这枚帧——§7.1 的定长 128 字节结构、§7.1.1 的扩展块规则、§7.1.2 的时间字段——用一张「拒绝清单」作自我介绍。这个家族——我们为这枚帧准备的案例集——本周以 PR #222 进入一致性实验室的主线,2026-11-17 04:51:07Z 合并;本篇走读它携带的纪律:帧面对任何输入的第一个动作是拒绝,只有活过拒绝清单的字节才挣得被推理的资格。
帧是定长的,所以读法也是定死的
这枚帧的设计从「拒绝解析」开始。§7.1 原文:“The pulse header is the fixed 128-octet structure that carries an rttp pulse. Its fields are fixed-offset, so a reader validates a header with fixed comparisons rather than by parsing a variable layout.” 九个字段、九个固定偏移——魔数、版本、序号、时间戳、TTL、优先级、派生地址、主体 AID、扩展块。定值比对实现起来便宜、想错得隐蔽却很难,这恰好是一致性套件想要的交换:家族的帧案例是具体的 128 字节帧头,检查器用文本所要求的同一套定值比对从字节重新推导每个判定,不依赖任何库。
扩展块是这枚设计里最安静的德行。0x66–0x7F 的 26 个字节在扩展块出现之前是保留的全零;扩展块占用它们“without moving or redefining any earlier field, and VERSION_ID is not incremented”,因为“implementations that read only offsets 0x00-0x65 continue to validate unchanged, because the bytes they have not read were previously zero and remain ignorable.” 九条负向案例中的两条从两侧钉死这条边界:SPEC_REV 0 配非零扩展块被拒,SPEC_REV 1 配非零 RESERVED 被拒。扩展块的存在只有一个入场条件:除此之外的整帧必须可证明地与扩展前形状逐位相同。
拒绝清单本身就是规则,不是序言
§7.1.1 的 fail-closed 段是这个家族的重心,它写成清单正是为了让判断无处提前掺入:“A receiver MUST reject a frame if any of the following holds: the ACTION field contains characters outside the set of Section 4.1, exceeds 16 significant bytes, or carries non-zero padding; SPEC_REV is outside the known set; SPEC_REV is 0 and the extension block is not all zero; or SPEC_REV is 1 and RESERVED is not all zero or unknown FLAGS bits are set.” 这张清单没有一处问接收方「这帧是什么意思」。拒绝发生在结构上——字符集、长度、填充、保留字节——远在任何对帧内动词的解释获得资格之前。
然后这枚设计做了更严的一步:它连「活过清单的帧是安全的」这个推断都拒绝给。当 action 存在时,§4.3 警告“a client MUST NOT infer safety from this section”,而 §7.1.1 的 unknown-verb 规则把这句警告铸成线上行为:“On encountering an unrecognised action verb, an implementation MUST NOT infer safety from the default-operation statement of Section 4.3: the verb MUST be treated as having unknown safety and either require explicit authorisation under the local security policy or be rejected (Section 9).” 这条规则存在是因为 action 空间是开放的——“this document deliberately defines no enumeration of verbs, because enumerating an open set would close it”——而开放集保证每个接收方终将遇到一个从未见过的动词。四条行为案例(PH-B03 至 PH-B05 与 PH-B12)双向钉死这条规则:默认放行被判为不合规范,因为无论默认接受还是默认操作,都不是接收方有权给出的裁决。
几乎不做任何主张的时间字段
帧携带三个时间与顺序字段,§7.1.2 给它们的职守刻意收窄:“a pulse is a claim of intent, and the only freshness that can authorize anything rides the answer side (Section 6); the pulse's time fields make the claim's moment checkable, not the subject's validity.” TIMESTAMP 让脉冲的年龄可以离线从字节本身推导——“a pulse states how old it is, whatever channel carried it”——而紧随其后的一句禁止读者把这份年龄升格为信任:“A receiver MUST NOT treat TIMESTAMP, or the age it yields, as a statement about the subject's standing.” TTL 规则同样不浪漫:收到 TTL 为 0 的脉冲必须不得转发、转发前必须递减,而在收到处消费脉冲的验证部署对这个字段完全不给予信任。四条行为案例钉死 TTL 边界、另有两条钉死时间戳边界,突变电池里还有一只把时间戳边界整个丢掉的突变体——它死了,因为有一条案例依赖这条规则。
一行收束:一帧必须先活过拒绝清单才挣得被解释的资格;一个陌生动词什么都挣不到,默认操作尤其挣不到;脉冲的时间戳说的是主张有多旧,从不说主体是否成立——因为 fail-closed 不是这枚设计的特性,是它的承重墙:rttp resolves where & when; iqa states whether — and where the two agree, action begins.