Stuff

Mobile Mesh Networking: How to Build a Router-Free Smartphone Network

The internet stopped being a place of unfettered freedom and impunity long ago. Today the Net is tightly controlled, and any attempt to cross the illusory line of free expression—one even its architects can’t clearly define—is stamped out. China blocks VPNs, Russia tries to bring Durov to heel, and Europe is obsessed with copyright. But what if we built our own internet? Not Tor and the dark‑web scene, but a literal new network—one that connects our smartphones directly in the name of free information sharing.

The Advent of Mesh Networks

In the early 1990s, Charles Perkins of Sun Microsystems and Chai Keong Toh of the University of Cambridge independently began working on a new kind of computer network that, instead of relying on the conventional Internet infrastructure, would use direct wireless links between peers, with each peer simultaneously acting as sender, receiver, and router of data.

In the simplest case, such a network could consist of two or three geographically dispersed participants. If there were only two nodes, they would just exchange data directly. When a third node came online but was within range of only one of the original two, the network would automatically reconfigure so all nodes could reach each other, using that intermediary node as a router. Over time, more nodes could appear, the links between them would grow more complex, routes would get longer, alternative paths would emerge, and the network would expand geographically, covering ever larger areas.

That was the original idea, later dubbed a “wireless ad hoc network” or “wireless mesh network.” Its widespread adoption was held back by several factors: immature dynamic routing technologies; the limitations of the networking equipment and computers of the time, which couldn’t deliver sufficient throughput in large networks; and the low penetration of wireless data technologies. In the end, it wasn’t clear where this constrained new technology fit amid the broader obsession with the Internet. About the only ones interested were the military, who wanted something like it to rapidly deploy a network right on the battlefield.

However, in 2004, the wireless mesh network guifi.net came to life, deployed across Catalonia in Spain. According to the legend, locals got fed up with waiting for decent internet service and decided to build their own network—using Wi‑Fi routers, supernodes, and gateways to the very Internet everyone had heard about but hardly anyone had actually seen.

Today, guifi.net includes about 33,000 nodes and spans roughly 46,000 square kilometers. Connecting to it costs nothing beyond a Wi‑Fi router running a modified DD‑WRT firmware. Routers mesh together to form what’s called an “island,” where all nodes exchange data with each other as described above. Islands are interconnected via supernodes, which can be linked using either wired or wireless technologies. Internet access is provided in the same way.

There’s a similar network in Athens, and like guifi.net, it’s not our focus. We’re much more interested in mobile mesh networks.

Map of guifi.net
Map of guifi.net

Mobile Mesh Networks

The idea of mesh networks that wouldn’t require specialized hardware to connect to each other surfaced almost as soon as Wi‑Fi‑enabled laptops became widespread. However, much like the early ’90s experiments, these networks never made it beyond research labs and military test ranges, and everyday users came to use the term “ad hoc” to mean nothing more than a direct link between two laptops, with one acting as an access point and sharing its internet connection.

The same thing happened with smartphones. We all know how easy it is to turn an Android phone into a hotspot: a couple of taps and anyone nearby can jump on. But do you know how to link a large number of smartphones into a self-organizing mesh network?

FireChat

In 2014, an app called FireChat appeared in the App Store and Google Play. At first glance it looked like a typical messenger, a la WhatsApp or Telegram, but it worked very differently. FireChat leveraged Wi‑Fi Direct and ad‑hoc Bluetooth to connect nearby devices directly, then stitched them together into a mesh network so messages could hop across a chain of phones to reach the recipient.

If any smartphone in the chain had Internet access, the message was also relayed to the server, so FireChat could not only mesh local phone networks but also bridge one network to another. If there were no other nearby smartphones running FireChat, the app fell back to the traditional server-based mode.

Map of a FireChat mesh network
Map of a FireChat mesh network

FireChat became popular among protesters in various countries. It was used during the protests in Iraq, China, Taiwan, and several others. It also caught on at the Burning Man festival, and the CTO of the French government urged citizens to install FireChat during the march following the Charlie Hebdo attack. The app received several awards for its innovative technology—and an “anti-award” from AT&T, which demanded it be removed from the app store over what it called unauthorized Internet sharing (tethering).

FireChat is still available in the App Store and Play Store today, but it isn’t particularly popular. The Android version drains the battery quickly and repeatedly drops the Wi‑Fi connection as it tries to switch it into Wi‑Fi ad hoc mode. That said, the app is still usable if you really want to use it.

FireChat
FireChat
FireChat

Internet Sharing

Besides FireChat, Open Garden’s developers also built an Internet sharing app that can turn a smartphone into a hotspot. It creates a mesh network linking multiple devices together and routes their traffic through phones that have an Internet connection.

Briar

FireChat recently got a serious competitor: Briar. Its developers went even further and built an app that not only works in both modes (with and without Internet connectivity) but also doesn’t use any server at all.

