Description

This KB article explains the working of Shaped Deficit Weighted Round Robin (SDWRR) algorithm on Class of Service in JUNOS. It explains in two parts, one the default behavior without any transmit-rates configured and the second in which the algorithm works for a given transmit rate configuration.

Symptoms


Solution

By default, without any transmit-rate configuration, the SDWRR services the queues based on their priority from Q7 to Q0 where Q7 belongs to network-control forwarding class and Q0 for best-effort traffic.

When transmit-rates are configured either as BPS or as a PERCENTAGE,each queue in the Class of Service configuration will be internally serviced by their ratio of their transmit rate value configured either in BPS or in PERCENT, to the available output bandwidth. This is how the shaped deficit weighted round robin (SDWRR) algorithm is implemented internally in JUNOS.
  1.  All the queues are serviced based on Weighted Round Robin algorithm other than the ones configured with Strict Priority.
  2.  The weights are calculated as the ratio of the transmit rates configured (either as bps or percentage)
  3.  If the transmit-rates are configured in bps, then a minimum value that is allowed to be configured is 10Mbps since any value less than 10Mbps will be considered as 0 in SDWRR calculation and that (or those) queue(s) will be serviced in order its priority without a minimum guaranteed bandwidth.
  4.  For example if the transmit-rates are configured as 30M 30M, 10M, 10M,20M, 20M, SP, SP (Strict priority) from q0 to q7 respectively.
  5. The weights corresponding to these values are in the ratio of 3:3:1:1:2:2:SP:SP of the available output bandwidth
  6. If the input rate is 14Mbps with 2Mbps on each queue and the output shaping rate is 10Mbps, then q6 and q7 will take 4Mbps of output bandwidth since those two queues are treated as strict priority queues and get unlimited share from the available 14Mbps of output bandwidth.
  7. The remaining 6 Mbps will be shared among the remaining queues based on their ratio. So the minimum bandwidth guaranteed for each queue will be 1.5M:1.5M:0.5M:0.5M:1M:1M:2M:2M
Let's assume that the transmit-rates for each of the seven queues are configured as displayed below.

schedulers {

Q-Seven {
priority strict-high;
}
Q-Six {
priority strict-high;
}
Q-Five {
transmit-rate 20m;
}
Q-Four {
transmit-rate 20m;
}
Q-Three {
transmit-rate 10m;
}
Q-Two {
transmit-rate 10m;
}
Q-One {
transmit-rate 30m;
}
Q-Zero {
transmit-rate 30m;
}

}

Note: Please remember when configuring transmit-rate as in BPS since the face values of the transmit-rate are not the guaranteed bandwidth. Instead the guaranteed bandwidth is actually calculated as a ratio of these values to the available output bandwidth. So it is recommended to configure transmit-rates as percentage to avoid any confustion.