skip to main content
10.1145/3532577.3532591acmotherconferencesArticle/Chapter ViewAbstractPublication Pageswns3Conference Proceedingsconference-collections
research-article
Open access

ns3-fl: Simulating Federated Learning with ns-3

Published: 22 June 2022 Publication History

Abstract

In recent years, there has been a spike in interest in the field of federated learning (FL). As a result, an increasing number of federated learning algorithms have been developed. Large-scale deployments to validate these algorithms are often not feasible, resulting in a need for simulation tools which closely emulate real deployment conditions. Existing federated learning simulators lack complex network settings, and instead focus on data and algorithmic development. ns-3 is a discrete event network simulator, which has a plethora of models to represent network components and can simulate complex networking scenarios. In this paper, we present ns3-fl, which is a tool that connects an existing FL simulator, flsim, with ns-3 to produce a federated learning simulator that considers data, algorithm, and network. We first discuss the learning, network and power models used to develop our tool. We then present an overview of our implementation, including the Client/Server ns-3 applications and interprocess communication protocols. A real Raspberry Pi-based deployment is setup to validate our tool. Finally, we perform a simulation emulating FL training on 40 clients throughout the UCSD campus and analyze the performance of our tool, in terms of real clock execution time for various FL rounds.

References

[1]
Aaron Carroll and Gernot Heiser. 2010. An Analysis of Power Consumption in a Smartphone. In 2010 USENIX Annual Technical Conference (USENIX ATC 10).
[2]
Mingzhe Chen, H. Vincent Poor, Walid Saad, and Shuguang Cui. 2021. Convergence Time Optimization for Federated Learning Over Wireless Networks. IEEE Transactions on Wireless Communications 20, 4(2021), 2457–2471. https://doi.org/10.1109/TWC.2020.3042530
[3]
Yujing Chen, Yue Ning, Martin Slawski, and Huzefa Rangwala. 2020. Asynchronous Online Federated Learning for Edge Devices with Non-IID Data. In 2020 IEEE International Conference on Big Data (Big Data). 15–24. https://doi.org/10.1109/BigData50022.2020.9378161
[4]
Yang Chen, Xiaoyan Sun, and Yaochu Jin. 2020. Communication-Efficient Federated Deep Learning With Layerwise Asynchronous Model Update and Temporally Weighted Aggregation. IEEE Transactions on Neural Networks and Learning Systems 31, 10(2020), 4229–4238. https://doi.org/10.1109/TNNLS.2019.2953131
[5]
Zheyi Chen, Weixian Liao, Kun Hua, Chao Lu, and Wei Yu. 2021. Towards Asynchronous Federated Learning for Heterogeneous Edge-Powered Internet of Things. Digital Communications and Networks 7, 3 (2021), 317–326. https://doi.org/10.1016/j.dcan.2021.04.001
[6]
Li Deng. 2012. The MNIST Database of Handwritten Digit Images for Machine Learning Research [Best of the Web]. IEEE Signal Processing Magazine 29, 6 (2012), 141–142. https://doi.org/10.1109/MSP.2012.2211477
[7]
Piotr Gawlowicz and Anatolij Zubow. 2018. ns3-gym: Extending OpenAI Gym for Networking Research. (2018). arxiv:1810.03943 [cs.NI]
[8]
Jiangshan Hao, Yanchao Zhao, and Jiale Zhang. 2020. Time Efficient Federated Learning with Semi-Asynchronous Communication. In 2020 IEEE 26th International Conference on Parallel and Distributed Systems (ICPADS). 156–163. https://doi.org/10.1109/ICPADS51040.2020.00030
[9]
Chaoyang He, Songze Li, Jinhyun So, Mi Zhang, Hongyi Wang, Xiaoyang Wang, Praneeth Vepakomma, Abhishek Singh, Hang Qiu, Li Shen, Peilin Zhao, Yan Kang, Yang Liu, Ramesh Raskar, Qiang Yang, Murali Annavaram, and Salman Avestimehr. 2020. FedML: A Research Library and Benchmark for Federated Machine Learning. arXiv preprint arXiv:2007.13518(2020).
[10]
Thomas R Henderson, Mathieu Lacage, George F Riley, Craig Dowell, and Joseph Kopena. 2008. Network Simulations with the ns-3 Simulator. SIGCOMM demonstration 14, 14 (2008), 527.
[11]
Hioki3334 Powermeter. [n.d.]. Hioki3334 Powermeter. https://www.hioki.com/en/products/detail/?product_key=5812.
[12]
Chung-Hsuan Hu, Zheng Chen, and Erik G. Larsson. 2021. Device Scheduling and Update Aggregation Policies for Asynchronous Federated Learning. In 2021 IEEE 22nd International Workshop on Signal Processing Advances in Wireless Communications (SPAWC). 281–285. https://doi.org/10.1109/SPAWC51858.2021.9593194
[13]
Peter Kairouz, H Brendan McMahan, Brendan Avent, Aurélien Bellet, Mehdi Bennis, Arjun Nitin Bhagoji, Kallista Bonawitz, Zachary Charles, Graham Cormode, Rachel Cummings, 2021. Advances and Open Problems in Federated Learning. Foundations and Trends® in Machine Learning 14, 1–2(2021), 1–210.
[14]
Alex Krizhevsky, Geoffrey Hinton, 2009. Learning Multiple Layers of Features from Tiny Images. (2009).
[15]
Tian Li, Anit Kumar Sahu, Ameet Talwalkar, and Virginia Smith. 2020. Federated Learning: Challenges, Methods, and Future Directions. IEEE Signal Processing Magazine 37, 3 (2020), 50–60.
[16]
Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise Aguera y Arcas. 2017. Communication-Efficient Learning of Deep Networks from Decentralized Data. In Artificial Intelligence and Statistics. PMLR, 1273–1282.
[17]
Vaikkunth Mugunthan, Anton Peraire-Bueno, and Lalana Kagal. 2020. PrivacyFL: A Simulator for Privacy-Preserving and Secure Federated Learning. In Proceedings of the 29th ACM International Conference on Information and Knowledge Management(Virtual Event, Ireland) (CIKM ‘20). Association for Computing Machinery, New York, NY, USA, 3085–3092. https://doi.org/10.1145/3340531.3412771
[18]
Dinh C. Nguyen, Ming Ding, Pubudu N. Pathirana, Aruna Seneviratne, Jun Li, and H. Vincent Poor. 2021. Federated Learning for Internet of Things: A Comprehensive Survey. IEEE Communications Surveys and Tutorials 23, 3 (2021), 1622–1658. https://doi.org/10.1109/comst.2021.3075439
[19]
Raspberry Pi 400. [n.d.]. Raspberry Pi 400. https://www.raspberrypi.com/products/raspberry-pi-400/.
[20]
Raspberry Pi 4B. [n.d.]. Raspberry Pi 4B. https://www.raspberrypi.com/products/raspberry-pi-4-model-b/.
[21]
Jae Hun Ro, Ananda Theertha Suresh, and Ke Wu. 2021. FedJAX: Federated Learning Simulation with JAX. CoRR abs/2108.02117(2021). arXiv:2108.02117https://arxiv.org/abs/2108.02117
[22]
Hao Wang, Zakhary Kaplan, Di Niu, and Baochun Li. 2020. Optimizing Federated Learning on Non-IID Data with Reinforcement Learning. In IEEE INFOCOM 2020-IEEE Conference on Computer Communications. IEEE, 1698–1707.
[23]
Han Xiao, Kashif Rasul, and Roland Vollgraf. 2017. Fashion-MNIST: A Novel Image Dataset for Benchmarking Machine Learning Algorithms. arxiv:1708.07747 [cs.LG]
[24]
Cong Xie, Oluwasanmi Koyejo, and Indranil Gupta. 2019. Asynchronous Federated Optimization. ArXiv abs/1903.03934(2019).
[25]
Zhaohui Yang, Mingzhe Chen, Walid Saad, Choong Seon Hong, and Mohammad Shikh-Bahaei. 2021. Energy Efficient Federated Learning Over Wireless Communication Networks. IEEE Transactions on Wireless Communications 20, 3(2021), 1935–1949. https://doi.org/10.1109/TWC.2020.3037554
[26]
Hao Yin, Pengyu Liu, Keshu Liu, Liu Cao, Lytianyang Zhang, Yayu Gao, and Xiaojun Hei. 2020. Ns3-Ai: Fostering Artificial Intelligence Algorithms for Networking Research. Proceedings of the 2020 Workshop on ns-3(2020), 57–64.
[27]
Lide Zhang, Birjodh Tiwana, Zhiyun Qianand Zhaoguang Wang, Robert P Dick, Zhuoqing Morley Mao, and Lei Yang. 2010. Accurate Online Power Estimation and Automatic Battery Behavior Based Power Model Generation for Smartphones. In Proceedings of the eighth IEEE/ACM/IFIP international conference on Hardware/software codesign and system synthesis. 105–114.

