Giter VIP home page Giter VIP logo

ns-fl's Introduction

ns3-fl

Initial work by Emily Ekaireb

Description

Ns3-fl is a federated learning simulator which takes into consideration data, algorithm, and network. Ns3-fl is built off of two existing simulators, flsim and ns-3. Flsim is the federated learning simulator, which simulates data and algorithm over an ideal network. Ns-3 is an open source discrete event network simulator, created for research and educational use. Ns3-fl also contains an power module which computes the computational time, power, and energy, as well as the transmit power, and energy.

Installation

To install ns3-fl, first clone the respository. To clone the submodules, run

cd ns3-fl
git submodule update --init --recursive --remote

Next, install Anaconda.

Configuring each submodule

To configure the ns3-fl-network submodule, from the root directiory, run

cd ns3-fl-network
./ns3 configure --build-profile=debug
./ns3 build

To configure the flsim submodule, from the root directory, run

cd flsim
conda env create -f environment.yml
conda activate fl-py37

The above commands create and activate an Anaconda enviroment, with all of the dependencies needed to run flsim. For a more detailed description on setting up and running flsim, refer to the original flsim repository.

Simulation

To start a simulation, from the root directory, run

cd flsim
python3 run.py --config=configs/config.json 

To specify simulation parameters, we use the same configuration JSON files as in flsim, though we add more fields to allow for a wider range of data and algorithm settings, in addition to network settings.

There are examples of how to set up the configuration file in flsim/configs/ns3-fl.

Configuration Options

The configuration options which are not listed below were a part of the original flsim. Refer to the original flsim wiki for details on how to set these parameters. In the nested model section model:

  • size: Specifies the model size in kB. The model size will be used in the network code. In the nested section network,
  • folder: Specifies folder in the scratch file which should be run for the network. The default parameter, which works with the rest of our network settings, is wifi_exp.
  • type: Specifies the type of network to run the simulation on. Currently supported options are ethernet and wifi. The network code is in the scratch folder of the ns3-fl-network submodule.
  • wifi: A nested section, within the network section, that specifies configurations for the WiFi network.
    • loss: Specifies the mean of the range of propogation loss in the network. We use the RandomPropogationLossModel in the network code to simulate loss. The range for the loss is 20 below and above the specified mean.
    • max_packet_size: Specifies the maximum size for a packet to be sent over the network.
  • ethernet: A nested section, within the network section, that specifies configurations for the Ethernet network.
    • max_packet_size: Specifies the maximum size for a packet to be sent over the network.
  • device_type: Specifies the device type for the clients in the network simulation. The device type is used when calculating the average power and energy consumed during each round of the simulation. Currently, the supported options are 400 and 4 for Raspberry Pi 400s and 4s, respectively.

ns-fl's People

Contributors

halsimov avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.