"sample" rate control module
This is an implementation of John Bickett's paper.
The sample rate control module does a few things different to onoe and amrr. It doesn't simply bump the transmission rate up or down.
The thirty second overview:
- It "samples" all of the rates, both CCK and OFDM;
- It calculates an average TX time based on the packet error rate and the perfect (ie, 0 error) TX time;
- It picks the highest rate which minimises average TX time.
Legacy (pre-802.11n) behaviour
The best thing to do is read the paper. Sorry!
Adrian's modifications for 802.11n
In order to make ath_rate_sample work ('good enough for testing') for 802.11n, Adrian made a few changes:
- The MCS rates (1, 2, 3 stream) needed to be added to the TX schedule tables;
- .. and MCS aware packet length calculations were added;
- A lot of the packet counters became 64 bits rather than 32 bits, as the 32 bit counters could wrap after a few hours;
- The ath_rate API for TX completion was extended to include aggregate information - specifically the number of frames in the aggregate and the number of failures. (From this the "number of good" frames can be determined);
- A weighted average (EWMA) is kept for each of the TX rates;
- The average TX time is calculated based on the EWMA rather than the total error rate;
- Since 2 stream rates have a slightly higher TX time than 1 stream rates, add a fudge in pick_best_rate() which gives a little leeway for this.
There are likely quite a few other changes which haven't been listed here - look at the SVN history!
What doesn't work well right now
Although this works, it can be much, much better!
- The default parameters (EWMA smoothing rate = 95%) is not optimal - bursty failures will force the EWMA to drop quickly but sampling doesn't bump up the EWMA very quickly. So it can take many minutes of sampling to allow a higher rate to become OK again.
- .. and it's quite possible that the smoothing rate should be per-node and dynamic - ie, try to find a way to let the EWMA recover (much) quicker from the sampling.
Where to go from here