Programmable Packet Scheduling

Anirudh Sivaraman, Suvinay Subramanian, Anurag Agrawal, Sharad Chole, Shang-Tse Chuang, Tom Edsall, Mohammad Alizadeh, Sachin Katti, Nick McKeown, Hari BalakrishnanarXiv 2016

Abstract

Switches today provide a small set of scheduling algorithms. While we can tweak scheduling parameters, we cannot modify algorithmic logic, or add a completely new algorithm, after the switch has been designed. This paper presents a design for a programmable packet scheduler, which allows scheduling algorithms—potentially algorithms that are unknown today—to be programmed into a switch without requiring hardware redesign. Our design builds on the observation that scheduling algorithms make two decisions: in what order to schedule packets and when to schedule them. Further, in many scheduling algorithms these decisions can be made when packets are enqueued. We leverage this observation to build a programmable scheduler using a single abstraction: the push-in first-out queue (PIFO), a priority queue that maintains the scheduling order and time for such algorithms. We show that a programmable scheduler using PIFOs lets us program a wide variety of scheduling algorithms. We present a detailed hardware design for this scheduler for a 64-port 10 Gbit/s shared-memory switch with <4% chip area overhead on a 16-nm standard-cell library. Our design lets us program many sophisticated algorithms, such as a 5-level hierarchical scheduler with programmable scheduling algorithms at each level.

Introduction

Packet scheduling is the "heartbeat" of a network switch, determining the order and timing of packet transmissions. Traditionally, these schedulers are implemented as fixed-function hardware blocks. While this approach achieves the extreme speeds required for line-rate processing, it imposes a rigid bottleneck on network innovation. Operators are limited to the specific algorithms—such as Weighted Round Robin or Deficit Round Robin—baked into the silicon at the time of manufacture.

This paper introduces a programmable packet scheduler that breaks this rigidity. By identifying a common pattern in scheduling logic and mapping it to a flexible hardware abstraction, we enable network operators to define and deploy new scheduling algorithms via software updates, all while maintaining the performance of dedicated hardware.

The PIFO Abstraction

The core of our design is the Push-In First-Out (PIFO) queue. A PIFO is a priority queue that supports two operations:

  1. Push: An element is inserted into the queue at a position determined by its rank.
  2. Pop: The element with the lowest rank (at the head of the queue) is removed and scheduled.

The key insight is that for a vast majority of scheduling algorithms, a packet's relative priority or its scheduled transmission time can be calculated the moment it arrives at the switch (at enqueue). By performing this calculation upfront, the complex logic of the scheduling algorithm is moved to the "push" side, leaving the "pop" side as a simple, high-speed operation.

The PIFO tree abstraction encodes scheduling order by allowing parent PIFOs to reference child PIFOs.

As shown in Figure 1, PIFOs can be organized into trees to support hierarchical scheduling. In this model, a parent PIFO contains references to child PIFOs rather than individual packets. This recursive structure allows for sophisticated policies, such as sharing bandwidth between departments and then further subdividing it among individual users or flows.

Programming Model

To program the scheduler, developers define scheduling transactions. These are small blocks of code that execute upon packet arrival to compute the packet's rank. This rank determines the packet's position in one or more PIFOs within the tree.

Mapping a hierarchical fair queueing algorithm to a tree of PIFOs with associated scheduling transactions.

Figure 2 illustrates how a hierarchical weighted fair queueing (WFQ) algorithm is mapped to this abstraction. The transaction code (c) computes the start and finish times for packets based on their flow's weight and the current virtual time. This logic is applied at each level of the PIFO tree (b) to maintain the desired scheduling properties (a).

Hardware Architecture and Evaluation

Implementing a programmable priority queue that can sort at 1 GHz (one decision per nanosecond) is a significant hardware challenge. Our design, the PIFO Mesh, uses a hybrid approach. It employs a fast "Flow Scheduler" using flip-flops to manage the heads of active flows and an SRAM-based "Rank Store" to hold the bulk of the buffered packets.

We evaluated this architecture using an industry-standard 16-nm standard-cell library. The results demonstrate that a programmable scheduler capable of supporting a 64-port 10 Gbit/s switch incurs less than 4% chip area overhead compared to a traditional fixed-logic shared-memory switch. Furthermore, the design successfully meets timing constraints at 1 GHz, proving that programmability does not have to come at the cost of line-rate performance.

Conclusion

The PIFO abstraction provides a powerful and efficient foundation for software-defined packet scheduling. We have demonstrated its expressiveness by implementing a wide range of algorithms, including Weighted Fair Queueing, Token Bucket Filtering, and multi-level hierarchical schedulers. While some limitations remain—such as the inability to re-rank packets already in the queue—this work represents a major step toward fully programmable data planes that can evolve alongside the needs of modern networks.

Summary updated

BibTeX
@misc{sivaraman2016programmable,
  author = {Anirudh Sivaraman and Suvinay Subramanian and Anurag Agrawal and Sharad Chole and Shang-Tse Chuang and Tom Edsall and Mohammad Alizadeh and Sachin Katti and Nick McKeown and Hari Balakrishnan},
  title = {{Programmable Packet Scheduling}},
  year = {2016},
  eprint = {1602.06045},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1602.06045},
}
Figure