Sunday, December 21, 2008

3560 SHARED/SHAPED ROUND ROBIN QUEUEING


In 3560 switches   WRR scheduler is replaced with SRR.  SRR is a scheduling service for specifying the rate at which packets are dequeued. With SRR there are two modes, Shaped and Shared (default). Shaped mode is only available on the egress queues. Shaped egress queues reserve a set of port bandwidth and then send evenly spaced packets as per the reservation. In Shared mode, if a higher priority queue is empty, instead of the servicer waiting for that reserved bandwidth to expire, the lower priority queue can take the unused bandwidth. Shared SRR is used when one wants to get the maximum efficiency out of a queuing system, because unused queue slots can be used by queues with excess traffic. Shaped SRR is used when one wants to shape a queue or set a hard limit on how much bandwidth a queue can use. When one uses Shaped SRR one can shape queues within a ports overall shaped rate. SRR shaped mode always take preference over SRR shared weights. The  port rate-limit feature of  SRR  limits the total port bandwidth to a percentage of port  speed  from 10% to 90%. 








Configuring SRR shared & shaped dequeing.

 

sw3(config)#int fastEthernet 0/1 

sw3(config-if)#srr-queue bandwidth shape 10 10 0 0 

sw3(config-if)#srr-queue bandwidth share 10 20 40 30

 

Configuring priority queueing in 3560 ports. 

sw3(config)#int fastEthernet 0/1 

sw3(config-if)#priority-queue out

 

The weight assigned to the priority queue is simply ignored for SRR calculations. Unlike the 3550, on the 3560, egress priority queue has queue-id 1, not 4. 

In 3560 switches four egress queues are there , in that the 1st queue will be  the expedite queue. Each of these queues will have 3 threshold values known as explicit drop thresholds . First 2 explicit drop thresholds are configurable the 3rd threshold represents 100% state / fixed state . 

Configuring egress queues

 

Mapping COS values to 4 queues

 

In the following example Q   Queue 1 is configured with 3 thresholds , COS values 2 & 3 are mapped to threshold 1 of queue 1  , COS value 5 is mapped to threshold 2 of queue 1  and COS value 0 is  mapped to threshold 3 of queue 1 . 

Queue 2 is configured with 3rd   threshold (100%) & COS value 1 is mapped to this. Queue 3 is configured with 2nd   threshold  & COS value 6 is mapped to this.

Queue 4 is configured with 1st    threshold  & COS value 7 is mapped to this.

 

sw3(config)#mls qos srr-queue output cos-map queue 1 threshold 1 2 3 

sw3(config)#mls qos srr-queue output cos-map queue 1 threshold 2 5 

sw3(config)#mls qos srr-queue output cos-map queue 1 threshold 3 0 

sw3(config)#mls qos srr-queue output cos-map queue 2 threshold 3 1 

sw3(config)#mls qos srr-queue output cos-map queue 3 threshold 2 6 

sw3(config)#mls qos srr-queue output cos-map queue 4 threshold 1 7 

 

Mapping DSCP values to 4 queues 

 In this dscp values 0 to 7 are mapped to queue 1 threshold 1 , dscp values 8 to 12 are mapped to queue 1 threshold 2  , dscp values 13 to 16 are mapped to queue 1 threshold 3 . 

dscp values 17 to 40 are mapped to queue 2 threshold 3 ,  dscp values 41 to 56 are mapped to queue 3 threshold 2 , dscp values 57 to 63 are mapped to queue 4 threshold 1 .

 

sw3(config)#mls qos srr-queue output dscp-map queue 1 threshold 1 0 1 2 3 4 5 6 7 

sw3(config)#mls qos srr-queue output dscp-map queue 1 threshold 2 8 9 10 11 12 

sw3(config)#mls qos srr-queue output dscp-map queue 1 threshold 3 13 14 15 16 

sw3(config)#mls qos srr-queue output dscp-map queue 2 threshold 3 17 18 19 20 21 22 23 24 

sw3(config)#mls qos srr-queue output dscp-map queue 2 threshold 3 25 26 27 28 29 30 31 32 

sw3(config)#mls qos srr-queue output dscp-map queue 2 threshold 3 33 34 35 36 37 38 39 40 

sw3(config)#mls qos srr-queue output dscp-map queue 3 threshold 2 41 42 43 44 45 46 47 48 

sw3(config)#mls qos srr-queue output dscp-map queue 3 threshold 2 49 50 51 52 53 54 55 56 

sw3(config)#mls qos srr-queue output dscp-map queue 4 threshold 1 57 58 59 60 61 62 63 

Buffer allocation in egress queues.

 

By using a queue-set you can do buffer allocation in egress queues , only 2 queue sets can be configured in a 3560 switch .

  

sw3(config)#mls qos queue-set output 1 buffers 10 20 30 40 

sw3(config)#int fa 0/2 

sw3(config-if)#queue-set 1

 

Ingress Queues 

    In 3560 switches 2 ingress queues can be configured & any of them can be configures as priority queue & up to 40% of bandwidth can be reserved for this. By default queue 2 is the priority queue.

 

sw3(config)#mls qos srr-queue input priority-queue 1 bandwidth 20 

Bandwidth configuration of input queues can be done in the following way .     

sw3(config)#mls qos srr-queue input bandwidth 30 70 

The buffer allocation to each of the input queues can also be changed . 

sw3(config)#mls qos srr-queue input buffers 35 65 

 

In the following example cos mapping is done for input srr queues.  COS values 0 , 1 & 2 are mapped to queue 1 threshold 1 , COS values 3 is  mapped to queue 1 threshold 2 , COS values 4 is  mapped to queue 1 threshold 3 , & finally COS values 5 , 6 & 7 are mapped to queue 2 threshold 1 . 

 

sw3(config)#mls qos srr-queue input cos-map queue 1 threshold 1 0 1 2 

sw3(config)#mls qos srr-queue input cos-map queue 1 threshold 2 3 

sw3(config)#mls qos srr-queue input cos-map queue 1 threshold 3 4 

sw3(config)#mls qos srr-queue input cos-map queue 2 threshold 1 5 6 7

 

 

In the following example dscp  mapping is done for input srr queues DSCP values 0-7 are mapped to queue 1 with a threshold of 1 , DSCP values 8-15  are mapped to queue 1 with a threshold of 2 , rest of the DSCP values are mapped to queue 2 with a threshold of 2.

 

sw3(config)#mls qos srr-queue input dscp-map queue 1 threshold 1 0 1 2 3 4 5 6 7 

sw3(config)#mls qos srr-queue input dscp-map queue 1 threshold  2 8 9 10 11 12 13 14 15 

sw3(config)#mls qos srr-queue input dscp-map queue 2  threshold  2 16 17 18 19 20 21 22 23 

sw3(config)#mls qos srr-queue input dscp-map queue 2 threshold  2 24 25 26 27 28 29 30 31 

sw3(config)#mls qos srr-queue input dscp-map queue 2 threshold  2 32 33 34 35 36 37 38 39 

sw3(config)#mls qos srr-queue input dscp-map queue 2 threshold  2 40 41 42 43 44 45 46 47 

sw3(config)#mls qos srr-queue input dscp-map queue 2 threshold  2 48 49 50 51 52 53 54 55 

sw3(config)#mls qos srr-queue input dscp-map queue 2 threshold  2 56 57 58 59 60 61 62 63

 

 

Verification commands: 

sw3#sh mls qos input-queue

sw3#sh mls qos interface fastEthernet 0/1 

sw3#sh mls qos queue-set 1