May 13, 2009

WRR(Weighted Round Robin) vs SRR(Shared/Shaped Round Robin)

在舊版的QoS 2.2中只有提到WRR(Weighted Round Robin),但是在實務中,SRR已經漸漸在愈來愈多的Switch平台中使用,其中WRR與SRR最大的差別就是在於它們同時使用權重但是Scheduling的方式不同。

以下圖而言(暫不考慮Strict Priority Queue),如果是用WRR的話,Queue 3的權重為4,所以每一輪都可以同時送出4個封包;Queue 2的權重為2,所以每一輪都可以同時送出2個封包;Queue 1的權重為1,所以每一次都可以同時送出1個封包。

如果是用SRR(Shared or Shaped Round Robin)的話,Queue 3的權重為4,Queue 2的權重為2,Queue 1的權重為1。因此Q3,Q2,Q1各出1個封包,接著Q3,Q2各出1個封包,再接著Q3出2個封包,這樣子才算是一輪。

所以SRR的好處在於每一個Queue很平均地送出封包前後穿插進入FIFO Queue(Hardware Queue),而不是像WRR那樣一次出清每個Queue權重所佔比例數量的封包,這樣子下來的結果會讓不同Queue中的封包排程更加smooth,不會互相排擠。

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.

Shared egress queues are also guaranteed a configured share of bandwidth, but do not reserve the bandwidth. That is, 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.

Neither Shaped SRR nor Shared SRR is better than the other. 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. This is not possible in a standard Weighted Round Robin (WRR). 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.

As stated earlier, SRR differs from WRR. With WRR, queues are serviced based on the weight. Q1 is serviced for Weight 1 period of time, Q2 is served for Weight 2 period of time, and so forth. The servicing mechanism works by moving from queue to queue and services them for the weighted amount of time.

With SRR weights are still followed; however, SRR services the Q1, moves to Q2, then Q3 and Q4 in a different way. It doesn't wait at and service each queue for a weighted amount of time before moving on to the next queue. Instead, SRR makes several rapid passes at the queues, in each pass, each queue may or may not be serviced. For each given pass, the more highly weighted queues are more likely to be serviced than the lower priority queues. Over a given time, the number of packets serviced from each queue is the same for SRR and WRR. However, the ordering is different.

With SRR, traffic has a more evenly distributed ordering.
With WRR one sees a bunch of packets from Q1 and then a bunch of packets from Q2, etc. With SRR one sees a weighted interleaving of packets.

SRR is an evolution of WRR that protects against overwhelming buffers with huge bursts of traffic by using a smoother round-robin mechanism.

Reference URL:

On your queuing thoughts there: WRR, or weighted round robin, is the method that 3550s use to allocate and manage the hardware queues on interfaces. SRR (which can mean shared round robin or shaped round robin, depending on what commands you use) is the method that a 3560 uses for the same management.

There are some important differences when it comes to allocation and how things are configured! In the WRR system, things are linear in their logic. By default:

Queue 1 serves CoS values 0 and 1
Queue 2 serves CoS values 2 and 3
Queue 3 serves CoS values 4 and 5
Queue 4 serves CoS values 6 and 7

Queue 4 may be set up as a strict priority queue. Numerically, this makes sense; operationally, it doesn't really!

On the 3560, things default to a more operational logic:

Queue 1 serves CoS value 5
Queue 2 serves CoS values 0 and 1
Queue 3 serves CoS values 2 and 3
Queue 4 serves CoS values 4, 6 and 7

Queue 1 may be set up as a strict priority queue. Operationally, this makes much more sense. Numerically, it does not!


Scott Morris, quadruple CCIE, JNCIE and all-around uber-geek, can often be seen traveling around the world consulting and delivering CCIE training. He recently accepted a new Senior CCIE Instructor position with Internetwork Expert! For more information on him check out or for CCIE training check out You can contact Scott via You can contact Scott about "What's the Deal with Cisco 3560 Switches? " at

Reference URL:
Post a Comment