QoS Part II: Congestion Management, Traffic Policing and Shaping


When we are talking about the QoS Congestion Management and Avoidance, the three most important terms are: queuing, dropping and scheduling. Queuing places the packets into the different software queues based on the QoS labels. After the traffic is classified and marked with QoS labels, you can assign the traffic into a certain number different queues based on the QoS labels.

WRED (Weighted Random Early Detection) is the only RED method used by Cisco to drop the last packets in the certain queues. Threshold is a number of packets in a queue that when reached the packets start being dropped. 

The number of QUEUES and THRESHOLDS will depend on the Switch characteristics. Different configurations will be applied accordingly. Refer to the list of devices for details:

Dedicate the BW to each of the queues. Set the VOICE traffic as the single strict priority queue to guarantee a minimum delay, and the WRR scheduling method for the remaining queues to guarantee the bandwidth.


You can check the QoS capabilities such as Ingress/Egress number of Queues, Priority Queues and Thresholds on each interface using the following command:


SW_CISCQUEROS_A21# show interfaces GigabitEthernet 7/1 capabilities 
GigabitEthernet7/1
  Model:                 WS-SUP32-GE-3B
  Type:                  1000BaseSX
  Speed:                 1000
  Duplex:                full
  Trunk encap. type:     802.1Q,ISL
  Trunk mode:            on,off,desirable,nonegotiate
  Channel:               yes
  Broadcast suppression: percentage(0-100)
  Flowcontrol:           rx-(off,on,desired),tx-(off,on,desired)
  Membership:            static
  Fast Start:            yes
  QOS scheduling:        rx-(2q8t), tx-(1p3q8t)
  QOS queueing mode:     rx-(cos), tx-(cos)



Within the LAN Network the best practice would be marking the packets on the INGRESS interfaces, and applying the queuing methods on the EGRESS interfaces towards the upper layer switches. As you can see from the previous example, the given switch with the Supervisor model 32 has 1P3Q8T:

- 1 Priority Queue that will most likely be used for the VOICE traffic)
- 3 Standard Queues where all the other classes of traffic will
- 8 Thresholds for each of the standard queues 

There is another command that can be pretty useful, but it’s supported only on the Switch Models that support the WRR queuing. It shows the Bandwidth allocation per queue, COS values assigned to each queue and some other interface capacities that are not available within the “capabilities” command:

SW_CISCQUEROS_A21#show queueing interface GigabitEthernet 7/1
Interface GigabitEthernet7/1 queueing strategy:  Weighted Round-Robin
  Port QoS is enabled
Trust boundary disabled

  Trust state: trust DSCP
  Extend trust state: not trusted [COS = 0]
  Default COS is 0
    Queueing Mode In Tx direction: mode-cos
    Transmit queues [type = 1p3q8t]:
    Queue Id    Scheduling  Num of thresholds
    -----------------------------------------
       01         WRR                 08
       02         WRR                 08
       03         WRR                 08
       04         Priority            01

    WRR bandwidth ratios:   20[queue 1]  30[queue 2]  35[queue 3] 
    queue-limit ratios:     50[queue 1]  20[queue 2]  15[queue 3]  15[Pri Queue]

  Packets dropped on Transmit:
    BPDU packets:  0

    queue              dropped  [cos-map]
    ---------------------------------------------

    1                        0  [0 2 1 ]
    2                        0  [3 ]
    3                        0  [4 ]
    4                        0  [5 6 7 ]




Please refer to the following examples for details how to configure the QoS.



EXAMPLE 1: 

Switch Model: WS-C3750G-48PS
QoS Egress Capabilities: 4Q2T or 4Q3T (in both cases its actually 4 Queues, 2 configurable Thresholds and 1 non-configurable Threshold)
Supported Queueing Method: SRR

Under the Global Configuration Mode configure the DSCP to CoS mapping:

mls qos map cos-dscp 0 10 18 26 34 46 48 56

Then assign the CoS values into the desired queue and assign the corresponding thresholds:

#the first line assigns the CoS values 5,6 and 7 to the Queue 1, with the Threshold 3 (the non-configurable Threshold)
mls qos srr-queue output cos-map queue 1 threshold 3 5 6 7
mls qos srr-queue output cos-map queue 2 threshold 1 4
mls qos srr-queue output cos-map queue 3 threshold 1 3
mls qos srr-queue output cos-map queue 4 threshold 1 2
mls qos srr-queue output cos-map queue 4 threshold 2 1

