Cisco IOS QoS – Catalyst 3560 Markingの設定

スポンサーリンク

Catalyst 3560にはルータとは異なる独自のQoSが存在します。Catalyst 3560でのMarkingの動作確認をします。

概要

Catalyst 3560 QoSのMarkingについてまとめます。Markingの方法は以下があります。

  • Mapping Tableに基づく自動的なMarking
  • policy-mapを利用したMarking
  • DSCP Mutation

コマンド一覧

このシナリオで重要なコマンド一覧は以下の通りです。

Switch(config)# mls qos
Switch(config)# mls qos map cos-dscp <val0> <val1> <val2> <val3> <val4> <val5> <val6> <val7>
Switch(config)# mls qos map ip-prec-dscp <val0> <val1> <val2> <val3> <val4> <val5> <val6> <val7>
Switch(config)# mls qos map dscp-cos <val0> <val1> ... <valN> to <value>
Switch(config)# mls qos map dscp-mutation <mutation_name> <before_dscp> to <after_dscp>

Switch(config-if)# mls qos trust { cos | ip-precedence | dscp }
Switch(config-if)# mls qos cos <value>
Switch(config-if)# mls qos cos override
Switch(config-if)# mls qos dscp-mutation <mutation_name>

構成図

以下の構成で動作確認を行います。

 [physical diagram]
    +------+f0/0    +------+f0/13   +------+f0/2    +------+
    |  R1  +--------+ SW 1 +--------+ SW 2 +--------+  R2  |
    +------+    f0/1+------+   f0/13+------+    f0/0+------+

 [logical diagram]
           192.168.12.0/24
          f0/0        f0/0
    +------+.1        .1+------+
    |      +------------+      | 
    |  R1  |            |  R2  | 
    |      +------------+      | 
    +------+.2        .2+------+
         f0/0.21    f0/0.21
          192.168.21.0/24

 [R1]
ipx routing
!
interface FastEthernet0/0
 ip address 192.168.12.1 255.255.255.0
!
interface FastEthernet0/0.21
 encapsulation dot1Q 21
 ip address 192.168.21.1 255.255.255.0
 ipx network 21 encapsulation SNAP
!
line vty 0 4
 password cisco
 login

 [R2]
ipx routing
!
interface FastEthernet0/0
 ip address 192.168.12.2 255.255.255.0
!
interface FastEthernet0/0.21
 encapsulation dot1Q 21
 ip address 192.168.21.2 255.255.255.0
 ipx network 21 encapsulation SNAP
!
line vty 0 4
 password cisco
 login

 [SW1]
vlan 12,21
!
interface FastEthernet0/1
 switchport trunk encapsulation dot1q
 switchport trunk native vlan 12
 switchport mode trunk
!
interface FastEthernet0/13
 switchport trunk encapsulation dot1q
 switchport mode trunk
!
interface range FastEthernet0/14 - 21
 shutdown

 [SW2]
vlan 12,21
!
interface FastEthernet0/2
 switchport trunk encapsulation dot1q
 switchport trunk native vlan 12
 switchport mode trunk
!
interface FastEthernet0/13
 switchport trunk encapsulation dot1q
 switchport mode trunk
!
interface range FastEthernet0/14 - 21
 shutdown

設定全文は下記ファイルです。詳細設定は下記を参照ください。

R1
version 12.4
no service pad
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
no network-clock-participate slot 1
no network-clock-participate wic 0
ip cef
!
!
!
!
!
ipx routing 000f.8f4f.ad60
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
 ip address 192.168.12.1 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/0.21
 encapsulation dot1Q 21
 ip address 192.168.21.1 255.255.255.0
 ipx network 21 encapsulation SNAP
!
interface Serial0/0
 no ip address
 shutdown
!
interface Serial0/1
 no ip address
 shutdown
!
!
!
ip http server
no ip http secure-server
!
!
!
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
 logging synchronous level 0 limit 20
line aux 0
line vty 0 4
 login
!
!
end
R2
version 12.4
no service pad
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
no network-clock-participate slot 1
no network-clock-participate wic 0
ip cef
!
!
!
!
!
ipx routing 000d.655b.9740
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
 ip address 192.168.12.2 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/0.21
 encapsulation dot1Q 21
 ip address 192.168.21.2 255.255.255.0
 ipx network 21 encapsulation SNAP
!
interface Serial0/0
 no ip address
 shutdown
!
interface Serial0/1
 no ip address
 shutdown
