The Serval Project's core daemon that implements Distributed Numbering Architecture (DNA), MDP, VoMP, Rhizome, MeshMS, etc.
Go to file
2016-01-21 15:17:52 +01:00
Debian/etc
doc Minor improvements to README 2016-01-11 18:02:26 +10:30
fec-3.0.1
java/org/servalproject Split java test classes into a separate folder 2016-01-19 10:41:52 +10:30
javatest/org/servalproject/test Split java test classes into a separate folder 2016-01-19 10:41:52 +10:30
m4 fix detection of var_attributes_section_seg on OSX 2016-01-21 12:12:52 +01:00
nacl
openwrt/packages/serval-dna
sqlite-amalgamation-3070900 Fix sqlite compiler warnings, when building with gcc 2014-07-01 18:31:31 +09:30
tests Don't talk about SID's that don't match the whole abbreviation 2016-01-12 10:29:46 +10:30
utilities
win32
.dir-locals.el
.gitignore Remove aclocal.m4 from version control 2016-01-11 18:02:26 +10:30
android.c Move DEBUGF() from "log.h" to "debug.h" 2015-07-13 18:24:04 +09:30
Android.mk Add Java API for setting the instance path 2016-01-18 13:22:36 +10:30
cc-by-4.0.png Add copyright notices and CC-BY license to README.md and INSTALL.md 2014-05-20 14:52:57 +09:30
CC-BY-4.0.md Add text of CC BY 4.0 license 2014-05-21 17:37:23 +09:30
check-in-out-return.c
cli.c Move DEBUGF() from "log.h" to "debug.h" 2015-07-13 18:24:04 +09:30
cli.h Don't log cli args unless debug.verbose is set 2015-08-10 11:41:38 +09:30
commandline.c shorten section names (and precursors) to keep in the 16 char limit 2015-08-24 10:17:04 +09:30
commandline.h Fix broken clang and Android builds 2015-11-23 15:00:25 +10:30
conf_cli.c Add strbuf_local_buf() macro 2015-11-02 10:11:41 +10:30
conf_om.c Improve config overflow message 2015-12-14 10:31:38 +10:30
conf_parse.c Improve config overflow message 2015-12-14 10:31:38 +10:30
conf_schema.c make rhizome http port number configurable via serval.conf 2015-08-24 16:06:25 +09:30
conf_schema.h make rhizome http port number configurable via serval.conf 2015-08-24 16:06:25 +09:30
conf.c Move DEBUGF() from "log.h" to "debug.h" 2015-07-13 18:24:04 +09:30
conf.h Improve config overflow message 2015-12-14 10:31:38 +10:30
config.guess Update config.guess and config.sub scripts 2016-01-18 11:53:52 +10:30
config.sub Update config.guess and config.sub scripts 2016-01-18 11:53:52 +10:30
configure.in Fix OSX build errors 2016-01-18 21:16:01 +10:30
console.c Fix broken clang and Android builds 2015-11-23 15:00:25 +10:30
console.h Overhaul Makefile and header files 2014-05-26 15:36:26 +09:30
constants.h Fix broken clang and Android builds 2015-11-23 15:00:25 +10:30
context1.c
CONTRIBUTORS.md
COPYRIGHT.txt
crypto.c crypto_sign_compute_public_key() return void not int 2015-03-23 17:31:06 +10:30
crypto.h crypto_sign_compute_public_key() return void not int 2015-03-23 17:31:06 +10:30
dataformats.c Make strn_to_xxx() functions consistent 2015-03-28 04:53:09 +10:30
dataformats.h
debug.h Move DEBUGF() from "log.h" to "debug.h" 2015-07-13 18:24:04 +09:30
directory_client.c Move if(config.debug.xxx) tests into DEBUGF() 2015-07-13 16:00:05 +09:30
directory_service.c Add buf_strncpy_nul(), use in place of strlcpy() 2015-11-02 10:11:41 +10:30
dna_helper.c Add strbuf_local_buf() macro 2015-11-02 10:11:41 +10:30
fakeradio.c Refactor source and build process to split out test commands 2014-12-01 13:26:27 +10:30
fdqueue.c Move if(config.debug.xxx) tests into DEBUGF() 2015-07-13 16:00:05 +09:30
fdqueue.h Remove terminating semicolons from within macros 2015-11-02 10:11:41 +10:30
features.h Fix broken clang and Android builds 2015-11-23 15:00:25 +10:30
fifo.h
golay.c Refactor to fix some OS-X compile warnings 2014-08-14 17:39:44 +09:30
golay.h
GPL-2.0.txt
headerfiles.mk Fix broken clang and Android builds 2015-11-23 15:00:25 +10:30
http_server.c Improve HTTP responses 2015-12-01 00:51:15 +10:30
http_server.h Improve HTTP responses 2015-12-01 00:51:15 +10:30
httpd.c Refactor Rhizome result handling 2015-12-01 00:51:15 +10:30
httpd.h Refactor Rhizome result handling 2015-12-01 00:51:15 +10:30
install-sh
INSTALL.md Improve build instructions 2016-01-18 12:07:11 +10:30
instance.c Add Java API for setting the instance path 2016-01-18 13:22:36 +10:30
instance.h Fix broken clang and Android builds 2015-11-23 15:00:25 +10:30
jni.c
keyring_cli.c Move if(config.debug.xxx) tests into DEBUGF() 2015-07-13 16:00:05 +09:30
keyring_restful.c Improve REST HTTP response status codes 2015-11-02 12:26:40 +10:30
keyring.c Only log debug messages for keyring slots that fail validation 2016-01-12 15:05:41 +10:30
keyring.h make rhizome http port number configurable via serval.conf 2015-08-24 16:06:25 +09:30
LICENSE-DOCUMENTATION.md Add text of CC BY 4.0 license 2014-05-21 17:37:23 +09:30
limit.c
limit.h
log_context.c Add log_context 2015-06-29 15:39:19 +09:30
log_on_config_change.c Fix OSX build errors 2016-01-18 21:16:01 +10:30
log_stderr.c Move serverMode flag from log.c to server.c 2014-06-11 14:53:26 +09:30
log_util.c Add strbuf_local_buf() macro 2015-11-02 10:11:41 +10:30
log.c Add strbuf_local_buf() macro 2015-11-02 10:11:41 +10:30
log.h Reimplement WHY() macro without comma operator 2015-10-26 15:58:52 +10:30
logMessage.c Overhaul Makefile and header files 2014-05-26 15:36:26 +09:30
lsif.c Poll netlink socket for interface changes on linux systems 2015-10-12 18:11:44 +10:30
ltmain.sh
macconfig
main.c Overhaul Makefile and header files 2014-05-26 15:36:26 +09:30
Makefile.dbg
Makefile.in Expand m4 section attribute detection to include linking the resulting object 2016-01-19 11:23:04 +10:30
mdp_client.c Fix MDP client packet receive bug on OSX 2016-01-19 04:05:46 +10:30
mdp_client.h Add support for mdp clients to provide a link layer packet transport 2015-03-02 15:44:34 +10:30
mdp_filter.c Move if(config.debug.xxx) tests into DEBUGF() 2015-07-13 16:00:05 +09:30
mem.c Move if(config.debug.xxx) tests into DEBUGF() 2015-07-13 16:00:05 +09:30
mem.h Fix broken clang and Android builds 2015-11-23 15:00:25 +10:30
meshms_restful.c Improve REST HTTP response status codes 2015-11-02 12:26:40 +10:30
meshms.c Improve Rhizome HTTP API diagnostics 2015-12-07 22:35:42 +10:30
meshms.h Fix RESTful MeshMS newsince ACK logic 2014-11-12 23:09:00 +10:30
meshpotato_build
monitor-cli.c Build the array of console commands by using linkage tricks 2014-08-22 10:36:52 +09:30
monitor-client.c Move DEBUGF() from "log.h" to "debug.h" 2015-07-13 18:24:04 +09:30
monitor-client.h
monitor.c Add route_link.h 2015-09-28 11:58:48 +09:30
mpbuild
msp_client.c Move DEBUGF() from "log.h" to "debug.h" 2015-07-13 18:24:04 +09:30
msp_client.h Overhaul Makefile and header files 2014-05-26 15:36:26 +09:30
msp_proxy.c Move DEBUGF() from "log.h" to "debug.h" 2015-07-13 18:24:04 +09:30
net.c Overhaul Makefile and header files 2014-05-26 15:36:26 +09:30
net.h Include "whence.h" instead of "log.h" where suitable 2015-07-13 18:24:16 +09:30
network_cli.c Add strbuf_local_buf() macro 2015-11-02 10:11:41 +10:30
os.c Ignore potential race condition between setting up instance path and first log message 2015-08-24 16:38:55 +09:30
os.h Add timestamps to meshms messages and acks 2014-07-14 13:43:37 +09:30
overlay_address.c Simplify subscriber enumeration & only support the use-cases we need 2016-01-12 11:47:29 +10:30
overlay_address.h Don't ask for explanation of SIDs with dead routing links 2015-11-16 14:09:35 +10:30
overlay_buffer.c use allocSize instead of allocated for asserts. 2016-01-21 15:17:52 +01:00
overlay_buffer.h
overlay_interface.c rename NLMSG_OK macro we have included to avoid name collision. 2016-01-21 12:22:51 +01:00
overlay_interface.h Poll netlink socket for interface changes on linux systems 2015-10-12 18:11:44 +10:30
overlay_link.c Add route_link.h 2015-09-28 11:58:48 +09:30
overlay_mdp_services.c Don't ask for explanation of SIDs with dead routing links 2015-11-16 14:09:35 +10:30
overlay_mdp.c Fix MDP client packet receive bug on OSX 2016-01-19 04:05:46 +10:30
overlay_olsr.c Don't ask for explanation of SIDs with dead routing links 2015-11-16 14:09:35 +10:30
overlay_packet.h Fix vomp stun tests 2015-06-22 14:50:28 +09:30
overlay_packetformats.c Don't ask for explanation of SIDs with dead routing links 2015-11-16 14:09:35 +10:30
overlay_packetradio.c Move if(config.debug.xxx) tests into DEBUGF() 2015-07-13 16:00:05 +09:30
overlay_payload.c Allow for different routes per packet destination 2014-09-23 14:54:22 +09:30
overlay_queue.c Squelch logging due to unacked packet timeout 2015-11-30 14:22:45 +10:30
performance_timing.c Move if(config.debug.xxx) tests into DEBUGF() 2015-07-13 16:00:05 +09:30
radio_link.c Move if(config.debug.xxx) tests into DEBUGF() 2015-07-13 16:00:05 +09:30
radio_link.h
randombytes.c
README.md Minor improvements to README 2016-01-11 18:02:26 +10:30
rhizome_bundle.c Improve Rhizome HTTP API diagnostics 2015-12-07 22:35:42 +10:30
rhizome_cli.c Running out of space is not a fatal error 2016-01-19 15:09:49 +10:30
rhizome_crypto.c Refactor Rhizome result handling 2015-12-01 00:51:15 +10:30
rhizome_database.c Remove terminating semicolons from within macros 2015-11-02 10:11:41 +10:30
rhizome_direct_http.c Improve Rhizome HTTP API diagnostics 2015-12-07 22:35:42 +10:30
rhizome_direct.c Add strbuf_local_buf() macro 2015-11-02 10:11:41 +10:30
rhizome_fetch.c Improve Rhizome HTTP API diagnostics 2015-12-07 22:35:42 +10:30
rhizome_http.c Add strbuf_local_buf() macro 2015-11-02 10:11:41 +10:30
rhizome_packetformats.c make rhizome http port number configurable via serval.conf 2015-08-24 16:06:25 +09:30
rhizome_restful.c Document REST POST /restful/rhizome/insert 2015-12-07 22:39:19 +10:30
rhizome_store.c Document REST POST /restful/rhizome/insert 2015-12-07 22:39:19 +10:30
rhizome_sync.c add missing OUT() to sync_send_response exit path if sqllite 2015-12-26 15:44:22 +10:30
rhizome_types.h make rhizome http port number configurable via serval.conf 2015-08-24 16:06:25 +09:30
rhizome.c Improve Rhizome HTTP API diagnostics 2015-12-07 22:35:42 +10:30
rhizome.h Improve Rhizome HTTP API diagnostics 2015-12-07 22:35:42 +10:30
rotbuf.c
rotbuf.h
route_link.c Use the unicast tick_ms for link ACK's, if configured 2016-01-13 12:01:29 +10:30
route_link.h Add route_link.h 2015-09-28 11:58:48 +09:30
section.h Fix OSX build errors 2016-01-18 21:16:01 +10:30
serval_packetvisualise.c Overhaul Makefile and header files 2014-05-26 15:36:26 +09:30
serval_types.h Make strn_to_xxx() functions consistent 2015-03-28 04:53:09 +10:30
serval.h Fix broken clang and Android builds 2015-11-23 15:00:25 +10:30
servalwrap.c
server_httpd.c Add strbuf_local_buf() macro 2015-11-02 10:11:41 +10:30
server.c Revert some recent tweaks that were causing test failures 2016-01-11 16:23:32 +10:30
server.h Add support for running and stopping servald from a JVM thread 2015-05-25 11:46:37 +09:30
sha2.c Add SHA512_Final_Len() et al 2014-11-13 09:59:21 +10:30
sha2.h Add SHA512_Final_Len() et al 2014-11-13 09:59:21 +10:30
sighandlers.c Fix broken clang and Android builds 2015-11-23 15:00:25 +10:30
sighandlers.h Overhaul Makefile and header files 2014-05-26 15:36:26 +09:30
simulator.c Add strbuf_local_buf() macro 2015-11-02 10:11:41 +10:30
simulator.h Create new AF_UNIX based network simulator 2014-05-23 10:47:22 +09:30
socket.c Fix MDP client packet receive bug on OSX 2016-01-19 04:05:46 +10:30
socket.h Fix MDP client packet receive bug on OSX 2016-01-19 04:05:46 +10:30
sourcefiles.mk Fix MDP client packet receive bug on OSX 2016-01-19 04:05:46 +10:30
srandomdev.c
str.c Add functions to parse uint16_t 2015-10-01 07:05:17 +09:30
str.h Add buf_strncpy_nul(), use in place of strlcpy() 2015-11-02 10:11:41 +10:30
strbuf_helpers.c Fix empty-string tests on char[] 2015-10-01 07:05:17 +09:30
strbuf_helpers.h Format network addresses using posix API 2015-09-28 11:58:48 +09:30
strbuf.c Optimise strbuf_ncat() 2015-11-17 00:42:06 +10:30
strbuf.h Fix broken clang and Android builds 2015-11-23 15:00:25 +10:30
strlcpy.c Reimplement strlcpy() using strncpy_nul() 2015-11-02 10:11:41 +10:30
strlcpy.h Reimplement strlcpy() using strncpy_nul() 2015-11-02 10:11:41 +10:30
test_cli.c Fix broken clang and Android builds 2015-11-23 15:00:25 +10:30
testconfig.sh.in
testdefs_java.sh Split java test classes into a separate folder 2016-01-19 10:41:52 +10:30
testdefs_json.sh Split up 'rhizomehttp' test script 2014-06-26 15:08:48 +09:30
testdefs_meshms.sh Fix 'meshms' and 'meshmsjava' newsince-arrival tests 2015-05-25 16:46:43 +09:30
testdefs_rhizome.sh Fix 'rhizomerestful' and 'rhizomejava' newsince-arrival tests 2015-06-02 02:23:06 +09:30
testdefs.sh Define $LF in testdefs 2015-12-07 22:35:42 +10:30
testframework.sh Improve test framework: report stderr/stdout of execute within fork 2015-05-18 17:17:29 +09:30
testnacl.c
tfw_createfile.c Add --omit option to 'tfw_createfile' utility 2015-12-07 22:35:42 +10:30
timeit.c
trigger.h Remove terminating semicolons from within macros 2015-11-02 10:11:41 +10:30
uuid.c
uuid.h
version_servald.c
version_string.sh Don't depend on .git folders or on error text strings 2014-12-12 11:01:34 +10:30
vomp_console.c Move if(config.debug.xxx) tests into DEBUGF() 2015-07-13 16:00:05 +09:30
vomp.c Add strbuf_local_buf() macro 2015-11-02 10:11:41 +10:30
whence.c Add alloca_sourceloc(), refactored from log.c 2015-06-29 15:39:19 +09:30
whence.h Add alloca_sourceloc(), refactored from log.c 2015-06-29 15:39:19 +09:30
xprintf.c
xprintf.h Fix broken clang and Android builds 2015-11-23 15:00:25 +10:30

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

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.

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.