Brain-on-Switch: Towards Advanced Intelligent Network Data Plane via NN-Driven Traffic Analysis at Line-Speed

Jinzhu Yan, Haotian Xu, Zhuotao Liu, Qi Li, Ke Xu, Mingwei Xu, Jianping Wu

Introduction

The networking community has long sought an Intelligent Network Data Plane (INDP)—the ability to analyze traffic, such as detecting malware or classifying applications, directly on programmable switches at line-speed. Historically, INDP has relied almost exclusively on decision trees or forests. While these models map well to the "match-action" tables of switches like the Barefoot Tofino, they require complex, hand-crafted statistical features (e.g., standard deviation of packet lengths) that are hardware-intensive to compute and often inaccurate.

Neural Networks (NNs), particularly Recurrent Neural Networks (RNNs), excel at processing raw sequences of data. However, they are notoriously difficult to deploy on switches due to hardware constraints—such as the lack of floating-point units and limited memory—and a paradigm mismatch between recurrent logic and the linear, feed-forward pipelines of modern switches.

System Architecture

Brain-on-Switch (BoS) is the first system to enable high-performance NN inference directly on programmable switches at line-speed. BoS employs a hybrid architecture that splits the workload between the switch and a co-located server to balance performance and accuracy.

BoS System Architecture: Traffic Analysis Logic and Data Plane Realization

On-Switch Binary RNN

To fit an RNN into a switch's pipeline, BoS utilizes several hardware-optimized techniques:

  • Activation Binarization: By binarizing activation functions using Straight-Through Estimators (STE), inputs and outputs are reduced to simple bit strings.
  • Table-based Forward Propagation: Instead of performing complex arithmetic, BoS treats each NN layer as a lookup table. Since activations are binary, the number of possible input combinations is small enough to be stored in match-action tables. Full-precision weights are baked into these tables during training.
  • Sliding Window Recurrence: To manage long sequences within limited hardware stages, BoS uses a sliding window. The switch processes segments of packets, stores intermediate states in register-based ring buffers, and shifts the window forward with each new packet.
  • Scalable Argmax: Switches lack a native "find maximum" operation. BoS introduces a novel ternary-matching-based argmax using TCAM (Ternary Content Addressable Memory) to identify the highest probability class efficiently.

Analysis Escalation (IMIS)

BoS does not attempt to resolve every flow on-switch. Instead, it calculates a confidence score. If the on-switch RNN is "confused" (i.e., confidence falls below a threshold $T_{conf}$), the flow is escalated to the Integrated Model Inference System (IMIS)—an off-switch module running a full-precision Transformer on a GPU. This hybrid approach ensures that over 95% of traffic is handled at line-speed, while ambiguous cases receive deep analysis.

Evaluation of the Confidence-Driven Escalation Mechanism

Key Results

The authors evaluated BoS on four diverse traffic analysis tasks, including encrypted VPN classification and botnet detection. Key findings include:

  • Superior Accuracy: BoS outperformed the state-of-the-art tree-based model (NetBeacon) by up to 19% in F1-score and a binary MLP model (N3IC) by up to 40%.
  • Line-Speed Throughput: The system achieved 100 Gbps on a physical Tofino 1 switch and demonstrated scalability up to 1.6 Tbps in simulation.
  • Resource Efficiency: BoS consumes less than 25% of the switch's SRAM and significantly less TCAM than prior methods, leaving ample resources for traditional routing functions.

Conclusion

By leveraging the "table as an ALU" insight and a confidence-driven hybrid architecture, Brain-on-Switch overcomes the traditional barriers to deploying NNs in the data plane. It provides a scalable, high-accuracy solution for real-time traffic analysis at Terabit scales, moving the industry closer to a truly intelligent network infrastructure.

Summary updated

BibTeX
@inproceedings{yan2024brain,
  author = {Jinzhu Yan and Haotian Xu and Zhuotao Liu and Qi Li and Ke Xu and Mingwei Xu and Jianping Wu},
  title = {{Brain-on-Switch: Towards Advanced Intelligent Network Data Plane via NN-Driven Traffic Analysis at Line-Speed}},
  booktitle = {NSDI},
  year = {2024},
  url = {https://openreview.net/forum?id=XHXxrgz738},
}
Figure