2014-08-15 23:43:06

by Avery Pennarun

[permalink] [raw]
Subject: Best choice of primary channels when using 40- or 80 MHz wide channels

Hi all,

I'm pretty confused about how to select the "primary" channel when
using wide channels with 802.11ac (and also 802.11n, really). My
hostapd contains a section like this:

hw_mode=a
channel=149
country_code=US
ieee80211d=1
ieee80211h=1
ieee80211n=1
ieee80211ac=1
ht_capab=[HT20][HT40+][RX-STBC1]
vht_capab=[MAX-A-MPDU-LEN-EXP4]
vht_oper_chwidth=1
vht_oper_centr_freq_seg0_idx=155

If I understand correctly, this will have the following results:
- at 20 MHz, it will use channel 149
- at 40 MHz, it will use channels 149+153 (HT40+)
- at 80 MHz, it will use channels 149+153+157+161 (centr_freq_seg0_idx)

This is fine when I'm the only AP around. But let's imagine I'm in a
crowded apartment building with lots of APs, and various clients
support only 20 MHz channel width (increasingly rare), or 20/40, or
20/40/80. In such a situation, we'd like to spread around the APs so
that clients that can only do 20 or 40 don't always fall back to
channel 149 or 149+153; otherwise we're just wasting tons of empty
space on channels 157 and 161.

The obvious way to do this would be to try a configuration like this (HT40-):

channel=153
ht_capab=[HT20][HT40-][RX-STBC1]
vht_capab=[MAX-A-MPDU-LEN-EXP4]
vht_oper_chwidth=1
vht_oper_centr_freq_seg0_idx=155

or perhaps this (40 Mhz uses upper half instead of lower half):

channel=157
ht_capab=[HT20][HT40+][RX-STBC1]
vht_capab=[MAX-A-MPDU-LEN-EXP4]
vht_oper_chwidth=1
vht_oper_centr_freq_seg0_idx=155

But when I try to do this, hostapd seems to abort and claim it can't
register to use the channels. Am I doing something wrong? Is it
hostapd version related?

Also, hostapd contains code to swap the primary/secondary 20 MHz
channels in the 40 MHz channel, based on what other APs are around.
If I read correctly, it seems to want to use the same primary channel
as everyone else. Wouldn't it be better to equailze things to try to
get about half the APs using each sub channel?

Any advice on this topic is very welcome. Thanks!

Have fun,

Avery


2014-08-18 09:14:09

by Michal Kazior

[permalink] [raw]
Subject: Re: Best choice of primary channels when using 40- or 80 MHz wide channels

On 16 August 2014 01:42, Avery Pennarun <[email protected]> wrote:
> Hi all,
>
> I'm pretty confused about how to select the "primary" channel when
> using wide channels with 802.11ac (and also 802.11n, really). My
> hostapd contains a section like this:
>
> hw_mode=a
> channel=149
> country_code=US
> ieee80211d=1
> ieee80211h=1
> ieee80211n=1
> ieee80211ac=1
> ht_capab=[HT20][HT40+][RX-STBC1]

There is no such thing as [HT20] in ht_capab in hostapd. You can just
remove it. It has no effect.


> vht_capab=[MAX-A-MPDU-LEN-EXP4]
> vht_oper_chwidth=1
> vht_oper_centr_freq_seg0_idx=155
>
> If I understand correctly, this will have the following results:
> - at 20 MHz, it will use channel 149
> - at 40 MHz, it will use channels 149+153 (HT40+)
> - at 80 MHz, it will use channels 149+153+157+161 (centr_freq_seg0_idx)

Basically, yes.


