SWARM: Self‑Organizing Wireless Asynchronous Relay Mesh
Overview
Cloud infrastructures can fail during large‑scale outages or emergencies, cutting off access to vital communication channels. SWARM provides a backup solution using a fully decentralized, peer‑to‑peer mesh network built on Apple’s Multipeer Connectivity framework. Nearby devices autonomously discover each other, form links, and relay packets without relying on any central server.
Explanation
Peer Discovery & Mesh Formation
Each device running the app becomes both discoverable and a relay node. When devices detect one another, they create edges in a dynamic graph. Any group of directly or indirectly linked devices forms a connected component that allows messages to reach nodes even if they are outside direct radio range.
Decentralized Connected‑Component Tracking
The problem of finding all reachable devices reduces to a connected component graph problem. Without a central registry, maintaining a global view of active devices is challenging. SWARM uses a distributed, two‑phase backpropagation algorithm inspired by classical distributed DFS to compute connected components using only local information.

Message Dissemination via Flooding Protocol
Communication uses a Flooding Protocol, similar to how a flood reaches every place. Each node forwards messages to its neighbors. We made the design decision to use the protocol over other P2P protocols such as Gossip/Epidemic propagation, DHT-based routing, or mesh-optimized Pub/Sub (e.g., Gossipsub) because flooding guarantees that every reachable node in the connected component receives the message without requiring global routing tables, node degree assumptions, or complex overlay maintenance. In a dynamic, ad-hoc mesh like Multipeer Connectivity, flooding avoids issues such as single points of failure, reliance on bootstrap nodes, and the overhead of maintaining distributed routing state as peers constantly appear and disappear.
Next Iterations
Improve discoverability: Enhance peer-finding mechanisms to detect nearby nodes faster and more reliably. Add monitoring systems: Integrate lightweight swarm-health and message-tracking features similar to BitTorrent’s peer monitors. Improve UI: Refine the interface for clearer network status, connections, and message flow visualization.
Built With
- b2b-ai-saas
- multipeer-connectivity
- react-native
- typescript
Log in or sign up for Devpost to join the conversation.