Patchwork [PROPOSAL] Add hostapd.conf parameter to skip check forneighboring BSS (prevent fallback in 150Mb mode)

login
register
mail settings
Submitter Alex Vorona
Date March 4, 2012, 7 a.m.
Message ID <4F53130D.1090007@vorona.com.ua>
Download mbox | patch
Permalink /patch/144477/
State Rejected
Headers show

Comments

Alex Vorona - March 4, 2012, 7 a.m.
Hello,

Sorry I cannot find how to reply to existing thread just after subscribe. So I had to use
the same topic name.

Here is hostapd -d start log

Scan for neighboring BSSes prior to enabling 40 MHz channel
Scan requested (ret=0) - scan timeout 10 seconds
Interface initialization will be completed in a callback
nl80211: Event message available
nl80211: Scan trigger
[...]
nl80211: New scan results available
Received scan results (4 BSSes)
40 MHz affected channel range: [2422,2472] MHz
Neighboring BSS: cc:96:a0:f5:4a:00 freq=2422 pri=3 sec=7
40 MHz pri/sec mismatch with BSS cc:96:a0:f5:4a:00 <2422,2442> (chan=3+) vs. <2457,2437>
20/40 MHz operation not permitted on channel pri=10 sec=6 based on overlapping BSSes

I can change channel to any between 1 and 10 in hostapd.conf and got the same result.
using HT40- instead HT40+ did not help.

If primary or secondary channel is 11+, I got something like that
nl80211: Failed to set channel (freq=2462): -22 (Invalid argument)
but that's unrelated to the problem, IMHO.

Why  I'm not able to force 40MHz operation in my apartment? OK, I can "hear" neighboring
APs through the concrete walls with low signal quality, so what? This is my apartment, not
neighbors. And even if we share walls or floor, I'm still want to use 40MHz like the
neighbor did. So I had attached quick patch just to disable 20MHz fallback.

I understand you guys trying to make things right, but I use Linux to make things as I
need, and that's why I love it. Being smart is clever but I need an ability to disable this.

Thanks,
Alex
Valeriy Kucherenko - March 4, 2012, 8:50 p.m.
Hello.

I'm using this workaround too, but have noticed that my clients sometimes fallback into 150mbps mode again. I have not investigated this problem.
Simple reconnect or hostapd restart solves this for some time.
Did you have that behavior too?


> Hello,
> 
> Sorry I cannot find how to reply to existing thread just after subscribe. So I had to use
> the same topic name.
> 
> Here is hostapd -d start log
> 
> Scan for neighboring BSSes prior to enabling 40 MHz channel
> Scan requested (ret=0) - scan timeout 10 seconds
> Interface initialization will be completed in a callback
> nl80211: Event message available
> nl80211: Scan trigger
> [...]
> nl80211: New scan results available
> Received scan results (4 BSSes)
> 40 MHz affected channel range: [2422,2472] MHz
> Neighboring BSS: cc:96:a0:f5:4a:00 freq=2422 pri=3 sec=7
> 40 MHz pri/sec mismatch with BSS cc:96:a0:f5:4a:00 <2422,2442> (chan=3+) vs. <2457,2437>
> 20/40 MHz operation not permitted on channel pri=10 sec=6 based on overlapping BSSes
> 
> I can change channel to any between 1 and 10 in hostapd.conf and got the same result.
> using HT40- instead HT40+ did not help.
> 
> If primary or secondary channel is 11+, I got something like that
> nl80211: Failed to set channel (freq=2462): -22 (Invalid argument)
> but that's unrelated to the problem, IMHO.
> 
> Why  I'm not able to force 40MHz operation in my apartment? OK, I can "hear" neighboring
> APs through the concrete walls with low signal quality, so what? This is my apartment, not
> neighbors. And even if we share walls or floor, I'm still want to use 40MHz like the
> neighbor did. So I had attached quick patch just to disable 20MHz fallback.
> 
> I understand you guys trying to make things right, but I use Linux to make things as I
> need, and that's why I love it. Being smart is clever but I need an ability to disable this.
> 
> Thanks,
> Alex
> 
> 
> _______________________________________________
> HostAP mailing list
> HostAP@lists.shmoo.com
> http://lists.shmoo.com/mailman/listinfo/hostap
Jouni Malinen - April 8, 2012, 9:35 a.m.
On Sun, Mar 04, 2012 at 09:00:29AM +0200, Alex Vorona wrote:
> Scan for neighboring BSSes prior to enabling 40 MHz channel
> [...]
> 40 MHz affected channel range: [2422,2472] MHz
> Neighboring BSS: cc:96:a0:f5:4a:00 freq=2422 pri=3 sec=7
> 40 MHz pri/sec mismatch with BSS cc:96:a0:f5:4a:00 <2422,2442> (chan=3+) vs. <2457,2437>
> 20/40 MHz operation not permitted on channel pri=10 sec=6 based on overlapping BSSes
> 
> I can change channel to any between 1 and 10 in hostapd.conf and got the same result.
> using HT40- instead HT40+ did not help.

