How rdkcentral/unified-wifi-mesh works
Project type and purpose
• This is a native C/C++ networking/control‐plane application implementing the Wi-Fi EasyMesh specification.
• It exposes three main runtime binaries:
• em_agent – runs on each managed access point
• em_ctrl – central controller/orchestrator
• em_cli – command‐line client for operators
• It also includes core libraries (Data Model, EasyMesh logic, abstraction layer) and persistence (DB client).
File structure
• Top‐level directories under src/:
• agent/ (agent binary implementation)
• ctrl/ (controller binary implementation)
• cli/ (CLI binary, with Go etree parser support)
• cmd/ (command definitions reused by CLI, agent & ctrl)
• db/ (database client abstraction)
• dm/ (Data Model objects: network, device, BSS, policies, etc.)
• em/ (EasyMesh core: discovery, provisioning, steering, state machines)
• orch/ (orchestrator glue between agent & controller)
• util_crypto/ (AES‐SIV library)
• utils/ (shared utilities)
• inc/ mirrors all public headers.
• build/, Makefile.am, and GitHub workflows drive CI and cross‐compilation.
• tests/ contains unit tests using GoogleTest.
README and docs
• README points to docs/UnifiedWifiMesh.pdf, which describes the EasyMesh state machines and message flows.
Main components
a. em_cli (CLI binary)
– User interface to issue commands over IPC (e.g., Unix domain socket or TCP)
b. em_ctrl (Controller)
– Central orchestrator; receives CLI commands, issues control messages to agents
– Houses “orch” layer
c. em_agent (Agent)
– Runs on each managed AP; receives control messages, configures local hardware via Data Model & AL‐SAP
d. Core libraries
– Data Model (dm/) – in‐memory representation of networks, radios, SSIDs, stations, policies
– EasyMesh (em/) – discovery, provisioning, steering, metrics, SM logic
– AL‐SAP (al-sap/) – abstraction layer for IEEE 1905 service access points and data units
– DB client (db/) – persists state/events if needed
– Utilities (utils/, util_crypto/, cjson_util)
e. Inter‐process & network interfaces
– IPC (CLI ↔ Controller, Controller ↔ Agent)
– IEEE 1905 messages over the local LAN for discovery & topology sync
f. External systems
– Underlying OS network interfaces, hardware drivers
– Optionally other controllers or management platforms via northbound APIs
Relationships & data flows
• User → em_cli → (IPC) → em_ctrl
• em_ctrl → (internal orch APIs) → EasyMesh Control API
• em_ctrl → (IPC or network) → em_agent
• em_agent → DM & AL‐SAP modules → hardware (radio firmware, hostapd, nl80211)
• em_agent → (IEEE 1905) → neighboring agents for topology/discovery
• DM & EM modules exchange events/messages via in‐process queues
• DB client may log events or persist state for replay/testing
Architectural patterns
• Layered architecture:
• Presentation (CLI)
• Orchestration (Controller/Orch)
• Core logic (EasyMesh state machines, DM, AL‐SAP)
• Persistence (DB client)
• Modular design: clear separation into libraries & binaries
• Message‐based event handling and state machines
• Reuse of cmd/ layer to share command definitions
Final checklist
• Related modules (e.g., all under “Agent process”) with a lightly shaded container
• External dependencies (OS, drivers, IEEE 1905 network) as boundary elements