Andrew Bettison c7a2fb4573 Add nibble-tree iterator
The new struct tree_iterator and associated start/get/next/free
functions replace the recursive walk() function, removing the need for a
callback when iterating over all nodes in the tree, and allowing
iteration to be suspended while other pseudo-threads are run.  This
allows an HTTP REST request to keep a tree_iterator in its state struct
and potentially simplifies other areas of the code.

The iterator free()s any empty internal tree nodes that it encounters,
as did the original tree_walk() function.  To support the existence of
multiple iterators at once, a reference count has been added to the
tree_node struct, to prevent any iterator from free()ing a node while
any other iterators point to it; only the last iterator to pop out of an
empty node will free() it.

The tree_walk() and tree_walk_prefix() functions have been
re-implemented to use an iterator state object internally.  This
resolves an outstanding TODO to perform tree-node freeing during a
prefix walk, and simplifies the code considerably.

Renamed some function parameters and struct members to make the
nibble-tree API a little more self-explanatory.

Added a nibble-tree test to the 'serval-tests' utility.
2018-03-29 15:19:54 +10:30
2018-03-06 15:29:29 +10:30
2017-09-27 14:52:05 +09:30
2018-03-29 15:19:54 +10:30
2013-02-22 00:05:34 -08:00
2018-03-06 15:29:29 +10:30
2016-11-14 11:28:03 +10:30
2018-03-06 15:29:29 +10:30
2014-05-21 17:37:23 +09:30
2016-11-14 11:28:03 +10:30
2018-03-06 15:16:56 +10:30
2015-12-14 10:31:38 +10:30
2015-12-14 10:31:38 +10:30
2018-03-06 15:16:56 +10:30
2018-03-06 15:29:29 +10:30
2014-05-26 15:36:26 +09:30
2013-11-21 16:49:44 +10:30
2018-03-06 15:29:29 +10:30
2018-03-06 15:29:29 +10:30
2018-03-06 15:29:29 +10:30
2016-10-19 09:33:01 +10:30
2018-03-06 15:16:56 +10:30
2018-03-06 15:29:29 +10:30
2018-03-06 15:29:29 +10:30
2016-10-19 09:33:01 +10:30
2018-03-06 15:29:29 +10:30
2013-12-04 02:52:31 +10:30
2018-03-06 15:29:29 +10:30
2018-03-06 15:29:29 +10:30
2018-03-06 15:29:29 +10:30
2018-03-06 15:29:29 +10:30
2018-03-29 12:20:56 +10:30
2018-03-29 12:20:56 +10:30
2018-03-06 15:29:29 +10:30
2014-05-12 13:44:50 +09:30
2018-03-06 15:29:29 +10:30
2018-03-06 15:16:56 +10:30
2015-06-29 15:39:19 +09:30
2018-03-06 15:16:56 +10:30
2018-03-06 15:16:56 +10:30
2018-03-06 15:16:56 +10:30
2018-03-06 15:16:56 +10:30
2018-03-06 15:16:56 +10:30
2018-03-09 16:56:36 +10:30
2018-03-06 15:16:56 +10:30
2018-03-06 15:16:56 +10:30
2018-03-06 15:29:29 +10:30
2018-03-06 15:29:17 +10:30
2018-03-29 15:19:54 +10:30
2018-03-06 15:16:55 +10:30
2017-04-19 14:46:36 +09:30
2017-04-19 14:46:36 +09:30
2018-03-29 15:19:54 +10:30
2018-03-06 15:29:29 +10:30
2018-03-06 15:29:29 +10:30
2018-03-06 15:16:56 +10:30
2018-03-06 15:29:29 +10:30
2011-08-10 15:39:40 +02:00
2016-10-19 09:33:01 +10:30
2016-10-19 16:27:20 +10:30
2018-03-29 15:19:54 +10:30
2018-03-29 15:19:54 +10:30
2018-03-06 15:16:56 +10:30
2018-03-06 15:16:56 +10:30
2018-03-29 15:19:54 +10:30
2018-03-06 15:29:29 +10:30
2017-05-17 10:16:46 +09:30
2018-03-06 15:29:29 +10:30
2016-10-19 09:30:18 +10:30
2016-11-21 10:34:12 +10:30
2018-03-06 15:29:29 +10:30
2016-10-19 09:33:01 +10:30
2017-08-29 13:19:35 +09:30
2018-03-06 15:29:29 +10:30
2015-11-17 00:42:06 +10:30
2016-11-09 19:03:45 +10:30
2016-10-19 16:27:20 +10:30
2018-03-29 15:19:54 +10:30
2018-03-29 15:19:54 +10:30
2016-11-21 10:34:12 +10:30
2016-10-19 09:33:01 +10:30
2018-03-06 15:16:56 +10:30
2018-03-06 15:16:56 +10:30
2018-03-06 15:29:29 +10:30
2018-03-06 15:16:56 +10:30
2018-03-06 15:16:56 +10:30
2018-03-06 15:16:56 +10:30

Serval DNA

Serval Project, September 2017

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 Linux, Mac OS-X, and similar 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.

What is in this repository?

This repository contains:

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 or via the [Swift module][] from within a Swift 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 2015 Serval Project Inc.
Copyright 2016-2017 Flinders University
CC-BY-4.0 This document is available under the Creative Commons Attribution 4.0 International licence.

Description
The Serval Project's core daemon that implements Distributed Numbering Architecture (DNA), MDP, VoMP, Rhizome, MeshMS, etc.
Readme 33 MiB
Languages
C 89.4%
Shell 5.9%
Java 2%
M4 1.1%
Assembly 0.6%
Other 0.9%