This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Backoff mechanism for reliable mesh messages

Hi,

I have a question about the time period being used as waiting time before sending a reliable message is retried, this until an ACK is received or the timeout is reached (minimal 30 s). According to the standard, this is "application specific". From what I measure using the Nordic Mesh SDK stack, this seems to be first two tries after 280 ms, and then each next try after the multiple of the previous. This gives for a timeout of 30 s, a maximum of 8 tries or 8 packets being send:

0.00 (first) after 280.37 ms after 279.97 ms after 559.98 ms after 1119.96 ms after 2239.94 ms after 4479.87 ms after 8959.84 ms

Is this correct and is this something that's unchangeable to me as a developer?

Thanks in advance.

Kind regards,

Mathias

Parents
  • Hi,

    The timeout is based on TTL, and the exact formulas can be read in mesh/core/src/transport.c:

    static inline uint32_t rx_ack_timer_delay_get(uint8_t ttl)
    {
        return m_trs_config.rx_ack_base_timeout + m_trs_config.rx_ack_per_hop_addition * ttl;
    }
    
    static inline uint32_t tx_retry_timer_delay_get(uint8_t ttl)
    {
        return m_trs_config.tx_retry_base_timeout + m_trs_config.tx_retry_per_hop_addition * ttl;
    }

    The other parameters used are set to default values provided in mesh/core/include/transport.h:

    /** Default base RX acknowledgement timeout. */
    #define TRANSPORT_SAR_RX_ACK_BASE_TIMEOUT_DEFAULT_US MS_TO_US(150)
    
    /** Default per hop RX acknowledgement timeout addition. */
    #define TRANSPORT_SAR_RX_ACK_PER_HOP_ADDITION_DEFAULT_US MS_TO_US(50)
    
    /** Default base TX retry timeout. */
    #define TRANSPORT_SAR_TX_RETRY_BASE_TIMEOUT_DEFAULT_US MS_TO_US(500)
    
    /** Default per hop TX retry timeout addition. */
    #define TRANSPORT_SAR_TX_RETRY_PER_HOP_ADDITION_DEFAULT_US MS_TO_US(50)

    These values can also be changed runtime, using nrf_mesh_opt_set().

    Regards,
    Terje

  • Okay, thank you very much for the explanation.

    Kind regards, Mathias

Reply Children
No Data
Related