mtrp:frame_format
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| mtrp:frame_format [2026/06/10 13:11] – mosh | mtrp:frame_format [2026/06/10 13:17] (current) – mosh | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| ===== 2.1 Purpose ===== | ===== 2.1 Purpose ===== | ||
| - | This document defines the high-level structure | + | This document defines the on-wire frame structure |
| - | ===== 2.2 Frame Model ===== | + | ===== 2.2 Scope ===== |
| + | |||
| + | This document describes: | ||
| + | |||
| + | * the serialized MTRP header | ||
| + | * payload placement | ||
| + | * optional CRC placement | ||
| + | * compact and native header formats | ||
| + | * the distinction between wire fields and local metadata | ||
| + | |||
| + | ===== 2.3 Frame Model ===== | ||
| An MTRP frame consists of: | An MTRP frame consists of: | ||
| - | * a protocol | + | * a serialized |
| * a payload | * a payload | ||
| - | * implementation-local metadata used during processing | + | * an optional CRC footer |
| + | * local metadata used internally by the router | ||
| - | Only the serialized | + | Only the serialized header, payload, |
| - | ===== 2.3 Header Responsibilities ===== | + | Local metadata is not serialized as part of the MTRP frame. |
| - | The protocol header carries routing-visible and protocol-visible information. | + | ===== 2.4 Native Frame Layout ===== |
| - | Typical header responsibilities include: | + | In native mode, the serialized frame layout is: |
| - | * protocol version identification | + | * '' |
| - | * flag signaling | + | * '' |
| - | * network identification | + | * '' |
| - | * source and destination addressing | + | * '' |
| - | * previous-hop identification | + | * '' |
| - | * message identification | + | * '' |
| - | * hop-limit or TTL behavior | + | * '' |
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| - | ===== 2.4 Payload Responsibilities ===== | + | Native header length is 15 bytes. |
| - | The payload carries protocol-specific or application-specific content. | + | ===== 2.5 Compact Frame Layout ===== |
| - | Examples include: | + | In constrained mode, the serialized frame layout is: |
| + | |||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | Compact header length is 13 bytes. | ||
| + | |||
| + | ===== 2.6 Header Field Order ===== | ||
| + | |||
| + | The current serialized field order is identical in both modes after the first header bytes. | ||
| + | |||
| + | ^ Order ^ Native ^ Compact ^ Size ^ Notes ^ | ||
| + | | 1 | Flags | Flags | 1 byte | protocol flags | | ||
| + | | 2 | Version | Version/ | ||
| + | | 3 | Payload Length | Message ID | 2 bytes in native | compact mode does not store payload length separately | | ||
| + | | 4 | Message ID | Origin Node ID | 2 bytes | per-origin message identifier | | ||
| + | | 5 | Origin Node ID | Destination Node ID | 2 bytes | original sender | | ||
| + | | 6 | Destination Node ID | Previous Hop Node ID | 2 bytes | intended recipient | | ||
| + | | 7 | Previous Hop Node ID | Network ID | 2 bytes | most recent forwarding node | | ||
| + | | 8 | Network ID | TTL | 2 bytes native / 1 byte compact | logical network identifier | | ||
| + | | 9 | TTL | Payload | 1 byte | remaining hop count | | ||
| + | |||
| + | For clarity, the actual compact order on wire is: | ||
| + | |||
| + | - Flags | ||
| + | - Version/ | ||
| + | - Message ID | ||
| + | - Origin Node ID | ||
| + | - Destination Node ID | ||
| + | - Previous Hop Node ID | ||
| + | - Network ID | ||
| + | - TTL | ||
| + | |||
| + | ===== 2.7 Header Field Definitions ===== | ||
| + | |||
| + | ==== 2.7.1 Flags ==== | ||
| + | |||
| + | The flags byte carries protocol behavior bits. | ||
| + | |||
| + | Current flags are: | ||
| + | |||
| + | ^ Bit Mask ^ Name ^ Meaning ^ | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | |||
| + | ==== 2.7.2 Version ==== | ||
| + | |||
| + | The version field identifies the protocol/ | ||
| + | |||
| + | In native mode, version occupies one full byte. | ||
| + | |||
| + | In compact mode, version occupies the upper 3 bits of the combined '' | ||
| + | |||
| + | A received frame MUST match the implementation' | ||
| + | |||
| + | ==== 2.7.3 Payload Length ==== | ||
| + | |||
| + | In native mode, payload length is stored as a 16-bit value. | ||
| + | |||
| + | In compact mode, payload length is stored in the lower 5 bits of the combined '' | ||
| + | |||
| + | As currently implemented, | ||
| + | |||
| + | ==== 2.7.4 Message ID ==== | ||
| + | |||
| + | The message ID is a per-origin identifier used for duplicate suppression and message tracking. | ||
| + | |||
| + | ==== 2.7.5 Origin Node ID ==== | ||
| + | |||
| + | The origin node ID identifies the original sender of the frame. | ||
| + | |||
| + | ==== 2.7.6 Destination Node ID ==== | ||
| + | |||
| + | The destination node ID identifies the intended recipient of the frame. | ||
| + | |||
| + | ==== 2.7.7 Previous Hop Node ID ==== | ||
| + | |||
| + | The previous hop node ID identifies the node that most recently forwarded or transmitted the frame. | ||
| + | |||
| + | ==== 2.7.8 Network ID ==== | ||
| + | |||
| + | The network ID distinguishes one logical MTRP network from another. | ||
| + | |||
| + | ==== 2.7.9 TTL ==== | ||
| + | |||
| + | The TTL field limits how many forwarding hops a frame may traverse. | ||
| + | |||
| + | ===== 2.8 Compact Version/ | ||
| + | |||
| + | In compact mode, the second header byte is packed as follows: | ||
| + | |||
| + | ^ Bit Range ^ Meaning ^ | ||
| + | | bits 7..5 | version | | ||
| + | | bits 4..0 | payload length | | ||
| + | |||
| + | Equivalent expression: | ||
| + | |||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | This means: | ||
| + | |||
| + | * compact mode supports a 3-bit serialized version value | ||
| + | * compact mode supports a maximum serialized payload length of 31 bytes | ||
| + | |||
| + | ===== 2.9 Payload ===== | ||
| + | |||
| + | The payload immediately follows the serialized header. | ||
| + | |||
| + | Payload length is determined by the serialized length field. | ||
| + | |||
| + | The payload may carry: | ||
| * control messages | * control messages | ||
| Line 39: | Line 179: | ||
| * application data | * application data | ||
| - | ===== 2.5 Local Metadata | + | ===== 2.10 Optional CRC Footer |
| - | Local metadata | + | If the '' |
| - | Local metadata is not equivalent to the serialized wire header. | + | Current behavior: |
| - | Examples of local metadata include: | + | * CRC algorithm: CRC-16/ |
| + | * CRC is computed over '' | ||
| + | * CRC bytes are appended after the payload | ||
| + | * received CRC is validated during deserialization | ||
| - | * ingress path identifier | + | If '' |
| - | * ingress path metric | + | |
| - | * resolved egress path identifier | + | |
| - | * resolved next-hop identifier | + | |
| - | * local delivery behavior flags | + | |
| - | ===== 2.6 Compact Operation | + | ===== 2.11 Deserialization Rules ===== |
| - | On constrained transports, MTRP MAY use a compact on-wire representation. | + | On receive: |
| - | Compact operation SHOULD preserve core routing semantics while reducing | + | - the flags byte is read first |
| + | - '' | ||
| + | - version MUST match the current protocol version | ||
| + | - payload length MUST not exceed the configured maximum | ||
| + | - if '' | ||
| - | Compact operation does not remove the requirement for the receiver to correctly determine how the frame is to be interpreted. | + | A frame that fails these checks MUST be rejected. |
| - | ===== 2.7 Broadcast and Unicast Semantics | + | ===== 2.12 Local Metadata |
| - | A frame MAY be addressed as either: | + | MTRP also carries internal metadata that is not serialized on wire. |
| - | * unicast, for a specific destination node | + | Examples include: |
| - | * broadcast, for network-wide or local-scope distribution | + | |
| - | Broadcast handling and unicast handling MAY differ in forwarding and reliability behavior. | + | * ingress path ID |
| + | * ingress path metric | ||
| + | * egress path ID | ||
| + | * egress next hop | ||
| + | * route resolution state | ||
| + | * fragment bookkeeping | ||
| + | * transport-source metadata | ||
| - | ===== 2.8 Current Limitations ===== | + | These values exist only for local router behavior. |
| - | The present documentation does not fully specify: | + | ===== 2.13 Current Notes ===== |
| - | * fragmentation format | + | * native mode uses a 15-byte header |
| - | * reliable-delivery extensions | + | * compact mode uses a 13-byte header |
| - | * end-to-end acknowledgment fields | + | * compact mode payload length is currently limited |
| - | * group-address | + | * compact mode sets the '' |
| + | * CRC is optional and controlled by the '' | ||
/var/www/wiki.moshnetworks.com/data/attic/mtrp/frame_format.1781097108.txt.gz · Last modified: by mosh