Did you try using the same combination as the conflicting BSS, i.e.,
channel 3 HT40+? The only rule that hostapd is currently using for 40
MHz channels on 2.4 GHz band is to mandate that the same pri/sec
channels are used with any other 40 MHz BSS in the affected frequency
range.

If there is more than one 40 MHz BSS on 2.4 GHz already running with
conflicting channels, they should not really have started in the first
place.. Is that the case here?
Valeriy Kucherenko - April 8, 2012, 10:49 a.m.
> On Sun, Mar 04, 2012 at 09:00:29AM +0200, Alex Vorona wrote:
> > Scan for neighboring BSSes prior to enabling 40 MHz channel
> > [...]
> > 40 MHz affected channel range: [2422,2472] MHz
> > Neighboring BSS: cc:96:a0:f5:4a:00 freq=2422 pri=3 sec=7
> > 40 MHz pri/sec mismatch with BSS cc:96:a0:f5:4a:00 <2422,2442> (chan=3+) vs. <2457,2437>
> > 20/40 MHz operation not permitted on channel pri=10 sec=6 based on overlapping BSSes
> > 
> > I can change channel to any between 1 and 10 in hostapd.conf and got the same result.
> > using HT40- instead HT40+ did not help.
> 
> Did you try using the same combination as the conflicting BSS, i.e.,
> channel 3 HT40+? The only rule that hostapd is currently using for 40
> MHz channels on 2.4 GHz band is to mandate that the same pri/sec
> channels are used with any other 40 MHz BSS in the affected frequency
> range.
> 
> If there is more than one 40 MHz BSS on 2.4 GHz already running with
> conflicting channels, they should not really have started in the first
> place.. Is that the case here?

I guess that this is my case. Hostapd won't start in 40 mhz mode if any overlapping BSS is found on 13+9 channel,
but the main problem, as I write before, is that even if it starts in 40 mhz mode (clients shows 270-300 mbps connection), 
then from time to time it fallback in 20 mhz mode (clients shows 150 mbps connection). I can't understand why this happens,
but it happens. And after overriding scan results with oper40 = 1; this problem seems to go away.

Anyway, you wrote that hostapd check for overlapping BSSes only at startup. Let's assume that at the moment of start there was one
conflicting BSSes on our channels, so as result hostapd started in 20 mhz mode. Then, after some time this conflicting AP has 
gone away (this is an example from real life). In this case, I guess, hostapd will still work in 20 mhz mode and will not switch 
into 40 mhz mode because check for neighboring BSSes performed only at startup. Am I correct?

> 
> -- 
> Jouni Malinen                                            PGP id EFC895FA
> _______________________________________________
> HostAP mailing list
> HostAP@lists.shmoo.com
> http://lists.shmoo.com/mailman/listinfo/hostap
Jouni Malinen - April 8, 2012, 3:08 p.m.
On Sun, Apr 08, 2012 at 01:49:38PM +0300, Valeriy Kucherenko wrote:
> I guess that this is my case. Hostapd won't start in 40 mhz mode if any overlapping BSS is found on 13+9 channel,

