Network scheduler

Print Print
Reading time 7:13

Packets queuing in a FIFO (first in, first out) data structure.

A network scheduler, also called packet scheduler, queueing discipline, qdisc or queueing algorithm, is an arbiter on a node in packet switching communication network. It manages the sequence of network packets in the transmit and receive queues of the network interface controller. There are several network schedulers available for the different operating systems, that implement many of the existing network scheduling algorithms.

The network scheduler logic decides which network packet to forward next. The network scheduler is associated with a queuing system, storing the network packets temporarily until they are transmitted. Systems may have a single or multiple queues in which case each may hold the packets of one flow, classification, or priority.

In some cases it may not be possible to schedule all transmissions within the constraints of the system. In these cases the network scheduler is responsible for deciding which traffic to forward and what gets dropped.

Terminology and responsibilities

A network scheduler may have responsibility in implementation of specific network traffic control initiatives. Network traffic control is an umbrella term for all measures aimed at reducing congestion, latency and packet loss. Specifically, active queue management (AQM) is the selective dropping of queued network packets to achieve the larger goal of preventing excessive network congestion. The scheduler must choose which packets to drop. Traffic shaping smooths the bandwidth requirements of traffic flows by delaying transmission packets when they are queued in bursts. The scheduler decides the timing for the transmitted packets. quality of service (QoS) is the prioritization of traffic based on service class (Differentiated services) or reserved connection (Integrated services).


In the course of time many network queueing disciplines have been developed. Each of these provides specific reordering or dropping of network packets inside various transmit or receive buffers.[1][2] Queuing disciplines are commonly used as attempts to compensate for various networking conditions, like reducing the latency for certain classes of network packets, and are generally used as part of QoS measures.[3][4][5]

Examples of algorithms suitable for managing network traffic include:

  • AVQ (adaptive virtual queue)[6]
  • CBQ (class-based queueing) discipline
  • CHOKe (CHOose and Keep for responsive flows, CHOose and Kill for unresponsive flows) is a variant of RED
  • CoDel (controlled delay) and fair/flow queue CoDel
  • CAKE (Common Applications Kept Enhanced), implemented in linux kernel[7]
  • Credit-based fair queuing
  • DRR (deficit round robin) and DWRR, implementation e.g. written by Patrick McHardy for the Linux kernel[8] and published under the GNU General Public License.
  • FaQ (FavourQueue)[9]
  • FQ-PIE (Flow Queue Proportional Integral controller Enhanced)
  • GCRA (generic cell rate algorithm)
  • HFF (heavy-hitter filter)[10]
  • HFSC (hierarchical fair-service curve)
  • HTB (hierarchical token bucket)[11]
  • QFQ (quick fair queueing)[12]
  • FQ (fair queuing) and WFQ (weighted fair queuing)
  • FIFO (first in, first out)
  • pkt_sched: fq: fair queue packet scheduler [13]
  • NETEM network emulator[14]
  • PIE (proportional integral controller enhanced)[15]
  • RED (random early detection)
    • ARED (advanced random early detection)
    • GRED (generalized random early detection)
    • RRED (robust random early detection)
    • WRED (weighted random early detection)
  • RR (round-robin) and WRR (weighted round robin)
  • SFB (stochastic fair blue) as well as RSFB (resilient SFB)
  • SFQ (stochastic fairness queuing)[16]
  • TBF (token bucket filter)[17]
  • TEQL (trivial link equalizer)

Several of the above have been implemented as Linux kernel modules[18] and are freely available.


Bufferbloat is a phenomenon in packet-switched networks in which excess buffering of packets causes high latency and packet delay variation. Bufferbloat can be addressed by a network scheduler that strategically discards packets to avoid an unnecessarily high buffering backlog. Examples include CoDel and Random early detection.


Linux kernel

The Linux kernel's packet scheduler is part of the network stack, together with netfilter, nftables, and Berkeley Packet Filter.

