Lora-net / LoRaMac-node

Reference implementation and documentation of a LoRa network node.
Other
1.88k stars 1.09k forks source link

Region: retransmission limitations not accounting for MAC reset #1395

Closed JordanYates closed 1 year ago

JordanYates commented 1 year ago

The LoRaWAN spec for retransmission backoffs (https://lora-alliance.org/wp-content/uploads/2020/11/lorawan1.0.3.pdf, Section 7) provides the following backoff table: Screenshot 2022-12-02 at 3 32 49 pm Together with this note: image

Combined, it can be implied that the reset mentioned in the first box is a MAC layer reset (rejoin), not a hard power reset (which is already covered by power-up). The current backoff algorithm is however only considering the total time since boot in the algorithm, not the time since the synchronization event.

https://github.com/Lora-net/LoRaMac-node/blob/f9bb6f9c7de1d30a37d65ead8e60bdbe5d09be3e/src/mac/region/RegionCommon.c#L146-L160

The limits as they currently exist are too restrictive for devices that attempt to rejoin after detecting a lost connection, as opposed to simply rebooting.

mluis1 commented 1 year ago

The current implementation is done according to the current LoRaWAN specification version 1,0,4/1.1.1. The power-up and reset events as specified represent a similar event. The reset meaning a MCU reset.

However, I full agree with your observation and actually proposed to the LoRa-Alliance technical committee to change this behavior description for the next LoRaWAN specification revision. This new specification will have a slightly revised behavior description which will be inline with your observations. In addition with the new specification this back off algorithm will be applied not only to JoinReq or ReJoinReq but to other kind of events.

Therefore, once this project gets updated to support the next LoRaWAN specification it will be inline with your expectations.