Skip to content

In-Network-Machine-Learning/FLIP4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FLIP4

License

Introduction

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

Prepare your environment

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.

Run a demo

To run this code:

  1. 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
  1. Open a new terminal to run a server:
$ python3 fedavg.py
  1. Open a new terminal to run clients on switches:
$ python3 FL_controller.py

FLIP4 Workflow

image

Aggregator

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.

Control plane logic

The file FL_controller.py is responsible for model parameter sharing and communication between the local data plane and the aggregator for updates.

Data plane logic

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

Citation

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:

Acknowledgment

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).

About

FLIP4 is a federated learning-based framework for in-network traffic analysis.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages