Skip to content

ricktaylor/hardy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2,495 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hardy

A performant, compliant, and extensible BPv7 DTN solution for the Cloud.

Build Security audit License Rust

Overview

Hardy is a modular implementation of the Bundle Protocol Version 7 (BPv7) as defined in RFC 9171, designed for Delay-Tolerant Networking (DTN) applications. Written in reliable, accessible, asynchronous Rust, many components are rigorously tested using fuzzing to ensure robustness and security.

Table of Contents

Features

  • Full RFC 9171 BPv7 bundle protocol support
  • BPSec (RFC 9172/9173) for bundle security with HMAC-SHA and AES-GCM
  • RFC 9174 TCPCLv4 convergence layer with TLS
  • Pluggable storage backends (local filesystem, SQLite, PostgreSQL, S3)
  • Time-Variant Routing with recurring schedule support
  • Configurable ingress/egress filter pipeline
  • gRPC API for application and CLA integration
  • OpenTelemetry integration for observability (traces, metrics, logs)
  • Interoperability verified against 7 independent BPv7 implementations
  • no_std compatible core libraries for embedded use

Components

Core Libraries

Crate Description
hardy-cbor RFC 8949 compliant Canonical CBOR encoder/decoder with streaming API. no_std compatible.
hardy-bpv7 RFC 9171 BPv7 implementation with bundle creation, parsing, and manipulation. Includes BPSec support for integrity (BIB) and confidentiality (BCB) blocks. no_std compatible.
hardy-bpa Complete Bundle Processing Agent library implementing DTN routing, dispatching, filter pipeline, RIB management, and CLA/service interfaces.
hardy-eid-patterns EID pattern parsing and matching for IPN and DTN URI schemes with glob support.
hardy-async Runtime-agnostic async primitives including TaskPool, sync wrappers (Mutex, RwLock, Once), and cancellation tokens.
hardy-proto Protobuf v3 and gRPC API definitions for BPA-to-application and BPA-to-CLA communication.
hardy-otel OpenTelemetry integration for distributed tracing, metrics, and structured logging.

Storage Engines

Crate Description
hardy-sqlite-storage SQLite-based metadata storage engine with automatic schema migration.
hardy-postgres-storage PostgreSQL-based metadata storage engine.
hardy-localdisk-storage Filesystem-based bundle storage with configurable fsync and recovery support.
hardy-s3-storage S3-compatible object storage for bundle data, supporting AWS S3 and MinIO.

Convergence Layer Adapters

Crate Description
hardy-tcpclv4 RFC 9174 TCPCLv4 implementation with TLS support, session management, and structured logging.
hardy-file-cla File-system-based CLA for bundle exchange via watched directories.
hardy-bibe Bundle-in-Bundle Encapsulation (BIBE) for tunneling bundles through intermediate networks.

Services & Filters

Crate Description
hardy-echo-service Echo service for testing and diagnostics - reflects bundles back to sender.
hardy-ipn-legacy-filter Egress filter for legacy 2-element IPN EID encoding compatibility.

Servers & Tools

Crate Description
hardy-bpa-server Modular BPv7 Bundle Processing Agent server with gRPC API, multiple storage backends, configurable filters, and static routing.
hardy-tcpclv4-server Standalone TCPCLv4 listener and session handler.
hardy-bpv7-tools CLI (bundle) for bundle operations: create, inspect, validate, sign, encrypt, and more.
hardy-cbor-tools CLI (cbor) for CBOR inspection and conversion between binary, CDN, and JSON formats.
hardy-tvr Time-Variant Routing agent — installs and withdraws routes based on contact schedules (cron, file, gRPC).
hardy-tools General DTN utilities including the bp command for ping and bundle operations.

Getting Started

Prerequisites

  • Rust 2024 edition (1.87+)
  • Cargo

Building

# Build all packages
cargo build --release

# Build the BPA server with all features
cargo build --release -p hardy-bpa-server --all-features

# Run tests
cargo test --workspace

Running the BPA Server

From source:

./target/release/hardy-bpa-server -c bpa-server/config.yaml

Via Docker Compose (with PostgreSQL + MinIO):

docker compose up --build -d

For a lightweight setup with in-memory storage (no PostgreSQL/MinIO):

docker compose --profile debug up --build hardy-debug

The server listens on gRPC (50051) and TCPCLv4 (4556). Configuration is in bpa-server/config.yaml; edit it to change node settings. See the bpa-server README for all options.

To send a test ping to the echo service:

bp ping ipn:1.7 127.0.0.1:4556

CLI Tools

Three command-line tools are available, also bundled in the ghcr.io/ricktaylor/hardy/hardy-tools:latest Docker image:

Tool Package Description
bp hardy-tools Network diagnostics — bp ping measures RTT, packet loss, and path visibility.
bundle hardy-bpv7-tools Bundle operations — create, inspect, validate, sign, encrypt, and more.
cbor hardy-cbor-tools CBOR inspection and conversion between binary, CDN, and JSON.

From source:

# Ping a remote node
bp ping ipn:2.7 192.168.1.1:4556

# Inspect a bundle
bundle inspect bundle.cbor

# Create, sign, and inspect a bundle
echo "Hello DTN" | bundle create -s ipn:1.0 -d ipn:2.0 - \
  | bundle sign -k key.jwk - \
  | bundle inspect -

# Inspect CBOR data
cbor inspect data.cbor

Via Docker:

docker run --rm --network host ghcr.io/ricktaylor/hardy/hardy-tools:latest \
  bp ping ipn:2.7 192.168.1.1:4556

See the bp-ping man page, bpv7-tools README, and cbor-tools README for full documentation.

Interoperability

Hardy is tested for bidirectional bundle exchange against multiple BPv7 implementations:

Implementation CLA Source
Hardy (self-test) TCPCLv4 -
dtn7-rs TCPCLv4 GitHub
NASA HDTN TCPCLv4 GitHub
NASA DTNME TCPCLv4 GitHub
JPL ION STCP GitHub
ud3tn MTCP GitLab
ESA BP STCP ESA ESSR
NASA cFS BPNode STCP GitHub

Each test verifies ping/echo in both directions. A benchmark script compares RTT across all implementations.

# Run all interop tests with RTT comparison
./tests/interop/run_all.sh

# Run a single implementation test
./tests/interop/HDTN/test_hdtn_ping.sh

See tests/interop/README.md for details.

Documentation

Document Description
User Guide Getting started, configuration reference, and deployment guide.
Architecture Overview High-level system architecture and design principles.
Requirements High-level and low-level requirements with RFC traceability.
Test Strategy Overall testing approach including unit, integration, and fuzz testing.
Test Coverage Project-wide test plan inventory and coverage metrics.
Requirements Coverage Requirements traceability matrix and LLR verification status.
Interop Tests Interoperability test suite for 7 BPv7 implementations.

Contributing

We welcome contributions to the Hardy project! If you would like to contribute, please follow these guidelines:

  1. Fork the repository and create a new branch for your contribution.
  2. Make your changes and ensure the code follows the coding style guide and passes the CI checks (cargo fmt --check and cargo clippy --all-targets --all-features -- -D warnings).
  3. Write tests to cover your changes and ensure that all existing tests pass.
  4. Submit a pull request with a clear description of your changes and the problem they solve.

Before contributing, please familiarize yourself with the coding style guide and the project's Test Strategy to understand our conventions and approach to quality. AGENTS.md summarises the build, test, and style essentials in one place — it is also the file that AI coding assistants load.

By contributing to Hardy, you agree to license your contributions under the project's license.

License

Hardy is licensed under the Apache 2.0 License.

About

BPv7 DTN server implementation

Resources

License

Security policy

Stars

20 stars

Watchers

2 watching

Forks

Packages

 
 
 

Contributors