Skip to content
The Serval Project's Serval Daemon, incorporating Distributed Numbering Architecture (DNA), Rhizome, MDP, VoMP etc
C Shell C++ Java M4 Python Other
Latest commit c78ee66 Apr 27, 2016 Jeremy Lakeman Add interface index to UP/DOWN monitor message
Failed to load latest commit information.
Debian/etc Improve Debian init.d script and default file Jan 24, 2013
doc Split REST API documentation into several files Feb 22, 2016
fec-3.0.1 Fix -Wsign-compare warnings: use size_t or unsigned for byte counts Dec 10, 2013
java/org/servalproject Append manifest into zip file comment Mar 30, 2016
javatest/org/servalproject/test Split java test classes into a separate folder Jan 19, 2016
m4 fix detection of var_attributes_section_seg on OSX Jan 21, 2016
nacl Replace nacl & sha methods with versions from libsodium to avoid unde… Jan 27, 2016
openwrt/packages/serval-dna Modify OpenWRT Makefile for development Mar 3, 2014
sqlite-amalgamation-3100200 Update sqlite Jan 27, 2016
tests Fix case where eof mime boundary overlaps buffer boundary Apr 11, 2016
utilities Fix Markdown formatting Feb 22, 2013
win32 Allow clients to request variables for all records by passing empty did. Apr 27, 2011
.dir-locals.el Add file to set emacs variables to match the prevailing style. Jul 29, 2012
.gitignore Remove aclocal.m4 from version control Jan 11, 2016
Android.mk Add default instance path for android debug servald binary Apr 4, 2016
CC-BY-4.0.md Add text of CC BY 4.0 license May 21, 2014
CONTRIBUTORS.md Add CONTRIBUTORS.md file, fix alternative links in README.md Dec 3, 2013
COPYRIGHT.txt Add Petter Reinholdtsen to copyright message Dec 9, 2013
GPL-2.0.txt Add full text of GPL version 2.0 Dec 4, 2013
INSTALL.md Fix OSX bugs in test framework Jan 27, 2016
LICENSE-DOCUMENTATION.md Add text of CC BY 4.0 license May 21, 2014
Makefile.dbg Move debug options to Makefile.dbg so we don't have to re-run configure. Jul 29, 2012
Makefile.in Suppress sqlite.c compile warnings with gcc 5.3 Feb 1, 2016
README.md Minor improvements to README Jan 11, 2016
android.c Move DEBUGF() from "log.h" to "debug.h" Jul 13, 2015
cc-by-4.0.png Add copyright notices and CC-BY license to README.md and INSTALL.md May 20, 2014
check-in-out-return.c Uniform copyright notices Dec 4, 2013
cli.c Move DEBUGF() from "log.h" to "debug.h" Jul 13, 2015
cli.h Don't log cli args unless debug.verbose is set Aug 10, 2015
commandline.c Workaround stack alignment bugs when compiling with clang Jan 27, 2016
commandline.h Fix broken clang and Android builds Nov 23, 2015
conf.c Move DEBUGF() from "log.h" to "debug.h" Jul 13, 2015
conf.h Remove duplicate global variables Mar 30, 2016
conf_cli.c Add strbuf_local_buf() macro Nov 2, 2015
conf_om.c Improve config overflow message Dec 14, 2015
conf_parse.c Improve config overflow message Dec 14, 2015
conf_schema.c Avoid remeasuring string Mar 30, 2016
conf_schema.h make rhizome http port number configurable via serval.conf Aug 24, 2015
config.guess Update config.guess and config.sub scripts Jan 18, 2016
config.sub Update config.guess and config.sub scripts Jan 18, 2016
configure.in Fix OSX build errors Jan 18, 2016
console.c Don't continuously toggle fd blocking mode Mar 30, 2016
console.h Overhaul Makefile and header files May 26, 2014
constants.h Fix broken clang and Android builds Nov 23, 2015
context1.c Fix compiler warning Nov 21, 2013
crypto.c crypto_sign_compute_public_key() return void not int Mar 23, 2015
crypto.h crypto_sign_compute_public_key() return void not int Mar 23, 2015
dataformats.c Make strn_to_xxx() functions consistent Mar 28, 2015
dataformats.h Initial msp library implementation with connection state tracking Jan 9, 2014
debug.h Move DEBUGF() from "log.h" to "debug.h" Jul 13, 2015
directory_client.c Use trigger for interface up/down Mar 8, 2016
directory_service.c Add buf_strncpy_nul(), use in place of strlcpy() Nov 2, 2015
dna_helper.c Handle stream EOF without entering an infinite poll loop Jan 27, 2016
fakeradio.c Refactor source and build process to split out test commands Dec 1, 2014
fdqueue.c Don't continuously toggle fd blocking mode Mar 30, 2016
fdqueue.h Remove terminating semicolons from within macros Nov 2, 2015
features.h Fix broken clang and Android builds Nov 23, 2015
fifo.h Uniform copyright notices Dec 4, 2013
golay.c Refactor to fix some OS-X compile warnings Aug 14, 2014
golay.h Uniform #ifdef __SERVAL_DNA__... for headers Dec 4, 2013
headerfiles.mk Update sqlite Jan 27, 2016
http_server.c Fix case where eof mime boundary overlaps buffer boundary Apr 11, 2016
http_server.h Improve HTTP responses Dec 1, 2015
httpd.c Don't continuously toggle fd blocking mode Mar 30, 2016
httpd.h Refactor Rhizome result handling Dec 1, 2015
install-sh Artefacts created by libtoolize -c -i Sep 12, 2012
instance.c Add Java API for setting the instance path Jan 18, 2016
instance.h Fix broken clang and Android builds Nov 23, 2015
jni.c Imported ref10/ implementation of crypto_sign from supercop-20120525 Oct 18, 2012
keyring.c Define internal port bindings with section linking tricks Mar 7, 2016
keyring.h Define internal port bindings with section linking tricks Mar 7, 2016
keyring_cli.c Move if(config.debug.xxx) tests into DEBUGF() Jul 13, 2015
keyring_restful.c Improve REST HTTP response status codes Nov 2, 2015
limit.c Move rate limit code to separate file May 12, 2014
limit.h Move rate limit code to separate file May 12, 2014
log.c Redirect any output from the server to stderr to the log file Jan 27, 2016
log.h Redirect any output from the server to stderr to the log file Jan 27, 2016
logMessage.c Overhaul Makefile and header files May 26, 2014
log_context.c Add log_context Jun 29, 2015
log_on_config_change.c Fix OSX build errors Jan 18, 2016
log_stderr.c Move serverMode flag from log.c to server.c Jun 11, 2014
log_util.c Add strbuf_local_buf() macro Nov 1, 2015
lsif.c Poll netlink socket for interface changes on linux systems Oct 12, 2015
ltmain.sh Artefacts created by libtoolize -c -i Sep 12, 2012
macconfig Fixed broadcast address discovery to work on Mac. Aug 8, 2011
main.c Overhaul Makefile and header files May 26, 2014
mdp_client.c Don't continuously toggle fd blocking mode Mar 30, 2016
mdp_client.h Add prior hop SID to route print output Mar 2, 2016
mdp_filter.c Move if(config.debug.xxx) tests into DEBUGF() Jul 13, 2015
mem.c Move if(config.debug.xxx) tests into DEBUGF() Jul 13, 2015
mem.h Fix broken clang and Android builds Nov 23, 2015
meshms.c Improve Rhizome HTTP API diagnostics Dec 7, 2015
meshms.h Fix RESTful MeshMS newsince ACK logic Nov 12, 2014
meshms_restful.c Report missing Content-Disposition header Feb 22, 2016
meshpotato_build Assorted unknown changes. Updated Makefile.in etc to properly build s… Jun 15, 2011
monitor-cli.c Build the array of console commands by using linkage tricks Aug 22, 2014
monitor-client.c Move DEBUGF() from "log.h" to "debug.h" Jul 13, 2015
monitor-client.h Uniform #ifdef __SERVAL_DNA__... for headers Dec 4, 2013
monitor.c Add interface index to UP/DOWN monitor message Apr 27, 2016
mpbuild Added mesh potato build script. Aug 10, 2011
msp_client.c Move DEBUGF() from "log.h" to "debug.h" Jul 13, 2015
msp_client.h Overhaul Makefile and header files May 26, 2014
msp_proxy.c Move DEBUGF() from "log.h" to "debug.h" Jul 13, 2015
net.c Handle stream EOF without entering an infinite poll loop Jan 27, 2016
net.h Include "whence.h" instead of "log.h" where suitable Jul 13, 2015
network_cli.c Reduce technical debt Apr 26, 2016
os.c Avoid undefined behaviour as highlighted by clang Jan 27, 2016
os.h Add timestamps to meshms messages and acks Jul 14, 2014
overlay_address.c Simplify subscriber enumeration & only support the use-cases we need Jan 12, 2016
overlay_address.h Add prior hop SID to route print output Mar 2, 2016
overlay_buffer.c Reduce technical debt Apr 26, 2016
overlay_buffer.h Refactor rhizome mdp and vomp packet sending Feb 19, 2014
overlay_interface.c Add interface index to UP/DOWN monitor message Apr 27, 2016
overlay_interface.h Remove overlay_interface_find_name Apr 27, 2016
overlay_link.c Remove overlay_interface_find_name Apr 27, 2016
overlay_mdp.c Define internal port bindings with section linking tricks Mar 7, 2016
overlay_mdp_services.c Define internal port bindings with section linking tricks Mar 7, 2016
overlay_olsr.c Don't ask for explanation of SIDs with dead routing links Nov 16, 2015
overlay_packet.h Define internal port bindings with section linking tricks Mar 7, 2016
overlay_packetformats.c Don't ask for explanation of SIDs with dead routing links Nov 16, 2015
overlay_packetradio.c Move if(config.debug.xxx) tests into DEBUGF() Jul 13, 2015
overlay_payload.c Allow for different routes per packet destination Sep 23, 2014
overlay_queue.c Avoid undefined behaviour as highlighted by clang Jan 27, 2016
performance_timing.c Move if(config.debug.xxx) tests into DEBUGF() Jul 13, 2015
radio_link.c Move if(config.debug.xxx) tests into DEBUGF() Jul 13, 2015
radio_link.h Uniform #ifdef __SERVAL_DNA__... for headers Dec 4, 2013
randombytes.c More consistent use of sleep_ms Aug 27, 2013
rhizome.c Append manifest into zip file comment Mar 30, 2016
rhizome.h Append manifest into zip file comment Mar 30, 2016
rhizome_bundle.c Add sqlite column for the hash of the manifest (before any signatures) Mar 7, 2016
rhizome_cli.c Append manifest into zip file comment Mar 30, 2016
rhizome_crypto.c Add sqlite column for the hash of the manifest (before any signatures) Mar 7, 2016
rhizome_database.c Only trigger bundle add hooks within the daemon thread / process Mar 30, 2016
rhizome_direct.c Add strbuf_local_buf() macro Nov 1, 2015
rhizome_direct_http.c Append manifest into zip file comment Mar 30, 2016
rhizome_fetch.c Handle stream EOF without entering an infinite poll loop Jan 27, 2016
rhizome_http.c Add strbuf_local_buf() macro Nov 1, 2015
rhizome_packetformats.c make rhizome http port number configurable via serval.conf Aug 24, 2015
rhizome_restful.c Report missing Content-Disposition header Feb 22, 2016
rhizome_store.c Ensure we rollback if commit fails Apr 18, 2016
rhizome_sync.c Rework detection of rhizome add from cli to trigger bundle_add Mar 8, 2016
rhizome_types.h Replace nacl & sha methods with versions from libsodium to avoid unde… Jan 27, 2016
rotbuf.c Fix bug in rotbuf_next_chunk() when rotation == 0 May 15, 2013
rotbuf.h Remove spurious rotbuf_log() declaration, fixes #75 Apr 3, 2014
route_link.c Define trigger for changes to the neighbour list Mar 8, 2016
route_link.h Define trigger for changes to the neighbour list Mar 8, 2016
section.h Flip section linking tests Mar 30, 2016
serval.h Define internal port bindings with section linking tricks Mar 7, 2016
serval_packetvisualise.c Overhaul Makefile and header files May 26, 2014
serval_types.h Replace nacl & sha methods with versions from libsodium to avoid unde… Jan 27, 2016
servalwrap.c Fix android commandline interface Jul 9, 2013
server.c Fix bug with syncing config within a multi-threaded java process Apr 13, 2016
server.h Add support for running and stopping servald from a JVM thread May 25, 2015
server_httpd.c Add strbuf_local_buf() macro Nov 1, 2015
sha2.c Replace nacl & sha methods with versions from libsodium to avoid unde… Jan 27, 2016
sha2.h Replace nacl & sha methods with versions from libsodium to avoid unde… Jan 27, 2016
sighandlers.c Fix broken clang and Android builds Nov 23, 2015
sighandlers.h Overhaul Makefile and header files May 26, 2014
simulator.c Add strbuf_local_buf() macro Nov 1, 2015
simulator.h Create new AF_UNIX based network simulator May 23, 2014
socket.c Fix MDP client packet receive bug on OSX Jan 19, 2016
socket.h Fix MDP client packet receive bug on OSX Jan 18, 2016
sourcefiles.mk Update sqlite Jan 27, 2016
srandomdev.c Add supid copyright headers on request from Andrew Bettison in the se… Dec 7, 2013
str.c Replace nacl & sha methods with versions from libsodium to avoid unde… Jan 27, 2016
str.h Add buf_strncpy_nul(), use in place of strlcpy() Nov 1, 2015
strbuf.c Optimise strbuf_ncat() Nov 17, 2015
strbuf.h Workaround stack alignment bugs when compiling with clang Jan 27, 2016
strbuf_helpers.c Avoid undefined behaviour as highlighted by clang Jan 27, 2016
strbuf_helpers.h Format network addresses using posix API Sep 28, 2015
strlcpy.c Reimplement strlcpy() using strncpy_nul() Nov 2, 2015
strlcpy.h Reimplement strlcpy() using strncpy_nul() Nov 1, 2015
test_cli.c Fix broken clang and Android builds Nov 23, 2015
testconfig.sh.in Trival test of dna JNI command line entry point Apr 23, 2012
testdefs.sh Improve test defs to ensure setup_curl is called before curl Feb 15, 2016
testdefs_java.sh Split java test classes into a separate folder Jan 19, 2016
testdefs_json.sh Improve JSON test defs to ensure setup_jq is called before jq Feb 15, 2016
testdefs_meshms.sh Fix 'meshms' and 'meshmsjava' newsince-arrival tests May 25, 2015
testdefs_rhizome.sh Fix 'rhizomerestful' and 'rhizomejava' newsince-arrival tests Jun 2, 2015
testframework.sh Fix OSX bugs in test framework Jan 26, 2016
testnacl.c Add missing copyright/license comment blocks Nov 21, 2013
tfw_createfile.c Add --omit option to 'tfw_createfile' utility Dec 7, 2015
timeit.c add context switching speed test to "test memory" command. Oct 22, 2013
trigger.h Remove terminating semicolons from within macros Nov 1, 2015
uuid.c Rename uuid_t --> serval_uuid_t Feb 17, 2014
uuid.h Rename uuid_t --> serval_uuid_t Feb 17, 2014
version_servald.c Add "servald version" command and "make copyright" Dec 5, 2013
version_string.sh Don't depend on .git folders or on error text strings Dec 12, 2014
vomp.c Define internal port bindings with section linking tricks Mar 7, 2016
vomp_console.c Don't continuously toggle fd blocking mode Mar 30, 2016
whence.c Add alloca_sourceloc(), refactored from log.c Jun 29, 2015
whence.h Add alloca_sourceloc(), refactored from log.c Jun 29, 2015
xprintf.c Add XPRINT strbuf adapter Mar 25, 2013
xprintf.h Fix broken clang and Android builds Nov 23, 2015

