dtn7-go

module
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: May 20, 2022 License: GPL-3.0

README

dtn7-go

Release PkgGoDev CI REUSE status

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

Protocols

This software implements the current draft of the Bundle Protocol Version 7.

Convergence Layer

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

At this point, mtcp is probably your best bet for reliable data transfer.

Routing

We have implemented the following routing algorithms:

  • Epidemic Routing
  • Spray and Wait, vanilla and binary
  • Delay-Tolerant Link State Routing (DTLSR)
  • Probabilistic Routing Protocol using History of Encounters and Transitivity (PRoPHET)
  • Sensor Network-specific routing algorithm for Data Mules, documentation

Software

Installation
Package Manager
From Source

Install the Go programming language, version 1.16 or later.

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

go build ./cmd/dtn-tool
go build ./cmd/dtnd
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.

REST API / WebSocket API

We provide different interfaces to allow communication from external programs with dtnd. More precisely: a REST API and a WebSocket API.

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

If you need bidirectional communication, you can use the WebSocket API. This API sends CBOR-encoded messages. For details, see the ws_agent-files of the agent package. But one can also simply use it with the github.com/dtn7/dtn7-go/agent.WebSocketAgentConnector, which implements a client.

dtn-tool

dtn-tool is a swiss army knife for bundles and uses the WebSockets API.

It allows the simple creation of new bundles, written to a file or the stdout. Furthermore, one can print out bundles as a human/machine-readable JSON object. To exchange bundles, dtn-tool may watch a directory and send all new bundle files to the corresponding dtnd instance. In the same way, incoming bundles from dtnd are stored in this directory.

Usage of ./dtn-tool create|exchange|ping|show:

./dtn-tool create sender receiver -|filename [-|filename]
  Creates a new Bundle, addressed from sender to receiver with the stdin (-)
  or the given file (filename) as payload. If no further specified, the
  Bundle is stored locally named after the hex representation of its ID.
  Otherwise, the Bundle can be written to the stdout (-) or saved
  according to a freely selectable filename.

./dtn-tool exchange websocket endpoint-id directory
  ./dtn-tool registeres itself as an agent on the given websocket and writes
  incoming Bundles in the directory. If the user dropps a new Bundle in the
  directory, it will be sent to the server.

./dtn-tool ping websocket sender receiver
  Send continuously bundles from sender to receiver over a websocket.

./dtn-tool show -|filename
  Prints a JSON version of a Bundle, read from stdin (-) or filename.

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. If you are interested in working with this code, check out the documentation.

Contributing

We warmly welcome any contribution.

Please format your code using Gofmt. Further inspection of the code via golangci-lint is highly recommended, our CI-pipeline includes a golangci-lint-action.

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.

Please document your changes in your commit messages and the CHANGELOG.md file.

Also, we attempt to be REUSE compliant. You can use the contrib/reuse/reuse-headers.py-script for automatic copyright header generation.

OS-specific
macOS

Installing the Go programming language via brew, 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). We use the REUSE-tool to simplify the copyright stuff.

Directories

Path Synopsis
cmd
pkg
agent
Package agent describes an interface for modules to receive and send bundles.
Package agent describes an interface for modules to receive and send bundles.
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/bbc
Package bbc describes a simple Bundle Broadcasting Connector to receive and transmit Bundles over a shared broadcasting medium, e.g., LoRa.
Package bbc describes a simple Bundle Broadcasting Connector to receive and transmit Bundles over a shared broadcasting medium, e.g., LoRa.
cla/mtcp
Package mtcp provides a library for the Minimal TCP Convergence-Layer Protocol as defined in draft-ietf-dtn-mtcpcl-01 Because of the unidirectional design of MTCP, both MTPCServer and MTCPClient exists.
Package mtcp provides a library for the Minimal TCP Convergence-Layer Protocol as defined in draft-ietf-dtn-mtcpcl-01 Because of the unidirectional design of MTCP, both MTPCServer and MTCPClient exists.
cla/tcpclv4
Package tcpclv4 provides a library for the Delay-Tolerant Networking TCP Convergence Layer Protocol Version 4, draft-ietf-dtn-tcpclv4-23.
Package tcpclv4 provides a library for the Delay-Tolerant Networking TCP Convergence Layer Protocol Version 4, draft-ietf-dtn-tcpclv4-23.
cla/tcpclv4/internal/msgs
Package msgs defines internal messages for the Delay-Tolerant Networking TCP Convergence Layer Protocol Version 4.
Package msgs defines internal messages for the Delay-Tolerant Networking TCP Convergence Layer Protocol Version 4.
cla/tcpclv4/internal/stages
Package stages contains internal stages of a TCPCLv4 session.
Package stages contains internal stages of a TCPCLv4 session.
cla/tcpclv4/internal/utils
Package utils provides encapsulated elements of a TCPCLv4 session.
Package utils provides encapsulated elements of a TCPCLv4 session.
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.
routing
Package routing represents a bundle node's router and contains both the bundle protocol agent and application agent.
Package routing represents a bundle node's router and contains both the bundle protocol agent and application agent.
storage
Package storage provides a Bundle Storage based on BadgerHold, a frontend for the badger NoSQL store.
Package storage provides a Bundle Storage based on BadgerHold, a frontend for the badger NoSQL store.

Jump to

Keyboard shortcuts

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