♥India♥

Details on CWmin and CWmax (Contention Window Minimum and Maximum)


2 comments
Categories : CSMA/CA , WLAN

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:

PHYCWminCWmax
802.11b311023
802.11g15 or 311023
802.11a151023
802.11n151023
802.11ac151023

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

0-63

0-127

0-255

0-511

0-1023(CWmax)

♠ 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”.

PHYCWminCWmaxECW MinECW Max
802.11b311023510
802.11g15(bg) or 31 (g)10234 or 510
802.11a151023410
802.11n151023410
802.11ac151023410

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

♣ CWmin and CWmax values for WMM ACs:

Let’s assume CWmin = 15 and CWmax = 1023 for below table.

ACAIFSNCWminCWmax
BK7CWmin=15CWmax=1023
BE3CWmin=15CWmax=1023
VI2(CWmin+1)/2 – 1 =7CWmin=15
VO2(CWmin+1)/4 – 1 =3(CWmin+1)/2 – 1 =7

Here is screenshot for above values advertised in Beacon.

ECW Min and ECW Max

In another way:

Initial CW range for

BK: 0-15

BE: 0-15

VI: 0-7

VO: 0-3

With above configurations we can easily understand how VO,VI are given highest priority for transmitting frames.

Conclusion:

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 feedback@wifisharks.com. ♥♥ 

2 comments on “Details on CWmin and CWmax (Contention Window Minimum and Maximum)

    Anshul Bhargava

    • June 17, 2022 at 8:47 am

    Hi Bamdeb..

    Thanks for Explaining , i have one query ,we calculate random back of time with the help of cwmin & max that is present in the WMM field , when there is no WMM IE then how we get this random backoff time?

      Bamdeb

      • June 19, 2022 at 1:20 am

      From “https://wifisharks.com/2021/02/13/cwmin-cwmax/” and as per “CWmin and Cwmax table ” CWmin and CWmax values are fixed for any particular PHY [11a, 11ac, 11n etc]. So if WMM IE is not there then the default values will be used as per table. Another way , when there is no WMM IE, there is no other AC than BE.

Leave a Reply to Bamdeb Cancel reply

Your email address will not be published. Required fields are marked *

error: Content is protected !!
%d bloggers like this: