Weighted round robin

From Wikipedia, the free encyclopedia

Weighted round robin (WRR) is a best-effort connection scheduling discipline. It is the simplest emulation of generalized processor sharing (GPS) discipline. While GPS serves infinitesimal amount of data from each nonempty connection, WRR serves a number of packets for each nonempty connection (number = normalized(weight / mean packet size) ).

To obtain normalized set of weights a mean packet size must be known. Only then WRR correctly emulates GPS. It is best to know this parameter in advance. But that's really uncommon in IP networks so it has to be estimated which may be in practice quite hard (in terms of good GPS approximation). Another problem with WRR is that in a scale of one round WRR doesn't provide fair link sharing.

WRR mechanism (pseudo-code):

//calculate number of packets to be served each round by connections

for each connection c
   c.normalized_weight = c.weight / c.mean_packet_size

min = findSmallestNormalizedWeight

for each connection c
   c.packets_to_be_served = c.normalized_weight / min

// main loop
loop
   for each non-empty connection c
      min(c.packets_to_be_served, c.packets_waiting).times do
         servePacket c.getPacket

There's a modified version of WRR called deficit round robin (DRR) which is able to properly handle packets of different size without knowing their mean size of each connection in advance.

There are more effective scheduling disciplines which handles both of these problems mentioned above (e.g. weighted fair queuing (WFQ)).

[edit] See also

In other languages