README.md

Serval DNA

Serval Project, March 2014

Serval DNA is the core component of the Serval Mesh app for Android and the Serval Mesh Extender long-range mesh networking device. It is a daemon process that performs all the central services of the Serval mesh network such as dynamic routing, encryption and authentication, file distribution, messaging, and voice telephony.

Any device with Wi-Fi connectivity that runs the Serval DNA daemon can participate in the Serval mesh network.

Download, build and test

  • INSTALL.md contains instructions for downloading, building and testing Serval DNA on most Linux and some Linux-like platforms.

  • Notes for Developers contains useful information for developers of Serval DNA, which may also help resolve build issues.

Configuration

Documentation

Bugs and issues

  • Bugs can be reported and inspected using the [GitHub issue tracker]Serval DNA issues.

What is in this repository?

This repository contains the GNU C source code for the servald executable, a test framework and test scripts written in Bash, some technical documentation, and various support files for installation and configuration on various platforms.

The servald executable is a multi-purpose program that can be invoked directly from the command line, run as a daemon process, or invoked via JNI from within a Java program. The servald executable is really many commands built into one; the command-line arguments select which command to run. Some commands are stand-alone utilities, some start and stop the servald daemon process, some communicate with the servald daemon as an MDP client, and others via a two-way pipe called the monitor interface.

