Technical Briefing – Free Internetworking Peering System (FIPS) Repository: https://github.com/moses-y/fips
What This Does
FIPS implements a decentralized mesh‑routing protocol built on Nostr‑style secp256k1 identities. Core Rust code lives under src/; the protocol stack, node lifecycle, and transport handling are defined in a handful of modules that together create a self‑organising network capable of spanning‑tree routing, bloom‑filter peer selection, and Noise‑based encryption. The testing/ tree contains Docker‑based chaos‑simulation harnesses used for protocol stress‑testing.
Key files:
src/bin/fips.rs– binary entry point (fn main).src/node/lifecycle.rs– node start/stop logic (fn start).src/control/queries.rs– RPC entry point (dispatch).src/transport/udp.rs– UDP overlay implementation.src/identity/local.rs– generation of Nostr keypairs.
All configuration is read from a fips.yaml file (search order documented in the README).
How It Is Wired
- Program start –
cargo build --releaseproducestarget/release/fips. Execution begins atsrc/bin/fips.rs:21(main). mainparses CLI flags, then callssrc/node/lifecycle.rs:234→start.startcreates aNode(viasrc/node/mod.rs:new) and spawns the control socket (src/control/mod.rs).- The control socket registers RPC handlers; the primary dispatch function is
src/control/queries.rs:399(dispatch), which reaches 42 other functions and is not called elsewhere. - Network I/O is handed to
src/transport/mod.rs(123 functions). UDP transport is instantiated insrc/transport/udp.rs, which ultimately callssocket::bind(external) and registers the packet channel. - Incoming packets are routed through
src/node/handlers/*. The most heavily used handler issrc/node/handlers/forwarding.rs, which participates in 8 distinct call paths. - Peer discovery and tree coordination rely on
src/protocol/*andsrc/bloom/*. The bloom filter (src/bloom/filter.rs) is invoked from 48 other files and providesinsert,contains, and serialization helpers. - Cryptographic identity handling flows through
src/identity/*;make_node_addr(154 call sites) andnode_addr(142 sites) are the highest‑fan‑out functions, making them the primary change‑impact points.
File‑level blast radius (calls from many places):
src/bloom/filter.rs– 48 callers, 25 functions reachable.src/transport/mod.rs– 17 callers, 123 functions reachable.src/node/mod.rs– 25 callers, 76 functions reachable.
No circular module dependencies were detected, simplifying static analysis and future refactoring.
How To Use It
# Clone and build
git clone https://github.com/moses-y/fips.git
cd fips
cargo build --release
# Run a node (requires root for TUN)
sudo ./target/release/fips # defaults, generates ephe‑meral identity
# or with explicit config
sudo ./target/release/fips -c fips.yaml
Configuration (fips.yaml) lives in the current directory, $HOME/.config/fips/, or /etc/fips/. A minimal two‑node example is documented in the README and uses the identity.nsec field for a Nostr secret key; omitting it generates a fresh key on each start.
For protocol‑level testing, the chaos harness can be built with Docker:
cd testing/chaos
docker build -t fips-chaos .
./scripts/chaos.sh # runs predefined scenarios
The harness reads testing/static/.env (currently committed) for environment variables; replace or remove it before production use.
Code Health & Issues
Measured findings (static analysis):
- HIGH – Deep nesting –
src/control/mod.rs,src/node/handlers/encrypted.rs,src/node/handlers/forwarding.rs(max depth 8). - HIGH – Duplicated code – repeated 6‑line blocks across 44 files (e.g.,
src/cache/coord_cache.rs,src/protocol/discovery.rs). - MEDIUM – Broad exception handling –
testing/chaos/sim/runner.pyuses bareexcept. - MEDIUM – Oversized files –
src/node/handlers/session.rs,src/node/mod.rs,src/node/tests/routing.rs(> 1 k LOC each). - MEDIUM – High branching density –
src/identity/encoding.rs(15 branches in 46 lines).
Code‑health audit adds:
- HIGH – No CI workflow – repository lacks any
.github/workflows/*. - HIGH – Deploy image not gated –
testing/chaos/Dockerfilebuilds without CI validation. - HIGH – Committed secret file –
testing/static/.envshould be removed and rotated. - MEDIUM – Dependabot missing – only one manifest (
Cargo.toml). - MEDIUM – Base image not pinned –
testing/chaos/Dockerfileusesdebian:bookworm-slim. - MEDIUM – No pre‑commit secret scan.
- MEDIUM – Docker image runs as root – add a non‑root
USER.
All issues include concrete fix recommendations in the audit; no additional concerns were found.
The Bottom Line
FIPS delivers a complete Rust‑based mesh routing stack with documented design assets and a functional test harness. The codebase is functional but shows classic early‑stage technical debt: deep nesting, duplicated logic, and large modules that will hinder maintainability. Absence of CI/CD and the presence of a committed .env are immediate risks for production use. The project is suitable for teams comfortable with Rust and willing to invest in refactoring and CI integration before deploying in a security‑sensitive environment.