Monday, January 21, 2013

A quick post on QoS 2960/3560s auto-qos

This post is about a simple diagram that shows the  standard queues and cos values associated to various traffic. Please see the diagram here;





VoIP and the voice bearer portion is always set as expedite forward ( AKA EF or decimal value 46 ), in most case it's also associated with  CoS value #5. Your cos-2-dscp and dscp-2-qos maps should also reflect this;

cisco 2960:



ccie2960_01>sh mls qos map cos-dscp
   Cos-dscp map:
        cos:   0  1  2  3  4  5  6  7
     --------------------------------
       dscp:   0  8 16 24 32 46 48 56

 

and

 
ccie2960_01>sh mls qos map 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


The typical cisco  auto-qos does a good job with setting up your mls qos options. You may have to re-view and re-adust them based on the desired QoS goals and classification that you might need in your local LAN.

Typical most congestion are the output of the WAN and  trunk-ports. So plan and review you mls qos settings and mainly any drops.

e.g

show mls qos int fas 0/3  statistics | b dropped
  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


To enable auto-qos the commands are simple;





1: what's expected on the port that we are to enable auto-qos on ( phone, etc..)

2: do we want to trust any qos settings layer2 ( cos ) or  layer3 (dscp)

3: here's how to set QoS on a layer2 access-port that connected to a  phone;

(config-if)#auto qos voip ?
  cisco-phone      Trust the QoS marking of Cisco IP Phone
  cisco-softphone  Trust the QoS marking of Cisco IP SoftPhone
  trust            Trust the DSCP/CoS marking
and

(config-if)#auto qos voip cisco-phone

and the following show cmd provides me with the following output;

sh mls qos int fas 0/4
FastEthernet0/4
Attached policy-map for Ingress: AutoQoS-Police-CiscoPhone
trust state: not trusted
trust mode: trust cos
trust enabled flag: dis
COS override: dis
default COS: 0
DSCP Mutation Map: Default DSCP Mutation Map
Trust device: cisco-phone
qos mode: port-based


and we will find that the switch now has mls qos enabled globally and the port has some mls qos cfgs

!
interface FastEthernet0/4
 switchport access vlan 199
 switchport mode access
 srr-queue bandwidth share 10 10 60 20
 priority-queue out
 mls qos trust device cisco-phone
 mls qos trust cos
 auto qos voip cisco-phone
 spanning-tree portfast
 service-policy input AutoQoS-Police-CiscoPhone
end



In the above, we are using mls qos and legacy policy-map with the map name AutoQoS-Police-CiscoPhone. Let's look at that service policy map;

show policy-map AutoQoS-Police-CiscoPhone
  Policy Map AutoQoS-Police-CiscoPhone
    Class AutoQoS-VoIP-RTP-Trust
      set dscp ef
      police 1000000 8000 exceed-action policed-dscp-transmit
    Class

AutoQoS-VoIP-Control-Trust      set dscp cs3
      police 1000000 8000 exceed-action policed-dscp-transmit

Very simple it's a 2 class map using AutoQoS-VoIP-RTP-Trust and AutoQoS-VoIP-Control-Trust.

These class-maps are defined in the cfg as the following;

class-map match-all AutoQoS-VoIP-RTP-Trust
 match ip dscp ef


class-map match-all AutoQoS-VoIP-Control-Trust
 match ip dscp cs3  af31
!


Notice the match-all and in the control-trust we are matching on AF31 and cs3?  ( i.e AF31 is cs3 ). It's also kinda of redundant in the policy-map to set dscp ef  when the class is already expect to match it to begin with.

The rest of the mls qos setting sets a  priority queue-out and adjust the bandwidth per the srr lines;

 srr-queue bandwidth share 10 10 60 20
 priority-queue out
 mls qos trust device cisco-phone
 mls qos trust cos


 We can validate the queues output by execution of the following show cmd;

show mls qos int fas 0/4 queueing
FastEthernet0/4
Egress Priority Queue : enabled
Shaped queue weights (absolute) :  25 0 0 0
Shared queue weights  :  10 10 60 20
The port bandwidth limit : 100  (Operational Bandwidth:100.0)
The port is mapped to qset
: 1

So the lines show the queueing status with a priority queued enable, shaped at a hard 25 % of the bandwidth and the shared queues for queue 2-4 are 10/60/20 respectively.  So queues #1 value #10 can be ignored since the shaped  override it.

Queues #2 #3 #4 can use any unused portion of the other queues if they are not being used and are available.

So that's it for  quick 123  on auto-qos on the 2960s. A 3560 and 3750 should be similar since they both use  SRR  for scheduling queueing operations.

Ken Felix
Freelance Network/Security Engineer
kfelix  @  hyperfeed   com

 
 

1 comment:

  1. Hi Ken. Having read a few other sites I believe the priority queue isn't shaped to 25%. Shaping is 1/X of the bandwidth, so a shaping value of 25 means 1/25 or 4%. Also, when priority queue out is enabled the switch ignores shaping for this queue and so it can potentially lead to queue starvation. See http://blog.ine.com/tag/srr/. Thanks.

    ReplyDelete