The Serval Project's core daemon that implements Distributed Numbering Architecture (DNA), MDP, VoMP, Rhizome, MeshMS, etc.
Go to file
2012-11-29 16:43:19 +10:30
asterisk_include Added support for batmand.peers file for reliable peer querying. 2011-03-21 13:08:35 +10:30
doc Intial notes for OpenBTS setup documentation 2012-11-08 15:15:52 +10:30
java/org/servalproject/servald JNI interface returns byte[] instead of String 2012-11-07 17:12:04 +10:30
m4 Artefacts created by libtoolize -c -i 2012-09-12 15:21:50 +09:30
nacl cleaned up NaCl build to just compile using make. #17 2012-10-18 17:26:52 +10:30
openwrt/packages/serval-dna Updated build files for openwrt (now all live in openwrt/). #26 2012-10-29 07:38:16 +10:30
sqlite-amalgamation-3070900 Reduce use of stderr in many places 2012-08-01 17:54:02 +09:30
tests Merge branch 'whacktmps' into 'master' 2012-11-15 13:41:45 +10:30
win32 Allow clients to request variables for all records by passing empty did. 2011-04-27 12:17:26 +09:30
.dir-locals.el Add file to set emacs variables to match the prevailing style. 2012-07-29 13:52:46 +09:30
.gitignore Improve test framework: create_file() 2012-10-31 18:13:33 +10:30
aclocal.m4 Merge branch 'master' of github.com:servalproject/serval-dna 2012-04-23 20:41:52 +09:30
Android.mk refactored Makefile.in and Anrdoid.mk so that source file lists are 2012-10-25 04:30:14 +10:30
androidonlysources.mk refactored Makefile.in and Anrdoid.mk so that source file lists are 2012-10-25 04:30:14 +10:30
asterisk_app.c Expunge old DNA protocol code (cleans up warnings) 2012-06-25 15:37:11 +09:30
audio_alsa.c work on bypass-audio. 2012-05-11 08:14:00 +09:30
audio_msm_g1.c Fix rhizome transfers 2012-06-27 16:54:42 +09:30
audio_reflector.c work on bypass-audio. 2012-05-11 08:14:00 +09:30
audiodevices.c Try detecting ALSA better. 2012-09-06 12:43:06 +09:30
cli.c Reuse command line parsing framework with monitor interface 2012-09-25 13:31:34 +09:30
cli.h Reuse command line parsing framework with monitor interface 2012-09-25 13:31:34 +09:30
codecs.c Use new typedef time_ms_t everywhere 2012-08-09 12:14:32 +09:30
commandline.c Fix ping message format 2012-11-20 10:25:33 +10:30
conf.c Move toprint functions from log.h to str.h 2012-11-20 18:10:08 +10:30
conf.h Fix bugs in earlier conf/log recursion logic 2012-11-15 12:38:17 +10:30
config.guess Artefacts created by libtoolize -c -i 2012-09-12 15:21:50 +09:30
config.sub Artefacts created by libtoolize -c -i 2012-09-12 15:21:50 +09:30
configure.in cleaned up NaCl build to just compile using make. #17 2012-10-18 17:26:52 +10:30
constants.h Issue #17, overhaul manifest author crypto logic 2012-10-11 17:58:24 +10:30
crypto.c Extract crypto signing primitives from mdp processing 2012-10-19 14:54:41 +10:30
crypto.h Extract crypto signing primitives from mdp processing 2012-10-19 14:54:41 +10:30
dataformats.c Refactor string functions, add str_fromprint() 2012-11-07 16:42:45 +10:30
directory_client.c Fix segfaults 2012-11-12 10:38:24 +10:30
directory_service.c Better tree walking for duplicate results 2012-11-16 15:39:33 +10:30
dna_helper.c Refactor string functions, add str_fromprint() 2012-11-07 16:42:45 +10:30
encode.c Put back a pile of files needed for building on osx, and also required 2012-03-15 10:57:38 +10:30
fdqueue.c Move toprint functions from log.h to str.h 2012-11-20 18:10:08 +10:30
fifo.c Add PA setup and FIFO code (still not plumbed into the main program) 2012-04-23 16:32:47 +09:30
fifo.h Add PA setup and FIFO code (still not plumbed into the main program) 2012-04-23 16:32:47 +09:30
headerfiles.mk refactored Makefile.in and Anrdoid.mk so that source file lists are 2012-10-25 04:30:14 +10:30
install-sh Artefacts created by libtoolize -c -i 2012-09-12 15:21:50 +09:30
INSTALL.md Move information from BUILD.txt into INSTALL.md 2012-10-30 14:49:50 +10:30
jni.c Imported ref10/ implementation of crypto_sign from supercop-20120525 2012-10-18 17:26:48 +10:30
keyring.c Dampen logging 2012-11-09 15:56:54 +10:30
log.c Move toprint functions from log.h to str.h 2012-11-20 18:10:08 +10:30
log.h Fix compilation errors 2012-11-22 10:55:54 +10:30
lsif.c Prevent segfault for interfaces with no address 2012-11-01 14:00:18 +10:30
ltmain.sh Artefacts created by libtoolize -c -i 2012-09-12 15:21:50 +09:30
macconfig Fixed broadcast address discovery to work on Mac. 2011-08-08 16:11:05 +09:30
main.c Remove dead code 2012-10-19 15:02:22 +10:30
Makefile.dbg Move debug options to Makefile.dbg so we don't have to re-run configure. 2012-07-29 14:55:10 +09:30
Makefile.in Move toprint functions from log.h to str.h 2012-11-20 18:10:08 +10:30
mdp_client.c Allow for with slightly longer paths 2012-11-09 13:40:55 +10:30
mdp_client.h Only parse incoming packets with port numbers matching our expected responses 2012-10-02 16:15:30 +09:30
meshpotato_build Assorted unknown changes. Updated Makefile.in etc to properly build serval.c for building asterisk module. 2011-06-15 13:52:30 +09:30
mkdir.c Overhaul debug flags 2012-05-14 18:37:32 +09:30
monitor-cli.c Reuse command line parsing framework with monitor interface 2012-09-25 13:31:34 +09:30
monitor-client.c Improve monitor CLI client error handling 2012-10-19 19:38:59 +10:30
monitor-client.h Reuse command line parsing framework with monitor interface 2012-09-25 13:31:34 +09:30
monitor.c Remove unused variables 2012-10-29 13:05:03 +10:30
mpbuild Added mesh potato build script. 2011-08-10 15:39:40 +02:00
net.c Move toprint functions from log.h to str.h 2012-11-20 18:10:08 +10:30
net.h Logging/debug improvements: __WHENCE__, __whence 2012-10-16 17:00:03 +10:30
overlay_address.c Degrade link score to zero within 20 seconds 2012-11-16 15:54:01 +10:30
overlay_address.h Always update unicast addresses 2012-10-19 10:40:02 +10:30
overlay_advertise.c Refactor string functions, add str_fromprint() 2012-11-07 16:42:45 +10:30
overlay_buffer.c Logging/debug improvements: __WHENCE__, __whence 2012-10-16 17:00:03 +10:30
overlay_buffer.h Refactor overlay buffer interface to support simple parsing 2012-08-31 15:03:07 +09:30
overlay_interface.c Fix compile warnings on Solaris (gcc 4.4) 2012-11-28 14:13:25 +10:30
overlay_mdp.c Refactor string functions, add str_fromprint() 2012-11-07 16:42:45 +10:30
overlay_olsr.c Always update unicast addresses 2012-10-19 10:40:02 +10:30
overlay_packet.h Move requested payload queue into frame structure 2012-10-09 15:44:37 +10:30
overlay_packetformats.c Refactor string functions, add str_fromprint() 2012-11-07 16:42:45 +10:30
overlay_payload.c Move payload queueing functions to separate .c file 2012-11-21 11:02:00 +10:30
overlay_queue.c Fix compilation errors 2012-11-22 10:55:54 +10:30
overlay_route.c Degrade link score to zero within 20 seconds 2012-11-16 15:54:01 +10:30
overlay.c Move payload queueing functions to separate .c file 2012-11-21 11:02:00 +10:30
pa_phone.c Add support for srtuct ucred on BSD. 2012-05-21 12:22:50 +09:30
packetformats.c Remove dead code 2012-10-19 15:02:22 +10:30
performance_timing.c Improve performance timing diagnostics 2012-11-12 14:38:50 +10:30
randombytes.c Added missing GPL license declaration to file. 2012-02-17 00:42:37 +10:30
README.md Fix README.md -- Markdown typo 2012-10-28 23:18:12 -07:00
rhizome_bundle.c Fix bugs revealed by Rhizome stress test 2012-10-18 17:30:22 +10:30
rhizome_crypto.c Squelch debug log message 2012-11-16 13:20:32 +10:30
rhizome_database.c Fix compile warnings on Solaris (gcc 4.4) 2012-11-28 14:13:25 +10:30
rhizome_direct_http.c Pass SID as well as ip:port through rhizome fetch request logic. 2012-11-29 15:38:04 +10:30
rhizome_direct.c Merge branch 'rhizomedirect' into 'master' 2012-10-05 17:45:30 +09:30
rhizome_fetch.c call switch to mdp fetch if http request setup fails. 2012-11-29 16:43:19 +10:30
rhizome_http.c Improve str.h functions 2012-11-20 18:10:08 +10:30
rhizome_packetformats.c Pass SID as well as ip:port through rhizome fetch request logic. 2012-11-29 15:38:04 +10:30
rhizome.c Refactor string functions, add str_fromprint() 2012-11-07 16:42:45 +10:30
rhizome.h Pass SID as well as ip:port through rhizome fetch request logic. 2012-11-29 15:38:04 +10:30
serval_packetvisualise.c Changed rhizome manifest signature block type code semantics to 2012-10-29 16:07:42 +10:30
serval.h Move payload queueing functions to separate .c file 2012-11-21 11:02:00 +10:30
servalwrap.c Fix compilation for android 2012-07-24 16:04:59 +09:30
server.c Remove dead code 2012-10-19 15:02:22 +10:30
sha2.c Initial stab at porting to Solaris. 2012-09-05 20:42:50 +09:30
sha2.h Substantial preparatory work towards Rhizome/MeshMS store-and-forward 2011-12-13 19:34:12 +10:30
sighandlers.c more work on dna helper interface. 2012-06-21 16:35:28 +09:30
socket.c Refactor out socket name setting code into one place. 2012-07-29 22:20:54 +09:30
socket.h Refactor out socket name setting code into one place. 2012-07-29 22:20:54 +09:30
sourcefiles.mk Move payload queueing functions to separate .c file 2012-11-21 11:02:00 +10:30
srandomdev.c Don't use an uninitialised variable. 2012-09-01 16:32:50 +09:30
str.c Improve str.h functions 2012-11-20 18:10:08 +10:30
str.h Fix compile warnings on Solaris (gcc 4.4) 2012-11-28 14:13:25 +10:30
strbuf_helpers.c Fix Android compile error 2012-10-24 15:36:52 +10:30
strbuf_helpers.h Move toprint functions from log.h to str.h 2012-11-20 18:10:08 +10:30
strbuf.c Fix bug in alloca_toprint() that caused SEGV 2012-08-06 15:39:08 +09:30
strbuf.h Introduce struct __sourceloc 2012-08-23 12:31:07 +09:30
strlcpy.c Fix issues arising from new strlcpy.c 2012-08-14 11:23:27 +09:30
strlcpy.h Add strlcpy as it appears some systems (Ubuntu and probably Debian) don't have it. 2012-08-13 18:24:19 +09:30
testconfig.sh.in Trival test of dna JNI command line entry point 2012-04-23 18:25:26 +09:30
testdefs_rhizome.sh Improve Rhizome test defs: bundle_received_by() 2012-11-05 14:43:57 +10:30
testdefs.sh Improve Rhizome test defs: bundle_received_by() 2012-11-05 14:43:57 +10:30
testframework.sh Improve test framework: --line=N..M for assertGrep() 2012-11-07 20:27:11 +10:30
testnacl.c Added test code for NaCl. 2011-10-25 13:39:14 +10:30
tfw_createfile.c Improve str.h functions 2012-11-20 18:10:08 +10:30
vomp_console.c Fix compiler warning on Linux gcc 4.7.1 2012-10-08 17:20:19 +10:30
vomp.c Refactor string functions, add str_fromprint() 2012-11-07 16:42:45 +10:30
xprintf.c Add xprintf() extensible stream formatter 2012-08-03 16:44:05 +09:30
xprintf.h Add xprintf() extensible stream formatter 2012-08-03 16:44:05 +09:30

