Skip to main content

Module mrp

Module mrp 

Source
Expand description

Message Reliability Protocol (MRP) timing parameters and backoff math per Matter specification section 4.12.

Peers advertise their session intervals in mDNS TXT records (keys SII, SAI, SAT - decimal milliseconds). Senders derive retransmission deadlines from these values using exponential backoff with jitter:

t = i * MARGIN * BASE^max(0, n - THRESHOLD) * (1 + rand * JITTER)

where i is the peer’s active interval (SAI) if the peer was heard from within the active threshold (SAT), otherwise its idle interval (SII), and n is the 0-based retransmission index. A message is given up on after MRP_MAX_TRANSMISSIONS total transmissions.

Used by [crate::retransmit] (handshake exchanges) and [crate::active_connection] (operational traffic). Parameters are stored on the transport connection (crate::transport::ConnectionTrait::mrp_params).

Structs§

MrpParameters
Peer MRP intervals, typically taken from its mDNS TXT records.

Constants§

MRP_BACKOFF_BASE
MRP_BACKOFF_JITTER
MRP_BACKOFF_MARGIN
MRP_BACKOFF_THRESHOLD
MRP_MAX_INTERVAL_MS
Spec cap for advertised SII/SAI values (milliseconds).
MRP_MAX_TRANSMISSIONS
Maximum number of transmissions of a single message (initial + retransmits).

Functions§

backoff_interval
Wait time before the next retransmission per spec 4.12 backoff formula. retransmission_index is 0 for the wait after the initial transmission.
base_interval
Base retransmission interval: the peer’s active interval if it was heard from within the active threshold, otherwise its idle interval.