One of the most confusing topics that i have read in my CCIE studies is 3560 Queuing and Scheduling.In 3550 queues are interface based however in 3560 queues are chassis based.

Because the total inbound bandwidth of all ports can exceed the bandwidth of the internal ring, ingress queues are located after the packet is classified, policed, and marked and before packets are forwarded into the switch fabric. Because multiple ingress ports can simultaneously send packets to an egress port and cause congestion, outbound queues are located after the internal ring.

In 3560 we have 2 input queues as shown in the diagram and 4 output queues per interface.Input queues are configured in global mode  by “mls qos srr-queue input [try ?]” .Only mapping DSCP or COS values to an egress queue and to a threshold id can be done in global config mode by “mls qos srr-queue output [try ?]” rest Egress queues can be configured under interface mode.

3560 has four hardware queues per interface and per queue has 3 threshold .Expedite Queue can be configured in Q1. Resulting in 4Q1P3T.Although by default.

COS 5 -> Queue 1
COS 0 -> Queue 2
COS 2/3 -> Queue 3
COS 4/5/6 -> Queue 4

Weighted Tail Drop

Both the ingress and egress queues use an enhanced version of the tail-drop congestion-avoidance mechanism called weighted tail drop (WTD). WTD is implemented on queues to manage the queue lengths and to provide drop precedences for different traffic classifications.

Each queue has three threshold values. The QOS label  determines which of the three threshold values is subjected to the frame. Of the three thresholds, two are configurable (explicit) and one is not (implicit).

Configuring Ingress Queue Characteristics:-

Mapping DSCP or CoS Values to an Ingress Queue and Setting WTD Thresholds

We can prioritize traffic by placing packets with particular DSCPs or CoSs into certain queues and adjusting the queue thresholds so that packets with lower priorities are dropped.

This example shows how to map DSCP values 0 to 6 to ingress queue 1 and to threshold 1 with a drop threshold of 50 percent. It maps DSCP values 20 to 26 to ingress queue 1 and to threshold 2 with a drop threshold of 70 percent:

Switch(config)# mls qos srr-queue input dscp-map queue 1 threshold 1 0 1 2 3 4 5 6
Switch(config)# mls qos srr-queue input dscp-map queue 1 threshold 2 20 21 22 23 24 25 26
Switch(config)# mls qos srr-queue input threshold 1 50 70

In this example, the DSCP values (0 to 6) are assigned the WTD threshold of 50 percent means that after filling 50% of the queue 1 threshold the packet will start dropping and will be dropped sooner than the DSCP values (20 to 26) assigned to the WTD threshold of 70 percent means the packets are not dropped till the queue 1 reaches 70% of threshold.

Allocating Buffer Space Between the Ingress Queues

We define the ratio (allocate the amount of space) with which to divide the ingress buffers between the two queues. The buffer and the bandwidth allocation control how much data can be buffered before packets are dropped.

This example shows how to allocate 60 percent of the buffer space to ingress queue 1 and 40 percent of the buffer space to ingress queue 2:

Switch(config)# mls qos srr-queue input buffers 60 40

Allocating Bandwidth Between the Ingress Queues

We need to specify how much of the available bandwidth is allocated between the ingress queues. The ratio of the weights is the ratio of the frequency in which the SRR scheduler sends packets from each queue. The bandwidth and the buffer allocation control how much data can be buffered before packets are dropped. On ingress queues, SRR operates only in shared mode.

This example shows how to assign the ingress bandwidth to the queues. Priority queueing is disabled, and the shared bandwidth ratio allocated to queue 1 is 25/(25+75) and to queue 2 is 75/(25+75):

Switch(config)# mls qos srr-queue input priority-queue 2 bandwidth 0
Switch(config)# mls qos srr-queue input bandwidth 25 75

Configuring the Ingress Priority Queue

We should use the priority queue only for traffic that needs to be expedited (for example, voice traffic, which needs minimum delay and jitter).

This example shows how to assign the ingress bandwidths to the queues. Queue 1 is the priority queue with 10 percent of the bandwidth allocated to it. The bandwidth ratios allocated to queues 1 and 2 is 4/(4+4). SRR services queue 1 (the priority queue) first for its configured 10 percent bandwidth. Then SRR equally shares the remaining 90 percent of the bandwidth between queues 1 and 2 by allocating 45 percent to each queue:

Switch(config)# mls qos srr-queue input priority-queue 1 bandwidth 10
Switch(config)# mls qos srr-queue input bandwidth 4 4

Configuring Egress Queue Characteristics:-

Allocating Buffer Space to and Setting WTD Thresholds for an Egress Queue-Set

This example shows how to map a port to queue-set 2. It allocates 40 percent of the buffer space to egress queue 1 and 20 percent to egress queues 2, 3, and 4. It configures the drop thresholds for queue 2 to 40 and 60 percent of the allocated memory, guarantees (reserves) 100 percent of the allocated memory, and configures 200 percent as the maximum memory that this queue can have before packets are dropped:

Switch(config)# mls qos queue-set output 2 buffers 40 20 20 20
Switch(config)# mls qos queue-set output 2 threshold 2 40 60 100 200
Switch(config)# interface gigabitethernet0/1
Switch(config-if)# queue-set 2

Mapping DSCP or CoS Values to an Egress Queue and to a Threshold ID

We can prioritize traffic by placing packets with particular DSCPs or costs of service into certain queues and adjusting the queue thresholds so that packets with lower priorities are dropped.

This example shows how to map DSCP values 10 and 11 to egress queue 1 and to threshold 2:

Switch(config)# mls qos srr-queue output dscp-map queue 1 threshold 2 10 11