Serval DNA

This repository contains the source code for the “core” Serval components implemented in GNU C:

  • 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. It is a protocol carried over MDP (see below) that allows any device to ask its neighboring devices for a phone number (DID). Such a request will propagate through the mesh, and any device may respond with the identity (SID) of a subscriber who has “claimed” that DID.

  • 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 any locked identity.

  • 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, but for the time being 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 WiFi. However, MDP could easily be implemented directly over a layer 2 data link such as WiFi or Ethernet MAC. MDP uses subscribers' public keys (SID) as source and destination addresses, and has a 32-bit port number analogous to the 16-bit port number used in TCP/IP.

  • The Rhizome content distribution service is a storage engine implemented using SQLite and a content-exchange protocol based on MDP and HTTP for the pervasive dissemination of 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.

  • The MeshMS messaging service is implemented using Rhizome as its transport, with each thread represented as a pair of bundles, one for each direction. At present, the MeshMS logic is implemented in Java within the Serval Mesh Android app, but is planned to be re-implemented in C as part of Serval DNA (see issue #28).

  • 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).

Most of these services are performed by a daemon process called servald. Serval Infrastructure is implemented by a separate daemon called directory_service.

Serval DNA is free software produced by the Serval Project and many contributors. It is licensed to the public under the GNU General Public License version 2. All source code 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., an organisation incorporated in the state of South Australia in the Commonwealth of Australia for the purpose of developing the Serval mesh software.

The Serval Project will accept contributions from individual developers who have agreed to the Serval Project Developer Agreement - Individual, and from organisations that have agreed to the Serval Project Developer Agreement - Entity.

servald

The servald executable is a multi-purpose program designed to be invoked directly from the command line and also via JNI from within a Java program. The following command will print a summary of all the operations that servald offers:

servald help

Some operations are self-contained, 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.

For more detail on the purpose and usage of the servald command-line, see the doc directory.

Build and test

Instructions for building and testing Serval DNA are in INSTALL.md. (If that link is does not work, try INSTALL.md.)