Esp32 Mesh Network Design
A Wi-Fi mesh network built from ESP32-class nodes solves a problem a single access point can't: covering a physical space larger than one device's radio range by having nodes relay traffic for each other, so a device at the far edge of a building reaches the network through intermediate nodes rather than needing a direct link to the router. A standard Wi-Fi deployment requires every client device to be within range of an access point; a mesh network instead lets any node that can't reach the root connection directly hop its traffic through a neighboring node that can, extending effective coverage well beyond what any single radio's range would otherwise allow — at the cost of a genuinely harder networking problem than a simple star topology ever has to solve.
Self-healing topology — the mesh automatically reorganizing when a node drops out — is what makes a mesh network genuinely more resilient than a star topology, but it's also where most of the protocol's real complexity lives, because every node losing its parent has to find a new path back to root without creating a routing loop or a split network. A simple star network has exactly one failure mode worth worrying about — the single access point going down takes everything with it; a mesh network instead has to handle any interior node failing, which means every child of that failed node needs a deterministic, loop-free process for finding a new parent and re-establishing its route back to the root, all while other parts of the mesh keep operating normally — getting that re-formation logic wrong produces a network that looks resilient on paper but actually fragments or loops under real-world node churn.
Multi-hop latency and throughput degradation accumulate with every additional hop a packet travels, which means mesh coverage isn't free — a node several hops from the root genuinely experiences worse performance than one directly connected, and that tradeoff has to be sized deliberately rather than treated as a minor detail. Every intermediate hop adds queuing delay, and because each node is sharing its own radio airtime between its own traffic and the traffic it's relaying for children, deep mesh trees can see meaningfully reduced effective throughput at the leaves farthest from root — which is exactly why practical mesh deployments cap the maximum tree depth and node count a single mesh network should support, rather than assuming mesh coverage scales indefinitely just by adding more nodes.
Security on a mesh network has to protect node-to-node links, not just the root's connection to the real internet-facing router, because every hop is itself a wireless link an attacker could target. A flat star network has one security boundary worth worrying about — the connection between client and access point; a mesh network has as many wireless links as there are parent-child relationships in the tree, and every one of those links needs its own authentication and encryption, since a compromised or spoofed intermediate node could otherwise intercept or inject traffic for every device relying on it as a relay — mesh security schemes accordingly authenticate and encrypt each hop independently rather than relying on end-to-end encryption alone to paper over an untrusted relay path.
Mesh networking on ESP32-class nodes trades the simplicity of a single access point for coverage a star topology could never achieve on its own, but that trade comes with real engineering obligations: self-healing topology logic that actually avoids loops and splits under node churn, a deliberate limit on tree depth so multi-hop latency doesn't quietly degrade the farthest leaves, and per-hop security treating every node-to-node link as its own attack surface rather than trusting the mesh's internal relay path by default.