Weighted round robin

Last updated

Weighted round robin (WRR) is a network scheduler for data flows, but also used to schedule processes.

Contents

Weighted round robin [1] is a generalisation of round-robin scheduling. It serves a set of queues or tasks. Whereas round-robin cycles over the queues or tasks and gives one service opportunity per cycle, weighted round robin offers to each a fixed number of opportunities, as specified by the configured weight which serves to influence the portion of capacity received by each queue or task. In computer networks, a service opportunity is the emission of one packet, if the selected queue is non-empty.

If all packets have the same size, WRR is the simplest approximation of generalized processor sharing (GPS). Several variations of WRR exist. [2] The main ones are the classical WRR, and the interleaved WRR.

Algorithm

Principles

WRR is presented in the following as a network scheduler. It can also be used to schedule tasks in a similar way.

A weighted round-robin network scheduler has input queues, . To each queue is associated , a positive integer, called the weight. The WRR scheduler has a cyclic behavior. In each cycle, each queue has emissions opportunities.

The different WRR algorithms differ on the distributions of these opportunities in the cycle.

Classical WRR

In classical WRR [2] [3] [4] the scheduler cycles over the queues. When a queue is selected, the scheduler will send packets, up to the emission of packet or the end of queue.

Constant and variables:      const N             // Nb of queues      const weight[1..N]  // weight of each queue     queues[1..N]        // queues     i                   // queue index     c                   // packet counter      Instructions:while true dofor i in 1 .. N do         c := 0         while (not queue[i].empty) and (c<weight[i]) do             send(queue[i].head())             queue[i].dequeue()             c:= c+1

Interleaved WRR

Let , be the maximum weight. In IWRR, [1] [5] each cycle is split into rounds. A queue with weight can emit one packet at round only if .

Constant and variables:      const N             // Nb of queues      const weight[1..N]  // weight of each queue     const w_max     queues[1..N]        // queues     i                   // queue index     r                   // round counter      Instructions:
while true dofor r in 1 .. w_max dofor i in 1 .. N doif (not queue[i].empty) and (weight[i] >= r) then                 send(queue[i].head())                 queue[i].dequeue()

Example

Example of scheduling for CWRR and IWRR WRR-Examples.svg
Example of scheduling for CWRR and IWRR

Consider a system with three queues and respective weights . Consider a situation where they are 7 packets in the first queue, A,B,C,D,E,F,G, 3 in the second queue, U,V,W and 2 in the third queue X,Y. Assume that there is no more packet arrival.

With classical WRR, in the first cycle, the scheduler first selects and transmits the five packets at head of queue,A,B,C,D,E (since ), then it selects the second queue, , and transmits the two packets at head of queue, U,V (since ), and last it selects the third queue, which has a weight equals to 3 but only two packets, so it transmits X,Y. Immediately after the end of transmission of Y, the second cycle starts, and F,G from are transmitted, followed by W from .

With interleaved WRR, the first cycle is split into 5 rounds (since ). In the first one (r=1), one packet from each queue is sent (A,U,X), in the second round (r=2), another packet from each queue is also sent (B,V,Y), in the third round (r=3), only queues are allowed to send a packet (, and ), but since is empty, only C from is sent, and in the fourth and fifth rounds, only D,E from are sent. Then starts the second cycle, where F,W,G are sent.

Task scheduling

Task or process scheduling can be done in WRR in a way similar to packet scheduling: when considering a set of active tasks, they are scheduled in a cyclic way, each task gets quantum or slice of processor time . [6] [7]

Properties

Like round-robin, weighted round robin scheduling is simple, easy to implement, work conserving and starvation-free.

When scheduling packets, if all packets have the same size, then WRR and IWRR are an approximation of Generalized processor sharing: [8] a queue will receive a long term part of the bandwidth equals to (if all queues are active) while GPS serves infinitesimal amounts of data from each nonempty queue and offer this part on any interval.

If the queues have packets of variable length, the part of the bandwidth received by each queue depends not only on the weights but also of the packets sizes.

If a mean packets size is known for every queue , each queue will receive a long term part of the bandwidth equals to . If the objective is to give to each queue a portion of link capacity (with ), one may set .

Since IWRR has smaller per class bursts than WRR, it implies smaller worst-case delays. [9]