The following protocols and services are implemented in servald:

  • The Distributed Numbering Architecture (DNA) is the key innovation that makes mesh telephony viable in the absence of any infrastructure, eg, in the aftermath of a natural disaster or in remote locations. DNA is a protocol carried over MDP (see below) that asks many devices at once if they will answer a phone number (DID). A device will respond with its own subscriber identity (SID) if its user has “claimed” that DID. This allows phone calls to be established over the mesh using conventional phone numbers.

  • The Serval Keyring is a flat file containing all the user identities on a single device. Each identity is a set of elliptic curve secret cryptographic keys that belong to a single “mesh subscriber”, indexed by the subscriber's 256-bit public key, called a SID. Each identity in the keyring is locked by its own user-chosen password (called a PIN in the code and documentation), using elliptic curve cryptography to protect locked entries from theft or tampering, and steganography to allow the user to plausibly deny the existence of locked identities.

  • The Mesh Datagram Protocol (MDP) is Serval's own layer 3 protocol designed for secure mesh networking. It is completely independent of Internet protocols such as IP and UDP, although for the time being it is implemented as an “overlay” network based on UDP/IP because that is the interface that Linux and other operating systems provide for sending data over Wi-Fi. However, MDP could easily be implemented directly over a layer 2 data link such as Wi-Fi or Ethernet MAC. MDP uses subscribers' public keys (SID) as source and destination addresses, has a 32-bit port number analogous to the 16-bit port number used in TCP/IP, and encrypts all packet contents by default, using the public key (SID) of the destination.

  • The Voice over Mesh Protocol (VoMP) is Serval's own call negotiation and two-way audio streaming protocol used to implement mesh voice calls. It fills the same role as SIP/RTS, the dominant protocol used for Voice over Internet Protocol, but VoMP is designed for the variable and unstable conditions of wireless mesh networks. VoMP's session state model and signalling can handle packet loss, mid-call re-routing and re-connection where SIP would fail. VoMP's audio streaming can encapsulate many codecs and even DTMF (dialpad button) signalling.

  • Rhizome is a content storage and distribution service implemented using SQLite and a content-exchange protocol based on MDP. It can be used to disseminate content like images, videos, documents, software upgrades, etc. Each piece of content in Rhizome is called a “bundle”, which has two parts: a manifest that describes the content, and the payload, which is the content itself. Each bundle has its own unique cryptographic identifier that allows any recipient to verify that it has not been tampered with. A bundle's payload may be encrypted by the author so that only the designated recipient can read it.

  • The MeshMS messaging service sends short text messages using Rhizome as its transport. Each message thread is stored and carried in a pair of journal bundles, one for each direction (ply).

  • Serval Infrastructure services may optionally be deployed on any devices in the mesh to expose external services to mesh subscribers and vice versa (eg, VoIP gateways, SMS satellite links, packetised web), and to overcome scalability limitations of a perfectly decentralised mesh (eg, central telephone directory). Serval Infrastructure is implemented as a daemon with its own executable called directory_service.

Copyright and licensing

Serval DNA is free software produced by the Serval Project and many contributors. Its source code is licensed to the public under the GNU General Public License version 2. Its technical documentation is licensed to the public under the Creative Commons Attribution 4.0 International licence. All source code and technical documentation is freely available from the Serval Project's serval-dna Git repository on GitHub.

The copyright in most of the source code in Serval DNA is held by Serval Project Inc., a not-for-profit association incorporated in the state of South Australia in the Commonwealth of Australia for the purpose of developing the Serval mesh software. The COPYRIGHT file contains a full list of all those who hold copyright in portions of the Serval DNA source code.

The Serval Project will accept contributions for which copyright has been assigned to Serval Project Inc., or which are licensed to either Serval Project Inc. or to the public on terms that allow the Serval Project to freely redistribute and re-license the code under non-restrictive terms, for example, to release Serval DNA as part of a product distributed through the Apple app store.

Individual developers may assign copyright in their contributions by signing the Serval Project Developer Agreement - Individual, and organisations by signing the Serval Project Developer Agreement - Entity.


Copyright 2014 Serval Project Inc.
CC-BY-4.0 This document is available under the Creative Commons Attribution 4.0 International licence.

Something went wrong with that request. Please try again.