|
F439_CPP_TX-RX_LoRa_Project
|
This page defines the canonical on-wire layout for a Wire v3 frame. It documents the fixed header fields, byte offsets, endian rules, and size constraints used by the RadioLink protocol layer.
A Wire v3 frame is serialized in this order:
The fixed Wire v3 header is 11 bytes long and occupies byte offsets 0..10.
version : Wire-format version discriminator. The current supported value is RADIOLINK_WIRE_V3_VERSION (0x03).
nodeId : Runtime node identifier for the sender.
sessionSeqId_le : Little-endian 32-bit session sequence identifier. This value advances once per TX boot epoch and is used as part of replay protection and nonce derivation.
msgCounter_le : Little-endian 32-bit per-session message counter. This value advances only after a successful transmission and is also used for replay protection and nonce derivation.
payloadLen : Length in bytes of the payload region that follows the fixed header. This is the plaintext length before encryption and the ciphertext length on wire after encryption. Wire v3 does not include the CMAC tag length in payloadLen.
payload : Variable-length application payload. The payload begins immediately after the fixed 11-byte header and is AES-CTR protected on wire.
CMAC : Fixed 16-byte AES-CMAC authentication tag appended after the payload. The tag authenticates the serialized header and ciphertext payload.
The following conditions must always hold for any valid Wire v3 frame:
Multi-byte integer fields in the Wire v3 header are serialized in little-endian format:
The single-byte fields version, nodeId, and payloadLen have no endian ambiguity.
Total frame length is defined as:
Current fixed lengths:
With the current transport limit of 255 bytes, the maximum plaintext payload that fits in a single Wire v3 frame is:
The canonical byte offsets documented on this page correspond to the derived offsetof()-based constants in radio_wire.h:
The fixed header length is derived as:
Future protocol revisions may add new authenticated metadata fields to the fixed header. Any such change must be treated as a wire-format revision and must not silently alter the Wire v3 layout documented here.