No project description provided
Project description
dtn7zero
This is a DTN7 python implementation (work-in-progress) with NetworkZero like API.
The current features are:
- a full bundle protocol agent (without fragment or CRC support)
- a minimal TCP convergence layer
- a dtn7rs REST convergence layer
- an ipnd module
- a standalone 'external' endpoint (which connects to a dtn7rs)
- a simplified NetworkZero like API to easily get started
- full MicroPython support (tested on an ESP32-GENERIC)
- (currently uses epidemic routing and in-memory storage managing)
- (with extendability for new convergence layer adapters, routing algorithms, and storage managers)
Getting Started
To use dtn7zero in your CPython environment, simply install it via pip (or pip3 on linux):
(currently the package is only available on the test instance)
$ pip install -i https://test.pypi.org/simple/ --upgrade dtn7zero
Development Mode
You can install this project locally to directly reflect code changes in your environment. Simply run this in the project root folder (requires at least pip v21.1):
$ pip install --editable .
MicroPython Installation Guide
This whole project was tested on an ESP32 (GENERIC) and this installation guide is tailored for the ESP32. If you plan to use another microcontroller you might need to do adjustments (most certainly the MicroPython installation, and the MPY_MARCH in esp-deployment.py).
Important note for linux: it may be that mpremote assumes another USB device with higher priority than the ESP32.
In that case all mpremote commands (especially inside esp-deployment.py) will fail as no communication is possible.
Check all USB devices mpremote considers in priority order with mpremote devs
.
First Time MicroPython Installation For ESP32 (GENERIC)
- download the newest firmware
- install the esp flash tool:
pip install esptool
- connect your ESP32 via USB and start a terminal at the location of the downloaded firmware
- start the following command (with the correct USB port), then hold boot until it starts erasing:
esptool --chip esp32 --port /dev/ttyUSB0 erase_flash
- start the following command (with the correct USB port and firmware name), then hold boot until it starts flashing:
esptool --chip esp32 --port /dev/ttyUSB0 --baud 460800 write_flash -z 0x1000 esp32-20220618-v1.19.1.bin
- done, you may now connect to it via:
mpremote
(installation via pip:pip install mpremote
)
Update To New MicroPython Version
- download the newest firmware
- start the following command (with the correct USB port and firmware name), then hold boot until it starts flashing:
esptool --chip esp32 --port /dev/ttyUSB0 --baud 460800 write_flash -z 0x1000 esp32-20220618-v1.19.1.bin
- done
First Time dtn7zero Deployment
- make sure you check out the repository and the submodules (especially py-dtn7)
- install the mpremote tool:
pip install mpremote
- install the mpy-cross compiler tool:
pip install mpy-cross
- populate wlan.json with an appropriate hostname and at least one ssid -> password mapping
- check your connection to the ESP32 with:
mpremote
- copy wlan.json to your ESP32:
mpremote fs cp wlan.json :wlan.json
- copy boot.py to your ESP32:
mpremote fs cp boot.py :boot.py
- deploy the dtn7zero and dependencies onto the ESP32 (this can take a while):
python scripts/esp-deployment.py
- done
Continuous dtn7zero Deployment
- check your connection to the ESP32 with:
mpremote
- deploy the changes of dtn7zero and dependencies onto the ESP32 (this can take a while):
python scripts/esp-deployment.py
- done
First dtn7zero Functionality Check On MicroPython
- you may check that wlan is connecting correctly (connect via
mpremote
and press enable for a soft reset) - you may also check that you can import dtn7zero (connect via
mpremote
andimport dtn7zero
) - you can also check that everything works (run the test script
mpremote run scripts/test-bundle-protocol-agent.py
)
Useful Links
the DTN7 website: https://dtn7.github.io
dtn7 go implementation: https://github.com/dtn7/dtn7-go
dtn7 rust implementation: https://github.com/dtn7/dtn7-rs
dtn7 python bundle implementation and dtn7rs-rest-api access: https://github.com/teschmitt/py-dtn7
Bundle Protocol 7 RFC: https://datatracker.ietf.org/doc/html/rfc9171
Bundle Protocol Security (BPSec) RFC: https://datatracker.ietf.org/doc/html/rfc9172
Default Security Contexts for BPSec RFC: https://datatracker.ietf.org/doc/html/rfc9173
TCP Convergence-Layer Protocol Version 4 RFC: https://datatracker.ietf.org/doc/html/rfc9174
Minimal TCP Convergence-Layer Protocol RFC (draft): https://datatracker.ietf.org/doc/html/draft-ietf-dtn-mtcpcl-01
UDP Convergence Layer RFC (draft): https://datatracker.ietf.org/doc/html/draft-sipos-dtn-udpcl-01
Outdated Standards:
DTN URI Scheme: https://www.ietf.org/archive/id/draft-irtf-dtnrg-dtn-uri-scheme-00.html
Further Research
This is some information gathered about future mesh extensions:
-
- a special mesh standard which is based of Wi-Fi and uses the special AP_STA mode
- no micropython implementation known
-
Alternative: AP_STA mode for simultaneous AP and STA without explicit ESP-MESH usage
- only available for Arduino+C
- painlessMesh also uses this mode to build its mesh
Open End Topics / Known Issues
- interface between router and cla is inconsistent (different responsibilities for send and receive)
- dtn7rs-rest-cla and in-memory storage together use too much RAM (therefore the rest-cla is disabled in the simple API)
- additional group (for example: "dtn://group/~news") registration on singleton endpoints (can there be registrations from multiple local endpoints on the same group?)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file dtn7zero-0.0.1.tar.gz
.
File metadata
- Download URL: dtn7zero-0.0.1.tar.gz
- Upload date:
- Size: 49.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53d1cc1df75d5acb824795181709849b0e1234e95be3fd019d1d4da4abb91e1f |
|
MD5 | 357339f05172eb8c5760cbb441c7bc8d |
|
BLAKE2b-256 | 564d759f289406018cc41572288b2bd824b1c7552da25dcf2645753c0cee9adb |
File details
Details for the file dtn7zero-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: dtn7zero-0.0.1-py3-none-any.whl
- Upload date:
- Size: 42.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 581f7d32036b75fa105d597a852856d295630de22b3474aa18881d1312bb9ab5 |
|
MD5 | 192b81a85fb7c2f079e8d3e12cf5d7f1 |
|
BLAKE2b-256 | acf56a5da419eae5494bddd812fd39462fa12c136e51b9bce161428fbb7768d6 |