Programmable Switch as a Parallel Computing Device

Li Chen, Ge Chen, Justinas Lingys, Kai ChenarXiv 2018

Abstract

Modern datacenter switches possess immense packet-processing capabilities that often sit idle under traditional networking paradigms. This research investigates the potential of programmable switches to serve as high-performance parallel computing devices. By offloading Map-Reduce tasks to the data plane using the proposed p4mr framework, the authors demonstrate that the network fabric can act as a massively parallel co-processor, achieving up to a 20x speedup for data-intensive applications like Word-Count.

Introduction

In modern datacenters, switches have massive packet-processing capacities (up to 6.5 Tbps), yet they are traditionally governed by the "Minimal Computation Principle" (MCP)—the idea that switches should do as little work as possible to keep latency low. However, as switches become increasingly programmable via languages like P4, a gap has emerged: raw computational potential sits idle in the network while servers struggle with CPU-heavy data processing. This paper addresses two main challenges: the serialization bottleneck of converting raw data into packets and the difficulty of coordinating a network of switches to act as a single distributed computer.

The p4mr Framework and Methodology

The authors approach the problem through mathematical modeling and the development of the p4mr framework. This framework allows users to write high-level code (e.g., SUM(A, B)), which is then parsed into a Directed Acyclic Graph (DAG) for automatic placement and routing across physical switches.

The Map-Reduce workflow implemented within the network fabric, showing the transition from raw data packets to mapped and reduced results.

The methodology involved comparing three setups for a Word-Count application:

  • Scenario 1: Map and Reduce both done on servers (Baseline).
  • Scenario 2: Map on servers, Reduce on the switch.
  • Scenario 3: Both Map and Reduce offloaded to the switch.

To handle the "Map" task, which involves splitting large packets into smaller data-item packets, the switch must recirculate data. The authors calculated a theoretical throughput penalty of approximately 63% for this process, yet found it still outperformed server-side processing due to reduced CPU overhead.

Key Results and Insights

The core advantage of this approach is "In-Transit" processing: data is processed while moving through the switch, so the destination receives pre-aggregated results. This drastically reduces final processing time by bypassing the massive CPU overhead of software-based serialization.

Speedup of full offloading (Scenario 3) compared to the server-only baseline (Scenario 1) across varying server counts and dataset sizes.

Key performance findings include:

  • Massive Speedups: Offloading both Map and Reduce tasks (Scenario 3) resulted in up to a 20x speedup compared to traditional server-only processing. Offloading just the Reduce task (Scenario 2) provided a 5.32x speedup.
  • Scalability and Data Size: The benefits of offloading become more pronounced as dataset sizes increase (e.g., 5GB vs 500MB), as the switch's line-rate processing capabilities outpace server CPU scaling.
  • Diminishing Returns: As more servers are added to a cluster, the relative speedup decreases because the per-server workload drops, making the server-side CPU bottleneck less severe.

Limitations and Future Work

While promising, several hurdles remain for real-world deployment. Switches use expensive, high-speed SRAM and TCAM, which are limited in size, making it difficult to store large aggregation tables. Additionally, the current prototype assumes a dedicated switch; future work must address multi-job scheduling and dynamic job arrivals in shared environments. Finally, while performance tests used real servers, full framework validation on hardware like the Barefoot Tofino chipset is cited as a necessary next step.

Summary updated

BibTeX
@misc{chen2018programmable,
  author = {Li Chen and Ge Chen and Justinas Lingys and Kai Chen},
  title = {{Programmable Switch as a Parallel Computing Device}},
  year = {2018},
  eprint = {1803.01491},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1803.01491},
}
Figure