日本語フォーラム

 View Only

[CX-Switch] 簡易まとめ_QoS動作と設定について

This thread has been viewed 32 times
  • 1.  [CX-Switch] 簡易まとめ_QoS動作と設定について

    Posted Jan 28, 2025 01:18 PM
    Edited by namishingo Sep 05, 2025 12:29 AM

    CXスイッチのQoS動作と設定について、CX6200Fシリーズを参考にまとめています。
    CXシリーズごとの制限や設定オプションなどについては、コンフィグレーションガイド、コマンドリファレンスなどを確認ください。

    【トラフィックの入力から出力までの動作】
    CXシリーズスイッチは、QoSに着目をすると、入力から出力まで主に6つのステージがあります。

    ① Ingressステージ
    このステージは、スイッチのインタフェースにパケットが入力(受信)する状態で、入力トラフィックの通信量を制限するレートリミット(rate-limit)を設定、適用することができます。
    参考としたCX6200Fシリーズスイッチでは、レートリミットを適用できるトラフィックの種類として、ブロードキャスト、マルチキャスト、アンノウンユニキャスト、ICMPの4つがあります。
    **設定例
    !
    interface 1/1/1
        rate-limit unknown-unicast 4000 kbps
        rate-limit broadcast 1000 kbps
        rate-limit multicast 3000 kbps
        rate-limit icmp ipv4 2000 kbps
    !

    **確認例
    CX6200F# show interface 1/1/1 qos
    Interface 1/1/1 is up
     Admin state is up
     qos trust none (override)
     qos queue-profile factory-default (global)
     qos schedule-profile factory-default (global)
     rate-limit unknown-unicast 4000 kbps (4000 actual)
     rate-limit broadcast 1000 kbps (1000 actual)
     rate-limit multicast 3000 kbps (3000 actual)
     rate-limit icmp ipv4 2000 kbps (2000 actual)
                                Forwarded Pkts         Dropped Pkts      Forwarded Bytes        Dropped Bytes
       Broadcast:                            1                    0                  247                    0
       Multicast:                            0                    0                    0                    0
       Unknown Unicast:                      0                    0                    0                    0
       ICMP:                                 0                    0                    0                    0
    
    CX6200F#

    他、Class-Based Policyを利用することで、特定の送信元、宛先、プロトコルなどを条件としたポリシー設定を利用することにより、ポリシーに一致するトラフィックの入力を一定レートに制限させることも可能です。

    **Class-Based Policyの設定例
    * 送信元IPが172.17.24.0/24のトラフィックをクラス名"vlan24_traffic"として分類
    * ポリシー名"policy1"を作成。クラス名"vlan24_traffic"のポリシーとしてレートが1000Kbpsを超過すると超過分のトラフィックを破棄させる
    * 物理インタフェース1/1/1へポリシー"policy1"を入力方向で適用する
    !
    class ip vlan24_traffic
        11 match any 172.17.24.0/255.255.255.0 any
    !
    policy policy1
        11 class ip vlan24_traffic action cir kbps 1000 cbs 0 exceed drop
    !
    interface 1/1/1
        apply policy policy1 in
    !


    **確認例

    CX6200F# show class
    
    User Configured ipv4 classes:
    =============================
    
    Type       Name
               Additional Class Parameters
      Sequence Comment
               Action                          L3 Protocol
               Source IP Address               Source L4 Port(s)
               Destination IP Address          Destination L4 Port(s)
               Additional Entry Parameters
    -------------------------------------------------------------------------------
    IPv4       vlan24_traffic
            11
               match                           any
               172.17.24.0/255.255.255.0
               any
    
    CX6200F#
    CX6200F# show policy
    User Configured Policies:
    =========================
               Name
               Additional Policy Parameters
      Sequence Comment
               Class Type
                        action
    -------------------------------------------------------------------------------
               policy1
            11
               vlan24_traffic ipv4
                        cir kbps 1000
                        cbs 0
                        exceed drop
    
    
    CX6200F#
    CX6200F# show policy hitcounts policy1
    Statistics for Policy policy1:
    
    Interface 1/1/1 (in):
         Matched Packets  Configuration
    11 class ip vlan24_traffic action cir kbps 1000 cbs 0 exceed drop  [ 43 kbps conform ]
                       -  11 match any 172.17.24.0/255.255.255.0 any
    
    CX6200F#


    ② Prioritizeステージ

    このステージでは、出力ポートのキューを決定するLocal Priorityと、出力キューが満杯となったとき、破棄優先度の指標となるColorがあります。
     
    [Local Priority]
    着信トラフィックのDSCP値、CoS値をもとにLocal Priorityを決定することができます。
    *DSCP/CoS値の信頼
    スイッチの初期状態の動作は、入力トラフィックのDSCP値、CoS値の値は信頼されない(none)の状態となっています。
    DSCP値、CoS値を信頼とするときは、グローバルコンフィグレーションまたはインタフェースで以下の設定を行います。

    **設定
    CX6200F(config)# qos trust [ dscp | cos ]
    CX6200F(config-if)# qos trust [ dscp | cos ]


    **確認

    CX6200F# show interface 1/1/1 qos
    Interface 1/1/1 is up
     Admin state is up
     qos trust dscp (override)
     qos queue-profile factory-default (global)
     qos schedule-profile factory-default (global)


    DSCP値/CoS値が、どのLocal Priorityとなるかは初期設定が定義されています。
    DSCPは、DSCPマップ、CoSはCoSマップをそれぞれマップ名"default"が設定されています。

    【dscp-map】

    CX6200F# show qos dscp-map default
    DSCP     code_point local_priority cos color   name
    -------- ---------- -------------- --- ------- ----
    000000   0          1                  green   CS0
    000001   1          1                  green
    000010   2          1                  green
    000011   3          1                  green
    000100   4          1                  green
    000101   5          1                  green
    000110   6          1                  green
    000111   7          1                  green
    001000   8          0                  green   CS1
    001001   9          0                  green
    001010   10         0                  green   AF11
    001011   11         0                  green
    001100   12         0                  yellow  AF12
    001101   13         0                  green
    001110   14         0                  red     AF13
    001111   15         0                  green
    010000   16         2                  green   CS2
    010001   17         2                  green
    010010   18         2                  green   AF21
    010011   19         2                  green
    010100   20         2                  yellow  AF22
    010101   21         2                  green
    010110   22         2                  red     AF23
    010111   23         2                  green
    011000   24         3                  green   CS3
    011001   25         3                  green
    011010   26         3                  green   AF31
    011011   27         3                  green
    011100   28         3                  yellow  AF32
    011101   29         3                  green
    011110   30         3                  red     AF33
    011111   31         3                  green
    100000   32         4                  green   CS4
    100001   33         4                  green
    100010   34         4                  green   AF41
    100011   35         4                  green
    100100   36         4                  yellow  AF42
    100101   37         4                  green
    100110   38         4                  red     AF43
    100111   39         4                  green
    101000   40         5                  green   CS5
    101001   41         5                  green
    101010   42         5                  green
    101011   43         5                  green
    101100   44         5                  green
    101101   45         5                  green
    101110   46         5                  green   EF
    101111   47         5                  green
    110000   48         6                  green   CS6
    110001   49         6                  green
    110010   50         6                  green
    110011   51         6                  green
    110100   52         6                  green
    110101   53         6                  green
    110110   54         6                  green
    110111   55         6                  green
    111000   56         7                  green   CS7
    111001   57         7                  green
    111010   58         7                  green
    111011   59         7                  green
    111100   60         7                  green
    111101   61         7                  green
    111110   62         7                  green
    111111   63         7                  green
    CX6200F#

    マッピングの変更を行うことも可能です。例として、DSCP値0のLocal Priorityを7とするには以下のように設定を行います。
    **設定例

    CX6200F(config)# qos dscp-map 0 local-priority 7


    **確認例

    CX6200F# show qos dscp-map
    DSCP     code_point local_priority cos color   name
    -------- ---------- -------------- --- ------- ----
    000000   0          7                  green
    /////出力省略/////

    【cos-map】

    CX6200F# show qos cos-map default
    code_point local_priority color   name
    ---------- -------------- ------- ----
    0          1              green   Best_Effort
    1          0              green   Background
    2          2              green   Excellent_Effort
    3          3              green   Critical_Applications
    4          4              green   Video
    5          5              green   Voice
    6          6              green   Internetwork_Control
    7          7              green   Network_Control
    CX6200F#


    マッピングの変更を行うことも可能です。例として、CoS値0のLocal Priorityを7とするには以下のように設定を行います。
    **設定例

    CX6200F(config)# qos cos-map 0 local-priority 7


    **確認例

    CX6200F# show qos cos-map
    code_point local_priority color   name
    ---------- -------------- ------- ----
    0          7              green
    /////出力省略/////

    [Color]
    破棄優先度の指標となるColorも、上記のLocal Priorityと同様に各DSCP値ごと、CoS値ごとにGreen、Yellow、Redの3つのいずれかが設定されています。
    Colorの変更は、qos dscp-mapコマンド、qos cos-mapコマンドのコマンドオプションとして設定することができます。

    **dscp-mapでの設定例

    CX6200F(config)# qos dscp-map 0 local-priority 7 color red


    **確認例

    CX6200F# show qos dscp-map
    DSCP     code_point local_priority cos color   name
    -------- ---------- -------------- --- ------- ----
    000000   0          7                  red
    /////出力省略/////


    **cos-mapでの設定例

    CX6200F(config)# qos cos-map 0 local-priority 7 color red


    **確認例

    CX6200F# show qos cos-map
    code_point local_priority color   name
    ---------- -------------- ------- ----
    0          7              red
    /////出力省略/////

    ③ Remarkingステージ

    このステージでは、特定の送信元、宛先、プロトコルなどを条件としたポリシー設定を利用することにより、ポリシーに一致するトラフィックに対してLocal Priorityの指定と、着信トラフィックに設定(マーク)されているDSCP値/CoS値を変更させることができます。Local Priorityを指定したときは、出力ポートからの出力時にLocal Priorityに対応したキュー番号のキューから出力されることになります。

    **ポリシーに一致したトラフィックのLocal Priorityを指定する設定例
    ポート1/1/1で受信した送信元IP172.17.24.0/24のトラフィックのLocal Priorityを4にする。

    !
    class ip vlan24_traffic
        11 match any 172.17.24.0/255.255.255.0 any
    !
    policy policy1
        11 class ip vlan24_traffic action local-priority 4
    !
    interface 1/1/1
        apply policy policy1 in
    !


    **DSCP値のRemark設定例
    ポート1/1/1で受信した送信元IP172.17.24.0/24のトラフィックのDSCP値を48にする。

    !
    class ip vlan24_traffic
        11 match any 172.17.24.0/255.255.255.0 any
    !
    policy policy1
        11 class ip vlan24_traffic action dscp CS6
    !
    interface 1/1/1
        apply policy policy1 in
    !


    **出力ポート側でのパケットキャプチャ結果

    ④ Destinationステージ
    このステージでは、ルーティング、スイッチングをもとに出力インタフェースが決定されます。
    このステージで適用されるQoSの設定や動作は、ありません。
    ⑤Queuingステージ
    このステージでは、Prioritizeステージで決定されたLocal Priorityの値をもとに、出力ポートごとに持つ決められたキュー番号にパケットがキューイングされます。
    Local Priorityと、対応するキューは、初期設定が定義されており、キュープロファイル名"factory-default"が、スイッチに対して有効になっています。
    CX6200F# show qos queue-profile
    profile_status profile_name
    -------------- ------------
    applied        factory-default
    CX6200F# show qos queue-profile factory-default
    queue_num local_priorities name
    --------- ---------------- ----
    0         0                Scavenger_and_backup_data
    1         1
    2         2
    3         3
    4         4
    5         5
    6         6
    7         7
    CX6200F# show interface 1/1/1 qos
    Interface 1/1/1 is up
     Admin state is up
     qos trust none (global)
     qos queue-profile factory-default (global)
     qos schedule-profile factory-default (global)
    
    CX6200F#
    キュープロファイルを定義することも可能です。
    例として、Local Priority値0と1をキュー0、Local Priority値2と3をキュー1、Local Priority値4と5をキュー2、Local Priority値6と7をキュー3へキューイングされるようにするには、以下のように設定を行います。
    キュープロファイルの設定時、後述するスケジュールプロファイルも同時に指定する必要があります。

    **設定例
    CX6200F(config)# qos queue-profile test-queue-prof
    CX6200F(config-queue)# map queue 0 local-priority 0
    CX6200F(config-queue)# map queue 0 local-priority 1
    CX6200F(config-queue)# map queue 1 local-priority 2
    CX6200F(config-queue)# map queue 1 local-priority 3
    CX6200F(config-queue)# map queue 2 local-priority 4
    CX6200F(config-queue)# map queue 2 local-priority 5
    CX6200F(config-queue)# map queue 3 local-priority 6
    CX6200F(config-queue)# map queue 3 local-priority 7
    CX6200F(config)# apply qos queue-profile test-queue-prof schedule-profile strict

    **確認例
    CX6200F# show qos queue-profile
    profile_status profile_name
    -------------- ------------
    complete       factory-default
    applied        test-queue-prof
    CX6200F# show qos queue-profile test-queue-prof
    queue_num local_priorities name
    --------- ---------------- ----
    0         0,1
    1         2,3
    2         4,5
    3         6,7
    CX6200F# show interface 1/1/1 qos
    Interface 1/1/1 is up
     Admin state is up
     qos trust none (global)
     qos queue-profile test-queue-prof (global)
     qos schedule-profile strict (global)
    
    CX6200F#

    キューごとの出力と破棄のカウント数は、以下のコマンドで確認することができます。
    **確認例
    CX6200F# show interface 1/1/1 queues
    Interface 1/1/1 is up
     Admin state is up
                   Tx Bytes        Tx Packets          Tx Drops
     Q0                 711                 6                 0
     Q1             1381982              1229                 0
     Q2                   0                 0                 0
     Q3                1837                11                 0
     Q4                   0                 0                 0
     Q5                   0                 0                 0
     Q6                   0                 0                 0
     Q7                5074                30                 0
    
    CX6200F#

    ⑥Transmitステージ

    このステージでは、キューに保持されているパケットをポートから出力します。複数あるキューから、どの順番で出力されるかは、スケジューラの設定により決まります。
    これまでと同様にスケジューリングも初期設定が定義されており、スケジュールプロファイル名"factory-default"と"stric"の2つが定義されています。
    このうち、スイッチに対しては、スケジュールプロファイル名"factory-default"が有効となっています。

    CX6200F# show qos schedule-profile
    profile_status profile_name
    -------------- ------------
    applied        factory-default
    complete       strict
    CX6200F#
    CX6200F# show qos schedule-profile factory-default
    Queue                                      Maximum   Bandwidth
    Number  Algorithm      Percent  Weight   Bandwidth   Units
    ------- -------------- -------- ------- ----------   ----------
    0       dwrr                    1
    1       dwrr                    1
    2       dwrr                    1
    3       dwrr                    1
    4       dwrr                    1
    5       dwrr                    1
    6       dwrr                    1
    7       dwrr                    1
    CX6200F#
    CX6200F# show qos schedule-profile strict
    Queue                                      Maximum   Bandwidth
    Number  Algorithm      Percent  Weight   Bandwidth   Units
    ------- -------------- -------- ------- ----------   ----------
    0       strict
    1       strict
    2       strict
    3       strict
    4       strict
    5       strict
    6       strict
    7       strict
    CX6200F#
    CX6200F# show interface 1/1/1 qos
    Interface 1/1/1 is up
     Admin state is up
     qos trust none (global)
     qos queue-profile factory-default (global)
     qos schedule-profile factory-default (global)
    
    CX6200F#


    キューの優先順位は、値の大きいキュー番号が優先となっています。
    スケジュールプロファイルは、スイッチ全体に適用、または、インタフェース個別に適用させることができます。
    スイッチ全体に適用するときは、グローバルコンフィグレーションモードで設定を行いますが、スケジュールプロファイル単独では変更ができないため、前述のキュープロファイルを同時に指定する必要があります。

    **設定例【スイッチ全体に適用】

    CX6200F(config)# apply qos queue-profile factory-default schedule-profile strict


    **確認例

    CX6200F# show qos schedule-profile
    profile_status profile_name
    -------------- ------------
    complete       factory-default
    applied        strict
    CX6200F# show interface 1/1/1 qos
    Interface 1/1/1 is up
     Admin state is up
     qos trust none (global)
     qos queue-profile factory-default (global)
     qos schedule-profile strict (global)
    
    CX6200F#


    **設定例【インタフェース個別に適用】

    CX6200F(config)# interface 1/1/1
    CX6200F(config-if)# apply qos schedule-profile strict


    **確認例

    CX6200F# show interface 1/1/1 qos
    Interface 1/1/1 is up
     Admin state is up
     qos trust none (global)
     qos queue-profile factory-default (global)
     qos schedule-profile strict (override)
    
    CX6200F#

    #Blog

    #Wired