Skip to content

xipid/rho

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rho

Docs Discord License Platform

Blazing-fast, zero-copy networking primitives that run everywhere — from ESP32 microcontrollers to bare-metal servers.

Rho is not a single project. It is a collection of composable networking layers, each one self-contained, each one purpose-built, and each one designed to be unrolled, inlined, and even synthesized into hardware.


Why Rho?

For game developers and real-time systems

Drop TCP. Drop QUIC. Rho's Server and Client give you what the game industry actually needs:

#include <Util/Server.hpp>
#include <Lines/Bind.hpp>

Bind bind("0.0.0.0:7777");
Server srv;
srv.hook(bind);

srv.onPacket([](Packet pkt, Tunnel& player, Cart cart) {
    // 60 Hz game state — unreliable, fire-and-forget
    player.push(gameState, 2, false);  // channel 2, not important

    // Kill event — reliable, guaranteed delivery
    player.push(killEvent, 3, true);   // channel 3, important
});
  • Unreliable channels out of the box — no stale retransmissions
  • No head-of-line blocking — lost packets on channel 2 don't stall channel 3
  • Built-in AEAD encryption — X25519 key exchange in one call
  • True 0-RTT reconnection — player switches WiFi → cellular, zero round-trips to resume
  • ~700 lines of implementation — not 200,000 like a QUIC stack
  • Runs on ESP32 — good luck getting QUIC on a microcontroller

For network architects

Rho was designed from scratch to replace the entire IP/BGP stack with something that actually makes sense:

  • Hierarchical variable-depth addressing — no more NAT, no more CIDR hacks, no more address exhaustion
  • Strict tree routing — each node knows only its parent and children, yet packets traverse continents
  • Self-built routing tables — no BGP advertisements, no convergence delays, no route leaks
  • Government-level manual peering at the top, automatic child registration below

A device at address 3.1.1.1 in Saudi Arabia sends a packet to 1.1.1.1 in the USA. The packet climbs the tree: 3.1.13.13 → fiber → 2 (transit) → fiber → 11.11.1.11.1.1.1. Each hop is a single table lookup. Each gateway holds maybe 50 entries. Even at 8 billion nodes.


The Layers

Rho is organized into three categories. Each one builds on the previous, but each one is independently useful.

Layer What it does Think of it as
Rho Railway Shared-bus multiplexing Ethernet + encryption
Rho Tunnel Reliable encrypted streams TCP/QUIC replacement
Rho Lines Cross-entity routing and bridging IP/BGP replacement

Rho Railway

Take any shared medium — LoRa, USB, UDP multicast, serial, a Unix socket — and make point-to-point connections possible. Cart is the packet. Station is the interface. Hook two stations together and they talk.

Rho Tunnel

Take a Station (unreliable, insecure) and turn it into a fully reliable, encrypted, multiplexed communication channel. Selective ACKs, congestion windows, packet fragmentation, AEAD encryption — all in one class.

Rho Lines

Take carts across entities that can't physically reach each other. Router builds a trie. Gateway wires it to Server/Client. Reach resolves names with Byzantine fault tolerance. Daemon configures it all from the filesystem.


Quick Start

It is not quite useful to build Rho itself, it is a library to be used...

If you want to build tests, or the rhod, do this:

git clone https://github.com/xipid/rho.git
cd rho
./build.sh

Rho is header-only. CMake automatically fetches Xi from GitHub if it's not found locally. For development, clone xic next to rho and CMake will use the local copy instead.

If you want to use this rho library itself, you could use:


include(FetchContent)

FetchContent_Declare(
    rho
    GIT_REPOSITORY https://github.com/xipid/rho.git
    GIT_TAG        main
    GIT_SHALLOW    TRUE
)

FetchContent_MakeAvailable(rho)


Platform Support

Platform Status
Linux (x86_64, ARM) ✅ Full support
ESP32 (lwIP) ✅ Full support
Any POSIX system ✅ Via Bind UDP sockets
Bare metal ✅ Via custom Station implementations

Documentation & Community

📖 Read the Docs — Architecture deep-dives, API references, and usage guides

💬 Join the Discord — Ask questions, share projects, contribute


License

Apache License 2.0

About

Composable networking primitives: blazing-fast Server/Client (QUIC alternative), trie-based Router (IP/BGP replacement), BFT name resolution, 0-RTT reconnection, AEAD encryption — runs on ESP32 and bare metal.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors