Sunday, August 17, 2014

802.11h in action

As you may or may not know, part of 802.11-2012 standard specifies the DFS or Dynamic Frequency Selection due to regulations that apply in most regulatory domains for RLANs in the 5GHz spectrum. DFS is there so that 802.11 radios don't interfere with other (more important) radar systems in the same radio vicinity. These are usually weather radars used by airplanes and having such a capability is a really good idea. DFS was originally part of 802.11h amendment which in turn is now part of the 802.11-2012 standard, but I'll refer to it as 11h.

In very short, the .11 radio in an AP wishing to operate on one of the UNII2e channels must continuously scan that channel for any presence of radar and must cease transmission on that channel if it detects a radar source. Some of the rules and procedures are written in this document from Cisco. 

The APs objective in changing channels is that disruption to the BSS is minimal and one of DFS procedures to help with this is the setting of the channel switch announcement element (CSA) in Beacon, Probe Response and/or Action management frames which tells it's associated STAs to which channel the AP is hopping and when. Below is an example of a beacon frame with a set CSA element. You can filter these frames out of a capture with "wlan_mgt.csa.channel_switch_mode" filter in wireshark.
The count value is the value of remaining beacons that will be broadcast on the current operating channel. The number here is 20 which indicates that 20 beacons (about 2 seconds) including this one are left before the channel change to channel 128 will be done. This number is decreasing with every sent beacon and when it reaches 1 you won't see another beacon or any other frame from the AP broadcasting BSS on the channel.

This assisting of changing channels isn't a guarantee that the STAs will actually accept the change and follow the AP to the new channel but most STAs will. STAs following the AP is only logical to do since the AP is handing the STA a new pipe to the net on a plate, but not all are made the same and some can switch to a new or even different BSS if they so choose.

If you've read this far first a thank you, and if you're asking your self why am I writing about this or who cares about channel changes I just wanted to  point out one vendors clever use of this function. Ruckus Wireless APs employ what their marketing calls ChannelFly. What their APs do is basically periodically hop through available channels in search of the one with best throughput characteristics. 'Everybody uses that. It's called background scanning' I hear you saying. Well CF differs from background scanning in that it doesn't go off channel to scan a different channel, but it just changes channels and operates on a new channel and takes measurements on that one and then hops again with the point of finding the one with the best characteristics of throughput and capacity. Each time it hops it uses the CSA element in it's beacons to hopefully take all it's associated STAs with it. 'Hopefully!?!', well for the most it does so without a problem. I've found many 5GHz STAs follow the AP without a problem, but some STAs might cause some problems. I have an HP laptop that operates in the 2,4GHz only and is supporting 11h, but upon a channel change it just gets lost and I have to disable/enable the NIC to get it running again.

My recommendation for CF would be to try it and see, but I consider it pretty safe when enabled on the 5GHz. For the 2,4GHz I suggest you try it and see if any STAs have problems when the AP is changing channels.

Monday, August 4, 2014

Fast & furious WLAN dB math

This post is a different look on Keith Parsons' "Easy dB Math in 5 minutes" but by no means a replacement. I've found that I learn thing faster if I see them from different perspectives and this is just that, a different perspective on the same subject.

There are only 2 things that you need to know really. The first is the linear to logarithmic conversion which Keith describes in Rule #2. This is what you need to remember.

+3dB = times 2 in linear form
-3dB = devide by 2 in linear form

And the other

10dB = 10 in linear form

The last one is important at the beginning when picking a reference point from which to start from. For about 99,9% of things in WLAN design the only 3 reference points will be 10dBm, 20dBm or 30dBm or 10mW, 100mW and 1000mW in linear terms. 

To convert it from one to the other just remember this: The number of zeroes in linear defines the first number of the dBm value and then you just ad a zero after that. For example

1000mW has 3 zeroes which you write as 30 and get the dBm value

And for the other way around the first number in dBm value (or dB or any other dBx value) defines the amount of zeros you add after number 1. For example

20dBm needs to have 2 zeroes after 1 or 100mW

Learn by doing

So to put this to practice, I've said that picking the right starting point is the key to fast conversion. For example, if we wanted to convert 27dBm to mW where would we start. The reference needs to be such that you can either add up to or down from it 3dB to the specified dBm value (27dBm) and then simply convert that to linear value. 

Let's first try to use 20dBm as reference. If we try to add up 3dB from that we couldn't get to 27dBm as 

20dBm +3dB + 3dB is 26dBm and
20dBm +3dB +3dB +3dB is 29dBm

So a better reference would be 30dBm since
30dBm -3dB = 27dBm

Since we know that 30dBm needs to have 3 zeroes after number 1 and -3dB means we need to divide that by 2 we can calculate that

1000mW divided by 2 is 500mW

We can make another example and convert 19dBm. In this example either 20dBm nor 30dBm would be the right starting points since we can't subtract 3dB from either of those to get to 19. But if we take the reference of 10dBm we can count up 3dB to it like so

10dBm +3dB +3dB +3dB = 19dBm

which translates to

10 x2 x2 x2 = 80mW

So as you can see it's pretty easy and hopefully you'll be translating linear to dB and vice versa easier now.