Skip to content
Surf Wiki
Save to docs
technology/algorithms

From Surf Wiki (app.surf) — the open knowledge base

Deficit round robin

Scheduling algorithm for the network scheduler


Scheduling algorithm for the network scheduler

Deficit Round Robin (DRR), also Deficit Weighted Round Robin (DWRR), is a scheduling algorithm for the network scheduler. DRR is, similar to weighted fair queuing (WFQ), a packet-based implementation of the ideal Generalized Processor Sharing (GPS) policy. It was proposed by M. Shreedhar and G. Varghese in 1995 as an efficient (with O(1) complexity) and fair algorithm.

Details

In DRR, a scheduler handling N flows is configured with one quantum Q_i for each flow. This global idea is that, at each round, the flow i can send at most Q_i bytes, and the remaining, if any, is reported to the next round. In this way, the minimum rate that flow i will achieve over a long term is \frac{Q_i}{(Q_1+Q_2+...+Q_N)}R; where R is the link rate.

Algorithm

The DRR scans all non-empty queues in sequence. When a non-empty queue i is selected, its deficit counter is incremented by its quantum value. Then, the value of the deficit counter is a maximal number of bytes that can be sent at this turn: if the deficit counter is greater than the packet's size at the head of the queue (HoQ), this packet can be sent, and the value of the counter is decremented by the packet size. Then, the size of the next packet is compared to the counter value, etc. Once the queue is empty or the value of the counter is insufficient, the scheduler will skip to the next queue. If the queue is empty, the value of the deficit counter is reset to 0.

Variables and Constants const integer N // Nb of queues const integer Q[1..N] // Per queue quantum integer DC[1..N] // Per queue deficit counter queue queue[1..N] // The queues

Scheduling Loop while true do for i in 1..N do if not queue[i].empty() then DC[i]:= DC[i] + Q[i] while( not queue[i].empty() and DC[i] ≥ queue[i].head().size() ) do DC[i] := DC[i] − queue[i].head().size() send( queue[i].head() ) queue[i].dequeue() end while if queue[i].empty() then DC[i] := 0 end if end if end for end while

Performances: fairness, complexity, and latency

Like other GPS-like scheduling algorithm, the choice of the weights is left to the network administrator.

Like WFQ, DRR offers a minimal rate to each flow whatever the size of the packets is. In weighted round robin scheduling, the fraction of bandwidth used depend on the packet's sizes.

Compared with WFQ scheduler that has complexity of O(log(n)) (n is the number of active flows/queues), the complexity of DRR is O(1), if the quantum Q_i is larger than the maximum packet size of this flow. Nevertheless, this efficiency has a cost: the latency, i.e., the distance to the ideal GPS, is larger in DRR than in WFQ. More on the worst-case latencies can be found here.

Implementations

An implementation of the deficit round robin algorithm was written by Patrick McHardy for the Linux kernel and published under the GNU General Public License.

In Cisco and Juniper routers, modified versions of DRR are implemented: since the latency of DRR can be larger for some class of traffic, these modified versions give higher priority to some queues, whereas the others are served with the standard DRR algorithm.{{cite journal | url-access= subscription

Notes

References

References

  1. Shreedhar, M.. (October 1995). "Efficient fair queueing using deficit round robin". ACM SIGCOMM Computer Communication Review.
  2. (2002). "IEEE 2002 Tenth IEEE International Workshop on Quality of Service (Cat. No.02EX564)".
  3. (May 2021). "2021 IEEE 27th Real-Time and Embedded Technology and Applications Symposium (RTAS)". IEEE.
  4. "DRR Linux kernel network scheduler module". [[kernel.org]].
Info: Wikipedia Source

This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page.

Want to explore this topic further?

Ask Mako anything about Deficit round robin — get instant answers, deeper analysis, and related topics.

Research with Mako

Free with your Surf account

Content sourced from Wikipedia, available under CC BY-SA 4.0.

This content may have been generated or modified by AI. CloudSurf Software LLC is not responsible for the accuracy, completeness, or reliability of AI-generated content. Always verify important information from primary sources.

Report