Wireless Rate Adaptation NOTE

来源:互联网 发布:摄像慢镜头软件下载 编辑:程序博客网 时间:2024/06/03 14:01

[近日查阅资料的随笔记录]


Atheros硬件允许用户创建9个发送FIFIO描述符,对发送进行调度;每个发送描述符包含了发送状况,数据的指针和长度,并且包含了一个4对的“速率/重传次数”对(r0/c0,r1/ c1r2/c2r3/c3)

当无线信道可以发送的时候,硬件将引发处于FIFO头的数据的发送,首先以速率r0发送,如果发送失败,继续以速率r0发送c0-1次,然而再次以速率r1发送,如果发送失败,继续以速率r1发送c1-1次……如果发送失败了c0+c1+c2+c3次,那么放弃这次发送。

当发送完毕,或者发送放弃,硬件会在发送描述符中报告本次发送丢失的ACK的数目,因此,通过获知丢失的ACK的数目可以间接的得到本次的发送速率。

MadWiFi的这个机制称为MultiRate Retry mechanism


 



ONOE:


Thisis a credit based Rate Control Algorithm where the values of thecredit is determined by the frequency of successful , erroneous andretransmissions accumulated during a fixed invocation period of1000ms. If less than 10 percent of the packets need to beretransmitted at a particular rate, Onoe keeps increasing its creditpoint till the threshold value of 10 is reached. At this point thecurrent transmission rate is increased to the next

availablehigher rate and the process is repeated with credit score of zero.Similar logic holds for deducting the credit score and moving to alower bit rate for failed packets.


TheOnoe algorithm is much less sensitive to individual packet failurethan the ARF algorithm, and basically tries to find the highestbit-rate that has less than 50% loss rate.

Onoe对每个包的失败与否不敏感,试图找到丢贞率小于50%的最高速率。


对每个目的连接,onen保存了一个当前链路的比特率、该比特率的信用度。算法跟踪每个链路当前比特率的信用度。如果丢包率小,则尝试增加信用度;如果信用度大到了一定阈值,则尝试增加速率;如果发生一些错误,则将信用度复位,速率下降。


When packets are fist sent to adestination, Onoe sets the initial bit-rate to 24 megabits in 802.11gand 802.11a, and 11 megabits in 802.11b.

第一次发送到目的地址的时候,将初始速率设置为24M(802.11a/g)或者11M(802.11b).


1.If no packets have succeeded, move tothe next lowest bit-rate and return.

如果没有数据发送成功,降低到下一个速率。


2.If 10 or more packets have been sentand thr average number of retries per packet was greater than one,move to the next lowest bit-rate and return.

如果发送了10个以上的包,并且每个包的重传次数大于1,降低到下一个速率。


