Weighted Round Robin - Algorithm

Algorithm

WRR mechanism (pseudo-code):

// calculate number of packets to be served each round by connections for each flow f f.normalized_weight = f.weight / f.mean_packet_size min = findSmallestNormalizedWeight for each flow f f.packets_to_be_served = f.normalized_weight / min // main loop loop for each non-empty flow queue f min(f.packets_to_be_served, f.packets_waiting).times do servePacket f.getPacket

Read more about this topic:  Weighted Round Robin