Unexpected properties of contention windows for rebroadcasting #8431
Replies: 1 comment 2 replies
-
|
First of all, SNR is just a heuristic; it was not designed to be a one-to-one relationship with rebroadcasting delay. There’s all kind of hardware and environmental differences that makes it not suited to follow precisely.
|
Beta Was this translation helpful? Give feedback.




Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm currently looking deeper into how the rebroadcast timing works in the firmware. There's plenty of proposals about changing the Role's behaviour, so I wanted to make sure my assumptions about the current behaviour are right to begin with... Turns out they're not.
There's multiple surprises (to me), I'll go through them step by step.
This plot shows the range of possible delays a node randomly chooses from to wait before rebroadcasting a packet in units of "slots".
The range depends on the SNR measured at reception and the role:
ROUTER-like (green)CLIENT-like (blue)ROUTER_LATE(red)First, the expectations that got confirmed:
Now here's what I'm surprised about. It's multiple things, I'll try to explain and visualize as clearly as I can, please bear with me.
I'll always provide one plot on the left that shows the "issue" and one plot on the right that shows what I expected it to be like.
1. A Client with vastly higher SNR still has a significant chance of preempting a Client with much lower SNR
That's because the lower bound of the Clients delay window is independent of SNR. (left plot).
I would have expected the lower bound of the range to increase with SNR, too, so a node with vastly higher SNR (1) doesn't preempt another one (2), even when it chooses a pretty small delay from their allowed range by chance (right plot).
2. Within major ranges, a Client that received with multiple dB lower SNR has zero (!) preference over another Client
There's only a small number of discrete steps here. In this example - despite significantly different SNR (here -14.5 dB vs. -9.5 dB) both Clients choose their delay randomly from the exact same range of possible values. Which of these Clients rebroadcasts is a 50/50 chance within a whole range of SNR values.
I would have expected the ranges to smoothly scale with SNR, so even though the ranges of nodes with similar SNR overlap, the lower SNR node (4) is more likely to rebroadcast and preempt (3) than the other way around.
There's so few different ranges because
RadioInterface::getCWsize(float snr)returns auint8_tin the range 3...8If
getCWsize()returned a float 3.0...8.0 instead and the rounding to an Integer amount of timeslots was only done later inRadioInterface::getTxDelayMsecWeighted()we would get the expected rebroadcasting preference that scales smoothly with SNR.3. Routers consider SNR, too


I'm not sure why that is, given that they are not able to silence each other anyways.
I would expect them to always choose from the full range of delays up to where the Client window starts, to make collisions as unlikely as possible:
4. Router_Late considers SNR, too
Again, I'm not sure why that is. My impression was that the whole selling point of Router_Late is to not preempt Client-Rebroadcasts.
But according to this, it's actually very likely that a low-SNR Router_Late somewhere will preempt most Clients.
I would have expected the "Late" window to always be later than the whole Client-window, independent of SNR.
5. There's just a single slot for Router_Late
Apparently, the "Late window" that is used by Router_Late isn't actually a window, it's a deterministic delay based on SNR. And since there's just a small handful of bins that all SNRs are grouped into right now, the risk of collision between multiple Router_Late seems pretty high.
Beta Was this translation helpful? Give feedback.
All reactions