Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
The Serval Project's Serval Daemon, incorporating Distributed Numbering Architecture (DNA), Rhizome, MDP, VoMP etc
C Shell Java Other

Fix 'meshms' and 'meshmsjava' newsince-arrival tests

Failed because of a database locking storm between the three waiting
newsince REST requests (which polled the database) and the concurrent
'meshms send' CLI commands.  Changed to use REST requests instead of CLI
for 'meshms send'.
latest commit d5b96b9931
@quixotique quixotique authored
Failed to load latest commit information.
Debian/etc Improve Debian init.d script and default file
doc Fix broken link
fec-3.0.1 Fix -Wsign-compare warnings: use size_t or unsigned for byte counts
java/org/servalproject Add missing file
m4 Artefacts created by libtoolize -c -i
nacl Fix -Wsign-compare warnings in NaCl code
openwrt/packages/serval-dna Modify OpenWRT Makefile for development
sqlite-amalgamation-3070900 Fix sqlite compiler warnings, when building with gcc
tests Fix 'meshms' and 'meshmsjava' newsince-arrival tests
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 Ignore new test binary
Android.mk Pass PIE flags for compiling on Android L
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 Improve test framework: test coverage support
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 Update test_cli to match recent config changes
README.md Add text of CC BY 4.0 license
aclocal.m4 Merge branch 'master' of github.com:servalproject/serval-dna
android.c Flush stdout on android
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 Add cli_optional_bid()
cli.h Add support for running and stopping servald from a JVM thread
commandline.c Add support for running and stopping servald from a JVM thread
commandline.h Refactor source and build process to split out test commands
conf.c Refactor source and build process to split out test commands
conf.h Refactor "conf_schema.h" to fix compile warnings
conf_cli.c Release mdp socket in config sync
conf_om.c Don't compare past the end of the parent key
conf_parse.c Refactor "conf_schema.h" to fix compile warnings
conf_schema.c Rearrange interface config to support unicast settings
conf_schema.h Merge RESTful Rhizome journal append into development
config.guess Artefacts created by libtoolize -c -i
config.sub Artefacts created by libtoolize -c -i
configure.in Measure free space on Android using statfs()
console.c Build the array of console commands by using linkage tricks
console.h Overhaul Makefile and header files
constants.h Add support for mdp clients to provide a link layer packet transport
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
directory_client.c Add support for running and stopping servald from a JVM thread
directory_service.c Fix un/signed comparison warning (error)
dna_helper.c Stop an existing dna helper on config reload
fakeradio.c Refactor source and build process to split out test commands
fdqueue.c Add support for running and stopping servald from a JVM thread
fdqueue.h Add support for running and stopping servald from a JVM thread
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 Accept '#passphrase' for bundle secret arguments
http_server.c HTTP server debug: log content of HTTP responses
http_server.h Allow lcal http servers to perform cross site scripting of restful APIs
httpd.c Add support for running and stopping servald from a JVM thread
httpd.h Add 'manifest-id' parameter to /restful/rhizome/insert
install-sh Artefacts created by libtoolize -c -i
instance.c Overhaul Makefile and header files
instance.h Filesystem Heirarchy Standard (FHS) paths
jni.c Imported ref10/ implementation of crypto_sign from supercop-20120525
keyring.c Fix test failure: create keyring
keyring.h Add support for running and stopping servald from a JVM thread
keyring_cli.c Fix test failure: create keyring
keyring_restful.c Add support for running and stopping servald from a JVM thread
limit.c Move rate limit code to separate file
limit.h Move rate limit code to separate file
log.c Refactor source and build process to split out test commands
log.h Move serverMode flag from log.c to server.c
logMessage.c Overhaul Makefile and header files
log_stderr.c Move serverMode flag from log.c to server.c
log_util.c Refactor source and build process to split out test commands
lsif.c initialise length field in netmask_addr
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 Trace network paths that are supposed to exist
mdp_client.h Add support for mdp clients to provide a link layer packet transport
mdp_filter.c Make strn_to_xxx() functions consistent
mdp_net.c Don't force the caller to initialise the address buffer length
mem.c Minor refactor in strn_edup()
mem.h Uniform #ifdef __SERVAL_DNA__... for headers
meshms.c Change return type of rhizome_fill_manifest()
meshms.h Fix RESTful MeshMS newsince ACK logic
meshms_restful.c Make strn_to_xxx() functions consistent
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 Overhaul Makefile and header files
monitor-client.h Uniform #ifdef __SERVAL_DNA__... for headers
monitor.c Log the source of monitor errors
mpbuild Added mesh potato build script.
msp_client.c Fix off by one error in packet acknowledgment
msp_client.h Overhaul Makefile and header files
msp_proxy.c Build the array of console commands by using linkage tricks
net.c Overhaul Makefile and header files
net.h Overhaul Makefile and header files
network_cli.c Add explicit timeout parameter to mdp trace for slow links
os.c fix OSX build errors.
os.h Add timestamps to meshms messages and acks
overlay_address.c Add support for running and stopping servald from a JVM thread
overlay_address.h Add support for running and stopping servald from a JVM thread
overlay_buffer.c Remove unused debug flags
overlay_buffer.h Refactor rhizome mdp and vomp packet sending
overlay_interface.c Use configured reachable timeout for network links, read dummy files …
overlay_interface.h Rearrange interface config to support unicast settings
overlay_link.c Use configured reachable timeout for network links, read dummy files …
overlay_mdp.c Add support for running and stopping servald from a JVM thread
overlay_mdp_services.c Refactor keyring identity iteration
overlay_olsr.c Refactor interface addresses to use new socket_address struct
overlay_packet.h Re-route packets on retransmision if the route has changed
overlay_packetformats.c Rearrange interface config to support unicast settings
overlay_packetradio.c Rearrange interface config to support unicast settings
overlay_payload.c Allow for different routes per packet destination
overlay_queue.c Use configured reachable timeout for network links, read dummy files …
performance_timing.c Add support for running and stopping servald from a JVM thread
radio_link.c Rearrange interface config to support unicast settings
radio_link.h Uniform #ifdef __SERVAL_DNA__... for headers
randombytes.c More consistent use of sleep_ms
rhizome.c /restful/rhizome/append on existing journal
rhizome.h Add support for running and stopping servald from a JVM thread
rhizome_bundle.c Suppress Rhizome add de-duplication for journals
rhizome_cli.c Add 'rhizome add file --bundle=BID' option
rhizome_crypto.c crypto_sign_compute_public_key() return void not int
rhizome_database.c Add support for running and stopping servald from a JVM thread
rhizome_direct.c Build the array of console commands by using linkage tricks
rhizome_direct_http.c Change return type of rhizome_fill_manifest()
rhizome_fetch.c Ensure sql lock failures are returned.
rhizome_http.c Ensure sql lock failures are returned.
rhizome_packetformats.c Improve debug info for rhizome sync
rhizome_restful.c RESTful Rhizome add/insert always return HTTP 201
rhizome_store.c /restful/rhizome/append on existing journal
rhizome_sync.c Improve debug info for rhizome sync
rhizome_types.h Make strn_to_xxx() functions consistent
rotbuf.c Fix bug in rotbuf_next_chunk() when rotation == 0
rotbuf.h Remove spurious rotbuf_log() declaration, fixes #75
route_link.c Relax ack timing
serval.h Add support for running and stopping servald from a JVM thread
serval_packetvisualise.c Overhaul Makefile and header files
serval_types.h Make strn_to_xxx() functions consistent
servalwrap.c Fix android commandline interface
server.c Add support for running and stopping servald from a JVM thread
server.h Add support for running and stopping servald from a JVM thread
sha2.c Add SHA512_Final_Len() et al
sha2.h Add SHA512_Final_Len() et al
sighandlers.c Overhaul Makefile and header files
sighandlers.h Overhaul Makefile and header files
simulator.c Fix conflict on UNUSED() macro from OpenJDK 7
simulator.h Create new AF_UNIX based network simulator
socket.c Overhaul Makefile and header files
socket.h Add support for mdp clients to provide a link layer packet transport
sourcefiles.mk Refactor source and build process to split out test commands
srandomdev.c Add supid copyright headers on request from Andrew Bettison in the se…
str.c Make strn_to_xxx() functions consistent
str.h Make strn_to_xxx() functions consistent
strbuf.c Change return type of strbuf_sprintf()
strbuf.h Change return type of strbuf_sprintf()
strbuf_helpers.c Rhizome Java API: improved form-data headers
strbuf_helpers.h Set up SEGV crash handler in main() not server()
strlcpy.c Fix issues arising from new strlcpy.c
strlcpy.h Fix build when strlcpy is present
test_cli.c Update test_cli to match recent config changes
testconfig.sh.in Trival test of dna JNI command line entry point
testdefs.sh Fix 'meshms' and 'meshmsjava' newsince-arrival tests
testdefs_java.sh Rhizome Java API: list bundles new since token
testdefs_json.sh Split up 'rhizomehttp' test script
testdefs_meshms.sh Fix 'meshms' and 'meshmsjava' newsince-arrival tests
testdefs_rhizome.sh Rhizome test defs support 'tail' field
testframework.sh Improve test framework: report stderr/stdout of execute within fork
testnacl.c Add missing copyright/license comment blocks
tfw_createfile.c Allow write to return less bytes than we asked for, or zero
timeit.c add context switching speed test to "test memory" command.
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 Send ANSWERED message even if we never see RINGING
vomp_console.c Build the array of console commands by using linkage tricks
whence.c Overhaul Makefile and header files
whence.h Overhaul Makefile and header files
xprintf.c Add XPRINT strbuf adapter
xprintf.h Fix minor compilation issues on CentOS.

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