Monday, April 16, 2012

Sharpening Serval's Mission

We have been doing a bit of reflecting lately about what it is that we are trying to accomplish with the Serval Project, not because we wonder what we are trying to do or why we are trying to do it.  Rather, we have been thinking about what order to do things in, so that we can get something usable into people's hands as soon as possible.


To answer this question we went back to our motto of "communications anywhere, anytime", and did some thinking there.  We came to realise that we can probably refine that, and that by doing so, we will probably come to understand what are the important things that need to happen first, and what are the (in many cases equally important) things that we will work on once we have the initial objectives under control.


So here is our current thinking, and we invite any and all to give us feedback on this, and potentially change the line up.  What follows is our working position in the absence of any feedback.


We think that Serval's mission can be expressed more clearly as:

mobile communications for those in need


This more or less says what we have been saying all along, but it moves the focus from the technology to the people using the technology.  At the end of the day, we are only making the technology in the hope that it can help people.


So we then turned to think about what the "minimum viable product" is for Serval, and we settled on a short-list of the four things that really matter right now.  These are the things that we are focussing our resources on, and not until those are under control will we move on to our longer list of things that we have on the drawing board (some of which I will describe later).


The four things that matter now are:

  • ease of use - the Serval software must be easy and intuitive to use, otherwise no one will use it, irrespective of how great and innovative the technology might be. 
  • resilient phone calls, messaging and file distribution - these are the core functions of the Serval software, i.e., what it let's you do.
  • strong, simple, security - security in mobile communications is so often an after thought, or severely compromised.  For example, the security of 2G and 3G mobile telephone systems has been thoroughly broken for years.  And when security is introduced into systems it has a bad habit of making life harder rather than easier.  Consider the complexity and interoperability issues suffered by IPSec as an example, indeed so complex that it's security benefits go largely un-used.
  • no infrastructure needed - this is what is needed to make sure that we can most effectively help those in need, as it is the failure or absence of infrastructure (or affordable access to infrastructure) that is a recurring characteristic of those we are trying to help.  Besides, there are already plenty of infrastructure-bound communications systems.

We are tracking well on these points, and expect to have positive news on the progress of several of these points over the next month or so.


Once we have these under control, we have a long list of features that we will immediately turn to, use-cases and improvements, some of which we are working on now in a limited capacity, and that we are planning support for from the outset. In no particular order, this list includes:



  • broad device support - For now we are happy to support a limited range of handsets, but we know that eventually we need to support as wide a range as possible, including non-Android phones.
  • Traffic prioritisation/QoS - Right now our focus is on making the core functionality as solid as possible.  We have plans in place for some innovative QoS functions that we will implement as resources allow.
  • optimising battery life - The mesh can already run for a full business day on a cheap Android phone, but we want more. We want to get to at least 48 hours of continuous operation on a single charge, and ideally much more.
  • massive scalability - Our protocols are designed with massive scalability in mind, but there are aspects of this that we simply don't have the time or resources to implement right now.  We figure that it is more important to get it working at the "village scale", and once that is right and larger networks start to emerge, it will be quite natural for us to complete our plans for scalability.
  • privacy and plausible deniability - For some people they take their privacy seriously, sometimes because their lives depend on it, or because the lives of the people they are in contact with depend on it.  Eventually our software should make sure that it can be configured to not betray any such information.  This is a considerable technical challenge, and one that it is not even certain that it is possible to achieve.
  • journalistic applications - This is intrinsically linked to the previous point, as one of the main issues for journalists is keeping their sources confidential.
  • complex “crisis mode” of operation - By this we mean some complex modes of operation where a network of phones automatically detects that a crisis is underway using various network heuristics (such as loss of cellular service, correlated vibrations or loud noise over a wide area, and to take some hithero undefined appropriate action.
  • group coordination - We have plans to introduce a variety of work-group/team features, that will allow ease of communications and coordination amongst small teams of people.  These are based on the core features that we are working on now, and so will be natural for us to complete once the dependent features are complete.
  • global mapping system and services - We already have an effective prototype of our mapping application that we demonstrated recently, and that we will continue work on as we are able.  This is a feature that has us quite excited, because it allows for a wide variety of coordinated and crowd-sourced activities through allowing users to create and share points of interest on the map, and to even automatically share the map tiles over the mesh, creating something like Google Maps that works without the internet.
  • environmental monitoring applications - We already have some projects in mind here that will make use of the mapping system to make it easy to collect, share and visualise environmental data in the field, and so hopefully help people assess and protect the natural and built environment.
  • -medical applications - We are quite excited about the possibility of making a cheap medical device platform that uses a sub-$100 Android phone as it's basis, combined with an open hardware port that allows the connection of an increasing number of off-the-shelf and custom medical attachments, such as pulse-oximetry, prick-less anemia testing, blood pressure, foetal heart-rate monitor and even imaging ultra-sound.  Support for additional functions and probes would be added to the platform overtime (with software updates over the mesh where required), as the interface would be open and flexible, doing to the medical device field what the smart-phone did to the software field. Extreme low-cost, field-upgradability, combined with resilient mesh communications to allow remote monitoring and collection of data and communication of alerts in infrastructure-deprived medical settings, we expect this concept to be highly disruptive to much of the medical devices space.



So that's what we are thinking about right now.  But we invite your input to help us shape this as best we can, and also to help us achieve these goals if you want to be part of the action or to help us resource this work.

Thursday, March 29, 2012

Serval Overlay Mesh Can Now Ping

Okay, so it is one small step, but for us it is a significant one: the Serval Overlay Mesh can now ping nodes, simply using the Serval network identifiers (that are really stand-alone public keys in the NaCl CryptoBox key space):


It looks just like normal ping, except for those really long addresses (256 bits).  What is important for us, is that behind the scenes we have the Mesh Datagram Protocol (MDP) working, and all of the supporting infrastructure that goes behind it.

This means we are getting closer to carrying phone calls over MDP, and that is significant, because it lets us enjoy great transparent super-strong cryptography to protect the privacy of people making calls on a Serval phone.

It also lets us use non-IP based transports to carry the data, such as UHF and VHF radio based long-range mesh technologies that we are working on.  We are having some really encouraging conversations with one phone manufacturer about including UHF long-range meshing into their phones, which would be great, as it would provide hundreds of metres range indoors and potentially one to a few kilometres outdoors under ideal conditions.

Such improved range compared with WiFi makes mesh telephony much more useful, as it means that fewer mesh phones are needed in an area to allow communications to occur.  With WiFi you need someone in just about every house with a mesh node if you want to connect a community, because the range is about one house.  But the long-range meshing would increase that range to perhaps a 5 to 10 house radius.  In that context only a few percent of homes need mesh devices, which is much easier to achieve.

Meanwhile, I should get some sleep and then get back to writing software.

Saturday, March 3, 2012

KiwiEx 2012: Installing and Updating Software In A Simulated Disaster

(Please take a look at our crowd-funding campaign at igg.me/at/speakfreely.)

KiwiEx 2012 has just finished, and I am sitting in Wellington Airport with a few spare minutes to write down some thoughts about the experience.

First, it has been amazing to spend a week with the exceptionally bright and dedicated volunteers of the New Zealand Red Cross IT&T Emergency Response Unit (ERU).  These people are all volunteers giving up their valuable time for training, and also for potential overseas deployment to help provide communications support for Red Cross activities anywhere in the world.  This IT&T ERU is one of only five in the world, and the only one outside of Europe and the USA, which shows the calibre of the group.

To provide some context, the ERU is the team that deploys HF and VHF radio systems and satellite-backed internet access for other Red Cross teams.  Thus, they are frequently working in areas with no available terrestrial communications infrastructure.
Setting up the HF and VHF Radio Mast For the Emergency Operations Centre (EOC)

The primary function of KiwiEx was to provide a simulated deployment exercise to aid team readiness for potential deployment.

Along side this, the secondary goal of the exercise was to test various new technologies to see if they would be helpful for the ERU, and possibly for other users within the New Zealand Red Cross and other Red Cross national societies.

The Serval Mesh was one of these new technologies being test-run at KiwiEx, with a focus on Serval Rhizome store-and-forward and the Serval MeshMS infrastructure-independent short message service, which is similar to SMS on cellular networks.

Charging Phones Ready For Roll-Out
Rhizome allows the sharing of files between mesh-enabled phones, even if they are not all in range of one another at the same time.  MeshMS allows text messaging between phones -- all without relying on any infrastructure.  The Serval software was also combined with software from Kestrel and hardware from de Lorme that allows the entering of free-form or structured information into an electronic form on an Android phone that is then relayed via the de Lorme inReach (which uses the Iridium satellite constellation) back to an internet-enabled portal that can display the entered information in real time.  The Serval Mesh software was also complemented with the ability to deliver MeshMS between teams using the inReach satellite link as the back-haul.


This combination can also provide real-time tracking of people on the ground via the GPS receiver in the inReach unit.  Keeping track of their personnel is very important for the Red Cross, not only to maximise their effectiveness, but also to keep their people safe.

Pre-Exercise Briefing
Following Serval's approach of assume zero infrastructure (including no satellite internet, and possibly even no GPS), we also provided a mesh-based mapping application that uses Rhizome to share location and point-of-interest (POI) information among phones on the mesh.  This allows the Emergency Operations Centre (EOC) in the field to get this useful information, even when outside communications are not possible.  If internet access is available, the information can be pushed to the internet and visualised there.


The intention was to test if these various technologies (and combinations of them) were actually practical. In this regard, the tests were very successful: about 50 succinct data reports and a number of Serval MeshMS messages were pushed via inReach back to Kestrel's internet portal; more than 11,000 tracking points were obtained from more than a dozen phones allowing the reconstruction of team movements during the week; and more than 86MB of data was pushed around the mesh using Rhizome.

The ERU Team Familarise Themselves With The Serval Mesh Phones
Rhizome proved it's value several times over during the exercise, enabling bulk data transfer without any supporting infrastructure, and without requiring that all phones be on the mesh at the same time.

The KiwiEx Amenities Block
Indeed, Rhizome worked so seamlessly that it wasn't until I had pushed several software updates and a local map to the phones on the mesh that the significance of what we had done really dawned on me:  we had been transferring data at broad-band speeds, delivering software updates and critical operational data and telemetry over a network that contained no infrastructure.  Phones delivered data to other phones as required.  By the time I had pushed an update to the mesh and told the team leaders about it, it was available on their handsets.  It just worked.  It was amazing.

Serval Mesh Phone and inReach on Dash-Board Relaying Data via Iridium Satellite and Serval Rhizome
Sending a Message via Satellite In The Field
The fact that phones were moving around an area of several hundred square kilometres, and being turned on and off at various times was unable to overcome Rhizome's termite-like relentlessness in steadily nibbling away at transferring data whenever it could.  Where as many other protocols try a few times to complete a transaction, Rhizome's design allows it to keep trying for as long as it takes. Also, where as many other mesh protocols suffer from exponential bandwidth decay as the hop count increases, Rhizome is able to transfer large amounts of data easily because it only ever moves files one hop at a time, and thus does not need any routing information.
Boiling the billy, Kiwi style, in a Thermette.


Similarly, when at the end of the exercise I wanted to collect all the photographs that various people had taken during the exercise and shared to the mesh, all I had to do was find any mesh phone, and copy the pictures, because they all had a copy of all of the photographs.

The early feedback from the ERU team has been very encouraging, and they have made many valuable suggestions to enable us to improve our software.  Above all, their enthusiasm for what Serval will be able to do for them in the near future was a wonderful vindication of our approach of assuming no infrastructure, but using whatever infrastructure is available.

Thursday, March 1, 2012

At KiwiEx 2012 (part 1)

This week I have been participating as an Observer at KiwiEx 2012 with the New Zealand Red Cross as part of a process for evaluating a combination of our Serval Mesh and Serval Rhizome software with software and hardware from Kestrel and de Lorme respectively to create a satellite-connected mesh network that can relay team tracking and situation awareness / common operating picture to the outside world, and allow the on-mesh sharing of software, photos, intelligence and other data that is too large to push up via satellite.  In fact, I am on a satellite link right now, so this will be a quick post, with more (and more pictures) to come.

But for now, some pictures:

A Serval-enabled phone in use tethered to a de Lorme inReach iridium satellite module sending data back to base.
We also did some tracking, just using the Serval Mesh to get the data back to the EOC (no iridium satellite), using Serval Rhizome to replicate data among the phones.  I then collected it from just one phone back at base.  All automatic and painless. Rhizome has been an amazing capability this week, being used to collect data and push out software updates at the same time.
Here is a view of the Emergency Operations Centre (EOC) the team set up.  VHF/HF radio masts and satellite (for internet and telephone) in the foreground.  EOC is in the shearing shed in the foreground, and those of us lucky enough slept in the two cottages in the distance, while the exercise participants camped in a field about a kilometre away.


I got to be part of the team that provided "interference" for the simulated exercises that is the principle purpose of KiwiEx.


Wednesday, February 15, 2012

Software Developer Contracts Available!


Do you thrive on contributing to something that has the potential to positively impact millions, if not billions of people the world over?

Do you slay pointers in your sleep, dream about data-flow diagrams, or cross-compile kernel drivers for fun?

Can you think in C (or Java)?  Do you know how to use mmap() instead of malloc()?

Have you ever written your own compiler, interpretor or network stack for the fun of it (or all three)?

If you can answer yes to at least some of the above, the Serval Project Inc. has the following contract opportunities that it is seeking to engage, so that we are able to accelerate our software development programme:

1. Java/Android/C Software Developer (full-time NOW through to 31 August)

2. Java/Android/C Software Developer (two days per week NOW through to 31 August)

(or possibly some mix-and-match for the total 1.4 full-time-equivalent.)

The purpose of these roles is to get us to our 1.0 public release in August 2012.  Future opportunities may develop over time, dependent on successful software outputs.

For both of these roles we are looking for people who can quickly pick up Java and/or C code, and make rapid and sustained contributions to the Serval Project's software base in preparation for major software releases during 2012.  

Being a Java/C polymath will definitely work in your favour, as will having some experience with Android software development.  General Linux/UNIX admin and scripting awareness and skills are also a plus, as is demonstrated experience contributing to FLOSS software projects.

But most of all, we need people who are passionate about what the Serval Project is doing, and who want to change the world for the better.  Prior engagement with the Serval Project is a great way to prove this to us, both for these and any future openings.

These openings are available immediately, are based in Adelaide, Australia (sorry, not negotiable for these openings due to the intensity of software development we have scheduled), and interested parties are strongly encouraged to put together:

1. A CV listing (providing links is great) any FLOSS, C, Java, Android and humanitarian experience;
2. A covering letter; and
3. About 250 words explaining why you think it is vital that the Serval Project succeed.

Then send it all to jobs@servalproject.org.  ODT and PDF are our preferred formats.

If we like what we read we will get in touch, and get into more of the nitty-gritty.

If we find more great people that we can offer work to, we will keep you on file for when we next have openings.

Wednesday, February 8, 2012

Serval has made the Netexplo 2012 Top-100 Most Promising Projects

We seemed to have reached the point with the Serval Project were we no longer have to enter competitions to start getting short-listed for things.  This is almost as amusing as it is humbling.
So it is that today I discovered that we made the Nexexplo top-100 list of the latest and most proming projects.


From their website, this is how they describe Netexplo:


The most promising uses of digital technology

Every year the Netexplo global observatory of digital innovations identifies the latest and most promising projects and experiments on every continent through its international network of more than 200 spotters. This initial material, comprised of several hundred projects, companies and technologies, is then analyzed in greater depth. A college of international experts next selects the 100 most interesting cases, forming the annual Netexplo 100. 
Finally, a jury comprised of independent personalities from the academic world, research and international organisations elect the Grand Prix from those 10 award winners. The Grand Prix trophy is announced and given out at the Netexplo Forum.
From new uses of the Web to groundbreaking technologies from research labs, as well as associations, NGOs or businesses that are transforming markets, every aspect of the ongoing digital revolution is covered. That’s why research that is still at the lab stage but has positive potential impact on lifestyles or an application that is already available can generate the same interest. Similarly, the Netexplo 100 lists futuristic applications on the verge of science-fiction alongside original, low-tech innovations using widely available technologies that deliver a socially useful function to a given audience.

So thank you to the Netexplo college for thinking that we are one of the most promising projects and experiments underway in 2012.  Now all we have to do is to live up to their expectations!

Monday, February 6, 2012

Developing Challenges of Multi-Hop Mesh Telephony on Android

If you are reading this blog, you probably know that the Serval Project is all about making mesh telephony practical, so that people can communicate anywhere, any time.

For regular Android software development, it is often practical to use the Android emulator to reduce the time between updating source code and seeing the effect of the change.

For Serval, this isn't really an option, because we work below the Android API layer, and much of the software development challenge is related to making the WiFi chipsets do what we want.  We also have a fair amount of native code to do the mesh routing and telephony functions.  In fact, we currently have an entire distribution of Asterisk in the Serval Mesh software, which must be decompressed and installed when the Serval Mesh APK is installed or updated.

Together, these contribute to an update process that can take several minutes to between modifying a line of code and seeing it on an Android device, especially on the low-cost devices that are our primary targets, and when using the debug option in eclipse.

Those minutes add up over time, and so I decided to minimise the install time as much as possible, and also address another problem with developing our software, that is detecting when you have an actual multi-hop network.

To reduce the install time, I started looking at the Asterisk installation to see what we could safely throw out.  I managed to get rid of about half of the loadable modules, several utilities and all of the speech files that Asterisk comes bundled with.  This reduced the size of the APK by a little over 1MB, down to just under 5MB, and cut down the install time by about 15%.  Further savings came from removing unused audio codecs in our SIPDroid-derived SIP client, saving another 0.4MB, and getting the whole thing down to less than 4.5MB and installing about 25% faster than previously.

The bulk of the remaining time is about evenly split between installing Asterisk and testing that the WiFi control works properly.  For development, it probably makes sense to separate out the Asterisk installation from the other files we need to deploy on installation, as we really don't modify the Asterisk files between builds.  This shouldn't be too hard to do, but I have run out of time tonight.

Also, for our target handsets, we really don't need to test the WiFi control every time we update, so we should be able to set a flag to tell the software that we are in development mode, and just assume that the WiFi control works.  This now works by checking if a file called /sdcard/serval/developer-mode/fast-wifi exists, and if so, bypassing those tests, and thus saving about 15 seconds.

So over all the minimum time from hitting "run" in Eclipse to getting the software ready has been reduced from 85 seconds down to 48 seconds (without debugging).

The over significant development convenience task I have worked on in the last few days is one that is probably of more general interest.  The peer list now shows the number of hops to each of the nodes that your phone knows about, as shown in the image below.  This was produced by having two phones at opposite ends of my house, and having the phone shown here with me out on the street.


Each row of the peer list now shows the telephone number, e.g., 5550344, the batman link score, e.g., 243, the ping time to the peer, e.g., 19 milli-seconds, and either "direct" for nodes we can reach directly, or the number of hops to reach the node, e.g., 2 hop.

Importantly for debugging, this displays doesn't ask BATMAN how far to the node in question, but actually enquires of the time-to-live (TTL) field in the IP header, and thus returns the true distance from your phone to the phone in question (the return path might be a different length, though).

Actually, because of limitations with the Java UDP programming interface, the TTL field is read by the Serval DNA daemon (which is written in C), and included in the returned UDP packet to the requesting client.

This means that we can just look at the interface on the screen (and so can all of you who have been asking us for this feature) and see what is happening to routes, instead of having to connect to the phone with a USB cable and enter all sorts of commands to ask BATMAN and the operating system what might be happening.

So all in all we now have a slightly faster and easier development process, that I am sure will more than save the couple of person days of effort that they took to develop, and thus enable us to work faster instead of harder.