0% found this document useful (0 votes)
201 views16 pages

Wi-Fi Channel Auto-Selection - Network and Wireless Configuration - OpenWrt Forum

Automatic channel selection (ACS) is an algorithm for selecting a Wi-Fi channel, while clear channel assessment (CCA) checks for signal activity on a channel before transmission. ACS aims to pick the most free channel based on surrounding interference, but originally just selected channel 1 or 36. Newer drivers have improved ACS, but manually selecting channels is still preferred to avoid issues.

Uploaded by

Daniel Iliescu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
201 views16 pages

Wi-Fi Channel Auto-Selection - Network and Wireless Configuration - OpenWrt Forum

Automatic channel selection (ACS) is an algorithm for selecting a Wi-Fi channel, while clear channel assessment (CCA) checks for signal activity on a channel before transmission. ACS aims to pick the most free channel based on surrounding interference, but originally just selected channel 1 or 36. Newer drivers have improved ACS, but manually selecting channels is still preferred to avoid issues.

Uploaded by

Daniel Iliescu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Wi-Fi channel auto-selection

Tiv 1 November 4, 2019, 10:53pm

Hello !

https://openwrt.org/docs/guide-user/network/wifi/basic
Name: channel
Type: "auto"

Channel auto-selection once when the router is turned on ??

Thank

Automatic channel selection

5GHz auto channel issue

How does "auto" channel work?

Selecting specific range of frequencies in 5GHz

DIR-885L A2, 5GHz not working

slh 2 November 4, 2019, 10:57pm

A few more words would help massively to understand your actual question.

That said, ACS/ auto should never be used. There is no smart algorithm behind auto, it just sets the first legal channel
for your environment (so effectively ch1 or ch36) - regardless of your environment or if other channels would be
better or completely free. Always select a channel manually, based on your surrounding.
EDIT: As this post seems to be referred to quite regularly.
Modern drivers (ath10k, ath11k, mt76) have gotten a little smarter in the mean time and can use ACS in a smarter
way, but it's still preferred (and can avoid real problems) to choose a channel manually (especially with DFS in mind).

5 Likes

OpenWrt 23.05.0-rc4 - Fourth Release Candidate

Tiv 3 November 4, 2019, 11:05pm

That is, Auto is not the choice of the most free channel according to, for example, the algorithm CCA (Clear Channel
Assessment) ?

slh 4 November 4, 2019, 11:10pm

No, it always selects 1 or 36.

1 Like

Tiv 5 November 4, 2019, 11:15pm

Thank, slh !
In OpenWRT there is no CCA or other algorithm of the periodic auto-selection of the free channel yet ?

shm0 6 November 5, 2019, 2:24am


slh:

No, it always selects 1 or 36.

that is not true.

I only have 1 other Wifi on channel 36 here (from neighbors) and with auto channel selection turned on my device
chooses a channel different than 36.

Maybe there is a problem measuring the interference on some devices.

1 Like

fantom-x 7 November 5, 2019, 2:43am

shm0 8 November 5, 2019, 3:26am

On my device setting channel to auto sets channel=acs_survey in the generated hostapd-phyX.conf.

https://w1.fi/cgit/hostap/plain/hostapd/hostapd.conf

# If CONFIG_ACS build option is enabled, the channel can be selected


# automatically at run time by setting channel=acs_survey or channel=0, both of
# which will enable the ACS survey based algorithm.

You can verify the ACS algorithm in the log output from hostapd.
logread | grep hostapd | grep ACS
daemon.notice hostapd: ACS: Automatic channel selection started, this may take a bit
daemon.notice hostapd: wlan0: interface state COUNTRY_UPDATE->ACS
daemon.notice hostapd: wlan0: ACS-STARTED
daemon.notice hostapd: ACS: Automatic channel selection started, this may take a bit
daemon.notice hostapd: wlan1: interface state COUNTRY_UPDATE->ACS
daemon.notice hostapd: wlan1: ACS-STARTED
daemon.notice hostapd: wlan1: ACS-COMPLETED freq=2437 channel=6
daemon.notice hostapd: wlan1: interface state ACS->ENABLED
daemon.notice hostapd: wlan0: ACS-COMPLETED freq=5260 channel=52
daemon.notice hostapd: wlan0: interface state ACS->HT_SCAN

There are also other options supported, like:


acs_chan_bias, acs_exclude_dfs, chanlist

# acs_chan_bias is a space-separated list of <channel>:<bias> pairs. It can be


# used to increase (or decrease) the likelihood of a specific channel to be
# selected by the ACS algorithm. The total interference factor for each channel
# gets multiplied by the specified bias value before finding the channel with
# the lowest value. In other words, values between 0.0 and 1.0 can be used to
# make a channel more likely to be picked while values larger than 1.0 make the
# specified channel less likely to be picked. This can be used, e.g., to prefer
# the commonly used 2.4 GHz band channels 1, 6, and 11 (which is the default
# behavior on 2.4 GHz band if no acs_chan_bias parameter is specified).
#
# Defaults:
#acs_num_scans=5
#acs_chan_bias=1:0.8 6:0.8 11:0.8

But actually, I don't understand this option.


The total interference factor for each channel gets multiplied by the specified bias value. The total interference factor
for each channel gets multiplied by the specified bias value before finding the channel with the lowest value
So it would make more sense if the bias value would be negative.
# Exclude DFS channels from ACS
# This option can be used to exclude all DFS channels from the ACS channel list
# in cases where the driver supports DFS channels.
#acs_exclude_dfs=1

# Channel list restriction. This option allows hostapd to select one of the
# provided channels when a channel should be automatically selected.
# Channel list can be provided as range using hyphen ('-') or individual
# channels can be specified by space (' ') separated values
# Default: all channels allowed in selected hw_mode
#chanlist=100 104 108 112 116
#chanlist=1 6 11-13

chanlist = channels in openwrt wifi config.

acs_exclude_dfs doesn't work on my device because the driver doesn't report DFS channels (correctly), I guess.

And chanlist/channels work better for me than acs_chan_bias.


option channels '1 6 11'
vs
option acs_chan_bias '1:0.8 6:0.8 11:0.8'

If your surrounding WiFis use a 4 Channel plan, like 1-5-9-13


It's better to use:
option channels '1 5 9 13'
or
option acs_chan_bias '1:0.8 5:0.8 9:0.8 13:0.8',
I guess.

I think, its also better to use chanlist/channels because acs_chan_bias allows hostapd to choose channels other
channels then 1,6,11/1,5,9,13.
So maybe your wifi radio ends up using channel 3, which will cause (side-channel) interference for channels 1-6.
See this graphic here from cisco (3 channels plan):
4 Channels plan:

But most likely you will end up using the 3 channels plan because most devices are defaulting to it, even in Europe.
If you are setting up a wifi on large area where no other rogue WiFis are around you can of course deploy a 4 channels
plan.

5 Likes

eduperez 9 November 5, 2019, 7:41am


Are you running vanilla OpenWrt on that device?

shm0 10 November 5, 2019, 9:57am

Latest trunk version with no modifications to hostapd, so yes it's vanilla?

I can't find any commit log for acs_survey but for acs_chan_bias.

hostapd: add support for acs_chan_bias option

During auto channel selection we may wish to prefer certain channels over
others. e.g. we can just squeeze 4 channels into europe so...

committed 11:48AM - 15 Jun 17 UTC ldir-EDB0 +6 -2

So there must be support for ACS at least since 2017?

acs_exclude_dfs was added this year.

mac80211: add new acs_exclude_dfs option

The channel can be selected automatically at run time by setting


channel=acs_survey or channel=0, both of which will enable the ACS survey
based...

committed 08:00AM - 04 Sep 19 UTC feckert +5 -1

So this will not work on stable OpenWRT release.


//edit
looking through the make files of hostapd and wpa-supplicant, like this for example:

openwrt/openwrt/blob/master/package/network/services/hostapd/files/hostapd-basic.config

# Example hostapd build time configuration


#
# This file lists the configuration options that are used when building the
# hostapd binary. All lines starting with # are ignored. Configuration option
# lines must be commented out complete, if they are not to be included, i.e.,
# just setting VARIABLE=n is not disabling that variable.
#
# This file is included in Makefile, so variables like CFLAGS and LIBS can also
# be modified from here. In most cass, these lines should use += in order not
# to override previous values of the variables.

