Sunday, July 21, 2013

CCIE-W: QoS Study Notes

I've had some people suggest that I should post more of my study notes.  QoS is one of those black magic topics that I really do need to understand more of.  I went through with one of my co-workers who gave me the Catalyst 3750 QoS in 30 lecture.  Between that and some of Jerome Henry's QoS videos on youtube, here the basics on QoS.  So here are my notes in all their ugly glory.


Controller QoS

Set 802.1p on QoS Profile(s)
      Voice gets 802.1P 6
      Video gets 802.1P 5
      Silver gets 802.1P 4
    ---Each one gets marked down by one when it hits the wire.  WLC does this automagically

Set your WLAN Qos Level on each WLAN.  These are the MAXIMUM levels that will be coming off this WLAN.

Go set your voice CAC under the media section for each radio



Switching QoS
---------------------------------------
Set qos maps
-------------------------------------
<Check the mappings.  We need DSCP 46 <> COS 5 and DSCP 24 <> COS3 for Voice.>

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

#show 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 

<Alter the CoS to DSCP Mappings>
(config)# mls qos map cos-dscp 0 8 16 24 32 46 48 56

<Verify that mls qos maps are set appropriately>
#show 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 

#show 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 

---------------------------------------
Queuing Sets
-------------------------------------
<Now lets look at the queuing sets:>


<We have 2 INPUT queues to worry about, i'm setting them to 20/80>
(config)#mls qos srr-queue input bandwidth 20 80

<Also setting the buffers to 20/80>
(config)#mls qos srr-queue input buffers 20 80 

<Setup our INPUT priority queue for 20%>
(config)#mls qos srr-queue input priority-queue 1 bandwidth 20

<Now setup the cos-map queuing, which CoS values go into queue 1 vs queue 2>
(config)#mls qos srr-queue input cos-map queue 1 threshold 3 3 4 5 6 7
(config)#mls qos srr-queue input cos-map queue 2 threshold 3 0 1 2

<Repeat for DSCP INPUT queues>
(config)#mls qos srr-queue input dscp-map queue 1 threshold 3 34 40 41 42 43 44 45 46
(config)#mls qos srr-queue input dscp-map queue 1 threshold 3 47 48 49 50 51 52 53 54
(config)#mls qos srr-queue input dscp-map queue 1 threshold 3 55 56 57 58 59 60 61 62
(config)#mls qos srr-queue input dscp-map queue 1 threshold 3 63
>




<Now for the OUTPUT queue policies, there are 4 queues here>

<Put CoS 4, 5 in queue 1 @ Threshold 3>
mls qos srr-queue output cos-map queue 1 threshold 3 4 5

<Put CoS 3, 6, 7 in queue 2 at Threshold 3>
mls qos srr-queue output cos-map queue 2 threshold 3 3 6 7

<Put CoS 1, 2 in queue 3 at Threshold 3>
mls qos srr-queue output cos-map queue 3 threshold 3 1 2

<Put CoS 0 in queue 4 @ threshold 3>
mls qos srr-queue output cos-map queue 4 threshold 3 0

<Repeat with DSCP Values>
mls qos srr-queue output dscp-map queue 1 threshold 3 46
mls qos srr-queue output dscp-map queue 2 threshold 1 16 18 20 22 26 32 34 36
mls qos srr-queue output dscp-map queue 2 threshold 1 38
mls qos srr-queue output dscp-map queue 2 threshold 2 24
mls qos srr-queue output dscp-map queue 2 threshold 3 48 56 58 59 60 61 62 63
mls qos srr-queue output dscp-map queue 3 threshold 3 0
mls qos srr-queue output dscp-map queue 4 threshold 1 8

<Exactly what are these "Threshold" values?  let's define them >
<Threshold 3 and 4 are set to 100%, Threshold 2 is 80% and 1 is 70%>
mls qos queue-set output 1 threshold 2 70 80 100 100



Layer 2 Trunk Config
This can be on a single port, or a port channel

<On L2 trunks trust on CoS becausee they have an 802.1P header>
(config-if)#mls qos trust cos
<set srr-queues on the ports as well, SHARE is setup in Percentages.>
(config-if)#srr-queue bandwidth share 10 10 60 20

<You can set the srr-shape as well.>
<Remember that SHAPE values are inverted, or 1/value, so 10 is really 1/10>
(config-if)#srr-queue bandwidth shape 10 0 0 0

<If they tell you to make sure that voice traffic must not be queued to "exhaustion" then set the priority queue out>
(You can put in Priority Queue Out, but it overrides ALL the srr-queue commands on the port)
(config-if)# priority-queue Out


Local Mode AP Port config
I'll be skipping any STP, general port config as this is all about QoS

<We trust DSCP on access points, unless they are in flex-connect/hreap mode>
(config-if)#mls qos trust dscp

<Apply your srr-queue values to the port, you can skip if you need priority-queue out>
(config-if)# srr-queue bandwidth share 10 10 60 20
(config-if)# srr-queue bandwidth shape 10 0 0 0

<Apply priority queue out if you need it, it overrides your srr-queue config>
(config-if)# priority-queue out

Flexconnect AP Port Config

<Since we are dropping traffic off with vlan tags, we should trust?  That's right, CoS>
(config-if)# mls qos trust cos

<Apply your srr-queue values to the port, or apply your priority-queue out>


Layer3 routed link
Since a layer 3 link doesn't have an 802.1P header, trust DSCP

<Configure to trust dscp>
(config-if)# mls qos trust dscp

<Insert your srr-queue or priority queue info here>


Cisco Phone
This one will be debated I'm sure.  I trust CoS and device Cisco-phone for a couple reasons.  1, I don't want to trust the PC, and trust DSCP will make me trust the pc plugged into the phone.  Second, i'm defining a voice vlan for the phone, so it will be sending me a 802.1P tag.  And finally, it's what they suggested in the Campus QoS class at Cisco Live ;)

<set qos trust for device cisco-phone>
(config-if)#mls qos trust device cisco-phone

<also set trust for CoS>
(config-if)# mls qos trust cos

<set your srr-queue statements here>