Deficit Round Robin
   HOME

TheInfoList



OR:

Deficit Round Robin (DRR), also Deficit Weighted Round Robin (DWRR), is a scheduling algorithm for the
network scheduler A network scheduler, also called packet scheduler, queueing discipline (qdisc) or queueing algorithm, is an arbiter on a node in a packet switching communication network. It manages the sequence of network packets in the transmit and receive ...
. DRR is, similar to
weighted fair queuing Weighted fair queueing (WFQ) is a network scheduling algorithm. WFQ is both a packet-based implementation of the generalized processor sharing (GPS) policy, and a natural extension of fair queuing (FQ). Whereas FQ shares the link's capacity i ...
(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 \fracR; 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 ..N // Per queue quantum integer DC ..N // Per queue deficit counter queue queue ..N // The queues ''Scheduling Loop'' while true do for i in 1..N do if not queue empty() then DC = DC + Q while( not queue empty() and DC ≥ queue head().size() ) do DC := DC − queue head().size() send( queue head() ) queue dequeue() end while if queue empty() then DC := 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 The Linux kernel is a Free and open-source software, free and open source Unix-like kernel (operating system), kernel that is used in many computer systems worldwide. The kernel was created by Linus Torvalds in 1991 and was soon adopted as the k ...
and published under the
GNU General Public License The GNU General Public Licenses (GNU GPL or simply GPL) are a series of widely used free software licenses, or ''copyleft'' licenses, that guarantee end users the freedom to run, study, share, or modify the software. The GPL was the first ...
. 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.


See also

*
Scheduling algorithm In computing, scheduling is the action of assigning resources to perform tasks. The resources may be processors, network links or expansion cards. The tasks may be threads, processes or data flows. The scheduling activity is carried out by ...
*
Fair Queuing Fair queuing is a family of scheduling algorithms used in some process and network schedulers. The algorithm is designed to achieve fairness when a limited resource is shared, for example to prevent flows with large packets or processes that gen ...
* Generalized processor sharing *
Weighted Fair Queuing Weighted fair queueing (WFQ) is a network scheduling algorithm. WFQ is both a packet-based implementation of the generalized processor sharing (GPS) policy, and a natural extension of fair queuing (FQ). Whereas FQ shares the link's capacity i ...
*
Weighted round robin Weighted round robin (WRR) is a network scheduler for data flows, but also used to schedule processes. Weighted round robin is a generalisation of round-robin scheduling. It serves a set of queues or tasks. Whereas round-robin cycles over the q ...
*
Fairness measure Fairness measures or metrics are used in network engineering to determine whether users or applications are receiving a fair share of system resources. There are several mathematical and conceptual definitions of fairness. Transmission Control Pr ...


Notes


References


External links


UC Berkeley EE122 lecture: Efficient fair queueing using deficit round robin
{{DEFAULTSORT:Deficit Round Robin Network scheduling algorithms