>
> This is fine when I'm the only AP around. But let's imagine I'm in a
> crowded apartment building with lots of APs, and various clients
> support only 20 MHz channel width (increasingly rare), or 20/40, or
> 20/40/80. In such a situation, we'd like to spread around the APs so
> that clients that can only do 20 or 40 don't always fall back to
> channel 149 or 149+153; otherwise we're just wasting tons of empty
> space on channels 157 and 161.
>
> The obvious way to do this would be to try a configuration like this (HT40-):
>
> channel=153
> ht_capab=[HT20][HT40-][RX-STBC1]
> vht_capab=[MAX-A-MPDU-LEN-EXP4]
> vht_oper_chwidth=1
> vht_oper_centr_freq_seg0_idx=155
>
> or perhaps this (40 Mhz uses upper half instead of lower half):
>
> channel=157
> ht_capab=[HT20][HT40+][RX-STBC1]
> vht_capab=[MAX-A-MPDU-LEN-EXP4]
> vht_oper_chwidth=1
> vht_oper_centr_freq_seg0_idx=155
>
> But when I try to do this, hostapd seems to abort and claim it can't
> register to use the channels. Am I doing something wrong? Is it
> hostapd version related?

All following configs work for me:

http://pastebin.com/w1LKTDGn
http://pastebin.com/McquAcCf
http://pastebin.com/1RNWHAAS
http://pastebin.com/kDd2RybJ

My hostapd is at 6d00ab04302df257cb3092b2b31b4eac42e77569.


>
> Also, hostapd contains code to swap the primary/secondary 20 MHz
> channels in the 40 MHz channel, based on what other APs are around.
> If I read correctly, it seems to want to use the same primary channel
> as everyone else. Wouldn't it be better to equailze things to try to
> get about half the APs using each sub channel?

That would break 20/40 coex, wouldn't it?


MichaƂ

2014-08-18 20:58:19

by Avery Pennarun

[permalink] [raw]
Subject: Re: Best choice of primary channels when using 40- or 80 MHz wide channels

On Mon, Aug 18, 2014 at 5:14 AM, Michal Kazior <[email protected]> wrote:
> On 16 August 2014 01:42, Avery Pennarun <[email protected]> wrote:
>> or perhaps this (40 Mhz uses upper half instead of lower half):
>>
>> channel=157
>> ht_capab=[HT20][HT40+][RX-STBC1]
>> vht_capab=[MAX-A-MPDU-LEN-EXP4]
>> vht_oper_chwidth=1
>> vht_oper_centr_freq_seg0_idx=155
>>
>> But when I try to do this, hostapd seems to abort and claim it can't
>> register to use the channels. Am I doing something wrong? Is it
>> hostapd version related?
>
> All following configs work for me:
>
> http://pastebin.com/w1LKTDGn
> http://pastebin.com/McquAcCf
> http://pastebin.com/1RNWHAAS
> http://pastebin.com/kDd2RybJ
>
> My hostapd is at 6d00ab04302df257cb3092b2b31b4eac42e77569.

Hmm, let me try your configurations and see what happens. Maybe I
just did something silly. That would be good news :)

>> Also, hostapd contains code to swap the primary/secondary 20 MHz
>> channels in the 40 MHz channel, based on what other APs are around.
>> If I read correctly, it seems to want to use the same primary channel
>> as everyone else. Wouldn't it be better to equailze things to try to
>> get about half the APs using each sub channel?
>
> That would break 20/40 coex, wouldn't it?

I'm certainly not the expert on this, but here's what I *think* I read
about it: in 40 MHz mode, you have to send an (identical I guess)
802.11g-compatible frame-start header on both 20 MHz subchannels at
the beginning of the frame. You also have to do carrier detection on
both subchannels before transmitting, of course. Then you can
transmit the actual content on the single 40 MHz wide channel now that
you know it's clear.

If it doesn't work this way, then if you have 802.11g APs on, say,
channels 1 and 5, and you set up a 40 MHz AP on channels 1+5 (with
either one being the primary), you will cause problems for anyone on
the secondary channel.

Am I misremembering/misunderstanding what I read? Or maybe devices
aren't actually implemented like that?

I guess the best approach is to actually benchmark it with/without the
channel swap and find out how bad the interference is.

Thanks,

Avery