There was a fascinating article posted on Medium this week by the CTO of messaging app Firechat:
In the text he outlines how they do decentralized "off-the-grid" private messaging using an ad hoc mesh network established between users of the Firechat app. It sounds like the app instances join together into some kind of peer-to-peer (P2P) network and then do normal "store-and-forward" messaging.
Of note, the apps do NOT need an Internet connection, or even a cellular network connection - instead they can use the Bluetooth and WiFi radios in the mobile phones to create a private mesh network and connect to other users of the Firechat app.
Naturally, having spent some time exploring P2P networks back when I was playing around with P2P SIP and distributed hash tables (DHTs) and other technologies, I immediately jump into the techie questions:
- How are they routing messages from one user to another?
- How is the "directory" of users in P2P mesh maintained?
- What addresses are they using for the communication? Is this still happening over IP addresses? Or are they using some other kind of addressing?
- How do users join and leave the mesh network?
- How do user get authorized to join the private mesh? (Or is it just open to all?)
- How secure is the communication between the parties?
- Is the message encrypted or private in any way? Or is it just plain text?
- How well do smartphone batteries hold up if multiple radios are being used? What is the power impact of joining into a mesh network like this?
None of that is covered in this article, of course... this piece is more about the theory of how this can work given a particular density of users. It introduces the phrase "percolation threshold" and provides some background and research into how these kind of networks can be created.
I've always been fascinated by P2P networks like this sounds to be. The beauty of the Internet... the "Internet Way", so to speak... has been to support distributed and decentralized architectures.
If you think about mail or web servers, they are (or at least were) massively distributed. Anyone could set up a mail or web server - and millions upon millions of them bloomed. While we've certainly seen a great amount of centralization due to market dominance (ex. Gmail), the architecture still is distributed / decentralized.
Except... of course, the directory is still centralized. Mail and web servers rely on the central directory of DNS to resolve domain names into IP addresses so that connections can occur. Most other applications rely on DNS for this as well.
Hence my curiousity about how Firechat is handling the directory and routing issues.
I'm also intrigued by how the article hints at integrating Internet-connected users into the P2P mesh. So you really have a hybrid network that is part P2P and part connected out to cloud-based servers.
(And all of this brings me back to those early days of Skype 8-10 years ago when so many of us were captivated by the P2P mechanisms they created... most all of which is now gone in the post-Microsoft-acquisition as Skype has moved from P2P to server/cloud-based - with one big reason being given that mobile devices apparently had speed and battery life issues participating in true P2P networks.)
A key challenge Firechat faces, of course, is the "directory dilemma" of building up the quantity of users where P2P mesh networks like this can happen. This is the same dilemma facing basically all over-the-top (OTT) messaging apps. "Percolation theory" requires a certain user density for a mesh like this to work.
That will be their struggle.
And in some urban areas I can see this working quite well. Perhaps not so much out in the woods of New Hampshire where I live!
But I wish them well with this. I love to see new explorations of potential new architectures for communication. And I can certainly see instances when ad hoc, distributed/decentralized P2P meshes like these could be quite useful.
And I'm definitely looking forward to some more technical articles that dive down into some of these questions.... I do hope they'll write more soon!
Photo credit: Stanislav Shalunov's article about Firechat