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 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. 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 n {\displaystyle n} input queues, q 1 , . . . , q n {\displaystyle q_{1},...,q_{n}} . To each queue q i {\displaystyle q_{i}} is associated w i {\displaystyle w_{i}} , a positive integer, called the weight. The WRR scheduler has a cyclic behavior. In each cycle, each queue q i {\displaystyle q_{i}} has w i {\displaystyle w_{i}} emissions opportunities. The different WRR algorithms differ in the distribution of these opportunities in the cycle.
Classical WRR In classical WRR the scheduler cycles over the queues. When a queue q i {\displaystyle q_{i}} is selected, the scheduler will send packets, up to the emission of the w i {\displaystyle w_{i}} packet or the end of the queue.
Interleaved WRR Let w m a x = max { w i } {\displaystyle w_{max}=\max\{w_{i}\}} , be the maximum weight. In IWRR, each cycle is split into w m a x {\displaystyle w_{max}} rounds. A queue with weight w i {\displaystyle w_{i}} can emit one packet at round r {\displaystyle r} only if r ≤ w i {\displaystyle r\leq w_{i}} .
Example
… excerpt ends here. Continue reading the full article.