#the next line assigns the DSCP values 46 (EF), 48 (CS6) and 56 (CS7) to the Queue 1, with the Threshold 3 (the non-configurable Threshold)
mls qos srr-queue output dscp-map queue 1 threshold 3 46 48 56
mls qos srr-queue output dscp-map queue 2 threshold 1 34 36 38
mls qos srr-queue output dscp-map queue 3 threshold 1 26 0
mls qos srr-queue output dscp-map queue 4 threshold 1 16 18
mls qos srr-queue output dscp-map queue 4 threshold 2 8 10 12 14 

#the next line creates a queue-set for the last queue (queue 4) and defines the 4 drop thresholds to be used by WRED
mls qos queue-set output 1 threshold 4 80 100 100 100

#all the interfaces towards the upper-layer (Distribution or Core) Switches
interface int Gi 1/0/49
 #map the port to the queue-set (previously defined Threshold levels)
 queue-set 1
 # Allocate BW to each queue. Priority queue value is ignored, so put 1.
 srr-queue bandwidth share 1 35 35 20
 #Prevent the VOICE traffic from starving the other BW by limiting it to one third of an entire BandWidth
 srr-queue bandwidth shape 3 0 0 0
 #Next command sets the Queue 1 as the Priority Queue
 priority-queue out



EXAMPLE 2:

Switch Model: WS-C6513, Supervisor: WS-SUP32-GE-3B
QoS Egress Capabilities: 1P3Q8T, 1 Priority Queue, 3 Standard Queues and 8 Thresholds
Supported Queueing Method: WRR

Under the Global Configuration Mode configure the DSCP to CoS mapping:

mls qos map cos-dscp 0 10 18 26 34 46 48 56

#all the interfaces towards the upper-layer (Distribution or Core) Switches
interface GigabitEthernet 8/2

#the first line assigns the CoS values 5,6 and 7 to the Queue 1
 priority-queue cos-map 1 5 6 7
 wrr-queue cos-map 3 1 4
 wrr-queue cos-map 2 1 3
 wrr-queue cos-map 1 1 2 0
 wrr-queue cos-map 1 3 1

#enable the WRED for the standard queues 1 and 3 (this is not the 1 as in the   priority queue, its the 1st of the STANDARD 3 queues)
 wrr-queue random-detect 1
 wrr-queue random-detect 3
 #Allocate BW to each of the 3 standard queues
 wrr-queue bandwidth 20 30 35
 #Define the Threshold Drop values for each of the 3 standard queues
 wrr-queue random-detect max-threshold 1 100 100 100 100 100 100 100 100
 wrr-queue random-detect min-threshold 1 80 100 100 100 100 100 100 100
 wrr-queue random-detect max-threshold 2 100 100 100 100 100 100 100 100
 wrr-queue random-detect min-threshold 2 80 100 100 100 100 100 100 100
 wrr-queue random-detect max-threshold 3 100 100 100 100 100 100 100 100
 wrr-queue random-detect min-threshold 3 80 40 100 100 100 100 100 100

EXAMPLE 3:

Switch Model: WS-C4006
QoS Egress Capabilities: 1P3Q1T, 1 Priority Queue, 3 Standard Queues and 1 Threshold
Supported Queueing Method: MANUAL QUEUES DEFINITION

Under the Global Configuration Mode configure the DSCP to CoS mapping:

qos map cos 0 to dscp 0
qos map cos 1 to dscp 10
qos map cos 2 to dscp 18
qos map cos 3 to dscp 26
qos map cos 4 to dscp 34
qos map cos 5 to dscp 46

Under the Global Configuration Mode map the DSCP one of the 4 Tx-Queues. Note that the queue 3 is the Priority Queue, and the Queue 1 is serviced last.

qos map dscp 46 to tx-queue 3
qos map dscp 34 to tx-queue 4
qos map dscp 26 to tx-queue 2
qos map dscp 18 to tx-queue 2
qos map dscp 0 to tx-queue 2
qos map dscp 10 to tx-queue 1

