Skip to content

Improve slot time calculation and adjust contention window size accordingly#5749

Merged
thebentern merged 3 commits into
meshtastic:masterfrom
GUVWAF:fixSlotTime
Jan 6, 2025
Merged

Improve slot time calculation and adjust contention window size accordingly#5749
thebentern merged 3 commits into
meshtastic:masterfrom
GUVWAF:fixSlotTime

Conversation

@GUVWAF

@GUVWAF GUVWAF commented Jan 5, 2025

Copy link
Copy Markdown
Member

Since the initial slot time calculation, the default number of symbols used for Channel Activity Detection (CAD) in RadioLib has changed. Therefore, our slot time is actually quite some lower, namely 28ms versus 77ms as calculated now on LongFast, which corresponds to the measurements I did recently (~26ms from isChannelActive() until after startTransmit()). To avoid this being changed again in the future, I now explicitly set the number of CAD symbols. For SX127x this is not possible, and the CAD duration is known (max. 2.25 symbols). For SX1280, there is a different calculation and the minimum recommended number of symbols is 4, so I applied this calculation when using 2.4GHz LoRa.

A reduced slot time means we can use more slots for the same delay, which should lower the chance of collisions. The slot time determines the maximum delay a node uses before rebroadcasting, depending on SNR. To make sure this is still roughly the same across firmware versions, I adjusted CWmin and CWmax, and I also decreased SNR_MAX to 10dB since I believe that’s closer to the actual maximum SNR. The plot below shows the max. delay versus SNR on LongFast for the different firmware versions (in 2.5 we fixed the slot time calculation #4469).
image
Even though the adjustments make sure the curve is close to the <=2.4 values, I think it’s good to merge this only when we release a new minor version.

@thebentern

Copy link
Copy Markdown
Contributor

@GUVWAF when you get a chance, reopen this one. I accidentally merged prematurely and reverted upstream

jeek pushed a commit to jeek/Meshtastic-Exploiteers-Hacker-Pager that referenced this pull request Jun 30, 2026
…CW size accordingly (meshtastic#5749)

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants