RFC Conformance

How closely a dissector follows the specification that defines it, what it does with octets that break that specification, and how PCAPKIT_MIMIC swaps the specification for an engine’s behaviour. A site that breaks a rule here is brought into line by a change of its own.

The Default

Every site follows its RFC or IANA registry exactly, ruled in review of #2874 (#2853): each element is scoped as its specification defines it, with no superset decoding for convenience. Where an engine such as Wireshark departs from the RFC, pcapkit still follows the RFC unless Engine Mimicry says otherwise.

Refusals

Where an RFC says to refuse a format or a value, construction refuses it and parsing reads past it where it can, ruled by the owner on #3230, with the scope and the warning settled on #3234:

  • A format or value rule the parser can read past – a length cap, a reserved or must-be-zero field, an out-of-range value, a forbidden combination – warns on parse and reads on. The warning is a ProtocolWarning, issued through warn() once per offending field. A fresh construction raises, and a rebuild of parsed data passes, so a round trip stays byte-exact.

  • A structural failure, where nothing more can be decoded – octets that run short, a Length that overruns its container, a missing field the rest depends on – keeps refusing: the layer is kept as Raw, without a warning, as for any handled refusal (#2588).

  • A version field whose other values name another layout counts as structural (#3234), since the octets after it cannot be read as this layout.

A reader applies them through pcapkit.utilities.conformance: nonconforming() at a format or value rule, and anomalous() for what Anomalies Outside the RFC reports.

Engine Mimicry

One variable, PCAPKIT_MIMIC, names the engine to follow: wireshark, dpkt or scapy. It was ruled on #3230 over one boolean per engine, since two engines could then claim the same site, and it covers every site where its engine departs from an RFC that pcapkit honours, reassembly or not (#3214).

  • Unset, every site follows its RFC, refusing as Refusals has it.

  • A value is a full mimic of its engine, on read and on build, at each site Mimic Mode lists (#3234). Where that engine reads silently, pcapkit reads on without a warning; where it refuses, pcapkit refuses.

  • A fresh construction builds a value the RFC refuses only when a value is set and its engine accepts that value; otherwise construction refuses (#3234).

  • A new site gets its rows in Mimic Mode’s table, one per value, in the change that adds the site.

Anomalies Outside the RFC

A site that reads on where its RFC is silent still reports what it observed, with the same ProtocolWarning, as for a zero IPv4 Total Length read as TCP segmentation offload. Ruled by the owner on #3234.