pub struct Capabilities {
pub tx_max_sdu: u16,
pub rx_max_sdu: u16,
pub duplex: Duplex,
pub reliable: bool,
}Expand description
What a medium can do, as the medium itself would describe it.
Transmit and receive limits are separate because real media are asymmetric:
Iridium SBD carries 340 bytes up and 270 down. Collapsing them to their
minimum — as the withdrawn design did — silently wasted 21% of every paid
uplink message (docs/architecture.md §4.9).
Fields§
§tx_max_sdu: u16Largest SDU the medium will transmit, in bytes.
u16 because Zenoh’s own BatchSize is u16, so a larger value could
never be filled.
rx_max_sdu: u16Largest SDU the medium will deliver, in bytes.
A promise this backend makes, and the driver checks it (#75). An
arrival larger than this counts rx_oversize_total and is logged as a
contract violation; it is still delivered, because the batch is Zenoh’s
to judge and discarding it here would be the driver deciding a question
I1 gives to Zenoh.
It is not what stops a peer sending too much, and the distinction
matters on an asymmetric bearer. batch_size is node-global and Zenoh
negotiates the minimum of the two ends, so a pair configured
inconsistently produces a small effective batch — 21% of a paid
uplink slot wasted on SBD — never an oversized arrival. What an
operator does with this number is size the far node’s batch_size,
which is why Driver::start logs it as peer_max_batch_size (#82).
duplex: DuplexWhether transmit and receive contend.
reliable: boolWhether the medium delivers in order and without loss.
Per invariant I2 this must be the truth about the hardware, not an
aspiration. A lane may only assert LaneKey::reliable over a medium
that reports true here.