Hi Gophers!
I’d like to introduce ubusio, an open-source implementation of the native OpenWrt ubus IPC protocol written entirely in Go.
I developed this library to build networking and embedded Linux services in Go without relying on CGO, C libraries, or external CLI processes.
Key features
-
100% Go, zero third-party dependencies
-
Direct Unix socket communication
-
Native ubus client and server
-
Binary blobmsg encoding and decoding
-
RPC calls and streaming responses
-
Events, notifications and subscriptions
-
Automatic reconnect and registration recovery
-
Unix file descriptor passing (SCM_RIGHTS)
-
Deferred requests
-
Monitor interface
-
Context-aware operations and graceful shutdown
-
Bounded queues and worker pools
Testing and performance
The library has been tested against native ubusd on real embedded hardware:
-
ARMv7: Orange Pi Zero, OpenWrt 21.02.2
-
ARM64: MediaTek MT7981, OpenWrt 25.12.5
The repository includes protocol compatibility tests, lifecycle stress tests, race detection, and reproducible benchmarks against the original C libubus implementation.
While libubus remains faster for individual RPC calls, ubusio reaches approximately 84% of its throughput in the ARMv7 benchmark with 64 concurrent clients under the documented test conditions.
Getting started
go get github.com/ddffcczz/ubusio@v0.2.1
-
GitHub: GitHub - ddffcczz/ubusio: Pure Go IPC for OpenWrt · GitHub
-
Go documentation: ubusio package - github.com/ddffcczz/ubusio - Go Packages
-
Latest release: Release ubusio v0.2.1 · ddffcczz/ubusio · GitHub
-
License: MIT
I’d appreciate feedback on the API design, concurrency model, performance, and potential use cases in embedded Linux and networking applications.
Contributions and bug reports are welcome!