When there’s no Internet, Briar tries to connect to nearby peers over Bluetooth and Wi‑Fi. It then asks them for information about other nodes on the network and can start exchanging messages with them. If Internet access is available, Briar discovers contacts using a distributed hash table (DHT) and connects to them using the Tor network as the transport. In both cases, Briar doesn’t rely on servers or centralized data storage—it’s a fully decentralized P2P solution.

Briar architecture
Briar architecture

Briar is not so much a messenger as a platform for building an independent, unregulated network. The app lets you run blogs and create forums, and the developers plan to add collaborative document editing in the future.

Briar is developed by a six-person team that includes Jack Grigg, a core I2P developer; Michael Rogers, who has worked on Freenet and LimeWire; and Torsten Grote, the author of the Free Your Android initiative. Briar’s code is released under the GPLv3 and has already undergone a security audit by Cure53, which has also audited SecureDrop, Cryptocat, and Dovecot.

Briar is currently available only on Android as a public beta. The network itself is running in test mode—on October 21 all data, including contact lists and message archives, will be wiped. This precaution is meant to protect users from potential risks associated with vulnerabilities that may be discovered during testing.

Briar
Briar
Briar

Serval Project

The broader public only started paying attention to mobile mesh networks after the FireChat app appeared. But even before it was on the scene, there was the Serval project, backed by Mark Shuttleworth’s foundation—Shuttleworth being the Ubuntu founder who flew to space.

Serval is a platform for building mesh networks. Its core component, called DNA, includes implementations of the Mesh Datagram Protocol (MDP), Voice over Mesh Protocol (VoMP), the Rhizome file distribution system, and the MeshMS messaging system.

Serval DNA can run on a wide range of platforms, including Linux, macOS, OpenWrt, and, of course, Android. On Android, you need to install the Serval Mesh app (https://play.google.com/store/apps/details?id=org.servalproject), which implements the capabilities provided by DNA: encrypted voice calls, encrypted text messages, and file sharing. The app also includes a button to launch maps, but that feature hasn’t been implemented yet.

Unlike FireChat and Briar, Serval Mesh implements a true mesh that doesn’t operate over the Internet and therefore can’t bridge multiple separate networks. The developers proposed another approach — the Extender, a router-like device preloaded with Serval DNA that can significantly expand the network’s coverage. The Indiegogo campaign didn’t reach its goal, but the team is ready to start production if funding becomes available.

Serval Mesh
Serval Mesh
Serval Mesh

Not quite mesh

FireChat’s success showed that mesh networks can find traction outside the military and academia. Many developers rushed to adopt the trendy tech. But, as so often happens, they didn’t really understand how it works and ended up shipping something odd.

Wi‑Fi Talkie is a solid example of this kind of app. It’s a messenger that works directly over Wi‑Fi, but it can’t build a true mesh network. Instead, it creates a Wi‑Fi hotspot that others can join to exchange voice or text messages. All traffic routes through the central phone, so if that device goes offline, users lose connectivity with each other.

Signal Offline Messenger (not to be confused with Signal) is another messenger built on the same concept. Instead of a software access point that other nodes join, it uses Wi‑Fi Direct to connect two devices directly with minimal hassle. Peers connect directly but don’t form a mesh, so you can only chat with people within Wi‑Fi range.

Twimight for Twitter is a more intriguing project. It’s a Twitter client with an “offline” mode. Here’s how it works: if, when sending a tweet, the client detects there’s no connection to the outside network, Twimight establishes a Bluetooth link with nearby smartphones and sends the tweet directly to them. Those phones then relay the tweet further, and so on, until all nearby smartphones have received the message. Naturally, Twimight must be installed on all the phones.

Wi‑Fi Talkie and Signal Offline Messenger
Wi‑Fi Talkie and Signal Offline Messenger
Wi‑Fi Talkie and Signal Offline Messenger

Other examples of wireless mesh networks

  • OLPC laptops (One Laptop per Child) use a mesh network to communicate with each other when the internet is unavailable. https://ru.wikipedia.org/wiki/One_Laptop_Per_Child
  • Google Home, Google Wifi, Google OnHub, and Apple AirPort use mesh networking to connect multiple devices into a single network with shared internet access.
  • Iridium satellites, which relay traffic between satellite phones, are interconnected in a mesh network.
  • Many IoT devices (smart plugs, light bulbs, smart blinds, etc.) can form a mesh network to pass information between devices.
  • There is ongoing work to interconnect autonomous vehicles in a mesh so they can exchange information about road conditions with one another.
  • iOS has supported mesh-style networking since version 7.0. Android has supported Wi‑Fi Direct since 4.0, and more recently Google Play services introduced the Nearby Connections 2.0 API, which significantly simplifies building mesh networks. https://android-developers.googleblog.com/2017/07/announcing-nearby-connections-20-fully.html

Conclusions

Wireless mesh networks are arguably one of the most important technologies of the 21st century. For better or worse, our world will soon be crammed with devices that can transmit data over the air. And it’s not just smartphones and tablets — it’s smart homes, cars, kettles, microwaves, outlets, and countless other things that only recently seemed unthinkable to equip with wireless modules. As a result, mesh networks will continue to evolve, and in the future we’ll be less dependent on the Internet.

it? Share: