Architecture
Control plane separated from data plane for maximum flexibility and reliability
Control Plane Architecture
GovernFlow operates as an external control plane, completely separated from the VPN data plane. This separation enables centralized management, independent scaling, and failover without affecting active VPN sessions.
governflowd
Main daemon providing REST API, cluster coordination, session management, and OpenVPN integration via Unix socket.
governflow-ls
Licensing server for multi-tenant license management with RSA-SHA256 signed licenses and tier-based feature control.
governflow-query
Lightweight helper called by OpenVPN for client configuration, firewall rules, and route management.
libgovernflow
Shared library with common functionality: logging, config parsing, database connection pooling, and license verification.
┌──────────────────────────────────────────┐
│ GovernFlow Control Plane │
├──────────────────────────────────────────┤
│ │
│ ┌────────────────────────────────────┐ │
│ │ governflowd │ │
│ │ ┌──────────────────────────────┐ │ │
│ │ │ Core: config, log, db, http │ │ │
│ │ └──────────────────────────────┘ │ │
│ │ ┌──────────────────────────────┐ │ │
│ │ │ Plugins: 14 dynamic modules │ │ │
│ │ └──────────────────────────────┘ │ │
│ │ Ports: 8443 (API), 8444 (UDP), │ │
│ │ 8445 (Raft), Unix Socket │ │
│ └────────────────────────────────────┘ │
│ │ │
│ ┌─────────────────┴──────────────────┐ │
│ │ libgovernflow.so │ │
│ └────────────────────────────────────┘ │
│ │
├──────────────────────────────────────────┤
│ OpenVPN Data Plane │
├──────────────────────────────────────────┤
│ ┌────────────────────────────────────┐ │
│ │ OpenVPN Server + governflow-query │ │
│ │ (client-connect/disconnect hooks) │ │
│ └────────────────────────────────────┘ │
└──────────────────────────────────────────┘
Cluster Topology
Distributed architecture with Raft consensus for high availability
Leader Node
Handles all write operations and coordinates cluster state. Automatically elected via Raft consensus.
Follower Nodes
Replicate state from leader and handle read operations. Can become leader if current leader fails.
Quorum Protection
Writes require majority confirmation. Prevents split-brain and ensures zero data loss during failover.
Communication Channels
Data Flow
How GovernFlow integrates with OpenVPN for real-time configuration
Client Connects to OpenVPN
OpenVPN receives connection request and triggers client-connect script
governflow-query Fetches Config
Queries governflowd via Unix socket for client configuration (IP, routes, QoS, zone)
Configuration Applied
Firewall rules via pf/iptables, routes added, push file generated for OpenVPN
Session Tracked in Cluster
Session registered across all cluster nodes with distributed locking to prevent duplicates
Technology Stack
Built with performance and reliability in mind