Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

Documentation #33

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/dtnd/configuration.toml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ endpoint = ":4556"

# Specify routing algorithm
[routing]
# One of "epidemic", "spray", "binary_sparay", "dtlsr", "prophet", "sensor-mule"
# One of ["epidemic", "spray", "binary_spray", "dtlsr", "prophet", "sensor-mule"]
algorithm = "epidemic"


Expand Down
17 changes: 17 additions & 0 deletions docs/agents.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!--
SPDX-FileCopyrightText: 2021 Markus Sommer

SPDX-License-Identifier: GPL-3.0-or-later
-->

# Application Agents

## Web Server

### REST-interface

Specify the endpoints

### WebSockets-interface

Same here
75 changes: 75 additions & 0 deletions docs/config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<!--
SPDX-FileCopyrightText: 2021 Markus Sommer

SPDX-License-Identifier: GPL-3.0-or-later
-->

# Daemon Configuration

Here, we'll go over the [sample config-file](https://github.com/dtn7/dtn7-go/blob/master/cmd/dtnd/configuration.toml) and explain the available options in-depth.

## [core]

### store

Path to the on-disk store used to persist bundles, may be either a relative or absolute path.

The store consist of a [badgerhold](https://github.com/timshannon/badgerhold) database for metadata, the bundle contents are written directly to disk.

### inspect-all-bundles

Inspect the Administrative Records from all Bundles, not only those addressed to this very node.
By doing so, this node can learn about a delivery and clear its store without being told directly.

### node-id

Public name of the node.
Will be set as the default endpoint ID for all CLAs, unless a different one has been specified.

According to the [standard](https://tools.ietf.org/html/draft-ietf-dtn-bpbis-31#section-4.2.5.1.1), your ID should be:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Node ID must be an unique identifier, as specified in section 4.2.5.2. Thus, it cannot be the null endpoint or a multicast address.


- `dtn:none`, if you are actually nothing
- `dtn://` + the actual name + `/` <- for a unicast enpoint
- `dtn://~` + the name of your multicast group + `/` <- for something that is not a unicast enpoint (it does not neccessarily have to be a multicast group, but that's the only use case I can think off the top of my head)

You might also use the [other](https://tools.ietf.org/html/draft-ietf-dtn-bpbis-31#section-4.2.5.1.2) adressing scheme, but we can't guarantee that such behaviour won't lead to death and/or dismemberment.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even if I also dislike the ipn URI scheme, it should be properly implemented and should work as well. Thus, no need for such harsh words.


## [logging]

## [discovery]

## [agents]

## [[listen]]

## [[peer]]

## [routing]

Select the routing algorithm, you can choose on from the list `["epidemic", "spray", "binary_spray", "dtlsr", "prophet", "sensor-mule"]`

### epidemic

*Epidemic Routing* is the simplest delay-tolerant routing algorithm.
All bundles are always sent to all peers, which gives the best delivery probability, but also the highest overhead.
Note that `dtnd` keeps track of peers who have already been sent a specific bundle, so each bundle should only be forwarded to each peer once.

### spray

The *Spray & Wait* routing algorithm.

### binary_spray

The *Binary Spray & Wait* routing algorithm.

### dtlsr

The *Delay-Tolerant Link-State Routing* algorithm.

### prophet

The *PRoPHET* routing algorithm.

### sensor-mule

For dtn over equine carriers.
7 changes: 7 additions & 0 deletions docs/dtn-tool.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!--
SPDX-FileCopyrightText: 2021 Markus Sommer

SPDX-License-Identifier: GPL-3.0-or-later
-->

# Use the `dtn-tool` or die trying
18 changes: 18 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!--
SPDX-FileCopyrightText: 2021 Markus Sommer

SPDX-License-Identifier: GPL-3.0-or-later
-->

# dtn7-go Documentation

Here be dragons.

## Contents

| Topic | Description |
|:--------------------------------|:------------------------------------------------------------------------|
| [Installation](install.md) | Instructions for manual & automatic installations |
| [Configuration](config.md) | Explanation of the `dtnd` configuration options |
| [Application Agents](agents.md) | APIs of the provided *Application Agents* |
| [dtn-tool](dtn-tool.md) | How to use use the dtn tool, because it's not really all that intuitive |
72 changes: 72 additions & 0 deletions docs/install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<!--
SPDX-FileCopyrightText: 2021 Markus Sommer
SPDX-FileCopyrightText: 2021 Alvar Penning

SPDX-License-Identifier: GPL-3.0-or-later
-->

# Installation Instructions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about providing a dockerized / Kubernetes option? I'd be interested in working on that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mogren: I would be very happy about a short documentation and a possible example of use. Thanks a lot for your help.

By the way, there are already two Dockerfiles for dnt7-go. One from @jonashoechst exists for CORE in the tutorial branch. Another one is in the dtn7-playground repository. Thus, there should already be some inspiration for the Docker part.


## Manual

- Install the *Go Programming language*, either through your package manager, or from [here](https://golang.org/dl/).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps add a note to always use the latest release or at least one greater than 1.13.

- Clone the [source repository](https://github.com/dtn7/dtn7-go).
- Check out the most recent release tag. Or don't and just build the `HEAD`, but we don't promise that it won't be broken.
- (Optional) Run `go test ./...` in the repository root to make sure we didn't screw up too badly.
- Run `go build ./cmd/dtnd && go build ./cmd/dtn-tool` in the repositry root to build both `dtnd` and `dtn-tool`

If you want to run `dtnd` as a service, you might also want to do the following:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The following section is very targeted to a specific setup; a generic GNU/Linux with systemd. Thus, this might be moved to the "Other Linux" section. You might wanna also add a reference from, e.g., Arch Linux to this section.


- Put the config-file (`cmd/dtnd/configuration.toml`) in `/etc/dtn7`
- Put the systemd-service (`contrib/systemd/service/dtn7.service`) in `/etc/systemd/system`
- Probably run `systemctl daemon-reload` for good measure
- Create the working directory `/var/lib/dtn7`
- Create a `dtn7` user like this: `useradd -r -s /sbin/nologin -d /var/lib/dtn7 dtn7`
- Set ownership of the working directory `chown dtn7:dtn7 /var/lib/dtn7`
- Start the service: `systemctl start dtn7`

If you install the arch-package, we do all of that for you.

## Automatic

For some select platforms, packages are provided. (Footnote: ''select'' in this case means those platforms that don't make it
prohibitively complicated to package for them - looking at you, Debian)

### Nix / NixOS

Nix is a purely functional package manager for Linux or macOS.
NixOS is a Linux distribution based on Nix.

There is a [dtn7 Nix User Repository (NUR)](https://github.com/dtn7/nur-packages) which contains two versions of dtn7-go.

- The `dtn7-go` package for the latest release,
- and the `dtn7-go-unstbale` package which is always the latest `master` branch's `HEAD`.

Both packages are automatically bumped after changes in the dtn7-go repository.

You can import and install one of those dtn7 packages as described in the [dtn7 NUR's README](https://github.com/dtn7/nur-packages).
Alternatively, all [NURs](https://github.com/nix-community/NUR) can be included and a dtn7-go version installed from those.

### Arch Linux

Install it from the [AUR](https://aur.archlinux.org/packages/dtn7) either manually, or using your favourite aur-helper.

The package also installs the config file & systemd-service.
Also takes care of directory & user creation.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be nitpicking, but can you please replace & with and in the two previous lines.


Start daemon using `systemctl start dtn7`

### Other Linux

We would like to provide packages for all distributions, however we're not really sure how.
Attempts at using the *Open SUSE Build Service* were unsuccessful, since the build VMs don't have internet access and therefore can't get the dependencies from `go.mod`.

If you know how to (automatically) build and package go applications for other distributions or package managers, please contact us.

### macOS

We provide a package for macOS through [Homebrew](https://brew.sh). To install from the [provided package](https://github.com/dtn7/homebrew-dtn7):
```
$ brew install dtn7/dtn7/dtn7-gp
```
A configuration file (`/usr/local/etc/dtn7-go/configuration.toml`) will be created, as well as a brew services / launchd compatible service file will be created. dtn7-d's store, as well as the runtime logs will appear in `/usr/local/var/dtn7-go/`.