# Driver interface for Host AP driver


#CONFIG_DRIVER_HOSTAP=y

# Driver interface for wired authenticator


CONFIG_DRIVER_WIRED=y

# Driver interface for drivers using the nl80211 kernel interface


CONFIG_DRIVER_NL80211=y

This file has been truncated. show original

#CONFIG_ACS=y

Seems like all makefiles have this line commented.


Idk why this feature is enabled.

1 Like
eduperez 11 November 5, 2019, 11:13am

shm0:

Latest trunk version with no modifications to hostapd, so yes it's vanilla?

When you post a "this works for me" answer, I think it would be nice to disclose that you are using a snapshot, to
avoid confusing users that are running a stable release.

1 Like

shm0 12 November 5, 2019, 11:25am

The mac80211.sh script in 18.06 has support for acs_survey, so it should work?

Tiv 13 November 5, 2019, 12:18pm

ACS is algorithm for channel selection ?


Which is better ACS or CCA ?

ejl 14 January 3, 2020, 7:41pm

Short precise questions make one tick. I did my best to collect answers in the same manner.

ACS is algorithm for channel selection ?


Yes.

Which is better ACS or CCA ?

Those can not be compared. Supposed the acronyms mean what they are written to above, ie. Automatic Channel
Selection (ACS) and Clear Channel Assessment (CCA).

ACS explained here: https://wireless.wiki.kernel.org/en/users/documentation/acs

CCA explained here (one source from many, the definitive being IEEE 802.11-2016 Standard):
https://www.extremenetworks.com/extreme-networks-blog/what-is-a-clear-channel-assessment-cca/

Dynamic Frequency Selection (DFS) in channels on 5GHz is one more acronym affecting channel selection,
description 1: https://forum.openwrt.org/t/wireless-config-channel-auto/1015/2 and description 2
https://en.wikipedia.org/wiki/Dynamic_frequency_selection.

A note: CCA and DFS are defined in 802.11 ammendments and standards, ACS seems not.

Disclaimer: I'm not an expert in 802.11 radios or standards, just a nerd trying to understand the pieces the 802.11 is
made of and who's controlling what.

3 Likes

fantom-x 15 February 9, 2020, 5:08pm

I got tired of having to change the channels due the surrounding AP's continuously moving over onto the same
channel that I use, so I decided to try the auto channel. Despite everyone saying that that doesn't work and the first
channel is always selected, that does not seem to be so. It is selecting channels and while I do not quite agree with the
2.4Ghz selection, the channels chosen for 5GHz are empty, so a good choice.

So, is this feature working or not? This is the latest 19.07 with non-ct firmware.

daemon.notice hostapd: ap2: ACS-STARTED


daemon.notice hostapd: ap2: ACS-COMPLETED freq=2462 channel=11
daemon.notice hostapd: ap2: interface state ACS->ENABLED
daemon.notice hostapd: ap2: ACS-STARTED
daemon.notice hostapd: ap5: ACS-STARTED
daemon.notice hostapd: ap2: ACS-COMPLETED freq=2412 channel=1
daemon.notice hostapd: ap2: interface state ACS->ENABLED
daemon.notice hostapd: ap5: ACS-COMPLETED freq=5300 channel=60
daemon.notice hostapd: ap5: interface state ACS->HT_SCAN
daemon.notice hostapd: ap2: ACS-STARTED
daemon.notice hostapd: ap5: ACS-STARTED
daemon.notice hostapd: ap2: ACS-COMPLETED freq=2412 channel=1
daemon.notice hostapd: ap2: interface state ACS->ENABLED
daemon.notice hostapd: ap5: ACS-COMPLETED freq=5260 channel=52
daemon.notice hostapd: ap5: interface state ACS->HT_SCAN
daemon.notice hostapd: ap5: ACS-STARTED
daemon.notice hostapd: ap5: ACS-COMPLETED freq=5300 channel=60
daemon.notice hostapd: ap5: interface state ACS->HT_SCAN
daemon.notice hostapd: ap5: ACS-STARTED
daemon.notice hostapd: ap2: ACS-STARTED
daemon.notice hostapd: ap2: ACS-COMPLETED freq=2412 channel=1
daemon.notice hostapd: ap2: interface state ACS->ENABLED
daemon.notice hostapd: ap5: ACS-COMPLETED freq=5300 channel=60
daemon notice hostapd: ap5: interface state ACS->HT SCAN
1 Like

