> For the complete documentation index, see [llms.txt](https://docs.morsemicro.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.morsemicro.com/application-notes/appnote-17-dynamic-channel-selection.md).

# APPNOTE-17 Dynamic Channel Selection

[Download as PDF](https://www.morsemicro.com/resources/appnotes/MM_APPNOTE-17_Dynamic_Channel_Selection_Guide.pdf)

## 1 Introduction

This application note applies to products containing the Dynamic Channel Selection (DCS) feature that is run on the Morse Micro MM6108 chip. The DCS allows an AP to periodically scan available channels while a BSS is running, and seamlessly switch to a new channel if the RF conditions are better on the new channel. DCS is integrated as a module in Smart Manager, which is a Morse Micro proprietary Access Point userspace daemon.

For issues or questions, please contact <support@morsemicro.com>.

***

## 2 Workflow

Smart manager tells the MM6108 chip which channels to scan, when to scan them, collate the results (Measure), decide on the best channel (Selection) and trigger the move to the new channel (Channel Switch).

DCS is accomplished by periodically performing Off Channel Scans (OCS). This process consists of the AP configuring a RAW window with an unused AID, which causes all associated stations to stop transmitting during this window. During this time, the AP will temporarily switch to the off channel in question, and perform an assessment using the PHY channel metric. The PHY will then start sampling the medium, and compute a metric to be reported back to Smart Manager. This metric takes into account noise floor, interference, and WLAN traffic. It returns an opaque number between 0 and 100, with 100 being an ‘ideal’ channel.

These channel metrics are then fed into an algorithm which will average them over time, and decide if/ when the channel needs to be changed.

If a decision is made to change channels, the AP will signal this using an ECSA (extended channel switch announcement). ECSA is an 802.11 feature which adds an information element into the beacon which contains the parameters of the new channel, and a count-down which is decremented each successive beacon. When this countdown reaches zero, the AP and all stations will seamlessly move to the new channel and continue service as normal.

Note: Smart Manager is released in binary form only.

### 2.1 DCS algorithm flow chart

![](/files/0ac0171bd80cd9af5c97866fdfb9d4baf58bf326)

### 2.2 Measurement

Smart Manager will utilize an Off Channel Scan (OCS) to make periodic measurements of all channels. The available channels will be queried from hostapd/mac80211 and stored prior to scanning.

Once Smart Manager triggers a scan, it will send a command with the requested channel to scan to the MM6108 chip. After the scan completes, the driver emits a MORSE\_VENDOR\_EVENT\_OCS\_DONE event via netlink, containing the scan results, which will be captured and stored by Smart Manager. This operation will iterate on all candidate channels to get an accurate view of the channel conditions. Multiple measurements will be taken over time,  as traffic and interference may be sporadic.

The scan results will need to be analysed by Smart Manager and a metric established to gauge the quality of the channel.

### 2.3 Selection

Once sufficient channel data has been obtained, Smart Manager will make a decision on whether it should trigger an ECSA based on the measurement (e.g. each channel’s quality, adjacent channels, channel's historic readings etc.).

Currently, Smart Manager will only try to switch within the channels which have the same bandwidth.

If considering changing operating BW, it is also important to take into consideration the maximum throughput of the network, which will be dependent on RSSI of stations and the traffic profile of the BSS.

### 2.4 Channel Switch

Once the “best” new channel has been selected, Smart Manager will trigger an Extended Channel Switch Announcement (ECSA). This will inform all currently associated stations to switch to the new channel at the coordinated time.

After the channel switch, Smart Manager will continue to evaluate alternative channels, thus ensuring the optimal channel is used for BSS operation.

***

## 3 Configuration

### 3.1 OpenWRT

The following configuration is tested using Morse Micro EKH01 firmware version V2.3.3. This feature can be enabled by the following steps:

Via webUI

DCS can be configured in the settings under the Network->Wireless menu:

![](/files/e15a405059a074c59241436be46bd2ef69d987a0)

Select ‘Edit’ next to the HaLow network that is to be configured:

![](/files/a3f86dd1ba40a0ce02b5d38655726ee512faf875)

Then tick the ‘Dynamic Channel Selection’ option to enable DCS:

![](/files/5b8967c1485d543a71ef60fdefa0eae30845c978)

Sample of the  smart\_manager.radio0.conf configuration file:

| <p>interface\_name = "wlan0"<br>logging: {<br>        level = 2<br>}<br>backends: {<br>        hostapd: {<br>                control\_path: "/var/run/hostapd\_s1g"<br>        }<br>}<br>datalog: {<br>        root\_dir = "/var/log"<br>        dcs: {<br>                enabled = false<br>        }<br>}<br>dcs: {<br>        algo\_type = "ewma"<br>        ewma: {<br>                ewma\_alpha = 30<br>                rounds\_for\_csa = 10<br>                threshold\_percentage = 5<br>                sec\_per\_scan = 2<br>                sec\_per\_round = 10<br>        }<br>        trigger\_csa = True<br>        dtims\_for\_csa = 10<br>}<br></p> |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

### 3.2 Generic

The following is an example configuration file that can be used by Smart Manager for DCS on a generic Linux platform such as buildroot.

| <p># Copyright Morse Micro 2023<br># Morse Micro Smart Manager configuration file<br># HaLow WLAN interface name<br>interface\_name = "wlan0"<br># Log levels as follows:<br>#       NONE            0<br>#       ERROR           1<br>#       WARN            2<br>#       INFO            3<br>#       DEBUG           4<br>#       VERBOSE         5<br>logging: {<br>        level = 2<br>        colours = True<br>}<br><br># Backend specific configuration<br>backends: {<br>        # Hostapd config<br>        hostapd: {<br>                # Control path for hostapd CLI<br>                control\_path : "/var/run/hostapd\_s1g"<br>        }<br>}<br># Datalog configuration. If not specified, datalogs will default to off<br>datalog: {<br>        # Root directory to store data logs<br>        root\_dir = "/var/log/smart\_manager"<br>        dcs : {<br>                enabled = true<br>        }<br>        nl80211: {<br>                enabled = false<br>        }<br>        hostapd: {<br>                enabled = false<br>        }<br>        morsectrl: {<br>                enabled = false<br>        }<br>}<br># Dynamic channel selection configuration<br>dcs : {<br>        # Currently enabled algorithm. Options are:<br>        #    - "ewma"<br>        #    - "sample\_and\_hold"<br>        algo\_type: "ewma"<br>        # Exponential weighted moving average function. Evaluates every scan round.<br>        ewma: {<br>                # DCS EWMA weight for the channel metric (max 100)<br>                ewma\_alpha = 30<br>                # Threshold percentage of channel score to be considered better<br>                threshold\_percentage = 5<br>                # Number of scan rounds in a row with a better channel to trigger a switch<br>                rounds\_for\_csa = 10<br>                # Time to wait between scanning each channel within a scan round<br>                sec\_per\_scan = 2<br>                # Time to wait before starting another scan round<br>                sec\_per\_round = 10<br>        }<br>        # Accumulated mean. Evaluates after 'rounds\_for\_eval' rounds.<br>        sample\_and\_hold: {<br>                # Number of scan rounds until evaluating and potentially triggering a switch<br>                rounds\_for\_eval: 20<br>                # Threshold percentage of channel score to be considered better<br>                threshold\_percentage: 5<br>                # Time to wait between scanning each channel within a scan round<br>                sec\_per\_scan = 2<br>                # Time to wait before starting another scan round<br>                sec\_per\_round = 10<br>        }<br>        # enable / disable CSA<br>        trigger\_csa = True<br>        # number of DTIM beacons to include channel switch announcement IE before actually moving<br>        dtims\_for\_csa = 10<br>        # Test mode parameters<br>        test :<br>        {<br>                # Test mode enabled<br>                enabled = False<br>                # Filepath to test mode samples<br>                filepath = "test\_samples.csv"<br>        }<br>}<br></p> |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

## 4 Revision History

| Release Number | Release Date | Release Notes  |
| -------------- | ------------ | -------------- |
| 01             | 03/11/2023   | 1st release    |
| 02             | 21/10/2024   | Second release |
