Skip to content
The Serval Project's Serval Daemon, incorporating Distributed Numbering Architecture (DNA), Rhizome, MDP, VoMP etc
C Shell C++ Java Python Makefile
Failed to load latest commit information.
Debian/etc Improve Debian init.d script and default file
doc Fix OSX bugs in test framework
fec-3.0.1 Fix -Wsign-compare warnings: use size_t or unsigned for byte counts
java/org/servalproject Split java test classes into a separate folder
javatest/org/servalproject/test Split java test classes into a separate folder
m4 fix detection of var_attributes_section_seg on OSX
nacl Replace nacl & sha methods with versions from libsodium to avoid unde…
openwrt/packages/serval-dna Modify OpenWRT Makefile for development
sqlite-amalgamation-3100200 Update sqlite
tests Make sure the test is performed on the correct serval instance
utilities Fix Markdown formatting
win32 Allow clients to request variables for all records by passing empty did.
.dir-locals.el Add file to set emacs variables to match the prevailing style.
.gitignore Remove aclocal.m4 from version control
Android.mk Update sqlite
CC-BY-4.0.md Add text of CC BY 4.0 license
CONTRIBUTORS.md Add CONTRIBUTORS.md file, fix alternative links in README.md
COPYRIGHT.txt Add Petter Reinholdtsen to copyright message
GPL-2.0.txt Add full text of GPL version 2.0
INSTALL.md Fix OSX bugs in test framework
LICENSE-DOCUMENTATION.md Add text of CC BY 4.0 license
Makefile.dbg Move debug options to Makefile.dbg so we don't have to re-run configure.
Makefile.in Suppress sqlite.c compile warnings with gcc 5.3
README.md Minor improvements to README
android.c Move DEBUGF() from "log.h" to "debug.h"
cc-by-4.0.png Add copyright notices and CC-BY license to README.md and INSTALL.md
check-in-out-return.c Uniform copyright notices
cli.c Move DEBUGF() from "log.h" to "debug.h"
cli.h Don't log cli args unless debug.verbose is set
commandline.c Workaround stack alignment bugs when compiling with clang
commandline.h Fix broken clang and Android builds
conf.c Move DEBUGF() from "log.h" to "debug.h"
conf.h Avoid undefined behaviour as highlighted by clang
conf_cli.c Add strbuf_local_buf() macro
conf_om.c Improve config overflow message
conf_parse.c Improve config overflow message
conf_schema.c make rhizome http port number configurable via serval.conf
conf_schema.h make rhizome http port number configurable via serval.conf
config.guess Update config.guess and config.sub scripts
config.sub Update config.guess and config.sub scripts
configure.in Fix OSX build errors
console.c Fix broken clang and Android builds
console.h Overhaul Makefile and header files
constants.h Fix broken clang and Android builds
context1.c Fix compiler warning
crypto.c crypto_sign_compute_public_key() return void not int
crypto.h crypto_sign_compute_public_key() return void not int
dataformats.c Make strn_to_xxx() functions consistent
dataformats.h Initial msp library implementation with connection state tracking
debug.h Move DEBUGF() from "log.h" to "debug.h"
directory_client.c Establish a unicast link to a configured host on demand
directory_service.c Add buf_strncpy_nul(), use in place of strlcpy()
dna_helper.c Handle stream EOF without entering an infinite poll loop
fakeradio.c Refactor source and build process to split out test commands
fdqueue.c Handle stream EOF without entering an infinite poll loop
fdqueue.h Remove terminating semicolons from within macros
features.h Fix broken clang and Android builds
fifo.h Uniform copyright notices
golay.c Refactor to fix some OS-X compile warnings
golay.h Uniform #ifdef __SERVAL_DNA__... for headers
headerfiles.mk Update sqlite
http_server.c Handle stream EOF without entering an infinite poll loop
http_server.h Improve HTTP responses
httpd.c Refactor Rhizome result handling
httpd.h Refactor Rhizome result handling
install-sh Artefacts created by libtoolize -c -i
instance.c Add Java API for setting the instance path
instance.h Fix broken clang and Android builds
jni.c Imported ref10/ implementation of crypto_sign from supercop-20120525
keyring.c Avoid undefined behaviour as highlighted by clang
keyring.h make rhizome http port number configurable via serval.conf
keyring_cli.c Move if(config.debug.xxx) tests into DEBUGF()
keyring_restful.c Improve REST HTTP response status codes
limit.c Move rate limit code to separate file
limit.h Move rate limit code to separate file
log.c Redirect any output from the server to stderr to the log file
log.h Redirect any output from the server to stderr to the log file
logMessage.c Overhaul Makefile and header files
log_context.c Add log_context
log_on_config_change.c Fix OSX build errors
log_stderr.c Move serverMode flag from log.c to server.c
log_util.c Add strbuf_local_buf() macro
lsif.c Poll netlink socket for interface changes on linux systems
ltmain.sh Artefacts created by libtoolize -c -i
macconfig Fixed broadcast address discovery to work on Mac.
main.c Overhaul Makefile and header files
mdp_client.c Fix MDP client packet receive bug on OSX
mdp_client.h Add support for mdp clients to provide a link layer packet transport
mdp_filter.c Move if(config.debug.xxx) tests into DEBUGF()
mem.c Move if(config.debug.xxx) tests into DEBUGF()
mem.h Fix broken clang and Android builds
meshms.c Improve Rhizome HTTP API diagnostics
meshms.h Fix RESTful MeshMS newsince ACK logic
meshms_restful.c Improve REST HTTP response status codes
meshpotato_build Assorted unknown changes. Updated Makefile.in etc to properly build s…
monitor-cli.c Build the array of console commands by using linkage tricks
monitor-client.c Move DEBUGF() from "log.h" to "debug.h"
monitor-client.h Uniform #ifdef __SERVAL_DNA__... for headers
monitor.c Add route_link.h
mpbuild Added mesh potato build script.
msp_client.c Move DEBUGF() from "log.h" to "debug.h"
msp_client.h Overhaul Makefile and header files
msp_proxy.c Move DEBUGF() from "log.h" to "debug.h"
net.c Handle stream EOF without entering an infinite poll loop
net.h Include "whence.h" instead of "log.h" where suitable
network_cli.c Add strbuf_local_buf() macro
os.c Avoid undefined behaviour as highlighted by clang
os.h Add timestamps to meshms messages and acks
overlay_address.c Simplify subscriber enumeration & only support the use-cases we need
overlay_address.h Establish a unicast link to a configured host on demand
overlay_buffer.c Avoid undefined behaviour as highlighted by clang
overlay_buffer.h Refactor rhizome mdp and vomp packet sending
overlay_interface.c Delay interface re-detection after errors to rate limit continuous fa…
overlay_interface.h Poll netlink socket for interface changes on linux systems
overlay_link.c Establish a unicast link to a configured host on demand
overlay_mdp.c Fix MDP client packet receive bug on OSX
overlay_mdp_services.c Avoid undefined behaviour as highlighted by clang
overlay_olsr.c Don't ask for explanation of SIDs with dead routing links
overlay_packet.h Fix vomp stun tests
overlay_packetformats.c Don't ask for explanation of SIDs with dead routing links
overlay_packetradio.c Move if(config.debug.xxx) tests into DEBUGF()
overlay_payload.c Allow for different routes per packet destination
overlay_queue.c Avoid undefined behaviour as highlighted by clang
performance_timing.c Move if(config.debug.xxx) tests into DEBUGF()
radio_link.c Move if(config.debug.xxx) tests into DEBUGF()
radio_link.h Uniform #ifdef __SERVAL_DNA__... for headers
randombytes.c More consistent use of sleep_ms
rhizome.c Improve Rhizome HTTP API diagnostics
rhizome.h Replace nacl & sha methods with versions from libsodium to avoid unde…
rhizome_bundle.c Replace nacl & sha methods with versions from libsodium to avoid unde…
rhizome_cli.c Running out of space is not a fatal error
rhizome_crypto.c Refactor Rhizome result handling
rhizome_database.c Workaround stack alignment bugs when compiling with clang
rhizome_direct.c Add strbuf_local_buf() macro
rhizome_direct_http.c Improve Rhizome HTTP API diagnostics
rhizome_fetch.c Handle stream EOF without entering an infinite poll loop
rhizome_http.c Add strbuf_local_buf() macro
rhizome_packetformats.c make rhizome http port number configurable via serval.conf
rhizome_restful.c Document REST POST /restful/rhizome/insert
rhizome_store.c Replace nacl & sha methods with versions from libsodium to avoid unde…
rhizome_sync.c add missing OUT() to sync_send_response exit path if sqllite
rhizome_types.h Replace nacl & sha methods with versions from libsodium to avoid unde…
rotbuf.c Fix bug in rotbuf_next_chunk() when rotation == 0
rotbuf.h Remove spurious rotbuf_log() declaration, fixes #75
route_link.c Reduce unintentional chattiness
route_link.h Add route_link.h
section.h Fix OSX build errors
serval.h Fix broken clang and Android builds
serval_packetvisualise.c Overhaul Makefile and header files
serval_types.h Replace nacl & sha methods with versions from libsodium to avoid unde…
servalwrap.c Fix android commandline interface
server.c Redirect any output from the server to stderr to the log file
server.h Add support for running and stopping servald from a JVM thread
server_httpd.c Add strbuf_local_buf() macro
sha2.c Replace nacl & sha methods with versions from libsodium to avoid unde…
sha2.h Replace nacl & sha methods with versions from libsodium to avoid unde…
sighandlers.c Fix broken clang and Android builds
sighandlers.h Overhaul Makefile and header files
simulator.c Add strbuf_local_buf() macro
simulator.h Create new AF_UNIX based network simulator
socket.c Fix MDP client packet receive bug on OSX
socket.h Fix MDP client packet receive bug on OSX
sourcefiles.mk Update sqlite
srandomdev.c Add supid copyright headers on request from Andrew Bettison in the se…
str.c Replace nacl & sha methods with versions from libsodium to avoid unde…
str.h Add buf_strncpy_nul(), use in place of strlcpy()
strbuf.c Optimise strbuf_ncat()
strbuf.h Workaround stack alignment bugs when compiling with clang
strbuf_helpers.c Avoid undefined behaviour as highlighted by clang
strbuf_helpers.h Format network addresses using posix API
strlcpy.c Reimplement strlcpy() using strncpy_nul()
strlcpy.h Reimplement strlcpy() using strncpy_nul()
test_cli.c Fix broken clang and Android builds
testconfig.sh.in Trival test of dna JNI command line entry point
testdefs.sh Fix OSX bugs in test framework
testdefs_java.sh Split java test classes into a separate folder
testdefs_json.sh Split up 'rhizomehttp' test script
testdefs_meshms.sh Fix 'meshms' and 'meshmsjava' newsince-arrival tests
testdefs_rhizome.sh Fix 'rhizomerestful' and 'rhizomejava' newsince-arrival tests
testframework.sh Fix OSX bugs in test framework
testnacl.c Add missing copyright/license comment blocks
tfw_createfile.c Add --omit option to 'tfw_createfile' utility
timeit.c add context switching speed test to "test memory" command.
trigger.h Remove terminating semicolons from within macros
uuid.c Rename uuid_t --> serval_uuid_t
uuid.h Rename uuid_t --> serval_uuid_t
version_servald.c Add "servald version" command and "make copyright"
version_string.sh Don't depend on .git folders or on error text strings
vomp.c Add strbuf_local_buf() macro
vomp_console.c Move if(config.debug.xxx) tests into DEBUGF()
whence.c Add alloca_sourceloc(), refactored from log.c
whence.h Add alloca_sourceloc(), refactored from log.c
xprintf.c Add XPRINT strbuf adapter
xprintf.h Fix broken clang and Android builds

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.