MCPcopy Index your code
hub / github.com/dtn7/dtn7-rs

github.com/dtn7/dtn7-rs @v0.21.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.21.0 ↗ · + Follow
632 symbols 1,526 edges 78 files 111 documented · 18% updated 42d agov0.21.0 · 2024-03-27★ 1102 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

dtn7-rs

Crates.io Docs.rs Build status License: MIT License: Apache 2.0 Chat Mastodon

Rust implementation of a disruption-tolerant networking (DTN) daemon for the Bundle Protocol version 7 - RFC9171.

Plus: * TCP Convergence Layer v4 - RFC9174 * Minimal TCP Convergence Layer * A simple HTTP Convergence Layer * A HTTP pull-based Convergence Layer * A minimal UDP Convergence Layer (currently, without the extensions) * An IP neighborhood discovery service * Convenient command line tools to interact with the daemon * A simple web interface for status information about dtnd * A web-socket interface for application agents * Interfaces for external processes to provide routing strategies and convergence layers

The actual BP7 implementation (encoding/decoding) is available as a separate project.

Additional dtn extensions and a client library are also available.

Currently, a service discovery based on IPND but adapted to CBOR and BPv7, TCP, MTCP & HTTP CLs, sprayandwait/flooding/epidemic/static/sink-routing and restful/websocket command interfaces are implemented. Both addressing schemes, dtn as well as ipn are supported. Furthermore, some CLI tools are provided to easily integrate dtn7 into shell scripts.

Beware: This code is still under development and thus might change frequently.

Installation

Installation from source using cargo:

cargo install --bins --examples dtn7

In case of compilation issues, try adding --locked to the command. This will use the exact versions of all dependencies as used in our repository.

Precompiled binaries for common platforms can be found on GitHub.

Usage

In the following some of the commands shipped with dtn7 are listed. There is also a more in-depth getting started guide available.

Daemon

The main Bundle Protocol Agent dtnd can be configured either through the CLI (dtnd --help) or by providing a configuration file. Command line options override configuration file settings if both are mixed. The daemon does not fork into background but can be easily started as a background service by invoking it with the nohup command and &.

Example usage for node1 with epidemic routing, mtcp convergence layer and the default endpoint 'incoming':

$ dtnd -n node1 -r epidemic -C mtcp -e incoming

The same but with ipn addressing scheme and a default endpoint at 23.42:

$ dtnd -n 23 -r epidemic -C mtcp -e 42

Configuration can also happen via a config file. For an example take a look at examples/dtn7.toml.example.

Helpers

  • dtnquery: Querying information from dtnd such as peers, bundles, nodeid, etc.
  • dtnrecv: A simple tool to check for new bundles on a specific endpoint, can be used for scripting.
  • dtnsend: A simple tool to send a bundle from a provided file or pipe, can be used for scripting.
  • dtntrigger: Automatic triggering of external binaries for incoming bundles, useful for advanced scripting.

Example Applications

A simple DTN echo service can be found under examples/dtnecho2.rs.

This service automatically registers its endpoint and listens for any incoming bundles on the local /echo endpoint or for ipn addresses on service number 7. Each bundle is sent back to its source with the same payload and lifetime, no delivery report is requested.

This service can be used together with examples/dtnping.rs for connectivity tests.

Example Use-Cases

Under tests/ are several shell scripts for integration tests that also showcase how to use the different command line utilities. Furthermore, under tests/clab are more complex and dynamic tests that get executed in Docker and coreemu. For pure docker compose scenarios you can take a look under tests/docker.

More complex scenarios can be found in the dtn7 showroom.

Acknowledging this work

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

@INPROCEEDINGS{baumgaertner2019bdtn7,
  author={L. {Baumgärtner} and J. {Höchst} and T. {Meuser}},
  booktitle={2019 International Conference on Information and Communication Technologies for Disaster Management (ICT-DM)},
  title={B-DTN7: Browser-based Disruption-tolerant Networking via Bundle Protocol 7},
  year={2019},
  volume={},
  number={},
  pages={1-8},
  keywords={Protocols;Browsers;Software;Convergence;Servers;Synchronization;Wireless fidelity},
  doi={10.1109/ICT-DM47966.2019.9032944},
  ISSN={2469-8822},
  month={Dec},
}

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in dtn7-rs by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Extension points exported contracts — how you extend this code

ConvergenceLayerAgent (Interface)
(no doc) [7 implementers]
core/dtn7/src/cla/mod.rs
HelpStr (Interface)
(no doc) [7 implementers]
core/dtn7/src/cla/mod.rs
RoutingAgent (Interface)
(no doc) [6 implementers]
core/dtn7/src/routing/mod.rs
Connector (Interface)
Trait to implement transport connector (e.g. WebSocket, TCP, ...) over which ecla modules can connect to. [2 implementers]
core/dtn7/src/cla/ecla/mod.rs
BundleStore (Interface)
(no doc) [3 implementers]
core/dtn7/src/core/store/mod.rs

Core symbols most depended-on inside this repo

new
called by 164
core/dtn7/src/routing/mod.rs
send
called by 77
core/dtn7/src/cla/tcp/mod.rs
id
called by 49
core/dtn7/src/core/bundlepack.rs
push
called by 44
core/dtn7/src/core/store/mem.rs
new
called by 39
core/dtn7/src/cla/ecla/ws_client.rs
contains
called by 39
core/dtn7/src/routing/epidemic.rs
new
called by 27
core/dtn7/src/core/store/mod.rs
is_empty
called by 26
core/dtn7/src/ipnd/services.rs

Shape

Method 263
Function 239
Class 88
Enum 32
Interface 6
Struct 4

Languages

Rust95%
Python4%
Go2%

Modules by API surface

core/dtn7/src/dtnd/httpd.rs40 symbols
core/dtn7/src/cla/tcp/mod.rs36 symbols
core/dtn7/src/lib.rs33 symbols
core/dtn7/src/cla/mtcp.rs23 symbols
core/dtn7/src/ipnd/beacon.rs20 symbols
core/dtn7/src/ipnd/services.rs19 symbols
core/dtn7/src/core/processing.rs19 symbols
core/dtn7/src/core/store/sneakers.rs17 symbols
core/dtn7/tests/beacon-test.rs16 symbols
core/dtn7/src/routing/erouting/mod.rs16 symbols
core/dtn7/src/core/peer.rs15 symbols
core/dtn7/src/core/mod.rs15 symbols

For agents

$ claude mcp add dtn7-rs \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page