2014年3月6日星期四

Cisco 3750 QoS problem: why packets leave interface not marked?

mls qos map  WS-C3750X-12S-S   cos-dscp 0 8 16 24 32 46 48 56
mls qos
...
policy-map POLICY-VOIP-LAN17
class class-default
  trust cos
...
interface GigabitEthernet1/0/1
description *** Uplink ***
no switchport
ip address 172.18.254.250 255.255.255.252
mls qos trust dscp
...
interface GigabitEthernet1/0/24
description *** Downlink ***
switchport trunk encapsulation dot1q
switchport trunk native vlan 4094
switchport trunk allowed vlan 31,33,41,101,102,117,1101,4094
switchport mode trunk
switchport nonegotiate
mls qos vlan-based
!
interface Vlan117
description *** LAN ***
ip address 10.254.32.3 255.255.254.0
service-policy input POLICY-VOIP-LAN17


Show mls qos interface statistic:

DSW1-2#sh mls qos interface g1/0/24 statistics
GigabitEthernet1/0/24 (All statistics are in packets)

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

  0 -  4 :        9579            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           6
25 - 29 :           0            0            0            0            0
30 - 34 :           0            0            0            0            0
35 - 39 :           0            0            0            0            0
40 - 44 :         364            0            0            0            0
45 - 49 :           0            0            0           30            0
50 - 54 :           0            0            0            0            0
55 - 59 :           0            0            0            0            0
60 - 64 :           0            0            0            0
  dscp: outgoing
-------------------------------

  0 -  4 :        7781            0            0            0            0
  5 -  9 :           0            0            0          100            0
10 - 14 :           0            0            0            0            0
15 - 19 :           0            1            0           30            0
20 - 24 :           0            0            0            0            0
25 - 29 :           9            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           48            0
50 - 54 :           0            0            0            0            0
55 - 59 :           0            0            0            0            0
60 - 64 :           0            0            0            0
  cos: incoming
-------------------------------

  0 -  4 :        9609            1            0            6            1
  5 -  7 :         364           30           22
  cos: outgoing
-------------------------------

  0 -  4 :        7911          100           31            9            0
  5 -  7 :           0           48            0
  output queues enqueued:
queue:    threshold1   threshold2   threshold3
-----------------------------------------------
queue 0:           0           0           0
queue 1:        7914         160          93
queue 2:          40           0           0
queue 3:           6           0          14

  output queues dropped:
queue:    threshold1   threshold2   threshold3
-----------------------------------------------
queue 0:           0           0           0
queue 1:           0           0           0
queue 2:           0           0           0
queue 3:           0           0           0

Policer: Inprofile:            0 OutofProfile:            0

DSW1-2#sh mls qos interface g1/0/1 statistics
GigabitEthernet1/0/1 (All statistics are in packets)

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

  0 -  4 :        3370            0            0            0            0
  5 -  9 :           0            0            0          338            0
10 - 14 :          11            0            0            0            0
15 - 19 :           0            4            0          139            0
20 - 24 :           0            0            0            0           94
25 - 29 :        1233            5            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            2            0
50 - 54 :           0            0            0            0            0
55 - 59 :           0            0            0            0            0
60 - 64 :           0            0            0            0
  dscp: outgoing
-------------------------------

  0 -  4 :        3271            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            0            0            0
35 - 39 :           0            0            0            0            0
40 - 44 :           0            0            0            0            0
45 - 49 :           0            0            0            2            0
50 - 54 :           0            0            0            0            0
55 - 59 :           0            0            0            0            0
60 - 64 :           0            0            0            0
  cos: incoming
-------------------------------

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

  0 -  4 :        3271            0            0            0            0
  5 -  7 :           0            2            0
  output queues enqueued:
queue:    threshold1   threshold2   threshold3
-----------------------------------------------
queue 0:           0           0           0
queue 1:        3273         163          80
queue 2:           0           0           0
queue 3:           2           0           0

  output queues dropped:
queue:    threshold1   threshold2   threshold3
-----------------------------------------------
queue 0:           0           0           0
queue 1:           0           0           0
queue 2:           0           0           0
queue 3:           0           0           0

Policer: Inprofile:            0 OutofProfile:            0
Why packets leave interface g1/0/1 not marked with DSCP 46 and 24?

you set your cos-dscp mapping so CoS 3 and 5 maps to DSCP 24 and 46 respectively. but be advised, u use the CoS-to-DSCP map to map CoS values in incoming packets to a DSCP value that QoS uses internally to represent the priority of the traffic.

So, it does NOT mean that at the egress point ur switch changes the incomming CoS to the mapped DSCP value, actually when you trust CoS on a dot1q ingress port, switch uses that value or its equivalent dscp mapping for the QoS and queueing uses. it removes the dot1q tag and the CoS value, and at the egress rewrites it in order to retain the same value (trust), since here your egress point is a Layer 3 interface, there is no dot1q tag, so no CoS!

I think WS-C3750V2-48PS-S   it is a best practice to trust DSCP instead of CoS since you'r changing to Layer 3 network (egress) or explicty configure to Set the dscp value of the packets you want for that interface.