Skip to main content

Overview

The etcd Server is ML Defender’s distributed coordination hub, providing centralized configuration management, automatic crypto seed exchange, and service discovery for all components. Implemented in C++ with the etcd v3 API, it ensures consistent state across the entire pipeline.

Core Functions

  • Distributed Configuration: Single source of truth
  • Crypto Key Exchange: ChaCha20-Poly1305 seed distribution
  • Service Registration: Component discovery
  • Health Monitoring: Heartbeat tracking

Performance

  • <50ms service registration latency
  • <100ms crypto seed exchange
  • 30-second heartbeat intervals
  • 60-second lease TTL

Architecture

The etcd Server acts as the coordination layer between all ML Defender components:

Key-Value Store Structure

Path: /crypto/<component>/tokens
Purpose: Automatic encryption key distribution without manual key exchange.

Crypto Seed Exchange

The etcd Server automates ChaCha20-Poly1305 key distribution across the pipeline:

Key Exchange Flow

1

Component Registration

Sniffer registers with etcd Server on startup:
2

etcd Generates Key

etcd Server generates a 256-bit ChaCha20-Poly1305 key:
3

Key Stored in etcd

Key persisted in etcd key-value store:
4

Downstream Components Retrieve

ML Detector and Firewall Agent retrieve the key:
Security: Keys are generated once at component registration and rotated every 24 hours automatically.

Service Registration & Heartbeats

Registration Protocol

Health Monitoring


C++ Implementation

The etcd Server is implemented in modern C++ using the httplib library for HTTP endpoints:

Configuration

etcd Server Configuration

Client Configuration (per component)


Deployment

Prerequisites

Build

1

Navigate

2

Configure

3

Compile

Run

Real-time Output:

API Reference

REST Endpoints

Request:
Response (200 OK):
Request:
Response (200 OK):
Request:
Response (200 OK):
Request:
Response (200 OK):
Request:
Response (200 OK):

Troubleshooting

Symptom: Components marked as unhealthy after 90 secondsSolution: Increase heartbeat frequency or TTL:

Next Steps

Sniffer

Configure network packet capture

ML Detector

Set up ML inference pipeline

Firewall Agent

Deploy autonomous blocking

Distributed Deployment

Multi-node etcd cluster setup