Net-P4ct: Enhanced WAN Bandwidth Fair Sharing Using P4 Programmable Switches

Haoran Chen (Bytedance), Mingwei Cui (Bytedance), Yihan Zou (ByteDance), Yihang Miao (ByteDance), Suhan Jiang (ByteDance), Damu Ding (ByteDance), Lirong Lai (ByteDance), Ming Gao (ByteDance), Rui Jiang (ByteDance), Shengyuan He (ByteDance), Anjian Chen (ByteDance), Jiaming Shi (ByteDance), Junjie Wan (ByteDance), Yandong Duan (ByteDance), Ruomin Fang (ByteDance), Hongyu Wu (ByteDance), Yongping Tang (ByteDance), Qiao Kang (unaffiliated), Guangrui Wu (ByteDance), Xiyun Xu (ByteDance)

23rd USENIX Symposium on Networked Systems Design and Implementation (NSDI '26) · Day 3 · Sandboxes, Containers, and Beyond

Overview

Driven by massive cloud services, live streaming, and high-demand video platforms, the capacity of ByteDance’s self-built Wide Area Network (WAN) has scaled to over 200 terabits per second over recent years. Because long deployment cycles and high provisioning costs restrict raw network expansion, operators must aggressively optimize bandwidth utilization and resource efficiency to satisfy stringent Service Level Objectives (SLOs). Network traffic in this environment splits into high-priority and low-priority classes, each encompassing a diverse mixture of infrastructure services (such as distributed file systems, compute clusters, and storage) alongside user-facing business applications. Enabling fair, predictable bandwidth sharing across thousands of distinct services under these conditions presents a formidable systems challenge.

Watch on YouTube · Slides

Visual summary for Net-P4ct: Enhanced WAN Bandwidth Fair Sharing Using P4 Programmable Switches by Haoran Chen, Mingwei Cui, Yihan Zou, Yihang Miao, Suhan Jiang, Damu Ding, Lirong Lai, Ming Gao, Rui Jiang, Shengyuan He, Anjian Chen, Jiaming Shi, Junjie Wan, Yandong Duan, Ruomin Fang, Hongyu Wu, Yongping Tang, Qiao Kang, Guangrui Wu, Xiyun Xu
Visual summary for Net-P4ct: Enhanced WAN Bandwidth Fair Sharing Using P4 Programmable Switches by Haoran Chen, Mingwei Cui, Yihan Zou, Yihang Miao, Suhan Jiang, Damu Ding, Lirong Lai, Ming Gao, Rui Jiang, Shengyuan He, Anjian Chen, Jiaming Shi, Junjie Wan, Yandong Duan, Ruomin Fang, Hongyu Wu, Yongping Tang, Qiao Kang, Guangrui Wu, Xiyun Xu

Key moments

  1. 0:00 Introduction and motivation for Net-P4ct
  2. 2:00 Challenges with host-based throttling using eBPF
  3. 4:00 Overview of Net-P4ct using P4 programmable switches
  4. 5:45 Bandwidth request model abstraction and traffic patterns
  5. 7:50 Resource allocation and weighted max-min fairness
  6. 9:50 DSCP remarking policies replacing traditional rate limiting
  7. 14:20 Evaluation results and CPU overhead comparison
  8. 15:25 Production deployment experiences and cluster scaling

Net-P4ct: Enhanced WAN Bandwidth Fair Sharing Using P4 Programmable Switches

Speakers: Haoran Chen (Bytedance); Mingwei Cui (Bytedance); Yihan Zou (ByteDance); Yihang Miao (ByteDance); Suhan Jiang (ByteDance); Damu Ding (ByteDance); Lirong Lai (ByteDance); Ming Gao (ByteDance); Rui Jiang (ByteDance); Shengyuan He (ByteDance); Anjian Chen (ByteDance); Jiaming Shi (ByteDance); Junjie Wan (ByteDance); Yandong Duan (ByteDance); Ruomin Fang (ByteDance); Hongyu Wu (ByteDance); Yongping Tang (ByteDance); Qiao Kang (unaffiliated); Guangrui Wu (ByteDance); Xiyun Xu (ByteDance)

Conference: USENIX NSDI

YouTube: https://www.youtube.com/watch?v=R6QG0su_9Oc

Overview

Driven by massive cloud services, live streaming, and high-demand video platforms, the capacity of ByteDance’s self-built Wide Area Network (WAN) has scaled to over 200 terabits per second over recent years. Because long deployment cycles and high provisioning costs restrict raw network expansion, operators must aggressively optimize bandwidth utilization and resource efficiency to satisfy stringent Service Level Objectives (SLOs). Network traffic in this environment splits into high-priority and low-priority classes, each encompassing a diverse mixture of infrastructure services (such as distributed file systems, compute clusters, and storage) alongside user-facing business applications. Enabling fair, predictable bandwidth sharing across thousands of distinct services under these conditions presents a formidable systems challenge.

The unique production topology further complicates bandwidth management due to a heterogeneous mixture of traffic sources, including self-managed data centers, Cloud Service Providers (CSPs), and the public internet. Backbone traffic spans two primary operational patterns: host-to-host (internal server traffic) and external-to-host (traffic originating from third-party cloud load balancers or the internet destined for internal backend nodes). Traditional host-based bandwidth management systems struggle to keep pace with these multi-origin traffic classes without incurring heavy CPU overheads, maintaining fragile multi-version kernel dependencies, and suffering from severe traffic visibility blind spots.

To overcome these roadblocks, ByteDance developed Net-P4ct, a WAN-wide bandwidth management and enforcement system powered by P4 programmable switches. By moving enforcement from millions of host servers directly into dedicated ingress P4 switch clusters, Net-P4ct achieves line-rate classification, work-conserving bandwidth allocation, and fine-grained traffic shaping. This technical article details the architecture, policy abstraction models, enforcement mechanisms, deployment lessons, and operational trade-offs of the Net-P4ct system as presented at USENIX NSDI.

Background

▶ Watch: Introduction and motivation for Net-P4ct (0:00)

Historically, ByteDance relied on a host-based traffic management architecture to enforce service-level bandwidth allocations. This architecture deployed a daemon named NetAgent on every server, leveraging eBPF (Extended Berkeley Packet Filter) programs directly inside the Linux kernel to execute traffic monitoring, packet header modification, and rate throttling.

While functional in smaller-scale deployments, this host-based throttling paradigm introduced three critical production bottlenecks:

  1. Excessive CPU Consumption: Operating NetAgent across millions of servers consumed roughly 20,000 CPU cores globally, stealing valuable compute cycles away from revenue-generating user applications.
  2. Maintenance Overhead and Fragility: Managing over 50 distinct kernel versions across millions of hosts created massive maintenance burdens. Kernel bugs—such as an incident where packets were mistakenly marked with erroneous large timestamps due to an old kernel bug fixed in version 5.10—frequently caused production network anomalies.
  3. Traffic Blind Spots: Because external-to-host traffic enters the backbone via third-party cloud load balancers or edge points before hitting internal hosts, host-based daemons missed substantial portions of incoming WAN traffic, creating dangerous visibility and control blind spots.

Network operators naturally investigated whether conventional Provider Edge (PE) switches could take over bandwidth enforcement duties. However, traditional PE switching hardware is fundamentally optimized for high-speed packet forwarding rather than programmable stateful traffic management, offering severely limited configuration flexibility and risking network-wide stability during frequent policy updates.

This operational impasse motivated the design of Net-P4ct, shifting traffic management from host operating systems and static PE switches into programmable in-network hardware.

Key Findings

▶ Watch: Overview of Net-P4ct using P4 programmable switches (4:00)

The deployment of Net-P4ct across ByteDance’s production WAN yielded several major discoveries and performance improvements:

  • Massive CPU Savings: By offloading rate-shaping and tagging logic from host servers to P4 programmable switches, Net-P4ct reduced host-side CPU usage for traffic management to under 3%, compared to nearly 15% consumed by host-based forwarding architectures at scale (evaluated across workloads ranging up to 16,000 active flows).
  • Elimination of Throughput Oscillation: Traditional threshold-based rate limiters cause undesirable sawtooth throughput patterns, activating when utilization hits an upper bound (e.g., 80%) and disabling only after dropping below a lower bound (e.g., 65%). Net-P4ct replaced hard rate limiting with DSCP (Differentiated Services Code Point) remarking combined with downstream strict priority queuing, eliminating throughput swings.
  • Support for Heterogeneous Traffic Sources: The system successfully unifies internal host-to-host and external-to-host traffic management under a single control plane, resolving historical blind spots associated with edge and cloud-originated traffic.
  • Robust Multi-Switch Scalability: Small-volume services (under 1 Gbps) are steered via VXLAN encapsulation to a single designated P4 switch, whereas heavier workloads automatically distribute policy enforcement across an entire P4 switch cluster to harness aggregate processing capacity.

Technical Deep Dive

▶ Watch: Bandwidth request model abstraction and traffic patterns (5:45)

Bandwidth Request Model and Abstraction

Net-P4ct introduces a structured job abstraction model to simplify multi-service bandwidth allocation. A job serves as the fundamental unit of bandwidth requests, defined by a tuple: (Job ID, Service Pattern, Region A, Region Z, Guaranteed Bandwidth, Weight).

Service patterns fall into two categories:

  • Host-to-Host Pattern: Containerized internal workloads require packets originating from hosts to carry a unique Job ID tag inserted by lightweight host agents. P4 switches recognize this ID at line rate to associate packets with specific jobs.
  • External-to-Host Pattern: Unmanaged or cloud-originated traffic is identified using a multi-tuple pattern (such as source IP prefix, destination IP prefix, and protocol, or a full five-tuple depending on the operational scope), capturing public load balancer IPs interacting with internal backend services.

Link capacity across the WAN is partitioned into two classes: Reserved Capacity (allocated for high-priority traffic and strict guaranteed bandwidth requests, retaining a fixed headroom percentage—such as 60% of a 400 Gbps link bundle—for disaster recovery and fault tolerance) and Non-Reserved Capacity (allocated for best-effort traffic and non-critical workloads).

Allocation and Fairness Algorithms

Net-P4ct operates as a work-conserving system. When the network is underutilized, jobs can consume spare bandwidth beyond their minimum guaranteed allocations. When congestion occurs, the control plane calculates fair-share bandwidth allocations using a weighted max-min fairness model driven by the classic water-filling algorithm.

Enforcement Policies

To enforce these allocations without causing packet reordering or throughput instability, Net-P4ct implements two distinct enforcement mechanisms:

  1. Meter-Based Policy: Conceptualized as a cascade of token buckets executing a two-rate three-color marker, this policy classifies packets into green (high priority), yellow (medium priority), and red (low priority) based on a CIR (Committed Information Rate) set to the guaranteed bandwidth and a PIR (Peak Information Rate) set to the sum of guaranteed and fair-share bandwidth. While intuitive, per-packet metering can occasionally induce packet reordering at the destination.
  2. Statistics-Based Policy: To eliminate packet reordering, this policy operates at the flow-group level by mapping traffic into hash buckets. A feedback loop periodically monitors real-time bucket throughput and updates DSCP markings using a knapsack-like optimization algorithm that matches exact guaranteed rate requirements. To handle short-term traffic bursts without reordering, supplemental meters are deployed to gracefully downgrade excess green or yellow traffic to red when sudden micro-bursts occur.

Experimental Setup & Results

▶ Watch: Resource allocation and weighted max-min fairness (7:50)

Evaluation of Net-P4ct in ByteDance’s production environment focused on fairness enforcement accuracy, operational overhead, and scalability:

  • Multi-Job Link Sharing: Tests evaluating three competing jobs sharing a single bottleneck link confirmed that Net-P4ct successfully honored strict minimum bandwidth guarantees for all three services while dynamically distributing additional spare capacity proportionally based on configured priority weights.
  • CPU Utilization Benchmarks: When scaling active flows from 2,000 to 16,000, host-based forwarding architectures saw CPU usage climb toward 15%. In contrast, Net-P4ct maintained host CPU usage below 3%, successfully offloading the computational burden to programmable network hardware.
  • Failover and Robustness: Active probing mechanisms monitor both P4 and non-P4 paths simultaneously. In the event of a switch port or hardware failure, BGP routes are automatically withdrawn to redirect traffic across healthy cluster ports, backed by a physical fallback mechanism that can bypass the P4 cluster entirely during catastrophic failures.

Practical Implications

▶ Watch: Evaluation results and CPU overhead comparison (14:20)

For network infrastructure teams, model builders, and cloud deployers, Net-P4ct demonstrates that offloading stateful traffic management from host operating systems to programmable network silicon yields massive reliability and efficiency dividends.

However, practitioners must navigate several trade-offs:

  • Service Team Collaboration: Operational experience revealed that application teams frequently overestimate their initial bandwidth requirements. Network operators must institute strict review processes and cost-allocation accountability (e.g., charging service teams for severely over-provisioned allocations) to prevent resource hoarding.
  • Hardware Portability: While currently anchored in P4 programmable switching hardware, the core abstractions of Net-P4ct are generalizable. Exploring ports to alternative high-speed networking silicon, such as Broadcom Trident 5 architectures, represents a crucial next step for broader industry adoption.
  • Complexity of Statistics-Based Shaping: While statistics-based flow-group enforcement prevents packet reordering, tuning hash buckets and burst mitigation meters requires careful calibration to balance responsiveness against control stability.

Key Takeaways

  • Architecture Shift: Net-P4ct replaces CPU-heavy, brittle host-based eBPF throttling (NetAgent) with line-rate enforcement inside programmable P4 switch clusters.
  • CPU Reduction: Host-side CPU consumption for traffic management drops from nearly 15% down to under 3% across tens of thousands of active flows.
  • Stability Without Oscillation: Replacing hard rate-limiting thresholds with DSCP remarking and strict priority queuing eliminates disruptive sawtooth throughput fluctuations.
  • Dual Enforcement Modes: The system offers both meter-based and statistics-based enforcement policies, allowing operators to balance rapid burst response against strict anti-reordering guarantees.
  • Operational Resilience: Active path probing, automated BGP route withdrawal, and physical fallback paths ensure high availability and graceful degradation during hardware failures.

About the Speaker(s)}

▶ Watch: Production deployment experiences and cluster scaling (15:25)

Haoran Chen presented this work on behalf of a large engineering and research contingent from ByteDance, alongside co-authors including Mingwei Cui, Yihan Zou, Yihang Miao, Suhan Jiang, Damu Ding, Lirong Lai, Ming Gao, Rui Jiang, Shengyuan He, Anjian Chen, Jiaming Shi, Junjie Wan, Yandong Duan, Ruomin Fang, Hongyu Wu, Yongping Tang, Qiao Kang (unaffiliated), Guangrui Wu, and Xiyun Xu. The team brings extensive production systems and networking expertise from operating one of the world's largest private WAN infrastructures at ByteDance.

Reviews

→ Top-rated talks at 23rd USENIX Symposium on Networked Systems Design and Implementation (NSDI '26)

All talks from 23rd USENIX Symposium on Networked Systems Design and Implementation (NSDI '26)