User: Password:
Subscribe / Log in / New account

LCA: Serval at the mobile miniconf needs you!

Without subscribers, LWN would simply not exist. Please consider signing up for a subscription and helping to keep LWN publishing

By Nathan Willis
January 30, 2013

Linux on mobile devices is a perpetually hot topic, but the discussion typically centers around Android, webOS, MeeGo, and other commercially backed operating system projects. The Mobile FOSS miniconf at 2013 offered a decidedly different program, highlighting projects that pushed mobile computing in directions of little interest to phone carriers, such as the Serval project, which focuses on freeing mobile phones from the cellular infrastructure altogether.

Miniconfs are one-day tracks organized by volunteers, separate from the main event schedule. The first two days of LCA featured thirteen miniconfs, with topics ranging from security to open government. Monday's Mobile FOSS miniconf featured eleven talks, although the schedule was dominated—in a friendly way—by a series of interconnected Serval sessions. The project builds a free software mesh networking framework for mobile and embedded devices. These devices can operate over the mesh network without cellular connections, instead using WiFi, or (potentially) any other radio layer. One of the sessions dealt with the project's interest in building specialty phone hardware to use other radio frequency bands, but most of the talks described how Serval runs on current Android devices today.

Haiti and the origin of Serval

[Paul Gardner-Stephen]

Paul Gardner-Stephen of Flinders University explained that the Serval Project had its origin in the 2010 Haiti earthquake, in the wake of which humanitarian relief organizations faced unprecedented logistical challenges—starting with the unavailability of airports, highways, and harbors to even get physical access to the disaster site. Gardner-Stephen likened the telecommunications challenge to that physical access challenge, noting that without the cellular telecom infrastructure, even high-end smartphones were unusable—in spite of the fact that the devices are physically capable of communicating directly to each other. Software, he said, is all that prevents smartphones from offering even the short-range connections offered by cheap walkie-talkies for children. Serval is his attempt to overcome that limitation.

The Serval framework runs on top of Linux; at this time primarily on Android devices, though the project has used routers as well (such as the Mesh Potato) to provide access points or uplinks to the Internet. In theory, phones should be able to connect to one another directly in ad hoc WiFi mode, but the reality is that ad hoc support has long been buggy [Note: this link is broken currently] in Android (and has been disabled in recent versions), and ad hoc mode interoperability between phone vendors is poor enough to be unusable. Consequently, some devices must be run in access point mode, while the others connect to them in client mode. Still, Gardner-Stephen noted, in field trials the project has been able to get phone-to-phone connections working over several hundred meters, which is significantly more range than one sees in an urban environment polluted by microwave oven interference (and by hundreds of conference attendees simultaneously browsing the web).


The Serval software consists of two layers, the servald daemon and the applications that utilize it. The project had freshly-updated Android packages available for installation during the sessions (delivered from one of the speakers' own phones running in access point mode). The main Serval package installed both the servald daemon and Serval BatPhone, an application that provides voice calling, text messaging, and file sharing over the mesh. A second package installed a mapping application intended to let teams keep track of individuals' locations in the field.

The servald layer implements device identification and discovery through a module named Distributed Numbering Architecture (DNA). Voice calls, since they require stricter latency than other applications, are handled by a special module called VoMP. All other services are implemented on top of Rhizome, a file distribution module described as USENET-like because it opportunistically stores-and-forwards every uploaded file to all clients on the mesh. Rhizome can be used to propagate static files to all clients. For example, field workers can take geotagged photos while on survey trips; the photos are automatically propagated to other team members. This protects against data loss, and it rapidly disseminates information about points of interest or concern. But Rhizome can also be used as a "datagram"-like protocol layer on which other applications are built. Serval's text message analogue "MeshMS" is implemented on top of Rhizome in just such a fashion.

Given the humanitarian relief scenarios that first prompted Serval, it should come as no surprise that the network was designed to provide users with security—disasters can put relief workers at risk of harm from criminals or militants in addition to natural dangers. At first run, each Serval client generates a 256-bit Elliptic Curve public-private key pair. The public key is used as the client node's Serval ID (SID); consequently any client that knows the SID of the node it wishes to exchange messages with already has enough information to encrypt and/or cryptographically sign that message.

Various applications are implemented on top of these core services, including the aforementioned BatPhone and Serval Maps. For the phone functions, users select their own "phone number" which is propagated to other clients over the mesh. The phone number is simply easier for users to dial than the SID public key itself, but VoMP and MeshMS are encrypted. The project described some other applications that they have implemented in field tests with humanitarian relief organizations, such as filing structured forms.

In the field

Gardner-Stephen described one of the Serval project's field tests in detail; the project worked with the New Zealand Red Cross (NZRC) on training exercises that placed NZRC teams in realistic disaster relief scenarios. From the exercises, he said, the Serval project learned practical lessons like the need to reduce the amount of chatter that clients produce synchronizing with each other when there are many nodes in close proximity. As he put it, Serval nodes are like ducks: they don't quack much on their own, but when you get a roomful of them together they won't shut up. The project also learned a number of details about real-world relief work that are not directly software driven, like the fact that NZRC has little interest in voice communications, but being able to exchange short data messages is vital.

The NZRC field tests allowed Serval developers to work with Iridium satellite networking equipment as a backbone; in other instances they have worked with OpenBTS to create a micro-cellular network. But Gardner-Stephen said the project was also exploring the possibility of building low-cost cellular phones with an Arduino-like microcontroller "backpack" that could be filled with swappable radio modules. WiFi in open-field conditions has far greater range than it does in crowded cities (or conferences), but unlicensed spectrum like the ISM 900MHz band offers the potential for greater range at lower power consumption. Since the same bands are not available in every region, of course, making the radio modules pluggable is seen as a critical feature.

At several points during the day, the question arose as to why the project had invented its own protocol rather than using an existing one, such as the mesh networking deployed by the One Laptop Per Child (OLPC) project. The project's members indeed had rationales for each case, although most of them boiled down to the same issue: making a decentralized system that could work without any infrastructure. The OLPC mesh network, for example, is based on 802.11s, but that standard is used to build a mesh extension that branches out from a fixed base station: without the base, the clients cannot communicate among themselves. Similarly, early experiments with voice calling revealed that the common SIP protocol found in most VoIP clients was unsuitable for stand-alone mesh calling because it ultimately relies on the certificate authority infrastructure of TLS.

The Serval project has built some impressive mesh networking technologies, although it still has plenty of challenges ahead. The hardware support issue is chief among them; the speakers observed that WiFi antennas in most Android phones are low-priority because phone-to-phone networking is not important to the device-maker. The cellular antenna is positioned to work well, but the assumption is that the WiFi antenna can be tucked in anyplace, since checking email and browsing the web is less critical than making a voice call. Whether Serval will overcome that hurdle by making its own hardware remains to be seen, but it does demonstrate that cellular voice calls are not always the most useful task a phone can perform. That is a notion many smartphone users would likely agree with, but Serval shows that humanitarian work, and entirely new networking topologies, are among the features.

(Log in to post comments)

Copyright © 2013, Eklektix, Inc.
This article may be redistributed under the terms of the Creative Commons CC BY-SA 4.0 license
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds