Improve slot time calculation and adjust contention window size accordingly#5749
Merged
Conversation
thebentern
approved these changes
Jan 5, 2025
caveman99
approved these changes
Jan 5, 2025
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 afterstartTransmit()). 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

CWminandCWmax, and I also decreasedSNR_MAXto 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).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.