Community Translation - Channel Switch Announcement (CSA) in WICED - KBA229053

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
KoSa_1909416
Level 5
Level 5
Distributor - Marubun (Japan)
250 sign-ins 25 replies posted First solution authored

Hi,

I tried to translate this KBA229053 into Japanese.

https://community.cypress.com/docs/DOC-18668

----------------------------------------------------------------

タイトル:

Channel Switch Announcement  (CSA) のWICEDでの実装

質問:
アクセスポイント( AP)からステーション(STA)に対して、チャンネルの切り替えをアナウンスするにはどうすればよいですか?

回答:
チャンネル・スイッチ・アナウンス(CSA)は、APが接続されたステーションに動作チャンネルを変更する意図を通知するためのメカニズムです。
これによりSTAは、APがホッピングしているチャンネルに移って接続を維持できます。

バックグラウンド:
動的周波数選択(DFS)は、無線LAN(WLAN)がレーダーシステムと共存する為のスペクトル共有メカニズムです。
WLANは5GHz帯域で動作している間、特定のレーダーシステムに干渉しない周波数を自動的に選択します。

DFSはレーダー干渉を検出し、無線ネットワークを干渉のない別の周波数に移動します。
DFSは 非占有リスト(NOL)でレーダーが検出されたチャンネルの管理を行います。
APはレーダーが検出されたチャンネルで、検出後に少なくとも30分間これらのチャンネルの使用を回避します。
DFSが有効な場合、APは次のことを行います。

・周波数チャンネルを確保する前にレーダー波を探します。
・通常動作中にレーダーの信号パターンを継続的にスキャンします。

DFSが有効の場合、5GHzチャンネル(5.470〜5.725 GHz)の1つで動作するAPは、そのチャンネルを継続的にスキャンしてレーダーの存在を確認し、

レーダーソースを検出した場合はそのチャンネルでの送信を停止する必要があります。

そのため、APは干渉を減らすためにノイズの少ない別のチャンネルに移動/ホップする場合があります。

(これまでの古いチャンネルでAPに接続されていた)既存のワイヤレスクライアントは、

APからの新しいビーコンの受信を待機している間に"タイムアウト"する場合があります。

クライアントは、APが動作している新しいチャンネルを検出するためにスキャンを開始しなければなりません。

中断が非常に長い場合、クライアントは、IPアドレスの再関連付け、再認証、および要求を行う必要があるかもしれません

基本サービスセット(BSS)のサービスの中断を最小限に抑えるために、APによるチャネルのホップは接続されたステーションに通知され、

ダウンタイムを最小限に抑えて同じチャンネルに移動できます。

この情報は、ビーコン、プローブ応答、アクション管理フレームのCSA要素として接続されたステーションに共有されます。

CSA エレメントには、新しいチャンネル番号、切り替え前のビーコン数をカウントするパラメーター、

およびチャンネル切り替えまでの送信制限に関する情報が含まれています。

WICED™では、wwd_wifi_send_csa というAPIを使用してCSAを送信できます。

/**

* This function will send a channel switch announcement and switch to the specified channel at the specified time.

* @param[in] wiced_chan_switch_t: pointer to channel switch information

* @param interface              : WWD_AP_INTERFACE (works only in AP mode)

* @return     @ref wwd_result_t

*/

wwd_result_t wwd_wifi_send_csa( const wiced_chan_switch_t* csa, wwd_interface_t interface );

このAPIは、次のようにwlコマンドを用いて使用することができます(wlコマンドのテストには”test.console” アプリケーションを使用してください)。

>wl csa <mode> <count> [2g|5g]<channel>[20 or 40u/l 0r 80]

例: wl csa 1 4 5g36/80


このコマンドは、APのチャンネルを80 MHz帯域幅のチャンネル番号42に切り替えます(APが別のチャネルにある場合)。

以下のコードは、wwd_wifi_send_csa APIをアプリケーションに追加した例です。

使用法: send_csa <channel_number> <band> <bandwidth> <sideband>

例: send_csa 38 5 40 1


このコマンドは、CSAを送信して5 GHz帯域のチャンネル番号36に切り替え、40 MHzの帯域幅を使用します(APが38以外のチャネルにある場合)。

WICEDの”snip.apsta”アプリケーションのコンソールコマンドのリストにAPIを追加します。