Cited By

View all
  • (2024)Evaluating Federated Learning Simulators: A Comparative Analysis of Horizontal and Vertical ApproachesSensors10.3390/s2416514924:16(5149)Online publication date: 9-Aug-2024
  • (2024)DAI-NET: Toward communication-aware collaborative training for the industrial edgeFuture Generation Computer Systems10.1016/j.future.2024.01.027155(193-203)Online publication date: Jun-2024
  • (2023)LoRaWAN Meets ML: A Survey on Enhancing Performance with Machine LearningSensors10.3390/s2315685123:15(6851)Online publication date: 1-Aug-2023

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Other conferences
WNS3 '22: Proceedings of the 2022 Workshop on ns-3
June 2022
134 pages
ISBN:9781450396516
DOI:10.1145/3532577
This work is licensed under a Creative Commons Attribution International 4.0 License.

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 22 June 2022

Check for updates

Author Tags

  1. federated learning
  2. network simulation
  3. ns-3

Qualifiers

  • Research-article
  • Research
  • Refereed limited

Conference

WNS3 2022
WNS3 2022: 2022 Workshop on ns-3
June 22 - 23, 2022
Virtual Event, USA

Acceptance Rates

Overall Acceptance Rate 54 of 82 submissions, 66%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)573
  • Downloads (Last 6 weeks)62
Reflects downloads up to 15 Sep 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Evaluating Federated Learning Simulators: A Comparative Analysis of Horizontal and Vertical ApproachesSensors10.3390/s2416514924:16(5149)Online publication date: 9-Aug-2024
  • (2024)DAI-NET: Toward communication-aware collaborative training for the industrial edgeFuture Generation Computer Systems10.1016/j.future.2024.01.027155(193-203)Online publication date: Jun-2024
  • (2023)LoRaWAN Meets ML: A Survey on Enhancing Performance with Machine LearningSensors10.3390/s2315685123:15(6851)Online publication date: 1-Aug-2023
  • (2023)Terahertz Meets AI: The State of the ArtSensors10.3390/s2311503423:11(5034)Online publication date: 24-May-2023

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media