!
!
!
ip http server
no ip http secure-server
!
!
!
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
 logging synchronous level 0 limit 20
line aux 0
line vty 0 4
 password cisco
 login
!
!
end
SW1
version 12.2
no service pad
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname SW1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
system mtu routing 1500
ip subnet-zero
!
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
spanning-tree extend system-id
!
vlan internal allocation policy ascending
!
!
!
!
interface FastEthernet0/1
 switchport trunk encapsulation dot1q
 switchport trunk native vlan 12
 switchport mode trunk
!
interface FastEthernet0/2
!
interface FastEthernet0/3
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
 switchport trunk encapsulation dot1q
 switchport mode trunk
!
interface FastEthernet0/14
 shutdown
!
interface FastEthernet0/15
 shutdown
!
interface FastEthernet0/16
 shutdown
!
interface FastEthernet0/17
 shutdown
!
interface FastEthernet0/18
 shutdown
!
interface FastEthernet0/19
 shutdown
!
interface FastEthernet0/20
 shutdown
!
interface FastEthernet0/21
 shutdown
!
interface FastEthernet0/22
!
interface FastEthernet0/23
!
interface FastEthernet0/24
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
!
interface Vlan1
 no ip address
 shutdown
!
ip classless
ip http server
ip http secure-server
!
!
!
control-plane
!
!
line con 0
 logging synchronous level 0 limit 20
line vty 0 4
 login
line vty 5 15
 login
!
end
SW2
version 12.2
no service pad
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname SW2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
system mtu routing 1500
ip subnet-zero
!
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
spanning-tree extend system-id
!
vlan internal allocation policy ascending
!
!
!
!
interface FastEthernet0/1
!
interface FastEthernet0/2
 switchport trunk encapsulation dot1q
 switchport trunk native vlan 12
 switchport mode trunk
!
interface FastEthernet0/3
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
 switchport trunk encapsulation dot1q
 switchport mode trunk
!
interface FastEthernet0/14
 shutdown
!
interface FastEthernet0/15
 shutdown
!
interface FastEthernet0/16
 shutdown
!
interface FastEthernet0/17
 shutdown
!
interface FastEthernet0/18
 shutdown
!
interface FastEthernet0/19
 shutdown
!
interface FastEthernet0/20
 shutdown
!
interface FastEthernet0/21
 shutdown
!
interface FastEthernet0/22
!
interface FastEthernet0/23
!
interface FastEthernet0/24
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
!
interface Vlan1
 no ip address
 shutdown
!
ip classless
ip http server
ip http secure-server
!
!
!
control-plane
!
!
line con 0
 logging synchronous level 0 limit 20
line vty 0 4
 login
line vty 5 15
 login
!
end

仕様説明

mls qos

以下のコマンドでmls qos(Multi Layer Switching QoS)を有効にできます。この機能を有効にすると、優先度(CoS, ip precedence, DSCPなど)の値に応じたスイッチングを行います。

Switch(config)# mls qos

trust interface

各interfaceに対して、優先度を信頼するかどうかを定義します。信頼しない場合は優先度の値に関わらず、DSCP 0, CoS 0にマーキングされます。信頼する場合は、マッピングテーブルに基づき、DSCP, CoS値が変換されます。

設定 動作
信頼しない DSCP 0, Cos 0として取り扱います。
mls qos trust cos CoS/DSCPマップに基づきCos値を設定します。
mls qos trust ip-precedence precedence/DSCPマップに基づきDSCPを設定します。
その後、DSCP/CoSマップに基づきCoS値を設定します。
mls qos trust dscp DSCP/CoSマップに基づきCoS値を設定します。
Switch(config-if)# mls qos trust { cos | ip-precedence | dscp }

mapping table

マッピングテーブルは以下のコマンドにより変更が可能です。

Switch(config)# mls qos map cos-dscp <val0> <val1> <val2> <val3> <val4> <val5> <val6> <val7>
Switch(config)# mls qos map ip-prec-dscp <val0> <val1> <val2> <val3> <val4> <val5> <val6> <val7>
Switch(config)# mls qos map dscp-cos <val0> <val1> ... <valN> to <value>

マッピングテーブルは以下のコマンドで確認可能です。デフォルト設定の場合は、以下のようになります。

SW1#show mls qos maps cos-dscp
   Cos-dscp map:
        cos:   0  1  2  3  4  5  6  7
     --------------------------------
       dscp:   0  8 16 24 32 40 48 56


