On 7. May 2025, at 01:27, Brian E Carpenter <brian.e.carpen...@gmail.com> wrote: > > > Isn't there a third option: formal notation to describe packet formats? We do > that with CBOR/CDDL for example, and I attempted a toy version of it for TLV > type formats at https://github.com/becarpenter/tlv .
This is a large field, with many different approaches. First of all, are you describing the format so some nice graphics can be created from this? (Compare the “protocol” format [98] that kramdown-rfc supports.) Or so some machine processing is possible based on the description? Second, are you trying to describe some representation format that somebody loved to get creative on? (You need Turing-equivalent power here, compare [99] for a specimen where some of that complexity is even justifiable, but we stuck with extended box notation.) Or something that was designed to be easy to process? We have schema-dependent and schema-independent formats (“schema” = data definition), i.e., ones where you need the description to do anything and ones where the basic structure of the data can be parsed without having a data definition at hand. “TLV” formats are typically invented when extensibility is required. Each “T” comes with a format for an entry that may be regular enough to skip unknown entries or they may need new programming for each of the “T”s. Most people would expect an IETF protocol to have bespoke fixed-bit parts, written in box notation, plus TLVs, each “T” of which also is written in box notation (usually with fixed-length and variable-length parts). Then, of course, there are text-based protocols, which we cover with ABNF, which can help with parsing, but doesn’t help bridge the semantic gap between the serialization and the data model. CDDL is a language for describing data-model-level trees; it presumes the use of a schema-independent serialization (usually [0] CBOR or JSON). It works best if we protocol designers can get by without doing the “smart” bit-level busywork that is so popular among us. It would be easy to augment CDDL by bit-level serialization descriptions, maybe like 3GPP’s CSN.1 (Appendix B of TS 124007); a similar piece of work has been undertaken for YANG a while ago [1]. TLS presentation language (Section 3 of RFC 8446 [2]) is a language for describing schema-dependent representation formats, usually relying on some English language passages to plug various parts together. There also is the QUIC “custom format” (Section 1.3 of RFC9000 [3]). UFMRG has usable formal methods on their plate but has been focusing on using formal descriptions to enable deriving formal properties of protocols, arguably a more extensive research topic. Grüße, Carsten [98]: https://github.com/cabo/kramdown-rfc/wiki/SVG#protocol [99]: https://www.rfc-editor.org/rfc/rfc8138 [0]: https://www.ietf.org/archive/id/draft-bormann-cbor-cddl-csv-06.html [1]: https://datatracker.ietf.org/doc/html/draft-petrov-t2trg-youpi-01 [2]: https://www.rfc-editor.org/rfc/rfc8446#section-3 [3]: https://www.rfc-editor.org/rfc/rfc9000#name-notational-conventions -- rswg mailing list -- rswg@rfc-editor.org To unsubscribe send an email to rswg-le...@rfc-editor.org