Limitations and improvements

WRR for network packet scheduling was first proposed by Katevenis, Sidiropoulos and Courcoubetis in 1991, [1] specifically for scheduling in ATM networks using fixed-size packets (cells). The primary limitation of weighted round-robin queuing is that it provides the correct percentage of bandwidth to each service class only if all the packets in all the queues are the same size or when the mean packet size is known in advance. In the more general case of IP networks with variable size packets, to approximate GPS the weight factors must be adjusted based on the packet size. That requires estimation of the average packet size, which makes a good GPS approximation hard to achieve in practice with WRR. [1]

Deficit round robin is a later variation of WRR that achieves better GPS approximation without knowing the mean packet size of each connection in advance. More effective scheduling disciplines were also introduced which handle the limitations mentioned above (e.g. weighted fair queuing).

See also

Related Research Articles

Network throughput refers to the rate of message delivery over a communication channel, such as Ethernet or packet radio, in a communication network. The data that these messages contain may be delivered over physical or logical links, or through network nodes. Throughput is usually measured in bits per second, and sometimes in data packets per second or data packets per time slot.

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.

<span class="mw-page-title-main">Round-robin scheduling</span> Algorithm employed by process and network schedulers in computing

Round-robin (RR) is one of the algorithms employed by process and network schedulers in computing. As the term is generally used, time slices are assigned to each process in equal portions and in circular order, handling all processes without priority. Round-robin scheduling is simple, easy to implement, and starvation-free. Round-robin scheduling can be applied to other scheduling problems, such as data packet scheduling in computer networks. It is an operating system concept.

Network congestion in data networking and queueing theory is the reduced quality of service that occurs when a network node or link is carrying more data than it can handle. Typical effects include queueing delay, packet loss or the blocking of new connections. A consequence of congestion is that an incremental increase in offered load leads either only to a small increase or even a decrease in network throughput.

Deficit Round Robin (DRR), also Deficit Weighted Round Robin (DWRR), is a scheduling algorithm for the network scheduler. DRR is, like 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 and fair algorithm.

The set cover problem is a classical question in combinatorics, computer science, operations research, and complexity theory. It is one of Karp's 21 NP-complete problems shown to be NP-complete in 1972.

The token bucket is an algorithm used in packet-switched and telecommunications networks. It can be used to check that data transmissions, in the form of packets, conform to defined limits on bandwidth and burstiness. It can also be used as a scheduling algorithm to determine the timing of transmissions that will comply with the limits set for the bandwidth and burstiness: see network scheduler.

Generalized processor sharing (GPS) is an ideal scheduling algorithm for process schedulers and network schedulers. It is related to the fair-queuing principle which groups packets into classes and shares the service capacity between them. GPS shares this capacity according to some fixed weights.

In computer science, an input queue is a collection of processes in storage that are waiting to be brought into memory to run a program. Input queues are mainly used in Operating System Scheduling which is a technique for distributing resources among processes. Input queues not only apply to operating systems (OS), but may also be applied to scheduling inside networking devices. The purpose of scheduling is to ensure resources are being distributed fairly and effectively; therefore, it improves the performance of the system.

Proportional-fair scheduling is a compromise-based scheduling algorithm. It is based upon maintaining a balance between two competing interests: Trying to maximize the total throughput of the network while at the same time allowing all users at least a minimal level of service. This is done by assigning each data flow a data rate or a scheduling priority that is inversely proportional to its anticipated resource consumption.

Weighted random early detection (WRED) is a queueing discipline for a network scheduler suited for congestion avoidance. It is an extension to random early detection (RED) where a single queue may have several different sets of queue thresholds. Each threshold set is associated to a particular traffic class.

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 generate small jobs from consuming more throughput or CPU time than other flows or processes.

Bandwidth management is the process of measuring and controlling the communications on a network link, to avoid filling the link to capacity or overfilling the link, which would result in network congestion and poor performance of the network. Bandwidth is described by bit rate and measured in units of bits per second (bit/s) or bytes per second (B/s).

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 in equal subparts, WFQ allows schedulers to specify, for each flow, which fraction of the capacity will be given.

