Skip to content
This repository

The Serval Project's Serval Daemon, incorporating Distributed Numbering Architecture (DNA), Rhizome, MDP, VoMP etc

Improve "mdp ping" command

Packet stats now exclude duplicate pong replies

With <count> arg, exits immediately once a pong has been received for
every ping, unless new --wait-for-duplicates option given

Routing tests for unreliable links now assert all pongs received and
very few duplicates
latest commit 459c5a2303
Andrew Bettison quixotique authored April 17, 2014
Octocat-spinner-32 Debian Improve Debian init.d script and default file January 24, 2013
Octocat-spinner-32 asterisk_include Added support for batmand.peers file for reliable peer querying. March 21, 2011
Octocat-spinner-32 doc Document MSP API April 11, 2014
Octocat-spinner-32 fec-3.0.1 Fix -Wsign-compare warnings: use size_t or unsigned for byte counts December 10, 2013
Octocat-spinner-32 java Shortcut equals test when objects are the same instance March 27, 2014
Octocat-spinner-32 m4 Artefacts created by libtoolize -c -i September 12, 2012
Octocat-spinner-32 nacl Fix -Wsign-compare warnings in NaCl code December 11, 2013
Octocat-spinner-32 openwrt Modify OpenWRT Makefile for development March 03, 2014
Octocat-spinner-32 sqlite-amalgamation-3070900 Reduce use of stderr in many places August 01, 2012
Octocat-spinner-32 tests Improve "mdp ping" command April 17, 2014
Octocat-spinner-32 utilities Fix Markdown formatting February 22, 2013
Octocat-spinner-32 win32 Allow clients to request variables for all records by passing empty did. April 27, 2011
Octocat-spinner-32 .dir-locals.el Add file to set emacs variables to match the prevailing style. July 29, 2012
Octocat-spinner-32 .gitignore version_string.sh uses VERSION.txt if not in a Git repo March 03, 2014
Octocat-spinner-32 Android.mk Fix android build, related to issue #76 fix April 07, 2014
Octocat-spinner-32 CONTRIBUTORS.md Add CONTRIBUTORS.md file, fix alternative links in README.md December 03, 2013
Octocat-spinner-32 COPYRIGHT.txt Add Petter Reinholdtsen to copyright message December 09, 2013
Octocat-spinner-32 GPL-2.0.txt Add full text of GPL version 2.0 December 04, 2013
Octocat-spinner-32 INSTALL.md Remove bitrot related to voip testing April 07, 2014
Octocat-spinner-32 Makefile.dbg Move debug options to Makefile.dbg so we don't have to re-run configure. July 29, 2012
Octocat-spinner-32 Makefile.in Remove bitrot related to voip testing April 07, 2014
Octocat-spinner-32 README.md Fix missing links in README March 05, 2014
Octocat-spinner-32 aclocal.m4 Merge branch 'master' of github.com:servalproject/serval-dna April 23, 2012
Octocat-spinner-32 check-in-out-return.c Uniform copyright notices December 04, 2013
Octocat-spinner-32 cli.c Fix -Wsign-compare warnings: use size_t or unsigned for byte counts December 10, 2013
Octocat-spinner-32 cli.h Fix -Wsign-compare warnings in CLI December 10, 2013
Octocat-spinner-32 commandline.c Improve "mdp ping" command April 17, 2014
Octocat-spinner-32 conf.c New config option: 'debug.config' April 16, 2014
Octocat-spinner-32 conf.h Rename "rhizome_http.h" to "httpd.h" February 03, 2014
Octocat-spinner-32 conf_om.c Fix -Wsign-compare warnings: make loop counters unsigned December 10, 2013
Octocat-spinner-32 conf_parse.c Fix -Wsign-compare warnings: make loop counters unsigned December 10, 2013
Octocat-spinner-32 conf_schema.c Add config set warning if attempting to drop packets on datagram sockets March 12, 2014
Octocat-spinner-32 conf_schema.h New config option: 'debug.config' April 16, 2014
Octocat-spinner-32 config.guess Artefacts created by libtoolize -c -i September 12, 2012
Octocat-spinner-32 config.sub Artefacts created by libtoolize -c -i September 12, 2012
Octocat-spinner-32 config_test.c Fix unsigned warning January 09, 2014
Octocat-spinner-32 configure.in Remove bitrot related to voip testing April 07, 2014
Octocat-spinner-32 constants.h Improve VOMP testing April 10, 2014
Octocat-spinner-32 context1.c Fix compiler warning November 21, 2013
Octocat-spinner-32 crypto.c Migrate keyring sas commands February 19, 2014
Octocat-spinner-32 crypto.h Migrate keyring sas commands February 19, 2014
Octocat-spinner-32 dataformats.c Initial msp library implementation with connection state tracking January 09, 2014
Octocat-spinner-32 dataformats.h Initial msp library implementation with connection state tracking January 09, 2014
Octocat-spinner-32 directory_client.c Replace internal usage of overlay_mdp_dispatch February 19, 2014
Octocat-spinner-32 directory_service.c Replace internal usage of overlay_mdp_dispatch February 19, 2014
Octocat-spinner-32 dna_helper.c Replace internal usage of overlay_mdp_dispatch February 19, 2014
Octocat-spinner-32 encode.c Put back a pile of files needed for building on osx, and also required March 15, 2012
Octocat-spinner-32 fakeradio.c Fix printf formats December 16, 2013
Octocat-spinner-32 fdqueue.c Initial msp library implementation with connection state tracking January 09, 2014
Octocat-spinner-32 fdqueue.h Clean up "serval.h" a bit April 07, 2014
Octocat-spinner-32 fifo.c Uniform copyright notices December 04, 2013
Octocat-spinner-32 fifo.h Uniform copyright notices December 04, 2013
Octocat-spinner-32 golay.c Uniform copyright notices December 04, 2013
Octocat-spinner-32 golay.h Uniform #ifdef __SERVAL_DNA__... for headers December 04, 2013
Octocat-spinner-32 headerfiles.mk New "instance.h" header March 24, 2014
Octocat-spinner-32 http_server.c Improve MeshMS RESTful HTTP failure reporting February 07, 2014
Octocat-spinner-32 http_server.h Improve MeshMS RESTful HTTP failure reporting February 07, 2014
Octocat-spinner-32 httpd.c Return mdp inet & http port numbers in servald start & status February 25, 2014
Octocat-spinner-32 httpd.h Implement HTTP POST /restful/meshms/<SID>/<SID>/sendmessage February 05, 2014
Octocat-spinner-32 install-sh Artefacts created by libtoolize -c -i September 12, 2012
Octocat-spinner-32 instance.c Move Android INSTANCE_PATH from instance.c to Android.mk March 26, 2014
Octocat-spinner-32 instance.h Filesystem Heirarchy Standard (FHS) paths March 26, 2014
Octocat-spinner-32 jni.c Imported ref10/ implementation of crypto_sign from supercop-20120525 October 18, 2012
Octocat-spinner-32 keyring.c Refactor keyring open/seed out of server() April 07, 2014
Octocat-spinner-32 keyring.h Migrate keyring sas commands February 19, 2014
Octocat-spinner-32 log.c Filesystem Heirarchy Standard (FHS) paths March 26, 2014
Octocat-spinner-32 log.h Filesystem Heirarchy Standard (FHS) paths March 26, 2014
Octocat-spinner-32 log_util.c Revive config_test.c November 21, 2013
Octocat-spinner-32 lsif.c Remove spurius include of netinet/if_ether.h, fixes #76 April 07, 2014
Octocat-spinner-32 ltmain.sh Artefacts created by libtoolize -c -i September 12, 2012
Octocat-spinner-32 macconfig Fixed broadcast address discovery to work on Mac. August 08, 2011
Octocat-spinner-32 main.c Uniform copyright notices December 04, 2013
Octocat-spinner-32 mdp_client.c Improve "mdp ping" command April 17, 2014
Octocat-spinner-32 mdp_client.h New "config sync" command April 16, 2014
Octocat-spinner-32 mdp_filter.c Add missing copyright messages April 07, 2014
Octocat-spinner-32 mdp_net.c Uniform copyright notices December 04, 2013
Octocat-spinner-32 mem.c Minor refactor in strn_edup() December 01, 2013
Octocat-spinner-32 mem.h Uniform #ifdef __SERVAL_DNA__... for headers December 04, 2013
Octocat-spinner-32 meshms.c Fix meshms conversations parsing when looking for a single SID February 12, 2014
Octocat-spinner-32 meshms.h Improve MeshMS RESTful HTTP failure reporting February 07, 2014
Octocat-spinner-32 meshms_restful.c Fix 64bit printf formatting February 12, 2014
Octocat-spinner-32 meshpotato_build Assorted unknown changes. Updated Makefile.in etc to properly build s… June 15, 2011
Octocat-spinner-32 monitor-cli.c Fix -Wunused-parameter warnings December 09, 2013
Octocat-spinner-32 monitor-client.c Refactor socket helper functions to take socket_address struct February 20, 2014
Octocat-spinner-32 monitor-client.h Uniform #ifdef __SERVAL_DNA__... for headers December 04, 2013
Octocat-spinner-32 monitor.c Fix android build, related to issue #76 fix April 07, 2014
Octocat-spinner-32 mpbuild Added mesh potato build script. August 10, 2011
Octocat-spinner-32 msp_client.c Add missing copyright messages April 07, 2014
Octocat-spinner-32 msp_client.h Add missing copyright messages April 07, 2014
Octocat-spinner-32 msp_proxy.c Add missing copyright messages April 07, 2014
Octocat-spinner-32 net.c Use ssize_t for read(2) and write(2) return value December 10, 2013
Octocat-spinner-32 net.h Uniform #ifdef __SERVAL_DNA__... for headers December 04, 2013
Octocat-spinner-32 nonce.c Fix -Wunused-parameter warnings December 09, 2013
Octocat-spinner-32 os.c Filesystem Heirarchy Standard (FHS) paths March 26, 2014
Octocat-spinner-32 os.h Filesystem Heirarchy Standard (FHS) paths March 26, 2014
Octocat-spinner-32 overlay.c New config option: server.config_reload_interval_ms April 16, 2014
Octocat-spinner-32 overlay_address.c Refactor interface addresses to use new socket_address struct January 09, 2014
Octocat-spinner-32 overlay_address.h Build filter framework for incoming mdp packets February 19, 2014
Octocat-spinner-32 overlay_buffer.c Refactor rhizome mdp and vomp packet sending February 19, 2014
Octocat-spinner-32 overlay_buffer.h Refactor rhizome mdp and vomp packet sending February 19, 2014
Octocat-spinner-32 overlay_interface.c Finish removing SLIP code and test case April 07, 2014
Octocat-spinner-32 overlay_interface.h Add missing copyright messages April 07, 2014
Octocat-spinner-32 overlay_link.c Replace internal usage of overlay_mdp_dispatch February 19, 2014
Octocat-spinner-32 overlay_mdp.c New "config sync" command April 16, 2014
Octocat-spinner-32 overlay_mdp_services.c Replace internal usage of overlay_mdp_dispatch February 19, 2014
Octocat-spinner-32 overlay_olsr.c Refactor interface addresses to use new socket_address struct January 09, 2014
Octocat-spinner-32 overlay_packet.h Swap to using NOCRYPT / NOSIGN for internal processing February 19, 2014
Octocat-spinner-32 overlay_packetformats.c Refactor socket helper functions to take socket_address struct February 20, 2014
Octocat-spinner-32 overlay_packetradio.c Refactor interface addresses to use new socket_address struct January 09, 2014
Octocat-spinner-32 overlay_payload.c Change overlay_buffer fields from int to size_t December 10, 2013
Octocat-spinner-32 overlay_queue.c Don't report error when dropping a packet due to no peers March 27, 2014
Octocat-spinner-32 performance_timing.c Refactor interface addresses to use new socket_address struct January 09, 2014
Octocat-spinner-32 radio_link.c Refactor interface addresses to use new socket_address struct January 09, 2014
Octocat-spinner-32 radio_link.h Uniform #ifdef __SERVAL_DNA__... for headers December 04, 2013
Octocat-spinner-32 randombytes.c More consistent use of sleep_ms August 27, 2013
Octocat-spinner-32 rhizome.c Rename "rhizome_http.h" to "httpd.h" February 03, 2014
Octocat-spinner-32 rhizome.h Filesystem Heirarchy Standard (FHS) paths March 26, 2014
Octocat-spinner-32 rhizome_bundle.c Fix "name=/file" bug in Rhizome add March 12, 2014
Octocat-spinner-32 rhizome_crypto.c Fix rhizome key generation for meshms January 22, 2014
Octocat-spinner-32 rhizome_database.c Filesystem Heirarchy Standard (FHS) paths March 26, 2014
Octocat-spinner-32 rhizome_direct.c Remove rhizome_read_manifest_file() December 20, 2013
Octocat-spinner-32 rhizome_direct_http.c Fix enum compiler warnings (clang -Wenum-conversion) April 03, 2014
Octocat-spinner-32 rhizome_fetch.c Tidy up rhizome fetch status, remove duplicate data March 05, 2014
Octocat-spinner-32 rhizome_http.c Improve MeshMS RESTful HTTP failure reporting February 07, 2014
Octocat-spinner-32 rhizome_packetformats.c Enable rhizome HTTP transfers over loopback while using local sockets March 05, 2014
Octocat-spinner-32 rhizome_restful.c Rename uuid_t --> serval_uuid_t February 17, 2014
Octocat-spinner-32 rhizome_store.c Only report that a payload exists if it actually exists April 07, 2014
Octocat-spinner-32 rhizome_sync.c Don't check the database again after tranfer completes March 05, 2014
Octocat-spinner-32 rotbuf.c Fix bug in rotbuf_next_chunk() when rotation == 0 May 15, 2013
Octocat-spinner-32 rotbuf.h Remove spurious rotbuf_log() declaration, fixes #75 April 03, 2014
Octocat-spinner-32 route_link.c Don't allow link_send() to dominate the scheduler March 05, 2014
Octocat-spinner-32 serval.h New config option: server.config_reload_interval_ms April 16, 2014
Octocat-spinner-32 serval_packetvisualise.c Fix -Wsign-compare warnings: use size_t or unsigned for byte counts December 10, 2013
Octocat-spinner-32 servalwrap.c Fix android commandline interface July 09, 2013
Octocat-spinner-32 server.c New config option: server.config_reload_interval_ms April 16, 2014
Octocat-spinner-32 sha2.c Add supid copyright headers on request from Andrew Bettison in the se… December 07, 2013
Octocat-spinner-32 sha2.h Substantial preparatory work towards Rhizome/MeshMS store-and-forward December 13, 2011
Octocat-spinner-32 sighandlers.c Add SIGINT handler to cleanup mdp sockets January 09, 2014
Octocat-spinner-32 socket.c Improve "mdp ping" command April 17, 2014
Octocat-spinner-32 socket.h Refactor socket helper functions to take socket_address struct February 20, 2014
Octocat-spinner-32 sourcefiles.mk Clean up "serval.h" a bit April 07, 2014
Octocat-spinner-32 srandomdev.c Add supid copyright headers on request from Andrew Bettison in the se… December 07, 2013
Octocat-spinner-32 str.c Fix formatting of strings with unknown size February 12, 2014
Octocat-spinner-32 str.h Replace config 'rhizome.external_blobs' with 'rhizome.max_blob_size' December 30, 2013
Octocat-spinner-32 strbuf.c Format UUID strings as lower case hex November 13, 2013
Octocat-spinner-32 strbuf.h STRBUF_ALLOCA_FIT() macro January 20, 2014
Octocat-spinner-32 strbuf_helpers.c Fix return value of mdp_send() April 16, 2014
Octocat-spinner-32 strbuf_helpers.h Fix return value of mdp_send() April 16, 2014
Octocat-spinner-32 strlcpy.c Fix issues arising from new strlcpy.c August 14, 2012
Octocat-spinner-32 strlcpy.h Fix build when strlcpy is present January 11, 2013
Octocat-spinner-32 testconfig.sh.in Trival test of dna JNI command line entry point April 23, 2012
Octocat-spinner-32 testdefs.sh Fix test defs: pop_instance did not restore instance March 03, 2014
Octocat-spinner-32 testdefs_rhizome.sh Fix "name=/file" bug in Rhizome add March 12, 2014
Octocat-spinner-32 testframework.sh Improve test framework: tfw_run() function March 03, 2014
Octocat-spinner-32 testnacl.c Add missing copyright/license comment blocks November 21, 2013
Octocat-spinner-32 tfw_createfile.c Fix -Wsign-compare warnings in tfw_createfile December 11, 2013
Octocat-spinner-32 timeit.c add context switching speed test to "test memory" command. October 22, 2013
Octocat-spinner-32 uuid.c Rename uuid_t --> serval_uuid_t February 17, 2014
Octocat-spinner-32 uuid.h Rename uuid_t --> serval_uuid_t February 17, 2014
Octocat-spinner-32 version_servald.c Add "servald version" command and "make copyright" December 05, 2013
Octocat-spinner-32 version_string.sh Cleanup git version arguments March 05, 2014
Octocat-spinner-32 vomp.c Improve VOMP testing April 10, 2014
Octocat-spinner-32 vomp_console.c Enhance console command to allow multiple concurrent calls April 10, 2014
Octocat-spinner-32 xprintf.c Add XPRINT strbuf adapter March 25, 2013
Octocat-spinner-32 xprintf.h Uniform #ifdef __SERVAL_DNA__... for headers December 04, 2013
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.

Configuration

doc/Servald-Configuration.md describes how to set up and run a Serval DNA daemon.

Documentation

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. 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 Voice over Mesh Protocol (VoMP) is Serval's own call negotiation and two-way audio streaming protocol used to implement mesh voice calls. It is analogous to SIP/RTS, which is the dominant protocol used to implement 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.

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

Something went wrong with that request. Please try again.