Network Layer: Bluetooth Mesh and Routing Algorithms
Managed Flooding and Node Density Theory
🕸 Network Layer: Bluetooth Mesh and Routing Algorithms
Butterfly's physical layer is built on Bluetooth Low Energy (BLE) technology, specifically leveraging the Advertising and Scanning features in the Generic Access Profile (GAP).
⚙️ Hardware Adaptation Specifications
The system adaptively adjusts according to device hardware:
BLE 4.0/4.2: Range 10–50 meters, low power mode, suitable for dense indoor social environments.
BLE 5.0+: Range 200–400 meters, supports "long range mode", suitable for outdoor music festivals/squares.
🛣 Routing Algorithm: Managed Flooding
For the mesh network routing algorithm, Butterfly abandons routing table mechanisms commonly used by protocols like ZigBee and instead adopts managed flooding. To prevent "broadcast storms," each relay node executes the following logic:
Time-To-Live (TTL)
Each packet is assigned a TTL value at initialization (default 7 hops). Each relay node decrements the TTL by 1. When TTL = 0, the node stops forwarding.
Message Cache
Each node maintains a sliding-window cache storing hashes of recently received Message_IDs. If Hash(Incoming_Packet) ∈ Cache, it indicates the message has already been processed or forwarded, and the node will immediately drop the packet.
Relay decision logic
🍏 Cross-Platform Challenges and Solutions
Implementing a persistent mesh network on smartphones faces operating system limitations, especially iOS's strict control of background Bluetooth advertising.
📉 Network Physics: Percolation Threshold
In random geometric graphs, only when node density exceeds a critical threshold does a "giant component" emerge.
For a Bluetooth connection radius m:
Conclusion: it is difficult to reach this density in the early stages in cities. Therefore, GTM strategy must focus on hyper-localized clusters(campuses, music festivals), where node density naturally exceeds , producing immediate network utility.
Last updated