SW1#
SW1#
SW1#show mls qos maps ip-prec-dscp
   IpPrecedence-dscp map:
     ipprec:   0  1  2  3  4  5  6  7
     --------------------------------
       dscp:   0  8 16 24 32 40 48 56


SW1#
SW1#
SW1#show mls qos maps dscp-cos
   Dscp-cos map:
     d1 :  d2 0  1  2  3  4  5  6  7  8  9
     ---------------------------------------
      0 :    00 00 00 00 00 00 00 00 01 01
      1 :    01 01 01 01 01 01 02 02 02 02
      2 :    02 02 02 02 03 03 03 03 03 03
      3 :    03 03 04 04 04 04 04 04 04 04
      4 :    05 05 05 05 05 05 05 05 06 06
      5 :    06 06 06 06 06 06 07 07 07 07
      6 :    07 07 07 07


SW1#

default cos

CoS値を信頼する場合は注意が必要です。タグが付与されていない(Access PortやNative Vlan)場合は、CoS値が存在しません。CoS値が存在しない場合は、以下コマンドで定義されたCoS値を元にCoS/DSCPマップを適用します。もし、”mls qos cos “コマンドが定義されていない場合は、CoS0としてCoS/DSCPマップを適用します。

Switch(config)# interface <interface>
Switch(config-if)# mls qos cos <value>

タグが存在するか存在しないかどうかに関わらず、常に同じCoS値を設定したい場合は、以下のように”mls qos cos override”コマンド使用して下さい。

Switch(config)# interface <interface>
Switch(config-if)# mls qos cos <value>
Switch(config-if)# mls qos cos override

no trust

mls qos 設定

interfaceを信頼していない場合の挙動について確認します。SW1にmls qosを有効する設定のみを投入します。

 [SW1]
mls qos

パケット送信

R1からR2へ、DSCP EF(ToS 184)をマークしたpingを送信します。

 [R1]
R1#ping
Protocol [ip]:
Target IP address: 192.168.12.2
Repeat count [5]: 100
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface:
Type of service [0]: 184
Set DF bit in IP header? [no]:
Validate reply data? [no]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 100, 100-byte ICMP Echos to 192.168.12.2, timeout is 2 seconds:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Success rate is 100 percent (100/100), round-trip min/avg/max = 1/2/5 ms
R1#

動作確認

R1が送信したpingはDSCP EF(DSCP 46), CoS 0が付与されています。SW1はR1を信頼していないのでDSCP 0, CoS 0にマークダウンしてSW2に転送している事が読み取れます。

 [SW1]
SW1#show mls qos interface FastEthernet 0/13 statistics
FastEthernet0/13 (All statistics are in packets)

 <omitted>

  dscp: outgoing
-------------------------------

  0 -  4 :         100            0            0            0            0
  5 -  9 :           0            0            0            0            0
 10 - 14 :           0            0            0            0            0
 15 - 19 :           0            0            0            0            0

 <omitted>

  cos: outgoing
-------------------------------

  0 -  4 :         101            0            0            0            0
  5 -  7 :           0            0            0
Policer: Inprofile:            0 OutofProfile:            0

SW1#

trust cos

mls qos 設定

SW1にR1のCoSを信頼する設定を投入します。また、cos/dscpテーブルを以下のように定義します。

CoS DSCP
0 default (DSCP 0, ToS 0)
1 AF11 (DSCP 10, ToS 40)
2 AF21 (DSCP 18, ToS 72)
3 CS3 (DSCP 24, ToS 96)
4 CS4 (DSCP 32, ToS 128)
5 FE (DSCP 46, ToS 184)
6 CS6 (DSCP 48, ToS 192)
7 CS7 (DSCP 56, ToS 224)
 [SW1]
clear mls qos interface statistics
!
mls qos
mls qos map cos-dscp 0 10 18 24 32 46 48 56
!
interface FastEthernet0/1
 mls qos cos 1
 mls qos trust cos

パケット送信 CoS 2

R1からR2へのCoS 2のpingを送信します。
以下のようなpolicy-mapを作成した後に、pingを送信します。

 [R1]
policy-map PMAP_SET_COS2
 class class-default
  set cos 2
!
interface FastEthernet0/0.21
 service-policy output PMAP_SET_COS2

R1#ping 192.168.21.2 repeat 100

Type escape sequence to abort.
Sending 100, 100-byte ICMP Echos to 192.168.21.2, timeout is 2 seconds:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Success rate is 100 percent (100/100), round-trip min/avg/max = 1/2/4 ms
R1#

