Network Hardware-Accelerated Consensus

Huynh Tu Dang, Pietro Bressana, Han Wang, Ki Suh Lee, Hakim Weatherspoon, Marco Canini, Fernando Pedone, Robert Soulé

Abstract: Consensus protocols like Paxos are essential for distributed systems but impose significant CPU overhead. This paper presents CAANS (Consensus As A Network Service), which offloads the Coordinator and Acceptor roles of Paxos to programmable network hardware using P4. By processing consensus logic "on the wire," CAANS achieves near-line-speed latency and a 2.24x throughput improvement over high-performance software implementations.

1. Introduction

Consensus protocols are the bedrock of fault-tolerant distributed systems, ensuring that multiple nodes agree on a single value even amidst failures. However, traditional software-based consensus is computationally expensive. In standard deployments, the "Coordinator" and "Acceptor" roles in Paxos become major CPU bottlenecks. Messages must traverse the entire network stack, undergo context switches, and wait for processing, which introduces significant latency and limits system throughput.

2. The CAANS Architecture

To address these bottlenecks, the authors introduce CAANS (Consensus As A Network Service). CAANS splits the Paxos protocol between software and hardware. Proposers (clients) and Learners (replicas) remain in software to facilitate easy application integration. Meanwhile, the bottleneck roles—Coordinators and Acceptors—are moved into programmable switches and Network Interface Cards (NICs).

The system is implemented using P4, a high-level data-plane programming language. This ensures portability across different hardware targets, such as FPGAs and NPUs. CAANS utilizes a custom Paxos header encapsulated in UDP, allowing switches to perform state checks (e.g., comparing round numbers) and update local registers "on the wire" without the packet ever leaving the network fabric for a server CPU.

3. Performance Evaluation

CAANS was evaluated against libpaxos, a high-performance software baseline, using hardware targets including the NetFPGA SUME and Netronome Agilio-CX.

  • Throughput: CAANS achieved a maximum throughput of 134,094 messages per second, representing a 2.24x improvement over the software baseline (~60k msgs/s).
  • Latency: Hardware offloading reduced acceptor latency to approximately 0.8–1.4 microseconds, compared to hundreds of microseconds in software.
  • Predictability: Unlike software, which is subject to OS jitter, CAANS provides extremely stable and predictable latency.

4. Discussion and Future Work

By offloading the coordinator and acceptor, the system bottleneck shifts to the Learner. This is a favorable outcome, as learners can be scaled horizontally more easily than coordinators. However, hardware implementations face challenges regarding memory constraints (limited BRAM on FPGAs) and the lack of non-volatile memory for durable state storage. Future work may explore offloading learner logic to NICs and integrating battery-backed RAM for persistence.

5. Conclusion

CAANS demonstrates that complex, stateful distributed protocols can be effectively offloaded to programmable network hardware. By moving consensus logic into the network fabric, systems can achieve significant performance gains while maintaining the flexibility and portability offered by the P4 language.

Summary updated

BibTeX
@misc{dang2016network,
  author = {Huynh Tu Dang and Pietro Bressana and Han Wang and Ki Suh Lee and Hakim Weatherspoon and Marco Canini and Fernando Pedone and Robert Soulé},
  title = {{Network Hardware-Accelerated Consensus}},
  year = {2016},
  eprint = {1605.05619},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1605.05619},
}
Figure