Interval scheduling is a class of problems in computer science, particularly in the area of algorithm design. The problems consider a set of tasks. Each task is represented by an interval describing the time in which it needs to be processed by some machine. For instance, task A might run from 2:00 to 5:00, task B might run from 4:00 to 10:00 and task C might run from 9:00 to 11:00. A subset of intervals is compatible if no two intervals overlap on the machine/resource. For example, the subset {A,C} is compatible, as is the subset {B}; but neither {A,B} nor {B,C} are compatible subsets, because the corresponding intervals within each subset overlap.

In graph theory, the graph bandwidth problem is to label the n vertices vi of a graph G with distinct integers so that the quantity is minimized . The problem may be visualized as placing the vertices of a graph at distinct integer points along the x-axis so that the length of the longest edge is minimized. Such placement is called linear graph arrangement, linear graph layout or linear graph placement.

In queueing theory, a discipline within the mathematical theory of probability, the backpressure routing algorithm is a method for directing traffic around a queueing network that achieves maximum network throughput, which is established using concepts of Lyapunov drift. Backpressure routing considers the situation where each job can visit multiple service nodes in the network. It is an extension of max-weight scheduling where each job visits only a single service node.

<span class="mw-page-title-main">Network scheduler</span> Arbiter on a node in packet switching communication network

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 queues of the protocol stack and network interface controller. There are several network schedulers available for the different operating systems, that implement many of the existing network scheduling algorithms.

Time-Sensitive Networking (TSN) is a set of standards under development by the Time-Sensitive Networking task group of the IEEE 802.1 working group. The TSN task group was formed in November 2012 by renaming the existing Audio Video Bridging Task Group and continuing its work. The name changed as a result of the extension of the working area of the standardization group. The standards define mechanisms for the time-sensitive transmission of data over deterministic Ethernet networks.

Enhanced Transmission Selection (ETS) is a network scheduler scheduling algorithm that has been defined by the Data Center Bridging Task Group of the IEEE 802.1 Working Group. It is a hierarchical scheduler that combines static priority scheduling and a bandwidth sharing algorithms.

References

  1. 1 2 3 4 Katevenis, M.; Sidgiropoulos, S.; Courcoubetis, C. (1991). "Weighted round-robin cell multiplexing in a general-purpose ATM switch chip". IEEE Journal on Selected Areas in Communications. 9 (8): 1265–1279. doi:10.1109/49.105173. ISSN   0733-8716.
  2. 1 2 Chaskar, H.M.; Madhow, U. (2003). "Fair scheduling with tunable latency: A round-robin approach". IEEE/ACM Transactions on Networking. 11 (4): 592–601. doi:10.1109/TNET.2003.815290. ISSN   1063-6692. S2CID   8010108.
  3. Brahimi, B.; Aubrun, C.; Rondeau, E. (2006). "Modelling and Simulation of Scheduling Policies Implemented in Ethernet Switch by Using Coloured Petri Nets". 2006 IEEE Conference on Emerging Technologies and Factory Automation. pp. 667–674. doi:10.1109/ETFA.2006.355373. ISBN   0-7803-9758-4. S2CID   6089006.
  4. F. Baker; R.Pan (May 2016). "2.2.2. Round-Robin Models". On Queuing, Marking, and Dropping (Technical report). IETF. RFC 7806.
  5. Semeria, Chuck (2001). Supporting Differentiated Service Classes: Queue Scheduling Disciplines (PDF) (Report). pp. 15–18. Retrieved May 4, 2020.
  6. Beaulieu, Alain (Winter 2017). "Real Time Operating Systems – Scheduling & Schedulers" (PDF). Retrieved May 4, 2020.[ permanent dead link ]
  7. United States 20190266019,Philip D. Hirsch,"Task Scheduling Using Improved Weighted Round Robin Techniques",published August 29, 2019
  8. Fall, Kevin (April 29, 1999). "EECS 122, "Introduction to Communication Networks", Lecture 27, "Scheduling Best-Effort and Guaranteed Connections"" . Retrieved May 4, 2020.
  9. Tabatabaee, Seyed Mohammadhossein; Le Boudec, Jean-Yves; Boyer, Marc (September 22–24, 2020). "Interleaved Weighted Round-Robin: A Network Calculus Analysis". Proc. of the 32nd Int. Teletraffic Congress (ITC 32). arXiv: 2003.08372 . doi:10.1109/ITC3249928.2020.00016.