動作確認 CoS 2

CoS 2で受信したパケットは、cos/despテーブルに基づきDSCP AF11(ToS 18)がマークされた事が読み取れます。

 [SW1]
SW1#show mls qos interface FastEthernet 0/1 statistics
FastEthernet0/1 (All statistics are in packets)

 <omitted>

  cos: incoming
-------------------------------

  0 -  4 :           0            5          100            0            0
  5 -  7 :           0            0            0
  cos: outgoing
-------------------------------

 <omitted>

SW1#
SW1#
SW1#show mls qos interface FastEthernet 0/13 statistics
FastEthernet0/13 (All statistics are in packets)


 <omitted>

  dscp: outgoing
-------------------------------

  0 -  4 :           0            0            0            0            0
  5 -  9 :           0            0            0            0            0
 10 - 14 :           0            0            0            0            0
 15 - 19 :           0            0            0          100            0
 20 - 24 :           0            0            0            0            0
 25 - 29 :           0            0            0            0            0

 <omitted>

SW1#

パケット送信 CoSなし

CoS値が存在しない場合の挙動について考察します。R1からR2へ、CoS値が存在しない(native vlanの)pingを送信します。

 [R1]
R1#ping 192.168.12.2 repeat 200

Type escape sequence to abort.
Sending 200, 100-byte ICMP Echos to 192.168.12.2, timeout is 2 seconds:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Success rate is 100 percent (200/200), round-trip min/avg/max = 1/2/4 ms
R1#

動作確認 CoSなし

CoS値が存在しない場合は、mls qos cosで定義された値に基づきマーキングされます。この場合は、”mls qos cos 1″と設定されていますのでcos/dscpテーブルに基づきDSCP AF11(ToS 10)がマークされます。

 [SW1]
SW1#show mls qos interface FastEthernet 0/1 statistics

 <omitted>

  cos: incoming
-------------------------------

  0 -  4 :           0          243          100            0            0
  5 -  7 :           0            0            0

 <omitted>

SW1#show mls qos interface FastEthernet 0/13 statistics
FastEthernet0/13 (All statistics are in packets)

  dscp: incoming
-------------------------------

  0 -  4 :           0            0            0            0            0
  5 -  9 :           0            0            0            0            0
 10 - 14 :         200            0            0            0            0
 15 - 19 :           0            0            0          100            0
 20 - 24 :           0            0            0            0            0

 <omitted>

SW1#

trust ip-precedence

mls qos 設定

SW1にR1のip precedenceを信頼する設定を投入します。また、precedence/DSCPテーブル, dscp/CoSテーブルを以下のように定義します。

precedence DSCP CoS
0 (DSCP 0, ToS 0) default (DSCP 0, ToS 0) 2
1 (DSCP 8, ToS 32) AF11 (DSCP 10, ToS 40) 2
2 (DSCP 16, ToS 64) AF21 (DSCP 18, ToS 72) 2
3 (DSCP 24, ToS 96) CS3 (DSCP 24, ToS 96) 3
4 (DSCP 32, ToS 128) CS4 (DSCP 32, ToS 128) 4
5 (DSCP 40, ToS 160) FE (DSCP 46, ToS 184) 5
6 (DSCP 48, ToS 192) CS6 (DSCP 48, ToS 192) 6
7 (DSCP 56, ToS 224) CS7 (DSCP 56, ToS 224) 7
 [SW1]
clear mls qos interface statistics
!
mls qos
mls qos map ip-prec-dscp 0 10 18 24 32 46 48 56
mls qos map dscp-cos 0 10 to 2
!
interface FastEthernet0/1
 mls qos trust ip-precedence

パケット送信

ip precedence 8のパケットをR1からR2へ送信します。

 [R1]
R1#ping
Protocol [ip]:
Target IP address: 192.168.12.2
Repeat count [5]: 100
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface:
Type of service [0]: 32
Set DF bit in IP header? [no]:
Validate reply data? [no]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 100, 100-byte ICMP Echos to 192.168.12.2, timeout is 2 seconds:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Success rate is 100 percent (100/100), round-trip min/avg/max = 1/2/4 ms
R1#

動作確認

prececende/DSCPマップに基づき、ip precedence 1(DSCP 8)がDSCP AF11 (DSCP 10)に変換されます。さらに、DSCP/CoSマップに基づき、CoS 2が付与されます。

 [SW1]