1.apsta.cでコマンドを定義します。

static const command_t commands[] =

{

    ALL_COMMANDS

    CSA_COMMAND

    CMD_TABLE_END

};

2.apsta.cにsend_csa関数を追加します。

wiced_result_t send_csa(int argc, char *argv[]){

    int chan_no, band_n, bw, sb;

    chanspec_t chanspec_n=0;

    int chan_set=0, band_set = 0, bw_set=0, sb_set=0;

    chan_no = strtol(argv[1], NULL, 10);

    printf("Channel number: %d\n", chan_no);

    if(chan_no < 0 || chan_no > 224){

        printf("invalid channel number: %d\n", chan_no);

        return WICED_ERROR; //bad channel

    }

    else{

        chanspec_n |= chan_no;

        chan_set = 1;

    }

    band_n = strtol(argv[2], NULL, 10);

    printf("Band: %d\n", band_n);

    if(! (band_n == 5 || band_n == 2) ){

        printf("invalid band number: %d\nEnter either 2 or 5", band_n);

        return WICED_ERROR; //bad band

    }

    else{

        if (band_n == 5)

chanspec_n |= WL_CHANSPEC_BAND_5G;

        else

chanspec_n |= WL_CHANSPEC_BAND_2G;

        band_set = 1;

    }

    bw = strtol(argv[3], NULL, 10);

    printf("BW: %d\n", bw);

    if(!(bw == 20 || bw == 40 || bw == 80) ){

        printf("invalid bandwidth: %d\nEnter either 20 or 40 or 80", bw);

        return WICED_ERROR; //bad BW

    }

    else{

        if (bw == 20)

chanspec_n |= WL_CHANSPEC_BW_20;

        else if (bw == 40)

chanspec_n |= WL_CHANSPEC_BW_40;

        else

chanspec_n |= WL_CHANSPEC_BW_80;

        bw_set = 1;

    }

   sb = strtol(argv[4], NULL, 10);

   printf("sb: %d\n", sb);

   if (! ((sb == 1) || (sb == 0) || (sb == -1)) ) {

        printf("invalid sideband: %d\nEnter either -1(lower) or 0 or 1(upper)", sb);

        return WICED_ERROR; //bad sideband

    }

    if (sb == -1)

        chanspec_n |= WL_CHANSPEC_CTL_SB_LOWER;

    else if (sb == 1)

        chanspec_n |= WL_CHANSPEC_CTL_SB_UPPER;

    sb_set = 1;

    /* set ctl sb to 20 if not set and 20mhz is selected */

    if (!sb_set && CHSPEC_IS20(chanspec_n)) {

        sb_set = 1;

        chanspec_n |= WL_CHANSPEC_CTL_SB_NONE;

    }

    if (chan_set==1 && band_set==1 && bw_set==1 && sb_set==1) {

        printf("Chanspec set to 0x%x\n", chanspec_n);

    }

    wiced_chan_switch_t * wiced_csa = (wiced_chan_switch_t *)malloc(sizeof(wiced_chan_switch_t));

    //count and mode can be changed

    wiced_csa->count = 5;

    wiced_csa->mode = 1;

    wiced_csa->chspec = chanspec_n;

    wiced_result_t result= wwd_wifi_send_csa(wiced_csa,WWD_AP_INTERFACE );

    if(result  == WICED_SUCCESS)

        {

            printf("Channel for AP interface is changed\n");

        }

    else{

            printf("Error in switching: %d\n", result);

    }

    return WICED_SUCCESS;

}

Wire Sharkで取得したCSAパケットのスナップショットを添付します。

image.png

参照:

1. https://wifi-insider.com/wlan/dfs.htm

2. http://wlanimp.blogspot.com/2014/08/80211h-in-action.html

----------------------------------------------------------------

BestRegards,

Sakagami

1 Reply
JennaJo
Moderator
Moderator
Moderator
1000 replies posted 750 replies posted 500 replies posted

Hello, Sakagami-san

We receive your translation, it will be published to KBA to Community.

After upload, You will receive the points as the word of KBA.

Due to the current volume of works, Please bear with me for the delayed the response,

Thanks for your contribution to CDC!

Will keep you update the status.

Thanks,

Jenna Jo

Jenna Jo