The Linux kernel packet scheduler is an integral part of the Linux kernel's network stack and manages the transmit and receive ring buffers of all NICs, by working on the layer 2 of the OSI model and handling Ethernet frames, for example.

The packet scheduler is configured using the utility called tc (short for "traffic control"). As the default queuing discipline, the packet scheduler uses a FIFO implementation called pfifo_fast,[19] although systemd since its version 217 changes the default queuing discipline to fq_codel.[20]

The ifconfig and ip utilities enable system administrators to configure the buffer sizes txqueuelen and rxqueuelen for each device separately in terms of number of Ethernet frames regardless of their size. The Linux kernel's network stack contains several other buffers, which are not managed by the network scheduler.[a]

Berkeley Packet Filter filters can be attached to the packet scheduler's classifiers. The eBPF functionality brought by version 4.1 of the Linux kernel in 2015 extends the classic BPF programmable classifiers to eBPF.[21] These can be compiled using the LLVM eBPF backend and loaded into a running kernel using the tc utility.[22]

BSD and OpenBSD

ALTQ is the implementation of a network scheduler for BSDs. As of OpenBSD version 5.5 ALTQ was replaced by the HFSC scheduler.

See also

  • Network congestion
  • Queue (abstract data type)
  • Queueing theory
  • Statistical time division multiplexing
  • Traffic shaping
  • Traffic classification
  • Type of service


  1. ^ The overall size of all buffers has been the point of critique by the Bufferbloat project, which provided a partial solution with CoDel that has been primarily tested in OpenWrt.


  1. ^ "Traffic Control HOWTO: Classless Queuing Disciplines (qdiscs)". Retrieved November 24, 2013.
  2. ^ Saravanan Radhakrishnan (September 30, 1999). "QoS Support in Linux: Queuing Disciplines". Retrieved March 18, 2014.
  3. ^ "Traffic Control HOWTO: Components of Linux Traffic Control". Retrieved November 24, 2013.
  4. ^ "Traffic Control HOWTO: Traditional Elements of Traffic Control". Retrieved November 24, 2013.
  5. ^ "Queuing Disciplines: Order of Packet Transmission and Dropping" (PDF). October 25, 2006. Retrieved March 18, 2014.
  6. ^ "Abstract". 2002. CiteSeerX . Cite journal requires |journal= (help)
  7. ^ "Let them run CAKE".
  8. ^ "DRR Linux kernel network scheduler module". Retrieved 2013-09-07.
  9. ^ "FavorQueue: a Parameterless Active Queue Management to Improve TCP Traffic Performance" (PDF).
  10. ^ "Heavy-Hitter Filter qdisc".
  11. ^ "HTB Linux kernel network scheduler module". Retrieved 2013-09-07.
  12. ^ "QFQ Linux kernel network scheduler module". Retrieved 2013-09-07.
  13. ^ "Fair Queue packet scheduler committed to Linux kernel 3.12".
  14. ^ "Network emulator Linux kernel network scheduler module". Retrieved 2013-09-07.
  15. ^ "Proportional Integral controller Enhanced (PIE)".
  16. ^ "SFQ Linux kernel network scheduler module". Retrieved 2013-09-07.
  17. ^ "TBF Linux kernel network scheduler module". Retrieved 2013-09-07.
  18. ^ "The Linux kernel network scheduler". 2012-12-26. Retrieved 2013-09-07.
  19. ^ "Linux Advanced Routing and Traffic Control HOWTO, Section 9.2.1. pfifo_fast". 2012-05-19. Retrieved 2014-09-19.
  20. ^ "systemd System and Service Manager: NEWS file". 2015-05-22. Retrieved 2015-06-09.
  21. ^ "Linux kernel 4.1, Section 11. Networking". 2015-06-21.
  22. ^ "BPF and XDP Reference Guide". Cilium documentation web site.

Edited: 2021-06-18 19:02:39