FLIP4 is a federated learning-based framework for in-network traffic analysis. This repo is the artifact for the paper "Federated In-Network Machine Learning for Privacy-Preserving IoT Traffic Analysis" published on ACM Transactions on Internet Technology. PDF
This setup is based on BMv2 in Ubuntu 20.04. We recommend the following guideline to set up a VM environment with Ubuntu 20.04
Please make sure the following packages are installed by running:
$ pip3 install -r ./requirements.txt
💡 To run the demo on Raspberry Pi, please follow the P4Pi guideline to configure the environment.
To run this code:
- Navigate to a use case folder (use case with dataset
$CIC-IDS2017$ as an example here), compile and run the BMv2 environment:
$ cd use_case_cic
$ make clean && make run
- Open a new terminal to run a server:
$ python3 fedavg.py
- Open a new terminal to run clients on switches:
$ python3 FL_controller.py
- The source of the dataset: CIC-IDS2017
The file fedavg.py continuously receives model parameters from the end nodes (clients) and aggregates the received parameters to form a global model based on the FedAvg algorithm.
The file FL_controller.py is responsible for model parameter sharing and communication between the local data plane and the aggregator for updates.
The file client_mapper.py maps the ML model to the data plane for in-network inference. The model can be further replaced by other classical ML models by Planter
FLIP4 builds upon Planter and P4Pir.
It is further inspired by IIsy, SwitchTree, pForest, federated-boosted-dp-trees.
If you find this code helpful, please cite:
@article{zang2024flip4,
title = {Federated In-Network Machine Learning for Privacy-Preserving IoT Traffic Analysis},
author = {Zang, Mingyuan and Zheng, Changgang and Koziak, Tomasz and Zilberman, Noa and Dittmann, Lars},
journal = {ACM Trans. Internet Technol.},
year = {2024}
}
💡 If you are interested in further details and more use cases of In-Network Machine Learning inference and how an ML model is mapped to a programmable data plane, please refer to Planter, IIsy, Linnet:
This work was partly supported by the Nordic University Hub on Industrial IoT (HI2OT) by NordForsk, VMware, and Innovate UK (Project No. 10056403) as part of the SmartEdge EU project (Grant Agreement No. 101092908).