That would need to be another 40 MHz BSS with different
primary/secondary channels..

> but the main problem, as I write before, is that even if it starts in 40 mhz mode (clients shows 270-300 mbps connection), 
> then from time to time it fallback in 20 mhz mode (clients shows 150 mbps connection). I can't understand why this happens,
> but it happens. And after overriding scan results with oper40 = 1; this problem seems to go away.

Have you verified that the AP Beacon frames are indeed changing at that
point or is this based just on what a client may show based on whatever
mechanism implemented at that device? hostapd does currently update the
HT Protection field dynamically based on what kind of stations are
around it in the operating channel, but I don't think it even has
capability of disabling 40 MHz mode without a restart..

> Anyway, you wrote that hostapd check for overlapping BSSes only at startup. Let's assume that at the moment of start there was one
> conflicting BSSes on our channels, so as result hostapd started in 20 mhz mode. Then, after some time this conflicting AP has 
> gone away (this is an example from real life). In this case, I guess, hostapd will still work in 20 mhz mode and will not switch 
> into 40 mhz mode because check for neighboring BSSes performed only at startup. Am I correct?

Yes, that's the current implementation. This will hopefully get more
dynamic in the future to allow 20/40 MHz mode to be enabled (and also
disabled) automatically based on periodic scans by the AP and/or
associated stations indicating that conflicting device leave/enter the
radio range.
Alex Vorona - April 10, 2012, 7:30 p.m.
08.04.2012 12:35, Jouni Malinen wrote:

> On Sun, Mar 04, 2012 at 09:00:29AM +0200, Alex Vorona wrote:
>> Scan for neighboring BSSes prior to enabling 40 MHz channel [...] 40 MHz affected
>> channel range: [2422,2472] MHz Neighboring BSS: cc:96:a0:f5:4a:00 freq=2422 pri=3 sec=7
>> 40 MHz pri/sec mismatch with BSS cc:96:a0:f5:4a:00 <2422,2442> (chan=3+) vs.
>> <2457,2437> 20/40 MHz operation not permitted on channel pri=10 sec=6 based on
>> overlapping BSSes I can change channel to any between 1 and 10 in hostapd.conf and got
>> the same result. using HT40- instead HT40+ did not help. 
> Did you try using the same combination as the conflicting BSS, i.e., channel 3 HT40+? 
Yes, that worked but probably due to same channels I got 3-4MBytes/70ms  download/ping
instead of 10-11MBytes/20ms.

Here I go on channel 2 HT40+ - same as detected neighboring BSS
======================================
Received scan results (4 BSSes)
40 MHz affected channel range: [2402,2452] MHz
Neighboring BSS: cc:96:a0:f5:4a:01 freq=2417 pri=2 sec=6
Neighboring BSS: cc:96:a0:f5:4a:02 freq=2417 pri=2 sec=6
Neighboring BSS: cc:96:a0:f5:4a:03 freq=2417 pri=2 sec=6
Neighboring BSS: cc:96:a0:f5:4a:00 freq=2417 pri=2 sec=6
Completing interface initialization
Mode: IEEE 802.11g  Channel: 2  Frequency: 2417 MHz
[...]
iw wlan0 station dump
[...]
        tx bitrate:     150.0 MBit/s MCS 7 40Mhz short GI
voron@jdi:~$ wget -O /dev/null .../128m.jpg
[...]
2012-04-10 21:55:10 (3,72 MB/s) - «/dev/null» saved [134217728/134217728]
======================================
Here I go on channel 10 HT40- with forced 40MHz
======================================
Received scan results (4 BSSes)
40 MHz affected channel range: [2422,2472] MHz
Neighboring BSS: cc:96:a0:f5:4a:00 freq=2417 pri=2 sec=6
40 MHz pri/sec mismatch with BSS cc:96:a0:f5:4a:00 <2417,2437> (chan=2+) vs. <2457,2437>
Completing interface initialization
Mode: IEEE 802.11g  Channel: 10  Frequency: 2457 MHz
[...]
iw wlan0 station dump
[...]
        tx bitrate:     150.0 MBit/s MCS 7 40Mhz short GI