#all the interfaces towards the upper-layer (Distribution or Core) Switches
interface GigabitEthernet 0/2
#Allocate BW to each of the 4 queues
tx-queue 1
bandwidth 10000000
tx-queue 2
bandwidth 45000000
tx-queue 3
bandwidth 10000000
#define queue 3 as the priority queue, and limit it to 10Mbps (10%)
priority high
shape 10000000
tx-queue 4
bandwidth 35000000
shape 35000000

int Gi 2/13, 2/19
tx-queue 3
no shape
no priority
no bandwidth

EXAMPLE 4: 

Switch Model: WS-C6506, Supervisor: c6sup2_rp
QoS Egress Capabilities: 1P2Q2T, 1 Priority Queue, 2 Standard Queues and 3 Thresholds
Supported Queueing Method: WRR

Under the Global Configuration Mode configure the DSCP to CoS mapping:

mls qos map cos-dscp 0 10 18 26 34 46 48 56

#all the interfaces towards the upper-layer (Distribution or Core) Switches
interface GigabitEthernet 8/2

#assign 50% to each of the standard queues
wrr-queue bandwidth 50 50

#How many packets need to be in the Queue in order for WRED to start dropping, so in this command for queue 1 it will be 70 packets for Threshold 1, and 80 for Threshold 2
wrr-queue random-detect min-threshold 1 70 80
wrr-queue random-detect max-threshold 1 100 100
wrr-queue random-detect min-threshold 2 40 80
wrr-queue random-detect max-threshold 2 100 100
priority-queue cos-map 1 5 6 7
#the next line assigns the CoS value 4 to the Queue 1 and Threshold 1
wrr-queue cos-map 1 1 4
wrr-queue cos-map 1 2 2 3
wrr-queue cos-map 2 1 0
wrr-queue cos-map 2 2 1


EXAMPLE 5

Switch Model: WS-C4503-E (MPC8548), SUPERVISOR 6-E
QoS Egress Capabilities: 1P7Q1T, 1 Priority Queue, 7 Standard Queues and 1 Threshold
Supported Queueing Method: WRR

Cisco models 4500 and 4900 with the Supervisors 6-E and 7-E use the MQC model of QoS Congestion control, and uses the Active queue management (AQM).

*DBL: Active queue management (AQM) is the pro-active approach of informing you about congestion before a buffer overflow occurs. AQM is done using Dynamic buffer limiting (DBL). DBL tracks the queue length for each traffic flow in the switch. When the queue length of a flow exceeds its limit, DBL drop packets or set the Explicit Congestion Notification (ECN) bits in the packet headers.

DBL classifies flows in two categories, adaptive and aggressive. Adaptive flows reduce the rate of packet transmission once it receives congestion notification. Aggressive flows do not take any corrective action in response to congestion notification. For every active flow the switch maintains two parameters, “buffersUsed” and “credits”. All flows start with “max-credits”, a global parameter. When a flow with credits less than “aggressive-credits” (another global parameter) it is considered an aggressive flow and is given a small buffer limit called “aggressiveBufferLimit”

class-map match-any VOICE-QUEUE
match dscp ef
match dscp cs5
class-map match-any CONTROL-MGMT-QUEUE
match dscp cs7
match dscp cs6
class-map match-all VIDEO-QUEUE
match dscp af41 af42 af43
class-map match-all CRITICAL-DATA-QUEUE
match dscp af31 af32 af33
class-map match-all BUSINESS-QUEUE
match dscp af21 af22 af23
class-map match-all BULK-DATA-QUEUE
match dscp 0
class-map match-all SCAVENGER-QUEUE
match dscp cs1
match dscp af11

policy-map 1P7Q1T
class VOICE-QUEUE
 priority
class CONTROL-MGMT-QUEUE
 bandwidth remaining percent 5
class VIDEO-QUEUE
 bandwidth remaining percent 20
class CRITICAL-DATA-QUEUE
 bandwidth remaining percent 20
class BUSINESS-QUEUE
 bandwidth remaining percent 20
 dbl
class SCAVENGER-QUEUE
 bandwidth remaining percent 5
class BULK-DATA-QUEUE
 bandwidth remaining percent 10
 dbl
class class-default
 bandwidth remaining percent 10
 dbl

#all the interfaces towards the upper-layer (Distribution or Core) Switches
interface range GigabitEthernet 3/4
service-policy output 1P7Q1T

No comments:

Post a Comment

Most Popular Posts