Catalyst QoS – Per port, Per VLAN classification

September 11, 2008 at 5:26 pm | Posted in QoS, Switching | 1 Comment

Configure SW3 to mark traffic comming to the trunk interface Fa0/16 fromm VLAN201 to IP Precedence 1, and from VLAN 202 to IP Precedence 2.

Topology:

VLAN201          VLAN201
  |                 |
  |                 |
  |                 |
SW2 ------------- SW3
  |                 |
  |		    |
  |		    |
VLAN202          VLAN202

Configuration

SW3#

!
class-map match-all VLAN202
match vlan  202
class-map match-all VLAN201
match vlan  201
!
!
policy-map MARK_PREC
 class VLAN201
  set ip precedence 1
 class VLAN202
  set ip precedence 2

!

Note that within a class-map, match VLAN has to be followed by a match class-map (nested configuration). See the wrong configuration example without match class-map (above) and the error message when the service policy is applied onto the interface:

SW3(config)#int fa0/16
SW3(config-if)#service-policy input MARK_PREC
QoS: match class-map must follow match vlan in class-map VLAN201.
QoS: Policy map MARK_PREC failed vlan check
Service Policy attachment failed
*Mar  1 05:45:32.418: %QM-4-MATCH_NOT_SUPPORTED: Match type is not supported in classmap VLAN201
SW3(config)#class-map match-all VLAN202
SW3(config-cmap)#match vlan  202
SW3(config-cmap)#match class-map IP_TRAFFIC
SW3(config)#class-map match-all VLAN201
SW3(config-cmap)#match vlan  201
SW3(config-cmap)#match class-map IP_TRAFFIC
SW3(config-cmap)#int fa0/16
SW3(config-if)#service-policy input MARK_PREC

Verification

SW3(config)#int vlan 201
SW3(config-if)#ip accounting precedence input
SW3#
SW3#
SW3#sh int vlan 201 precedence
Vlan201
  Input
    (none)

SW2#ping 201.0.0.9

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

SW3#sh int vlan 201 precedence
Vlan201
  Input
    Precedence 0:  5 packets, 590 bytes
SW3#sh mls qos
QoS is disabled

SW3#c
Enter configuration commands, one per line.  End with CNTL/Z.
SW3(config)#mls qos
QoS: ensure flow-control on all interfaces are OFF for proper operation.
SW3(config)#
SW3#
SW3#

SW3#sh mls qos
QoS is enabled

SW2#ping 201.0.0.9

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

SW3#sh int vlan 201 precedence
Vlan201
  Input
    Precedence 0:  5 packets, 590 bytes
    Precedence 1:  5 packets, 590 bytes

SW2#ping 202.0.0.9

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

SW3#sh int vlan 202 precedence
Vlan202
  Input
    Precedence 2:  5 packets, 590 bytes

Alternatively on a C3550 we can use “mls qos monitor dscp” on physical interface to count number of packets with a particular IP Precendence or DSCP values.

SW3#c
Enter configuration commands, one per line.  End with CNTL/Z.
SW3(config)#int fa0/16
SW3(config-if)#mls qos
SW3(config-if)#mls qos mo
SW3(config-if)#mls qos monitor ?
  bytes    Collect byte statistics
  dscp     Collect DSCP statistics
  packets  Collect packet statistics

SW3(config-if)#mls qos monitor ds
SW3(config-if)#mls qos monitor dscp ?
  <0-63>  DSCP values separated by spaces (up to 8 values total)

SW3(config-if)#mls qos monitor dscp 0 ?
  <0-63>  DSCP values separated by spaces (up to 8 values total)
  <cr>

SW3(config-if)#mls qos monitor dscp 0 8 16
SW3(config-if)#
SW3#
SW3#
SW3#
SW3#
SW3#
SW3#
*Mar  1 06:00:28.574: %SYS-5-CONFIG_I: Configured from console by console
SW3#c
Enter configuration commands, one per line.  End with CNTL/Z.
SW3(config)#int fa0/16
SW3(config-if)#mls qos monitor packets
QoS: This command is only applicable on a master port.
 On a 24 ports switch:
  -port 1 controls interface 1 to 12
  -port 13 controls interface 13 to 24
 On a 48 ports switch:
  -port 25 controls interface 25 to 36
  -port 37 controls interface 37 to 48
SW3(config-if)#
SW3(config-if)#
SW3(config-if)#int fa0/13
SW3(config-if)#mls qos monitor packets
SW3(config-if)#

SW2#ping 201.0.0.9

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

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

SW3#sh mls qos int fa0/16 statistics
FastEthernet0/16
Ingress
  dscp: incoming   no_change  classified policed    dropped (in pkts)
    0 : 14         4          0          0          0        
    8 : 0          0          5          0          0        
    16: 0          0          5          0          0        
Others: 0          0          0          0          0        
Egress
  dscp: incoming   no_change  classified policed    dropped (in pkts)
    0 : 5             n/a       n/a      0          0        
    8 : 5             n/a       n/a      0          0        
    16: 5             n/a       n/a      0          0        
Others: 69            n/a       n/a      0          0         

SW3#
Advertisements

1 Comment »

RSS feed for comments on this post. TrackBack URI

  1. Good Post. I like the way you verified the solution using accounting and qos monitor.


Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.
Entries and comments feeds.

%d bloggers like this: