Details on CWmin and CWmax (Contention Window Minimum and Maximum)
CW = Contention Window. CWmin and CWmax mean Minimum Contention Window and Maximum Contention Windows. Let’s understand where we need these two parameters.
If you have already gone through the CSMA/CA post then it will be easy to understand where these are used. In CSMA/CA flow chart there is one step
=> “Select a random backoff value if one is not chosen already”.
This random backoff value is chosen from the defined CWmina and CWmax value for device.
♣ CWmin and CWmax table:
|802.11g||15 or 31||1023|
♣ Example to understand easily:
Let’s say one device (802.11a supported) wants to send a frame.
According to the table,
CWmin=15 and Cwmax is 1023.
♦ 1st attempt: This device has option to select a random value form
0 – 15 and following CSMA/CA rule the selected random value will be decremented for each slot time [As long as Wireless Medium is free].
♦ 2nd attempt: If the 1st attempt is failed then this device has below CW range.
0 – 31. Why ☻?
Each time a device is failed to transmit any frame the CW window will be increased exponentially keeping the CWmax constant. As the device failed on 1st attempt so the new CW range for choosing random backoff number is 0-31.
For any further failure the CW range will be
♠ Note: Minimal value of CW is 0 but Maximum value of CW at any particular time always varies.
♣ When device stops transmitting a frame if there is contentious (nth attempt) failure?
In simple there below conditions:
♦ CWmax is reached as CW range. This means when device gets the CW range as 0-CWmax.
♦ Maximum retry count is reached for a particular frame.
♣ Understand exponential behavior:
We generally use ECWmin and ECWmax for representing “exponential CWmin” and “exponential CWmax”.
|PHY||CWmin||CWmax||ECW Min||ECW Max|
|802.11g||15(bg) or 31 (g)||1023||4 or 5||10|
Let’s understand 802.11b row: 25-1=31, 210-1=1023
The CW range for 1st attempt for 802.11b is: 0-31
The CW range for 2nd attempt for 802.11b is: 0-(26-1) = 0-63
The CW range for 3rd attempt for 802.11b is: 0-(27-1) = 0-127
Following this we can do the calculation for others easily.
♣ Where do we see CWmin, CWmax values in sniffer capture?
In Beacon or Probe Response we can see this value under WMM field.
♣ CWmin and CWmax values for WMM ACs:
Let’s assume CWmin = 15 and CWmax = 1023 for below table.
|VI||2||(CWmin+1)/2 – 1 =7||CWmin=15|
|VO||2||(CWmin+1)/4 – 1 =3||(CWmin+1)/2 – 1 =7|
Here is screenshot for above values advertised in Beacon.
In another way:
Initial CW range for
With above configurations we can easily understand how VO,VI are given highest priority for transmitting frames.
From above article we understand where CWmin and CWmax are used and what the importance of these values are.
♥♥ If you have any doubts or query please let me know in comment section or send mail at email@example.com. ♥♥