Cross-language IPC library for Netdata plugins and helper services.
This repository contains the C library, Rust crate, and Go package for the same wire contracts and typed APIs. The goal is simple:
- one specification
- one interoperable protocol stack
- one typed service model
- one local snapshot/cache helper layer
- three implementations: C, Rust, Go
This README is a summary of the current verified state of the repository. The authoritative specifications live under docs/.
- Level 1 transport
- connection lifecycle
- handshake and profile negotiation
- framing, chunking, batching, pipelining
- baseline and shared-memory transports
- Codec
- wire encode/decode
- typed views
- response builders
- validation rules
- Level 2 typed API
- typed client calls
- managed typed servers
- retry / reconnect behavior
- internal reusable buffers
- Level 3 snapshot API
- refresh
- local cache construction
- fast hash lookup
- cache preservation on failure
The design is layered:
- Level 1 and Codec are parallel building blocks
- Level 2 composes Level 1 + Codec
- Level 3 builds on Level 2
See:
| Platform | Baseline transport | Negotiated fast path | Languages |
|---|---|---|---|
| POSIX / Linux | Unix domain SOCK_SEQPACKET |
POSIX shared memory | C, Rust, Go |
| Windows | Named Pipes | Windows shared memory | C, Rust, Go |
Important facts:
- the same wire contracts are implemented in all three languages
- cross-language interoperability is mandatory
- Go stays pure Go, without
cgo - Level 2 and Level 3 are transport-agnostic from the caller perspective
Level 1 works with framed byte messages.
It owns:
- send / receive
- message IDs
- batch directories
- chunk continuation
- profile negotiation
- transport-specific session details
Relevant specs:
- docs/level1-transport.md
- docs/level1-wire-envelope.md
- docs/level1-posix-uds.md
- docs/level1-posix-shm.md
- docs/level1-windows-np.md
- docs/level1-windows-shm.md
Codec is pure wire-format logic.
It owns:
- encode / decode
- typed views over payload bytes
- response builders
- validation of field layout and bounds
It does not own:
- sockets
- pipes
- shared memory mappings
- retries
- cache policy
Relevant specs:
Level 2 is the public convenience layer.
The public contract is:
- clients issue typed calls
- servers register typed handlers
- callers do not manage transport scratch buffers
- callers do not manipulate raw payload bytes
Relevant specs:
Level 3 provides:
- typed snapshot refresh
- local materialization
- O(1)-style hash lookup on the hot path
- cache retention across refresh failures
Relevant spec:
This repository is intentionally built around interoperability, not single-language wrappers.
What is covered:
- C client -> C / Rust / Go server
- Rust client -> C / Rust / Go server
- Go client -> C / Rust / Go server
- baseline transport matrices on POSIX and Windows
- shared-memory matrices on POSIX and Windows
- typed Level 2 services
- snapshot refresh and local lookup flows
- benchmark matrices across all directed pairs
The interop results are validated by the test suite and by the checked-in benchmark reports:
The repository includes checked-in benchmark reports with complete, fail-closed matrices:
- POSIX report: benchmarks-posix.md
- generated
2026-03-22 - machine:
costa-desktop - complete matrix rows:
201
- generated
- Windows report: benchmarks-windows.md
- generated
2026-03-24 - machine:
win11 - complete matrix rows:
201
- generated
Headline numbers from the current checked-in reports:
-
POSIX baseline UDS ping-pong
166.9kto190.5kreq/s across the 3x3 language matrix
-
POSIX SHM ping-pong
2.41Mto3.33Mreq/s
-
POSIX UDS batch ping-pong
19.38Mto28.65Mreq/s
-
POSIX SHM batch ping-pong
24.94Mto44.88Mreq/s
-
POSIX snapshot refresh
- baseline:
139.3kto166.0kreq/s - SHM:
988.4kto1.67Mreq/s
- baseline:
-
POSIX local cache lookup
- C:
73.12Mreq/s - Go:
110.46Mreq/s - Rust:
198.75Mreq/s
- C:
-
Windows Named Pipe ping-pong
19.1kto21.5kreq/s
-
Windows SHM ping-pong
2.04Mto2.75Mreq/s
-
Windows Named Pipe batch ping-pong
7.26Mto8.44Mreq/s
-
Windows SHM batch ping-pong
38.25Mto60.13Mreq/s
-
Windows snapshot refresh
- Named Pipe:
19.2kto21.0kreq/s - SHM:
862.5kto1.29Mreq/s
- Named Pipe:
-
Windows local cache lookup
- C:
125.06Mreq/s - Go:
116.71Mreq/s - Rust:
175.15Mreq/s
- C:
The full reports include:
- per-pair throughput
- latency percentiles
- client and server CPU
- complete scenario validation summaries
- performance floor checks
The repo is not asking the reader to trust the design on words alone. The current validation story includes:
- CMake-based build and
ctestworkflows - unit tests
- cross-language interop tests
- typed service tests
- transport tests
- shared-memory tests
- coverage scripts for C, Go, and Rust
- benchmark generators that reject incomplete matrices
Linux / POSIX:
- build: passing
ctest:37/37passing- C coverage:
94.1% - Go coverage:
95.8% - Rust coverage:
98.57%- measured with
cargo-llvm-cov - Linux run now excludes Windows-tagged Rust files from the Linux total
- Unix Rust service tests now live in a separate
cgroups_unix_tests.rsfile - Unix Rust transport tests now live in separate
posix_tests.rsandshm_tests.rsfiles - the small Rust protocol test modules stay inline for now because externalizing them lowered the headline total without enough runtime-signal benefit
- measured with
Windows (win11):
- build: passing
ctest:28/28passing- C coverage:
93.9% - Go coverage:
96.7% - Rust coverage:
93.68%
Important honesty point:
- core build, transport, service, interop, and benchmark validation is strong on both Linux and Windows
- Linux still has broader chaos / hardening / stress breadth than Windows
- so the platforms are in good functional parity, but not yet in full validation parity
Coverage details:
The specs are authoritative.
Rule:
- when code and spec disagree, the spec wins unless explicitly revised
Start here:
Recommended reading order:
- docs/README.md
- docs/getting-started.md
- docs/level2-typed-api.md
- docs/level3-snapshot-api.md
- the relevant Level 1 transport spec for your platform
cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build build -j4
ctest --test-dir build --output-on-failure -j4Coverage:
bash tests/run-coverage-c.sh
bash tests/run-coverage-go.sh
bash tests/run-coverage-rust.shUse a mingw64 shell with native Windows cargo and go ahead of any MSYS
toolchain copies in PATH.
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build build -j4
ctest --test-dir build --output-on-failure -j4Coverage:
bash tests/run-coverage-c-windows.sh
bash tests/run-coverage-go-windows.sh
bash tests/run-coverage-rust-windows.shFor practical Windows workflow details, see:
.
├── bench/
│ └── drivers/
├── docs/
├── src/
│ ├── crates/netipc/
│ ├── go/pkg/netipc/
│ └── libnetdata/netipc/
└── tests/
├── fixtures/
└── run-*.sh
Main implementation roots:
- C: src/libnetdata/netipc/
- Rust: src/crates/netipc/
- Go: src/go/pkg/netipc/
This is the honest current state:
- coverage thresholds are enforced, but they are not at
100% - Linux and Windows are functionally close, but Windows still has less chaos / hardening / stress breadth
- some documented exclusions still require special infrastructure such as:
- allocation-failure injection
- kernel / OS failure injection
- race-window orchestration
Those limits are tracked explicitly instead of being hidden:
If you need the shortest trustworthy summary:
- the protocol stack is specified, implemented, and measured in C, Rust, and Go
- interop across the three languages is a core requirement, not an afterthought
- both POSIX and Windows have validated baseline and SHM benchmark matrices
- the public service API is typed
- the local snapshot/cache layer is implemented and benchmarked
- the repo has real tests, real coverage, and real benchmark artifacts checked in
For design details, start with docs/README.md.