3.If more than 10% of the packetsneeded a retry, decrement the number of credits(but don't let it gobelow 0) and return.

如果超过10%的包需要重传,将信用值减小(但要保持大于0)


4.If less than 10% of the packetsneeded a retry, increment the number of credits.

如果少于10%的包需要重传,增加信用值。


5.If the current bit-rate has 10 ormore credits, increase the bit-rate and return.

如果信用值大于10,增加速率。


c1=4,c2=c3=c4=2




AMRR:


Thisalgorithm uses Binary Exponential Backoff technique to adapt thelength of the sampling period used to change the values of bit-rateand transmission count parameters. It uses probe packets anddepending on their transmission status adaptively change thethreshold value. The adaptation mechanism ensures fewer failures andhigher throughput by not switching to a higher rate as specified bythe back off mechanism.


AMRRonoe的改进,使用了二进制避退(BEB)的概念,来适应改变m/cn的周期。为了适应快速变化的无线信道,设置c0=c1=c2=c3=1,速率r3为最小可用速率(6M@ 802.11a),而r1r2分别是r0的下一个和下下个速率。因此,核心是改变r0

AMRR使用了一个定时器来周期性的进行速率控制,时间设置为1秒。


 



Sample:


Itdecides on the transmission rate based on the past history ofperformance; it keeps a record of the number of successive failures,the number of successful transmits and the total transmission alongwith the destination for that bit-rate. Stale samples are removedbased on a EWMA windowing mechanism. If in the sampling process, nosuccessful acknowledgment is received or the number of packets sentis multiple of 10 on a specific

link,it transmits packets with the highest rate which has not failed for 4successive times.


该算法周期性地发送其他速率的包进行探询,看其他速率发送是否合适。

它认为速率选择算法需要考虑以下几个方面:

1.不能认为如果某低速率性能差,那么比它高一级的速率性能会更差。

2.最高吞吐量的算法可能丢包率也多,丢包率小的速率可能吞吐量未必最高。

3.链路状态是会发生变化的,不能对链路状态进行反映,会导致低的吞吐量。

4.速率选择算法必须要高效,不能尝试所有的速率。


SampleRateis implemented in three functions:

  1. apply_rate(),whichassigns bit-rate to a packet;

  2. process_feedback(),which updates the link statistics based on the number of retries apacket used and whether the packet was successfully acknowledged;

  3. remove_stale_results(),which removes results from the transmission results queue that wereobtained longer than 10 seconds ago.

remove_stale_results()and apply_rate() are called, in that order, immediately before packettransmission, and process_feedback() is called immediately afterpacket transmission.


SampleRatemaintains data structures that keep track of the totaltransmission time, the number of successive failures, andthe number of successful transmits for each bit-rate anddestination as well as the total number of packets sent acrosseach link. It also keeps a queue of transmissionresult(transmission time, status, destination and bit-rate) so itcan adjust the average transmission time for each bit-rate anddestination when transmission results become stale.


apply_rate()performs the following operations:

  1. Ifno packets have been successfully acknowledged, return the highestbit-rate that has not had 4 successive failures.

  2. Incrementthe number of packets sent over the link.

  3. Ifthe number of packets sent over the link is a multiple of ten,select a random bit-rate from the bit-rates that have not failedfour successive times and that have a minimum packet transmissiontime lower than the current bit-rate's average transmission time.

  4. Otherwise,send the packet at the bit-rate that has the lowest average218.104.71.166transmissiontime.


Whenprocess_feedback() runs, it updates information that tracks thenumber of samples and recalculates the average transmission time forthe bit-rate and destination. process_feedback() performs thefollowing operations:

  1. Calculatethe transmission time for the packet based on the bit-rate andnumber of retries using Equation 5.1 below.

  2. Lookup the destination and add the transmission time to the totaltransmission times for the bit-rate.

  3. Ifthe packet succeeded, increment the number of successful packetssent at that bit-rate.

  4. Ifthe packet failed, increment the number of successive failure forthe bit-rate. Otherwise reset it.

  5. Re-calculatethe average transmission time for the bit-rate based on the sum oftransmission time and the number of successful packets sent at thatbit-rate.

  6. Setthe current bit-rate for the destination to the one with the minimumaverage transmission time.

  7. Appendthe current time, packet status, transmission time, and bit-rate tothe list of transmission results.


SampleRate'sremove_stale_results() function performs these operations for eachstale sample, it recalculates the minimum average transmission timesfor each bit-rate and destination. remove_stale_results() then setsthe currents bit-rate for each destination to the one with thesmallest average transmission time.


Tocalculate the transmission time of a n-byte unicast packet given thebit-rate b and number of retries r, SampleRate uses the followingequation:


tx_time(b,r,n)= difs+backoff(r)+(r+1)(sifs+ack+header+(n*8/b))


wheredifs is 50 microseconds in 802.11b and 28 microseconds in 802.11a/g,sifs is 10 microseconds for 802.11b and 9 for 802.11a/g, and ack is304 microseconds using 1 megabit acknowledgments for 802.11b and 200microseconds for 6 megabit acknowledgment. Header is 192 microsecondsfor 1 megabit 802.11b packets, 96 for other 802.11b bit-rate, and 20for 802.11a/g bit-rates.




原创粉丝点击