SW1#show mls qos interface FastEthernet 0/13 statistics

 <omitted>

  dscp: outgoing
-------------------------------

  0 -  4 :           0            0            0            0            0
  5 -  9 :           0            0            0            0            0
 10 - 14 :         100            0            0            0            0
 15 - 19 :           0            0            0            0            0
 20 - 24 :           0            0            0            0            0
 25 - 29 :           0            0            0            0            0
 30 - 34 :           0            0            0            0            0
 35 - 39 :           0            0            0            0            0
 40 - 44 :           0            0            0            0            0
 45 - 49 :           0            0            0            0            0
 50 - 54 :           0            0            0            0            0
 55 - 59 :           0            0            0            0            0
 60 - 64 :           0            0            0            0

 <omitted>

  cos: outgoing
-------------------------------

  0 -  4 :           0            0          100            0            0
  5 -  7 :           0            0            0
Policer: Inprofile:            0 OutofProfile:            0

SW1#

trust dscp

mls qos 設定

SW1にR1のDSCPを信頼する設定を投入します。また、DSCP/CoSテーブルの設定を削除し、以下のデフォルトの変換ルールを適応します。

DSCP CoS
0 – 7 0
8 – 15 1
16 – 23 2
24 – 31 3
32 – 39 4
40 – 47 5
48 – 55 6
56 – 63 7
 [SW1]
clear mls qos interface statistics
!
mls qos
no mls qos map dscp-cos 0 10 to 2
!
interface FastEthernet0/1
 mls qos trust dscp

パケット送信

DSCP CS4のパケットをR1からR2へ送信します。

 [R1]
R1#ping
Protocol [ip]:
Target IP address: 192.168.12.2
Repeat count [5]: 100
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface: 128
% Invalid source. Must use IP address or full interface name without spaces (e.g. Serial0/1)
Source address or interface:
Type of service [0]: 128
Set DF bit in IP header? [no]:
Validate reply data? [no]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 100, 100-byte ICMP Echos to 192.168.12.2, timeout is 2 seconds:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Success rate is 100 percent (100/100), round-trip min/avg/max = 1/2/4 ms
R1#

動作確認

DSCP CS4(DSCP 32)がDSCP/CoSテーブルに基づき、CoS 4が付与されている事を確認します。

 [SW1]
SW1#show mls qos interface FastEthernet 0/13 statistics
FastEthernet0/13 (All statistics are in packets)

 <omitted>

  dscp: outgoing
-------------------------------

  0 -  4 :           0            0            0            0            0
  5 -  9 :           0            0            0            0            0
 10 - 14 :           0            0            0            0            0
 15 - 19 :           0            0            0            0            0
 20 - 24 :           0            0            0            0            0
 25 - 29 :           0            0            0            0            0
 30 - 34 :           0            0          100            0            0
 35 - 39 :           0            0            0            0            0
 40 - 44 :           0            0            0            0            0
 45 - 49 :           0            0            0            0            0
 50 - 54 :           0            0            0            0            0
 55 - 59 :           0            0            0            0            0
 60 - 64 :           0            0            0            0

 <omitted>

  cos: outgoing
-------------------------------

  0 -  4 :           0            0            0            0          100
  5 -  7 :           0            0            0
Policer: Inprofile:            0 OutofProfile:            0

SW1#

policy-map

mls qos 設定

Mapping Tableではなくpolicy-mapに基づいたマーキングも可能です。以下はIPX(eth tyep 0x8137)はCS1、ICMPはCS2、TELNETはEFにマーキングする設定例です。

 [SW2]
mac access-list extended ACL_IPX
 permit any any 0x8137 0x0
ip access-list extended ACL_ICMP
 permit icmp any any
ip access-list extended ACL_TELNET
 permit tcp any any eq telnet
 permit tcp any eq telnet any
!
class-map CMAP_IPX
 match access-group name ACL_IPX
class-map CMAP_ICMP
 match access-group name ACL_ICMP
class-map CMAP_TELNET
 match access-group name ACL_TELNET
!
policy-map PMAP_MARKING
 class CMAP_IPX
  set dscp cs1
 class CMAP_ICMP
  set dscp cs2
 class CMAP_TELNET
  set dscp ef
!
interface FastEthernet 0/2
 service-policy input PMAP_MARKING

パケット送信

R2からR1へ、IPX, ICMP, telnetのトラフィックを発生させます。

 [R2]