Configuring SRR Shaped Weights on Egress Queues

We can specify how much of the available bandwidth is allocated to each queue. The ratio of the weights is the ratio of frequency in which the SRR scheduler sends packets from each queue.

This example shows how to configure bandwidth shaping on queue 1. Because the weight ratios for queues 2, 3, and 4 are set to 0, these queues operate in shared mode. The bandwidth weight for queue 1 is 1/8, which is 12.5 percent:

Switch(config)# interface gigabitethernet0/1
Switch(config-if)# srr-queue bandwidth shape 8 0 0 0

Configuring SRR Shared Weights on Egress Queues

In shared mode, the queues share the bandwidth among them according to the configured weights. The bandwidth is guaranteed at this level but not limited to it. For example, if a queue empties and does not require a share of the link, the remaining queues can expand into the unused bandwidth and share it among them. With sharing, the ratio of the weights controls the frequency of dequeuing; the absolute values are meaningless.

This example shows how to configure the weight ratio of the SRR scheduler running on an egress port. Four queues are used, and the bandwidth ratio allocated for each queue in shared mode is 1/(1+2+3+4), 2/(1+2+3+4), 3/(1+2+3+4), and 4/(1+2+3+4), which is 10 percent, 20 percent, 30 percent, and 40 percent for queues 1, 2, 3, and 4. This means that queue 4 has four times the bandwidth of queue 1, twice the bandwidth of queue 2, and one-and-a-third times the bandwidth of queue 3.

Switch(config)# interface gigabitethernet0/1
Switch(config-if)# srr-queue bandwidth share 1 2 3 4

Configuring the Egress Expedite Queue

We can ensure that certain packets have priority over all others by queuing them in the egress expedite queue. SRR services this queue until it is empty before servicing the other queues.

This example shows how to enable the egress expedite queue when the SRR weights are configured. The egress expedite queue overrides the configured SRR weights.

Switch(config)# interface gigabitethernet0/1
Switch(config-if)# srr-queue bandwidth shape 25 0 0 0 
Switch(config-if)# srr-queue bandwidth share 30 20 25 25 
Switch(config-if)# priority-queue out 
Switch(config-if)# end 

Limiting the Bandwidth on an Egress Interface

We can limit the bandwidth on an egress port. For example, if a customer pays only for a small percentage of a high-speed link, we can limit the bandwidth to that amount.

This example shows how to limit the bandwidth on a port to 80 percent:

Switch(config)# interface gigabitethernet0/1
Switch(config-if)# srr-queue bandwidth limit 80

Default Ingress Queue Configuration

Table 1 shows the default ingress queue configuration when QoS is enabled.

Table 1 Default Ingress Queue Configuration

Feature

Queue 1

Queue 2
Buffer allocation 90 percent 10 percent
Bandwidth allocation 1 4 4
Priority queue bandwidth 2 0 10
WTD drop threshold 1 100 percent 100 percent
WTD drop threshold 2 100 percent 100 percent
1 The bandwidth is equally shared between the queues. SRR sends packets in shared mode only.2 Queue 2 is the priority queue. SRR services the priority queue for its configured share before servicing the other queue.

Table 2 shows the default CoS input queue threshold map when QoS is enabled.

cos-input-q for L2-based marking queue.Shown by “sh mls qos map cos-inout-q”. Can be modified with

put COS 1 to Q1T2
mls qos srr-queue input cos-map queue 1 threshold 2 1

Table 2 Default CoS Input Queue Threshold Map

CoS Value

Queue ID-Threshold ID
0-4 1-1
5 2-1
6, 7 1-1

Table 3 shows the default DSCP input queue threshold map when QoS is enabled.

dscp-input-q for L3-based marking queue. Shown by “sh mls qos map dscp-input-q”. Can be modified by

put DSCP decimal 32 to Q2T3
mls qos srr-queue input dscp-map queue 1 threshold 3 32

Table 3 Default DSCP Input Queue Threshold Map

DSCP Value

Queue ID-Threshold ID
0-39 1-1
40-47 2-1
48-63 1-1

Default Egress Queue Configuration

Table 4 shows the default egress queue configuration for each queue-set when QoS is enabled. All ports are mapped to queue-set 1. The port bandwidth limit is set to 100 percent and rate unlimited.

Table 4 Default Egress Queue Configuration

Feature

Queue 1

Queue 2

Queue 3

Queue 4
Buffer allocation 25 percent 25 percent 25 percent 25 percent
WTD drop threshold 1 100 percent 200 percent 100 percent 100 percent
WTD drop threshold 2 100 percent 200 percent 100 percent 100 percent
Reserved threshold 50 percent 50 percent 50 percent 50 percent
Maximum threshold 400 percent 400 percent 400 percent 400 percent
SRR shaped weights (absolute) 1 25 0 0 0
SRR shared weights 2 25 25 25 25
1 A shaped weight of zero means that this queue is operating in shared mode.2 One quarter of the bandwidth is allocated to each queue.

Table 5 shows the default CoS output queue threshold map when QoS is enabled.

Table 5 Default CoS Output Queue Threshold Map

CoS Value

Queue ID-Threshold ID
0, 1 2-1
2, 3 3-1
4 4-1
5 1-1
6, 7 4-1

Table 6 shows the default DSCP output queue threshold map when QoS is enabled.

Table 6 Default DSCP Output Queue Threshold Map

DSCP Value

Queue ID-Threshold ID
0-15 2-1
16-31 3-1
32-39 4-1
40-47 1-1
48-63 4-1
As defaults are already set for proper functioning of ASICs for QoS Queuing, we only need to alter configurations of queues when we need to change something according to our need in hardware processing within 3560.