mudRPC, gRPC for unstable networks

gRPC over LoRa and mesh radio

gRPC over LoRa and mesh radio is what a 512-byte sealed packet with no connection makes possible: gRPC’s service model where the link is a radio that is down more than up, a mesh that stores and forwards, or a LoRa frame of a few hundred bytes.

A mesh radio delivers when it can. A message may wait in a relay for an hour and arrive after the sender has moved on; two messages may arrive in the wrong order, or twice. gRPC’s connection cannot live there. mudRPC’s peer was built for it: every call has a ttl, the longest it is worth delivering, a week at most, and the mesh may hold it that long; a reply that arrives after the ttl is dropped and the call reported expired; a duplicate is dropped by its nonce, and a replay, however late, by a window of the newest 64 counters per sender. The payload is bounded by the frame, the number From gRPC gives, and the stubs encode it for you.

The transport is yours, since no two radios have one API: the peer hands you each outgoing item, a topic, a wire and its ttl, and you hand it each wire you receive; sent() tells it the radio took the item, and a radio that refuses keeps it for the next tick. The library’s own Udp, step 5 of every skill, is the one transport shipped, and Reticulum’s and DTN’s adapters are their authors’, written against adapters/CONFORMANCE.md; the simulator, sim, is the mesh you test against before a radio exists, with partitions, jamming, bandwidth collapse, floods and replays as scenario lines, and the six harnesses print the same log byte for byte.

Topics are the mesh’s addressing: a peer listens on its own name for its replies and on each service it serves, and a call goes out on the service’s name: every server that hears it answers, the caller keeps the first reply and drops the rest, so a device is called by its own name and a fleet is told by a publish. Events, a publish with no reply, ride the same topics. Over a radio the fleet key seals every wire and a signed fleet proves each sender, so a relay in the middle learns nothing but sizes and timing, and forges nothing.

The one-line change for a gRPC client is in From gRPC. This page belongs to gRPC without HTTP/2; the home page has the five-minute start.