Advanced Mesh Capability

The Chatters platform offers some interesting and cutting-edge mesh delivery capabilities. ChatterBoxes do not blindly parrot packets in hope they’ll get where they need to go. Instead, a ChatterBox uses various techniques to move packets efficiently, securely, and as quickly as possible, without relying on the same possible-points-of-failure (or privacy concerns) of many other messaging systems. At the heart of the Chatter platform’s delivery system are the mesh graph and the decentralized mesh cache.

Mesh Graph: Stored within each device’s FRAM, it represents the live connectivity and neighbors of every device within the cluster at any given time. The mesh graph is continually reconstructed by each ChatterBox as they watch LoRa traffic and use other tricky techniques to figure out the interconnectedness of each device in the cluster. This graph is consulted when figuring out the most efficient route for a packet to take.

Mesh Cache: Each ChatterBox has a certain amount of storage space in FRAM reserved for holding encrypted packets of other trusted devices. Only the original sender and final recipient are able to decrypt the message, but intermediary devices are able to see where the message (packets) are supposed to go. These “meshed” packets will be stored across multiple devices within the cluster, and will trickle their way to the final destination as opportunities present themselves.

Mesh Smart Routing

ChatterBoxes keep an evolving knowledge of all possible paths throughout the cluster. This knowledge is kept fresh and decentralized throughout the cluster. The result is that no matter how complicated your cluster is, ChatterBoxes will work together to find good ways to get messages delivered.

Ideal Scenario - Instant / Direct Delivery

“Person A” sends a message to “Person B,” who is in range with a powered-on ChatterBox. The message is encrypted, signed, transmitted over LoRa, received, decrypted, validated, and acknowledged. All this happens in about 1 or 2 seconds, after which both devices show the message, along with a check mark showing the message was definitely received. The message was encrypted using asymmetric keys of Person A and Person B, so no other devices (even trusted devices) in the area are able to read the message. No meshing is involved.

Mesh Delivery - Nearly Instant

“Some Sensor” needs to send data to “Hikers”, who are out of range. However, the Hikers do have their ChatterBox powered on. In this case, Some Sensor attempts instant delivery, but it fails. After a few seconds, Some Sensor instead puts the encrypted message into the mesh cache. The message is forwarded to whoever is in range, if they are capable of getting the message closer to the Hikers. Person B has his ChatterBox powered on, so it is targeted as the next hop. Person B’s device repeats the process, getting the packets to “Guy with big antenna”. Finally, the antenna guy’s massive boosted antenna is able to see the Hikers are within its range, so the message is delivered. The Hikers’ device receives/decrypts/etc, and then sends an acknowledgement (also via mesh). After a minute or so from the original send, the sensor has confirmation that the Hikers received its data.

Visualizing the Live Mesh Graph

On any running ChatterBox, you can connect (via USB) to a PC or Mac and vizualize that ChatterBox’s live view of the mesh graph using the python-based ChatterAnalyze app. Remember, each ChatterBox has it’s own view of the graph, and they will be very similar, but not 100% the same. The ChatterBox’s graph data relating to devices that are within fewer hops will typically be fresher. This mechanism is also what makes mesh the mesh delivery path get more efficient along the delivery path, possibly even cutting out hops at the end.

The graph above was generated by a device in my basement with direct connections to only two devices. In the visualization, green indicates a good, strong, and live connection. Yellow indicates a weak or stale connection. The easton device has been powered off for about 8 hours, which is why it’s connection to other devices appears yellow.

You can download the ChatterAnalyze source code and generate this yourself for your own cluster.

Mesh Delivery - Delayed

In this case, the tricky part isn’t necessarily the distance, but rather that the Hikers want to send a message to “Gray Man” who only comes within range occasionally. In this case, the Hikers’ message is routed to the guy with big antenna. The big antenna device will decide if it should hold onto the message for Gray Man, forward it along another path, or both. Whenever Gray Man’s device does come within range (maybe hours later), the message will be delivered, and the Hikers will receive confirmation.

Tuning Mesh Delivery Using Simulation

In order to be able to accurately test and tune mesh delivery algorithms without having to deploy them in all different elaborate scenarios, I created a simulation that mimics everything (within reason) about devices, their positions, differing antenna sensitivities, mobile devices, barriers, and everything else I could think of. This also lets me test tweaks to the mesh algorithms quickly and easily. The video below gives a short demonstration of this.