voron@jdi:~$ wget -O /dev/null .../128m.jpg
[...]
2012-04-10 21:57:16 (10,1 MB/s) - «/dev/null» saved [134217728/134217728]
======================================

> The only rule that hostapd is currently using for 40 MHz channels on 2.4 GHz band is to
> mandate that the same pri/sec channels are used with any other 40 MHz BSS in the
> affected frequency range.
So I had to watch to neighbors' APs channels every time my hostapd is started/restarted
and change channel/HT40+/- in hostapd.conf?  Ok, and if there will be two 40MHz APs before
my hostapd? And neighbors' APs will dynamically(or on boot) change their channels?

> If there is more than one 40 MHz BSS on 2.4 GHz already running with conflicting
> channels, they should not really have started in the first place.. Is that the case here? 
I think these APs do not care about neighbors. They care about their owners, housewifes,so
they just up and run @40MHz despite of anything.

Regards,
Alex
Valeriy Kucherenko - April 10, 2012, 10:35 p.m.
> On Sun, Apr 08, 2012 at 01:49:38PM +0300, Valeriy Kucherenko wrote:
> > I guess that this is my case. Hostapd won't start in 40 mhz mode if any overlapping BSS is found on 13+9 channel,
> 
> That would need to be another 40 MHz BSS with different
> primary/secondary channels..
> 
> > but the main problem, as I write before, is that even if it starts in 40 mhz mode (clients shows 270-300 mbps connection), 
> > then from time to time it fallback in 20 mhz mode (clients shows 150 mbps connection). I can't understand why this happens,
> > but it happens. And after overriding scan results with oper40 = 1; this problem seems to go away.
> 
> Have you verified that the AP Beacon frames are indeed changing at that
> point or is this based just on what a client may show based on whatever
> mechanism implemented at that device? hostapd does currently update the
> HT Protection field dynamically based on what kind of stations are
> around it in the operating channel, but I don't think it even has
> capability of disabling 40 MHz mode without a restart..

I don't know how to verify AP Beacon frames. I'm relying on what my notebook (Win7, Intel Centrino Adv-N 6200 AGN) is showing in wireless connection status (mbps) and real data transfer rate (mb/sec).

> 
> > Anyway, you wrote that hostapd check for overlapping BSSes only at startup. Let's assume that at the moment of start there was one
> > conflicting BSSes on our channels, so as result hostapd started in 20 mhz mode. Then, after some time this conflicting AP has 
> > gone away (this is an example from real life). In this case, I guess, hostapd will still work in 20 mhz mode and will not switch 
> > into 40 mhz mode because check for neighboring BSSes performed only at startup. Am I correct?
> 
> Yes, that's the current implementation. This will hopefully get more
> dynamic in the future to allow 20/40 MHz mode to be enabled (and also
> disabled) automatically based on periodic scans by the AP and/or
> associated stations indicating that conflicting device leave/enter the
> radio range.

Thanks for info.

> 
> -- 
> Jouni Malinen                                            PGP id EFC895FA
> _______________________________________________
> HostAP mailing list
> HostAP@lists.shmoo.com
> http://lists.shmoo.com/mailman/listinfo/hostap

Patch

--- hostapd-0.7.3/src/ap/hw_features.c.old	2012-03-04 08:06:27.425520296 +0200
+++ hostapd-0.7.3/src/ap/hw_features.c	2012-03-04 08:10:31.776913761 +0200
@@ -441,7 +441,7 @@ 
 	else
 		oper40 = ieee80211n_check_40mhz_2g4(iface, scan_res);
 	wpa_scan_results_free(scan_res);
-
+	oper40=1;
 	if (!oper40) {
 		wpa_printf(MSG_INFO, "20/40 MHz operation not permitted on "
 			   "channel pri=%d sec=%d based on overlapping BSSes",