R7800 performance

fantom-x 16 February 9, 2020, 7:06pm

shm0:

#CONFIG_ACS=y
Seems like all makefiles have this line commented.
Idk why this feature is enabled.

Could it be enabled because of this:

./package/network/services/hostapd/Makefile

DRIVER_MAKEOPTS= \
CONFIG_ACS=$(CONFIG_PACKAGE_kmod-cfg80211) \
CONFIG_DRIVER_NL80211=$(CONFIG_PACKAGE_kmod-cfg80211) \
CONFIG_IEEE80211N=$(HOSTAPD_IEEE80211N) \
CONFIG_IEEE80211AC=$(HOSTAPD_IEEE80211AC) \
CONFIG_DRIVER_WEXT=$(CONFIG_DRIVER_WEXT_SUPPORT) \

grep -r CONFIG_PACKAGE_kmod-cfg80211 .config


CONFIG_PACKAGE_kmod-cfg80211=y

2 Likes

AUTO Channel selection with specified channels list gives error

richardhd 18 August 6, 2020, 12:36pm

I'm new to OpenWrt and have been running it for a couple of months on my R7800. Wifi auto channel selection seems
to work when I reboot or restart a radio in Network->Wireless. Do any other events trigger channel auto selection?

slh 19 August 6, 2020, 5:48pm

Not really, channels are only chosen when the interface goes up or when a DFS event requires a change.
3 Likes

richardhd 20 August 6, 2020, 6:18pm

That's good to know. Thanks!

zagi-tng 22 September 29, 2022, 11:44am

shm0:

option channels '1 5 9 13'

What happens if i use :

option channels '5 9 13 1'

Is there a way to add "random" time to activation or scan ? If there is a power cycle or if i reboot many Aps they will
all start to scan with chan 5 as the first one.....

1 Like

zagi-tng 23 November 24, 2022, 10:14am

shm0:

option channels '1 5 9 13'


With this setup i see that channels 1,9 and 13 are used.
APs seem to 'skip' 5 ?!?

zagi-tng 24 January 31, 2023, 9:12am

How can i set 'acs_num_scans=10' via UCI ?

Bill 25 January 31, 2023, 10:29am

I just spent an hour reading @shm0 post 8 w/link and have concluded that the answer to your question is you don't
configure this via any uci command.

the parameter and value you question; are meant to be carefully adjusted in the /var/run/hostapd-phy1.conf
file of supporting acs devices on older OpenWrt builds.

I can not say confidently that all this has be deprecated by newer algorithms, yet the thread you necroed is quite old
and the person you've quoted has been recently active.

2 Likes

zagi-tng 26 March 13, 2023, 2:05pm

Problem that i have is that even if i set "channels '1 5 9 13' most of APs in that area seem to "avoid" channel 5 and
use either 1 , 9 or 13.
Also it's not that some would use 1 and some 13, but it seems that the majority "decides" to use 9 or 13...

and there you are looking at chann 5 and it's empty. And you see some 10+ aps using chan 9....

What could cause this ? Should i make wifi reload once a day or .... ?
zagi-tng 27 May 2, 2023, 6:48am

Adding

uci add_list wireless.radio1.hostapd_options='acs_num_scans=50'


uci add_list wireless.radio0.hostapd_options='acs_num_scans=50'

does not help

nor adding to radio1 (2.4)

acs_chan_bias=5:0.5

When my only selection in chanlist is 5, then it works.

Tried on OpenWrt 21.02 ... 22.03.4


MikroTiks or TPlink EAP225

zagi-tng 28 May 30, 2023, 11:45am

Anything, but 5

Any clues?

wireless.radio1.channel='auto'
wireless.radio1.channels='5 13 9 1'
wireless.radio1.hostapd_options='vendor_elements=DD080050F21101000000' 'acs_num_scans=

You might also like