minstrel.txt

来自「madwifi driver, linux system」· 文本 代码 · 共 357 行 · 第 1/2 页

TXT
357
字号
         Psucces_this_time_interval * (100 - ath_ewma_level) + (Pold * ath_ewma_level)Pnew =  ------------------------------------------------------------------------------                  100                            number_packets_sent_successfully_this_rate_time_intervalPsuccess_this_time_interval=--------------------------------------------------------                             number_packets_sent_this_rate_time_intervalIf no packets have been sent for a particular rate in a time interval, nocalculation is carried out. The Psuccess value for this rate is not changed.If the new time interval is the first time interval (the module has just beeninserted), then Pnew is calculated from above with Pold set to 0.The appropriate update interval was selected on the basis of choosing a compromisebetween *collecting enough success/failure information to be meaningful *minimising the amount of cpu time spent do the updates *providing a means to recover quickly enough from a bad rate selection.The first two points are self explanatory. When there is a sudden change in the radioenvironment, an update interval of 100ms will mean that the rates marked as optimal arevery quickly marked as poor. Consequently, the sudden change in radio environment willmean that minstrel will very quickly switch to a better rate. A sudden change in the transmission probabilities will happen when thenode has not transmitted any data for a while, and during that timethe environment has changed. On starting to transmit, the probabilityof success at each rate will be quite different. The driver must adaptas quickly as possible, so as to not upset the higher TCP networklayers.Module Parameters====================================================The module has three parameters:name              default value    purposeath_ewma_level      75%            rate of response to new data. A value of 100 is VERY responsive.ath_lookaround_rate 10%            percent of packets sent at non optimal speed.ath_segment_size   6000            maximum duration of a retry segment (microseconds)Test Network====================================================We used three computers in our test network.  The first two, equipped withatheros cards running in adhoc mode. We used a program that sends a fixednumber of TCP packets between computers, and reports on the data rate. Theapplication reports on the data rate - at an application layer level, which isconsiderably lower than the level used in transmitting the packets.The third computer had an atheros card also, but was running network monitormode with ethereal. The monitor computer was used to see what data rates wereused on the air. This computer was a form of "logging of the connection"without introducing any additional load on the first two computers.It was from monitoring the results on the third computer that we started toget some confidence in the correctness of the code. We observed TCPbackoffs (described above) on this box. There was much celebration when thethroughput increased simply because the retry chain was finished in under 26ms.Our view was that throughput between the two computers should be asclose as possible (or better than) what can be achieved by settingboth ends to fixed rates. Thus, if setting the both ends to fixedrates significantly increases the throughput, a reasonable conclusionis that a fault exists in the adaptive rate rate.We recorded throughputs (with minstrel) that are within 10% of what isachieved with the experimentally determined optimum fixed rate. Notes on Timing====================================================As noted above, Minstrel calculates the throughput for each rate. Thiscalculation (using a packet of size 1200 bytes) determines thetransmission time on the radio medium. In these calculations, we assume acontention window min and max value of 4 and 10 microseconds respectively.Further, calculation of the transmission time is required so that we canguarantee a packet is transmitted (or dropped) in a minimum time period.The transmission  time is used in determining how many times a packetis transmitted in each segment of the retry chain.Indeed, the card will supply the cwmin/cwmax values directly iwpriv if_name get_cwmin <0|1|2|3> <0|1>We have not made direct calls to determine cwmin/cwmax - this is an areafor future work. Indeed, the cwmin/cwmax determination code could check tosee if the user has altered these values with the appropriate iwpriv.The contention window size does vary with traffic class. For example,video and voice have a contention window min of 3 and 2 microsecondsrespectively. Currently, minstrel does not check traffic class.Calculating the throughputs based on traffic class and bit rate andvariable packet size will significantly complicate the code and requiremany more sample packets. More sample packets will lower the throughputachieved. Thus, our view is that for this release, we should take a simple(but reasonable) approach that works stably and gives good throughputs.Values of cwin/cwmax of 4 and 10 microseconds are from IEEE Part 11: Wireless LAN Medium Access Control (MAC) and Physical Layer(PHY) specifications, Amendment : Medium Access Control (MAC) Enhancements forQuality of Service (QoS) P802.11e/D12.0, November 2004.Internal variable reporting====================================================The minstrel algorithm reports to the proc file system its internalstatistics, which can be viewed as text. A sample output is below:cat /proc/net/madwifi/ath0/rate_inforate data for node:: 00:02:6f:43:8c:7arate     throughput  ewma prob   this prob  this succ/attempt   success    attempts     1         0.0        0.0        0.0          0(  0)          0           0     2         1.6       92.4      100.0          0(  0)         11          11     5.5       3.9       89.9      100.0          0(  0)         11          11    11         6.5       86.6      100.0          0(  0)         10          11     6         4.8       92.4      100.0          0(  0)         11          11     9         6.9       92.4      100.0          0(  0)         11          11    12         9.0       92.4      100.0          0(  0)         11          11    18        12.1       89.9      100.0          0(  0)         11          11    24        15.5       92.4      100.0          0(  0)         11          11    36        20.6       92.4      100.0          0(  0)         11          11 t  48        23.6       89.9      100.0          0(  0)         12          12T P 54        27.1       96.2       96.2          0(  0)        996        1029Total packet count::    ideal 2344      lookaround 261There is a separate table for each node in the neighbor table, which willappear similar to above.The possible datarates for this node are listed in the column at the left. Thecalculated throughput and "ewma prob" are listed next, from which the ratesused in retry chain are selected. The rates with the maximum throughput,second maximum throughput and maximum probability are indicated by the lettersT, t, and P respectively.The statistics gathered in the last 100ms time period are displayed in the"this prob" and "this succ/attempt" columns.Finally, the number of packets transmitted at each rate, since module loadingare listed in the last two columns. When interpreting the last four columns,note that we use the words "succ" or "success" to mean packets successfullysent from this node to the remote node. The driver determines success byanalysing reports from the hal. The word "attempt" or "attempts" means thecount of packets that we transmitted. Thus, the number in the success columnwill always be lower than the number in the attempts column. When the two nodes are brought closer together, the statistics start changing,and you see more successful attempts at the higher rates. The ewma prob at thehigher rates increases and then most packets are conveyed at the higher rates.When the rate is not on auto, but fixed, this table is stillavailable, and will report the throughput etc for the current bitrate. Changing the rate from auto to fixed to auto will completelyreset this table, and the operation of the minstrel module.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?