Skip to content

New frame format implementation

Katharina Fey requested to merge kookie/frame-formats into develop

This MR adds the new Frame format from the MREP specification. Several prototypes were evaluated. Ultimately a hand-made format was chosen which supports some amount of backwards compatibility/ versioning, is easy to read/ debug on the wire, and still produces very small output payloads.

This means that the structures from the MREP specification can be translated easily to Rust structures. Versioning is implemented via different types and version bytes. Forward versions can add new fields, but not remove old ones, similar to how Protobuf et. al. handle versioning (since older versions of the code may depend on a field. Optional fields MAY be removed via a zero byte, similarly to a missing field in the previous version of the schema.

Ideally we won't have to tweak this format much, but the chance is there. Additionally we have a 16-bit modes field which is used for distinguishing between different payloads. Radically incompatible frame formats can be added as additional settings in this bitfield.

This does indicate that two routers may need a way to negatiate capabilities. This was already planned, but has now become a necessity to improve future versioning efforts.

Edited by Katharina Fey

Merge request reports