dtn7-go

module
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2020 License: GPL-3.0

README

dtn7-go Build Status GoDoc

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

Bundles might be exchanged between nodes by the following protocols.

Routing

One of the following routing protocols might be used.

  • Delay-Tolerant Link State Routing (DTLSR)
  • Epidemic Routing
  • Probabilistic Routing Protocol using History of Encounters and Transitivity (PRoPHET)
  • Spray and Wait, vanilla and binary

Software

Installation
Package Manager
From Source

Install the Go programming language, version 1.11 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 represents a node inside the network and is able to transmit, receive and forward bundles to other nodes. A node's neighbors 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 their configuration is described inside the provided example configuration.toml.

REST API / WebSocket API

Different interfaces are provided 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. This is made 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.

However, a bidirectional communication is possible via the WebSocket API. This API sends CBOR-encoded messages. The details can be found in 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

A ready-to-use program that utilizes the WebSocket API mentioned above is dtn-tool, a swiss army knife for bundles.

It allows the simple creation of new bundles, written to a file or the stdout. Furthermore, one can print out bundles as a human / script readable JSON object. To exchange bundles, dtn-tool might 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|show|exchange:

./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 show -|filename
  Prints a JSON version of a Bundle, read from stdin (-) or 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.

Go Library

Multiple parts of this software are usable as a Go library. The bundle package contains code for bundle modification, serialization and deserialization and would most likely the most interesting part. If you are interested in working with this code, check out the documentation.

Directories

Path Synopsis
Package agent describes an interface for modules to receive and send bundles.
Package agent describes an interface for modules to receive and send bundles.
Package bundle provides a library for interaction with Bundles as defined in the Bundle Protocol Version 7 (draft-ietf-dtn-bpbis-24.txt).
Package bundle provides a library for interaction with Bundles as defined in the Bundle Protocol Version 7 (draft-ietf-dtn-bpbis-24.txt).
arecord
Package arecord includes an abstration for administrative records, as defined in the Bundle Protocol.
Package arecord includes an abstration for administrative records, as defined in the Bundle Protocol.
cla
Package cla defines two interfaces for Convergence Layer Adapters.
Package cla defines two interfaces for Convergence Layer Adapters.
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.
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.
tcpcl
Package tcpcl provides a library for the Delay-Tolerant Networking TCP Convergence Layer Protocol Version 4, draft-ietf-dtn-tcpclv4-14.
Package tcpcl provides a library for the Delay-Tolerant Networking TCP Convergence Layer Protocol Version 4, draft-ietf-dtn-tcpclv4-14.
cmd
Package core represents a bundle node's router and contains both the bundle protocol agent and application agent.
Package core represents a bundle node's router and contains both the bundle protocol agent and application agent.
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.

Jump to

Keyboard shortcuts

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