dtn7-go

module
v0.10.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2026 License: GPL-3.0

README

dtn7-go

PkgGoDev

Delay-Tolerant Networking software suite and library based on the Bundle Protocol Version 7 (RFC 9171).

Convergence Layer

A convergence layer in bundle protocol parlance is the abstraction for peer-to-peer communication. We have implemented the following protocols:

  • Minimal TCP Convergence-Layer Protocol (mtcp) (draft-ietf-dtn-mtcpcl-01) (RFC draft expired)
  • QUIC Convergence Layer (QUICL) (Custom, not (yet) standardised)

Software

Installation

Install the Go programming language, version 1.24 or later.

git clone https://github.com/dtn7/dtn7-go.git
cd dtn7-go

go build ./cmd/dtnd
go build ./cmd/dtnclient
dtnd

dtnd is a delay-tolerant networking daemon. It acts as a node in the network and can transmit, receive and forward bundles to other nodes. A node's neighbours may be specified in the configuration or detected within the local network through a peer discovery. Bundles might be sent and received through a REST-like web interface. The features and configuration are described inside the provided example configuration.toml.

Application Agents

We provide different interfaces to allow communication from external programs with dtnd. A REST API and an API based on UNIX domain sockets.

The REST API allows a client to register itself with an address, receive bundles and create/dispatch new ones simply by POSTing JSON objects to dtnd's RESTful HTTP server. The endpoints and structure of the JSON objects are described in the documentation for the github.com/dtn7/dtn7-go/agent.RestAgent type.

The UNIX API is meant to be somewhat simpler and faster than the HTTP-based alternatives. The message formats are described in pkg/application_agent/unix_agent/messages.go type. Messages are to be marshaled using the msgpack format. The communication protocol is very simple - first send the length of the message (encoded as a uint64, big endian), and then send the message.

dtnclient

dtnclient is a cli for interacting with dtnd via the UNIX application agent. For usage see dtnclient -h.

Go Library

Most components of this software are usable as a Go library. Those libraries are available within the pkg-directory.

For example, the bpv7-package contains code for bundle modification, serialization and deserialization and would most likely be the most interesting part.

Contributing

We warmly welcome any contribution.

Please format your code using Gofmt. Further inspection of the code via golangci-lint is highly recommended.

As a development environment, you may, of course, use whatever you personally like best. However, we have had a good experience with GoLand, especially because of the size of the project.

Assuming you have a supported version of the Go programming language installed, just clone the repository and install the dependencies as documented in the Installation, From Source section above.

OS-specific
macOS

Installing Go via homebrew, should solve permission errors while trying to fetch the dependencies.

License

This project's code is licensed under the GNU General Public License version 3 (GPL-3.0-or-later).

Acknowledging this work

If you use this software in a scientific publication, please cite the following papers:

@inproceedings{penning2019dtn,
	title        = {DTN7: An Open-Source Disruption-Tolerant Networking Implementation of Bundle Protocol 7},
	author       = {Penning, Alvar and Baumgärtner, Lars and Höchst, Jonas and Sterz, Artur and Mezini, Mira and Freisleben, Bernd},
	year         = 2019,
	booktitle    = {Ad-Hoc, Mobile, and Wireless Networks},
	publisher    = {Springer International Publishing},
	address      = {Cham},
	pages        = {196--209},
	isbn         = {978-3-030-31831-4},
	editor       = {Palattella, Maria Rita and Scanzio, Stefano and Coleri Ergen, Sinem},
}
@article{sommer2025quicl,
	title        = {QUICL: Disruption-tolerant networking via a QUIC convergence layer},
	author       = {Markus Sommer and Artur Sterz and Markus Vogelbacher and Hicham Bellafkir and Bernd Freisleben},
	year         = 2025,
	journal      = {Computer Communications},
	volume       = 241,
	pages        = 108247,
	doi          = {https://doi.org/10.1016/j.comcom.2025.108247},
	issn         = {0140-3664},
	url          = {https://www.sciencedirect.com/science/article/pii/S014036642500204X},
	keywords     = {Disruption-tolerant networks, QUIC, Go},
}

Directories

Path Synopsis
cmd
dtnclient command
dtnd command
pkg
application_agent
Package application_agent contains all application agents as well as the agent Manager.
Package application_agent contains all application agents as well as the agent Manager.
application_agent/rest_agent
Package rest_agent provides a RESTful Application Agent for simple bundle dispatching.
Package rest_agent provides a RESTful Application Agent for simple bundle dispatching.
application_agent/unix_agent
Package unix_agent provides an ApplicationAgent which communicates via a UNIX socket.
Package unix_agent provides an ApplicationAgent which communicates via a UNIX socket.
bpv7
Package bpv7 provides a library for interaction with Bundles as defined in the Bundle Protocol Version 7 (draft-ietf-dtn-bpbis-31.txt).
Package bpv7 provides a library for interaction with Bundles as defined in the Bundle Protocol Version 7 (draft-ietf-dtn-bpbis-31.txt).
cla
Package cla defines two interfaces for Convergence Layer Adapters.
Package cla defines two interfaces for Convergence Layer Adapters.
cla/dummy_cla
Package dummy_cla provides a simple implementation of the CLA interface used for testing.
Package dummy_cla provides a simple implementation of the CLA interface used for testing.
cla/mtcp
Package mtcp provides a library for the Minimal TCP Convergence-Layer Protocol as defined in draft-ietf-dtn-mtcpcl-01
Package mtcp provides a library for the Minimal TCP Convergence-Layer Protocol as defined in draft-ietf-dtn-mtcpcl-01
cla/quicl
Package quicl implements an experimental QUIC convergence layer.
Package quicl implements an experimental QUIC convergence layer.
discovery
Package discovery contains code for peer/neighbor discovery of other DTN nodes through UDP multicast packages.
Package discovery contains code for peer/neighbor discovery of other DTN nodes through UDP multicast packages.
id_keeper
Package id_keeper provides the IdKeeper.
Package id_keeper provides the IdKeeper.
processing
Package processing implements the "Bundle Processing" steps from bpv7 See: https://www.rfc-editor.org/rfc/rfc9171.html#name-bundle-processing
Package processing implements the "Bundle Processing" steps from bpv7 See: https://www.rfc-editor.org/rfc/rfc9171.html#name-bundle-processing
routing
Package routing provides and interface & implementations for routing algorithms.
Package routing provides and interface & implementations for routing algorithms.
store
Package store implements on-disk persistence for bundles and their metadata Uses Badgerhold (github.com/timshannon/badgerhold) for persisting metadata.
Package store implements on-disk persistence for bundles and their metadata Uses Badgerhold (github.com/timshannon/badgerhold) for persisting metadata.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL