FedComm: Understanding Communication Protocols for Edge-based Federated Learning

Gary Cleland, Di Wu, Rehmat Ullah, Blesson Varghese

Abstract

Federated learning (FL) trains machine learning (ML) models on devices using locally generated data and exchanges models without transferring raw data to a distant server. This exchange incurs a communication overhead and impacts the performance of FL training. There is limited understanding of how communication protocols specifically contribute to the performance of FL. Such an understanding is essential for selecting the right communication protocol when designing an FL system. This paper presents FedComm, a benchmarking methodology to quantify the impact of optimized application layer protocols, namely Message Queue Telemetry Transport (MQTT), Advanced Message Queuing Protocol (AMQP), and ZeroMQ Message Transport Protocol (ZMTP), and non-optimized application layer protocols, namely as TCP and UDP, on the performance of FL. FedComm measures the overall performance of FL in terms of communication time and accuracy under varying computational and network stress and packet loss rates. Experiments on a lab-based testbed demonstrate that TCP outperforms UDP as a non-optimized application layer protocol with higher accuracy and shorter communication times for 4G and Wi-Fi networks. Optimized application layer protocols such as AMQP, MQTT, and ZMTP outperformed non-optimized application layer protocols in most network conditions, resulting in a 2.5x reduction in communication time compared to TCP while maintaining accuracy.

Introduction

Federated Learning (FL) has emerged as a privacy-preserving paradigm for training machine learning models. By keeping raw data on local devices and only sharing model weights with a central server, FL mitigates many privacy concerns associated with centralized data collection. However, this decentralized approach introduces a significant communication bottleneck. While much research has focused on algorithmic improvements like gradient compression or reduced update frequency, the underlying communication protocols—the "plumbing" of the system—have remained largely unexamined.

In edge computing environments, network conditions are often volatile, ranging from high-speed Wi-Fi to constrained 3G or 4G cellular links. Selecting an inappropriate protocol can lead to excessive latency or model degradation. FedComm addresses this gap by providing a systematic benchmarking framework to evaluate how various application-layer protocols impact FL performance under diverse stress conditions.

Methodology: The FedComm Framework

The researchers developed FedComm, a structured methodology to quantify the effects of protocol choice on FL. The framework evaluates performance across several dimensions:

  1. Protocol Selection: It compares standard "non-optimized" protocols (TCP, UDP) against IoT-optimized protocols (MQTT, AMQP, ZMTP).
  2. Environmental Stress: The framework simulates real-world constraints by injecting CPU stress on edge devices and network congestion.
  3. Network Emulation: Bandwidth is capped to reflect 3G (5Mbps), 4G (20Mbps), and Wi-Fi (60Mbps) profiles.
  4. Packet Loss: Unreliable connections are modeled by dropping between 0% and 20% of data packets.
The FedComm benchmarking methodology involves an 8-step process from protocol selection to network monitoring.

The study utilized the CIFAR-10 dataset and evaluated two model architectures, VGG-5 and VGG-8, to understand how varying payload sizes (model weights) interact with protocol overhead.

Key Insights and Experimental Results

The benchmarking revealed several critical trade-offs between reliability, speed, and accuracy:

  • The Reliability Tax: TCP ensures data integrity through retransmissions. However, in constrained environments like 3G, these retransmissions cause significant spikes in communication time.
  • UDP’s Accuracy Trade-off: While UDP is faster due to its connectionless nature, packet loss directly translates to lost model weights. Under 3G conditions with high packet loss, UDP's speed advantage is negated by a substantial drop in model accuracy.
  • Optimized Protocol Superiority: Broker-based protocols like AMQP and MQTT proved significantly more efficient. By managing message distribution more effectively than one-to-one TCP sockets, these protocols achieved up to a 2.5x reduction in communication time on Wi-Fi networks.
Comparison of communication times for VGG-5 and VGG-8 models across different network types using TCP and UDP.

Specifically, AMQP emerged as a top performer, being 1.75x faster than TCP in 3G and 2.15x faster in 4G environments. Crucially, as long as the network remained stable, all protocols maintained nearly identical accuracy levels (within 0.5%).

Conclusion and Future Directions

FedComm demonstrates that the choice of communication protocol is as vital as the choice of learning algorithm in edge-based FL. Optimized IoT protocols offer a clear path to reducing latency without compromising model quality.

Future work will focus on scaling these findings to thousands of devices to test the limits of broker-based architectures. Additionally, the researchers aim to investigate "reliable UDP" implementations and the impact of different broker configurations (local vs. cloud) on edge-to-edge latency.

The FedComm framework is open-source and available for the research community on GitHub.

Summary updated

Abstract

Federated learning (FL) trains machine learning (ML) models on devices using locally generated data and exchanges models without transferring raw data to a distant server. This exchange incurs a communication overhead and impacts the performance of FL training. There is limited understanding of how communication protocols specifically contribute to the performance of FL. Such an understanding is essential for selecting the right communication protocol when designing an FL system. This paper presents FedComm, a benchmarking methodology to quantify the impact of optimized application layer protocols, namely Message Queue Telemetry Transport (MQTT), Advanced Message Queuing Protocol (AMQP), and ZeroMQ Message Transport Protocol (ZMTP), and non-optimized application layer protocols, namely as TCP and UDP, on the performance of FL. FedComm measures the overall performance of FL in terms of communication time and accuracy under varying computational and network stress and packet loss rates. Experiments on a lab-based testbed demonstrate that TCP outperforms UDP as a non-optimized application layer protocol with higher accuracy and shorter communication times for 4G and Wi-Fi networks. Optimized application layer protocols such as AMQP, MQTT, and ZMTP outperformed non-optimized application layer protocols in most network conditions, resulting in a 2.5x reduction in communication time compared to TCP while maintaining accuracy. The experimental results enable us to highlight a number of open research issues for further investigation. FedComm is available for download from https://github.com/qub-blesson/FedComm.
BibTeX
@misc{cleland2022fedcomm,
  author = {Gary Cleland and Di Wu and Rehmat Ullah and Blesson Varghese},
  title = {{FedComm: Understanding Communication Protocols for Edge-based Federated Learning}},
  year = {2022},
  eprint = {2208.08764},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2208.08764},
}
Figure