Federated learning over WiFi: Should we use TCP or UDP?
Federated learning is a distributed learning paradigm where a centralized model is trained on data distributed over a large number of clients, each with unreliable and relatively slow network connections. The client connections typically have limited bandwidth available to them when using networks such as 2G, 3G, or WiFi. As a result, communication often becomes a bottleneck. Currently, the communication between the clients and server is mostly based on TCP protocol. In this paper, we explore using the UDP protocol for the communication between the clients and server. In particular, we develop UDP-based algorithms for gradient aggregation-based federated learning and model aggregation-based federated learning. We propose methods to construct model updates in case of packet loss with the UDP protocol. We present a scalable framework for practical federated learning. We conduct experiments over WiFi and observe that the UDP-based protocols can lead to faster convergence than the TCP-based protocol -- especially in bad networks. Code available at the repository: \url{https://github.com/vineeths96/Federated-Learning}.