Utopia Documentation
Utopia serves as the foundational system infrastructure component for RDK-B middleware, providing comprehensive system initialization, configuration management, event bus services, and network service orchestration. This component acts as the backbone that enables inter-process communication, persistent configuration storage, and coordinated startup/shutdown sequences across all RDK-B middleware components.
Utopia provides three critical service layers to the RDK-B stack:
- System Infrastructure Services that handle system initialization, configuration persistence (syscfg), and inter-component messaging (sysevent);
- Network Service Management that orchestrates networking services including DHCP, firewall, routing, and WAN connectivity; and
- API Layer Services that expose standardized interfaces (UTAPI) for configuration management and system control to other RDK-B components and external management systems.
The component integrates deeply with the Linux system layer through direct HAL interactions, manages persistent data through filesystem-based storage mechanisms, and coordinates with other RDK-B components via RBus messaging protocol. Utopia's modular architecture supports platform-specific customizations while maintaining consistent service interfaces across different RDK-B device implementations.
graph LR
subgraph "External Systems"
RemoteMgmt["Remote Management"]
LocalUI["Local Web UI"]
end
subgraph "RDK-B Platform"
subgraph "Remote Management Agents"
ProtocolAgents["Protocol Agents<br>( TR-069, WebPA, USP etc.)"]
end
rdkbComponent["Other RDK-B Components"]
subgraph "Utopia"
subgraph "Utopia Core Services"
SysEvent[SysEvent Bus]
SysCfg[SysCfg Storage]
ServiceMgr[Service Manager]
UtAPI[UTAPI Library]
end
subgraph "Utopia Network Services"
DHCP[DHCP Service]
Firewall[Firewall Service]
Routing[Routing Service]
MultiNet[Multi-Network Service]
WAN[WAN Service]
IPv6[IPv6 Service]
IGD[UPnP IGD]
end
end
subgraph "Platform Layer"
HAL["Platform HAL"]
Linux["Linux"]
NetFilter[NetFilter/IPTables]
end
end
RemoteMgmt --> ProtocolAgents
LocalUI --> UtAPI
ProtocolAgents --> SysEvent
rdkbComponent --> SysCfg
UtAPI --> SysCfg
UtAPI --> SysEvent
ServiceMgr --> SysEvent
SysEvent --> DHCP
SysEvent --> Firewall
SysEvent --> Routing
SysEvent --> MultiNet
SysEvent --> WAN
SysEvent --> IPv6
SysEvent --> IDG
SysCfg --> DHCP
SysCfg --> Firewall
SysCfg --> WAN
Routing --> Linux
Firewall --> NetFilter
DHCP --> HAL
WAN --> HAL
HAL --> Linux
classDef external fill:#fff3e0,stroke:#ef6c00,stroke-width:2px;
classDef utopia fill:#e3f2fd,stroke:#1976d2,stroke-width:3px;
classDef rdkbComponent fill:#e8f5e8,stroke:#2e7d32,stroke-width:2px;
classDef system fill:#fce4ec,stroke:#c2185b,stroke-width:2px;
class RemoteMgmt,LocalUI external;
class SysEvent,SysCfg,ServiceMgr,UtAPI,DHCP,Firewall,Routing,MultiNet,WAN,IPv6,IGD utopia;
class ProtocolAgents,rdkbComponent, rdkbComponent;
class HAL,Linux,NetFilter system;
Key Features & Responsibilities:
- System Infrastructure Management: Provides core system initialization services including process startup coordination, dependency management, and system-wide configuration bootstrapping essential for RDK-B middleware operation
- Configuration Persistence (syscfg): Implements a high-performance shared memory-based configuration database with filesystem backing that enables atomic configuration updates and fast parameter retrieval across all system components
- Inter-Process Event Bus (sysevent): Operates a publish-subscribe event messaging system using Unix domain sockets that facilitates real-time communication and state synchronization between RDK-B middleware components
- Network Service Orchestration: Manages and coordinates networking services including DHCP server/client operations, firewall rule management, routing table updates, and WAN interface configuration through integrated service handlers
- Unified API Layer (UTAPI): Exposes standardized C APIs and command-line interfaces for system configuration, network management, and status monitoring that abstract platform-specific implementations from higher-level components
- Multi-Network Management: Provides advanced networking capabilities including VLAN management, bridge configuration, multi-WAN support, and service-specific network isolation through the service_multinet framework
Design
Utopia's architectural design follows a layered service-oriented approach that separates system infrastructure from application-specific networking logic. The core design principle centers around three foundational services: syscfg for configuration persistence, sysevent for inter-process communication, and UTAPI for external interface abstraction. These services operate as independent but coordinated daemons that provide reliable, high-performance infrastructure for the entire RDK-B middleware stack.
The design emphasizes scalability and maintainability through modular service decomposition, where each networking function (DHCP, firewall, routing) operates as an independent service process that communicates through standardized IPC mechanisms. Configuration changes propagate through the sysevent bus, triggering coordinated updates across dependent services without requiring direct inter-service dependencies. The shared memory-based syscfg implementation ensures configuration consistency while providing sub-millisecond access times critical for real-time networking operations.
Integration with external systems occurs through well-defined interface boundaries: northbound interactions with CCSP components use RBus messaging protcol, while southbound interactions with HAL and kernel services use direct API calls and system interfaces. The UTAPI layer provides configuration abstraction that enables platform-specific implementations while maintaining API compatibility across different hardware platforms. Event-driven service activation ensures efficient resource utilization and rapid response to network state changes.
Data persistence operates through a hybrid approach combining in-memory performance with filesystem reliability, where syscfg maintains active configuration in shared memory while asynchronously committing changes to persistent storage. The sysevent system supports both persistent and transient event states, enabling appropriate handling of both configuration changes and runtime status updates. Service startup orchestration follows dependency chains defined through sysevent triggers, ensuring proper initialization ordering without hard-coded dependencies.
%%{init: {"flowchart": {"curve": "basis", "rankSpacing": 50, "nodeSpacing": 40}}}%%
flowchart LR
subgraph UtopiaCore["Utopia Core"]
%% --- UTAPI Layer ---
subgraph UTAPI_Layer["UTAPI Layer"]
direction TB
UTAPI[UTAPI Library]
UTCtx[UT Context Manager]
end
%% --- Core Infrastructure ---
subgraph Core_Infra["Core Infrastructure"]
direction TB
SysCfg[SysCfg Service]
SysEvent[SysEvent Daemon]
SrvMgr[Service Manager]
end
%% --- Network Services ---
subgraph Net_Services["Network Services"]
direction TB
DHCP[service_dhcp]
FW[Firewall Service]
WAN[service_wan]
MNet[service_multinet]
Route[service_routed]
IPv6[service_ipv6]
IGD[UPnP IGD]
end
%% --- Utility Services ---
subgraph Util_Services["Utility Services"]
direction TB
DevMode[service_deviceMode]
DDNS[service_ddns]
DSLite[service_dslite]
UDHCPc[service_udhcpc]
end
end
%% --- Storage & IPC ---
subgraph Storage_IPC["Storage & IPC"]
direction LR
SharedMem[(Shared Memory)]
EventBus[(Event Bus)]
ConfigFiles[(Config Files)]
end
%% --- Main Flows ---
UTAPI --> UTCtx
UTCtx --> SysCfg
UTCtx --> SysEvent
SrvMgr --> SysEvent
SysCfg --> SharedMem
SysCfg --> ConfigFiles
SysEvent --> EventBus
%% --- Network Services Connections ---
Net_Services --> SysCfg
Net_Services --> SysEvent
%% --- Utility Services Connections ---
Util_Services --> SysEvent
Prerequisites and Dependencies
Build-Time Flags and Configuration:
| Configure Option |
DISTRO Feature |
Build Flag |
Purpose |
Default |
--enable-dslite_feature_support |
dslite |
DSLITE_FEATURE_SUPPORT |
Enable DS-Lite dual-stack lite tunneling support |
Enabled |
--enable-core_net_lib_feature_support |
core-net-lib |
CORE_NET_LIB_FEATURE_SUPPORT |
Enable advanced core networking library support |
Disabled |
--enable-extender |
extender |
FEATURE_RDKB_EXTENDER |
Enable WiFi extender/mesh device support |
Disabled |
--enable-hotspot |
N/A |
ENABLE_HOTSPOT_SERVICE |
Enable HotSpot captive portal functionality |
Enabled |
RDK-B Platform and Integration Requirements:
- RDK-B Components: CcspCommonLibrary, RBus messaging , persistent storage manager
- HAL Dependencies: Network HAL interfaces (WiFi, Ethernet, MoCA, DOCSIS)
- Systemd Services: Basic Linux systemd environment, Unix domain socket support, cron service integration
- Message Bus: RBus infrastructure for enhanced IPC performance (optional, falls back to direct calls)
- Configuration Files:
/etc/utopia/system_defaults, /nvram/syscfg.db, /etc/utopia/service.d/ service scripts
- Startup Order: Must initialize before CCSP components (PAM, PSM, TR-069 PA) that depend on configuration services
Threading Model:
Utopia employs a hybrid threading architecture that combines single-threaded event processing with multi-threaded I/O operations to ensure data consistency while maintaining responsiveness. The core sysevent daemon operates as a single-threaded event loop that processes all IPC messages sequentially, preventing race conditions in event ordering and state management. Network service handlers typically run as separate single-threaded processes that respond to sysevent triggers, enabling isolated failure domains and simplified debugging.
- Threading Architecture: Hybrid - Single-threaded for event processing, Multi-threaded for I/O operations
- Main Thread: Sysevent daemon main thread handles Unix domain socket connections, event routing, and client management using select()-based I/O multiplexing
- Main worker Threads:
- I/O Worker Threads: Handle file system operations for syscfg persistence, preventing blocking on main event processing thread
- Network Service Threads: Separate processes for DHCP, firewall, and routing services, each with dedicated single-threaded event handlers
- Synchronization: Shared memory access uses POSIX semaphores and memory barriers, sysevent uses Unix domain socket message queuing for thread-safe communication
Component State Flow
Initialization to Active State
Utopia follows a carefully orchestrated multi-phase initialization sequence that establishes core infrastructure services before activating network-specific services. The initialization process ensures dependency satisfaction and proper resource allocation while providing failure recovery mechanisms at each phase.
sequenceDiagram
autonumber
participant System
participant Syscfg
participant Sysevent
participant UTAPI
participant Services
participant Monitor
System->>System: Start [*] → SystemInit
Note right of System: Load system defaults<br>Initialize logging<br>Create shared memory<br>Set up IPC sockets
System->>Syscfg: Boot/Service Start → SyscfgInit
Note right of Syscfg: Initialize shared memory<br>Load persistent config<br>Setup syscfg database
Syscfg->>Sysevent: Initialize Configuration Storage → SyseventInit
Note right of Sysevent: Create Unix domain socket<br>Initialize event routing<br>Setup trigger manager
Sysevent->>UTAPI: Start Event Bus → UtapiInit
UTAPI->>Services: Initialize API Layer → ServiceRegistration
Services->>System: Register Network Services → DependencyCheck
System->>System: Validate Dependencies → Active
Note right of System: Process events<br>Handle configuration<br>Monitor services<br>Respond to requests
System->>System: Configuration Update → ConfigChange
System->>Services: Affected Service Restart → ServiceRestart
Services->>System: Service Synchronized → Active
System->>System: Interface State Change → NetworkEvent
System->>Monitor: Service Health Check Failed → FailureDetected
Monitor->>System: Restart Failed Service → ServiceRecovery
System->>System: Service Restored → Active
System->>System: Stop Request → Shutdown → [*]
Runtime State Changes and Context Switching
Utopia dynamically adapts to runtime conditions through event-driven state transitions that handle network topology changes, service failures, and configuration updates. The system maintains consistency through atomic state transitions and rollback mechanisms.
State Change Triggers:
- Network interface up/down events trigger service reconfiguration and routing table updates
- Configuration parameter changes propagate through sysevent bus causing coordinated service updates
- HAL device status changes trigger hardware-specific service adaptations
- External management requests (TR-069, WebUI) initiate controlled configuration transactions
Context Switching Scenarios:
- WAN failover scenarios where primary connection failure triggers automatic secondary interface activation
- DHCP lease renewal cycles that may require firewall rule updates and routing changes
- IPv6 address assignment changes that trigger neighbor discovery and routing protocol updates