R2#ping
Protocol [ip]: ipx
Target IPX address: 21.000f.8f4f.ad60
Repeat count [5]: 50
Datagram size [100]:
Timeout in seconds [2]:
Verbose [n]:
Type escape sequence to abort.
Sending 50, 100-byte IPX Novell Echoes to 21.000f.8f4f.ad60, timeout is 2 seconds:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Success rate is 100 percent (50/50), round-trip min/avg/max = 1/2/4 ms
R2#
R2#
R2#ping 192.168.12.1 repeat 100

Type escape sequence to abort.
Sending 100, 100-byte ICMP Echos to 192.168.12.1, timeout is 2 seconds:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Success rate is 100 percent (100/100), round-trip min/avg/max = 1/2/5 ms
R2#
R2#
R2#telnet 192.168.12.1
Trying 192.168.12.1 ... Open


User Access Verification

Password:
R1<

動作確認

DSCP CS1, CS2, EFのマーキングがなされている事を確認します。また、DSCP/CoSテーブルに基づき、DSCPに相当するCoS値が付与されている事を確認します。

 [SW2]
SW2#show mls qos interface FastEthernet 0/13 statistics
FastEthernet0/13 (All statistics are in packets)

 <omitted>

  dscp: outgoing
-------------------------------

  0 -  4 :           8            0            0            0            0
  5 -  9 :           0            0            0            0            0
 10 - 14 :           0            0            0            0            0
 15 - 19 :           0          100            0            0            0
 20 - 24 :           0            0            0            0            0
 25 - 29 :           0            0            0            0            0
 30 - 34 :           0            0            0            0            0
 35 - 39 :           0            0            0            0            0
 40 - 44 :           0            0            0            0            0
 45 - 49 :           0           33            0            0            0
 50 - 54 :           0            0            0            0            0
 55 - 59 :           0           11            0            0            0
 60 - 64 :           0            0            0            0

 <omitted>

  cos: outgoing
-------------------------------

  0 -  4 :          23           50          100            0            0
  5 -  7 :          33            0            0
Policer: Inprofile:            0 OutofProfile:            0

SW2#

DSCP Mutation

mls qos 設定

DSCP Mutationを用いてDSCPを変換する事ができます。以下はDSCP0, 26, 40をDSCP8, 24, 46に変換する例です。

 [SW2]
mls qos
mls qos map dscp-mutation MUTATION 0 to 8
mls qos map dscp-mutation MUTATION 26 to 24
mls qos map dscp-mutation MUTATION 40 to 46
!
interface FastEthernet 0/2
 no service-policy input PMAP_MARKING
 mls qos trust dscp
 mls qos dscp-mutation MUTATION

パケット送信

R2からR1へ、DSCP 0, DSCP 40(ToS 160)のパケットを送信します。

 [R2]
R2#ping 192.168.12.1 repeat 100

Type escape sequence to abort.
Sending 100, 100-byte ICMP Echos to 192.168.12.1, timeout is 2 seconds:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Success rate is 100 percent (100/100), round-trip min/avg/max = 1/2/5 ms
R2#
R2#
R2#ping
Protocol [ip]:
Target IP address: 192.168.12.1
Repeat count [5]: 100
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface:
Type of service [0]: 160
Set DF bit in IP header? [no]:
Validate reply data? [no]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 100, 100-byte ICMP Echos to 192.168.12.1, timeout is 2 seconds:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Success rate is 100 percent (100/100), round-trip min/avg/max = 1/2/5 ms
R2#

動作確認

DSCP0, 40のパケットが、DSCP8, 46に変換されていることが読み取れます。

 [SW2]
SW2#show mls qos interface FastEthernet 0/13 statistics
FastEthernet0/13 (All statistics are in packets)

 <omitted>

  dscp: outgoing
-------------------------------

  0 -  4 :          11            0            0            0            0
  5 -  9 :           0            0            0          100            0
 10 - 14 :           0            0            0            0            0
 15 - 19 :           0            0            0            0            0
 20 - 24 :           0            0            0            0            0
 25 - 29 :           0            0            0            0            0
 30 - 34 :           0            0            0            0            0
 35 - 39 :           0            0            0            0            0
 40 - 44 :           0            0            0            0            0
 45 - 49 :           0          100            0            0            0
 50 - 54 :           0            0            0            0            0
 55 - 59 :           0           13            0            0            0
 60 - 64 :           0            0            0            0

 <omitted>

タイトルとURLをコピーしました