For protecting µD3TN from proprietary forks that do not give back to the open-source project, we decided to re-license the µD3TN project under the GNU Affero General Public License v3.0 (AGPLv3). To still enable proprietary projects to use µD3TN, D3TN will start to offer proprietary licenses. To ensure that all future contributions are compatible with this dual licensing scheme, all external contributions will still be accepted under the terms of the Apache 2.0 license. Signed-off-by: Felix Walter <felix.walter@d3tn.com> |
||
|---|---|---|
| components | ||
| doc | ||
| dockerfiles | ||
| external | ||
| generated/aap2 | ||
| include | ||
| mk | ||
| pyd3tn | ||
| python-ud3tn-utils | ||
| test | ||
| tools | ||
| .dockerignore | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| .gitmodules | ||
| CHANGELOG | ||
| config.mk.example | ||
| CONTRIBUTING.md | ||
| DCO.txt | ||
| flake.lock | ||
| flake.nix | ||
| LICENSE | ||
| LICENSE.Apache-2.0 | ||
| Makefile | ||
| NOTICE | ||
| README.md | ||
About
µD3TN (pronounced "Micro-Dee-Tee-En") is a free, lean, and space-tested DTN protocol implementation running on POSIX (plus Linux ;-)). Though µD3TN is easily portable to further platforms, we currently support only POSIX-compliant systems (former versions also included support for STM32/FreeRTOS platforms).
A general introduction of µD3TN is available on its project web site at https://d3tn.com/ud3tn.html and in our video series on YouTube.
µD3TN currently implements:
- Bundle Protocol version 6 (RFC 5050),
- Bundle Protocol version 7 (draft version 31),
- Several Bundle Protocol convergence layers, such as:
- MTCP (draft version 0),
- TCPCLv3 (RFC 7242),
- CCSDS Space Packet Protocol (SPP).
Pre-compiled binaries
We provide docker images at registry.gitlab.com/d3tn/ud3tn-docker-images/ud3tn. Refer to https://gitlab.com/d3tn/ud3tn-docker-images/ for more information.
Usage
A comprehensive step-by-step tutorial for Linux and POSIX systems is included in the documentation. It covers a complete scenario in which two µD3TN instances create a small two-node DTN and external applications leverage the latter to exchange data.
Start a µD3TN node
For simple setups with just a single node, µD3TN is ready to use with its default settings. For advanced use, the CLI offers at lot of flexibility:
Mandatory arguments to long options are mandatory for short options, too.
-a, --aap-host HOST IP / hostname of the application agent service
-b, --bp-version 6|7 bundle protocol version of bundles created via AAP
-c, --cla CLA_OPTIONS configure the CLA subsystem according to the
syntax documented in the man page
-e, --eid EID local endpoint identifier
-h, --help print this text and exit
-l, --lifetime SECONDS lifetime of bundles created via AAP
-m, --max-bundle-size BYTES bundle fragmentation threshold
-p, --aap-port PORT port number of the application agent service
-r, --status-reports enable status reporting
-s, --aap-socket PATH path to the UNIX domain socket of the application agent service
-S, --aap2-socket PATH path to the UNIX domain socket of the experimental AAP 2.0 service
-u, --usage print usage summary and exit
Default POSIX invocation: ud3tn \
-b 7 \
-c "tcpclv3:*,4556;tcpspp:*,4223,false,1;smtcp:*,4222,false;mtcp:*,4224" \
-e dtn://ud3tn.dtn/ \
-l 86400 \
-m 18446744073709551615 \
-s $PWD/ud3tn.socket \
-S $PWD/ud3tn.aap2.socket
The AAP interface can use either a UNIX domain socket (-s option) or bind to a TCP address (-a and -p options).
Examples for CLA_OPTIONS are documented in the man page,
which can be viewed with man --local-file doc/ud3tn.1.
Default arguments and internal settings such as storage, routing, and connection parameters can be adjusted in include/ud3tn/config.h.
Configure contacts with other µD3TN / BP nodes
µD3TN performs its bundle forwarding decisions based on contacts, which are associated with a specific bundle node. Each instance accepts bundles addressed to dtn://<ud3tn-node-name>/config or ipn:<ud3tn-node-number>.9000 (by default, only via AAP) and parses them according to the specification documented at doc/contacts_data_format.md. To sum it up, a contact can be used to configure:
- start and end time (optional),
- data rate (optional),
- reliability of the contact (optional), and
- whether the bundle node can reach other nodes during this specific contact (list of EID, optional).
Nodes themselves can be configured (added / removed) via the same syntax and interface.
This repository includes convenient python tools that can be used after preparing the python environment to configure contacts.
Leverage AAP to make applications delay and disruption tolerant
Once a µD3TN enabled DTN network has been created, applications can leverage the custom Application Agent Protocol (AAP) to interact with it. Applications typically use AAP to:
- register themselves at a µD3TN instance with a local identifier,
- inject bundles (hand over a payload and a destination EID to µD3TN, µD3TN then creates a corresponding bundle and tries to forward / deliver it), and
- listen for application data addressed to their identifier.
The protocol is defined at doc/ud3tn_aap.md. Like above, there are dedicated python scripts for various tasks. Python bindings for AAP are available under the name ud3tn-utils in the Python package manager PyPI.
µD3TN v0.13.0 also contains an experimental preview of AAP 2.0, the next generation application protocol. In the future, AAP 2.0 will support controlling bundle forwarding decisions and links to other nodes. In the current version, only basic ADU send/receive functionality is implemented, matching the feature set of AAP 1.0 (extended by more ADU metadata). Please refer to the AAP 2.0 Overview and the AAP 2.0 Protobuf Description for more details.
Develop
Build
This project uses git submodules to manage some code dependencies.
Use the --recursive option if you git clone the project or run
git submodule init && git submodule update at a later point in time.
POSIX-compliant operating systems
-
Install or unpack the build toolchain
- Install GNU
make,gccandbinutils. - For building with Clang, additionally install a recent version of
clangandllvm.
- Install GNU
-
Configure the local build toolchain in
config.mk(optional for most systems)- Copy
config.mk.exampletoconfig.mk. - Adjust
TOOLCHAINif you want to build with Clang. - Adjust
TOOLCHAIN_POSIXif your toolchain installation is not included in your$PATH
- Copy
-
Run
make run-posixto build and execute µD3TN on your local machine.- You can find the µD3TN binary file in
build/posix/ud3tn. To just build it, you can also runmake posixormake(the latter building the library files as well). - Note that on some systems, such as BSD flavors, you may need to explicitly call GNU Make using the
gmakecommand. In this case, just substitute all calls tomakein the documentation bygmake. - Some build-time options (e.g., building with sanitizers) can be easily specified as arguments to
make. Seeconfig.mk.examplefor the values you can specify. Example:make sanitize=yes
- You can find the µD3TN binary file in
Nix-based build and development (x86_64-linux)
- Install the nix package manager
- Enable flake support
- Temporary: Add
--experimental-features 'nix-command flakes'when using any nix commands - Permanent: Add
experimental-features = nix-command flakesto~/.config/nix/nix.confor/etc/nix/nix.conf
- Temporary: Add
Most common nix commands are:
-
Build & run ud3tn:
nix run '.?submodules=1' -
Build individual packages:
nix build '.?submodules=1#ud3tn' nix build '.?submodules=1#pyd3tn' nix build '.?submodules=1#python-ud3tn-utils' -
Load a development environment with all packages and dependencies:
nix develop '.?submodules=1'After the development environment has been activated, all development dependencies are fulfilled in order to be able to execute all other described debug and build commands.
Library
Beside the µD3TN daemon binary, two types of library can be built using make posix-lib or make:
build/posix/libud3tn.so: a dynamic library (shared object) containing all but the daemon functions.build/posix/libud3tn.a: a thin static library providing the same functionality. This only references thecomponent.afiles in thebuilddirectory and is intended to statically link µD3TN into other projects. The preferred way to do this is to include µD3TN as part of your project's source tree (e.g. usinggit subtreeorgit submodule).
Test
The µD3TN development is accompanied by extensive testing. For this purpose, you should install gdb and a recent version of Python 3 (>= 3.8), plus the, venv, pip, and setuptools packages for your Python version. Our test suite covering static analysis, unit, and integration tests is documented in doc/testing.md.
Contribute
Contributions in any form (e.g., bug reports, feature, or merge requests) are very welcome! Please have a look at CONTRIBUTING.md first for a smooth experience. The project structure is organized as follows:
.
├── components C source code
├── include C header files
├── external 3rd party source code
├── generated generated source code (e.g. for Protobuf)
├── test various test routines
├── doc documentation
├── mk make scripts
├── dockerfiles Templates for creating Docker images
├── python-ud3tn-utils Python bindings for AAP
├── pyd3tn Python implementation of several DTN protocols
└── tools various utility scripts
The entry point is implemented in components/daemon/main.c.
License
This work is licensed as a whole under the GNU Affero General Public License v3.0, with some parts and components being licensed under the BSD 3-Clause, Apache 2.0, MIT, zLib, and GPL v2.0 licenses.
All code files, except those under the external/ directory tree, contain an SPDX license identifier at the top, to indicate the license that applies to the specific file.
The external libraries shipped with µD3TN and contained in external/ are subject to their own licenses, documented in LICENSE-3RD-PARTY.txt.
SPDX-License-Identifier: AGPL-3.0-or-later
Ecosystem
ud3tn-utilsis a Python package that provides bindings for µD3TN's Application Agent Protocol.aap.luais a Wireshark dissector for µD3TN's Application Agent Protocol. It can be installed by copying it into one of the Lua script folders listed in the Wireshark GUI atHelp > About Wireshark > Folders.pyD3TNis a Python package that provides implementations of several DTN related RFCs.aiodtnsimis a minimal framework for performing DTN simulations based on Python 3.7 and asyncio.dtn-tvg-utilis a Python package simplifying the analysis and simulation of DTNs based on time-varying network graphs.