Skip to main content

Federated communication layer

This section is for contributors working on the federated communication layer of FL-Net. It lives in the Federated-Learning-Communication-API repository and consists of two Go services:

  • Controller: one per federated learning node (participant and aggregator nodes, where the aggregator may either run on a Client or the Platform). It sends the data of a running federated Tool (e.g. model weights) via the Relay Server to other nodes and applies end-to-end encryption, SMPC, and DP. End to End encryption is not applies for broadcasts from the aggregator node for performance reasons.
  • Relay server: one per network, deployed with the Platform. All controllers connect to it, and it relays messages between them.

Neither service orchestrates federated learning: the Learning APIs register and start runs. How the controller and relay server are used during a run is described step by step in the Federated learning flow.

Getting started​

The README of the repository is the source of truth for the commands below. It also describes all configuration options and the internal architecture of both services.

Prerequisites: Go (version in go.mod), Docker for the images, and Python 3 for the end-to-end tests.

Build and start a relay server and a controller in development mode:

go build -o relay ./cmd/relay
go build -o controller ./cmd/controller

./relay --mode dev --tls-mode self-signed --domain localhost
./controller --address-tcp localhost:9141 --mode dev --tls-mode self-signed

Alternatively, docker compose up starts a relay and a controller from the published staging images.

Testing:

gofmt -l . # must print nothing
go test ./... # unit tests
pip install -r e2etests/requirements.txt
bash e2etests/e2e_test.sh # end-to-end tests (plain, DP and SMPC message flows)

CI additionally runs golangci-lint and govulncheck.