Compare commits

...
83 Commits
Author SHA1 Message Date
Mark Qvist bfade97051 Prepare release 2026-07-19 02:30:28 +02:00
Mark Qvist 3c4ef622cc Updated changelog 2026-07-19 02:29:09 +02:00
Mark Qvist 3898d63689 Block fast flapping configuration 2026-07-19 02:10:52 +02:00
Mark Qvist ec8d43a548 Updated rnsh config args to work similarly to other RNS utils 2026-07-19 00:57:27 +02:00
Mark Qvist 5081255317 Updated logging 2026-07-18 23:03:35 +02:00
Mark Qvist 13a538168f Cleanup 2026-07-18 21:30:46 +02:00
Mark Qvist a5ed0a4321 Improved HDLC handling 2026-07-18 21:26:57 +02:00
Mark Qvist d93f9798ae Cleanup 2026-07-18 19:23:02 +02:00
Mark Qvist 88833f170b Updated documentation 2026-07-18 16:46:04 +02:00
Mark Qvist cd6911ed53 Implemented automated fast-flapping client blocking on BackboneInterface 2026-07-18 16:45:42 +02:00
Mark Qvist b95c51b96e Added LOG_PATHING loglevel 2026-07-18 15:07:06 +02:00
Mark Qvist 3a36c367fe Improved resource handling 2026-07-18 02:46:06 +02:00
Mark Qvist cf6010da59 Enable discovery for internal-mode interfaces 2026-07-17 11:43:14 +02:00
Mark Qvist bb2897445f Added RESOURCE_RCL signal on resource receiver cancel. Improved link identify and resource safeguards. 2026-07-16 15:18:08 +02:00
Mark Qvist 406b141370 Updated version 2026-07-14 20:42:42 +02:00
Mark Qvist 00b2f81a82 Added ability to resolve discoverable interface location from external executable 2026-07-14 20:41:28 +02:00
Mark Qvist 9adf045a31 Added discovery location script info to docs 2026-07-14 20:40:45 +02:00
Mark Qvist de0f399a16 Prepare release 2026-07-10 12:42:56 +02:00
Mark Qvist dca2a92829 Prepare release 2026-07-10 12:40:39 +02:00
Mark Qvist b1b3ff7143 Updated version 2026-07-10 11:47:32 +02:00
Mark Qvist a0f0f31807 Cleanup 2026-07-10 01:15:57 +02:00
Mark Qvist 72db6e0ef2 Ensure link traffic stats consistency 2026-07-06 19:23:45 +02:00
Mark Qvist b70688883a Ensure link hops is available on both initiator and destination 2026-07-06 19:22:41 +02:00
Mark Qvist dd3ddb9d8a Added Weave event type 2026-07-06 19:21:45 +02:00
Mark Qvist 4ba1750c01 Updated changelog 2026-07-03 18:32:34 +02:00
Mark Qvist eacff56fe2 Cleanup 2026-07-03 18:25:44 +02:00
Mark Qvist 8768e163ae Updated changelog 2026-07-03 12:27:01 +02:00
Mark Qvist c0bc19d998 Cleanup 2026-06-27 21:59:34 +02:00
Mark Qvist c99ec922aa Cleanup 2026-06-26 11:59:33 +02:00
Mark Qvist 0a6f76e41b Updated documentation 2026-06-25 21:28:06 +02:00
Mark Qvist 156ce9cd34 Updated readme 2026-06-25 21:17:34 +02:00
Mark Qvist 176092ebf9 Cleanup 2026-06-25 20:57:40 +02:00
Mark Qvist 98817e3f9d Improved announce propagation logic 2026-06-25 19:53:06 +02:00
Mark Qvist 276b7bb92f Updated docs 2026-06-25 17:36:45 +02:00
Mark Qvist d1813e1ff0 Added announces_from_internal interface option 2026-06-25 15:33:48 +02:00
Mark Qvist 5355a9bb20 Updated readme 2026-06-25 15:33:25 +02:00
Mark Qvist 48d17a8616 Fixed typo 2026-06-19 23:55:50 +02:00
Mark Qvist 7e603f9606 Updated documentation 2026-06-19 20:13:16 +02:00
Mark Qvist ac6f0199f5 Updated documentation 2026-06-19 20:13:03 +02:00
Mark Qvist 71f6f721fd Added internal interface mode 2026-06-19 19:27:52 +02:00
Mark Qvist 51b7dc7cd4 Updated version 2026-06-19 10:16:25 +02:00
Mark Qvist 03ddb08248 Added recursive_prs interface option 2026-06-19 10:15:32 +02:00
Mark Qvist 422dc05549 Updated changelog 2026-06-07 15:21:20 +02:00
Mark Qvist 50c0a354c9 Cleanup 2026-06-01 00:34:49 +02:00
Mark Qvist e98487c1cf Prepare release 2026-06-01 00:27:36 +02:00
Mark Qvist 50e03a24e8 Updated version 2026-06-01 00:01:33 +02:00
Mark Qvist 0cc42568c7 Fixed UDP listener replacement deadlocking AutoInterface traffic when fast-roaming between physical interfaces or WiFi APs 2026-05-31 23:54:46 +02:00
Mark Qvist 41790ca707 Added release manifest 2026-05-31 11:39:27 +02:00
Mark Qvist 20b1bfd01e Prepare release 2026-05-29 09:29:40 +02:00
Mark Qvist 1be5e10abe Updated makefile 2026-05-29 09:29:19 +02:00
Mark Qvist 13a9ebed83 Updated version 2026-05-29 09:19:28 +02:00
Mark Qvist aee8c3be0c Fixed missing check for instance type configuration conflict 2026-05-29 09:01:21 +02:00
Mark Qvist ef8ccf67ed Cleaned up superfluous path state call 2026-05-29 08:21:32 +02:00
Mark Qvist 91d531b053 Fixed regression in inbound announce deduplication 2026-05-29 08:19:04 +02:00
Mark Qvist 0de169836e Improved cleanup of stale known destinations 2026-05-29 07:53:29 +02:00
Mark Qvist a2ef978208 Use msgpack for shared instance RPC 2026-05-29 07:30:41 +02:00
Mark Qvist 5b3bb050e7 Fixed typo 2026-05-29 00:22:50 +02:00
Mark Qvist 9b9efe5fac Added mailmap generation tip to git documentation 2026-05-29 00:04:05 +02:00
Mark Qvist 482d5ac4cb Updated docs 2026-05-28 23:36:51 +02:00
Mark Qvist 804a7ddbe1 Prepare release 2026-05-28 23:35:08 +02:00
Mark Qvist 739fdd387e Fixed known destinations persist regression on windows 2026-05-28 23:26:59 +02:00
Mark Qvist f3517d2e4b Prepare release 2026-05-28 17:55:40 +02:00
Mark Qvist c59f1e3dd6 Updated rngit documentation 2026-05-28 17:43:35 +02:00
Mark Qvist 2cf07099e3 Added local verify shorthand option to rngit release 2026-05-28 17:43:02 +02:00
Mark Qvist 0292465666 Added option to configure blackhole update interval 2026-05-28 17:12:21 +02:00
Victor Alexeev b4e15503c1 Added option to log without timestamps 2026-05-28 16:52:39 +02:00
Mark Qvist a5ca1ee41e Updated rngit docs 2026-05-28 02:27:24 +02:00
Mark Qvist f9c786fa28 Updated commit signing docs 2026-05-28 02:22:05 +02:00
Mark Qvist bcf35030bc Show signature status on commit page 2026-05-28 02:09:47 +02:00
Mark Qvist 237eada209 Added tag validation support 2026-05-28 00:17:22 +02:00
Mark Qvist afb984d3d4 Added rngit commit signing section to the manual 2026-05-27 23:42:37 +02:00
Mark Qvist 675a25c90e Added commit signing and validation to rngit 2026-05-27 21:42:31 +02:00
Mark Qvist f6d6314842 Added commit hash to generated release manifests 2026-05-27 15:39:27 +02:00
Mark Qvist 22ab5c29bd Cleanup of deprecated mandatory rsm note field 2026-05-27 13:35:26 +02:00
Mark Qvist 4931c6a54c Updated version 2026-05-26 23:31:26 +02:00
Mark Qvist d3fcc2a38c Extended blackhole functionality to immediately terminate links if remote identifies as a blackholed identity 2026-05-26 12:34:55 +02:00
Mark Qvist e9609b7f25 Only display first line in release lists 2026-05-25 17:36:32 +02:00
Mark Qvist 70cd51f0fa Adjusted logging 2026-05-25 13:48:34 +02:00
Mark Qvist fa7699a37d Improved markdown formatting of the manual 2026-05-23 09:53:38 +02:00
Mark Qvist 2c9b794182 Improved markdown formatting of gettingstartedfast chapter 2026-05-23 09:39:16 +02:00
Mark Qvist eae84ed8ba Improved markdown version of the manual 2026-05-23 09:26:38 +02:00
Mark Qvist 31539c5a0e Improved markdown formatting of understanding reticulum manual chapter 2026-05-23 09:21:56 +02:00
Mark Qvist abca32bca4 Improved markdown formatting of understanding reticulum manual chapter 2026-05-23 09:18:45 +02:00
93 changed files with 3919 additions and 4182 deletions

No files matched your search

+1
View File
@@ -14,3 +14,4 @@ tests/rnsconfig/logfile*
*.data *.data
*.result *.result
.buildinfo.bak .buildinfo.bak
docs/Reticulum Manual.*
+93 -92
View File
@@ -1,31 +1,42 @@
### 2026-05-22: RNS 1.3.1 ### 2026-07-19: RNS 1.3.9
This maintenance release fixes a single bug. **Critical Security Update**: This release fixes a severe security flaw in `rnsh`. Due to the nature of the issue, I will not disclose any further details for the time being. Once operators have had time to update, I will provide a full report for transparency. If you use `rnsh`, update **right now**.
**Important**: The new version of `rnsh` changes default identity file locations, and these will now be sourced from `~/.rnsh/identity` (initiator) and `~/.rnsh/identity.default` (listener). Make sure you copy your old files to this directory, or specify a custom identity path using the command line arguments. The `--config` argument has also been renamed to `--rnsconfig`, and the `--config` argument will now specify the `rnsh` configuration directory instead of the RNS configuration directory, bringing the behavior into alignment with other RNS utilities.
Additionally, this release includes automated blocking of fast-flapping clients on `BackboneInterface` listeners (see the Interfaces chapter of the manual for details), and a number of improvements to resource handling. The logging system has also been improved, and path and destination information moved to a new `LOG_PATHING` loglevel, to decrease log noise.
**Changes** **Changes**
- Fixed regression in request response transfer size accumulator - Fixed a critical security issue in `rnsh`
- Added automated blocking of fast-flapping clients to `BackboneInterface`
- Added new `LOG_PATHING` loglevel, improved logging
- Added ability to make internal-mode interfaces discoverable
- Added ability to get discoverable interface location from external script
- Added `RESOURCE_RCL` signal on resource receiver cancel
- Improved resource handling and reliability
- Updated `rnsh` config args to work similarly to other RNS utilities
**Verified Retrieval** **Verified Retrieval**
You can retrieve and verify this release over Reticulum using the built-in `rngit release` utility. To download all artifacts, and the release manifest for future updates, you can use the following command: You can retrieve and verify this release over Reticulum using the built-in `rngit release` utility. To retrieve only the installation `.whl` package, and the release manifest for future updates, you can use:
```sh
rngit release rns://7649a50d84610232d1416b41d2896aff/reticulum/reticulum fetch "latest:rns-*.whl" --signer bc7291552be7a58f361522990465165c
```
To download all artifacts, including the documentation and source archive, you can use the following command:
```sh ```sh
rngit release rns://7649a50d84610232d1416b41d2896aff/reticulum/reticulum fetch latest:all --signer bc7291552be7a58f361522990465165c rngit release rns://7649a50d84610232d1416b41d2896aff/reticulum/reticulum fetch latest:all --signer bc7291552be7a58f361522990465165c
``` ```
To retrieve only the `.whl` package for installation, and the release manifest, you can use:
```sh
rngit release rns://7649a50d84610232d1416b41d2896aff/reticulum/reticulum fetch "latest:rns-*-py3-none-any.whl" --signer bc7291552be7a58f361522990465165c
```
**Release Signatures** **Release Signatures**
Release artifacts include a signed `rsm` release manifest and `rsg` signature files that can be validated against the RNS release signing identity `<bc7291552be7a58f361522990465165c>` using `rngit` or `rnid`. To perform an offline verification of all release artifacts using a manifest: Release artifacts include a signed `rsm` release manifest and `rsg` signature files that can be validated against the RNS release signing identity `<bc7291552be7a58f361522990465165c>` using `rngit` or `rnid`. To perform an offline verification of all release artifacts using a manifest:
```sh ```sh
rngit release rns_*.rsm fetch latest:all --offline --signer bc7291552be7a58f361522990465165c rngit release rns_*.rsm verify --signer bc7291552be7a58f361522990465165c
``` ```
To verify releases using individual `rsg` files, while also verifying the manifest itself, download the `rsm` and `rsg` signatures, make sure they are in the same folder as the release artifact, and run `rnid` signature verification with the release identity as the required signer: To verify release artifacts using individual `rsg` files, while also verifying the manifest itself, download the `rsm` and `rsg` signatures, make sure they are in the same folder as the release artifact, and run `rnid` signature verification with the release identity as the required signer:
```sh ```sh
rnid -i bc7291552be7a58f361522990465165c -V rns_*.rsm *.rsg rnid -i bc7291552be7a58f361522990465165c -V rns_*.rsm *.rsg
@@ -33,6 +44,76 @@ rnid -i bc7291552be7a58f361522990465165c -V rns_*.rsm *.rsg
The `rnid` utility will then verify the signatures, and display whether they are valid. If the signature cannot be verified, the release has been tampered with and should be discarded. The `rnid` utility will then verify the signatures, and display whether they are valid. If the signature cannot be verified, the release has been tampered with and should be discarded.
### 2026-07-10: RNS 1.3.8
This release fixes various inconsistencies in link and hop-count related APIs.
**Changes**
- Fixed inconsistent link traffic stats calculation
- Fixed link hop-count metric only being available on initiator side
- Fixed potential hop-count serialization error on transport
- Updated `WeaveInterface` to support latest Weave firmware
### 2026-07-03: RNS 1.3.7
This maintenance release improves announces propagation logic, and adds additional options for configuring announce propagation and interface behavior in transport mode.
**Changes**
- Added `internal` interface mode
- Added `recursive_prs` interface option
- Added `announces_from_internal` interface option
- Added new options to the manual
- Improved and cleaned up announce propagation logic
### 2026-07-03: RNS 1.3.6
This release contained a bug in the local instance transport handling, and was superseded by version `1.3.7`.
### 2026-06-01: RNS 1.3.5
This maintenance release contains an important fix for `AutoInterface` reliability when roaming between different physical networks.
**Changes**
- Fixed UDP listener replacement deadlocking inbound AutoInterface traffic when fast-roaming between physical interfaces or WiFi APs
- Fixed some paths never resolving when using other interfaces at the same time as a deadlocked AutoInterface
### 2026-05-29: RNS 1.3.4
This release fixes a regression that could cause sub-optimal path selection under conditions where the same announce was received within a very short timespan on different interfaces, as well as a few other bugs and inefficiencies.
**Changes**
- Fixed regression in inbound announce de-duplication
- Fixed missing check for shared instance type configuration conflict
- Fixed superfluous path state configuration on new announce from new destinations
- Improved cleanup of stale known destinations
- Improved shared instance RPC handling
### 2026-05-28: RNS 1.3.3
This release fixes a regression in persistence of known destination on Windows.
**Changes**
- Fixed regression in known destinations persist on Windows
### 2026-05-28: RNS 1.3.2
This release adds commit signing and validation support to the `rngit` system, as well as improvements to the blackhole functionality.
**Changes**
- Extended blackhole functionality to immediately terminate links from blackholed identities
- Added commit signing and validation to `rngit`
- Added commit hash inclusion in generated release manifest to `rngit`
- Added local `verify` operation shorthand to `rngit release`
- Added option to configure blackhole update interval
- Added configuration option to log without timestamps
### 2026-05-22: RNS 1.3.1
This maintenance release fixes a single bug.
**Changes**
- Fixed regression in request response transfer size accumulator
### 2026-05-21: RNS 1.3.0 ### 2026-05-21: RNS 1.3.0
This maintenance release fixes a number of bugs. This maintenance release fixes a number of bugs.
@@ -47,28 +128,6 @@ This maintenance release fixes a number of bugs.
- Adjusted timeouts for remote operations in `rngit` - Adjusted timeouts for remote operations in `rngit`
- Updated documentation - Updated documentation
**Verified Retrieval**
You can retrieve and verify this release over Reticulum using the built-in `rngit release` utility. To download all artifacts, and the release manifest for future updates, you can use the following command:
```sh
rngit release rns://7649a50d84610232d1416b41d2896aff/reticulum/reticulum fetch latest:all --signer bc7291552be7a58f361522990465165c
```
To retrieve only the `.whl` package for installation, you can use:
```sh
rngit release rns://7649a50d84610232d1416b41d2896aff/reticulum/reticulum fetch latest:rns-1.3.0-py3-none-any.whl --signer bc7291552be7a58f361522990465165c
```
**Release Signatures**
Release artifacts include a signed `rsm` release manifest and `rsg` signature files that can be validated against the RNS release signing identity `<bc7291552be7a58f361522990465165c>` using `rnid`. To verify files, download the `rsm` and `rsg` signatures, make sure they are in the same folder as the release artifact, and run `rnid` signature verification with the release identity as the required signer:
```sh
rnid -i bc7291552be7a58f361522990465165c -V manifest.rsm *.rsg
```
The `rnid` utility will then verify the signatures, and display whether they are valid. If the signature cannot be verified, the release has been tampered with and should be discarded.
### 2026-05-19: RNS 1.2.9 ### 2026-05-19: RNS 1.2.9
This release completes the operational functionality of the `rngit` system, which now has full release creation, fetch and verified update support using the `rngit release` command. Additionally, two chapters have been added to the manual should cover all the things that `rngit` is currently capable of. This release completes the operational functionality of the `rngit` system, which now has full release creation, fetch and verified update support using the `rngit release` command. Additionally, two chapters have been added to the manual should cover all the things that `rngit` is currently capable of.
@@ -84,28 +143,6 @@ This release completes the operational functionality of the `rngit` system, whic
- Improved page node ref link handling in `rngit` - Improved page node ref link handling in `rngit`
- Improved logging in various locations - Improved logging in various locations
**Verified Retrieval**
You can retrieve and verify this release over Reticulum using the built-in `rngit release` utility. To download all artifacts, and the release manifest for future updates, you can use the following command:
```sh
rngit release rns://7649a50d84610232d1416b41d2896aff/reticulum/reticulum fetch latest:all --signer bc7291552be7a58f361522990465165c
```
To retrieve only the `.whl` package for installation, you can use:
```sh
rngit release rns://7649a50d84610232d1416b41d2896aff/reticulum/reticulum fetch latest:rns-1.2.8-py3-none-any.whl --signer bc7291552be7a58f361522990465165c
```
**Release Signatures**
Release artifacts include a signed `rsm` release manifest and `rsg` signature files that can be validated against the RNS release signing identity `<bc7291552be7a58f361522990465165c>` using `rnid`. To verify files, download the `rsm` and `rsg` signatures, make sure they are in the same folder as the release artifact, and run `rnid` signature verification with the release identity as the required signer:
```sh
rnid -i bc7291552be7a58f361522990465165c -V manifest.rsm *.rsg
```
The `rnid` utility will then verify the signatures, and display whether they are valid. If the signature cannot be verified, the release has been tampered with and should be discarded.
### 2026-05-18: RNS 1.2.8 ### 2026-05-18: RNS 1.2.8
This release improves the `rngit` system with signed release manifest generation and automatic artifact signing. It also includes several additions to `rnid` and various minor fixes and improvements to the `rngit` system. This release improves the `rngit` system with signed release manifest generation and automatic artifact signing. It also includes several additions to `rnid` and various minor fixes and improvements to the `rngit` system.
@@ -126,15 +163,6 @@ This release improves the `rngit` system with signed release manifest generation
- Fixed various minor bugs and inconsistencies in `rngit` - Fixed various minor bugs and inconsistencies in `rngit`
- Dropped `note` metadata field requirement from `rsg` structure - Dropped `note` metadata field requirement from `rsg` structure
**Release Signatures**
Release artifacts include a signed `rsm` release manifest and `rsg` signature files that can be validated against the RNS release signing identity `<bc7291552be7a58f361522990465165c>` using `rnid`. To verify files, download the `rsm` and `rsg` signatures, make sure they are in the same folder as the release artifact, and run `rnid` signature verification with the release identity as the required signer:
```sh
rnid -i bc7291552be7a58f361522990465165c -V manifest.rsm *.rsg
```
The `rnid` utility will then verify the signatures, and display whether they are valid. If the signature cannot be verified, the release has been tampered with and should be discarded.
### 2026-05-17: RNS 1.2.7 ### 2026-05-17: RNS 1.2.7
This release significantly improves the `rngit` system with fork, mirroring and empty repository creation functionality, a new work document proposals feature, improvements to the transport core reliability and efficiency and various other tweaks and improvements. This release significantly improves the `rngit` system with fork, mirroring and empty repository creation functionality, a new work document proposals feature, improvements to the transport core reliability and efficiency and various other tweaks and improvements.
@@ -152,15 +180,6 @@ This release significantly improves the `rngit` system with fork, mirroring and
- Improved transfer completed feedback in `rncp`, thanks to **neutral** - Improved transfer completed feedback in `rncp`, thanks to **neutral**
- Improved interface transport insertion and removal - Improved interface transport insertion and removal
**Release Signatures**
Release artifacts include `rsg` signature files that can be validated against the RNS release signing identity `<bc7291552be7a58f361522990465165c>` using `rnid`. To verify files, download the `rsg` signatures, make sure they are in the same folder as the release artifact, and run `rnid` signature verification with the release identity as the required signer:
```sh
rnid -i bc7291552be7a58f361522990465165c -V rns*.whl
```
The `rnid` utility will then verify the signatures, and display whether it is valid. If the signature cannot be verified, the file has been tampered with and should be thrown very far away in a jiffy.
### 2026-05-14: RNS 1.2.6 ### 2026-05-14: RNS 1.2.6
This release adds further improvements to the `rnid` and `rngit` utilities, and includes several bugfixes and other improvements. This release adds further improvements to the `rnid` and `rngit` utilities, and includes several bugfixes and other improvements.
@@ -182,15 +201,6 @@ This release adds further improvements to the `rnid` and `rngit` utilities, and
- Fixed potential race condition in interface discovery - Fixed potential race condition in interface discovery
- Fixed `rngit` remote helper hanging on startup if no client config had been created previously, and RNS loglevel was configured at debug or higher - Fixed `rngit` remote helper hanging on startup if no client config had been created previously, and RNS loglevel was configured at debug or higher
**Release Signatures**
Release artifacts include `rsg` signature files that can be validated against the RNS release signing identity `<bc7291552be7a58f361522990465165c>` using `rnid`. To verify files, download the `rsg` signatures, make sure they are in the same folder as the release artifact, and run `rnid` signature verification with the release identity as the required signer:
```sh
rnid -i bc7291552be7a58f361522990465165c -V rns*.whl
```
The `rnid` utility will then verify the signatures, and display whether it is valid. If the signature cannot be verified, the file has been tampered with and should be thrown very far away in a jiffy.
### 2026-05-09: RNS 1.2.5 ### 2026-05-09: RNS 1.2.5
This release brings substantial improvements to path request handling, and should significantly reduce overall network and local transport node processing loads. Path requests are now automatically ingress and egress limited per interface and sub-interface. Although the defaults are effective and sane, and should work right out of the box bring an end to practically all the PR and announce spam going on lately, the backend is fully configurable for both defaults and per interface, if you want to fiddle with the settings. This release brings substantial improvements to path request handling, and should significantly reduce overall network and local transport node processing loads. Path requests are now automatically ingress and egress limited per interface and sub-interface. Although the defaults are effective and sane, and should work right out of the box bring an end to practically all the PR and announce spam going on lately, the backend is fully configurable for both defaults and per interface, if you want to fiddle with the settings.
@@ -219,15 +229,6 @@ For all node ops out there, I'd recomment updating to this at some sort of semi-
- Ensured canonical validation functions in `rngit` - Ensured canonical validation functions in `rngit`
- Lots of other small fixes and stability improvements to `rngit` - Lots of other small fixes and stability improvements to `rngit`
**Release Signatures**
Release artifacts include `rsg` signature files that can be validated against the RNS release signing identity `<bc7291552be7a58f361522990465165c>` using `rnid`. To verify files, download the `rsg` signatures, make sure they are in the same folder as the release artifact, and run `rnid` signature verification with the release identity as the required signer:
```sh
rnid -i bc7291552be7a58f361522990465165c -V rns-1.2.5-py3-none-any.whl
```
The `rnid` utility will then verify the signatures, and display whether it is valid. If the signature cannot be verified, the file has been tampered with and should be thrown very far away in a jiffy.
### 2026-05-07: RNS 1.2.4 ### 2026-05-07: RNS 1.2.4
This release brings a complete rewrite and update to the `rnid` utility, which is now a lot more useful, and better at finding and saving identities. It also includes a bunch of other improvements, such as expanded `rngit` functionality, better transport performance and a few bugfixes. Enjoy! This release brings a complete rewrite and update to the `rnid` utility, which is now a lot more useful, and better at finding and saving identities. It also includes a bunch of other improvements, such as expanded `rngit` functionality, better transport performance and a few bugfixes. Enjoy!
+1 -1
View File
@@ -57,7 +57,7 @@ manual:
make -C docs latexpdf epub make -C docs latexpdf epub
distcollect: distcollect:
cp docs/Reticulum\ Manual.* dist mv docs/Reticulum\ Manual.* dist
build_spkg: remove_symlinks build_sdist create_symlinks build_spkg: remove_symlinks build_sdist create_symlinks
+7 -1
View File
@@ -39,7 +39,7 @@ userland, and can run on practically any system that runs Python 3.
## Read The Manual ## Read The Manual
The full documentation for Reticulum is available at [markqvist.github.io/Reticulum/manual/](https://markqvist.github.io/Reticulum/manual/). The full documentation for Reticulum is available at [markqvist.github.io/Reticulum/manual/](https://markqvist.github.io/Reticulum/manual/).
You can also download the [Reticulum manual as a PDF](https://github.com/markqvist/Reticulum/raw/master/docs/Reticulum%20Manual.pdf) or [as an e-book in EPUB format](https://github.com/markqvist/Reticulum/raw/master/docs/Reticulum%20Manual.epub). You can also download the [Reticulum manual as a PDF](https://github.com/markqvist/Reticulum/releases/latest/download/Reticulum.Manual.pdf) or [as an e-book in EPUB format](https://github.com/markqvist/Reticulum/releases/latest/download/Reticulum.Manual.epub).
For more info, see [reticulum.network](https://reticulum.network/) and [the FAQ section of the wiki](https://github.com/markqvist/Reticulum/wiki/Frequently-Asked-Questions). For more info, see [reticulum.network](https://reticulum.network/) and [the FAQ section of the wiki](https://github.com/markqvist/Reticulum/wiki/Frequently-Asked-Questions).
@@ -85,6 +85,12 @@ The Reticulum Protocol is defined entirely and authoritatively by this reference
implementation, and its associated manual. It is maintained by Mark Qvist, implementation, and its associated manual. It is maintained by Mark Qvist,
identified by the Reticulum Identity `<bc7291552be7a58f361522990465165c>`. identified by the Reticulum Identity `<bc7291552be7a58f361522990465165c>`.
No second-order protocol specification derivatives currently do, or will ever exist. You can't get a better specification than one that is executable, functional, testable, deployed and operating 24/7 across the planet.
There is not, and never will be a separate, derived "formal spec", "RFC" or anything similar for Reticulum:
**The reference implementation *is* the final, authoritative specification.**
Compatibility with the Reticulum Protocol is defined as having full interoperability, Compatibility with the Reticulum Protocol is defined as having full interoperability,
and sufficient functional parity with this reference implementation. Any specific protocol and sufficient functional parity with this reference implementation. Any specific protocol
implementation that achieves this is Reticulum. Any that does not is not Reticulum. implementation that achieves this is Reticulum. Any that does not is not Reticulum.
+7 -1
View File
@@ -16,7 +16,7 @@ No kernel modules or drivers are required. Reticulum runs completely in userland
The full documentation for Reticulum is available on `_`!`[this node`:/page/blob.mu`g=reticulum|r=reticulum|ref=HEAD|path=docs/markdown/index.md]`!`_. The full documentation for Reticulum is available on `_`!`[this node`:/page/blob.mu`g=reticulum|r=reticulum|ref=HEAD|path=docs/markdown/index.md]`!`_.
You can also download the `_`!`[Reticulum manual as a PDF`:/file/download`g=reticulum|r=reticulum|ref=HEAD|path=docs%2FReticulum+Manual.pdf]`!`_ or `_`!`[as an e-book in EPUB format`:/file/download`g=reticulum|r=reticulum|ref=HEAD|path=docs%2FReticulum+Manual.pdf]`!`_. You can also download the `_`!`[Reticulum manual as a PDF`:/file/artifact`g=reticulum|r=reticulum|t=latest|a=Reticulum+Manual.pdf]`!`_ or `_`!`[as an e-book in EPUB format`:/file/artifact`g=reticulum|r=reticulum|t=latest|a=Reticulum+Manual.epub]`!`_.
>> Notable Features >> Notable Features
@@ -58,6 +58,12 @@ You can also download the `_`!`[Reticulum manual as a PDF`:/file/download`g=reti
The Python code in this repository is the Reference Implementation of Reticulum. The Reticulum Protocol is defined entirely and authoritatively by this reference implementation, and its associated manual. It is maintained by Mark Qvist, identified by the Reticulum Identity `B333<bc7291552be7a58f361522990465165c>`b. The Python code in this repository is the Reference Implementation of Reticulum. The Reticulum Protocol is defined entirely and authoritatively by this reference implementation, and its associated manual. It is maintained by Mark Qvist, identified by the Reticulum Identity `B333<bc7291552be7a58f361522990465165c>`b.
No second-order protocol specification derivatives currently do, or will ever exist. You can't get a better specification than one that is executable, functional, testable, deployed and operating 24/7 across the planet.
There is not, and never will be a separate, derived "formal spec", "RFC" or anything similar for Reticulum:
`!The reference implementation `*is`* the final, authoritative specification.`!
Compatibility with the Reticulum Protocol is defined as having full interoperability, and sufficient functional parity with this reference implementation. Any specific protocol implementation that achieves this is Reticulum. Any that does not is not Reticulum. Compatibility with the Reticulum Protocol is defined as having full interoperability, and sufficient functional parity with this reference implementation. Any specific protocol implementation that achieves this is Reticulum. Any that does not is not Reticulum.
The reference implementation is licensed under the Reticulum License. The reference implementation is licensed under the Reticulum License.
+29 -2
View File
@@ -99,6 +99,33 @@ class InterfaceAnnouncer():
if not interface_type in self.DISCOVERABLE_INTERFACE_TYPES: return None if not interface_type in self.DISCOVERABLE_INTERFACE_TYPES: return None
else: else:
if not RNS.vendor.platformutils.is_windows() and interface.discovery_location:
try:
discovery_location = self.sanitize(interface.discovery_location)
exec_path = os.path.expanduser(discovery_location)
if os.path.isfile(exec_path) and os.access(exec_path, os.X_OK):
RNS.log(f"Evaluating discovery location from executable at {exec_path}", RNS.LOG_DEBUG)
exec_result = subprocess.run([exec_path], stdout=subprocess.PIPE)
exec_stdout = exec_result.stdout.decode("utf-8")
if exec_result.returncode != 0: raise ValueError("Non-zero exit code from subprocess")
discovery_location = self.sanitize(exec_stdout)
location_components = discovery_location.replace(" ", "").split(",")
if len(location_components) != 3: raise ValueError(f"Invalid location component count: {len(location_components)}")
dlat = float(location_components[0])
dlon = float(location_components[1])
dhgt = float(location_components[2])
if dlat < -90 or dlat > 90: raise ValueError(f"Invalid latitude: {dlat}")
if dlon < -180 or dlat > 180: raise ValueError(f"Invalid longitude: {dlon}")
if dhgt < -4000 or dhgt > 1e6: raise ValueError(f"Invalid height: {dhgt}")
interface.discovery_latitude = dlat
interface.discovery_longitude = dlon
interface.discovery_height = dhgt
except Exception as e:
RNS.log(f"Error while getting reachable_on from executable at {interface.reachable_on}: {e}", RNS.LOG_ERROR)
RNS.log(f"Aborting discovery announce", RNS.LOG_ERROR)
return None
flags = 0x00 flags = 0x00
info = {INTERFACE_TYPE: interface_type, info = {INTERFACE_TYPE: interface_type,
TRANSPORT: RNS.Reticulum.transport_enabled(), TRANSPORT: RNS.Reticulum.transport_enabled(),
@@ -237,7 +264,7 @@ class InterfaceAnnounceHandler:
valid = self.stamper.stamp_valid(stamp, self.required_value, workblock) valid = self.stamper.stamp_valid(stamp, self.required_value, workblock)
if not valid: if not valid:
RNS.log(f"Ignored discovered interface with invalid stamp", RNS.LOG_DEBUG) RNS.log(f"Ignored discovered interface with insufficient stamp value {value}", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None
return return
if value < self.required_value: RNS.log(f"Ignored discovered interface with stamp value {value}", RNS.LOG_DEBUG) if value < self.required_value: RNS.log(f"Ignored discovered interface with stamp value {value}", RNS.LOG_DEBUG)
@@ -746,7 +773,7 @@ class BlackholeUpdater():
if identity_hash in self.last_updates: last_update = self.last_updates[identity_hash] if identity_hash in self.last_updates: last_update = self.last_updates[identity_hash]
else: last_update = 0 else: last_update = 0
if now > last_update+self.UPDATE_INTERVAL: if now > last_update+RNS.Reticulum.blackhole_update_interval():
try: try:
destination_hash = RNS.Destination.hash_from_name_and_identity("rnstransport.info.blackhole", identity_hash) destination_hash = RNS.Destination.hash_from_name_and_identity("rnstransport.info.blackhole", identity_hash)
RNS.log(f"Attempting blackhole list update from {RNS.prettyhexrep(identity_hash)}...", RNS.LOG_DEBUG) RNS.log(f"Attempting blackhole list update from {RNS.prettyhexrep(identity_hash)}...", RNS.LOG_DEBUG)
+15 -11
View File
@@ -213,12 +213,12 @@ class Identity:
except Exception as e: except Exception as e:
RNS.log("Skipped recombining known destinations from disk, since an error occurred: "+str(e), RNS.LOG_WARNING) RNS.log("Skipped recombining known destinations from disk, since an error occurred: "+str(e), RNS.LOG_WARNING)
RNS.log("Saving "+str(len(Identity.known_destinations))+" known destinations to storage...", RNS.LOG_VERBOSE) RNS.log("Saving "+str(len(Identity.known_destinations))+" known destinations to storage...", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None
temp_file = RNS.Reticulum.storagepath+f"/known_destinations.tmp.{time.time()}" temp_file = RNS.Reticulum.storagepath+f"/known_destinations.tmp.{time.time()}"
try: try:
with open(temp_file,"wb") as file: umsgpack.dump(Identity.known_destinations.copy(), file) with open(temp_file,"wb") as file: umsgpack.dump(Identity.known_destinations.copy(), file)
os.rename(temp_file, RNS.Reticulum.storagepath+f"/known_destinations") os.replace(temp_file, RNS.Reticulum.storagepath+f"/known_destinations")
except Exception as e: except Exception as e:
RNS.log(f"Error while serializing and writing known destinations: {e}", RNS.LOG_ERROR) RNS.log(f"Error while serializing and writing known destinations: {e}", RNS.LOG_ERROR)
@@ -230,7 +230,7 @@ class Identity:
if save_time < 1: time_str = str(round(save_time*1000,2))+"ms" if save_time < 1: time_str = str(round(save_time*1000,2))+"ms"
else: time_str = str(round(save_time,2))+"s" else: time_str = str(round(save_time,2))+"s"
RNS.log("Saved known destinations to storage in "+time_str, RNS.LOG_VERBOSE) RNS.log("Saved known destinations to storage in "+time_str, RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None
except Exception as e: except Exception as e:
RNS.log("Error while saving known destinations to disk, the contained exception was: "+str(e), RNS.LOG_ERROR) RNS.log("Error while saving known destinations to disk, the contained exception was: "+str(e), RNS.LOG_ERROR)
@@ -316,6 +316,7 @@ class Identity:
no_path = 0 no_path = 0
retained = 0 retained = 0
never_used = 0 never_used = 0
ratchetdir = RNS.Reticulum.storagepath+"/ratchets"
with Identity.known_destinations_lock: destination_hashes = list(Identity.known_destinations.keys()) with Identity.known_destinations_lock: destination_hashes = list(Identity.known_destinations.keys())
for destination_hash in destination_hashes: for destination_hash in destination_hashes:
@@ -359,6 +360,12 @@ class Identity:
Identity.known_destinations.pop(destination_hash) Identity.known_destinations.pop(destination_hash)
removed += 1 removed += 1
try:
hexhash = RNS.hexrep(destination_hash, delimit=False)
ratchet_path = f"{ratchetdir}/{hexhash}"
if os.path.isfile(ratchet_path): os.unlink(ratchet_path)
except Exception as e: RNS.log(f"Could not clean stale ratchets for {RNS.prettyhexrep(destination_hash)}: {e}", RNS.LOG_WARNING)
# RNS.log(f"Total destinations: {total}, stale: {len(stale)}, removed: {removed}, no path: {no_path}, never used: {never_used}, with path: {total-no_path}, used: {total-never_used}, retained: {retained}. Completed in {RNS.prettyshorttime(time.time()-st)}", RNS.LOG_WARNING) # TODO: Remove # RNS.log(f"Total destinations: {total}, stale: {len(stale)}, removed: {removed}, no path: {no_path}, never used: {never_used}, with path: {total-no_path}, used: {total-never_used}, retained: {retained}. Completed in {RNS.prettyshorttime(time.time()-st)}", RNS.LOG_WARNING) # TODO: Remove
if not RNS.Transport.owner.is_connected_to_shared_instance: Identity.save_known_destinations(recombine=False) if not RNS.Transport.owner.is_connected_to_shared_instance: Identity.save_known_destinations(recombine=False)
@@ -595,21 +602,18 @@ class Identity:
signal_str = " [" signal_str = " ["
if packet.rssi != None: if packet.rssi != None:
signal_str += "RSSI "+str(packet.rssi)+"dBm" signal_str += "RSSI "+str(packet.rssi)+"dBm"
if packet.snr != None: if packet.snr != None: signal_str += ", "
signal_str += ", " if packet.snr != None: signal_str += "SNR "+str(packet.snr)+"dB"
if packet.snr != None:
signal_str += "SNR "+str(packet.snr)+"dB"
signal_str += "]" signal_str += "]"
else:
signal_str = "" else: signal_str = ""
if hasattr(packet, "transport_id") and packet.transport_id != None: if hasattr(packet, "transport_id") and packet.transport_id != None:
RNS.log("Valid announce for "+RNS.prettyhexrep(destination_hash)+" "+str(packet.hops)+" hops away, received via "+RNS.prettyhexrep(packet.transport_id)+" on "+str(packet.receiving_interface)+signal_str, RNS.LOG_EXTREME) if RNS.sl(RNS.LOG_EXTREME) else None RNS.log("Valid announce for "+RNS.prettyhexrep(destination_hash)+" "+str(packet.hops)+" hops away, received via "+RNS.prettyhexrep(packet.transport_id)+" on "+str(packet.receiving_interface)+signal_str, RNS.LOG_EXTREME) if RNS.sl(RNS.LOG_EXTREME) else None
else: else:
RNS.log("Valid announce for "+RNS.prettyhexrep(destination_hash)+" "+str(packet.hops)+" hops away, received on "+str(packet.receiving_interface)+signal_str, RNS.LOG_EXTREME) if RNS.sl(RNS.LOG_EXTREME) else None RNS.log("Valid announce for "+RNS.prettyhexrep(destination_hash)+" "+str(packet.hops)+" hops away, received on "+str(packet.receiving_interface)+signal_str, RNS.LOG_EXTREME) if RNS.sl(RNS.LOG_EXTREME) else None
if ratchet: if ratchet: Identity._remember_ratchet(destination_hash, ratchet)
Identity._remember_ratchet(destination_hash, ratchet)
return True return True
+12 -4
View File
@@ -428,14 +428,22 @@ class AutoInterface(Interface):
if ifname in self.interface_servers: if ifname in self.interface_servers:
RNS.log("Shutting down previous UDP listener for "+str(self)+" "+str(ifname), RNS.LOG_DEBUG) RNS.log("Shutting down previous UDP listener for "+str(self)+" "+str(ifname), RNS.LOG_DEBUG)
previous_server = self.interface_servers[ifname] previous_server = self.interface_servers[ifname]
def shutdown_server(): def shutdown_server(): previous_server.shutdown()
previous_server.shutdown()
threading.Thread(target=shutdown_server, daemon=True).start() threading.Thread(target=shutdown_server, daemon=True).start()
RNS.log("Starting new UDP listener for "+str(self)+" "+str(ifname), RNS.LOG_DEBUG) RNS.log("Starting new UDP listener for "+str(self)+" "+str(ifname), RNS.LOG_DEBUG)
udp_server = socketserver.UDPServer(listen_address, self.handler_factory(self.process_incoming)) retry_delay = 1.25
self.interface_servers[ifname] = udp_server listener_started = False
while not listener_started:
try:
time.sleep(retry_delay)
udp_server = socketserver.UDPServer(listen_address, self.handler_factory(self.process_incoming))
self.interface_servers[ifname] = udp_server
listener_started = True
except Exception as e:
RNS.log(f"Could not start new UDP listener for {self} on {listen_address}: {e}", RNS.LOG_WARNING)
RNS.log(f"Retrying in {retry_delay} seconds", RNS.LOG_WARNING)
thread = threading.Thread(target=udp_server.serve_forever) thread = threading.Thread(target=udp_server.serve_forever)
thread.daemon = True thread.daemon = True
+123 -40
View File
@@ -54,6 +54,13 @@ class BackboneInterface(Interface):
DEFAULT_IFAC_SIZE = 16 DEFAULT_IFAC_SIZE = 16
AUTOCONFIGURE_MTU = True AUTOCONFIGURE_MTU = True
BLOCK_FAST_FLAPPING = True
FAST_FLAP_THRESHOLD = 20
FAST_FLAP_GRACE = 5
FAST_FLAP_EXPIRY = 12*60*60
fast_flapping_lock = threading.Lock()
fast_flapping = {}
epoll = None epoll = None
listener_filenos = {} listener_filenos = {}
spawned_interface_filenos = {} spawned_interface_filenos = {}
@@ -109,13 +116,17 @@ class BackboneInterface(Interface):
super().__init__() super().__init__()
c = Interface.get_config_obj(configuration) c = Interface.get_config_obj(configuration)
name = c["name"] name = c["name"]
device = c["device"] if "device" in c else None device = c["device"] if "device" in c else None
port = int(c["port"]) if "port" in c else None port = int(c["port"]) if "port" in c else None
bindip = c["listen_ip"] if "listen_ip" in c else None bindip = c["listen_ip"] if "listen_ip" in c else None
bindport = int(c["listen_port"]) if "listen_port" in c else None bindport = int(c["listen_port"]) if "listen_port" in c else None
prefer_ipv6 = c.as_bool("prefer_ipv6") if "prefer_ipv6" in c else False prefer_ipv6 = c.as_bool("prefer_ipv6") if "prefer_ipv6" in c else False
flap_block = c.as_bool("block_fast_flapping") if "block_fast_flapping" in c else BackboneInterface.BLOCK_FAST_FLAPPING
flap_threshold = c.as_float("fast_flapping_threshold") if "fast_flapping_threshold" in c else BackboneInterface.FAST_FLAP_THRESHOLD
flap_grace = c.as_int("fast_flapping_grace") if "fast_flapping_grace" in c else BackboneInterface.FAST_FLAP_GRACE
flap_expiry = c.as_float("fast_flapping_block_time")*60 if "fast_flapping_block_time" in c else BackboneInterface.FAST_FLAP_EXPIRY
if port != None: bindport = port if port != None: bindport = port
@@ -128,11 +139,13 @@ class BackboneInterface(Interface):
self.mode = RNS.Interfaces.Interface.Interface.MODE_FULL self.mode = RNS.Interfaces.Interface.Interface.MODE_FULL
self.spawned_interfaces = [] self.spawned_interfaces = []
self.supports_discovery = True self.supports_discovery = True
self.block_fast_flapping = flap_block
self.fast_flap_threshold = flap_threshold
self.fast_flap_grace = flap_grace
self.fast_flap_expiry = flap_expiry
if bindport == None: if bindport == None: raise SystemError(f"No TCP port configured for interface \"{name}\"")
raise SystemError(f"No TCP port configured for interface \"{name}\"") else: self.bind_port = bindport
else:
self.bind_port = bindport
bind_address = None bind_address = None
if device != None: if device != None:
@@ -282,7 +295,9 @@ class BackboneInterface(Interface):
if fileno in BackboneInterface.spawned_interface_filenos: if fileno in BackboneInterface.spawned_interface_filenos:
try: BackboneInterface.epoll.modify(fileno, select.EPOLLOUT) try: BackboneInterface.epoll.modify(fileno, select.EPOLLOUT)
except Exception as e: except Exception as e:
RNS.log(f"Error occurred on {interface} while modifying socket EPOLL state: {e}", RNS.LOG_WARNING) if str(e).endswith("No such file or directory"): pass
elif str(e).endswith("Bad file descriptor"): pass
else: RNS.log(f"Error occurred on {interface} while modifying socket EPOLL state: {e}", RNS.LOG_WARNING)
raise e raise e
@staticmethod @staticmethod
@@ -302,7 +317,7 @@ class BackboneInterface(Interface):
if client_socket and fileno == client_socket.fileno() and (event & select.EPOLLIN): if client_socket and fileno == client_socket.fileno() and (event & select.EPOLLIN):
try: received_bytes = client_socket.recv(spawned_interface.HW_MTU) try: received_bytes = client_socket.recv(spawned_interface.HW_MTU)
except Exception as e: except Exception as e:
RNS.log(f"Error while reading from {spawned_interface}: {e}", RNS.LOG_DEBUG) RNS.log(f"Error while reading from {spawned_interface}: {e}", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
received_bytes = b"" received_bytes = b""
if len(received_bytes): spawned_interface.receive(received_bytes) if len(received_bytes): spawned_interface.receive(received_bytes)
@@ -325,7 +340,11 @@ class BackboneInterface(Interface):
try: written = client_socket.send(spawned_interface.transmit_buffer) try: written = client_socket.send(spawned_interface.transmit_buffer)
except Exception as e: except Exception as e:
written = 0 written = 0
if not spawned_interface.detached: RNS.log(f"Error while writing to {spawned_interface}: {e}", RNS.LOG_DEBUG) if not spawned_interface.detached:
if RNS.sl(RNS.LOG_DEBUG):
if str(e).endswith("Connection timed out"): pass
elif str(e).endswith("Connection reset by peer"): pass
else: RNS.log(f"Error while writing to {spawned_interface}: {e}", RNS.LOG_DEBUG)
BackboneInterface.deregister_fileno(fileno) BackboneInterface.deregister_fileno(fileno)
try: try:
@@ -399,8 +418,22 @@ class BackboneInterface(Interface):
BackboneInterface.deregister_listeners() BackboneInterface.deregister_listeners()
def incoming_connection(self, socket): def incoming_connection(self, socket):
RNS.log("Accepting incoming connection", RNS.LOG_VERBOSE)
try: try:
remote_ip = socket.getpeername()[0]
remote_port = str(socket.getpeername()[1])
if self.blocked_ip_count > 0:
with BackboneInterface.fast_flapping_lock:
if remote_ip in BackboneInterface.fast_flapping:
now = time.time()
ffe = BackboneInterface.fast_flapping[remote_ip]
started_flapping = ffe[0]
last_flap = ffe[1]
flaps = ffe[2]
if flaps > self.fast_flap_grace:
RNS.log(f"Ignoring incoming connection from fast-flapping IP {remote_ip}", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
return False
RNS.log("Accepting incoming connection", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
spawned_configuration = {"name": "Client on "+self.name, "target_host": None, "target_port": None} spawned_configuration = {"name": "Client on "+self.name, "target_host": None, "target_port": None}
spawned_interface = BackboneClientInterface(self.owner, spawned_configuration, connected_socket=socket) spawned_interface = BackboneClientInterface(self.owner, spawned_configuration, connected_socket=socket)
spawned_interface.OUT = self.OUT spawned_interface.OUT = self.OUT
@@ -421,8 +454,8 @@ class BackboneInterface(Interface):
spawned_interface.ic_pr_burst_freq = self.ic_pr_burst_freq spawned_interface.ic_pr_burst_freq = self.ic_pr_burst_freq
spawned_interface.socket = socket spawned_interface.socket = socket
spawned_interface.target_ip = socket.getpeername()[0] spawned_interface.target_ip = remote_ip
spawned_interface.target_port = str(socket.getpeername()[1]) spawned_interface.target_port = remote_port
spawned_interface.parent_interface = self spawned_interface.parent_interface = self
spawned_interface.bitrate = self.bitrate spawned_interface.bitrate = self.bitrate
spawned_interface.optimise_mtu() spawned_interface.optimise_mtu()
@@ -432,18 +465,12 @@ class BackboneInterface(Interface):
spawned_interface.ifac_netkey = self.ifac_netkey spawned_interface.ifac_netkey = self.ifac_netkey
if spawned_interface.ifac_netname != None or spawned_interface.ifac_netkey != None: if spawned_interface.ifac_netname != None or spawned_interface.ifac_netkey != None:
ifac_origin = b"" ifac_origin = b""
if spawned_interface.ifac_netname != None: if spawned_interface.ifac_netname != None: ifac_origin += RNS.Identity.full_hash(spawned_interface.ifac_netname.encode("utf-8"))
ifac_origin += RNS.Identity.full_hash(spawned_interface.ifac_netname.encode("utf-8")) if spawned_interface.ifac_netkey != None: ifac_origin += RNS.Identity.full_hash(spawned_interface.ifac_netkey.encode("utf-8"))
if spawned_interface.ifac_netkey != None:
ifac_origin += RNS.Identity.full_hash(spawned_interface.ifac_netkey.encode("utf-8"))
ifac_origin_hash = RNS.Identity.full_hash(ifac_origin) ifac_origin_hash = RNS.Identity.full_hash(ifac_origin)
spawned_interface.ifac_key = RNS.Cryptography.hkdf( spawned_interface.ifac_key = RNS.Cryptography.hkdf(length=64, derive_from=ifac_origin_hash,
length=64, salt=RNS.Reticulum.IFAC_SALT, context=None)
derive_from=ifac_origin_hash,
salt=RNS.Reticulum.IFAC_SALT,
context=None
)
spawned_interface.ifac_identity = RNS.Identity.from_bytes(spawned_interface.ifac_key) spawned_interface.ifac_identity = RNS.Identity.from_bytes(spawned_interface.ifac_key)
spawned_interface.ifac_signature = spawned_interface.ifac_identity.sign(RNS.Identity.full_hash(spawned_interface.ifac_key)) spawned_interface.ifac_signature = spawned_interface.ifac_identity.sign(RNS.Identity.full_hash(spawned_interface.ifac_key))
@@ -452,12 +479,13 @@ class BackboneInterface(Interface):
spawned_interface.announce_rate_penalty = self.announce_rate_penalty spawned_interface.announce_rate_penalty = self.announce_rate_penalty
spawned_interface.mode = self.mode spawned_interface.mode = self.mode
spawned_interface.HW_MTU = self.HW_MTU spawned_interface.HW_MTU = self.HW_MTU
spawned_interface.online = True RNS.log("Spawned new BackboneClient Interface: "+str(spawned_interface), RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
RNS.log("Spawned new BackboneClient Interface: "+str(spawned_interface), RNS.LOG_VERBOSE)
RNS.Transport.add_interface(spawned_interface) RNS.Transport.add_interface(spawned_interface)
while spawned_interface in self.spawned_interfaces: self.spawned_interfaces.remove(spawned_interface) while spawned_interface in self.spawned_interfaces: self.spawned_interfaces.remove(spawned_interface)
self.spawned_interfaces.append(spawned_interface) self.spawned_interfaces.append(spawned_interface)
BackboneInterface.add_client_socket(socket, spawned_interface) BackboneInterface.add_client_socket(socket, spawned_interface)
spawned_interface.spawned_at = time.time()
spawned_interface.online = True
except Exception as e: except Exception as e:
RNS.log(f"An error occurred while accepting incoming connection on {self}: {e}", RNS.LOG_ERROR) RNS.log(f"An error occurred while accepting incoming connection on {self}: {e}", RNS.LOG_ERROR)
@@ -491,15 +519,38 @@ class BackboneInterface(Interface):
if callable(listener_socket.shutdown): if callable(listener_socket.shutdown):
try: listener_socket.shutdown(socket.SHUT_RDWR) try: listener_socket.shutdown(socket.SHUT_RDWR)
except Exception as e: except Exception as e:
if str(e).endswith("Transport endpoint is not connected"): pass if str(e).endswith("Transport endpoint is not connected"): pass
elif str(e).endswith("Bad file descriptor"): pass
else: RNS.log("Error while shutting down socket for "+str(self)+": "+str(e), RNS.LOG_ERROR) else: RNS.log("Error while shutting down socket for "+str(self)+": "+str(e), RNS.LOG_ERROR)
def __str__(self): @property
if ":" in self.bind_ip: def blocked_ip_count(self):
ip_str = f"[{self.bind_ip}]" if not self.block_fast_flapping: return 0
else: else:
ip_str = f"{self.bind_ip}" count = 0
expired = []
now = time.time()
with BackboneInterface.fast_flapping_lock:
for remote_ip in BackboneInterface.fast_flapping:
ffe = BackboneInterface.fast_flapping[remote_ip]
started_flapping = ffe[0]
last_flap = ffe[1]
flaps = ffe[2]
if now - last_flap > self.fast_flap_expiry: expired.append(remote_ip)
elif flaps > self.fast_flap_grace: count += 1
for remote_ip in expired:
if remote_ip in BackboneInterface.fast_flapping:
try:
BackboneInterface.fast_flapping.pop(remote_ip)
RNS.log(f"Fast-flapping block expired for {remote_ip}", RNS.LOG_DEBUG)
except Exception as e: RNS.log(f"Error while expiring fast-flapping block for {remote_ip}: {e}", RNS.LOG_ERROR)
return count
def __str__(self):
if ":" in self.bind_ip: ip_str = f"[{self.bind_ip}]"
else: ip_str = f"{self.bind_ip}"
return "BackboneInterface["+self.name+"/"+ip_str+":"+str(self.bind_port)+"]" return "BackboneInterface["+self.name+"/"+ip_str+":"+str(self.bind_port)+"]"
@@ -710,6 +761,14 @@ class BackboneClientInterface(Interface):
RNS.log("The contained exception was: "+str(e), RNS.LOG_ERROR) RNS.log("The contained exception was: "+str(e), RNS.LOG_ERROR)
self.teardown() self.teardown()
def check_frame_len(self, frame_len):
if frame_len <= RNS.Reticulum.HEADER_MINSIZE: return False
elif frame_len > self.HW_MTU + (self.ifac_size or 0): return False
else: return True
def invalid_frame(self, frame_len):
RNS.log(f"Invalid HDLC frame of {RNS.prettysize(frame_len)} received on {self}, dropping frame", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None
def receive(self, data_in): def receive(self, data_in):
try: try:
if len(data_in) > 0: if len(data_in) > 0:
@@ -723,12 +782,18 @@ class BackboneClientInterface(Interface):
frame = self.frame_buffer[frame_start+1:frame_end] frame = self.frame_buffer[frame_start+1:frame_end]
frame = frame.replace(bytes([HDLC.ESC, HDLC.FLAG ^ HDLC.ESC_MASK]), bytes([HDLC.FLAG])) frame = frame.replace(bytes([HDLC.ESC, HDLC.FLAG ^ HDLC.ESC_MASK]), bytes([HDLC.FLAG]))
frame = frame.replace(bytes([HDLC.ESC, HDLC.ESC ^ HDLC.ESC_MASK]), bytes([HDLC.ESC])) frame = frame.replace(bytes([HDLC.ESC, HDLC.ESC ^ HDLC.ESC_MASK]), bytes([HDLC.ESC]))
if len(frame) > RNS.Reticulum.HEADER_MINSIZE: frame_len = len(frame)
self.process_incoming(frame) if frame_len != 0:
if self.check_frame_len(frame_len): self.process_incoming(frame)
else: self.invalid_frame(len(frame))
self.frame_buffer = self.frame_buffer[frame_end:] self.frame_buffer = self.frame_buffer[frame_end:]
else: else:
if len(self.frame_buffer) > self.HW_MTU*2: self.frame_buffer = b""
flags_remaining = False flags_remaining = False
else: else:
self.frame_buffer = b""
flags_remaining = False flags_remaining = False
else: else:
@@ -738,7 +803,7 @@ class BackboneClientInterface(Interface):
def job(): self.reconnect() def job(): self.reconnect()
threading.Thread(target=job, daemon=True).start() threading.Thread(target=job, daemon=True).start()
else: else:
RNS.log("The socket for remote client "+str(self)+" was closed.", RNS.LOG_DEBUG) RNS.log("The socket for remote client "+str(self)+" was closed.", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
self.teardown() self.teardown()
except Exception as e: except Exception as e:
@@ -755,11 +820,29 @@ class BackboneClientInterface(Interface):
def teardown(self): def teardown(self):
if self.initiator and not self.detached: if self.initiator and not self.detached:
RNS.log("The interface "+str(self)+" experienced an unrecoverable error and is being torn down. Restart Reticulum to attempt to open this interface again.", RNS.LOG_ERROR) RNS.log("The interface "+str(self)+" experienced an unrecoverable error and is being torn down. Restart Reticulum to attempt to open this interface again.", RNS.LOG_ERROR)
if RNS.Reticulum.panic_on_interface_error: if RNS.Reticulum.panic_on_interface_error: RNS.panic()
RNS.panic()
else: else:
RNS.log("The interface "+str(self)+" is being torn down.", RNS.LOG_VERBOSE) RNS.log("The interface "+str(self)+" is being torn down.", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
if self.parent_interface.block_fast_flapping and hasattr(self, "spawned_at"):
connected_time = time.time() - self.spawned_at
if connected_time < self.parent_interface.fast_flap_threshold:
try:
now = time.time()
remote_id = f"{self.target_ip}"
with BackboneInterface.fast_flapping_lock:
if remote_id in BackboneInterface.fast_flapping: ffe = BackboneInterface.fast_flapping[remote_id]
else: ffe = [now, now, 0]
ffe[1] = now
ffe[2] += 1
with BackboneInterface.fast_flapping_lock: BackboneInterface.fast_flapping[remote_id] = ffe
dt = now-ffe[0]; fff = ffe[2]/dt if dt > 0 else None
freq_str = f" at {RNS.prettyfrequency(fff)}" if fff else ""
RNS.log(f"{self} is fast flapping{freq_str}, connection time was {RNS.prettytime(connected_time)}, {ffe[2]} fast flaps", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None
if ffe[2] > self.parent_interface.fast_flap_grace: RNS.log(f"Ignoring further connections from {remote_id} due to fast-flapping", RNS.LOG_WARNING)
except Exception as e: RNS.log(f"Error while updating fast-flapping interface statistics: {e}", RNS.LOG_ERROR)
self.online = False self.online = False
self.OUT = False self.OUT = False
+19 -25
View File
@@ -48,10 +48,11 @@ class Interface:
MODE_ROAMING = 0x04 MODE_ROAMING = 0x04
MODE_BOUNDARY = 0x05 MODE_BOUNDARY = 0x05
MODE_GATEWAY = 0x06 MODE_GATEWAY = 0x06
MODE_INTERNAL = 0x07
# Which interface modes a Transport Node should # Which interface modes a Transport Node should
# actively discover paths for. # actively discover paths for.
DISCOVER_PATHS_FOR = [MODE_ACCESS_POINT, MODE_GATEWAY, MODE_ROAMING] DISCOVER_PATHS_FOR = [MODE_ACCESS_POINT, MODE_GATEWAY, MODE_ROAMING, MODE_INTERNAL]
# How many samples to use for announce # How many samples to use for announce
# frequency calculations # frequency calculations
@@ -106,6 +107,8 @@ class Interface:
self.discoverable = False self.discoverable = False
self.last_discovery_announce = 0 self.last_discovery_announce = 0
self.bootstrap_only = False self.bootstrap_only = False
self.recursive_prs = False
self.announces_from_internal = True
self.parent_interface = None self.parent_interface = None
self.spawned_interfaces = None self.spawned_interfaces = None
self.tunnel_id = None self.tunnel_id = None
@@ -197,36 +200,27 @@ class Interface:
def optimise_mtu(self): def optimise_mtu(self):
if self.AUTOCONFIGURE_MTU: if self.AUTOCONFIGURE_MTU:
if self.bitrate >= 1_000_000_000: if self.bitrate >= 1_000_000_000: self.HW_MTU = 524288
self.HW_MTU = 524288 elif self.bitrate > 750_000_000: self.HW_MTU = 262144
elif self.bitrate > 750_000_000: elif self.bitrate > 400_000_000: self.HW_MTU = 131072
self.HW_MTU = 262144 elif self.bitrate > 200_000_000: self.HW_MTU = 65536
elif self.bitrate > 400_000_000: elif self.bitrate > 100_000_000: self.HW_MTU = 32768
self.HW_MTU = 131072 elif self.bitrate > 10_000_000: self.HW_MTU = 16384
elif self.bitrate > 200_000_000: elif self.bitrate > 5_000_000: self.HW_MTU = 8192
self.HW_MTU = 65536 elif self.bitrate > 2_000_000: self.HW_MTU = 4096
elif self.bitrate > 100_000_000: elif self.bitrate > 1_000_000: self.HW_MTU = 2048
self.HW_MTU = 32768 elif self.bitrate > 62_500: self.HW_MTU = 1024
elif self.bitrate > 10_000_000: else: self.HW_MTU = None
self.HW_MTU = 16384
elif self.bitrate > 5_000_000:
self.HW_MTU = 8192
elif self.bitrate > 2_000_000:
self.HW_MTU = 4096
elif self.bitrate > 1_000_000:
self.HW_MTU = 2048
elif self.bitrate > 62_500:
self.HW_MTU = 1024
else:
self.HW_MTU = None
RNS.log(f"{self} hardware MTU set to {self.HW_MTU}", RNS.LOG_DEBUG) RNS.log(f"{self} hardware MTU set to {self.HW_MTU}", RNS.LOG_PATHING)
def age(self): def age(self):
return time.time()-self.created return time.time()-self.created
def hold_announce(self, announce_packet): def hold_announce(self, announce_packet):
if announce_packet.destination_hash in self.held_announces: if announce_packet.hops >= RNS.Transport.PATHFINDER_M-1:
return
elif announce_packet.destination_hash in self.held_announces:
self.held_announces[announce_packet.destination_hash] = announce_packet self.held_announces[announce_packet.destination_hash] = announce_packet
elif not len(self.held_announces) >= self.ic_max_held_announces: elif not len(self.held_announces) >= self.ic_max_held_announces:
self.held_announces[announce_packet.destination_hash] = announce_packet self.held_announces[announce_packet.destination_hash] = announce_packet
+15 -2
View File
@@ -333,6 +333,13 @@ class TCPClientInterface(Interface):
RNS.log("The contained exception was: "+str(e), RNS.LOG_ERROR) RNS.log("The contained exception was: "+str(e), RNS.LOG_ERROR)
self.teardown() self.teardown()
def check_frame_len(self, frame_len):
if frame_len <= RNS.Reticulum.HEADER_MINSIZE: return False
elif frame_len > self.HW_MTU + (self.ifac_size or 0): return False
else: return True
def invalid_frame(self, frame_len):
RNS.log(f"Invalid HDLC frame of {RNS.prettysize(frame_len)} received on {self}, dropping frame", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None
def read_loop(self): def read_loop(self):
try: try:
@@ -389,12 +396,18 @@ class TCPClientInterface(Interface):
frame = frame_buffer[frame_start+1:frame_end] frame = frame_buffer[frame_start+1:frame_end]
frame = frame.replace(bytes([HDLC.ESC, HDLC.FLAG ^ HDLC.ESC_MASK]), bytes([HDLC.FLAG])) frame = frame.replace(bytes([HDLC.ESC, HDLC.FLAG ^ HDLC.ESC_MASK]), bytes([HDLC.FLAG]))
frame = frame.replace(bytes([HDLC.ESC, HDLC.ESC ^ HDLC.ESC_MASK]), bytes([HDLC.ESC])) frame = frame.replace(bytes([HDLC.ESC, HDLC.ESC ^ HDLC.ESC_MASK]), bytes([HDLC.ESC]))
if len(frame) > RNS.Reticulum.HEADER_MINSIZE: frame_len = len(frame)
self.process_incoming(frame) if frame_len != 0:
if self.check_frame_len(frame_len): self.process_incoming(frame)
else: self.invalid_frame(len(frame))
frame_buffer = frame_buffer[frame_end:] frame_buffer = frame_buffer[frame_end:]
else: else:
if len(frame_buffer) > self.HW_MTU*2: frame_buffer = b""
flags_remaining = False flags_remaining = False
else: else:
frame_buffer = b""
flags_remaining = False flags_remaining = False
else: else:
+112 -130
View File
@@ -109,30 +109,30 @@ class WDCL():
self.switch_id = self.switch_identity.sig_pub_bytes[-4:] self.switch_id = self.switch_identity.sig_pub_bytes[-4:]
self.switch_pub_bytes = self.switch_identity.sig_pub_bytes self.switch_pub_bytes = self.switch_identity.sig_pub_bytes
self.rxb = 0 self.rxb = 0
self.txb = 0 self.txb = 0
self.owner = owner self.owner = owner
self.as_interface = as_interface self.as_interface = as_interface
self.device = device self.device = device
self.device.connection = self self.device.connection = self
self.pyserial = serial self.pyserial = serial
self.serial = None self.serial = None
self.port = port self.port = port
self.speed = 3000000 self.speed = 3000000
self.databits = 8 self.databits = 8
self.parity = parity self.parity = parity
self.stopbits = 1 self.stopbits = 1
self.timeout = 100 self.timeout = 100
self.online = False self.online = False
self.frame_buffer = b"" self.frame_buffer = b""
self.next_tx = 0 self.next_tx = 0
self.should_run = True self.should_run = True
self.receiver = None self.receiver = None
self.wdcl_connected = False self.wdcl_connected = False
self.reconnecting = False self.reconnecting = False
self.frame_queue = deque() self.frame_queue = deque()
if not self.as_interface:
self.id = RNS.Identity.full_hash(port.hwid.encode("utf-8")) if not self.as_interface: self.id = RNS.Identity.full_hash(port.hwid.encode("utf-8"))
if self.as_interface: if self.as_interface:
try: try:
@@ -168,19 +168,10 @@ class WDCL():
self.owner.wlog(f"Opening serial port {self.port.device}...") self.owner.wlog(f"Opening serial port {self.port.device}...")
target_port = self.port.device target_port = self.port.device
self.serial = self.pyserial.Serial( self.serial = self.pyserial.Serial(port = target_port, baudrate = self.speed,
port = target_port, bytesize = self.databits, parity = self.parity, stopbits = self.stopbits,
baudrate = self.speed, xonxoff = False, rtscts = False, timeout = 0.250, inter_byte_timeout = None,
bytesize = self.databits, write_timeout = None, dsrdtr = False)
parity = self.parity,
stopbits = self.stopbits,
xonxoff = False,
rtscts = False,
timeout = 0.250,
inter_byte_timeout = None,
write_timeout = None,
dsrdtr = False)
else: else:
if self.port != None: if self.port != None:
# Get device parameters # Get device parameters
@@ -198,19 +189,9 @@ class WDCL():
from usbserial4a.cdcacmserial4a import CdcAcmSerial from usbserial4a.cdcacmserial4a import CdcAcmSerial
proxy = CdcAcmSerial proxy = CdcAcmSerial
self.serial = proxy( self.serial = proxy(self.port, baudrate = self.speed, bytesize = self.databits,
self.port, parity = self.parity, stopbits = self.stopbits, xonxoff = False,
baudrate = self.speed, rtscts = False, timeout = None, inter_byte_timeout = None, dsrdtr = False)
bytesize = self.databits,
parity = self.parity,
stopbits = self.stopbits,
xonxoff = False,
rtscts = False,
timeout = None,
inter_byte_timeout = None,
# write_timeout = wtimeout,
dsrdtr = False,
)
if vid == 0x0403: if vid == 0x0403:
# Hardware parameters for FTDI devices @ 115200 baud # Hardware parameters for FTDI devices @ 115200 baud
@@ -299,10 +280,9 @@ class WDCL():
frame = frame.replace(bytes([HDLC.ESC, HDLC.ESC ^ HDLC.ESC_MASK]), bytes([HDLC.ESC])) frame = frame.replace(bytes([HDLC.ESC, HDLC.ESC ^ HDLC.ESC_MASK]), bytes([HDLC.ESC]))
if len(frame) > WDCL.HEADER_MINSIZE: self.process_incoming(frame) if len(frame) > WDCL.HEADER_MINSIZE: self.process_incoming(frame)
self.frame_buffer = self.frame_buffer[frame_end:] self.frame_buffer = self.frame_buffer[frame_end:]
else:
flags_remaining = False else: flags_remaining = False
else: else: flags_remaining = False
flags_remaining = False
except Exception as e: except Exception as e:
self.online = False self.online = False
@@ -359,6 +339,7 @@ class Evt():
ET_MSG = 0x0000 ET_MSG = 0x0000
ET_SYSTEM_BOOT = 0x0001 ET_SYSTEM_BOOT = 0x0001
ET_CORE_INIT = 0x0002 ET_CORE_INIT = 0x0002
ET_BOARD_INIT = 0x0003
ET_DRV_UART_INIT = 0x1000 ET_DRV_UART_INIT = 0x1000
ET_DRV_USB_CDC_INIT = 0x1010 ET_DRV_USB_CDC_INIT = 0x1010
ET_DRV_USB_CDC_HOST_AVAIL = 0x1011 ET_DRV_USB_CDC_HOST_AVAIL = 0x1011
@@ -426,77 +407,78 @@ class Evt():
IF_TYPE_DMA = 0x10 IF_TYPE_DMA = 0x10
event_descriptions = { event_descriptions = {
ET_SYSTEM_BOOT: "System boot", ET_SYSTEM_BOOT: "System boot",
ET_CORE_INIT: "Core initialization", ET_CORE_INIT: "Core initialization",
ET_DRV_UART_INIT: "UART driver initialization", ET_BOARD_INIT: "Board hardware initialization",
ET_DRV_USB_CDC_INIT: "USB CDC driver initialization", ET_DRV_UART_INIT: "UART driver initialization",
ET_DRV_USB_CDC_HOST_AVAIL: "USB CDC host became available", ET_DRV_USB_CDC_INIT: "USB CDC driver initialization",
ET_DRV_USB_CDC_HOST_SUSPEND: "USB CDC host suspend", ET_DRV_USB_CDC_HOST_AVAIL: "USB CDC host became available",
ET_DRV_USB_CDC_HOST_RESUME: "USB CDC host resume", ET_DRV_USB_CDC_HOST_SUSPEND: "USB CDC host suspend",
ET_DRV_USB_CDC_CONNECTED: "USB CDC host connection", ET_DRV_USB_CDC_HOST_RESUME: "USB CDC host resume",
ET_DRV_USB_CDC_READ_ERR: "USB CDC read error", ET_DRV_USB_CDC_CONNECTED: "USB CDC host connection",
ET_DRV_USB_CDC_OVERFLOW: "USB CDC overflow occurred", ET_DRV_USB_CDC_READ_ERR: "USB CDC read error",
ET_DRV_USB_CDC_DROPPED: "USB CDC dropped bytes", ET_DRV_USB_CDC_OVERFLOW: "USB CDC overflow occurred",
ET_DRV_USB_CDC_TX_TIMEOUT: "USB CDC TX flush timeout", ET_DRV_USB_CDC_DROPPED: "USB CDC dropped bytes",
ET_DRV_I2C_INIT: "I2C driver initialization", ET_DRV_USB_CDC_TX_TIMEOUT: "USB CDC TX flush timeout",
ET_DRV_NVS_INIT: "NVS driver initialization", ET_DRV_I2C_INIT: "I2C driver initialization",
ET_DRV_CRYPTO_INIT: "Cryptography driver initialization", ET_DRV_NVS_INIT: "NVS driver initialization",
ET_DRV_W80211_INIT: "W802.11 driver initialization", ET_DRV_CRYPTO_INIT: "Cryptography driver initialization",
ET_DRV_W80211_CHANNEL: "W802.11 channel configuration", ET_DRV_W80211_INIT: "W802.11 driver initialization",
ET_DRV_W80211_POWER: "W802.11 TX power configuration", ET_DRV_W80211_CHANNEL: "W802.11 channel configuration",
ET_DRV_DISPLAY_INIT: "Display driver initialization", ET_DRV_W80211_POWER: "W802.11 TX power configuration",
ET_DRV_DISPLAY_INIT: "Display driver initialization",
ET_DRV_DISPLAY_BUS_AVAILABLE: "Display bus availability", ET_DRV_DISPLAY_BUS_AVAILABLE: "Display bus availability",
ET_DRV_DISPLAY_IO_CONFIGURED: "Display I/O configuration", ET_DRV_DISPLAY_IO_CONFIGURED: "Display I/O configuration",
ET_DRV_DISPLAY_PANEL_CREATED: "Display panel allocation", ET_DRV_DISPLAY_PANEL_CREATED: "Display panel allocation",
ET_DRV_DISPLAY_PANEL_RESET: "Display panel reset", ET_DRV_DISPLAY_PANEL_RESET: "Display panel reset",
ET_DRV_DISPLAY_PANEL_INIT: "Display panel initialization", ET_DRV_DISPLAY_PANEL_INIT: "Display panel initialization",
ET_DRV_DISPLAY_PANEL_ENABLE: "Display panel activation", ET_DRV_DISPLAY_PANEL_ENABLE: "Display panel activation",
ET_DRV_DISPLAY_REMOTE_ENABLE: "Remote display output activation", ET_DRV_DISPLAY_REMOTE_ENABLE: "Remote display output activation",
ET_KRN_LOGGER_INIT: "Logging service initialization", ET_KRN_LOGGER_INIT: "Logging service initialization",
ET_KRN_LOGGER_OUTPUT: "Logging service output activation", ET_KRN_LOGGER_OUTPUT: "Logging service output activation",
ET_KRN_UI_INIT: "User interface service initialization", ET_KRN_UI_INIT: "User interface service initialization",
ET_PROTO_WDCL_INIT: "WDCL protocol initialization", ET_PROTO_WDCL_INIT: "WDCL protocol initialization",
ET_PROTO_WDCL_RUNNING: "WDCL protocol activation", ET_PROTO_WDCL_RUNNING: "WDCL protocol activation",
ET_PROTO_WDCL_CONNECTION: "WDCL host connection", ET_PROTO_WDCL_CONNECTION: "WDCL host connection",
ET_PROTO_WDCL_HOST_ENDPOINT: "Weave host endpoint", ET_PROTO_WDCL_HOST_ENDPOINT: "Weave host endpoint",
ET_PROTO_WEAVE_INIT: "Weave protocol initialization", ET_PROTO_WEAVE_INIT: "Weave protocol initialization",
ET_PROTO_WEAVE_RUNNING: "Weave protocol activation", ET_PROTO_WEAVE_RUNNING: "Weave protocol activation",
ET_PROTO_WEAVE_EP_ALIVE: "Weave endpoint alive", ET_PROTO_WEAVE_EP_ALIVE: "Weave endpoint alive",
ET_PROTO_WEAVE_EP_TIMEOUT: "Weave endpoint disappeared", ET_PROTO_WEAVE_EP_TIMEOUT: "Weave endpoint disappeared",
ET_SRVCTL_REMOTE_DISPLAY: "Remote display service control event", ET_SRVCTL_REMOTE_DISPLAY: "Remote display service control event",
ET_INTERFACE_REGISTERED: "Interface registration", ET_INTERFACE_REGISTERED: "Interface registration",
ET_SYSERR_MEM_EXHAUSTED: "System memory exhausted", ET_SYSERR_MEM_EXHAUSTED: "System memory exhausted",
} }
interface_types = { interface_types = {
IF_TYPE_USB: "usb", IF_TYPE_USB: "usb",
IF_TYPE_UART: "uart", IF_TYPE_UART: "uart",
IF_TYPE_W80211: "mw", IF_TYPE_W80211: "mw",
IF_TYPE_BLE: "ble", IF_TYPE_BLE: "ble",
IF_TYPE_LORA: "lora", IF_TYPE_LORA: "lora",
IF_TYPE_ETHERNET: "eth", IF_TYPE_ETHERNET: "eth",
IF_TYPE_WIFI: "wifi", IF_TYPE_WIFI: "wifi",
IF_TYPE_TCP: "tcp", IF_TYPE_TCP: "tcp",
IF_TYPE_UDP: "udp", IF_TYPE_UDP: "udp",
IF_TYPE_IR: "ir", IF_TYPE_IR: "ir",
IF_TYPE_AFSK: "afsk", IF_TYPE_AFSK: "afsk",
IF_TYPE_GPIO: "gpio", IF_TYPE_GPIO: "gpio",
IF_TYPE_SPI: "spi", IF_TYPE_SPI: "spi",
IF_TYPE_I2C: "i2c", IF_TYPE_I2C: "i2c",
IF_TYPE_CAN: "can", IF_TYPE_CAN: "can",
IF_TYPE_DMA: "dma", IF_TYPE_DMA: "dma",
} }
channel_descriptions = { channel_descriptions = {
1: "Channel 1 (2412 MHz)", 1: "Channel 1 (2412 MHz)",
2: "Channel 2 (2417 MHz)", 2: "Channel 2 (2417 MHz)",
3: "Channel 3 (2422 MHz)", 3: "Channel 3 (2422 MHz)",
4: "Channel 4 (2427 MHz)", 4: "Channel 4 (2427 MHz)",
5: "Channel 5 (2432 MHz)", 5: "Channel 5 (2432 MHz)",
6: "Channel 6 (2437 MHz)", 6: "Channel 6 (2437 MHz)",
7: "Channel 7 (2442 MHz)", 7: "Channel 7 (2442 MHz)",
8: "Channel 8 (2447 MHz)", 8: "Channel 8 (2447 MHz)",
9: "Channel 9 (2452 MHz)", 9: "Channel 9 (2452 MHz)",
10: "Channel 10 (2457 MHz)", 10: "Channel 10 (2457 MHz)",
11: "Channel 11 (2462 MHz)", 11: "Channel 11 (2462 MHz)",
12: "Channel 12 (2467 MHz)", 12: "Channel 12 (2467 MHz)",
@@ -529,23 +511,23 @@ class Evt():
} }
task_descriptions = { task_descriptions = {
"taskLVGL": "Driver: UI Renderer", "taskLVGL": "Driver: UI Renderer",
"ui_service": "Service: User Interface", "ui_service": "Service: User Interface",
"TinyUSB": "Driver: USB", "TinyUSB": "Driver: USB",
"drv_w80211": "Driver: W802.11", "drv_w80211": "Driver: W802.11",
"system_stats": "System: Stats", "system_stats": "System: Stats",
"core": "System: Core", "core": "System: Core",
"protocol_wdcl": "Protocol: WDCL", "protocol_wdcl": "Protocol: WDCL",
"protocol_weave": "Protocol: Weave", "protocol_weave": "Protocol: Weave",
"tiT": "Protocol: TCP/IP", "tiT": "Protocol: TCP/IP",
"ipc0": "System: CPU 0 IPC", "ipc0": "System: CPU 0 IPC",
"ipc1": "System: CPU 1 IPC", "ipc1": "System: CPU 1 IPC",
"esp_timer": "Driver: Timers", "esp_timer": "Driver: Timers",
"Tmr Svc": "Service: Timers", "Tmr Svc": "Service: Timers",
"kernel_logger": "Service: Logging", "kernel_logger": "Service: Logging",
"remote_display": "Service: Remote Display", "remote_display": "Service: Remote Display",
"wifi": "System: WiFi Hardware", "wifi": "System: WiFi Hardware",
"sys_evt": "System: Kernel Events", "sys_evt": "System: Kernel Events",
} }
@staticmethod @staticmethod
@@ -775,8 +757,8 @@ class WeaveDevice():
self.cpu_load = frame.data[0] self.cpu_load = frame.data[0]
self.capture_stats_cpu() self.capture_stats_cpu()
elif frame.event == Evt.ET_STAT_MEMORY: elif frame.event == Evt.ET_STAT_MEMORY:
self.memory_free = int.from_bytes(frame.data[:4]) self.memory_free = int.from_bytes(frame.data[:4], "big")
self.memory_total = int.from_bytes(frame.data[4:]) self.memory_total = int.from_bytes(frame.data[4:], "big")
self.memory_used = self.memory_total-self.memory_free self.memory_used = self.memory_total-self.memory_free
self.memory_used_pct = round((self.memory_used/self.memory_total)*100, 2) self.memory_used_pct = round((self.memory_used/self.memory_total)*100, 2)
self.capture_stats_memory() self.capture_stats_memory()
+118 -189
View File
@@ -191,8 +191,7 @@ class Link:
if len(data) == Link.ECPUBSIZE+Link.LINK_MTU_SIZE: if len(data) == Link.ECPUBSIZE+Link.LINK_MTU_SIZE:
RNS.log("Link request includes MTU signalling", RNS.LOG_DEBUG) # TODO: Remove debug RNS.log("Link request includes MTU signalling", RNS.LOG_DEBUG) # TODO: Remove debug
try: try: link.mtu = Link.mtu_from_lr_packet(packet) or Reticulum.MTU
link.mtu = Link.mtu_from_lr_packet(packet) or Reticulum.MTU
except Exception as e: except Exception as e:
RNS.trace_exception(e) RNS.trace_exception(e)
link.mtu = RNS.Reticulum.MTU link.mtu = RNS.Reticulum.MTU
@@ -277,6 +276,7 @@ class Link:
self.initiator = False self.initiator = False
self.prv = X25519PrivateKey.generate() self.prv = X25519PrivateKey.generate()
self.sig_prv = self.owner.identity.sig_prv self.sig_prv = self.owner.identity.sig_prv
else: else:
self.initiator = True self.initiator = True
self.expected_hops = RNS.Transport.hops_to(self.destination.hash) self.expected_hops = RNS.Transport.hops_to(self.destination.hash)
@@ -296,14 +296,11 @@ class Link:
if peer_pub_bytes == None: if peer_pub_bytes == None:
self.peer_pub = None self.peer_pub = None
self.peer_pub_bytes = None self.peer_pub_bytes = None
else:
self.load_peer(peer_pub_bytes, peer_sig_pub_bytes)
if established_callback != None: else: self.load_peer(peer_pub_bytes, peer_sig_pub_bytes)
self.set_link_established_callback(established_callback)
if closed_callback != None: if established_callback != None: self.set_link_established_callback(established_callback)
self.set_link_closed_callback(closed_callback) if closed_callback != None: self.set_link_closed_callback(closed_callback)
if self.initiator: if self.initiator:
signalling_bytes = b"" signalling_bytes = b""
@@ -334,8 +331,7 @@ class Link:
self.peer_sig_pub_bytes = peer_sig_pub_bytes self.peer_sig_pub_bytes = peer_sig_pub_bytes
self.peer_sig_pub = Ed25519PublicKey.from_public_bytes(self.peer_sig_pub_bytes) self.peer_sig_pub = Ed25519PublicKey.from_public_bytes(self.peer_sig_pub_bytes)
if not hasattr(self.peer_pub, "curve"): if not hasattr(self.peer_pub, "curve"): self.peer_pub.curve = Link.CURVE
self.peer_pub.curve = Link.CURVE
@staticmethod @staticmethod
def link_id_from_lr_packet(packet): def link_id_from_lr_packet(packet):
@@ -447,8 +443,8 @@ class Link:
thread = threading.Thread(target=self.callbacks.link_established, args=(self,)) thread = threading.Thread(target=self.callbacks.link_established, args=(self,))
thread.daemon = True thread.daemon = True
thread.start() thread.start()
else:
RNS.log("Invalid link proof signature received by "+str(self)+". Ignoring.", RNS.LOG_DEBUG) else: RNS.log("Invalid link proof signature received by "+str(self)+". Ignoring.", RNS.LOG_DEBUG)
except Exception as e: except Exception as e:
self.status = Link.CLOSED self.status = Link.CLOSED
@@ -497,35 +493,21 @@ class Link:
request_packet = RNS.Packet(self, packed_request, RNS.Packet.DATA, context = RNS.Packet.REQUEST) request_packet = RNS.Packet(self, packed_request, RNS.Packet.DATA, context = RNS.Packet.REQUEST)
packet_receipt = request_packet.send() packet_receipt = request_packet.send()
if packet_receipt == False: if packet_receipt == False: return False
return False
else: else:
packet_receipt.set_timeout(timeout) packet_receipt.set_timeout(timeout)
return RequestReceipt( return RequestReceipt(self, packet_receipt = packet_receipt, response_callback = response_callback,
self, failed_callback = failed_callback, progress_callback = progress_callback,
packet_receipt = packet_receipt, timeout = timeout, request_size = len(packed_request))
response_callback = response_callback,
failed_callback = failed_callback,
progress_callback = progress_callback,
timeout = timeout,
request_size = len(packed_request),
)
else: else:
request_id = RNS.Identity.truncated_hash(packed_request) request_id = RNS.Identity.truncated_hash(packed_request)
RNS.log("Sending request "+RNS.prettyhexrep(request_id)+" as resource.", RNS.LOG_DEBUG) RNS.log("Sending request "+RNS.prettyhexrep(request_id)+" as resource.", RNS.LOG_DEBUG)
request_resource = RNS.Resource(packed_request, self, request_id = request_id, is_response = False, timeout = timeout) request_resource = RNS.Resource(packed_request, self, request_id = request_id, is_response = False, timeout = timeout)
return RequestReceipt( return RequestReceipt(self, resource = request_resource, response_callback = response_callback,
self, failed_callback = failed_callback, progress_callback = progress_callback,
resource = request_resource, timeout = timeout, request_size = len(packed_request))
response_callback = response_callback,
failed_callback = failed_callback,
progress_callback = progress_callback,
timeout = timeout,
request_size = len(packed_request),
)
def update_mdu(self): def update_mdu(self):
self.mdu = self.mtu - RNS.Reticulum.HEADER_MAXSIZE - RNS.Reticulum.IFAC_MIN_SIZE self.mdu = self.mtu - RNS.Reticulum.HEADER_MAXSIZE - RNS.Reticulum.IFAC_MIN_SIZE
@@ -540,6 +522,7 @@ class Link:
self.rtt = max(measured_rtt, rtt) self.rtt = max(measured_rtt, rtt)
self.status = Link.ACTIVE self.status = Link.ACTIVE
self.activated_at = time.time() self.activated_at = time.time()
self.expected_hops = packet.hops
if self.rtt != None and self.establishment_cost != None and self.rtt > 0 and self.establishment_cost > 0: if self.rtt != None and self.establishment_cost != None and self.rtt > 0 and self.establishment_cost > 0:
self.establishment_rate = self.establishment_cost/self.rtt self.establishment_rate = self.establishment_cost/self.rtt
@@ -547,10 +530,8 @@ class Link:
self.__update_keepalive() self.__update_keepalive()
try: try:
if self.owner.callbacks.link_established != None: if self.owner.callbacks.link_established != None: self.owner.callbacks.link_established(self)
self.owner.callbacks.link_established(self) except Exception as e: RNS.log("Error occurred in external link establishment callback. The contained exception was: "+str(e), RNS.LOG_ERROR)
except Exception as e:
RNS.log("Error occurred in external link establishment callback. The contained exception was: "+str(e), RNS.LOG_ERROR)
except Exception as e: except Exception as e:
RNS.log("Error occurred while processing RTT packet, tearing down link. The contained exception was: "+str(e), RNS.LOG_ERROR) RNS.log("Error occurred while processing RTT packet, tearing down link. The contained exception was: "+str(e), RNS.LOG_ERROR)
@@ -565,73 +546,57 @@ class Link:
:param track: Whether or not to keep track of physical layer statistics. Value must be ``True`` or ``False``. :param track: Whether or not to keep track of physical layer statistics. Value must be ``True`` or ``False``.
""" """
if track: if track: self.__track_phy_stats = True
self.__track_phy_stats = True else: self.__track_phy_stats = False
else:
self.__track_phy_stats = False
def get_rssi(self): def get_rssi(self):
""" """
:returns: The physical layer *Received Signal Strength Indication* if available, otherwise ``None``. Physical layer statistics must be enabled on the link for this method to return a value. :returns: The physical layer *Received Signal Strength Indication* if available, otherwise ``None``. Physical layer statistics must be enabled on the link for this method to return a value.
""" """
if self.__track_phy_stats: if self.__track_phy_stats: return self.rssi
return self.rssi else: return None
else:
return None
def get_snr(self): def get_snr(self):
""" """
:returns: The physical layer *Signal-to-Noise Ratio* if available, otherwise ``None``. Physical layer statistics must be enabled on the link for this method to return a value. :returns: The physical layer *Signal-to-Noise Ratio* if available, otherwise ``None``. Physical layer statistics must be enabled on the link for this method to return a value.
""" """
if self.__track_phy_stats: if self.__track_phy_stats: return self.snr
return self.snr else: return None
else:
return None
def get_q(self): def get_q(self):
""" """
:returns: The physical layer *Link Quality* if available, otherwise ``None``. Physical layer statistics must be enabled on the link for this method to return a value. :returns: The physical layer *Link Quality* if available, otherwise ``None``. Physical layer statistics must be enabled on the link for this method to return a value.
""" """
if self.__track_phy_stats: if self.__track_phy_stats: return self.q
return self.q else: return None
else:
return None
def get_establishment_rate(self): def get_establishment_rate(self):
""" """
:returns: The data transfer rate at which the link establishment procedure ocurred, in bits per second. :returns: The data transfer rate at which the link establishment procedure ocurred, in bits per second.
""" """
if self.establishment_rate != None: if self.establishment_rate != None: return self.establishment_rate*8
return self.establishment_rate*8 else: return None
else:
return None
def get_mtu(self): def get_mtu(self):
""" """
:returns: The MTU of an established link. :returns: The MTU of an established link.
""" """
if self.status == Link.ACTIVE: if self.status == Link.ACTIVE: return self.mtu
return self.mtu else: return None
else:
return None
def get_mdu(self): def get_mdu(self):
""" """
:returns: The packet MDU of an established link. :returns: The packet MDU of an established link.
""" """
if self.status == Link.ACTIVE: if self.status == Link.ACTIVE: return self.mdu
return self.mdu else: return None
else:
return None
def get_expected_rate(self): def get_expected_rate(self):
""" """
:returns: The packet expected in-flight data rate of an established link. :returns: The packet expected in-flight data rate of an established link.
""" """
if self.status == Link.ACTIVE: if self.status == Link.ACTIVE: return self.expected_rate
return self.expected_rate else: return None
else:
return None
def get_mode(self): def get_mode(self):
""" """
@@ -649,10 +614,8 @@ class Link:
""" """
:returns: The time in seconds since this link was established. :returns: The time in seconds since this link was established.
""" """
if self.activated_at: if self.activated_at: return time.time() - self.activated_at
return time.time() - self.activated_at else: return None
else:
return None
def no_inbound_for(self): def no_inbound_for(self):
""" """
@@ -701,6 +664,7 @@ class Link:
Closes the link and purges encryption keys. New keys will Closes the link and purges encryption keys. New keys will
be used if a new link to the same destination is established. be used if a new link to the same destination is established.
""" """
if self.status == Link.CLOSED: return
if self.status != Link.PENDING and self.status != Link.CLOSED: self.__teardown_packet() if self.status != Link.PENDING and self.status != Link.CLOSED: self.__teardown_packet()
self.status = Link.CLOSED self.status = Link.CLOSED
if self.initiator: self.teardown_reason = Link.INITIATOR_CLOSED if self.initiator: self.teardown_reason = Link.INITIATOR_CLOSED
@@ -712,14 +676,11 @@ class Link:
plaintext = self.decrypt(packet.data) plaintext = self.decrypt(packet.data)
if plaintext == self.link_id: if plaintext == self.link_id:
self.status = Link.CLOSED self.status = Link.CLOSED
if self.initiator: if self.initiator: self.teardown_reason = Link.DESTINATION_CLOSED
self.teardown_reason = Link.DESTINATION_CLOSED else: self.teardown_reason = Link.INITIATOR_CLOSED
else:
self.teardown_reason = Link.INITIATOR_CLOSED
self.__update_phy_stats(packet) self.__update_phy_stats(packet)
self.link_closed() self.link_closed()
except Exception as e: except Exception as e: pass
pass
def link_closed(self): def link_closed(self):
for resource in self.incoming_resources: resource.cancel() for resource in self.incoming_resources: resource.cancel()
@@ -752,9 +713,7 @@ class Link:
while not self.status == Link.CLOSED: while not self.status == Link.CLOSED:
while (self.watchdog_lock): while (self.watchdog_lock):
rtt_wait = 0.025 rtt_wait = 0.025
if hasattr(self, "rtt") and self.rtt: if hasattr(self, "rtt") and self.rtt: rtt_wait = self.rtt
rtt_wait = self.rtt
sleep(max(rtt_wait, 0.025)) sleep(max(rtt_wait, 0.025))
if not self.status == Link.CLOSED: if not self.status == Link.CLOSED:
@@ -779,10 +738,8 @@ class Link:
self.link_closed() self.link_closed()
sleep_time = 0.001 sleep_time = 0.001
if self.initiator: if self.initiator: RNS.log("Timeout waiting for link request proof", RNS.LOG_DEBUG)
RNS.log("Timeout waiting for link request proof", RNS.LOG_DEBUG) else: RNS.log("Timeout waiting for RTT packet from link initiator", RNS.LOG_DEBUG)
else:
RNS.log("Timeout waiting for RTT packet from link initiator", RNS.LOG_DEBUG)
elif self.status == Link.ACTIVE: elif self.status == Link.ACTIVE:
activated_at = self.activated_at if self.activated_at != None else 0 activated_at = self.activated_at if self.activated_at != None else 0
@@ -796,11 +753,10 @@ class Link:
if time.time() >= last_inbound + self.stale_time: if time.time() >= last_inbound + self.stale_time:
sleep_time = self.rtt * self.keepalive_timeout_factor + Link.STALE_GRACE sleep_time = self.rtt * self.keepalive_timeout_factor + Link.STALE_GRACE
self.status = Link.STALE self.status = Link.STALE
else:
sleep_time = self.keepalive else: sleep_time = self.keepalive
else: else: sleep_time = (last_inbound + self.keepalive) - time.time()
sleep_time = (last_inbound + self.keepalive) - time.time()
elif self.status == Link.STALE: elif self.status == Link.STALE:
sleep_time = 0.001 sleep_time = 0.001
@@ -810,8 +766,7 @@ class Link:
self.link_closed() self.link_closed()
if sleep_time == 0: if sleep_time == 0: RNS.log("Warning! Link watchdog sleep time of 0!", RNS.LOG_ERROR)
RNS.log("Warning! Link watchdog sleep time of 0!", RNS.LOG_ERROR)
if sleep_time == None or sleep_time < 0: if sleep_time == None or sleep_time < 0:
RNS.log("Timing error! Tearing down link "+str(self)+" now.", RNS.LOG_ERROR) RNS.log("Timing error! Tearing down link "+str(self)+" now.", RNS.LOG_ERROR)
self.teardown() self.teardown()
@@ -825,7 +780,6 @@ class Link:
self.snr = None self.snr = None
self.q = None self.q = None
def __update_phy_stats(self, packet, query_shared = True, force_update = False): def __update_phy_stats(self, packet, query_shared = True, force_update = False):
if self.__track_phy_stats or force_update: if self.__track_phy_stats or force_update:
if query_shared: if query_shared:
@@ -834,12 +788,9 @@ class Link:
if packet.snr == None: packet.snr = reticulum.get_packet_snr(packet.packet_hash) if packet.snr == None: packet.snr = reticulum.get_packet_snr(packet.packet_hash)
if packet.q == None: packet.q = reticulum.get_packet_q(packet.packet_hash) if packet.q == None: packet.q = reticulum.get_packet_q(packet.packet_hash)
if packet.rssi != None: if packet.rssi != None: self.rssi = packet.rssi
self.rssi = packet.rssi if packet.snr != None: self.snr = packet.snr
if packet.snr != None: if packet.q != None: self.q = packet.q
self.snr = packet.snr
if packet.q != None:
self.q = packet.q
def __update_keepalive(self): def __update_keepalive(self):
self.keepalive = max(min(self.rtt*(Link.KEEPALIVE_MAX/Link.KEEPALIVE_MAX_RTT), Link.KEEPALIVE_MAX), Link.KEEPALIVE_MIN) self.keepalive = max(min(self.rtt*(Link.KEEPALIVE_MAX/Link.KEEPALIVE_MAX_RTT), Link.KEEPALIVE_MAX), Link.KEEPALIVE_MIN)
@@ -857,7 +808,7 @@ class Link:
request_data = unpacked_request[2] request_data = unpacked_request[2]
if path_hash in self.destination.request_handlers: if path_hash in self.destination.request_handlers:
request_handler = self.destination.request_handlers[path_hash] request_handler = self.destination.request_handlers[path_hash]
path = request_handler[0] path = request_handler[0]
response_generator = request_handler[1] response_generator = request_handler[1]
allow = request_handler[2] allow = request_handler[2]
@@ -933,8 +884,8 @@ class Link:
def job(): self.handle_request(request_id, request_data) def job(): self.handle_request(request_id, request_data)
threading.Thread(target=job, daemon=True).start() threading.Thread(target=job, daemon=True).start()
else:
RNS.log("Incoming request resource failed with status: "+RNS.hexrep([resource.status]), RNS.LOG_DEBUG) else: RNS.log("Incoming request resource failed with status: "+RNS.hexrep([resource.status]), RNS.LOG_DEBUG)
def response_resource_concluded(self, resource): def response_resource_concluded(self, resource):
if resource.status == RNS.Resource.COMPLETE: if resource.status == RNS.Resource.COMPLETE:
@@ -965,8 +916,7 @@ class Link:
:return: ``Channel`` object :return: ``Channel`` object
""" """
if self._channel is None: if self._channel is None: self._channel = Channel(LinkChannelOutlet(self))
self._channel = Channel(LinkChannelOutlet(self))
return self._channel return self._channel
def receive(self, packet): def receive(self, packet):
@@ -976,12 +926,10 @@ class Link:
RNS.log(f"Link-associated packet received on unexpected interface {packet.receiving_interface} instead of {self.attached_interface}! Someone might be trying to manipulate your communication!", RNS.LOG_ERROR) RNS.log(f"Link-associated packet received on unexpected interface {packet.receiving_interface} instead of {self.attached_interface}! Someone might be trying to manipulate your communication!", RNS.LOG_ERROR)
else: else:
self.last_inbound = time.time() self.last_inbound = time.time()
if packet.context != RNS.Packet.KEEPALIVE: if packet.context != RNS.Packet.KEEPALIVE: self.last_data = self.last_inbound
self.last_data = self.last_inbound
self.rx += 1 self.rx += 1
self.rxbytes += len(packet.data) self.rxbytes += len(packet.data)
if self.status == Link.STALE: if self.status == Link.STALE: self.status = Link.ACTIVE
self.status = Link.ACTIVE
if packet.packet_type == RNS.Packet.DATA: if packet.packet_type == RNS.Packet.DATA:
should_query = False should_query = False
@@ -1002,10 +950,8 @@ class Link:
elif self.destination.proof_strategy == RNS.Destination.PROVE_APP: elif self.destination.proof_strategy == RNS.Destination.PROVE_APP:
if self.destination.callbacks.proof_requested: if self.destination.callbacks.proof_requested:
try: try:
if self.destination.callbacks.proof_requested(packet): if self.destination.callbacks.proof_requested(packet): packet.prove()
packet.prove() except Exception as e: RNS.log("Error while executing proof request callback from "+str(self)+". The contained exception was: "+str(e), RNS.LOG_ERROR)
except Exception as e:
RNS.log("Error while executing proof request callback from "+str(self)+". The contained exception was: "+str(e), RNS.LOG_ERROR)
elif packet.context == RNS.Packet.LINKIDENTIFY: elif packet.context == RNS.Packet.LINKIDENTIFY:
plaintext = self.decrypt(packet.data) plaintext = self.decrypt(packet.data)
@@ -1018,12 +964,16 @@ class Link:
identity.load_public_key(public_key) identity.load_public_key(public_key)
if identity.validate(signature, signed_data): if identity.validate(signature, signed_data):
self.__remote_identity = identity if RNS.Reticulum.get_instance().is_blackholed(identity.hash):
if self.callbacks.remote_identified != None: RNS.log(f"Terminating incoming link from blackholed identity {RNS.prettyhexrep(identity.hash)}", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None
try: self.teardown()
self.callbacks.remote_identified(self, self.__remote_identity)
except Exception as e: else:
RNS.log("Error while executing remote identified callback from "+str(self)+". The contained exception was: "+str(e), RNS.LOG_ERROR) if self.__remote_identity == None:
self.__remote_identity = identity
if self.callbacks.remote_identified != None:
try: self.callbacks.remote_identified(self, self.__remote_identity)
except Exception as e: RNS.log(f"Error while executing remote identified callback from {self}. The contained exception was: "+str(e), RNS.LOG_ERROR)
self.__update_phy_stats(packet, query_shared=True) self.__update_phy_stats(packet, query_shared=True)
@@ -1036,8 +986,7 @@ class Link:
def job(): self.handle_request(request_id, unpacked_request) def job(): self.handle_request(request_id, unpacked_request)
threading.Thread(target=job, daemon=True).start() threading.Thread(target=job, daemon=True).start()
self.__update_phy_stats(packet, query_shared=True) self.__update_phy_stats(packet, query_shared=True)
except Exception as e: except Exception as e: RNS.log("Error occurred while handling request. The contained exception was: "+str(e), RNS.LOG_ERROR)
RNS.log("Error occurred while handling request. The contained exception was: "+str(e), RNS.LOG_ERROR)
elif packet.context == RNS.Packet.RESPONSE: elif packet.context == RNS.Packet.RESPONSE:
try: try:
@@ -1050,8 +999,7 @@ class Link:
def job(): self.handle_response(request_id, response_data, transfer_size, transfer_size, update_sizes=True) def job(): self.handle_response(request_id, response_data, transfer_size, transfer_size, update_sizes=True)
threading.Thread(target=job, daemon=True).start() threading.Thread(target=job, daemon=True).start()
self.__update_phy_stats(packet, query_shared=True) self.__update_phy_stats(packet, query_shared=True)
except Exception as e: except Exception as e: RNS.log("Error occurred while handling response. The contained exception was: "+str(e), RNS.LOG_ERROR)
RNS.log("Error occurred while handling response. The contained exception was: "+str(e), RNS.LOG_ERROR)
elif packet.context == RNS.Packet.LRRTT: elif packet.context == RNS.Packet.LRRTT:
if not self.initiator: if not self.initiator:
@@ -1066,36 +1014,39 @@ class Link:
packet.plaintext = self.decrypt(packet.data) packet.plaintext = self.decrypt(packet.data)
if packet.plaintext != None: if packet.plaintext != None:
self.__update_phy_stats(packet, query_shared=True) self.__update_phy_stats(packet, query_shared=True)
try:
if RNS.ResourceAdvertisement.is_request(packet): if RNS.ResourceAdvertisement.is_request(packet):
RNS.Resource.accept(packet, callback=self.request_resource_concluded) if self.destination.request_handlers:
elif RNS.ResourceAdvertisement.is_response(packet): RNS.Resource.accept(packet, callback=self.request_resource_concluded)
request_id = RNS.ResourceAdvertisement.read_request_id(packet) elif RNS.ResourceAdvertisement.is_response(packet):
for pending_request in self.pending_requests: request_id = RNS.ResourceAdvertisement.read_request_id(packet)
if pending_request.request_id == request_id: for pending_request in self.pending_requests:
response_resource = RNS.Resource.accept(packet, callback=self.response_resource_concluded, progress_callback=pending_request.response_resource_progress, request_id = request_id) if pending_request.request_id == request_id:
if response_resource != None: response_resource = RNS.Resource.accept(packet, callback=self.response_resource_concluded, progress_callback=pending_request.response_resource_progress, request_id = request_id)
if pending_request.response_size == None: if response_resource != None:
pending_request.response_size = RNS.ResourceAdvertisement.read_size(packet) if pending_request.response_size == None:
if pending_request.response_transfer_size == None: pending_request.response_size = RNS.ResourceAdvertisement.read_size(packet)
pending_request.response_transfer_size = 0 if pending_request.response_transfer_size == None:
pending_request.response_transfer_size += RNS.ResourceAdvertisement.read_transfer_size(packet) pending_request.response_transfer_size = 0
if pending_request.started_at == None: pending_request.response_transfer_size += RNS.ResourceAdvertisement.read_transfer_size(packet)
pending_request.started_at = time.time() if pending_request.started_at == None:
pending_request.response_resource_progress(response_resource) pending_request.started_at = time.time()
pending_request.response_resource_progress(response_resource)
elif self.resource_strategy == Link.ACCEPT_NONE: pass elif self.resource_strategy == Link.ACCEPT_NONE: pass
elif self.resource_strategy == Link.ACCEPT_APP: elif self.resource_strategy == Link.ACCEPT_APP:
if self.callbacks.resource != None: if self.callbacks.resource != None:
try: try:
resource_advertisement = RNS.ResourceAdvertisement.unpack(packet.plaintext) resource_advertisement = RNS.ResourceAdvertisement.unpack(packet.plaintext)
resource_advertisement.link = self resource_advertisement.link = self
if self.callbacks.resource(resource_advertisement): RNS.Resource.accept(packet, self.callbacks.resource_concluded) if self.callbacks.resource(resource_advertisement): RNS.Resource.accept(packet, self.callbacks.resource_concluded)
else: RNS.Resource.reject(packet) else: RNS.Resource.reject(packet)
except Exception as e: except Exception as e:
RNS.log("Error while executing resource accept callback from "+str(self)+". The contained exception was: "+str(e), RNS.LOG_ERROR) RNS.log("Error while executing resource accept callback from "+str(self)+". The contained exception was: "+str(e), RNS.LOG_ERROR)
elif self.resource_strategy == Link.ACCEPT_ALL: elif self.resource_strategy == Link.ACCEPT_ALL:
RNS.Resource.accept(packet, self.callbacks.resource_concluded) RNS.Resource.accept(packet, self.callbacks.resource_concluded)
except Exception as e:
RNS.log(f"Invalid resource advertisement on {self}: {e}", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None
self.teardown()
elif packet.context == RNS.Packet.RESOURCE_REQ: elif packet.context == RNS.Packet.RESOURCE_REQ:
plaintext = self.decrypt(packet.data) plaintext = self.decrypt(packet.data)
@@ -1183,7 +1134,6 @@ class Link:
self.watchdog_lock = False self.watchdog_lock = False
def encrypt(self, plaintext): def encrypt(self, plaintext):
try: try:
if not self.token: if not self.token:
@@ -1198,7 +1148,6 @@ class Link:
RNS.log("Encryption on link "+str(self)+" failed. The contained exception was: "+str(e), RNS.LOG_ERROR) RNS.log("Encryption on link "+str(self)+" failed. The contained exception was: "+str(e), RNS.LOG_ERROR)
raise e raise e
def decrypt(self, ciphertext): def decrypt(self, ciphertext):
try: try:
if not self.token: self.token = Token(self.derived_key) if not self.token: self.token = Token(self.derived_key)
@@ -1208,7 +1157,6 @@ class Link:
RNS.log("Decryption failed on link "+str(self)+". The contained exception was: "+str(e), RNS.LOG_ERROR) RNS.log("Decryption failed on link "+str(self)+". The contained exception was: "+str(e), RNS.LOG_ERROR)
return None return None
def sign(self, message): def sign(self, message):
return self.sig_prv.sign(message) return self.sig_prv.sign(message)
@@ -1216,8 +1164,7 @@ class Link:
try: try:
self.peer_sig_pub.verify(signature, message) self.peer_sig_pub.verify(signature, message)
return True return True
except Exception as e: except Exception as e: return False
return False
def set_link_established_callback(self, callback): def set_link_established_callback(self, callback):
self.callbacks.link_established = callback self.callbacks.link_established = callback
@@ -1385,7 +1332,6 @@ class RequestReceipt():
self.link.pending_requests.append(self) self.link.pending_requests.append(self)
def request_resource_concluded(self, resource): def request_resource_concluded(self, resource):
if resource.status == RNS.Resource.COMPLETE: if resource.status == RNS.Resource.COMPLETE:
RNS.log("Request "+RNS.prettyhexrep(self.request_id)+" successfully sent as resource.", RNS.LOG_DEBUG) RNS.log("Request "+RNS.prettyhexrep(self.request_id)+" successfully sent as resource.", RNS.LOG_DEBUG)
@@ -1408,7 +1354,6 @@ class RequestReceipt():
except Exception as e: except Exception as e:
RNS.log("Error while executing request failed callback from "+str(self)+". The contained exception was: "+str(e), RNS.LOG_ERROR) RNS.log("Error while executing request failed callback from "+str(self)+". The contained exception was: "+str(e), RNS.LOG_ERROR)
def __response_timeout_job(self): def __response_timeout_job(self):
while self.status == RequestReceipt.DELIVERED: while self.status == RequestReceipt.DELIVERED:
now = time.time() now = time.time()
@@ -1418,7 +1363,6 @@ class RequestReceipt():
time.sleep(0.1) time.sleep(0.1)
def request_timed_out(self, packet_receipt): def request_timed_out(self, packet_receipt):
if self in self.link.pending_requests and self.status == RequestReceipt.DELIVERED: if self in self.link.pending_requests and self.status == RequestReceipt.DELIVERED:
self.status = RequestReceipt.FAILED self.status = RequestReceipt.FAILED
@@ -1427,9 +1371,7 @@ class RequestReceipt():
if self.callbacks.failed != None: if self.callbacks.failed != None:
try: self.callbacks.failed(self) try: self.callbacks.failed(self)
except Exception as e: except Exception as e: RNS.log("Error while executing request timed out callback from "+str(self)+". The contained exception was: "+str(e), RNS.LOG_ERROR)
RNS.log("Error while executing request timed out callback from "+str(self)+". The contained exception was: "+str(e), RNS.LOG_ERROR)
def response_resource_progress(self, resource): def response_resource_progress(self, resource):
if resource != None: if resource != None:
@@ -1446,13 +1388,10 @@ class RequestReceipt():
self.progress = resource.get_progress() self.progress = resource.get_progress()
if self.callbacks.progress != None: if self.callbacks.progress != None:
try: try: self.callbacks.progress(self)
self.callbacks.progress(self) except Exception as e: RNS.log("Error while executing response progress callback from "+str(self)+". The contained exception was: "+str(e), RNS.LOG_ERROR)
except Exception as e:
RNS.log("Error while executing response progress callback from "+str(self)+". The contained exception was: "+str(e), RNS.LOG_ERROR) else: resource.cancel()
else:
resource.cancel()
def response_received(self, response, metadata=None): def response_received(self, response, metadata=None):
if not self.status == RequestReceipt.FAILED: if not self.status == RequestReceipt.FAILED:
@@ -1471,13 +1410,11 @@ class RequestReceipt():
if self.callbacks.progress != None: if self.callbacks.progress != None:
try: self.callbacks.progress(self) try: self.callbacks.progress(self)
except Exception as e: except Exception as e: RNS.log("Error while executing response progress callback from "+str(self)+". The contained exception was: "+str(e), RNS.LOG_ERROR)
RNS.log("Error while executing response progress callback from "+str(self)+". The contained exception was: "+str(e), RNS.LOG_ERROR)
if self.callbacks.response != None: if self.callbacks.response != None:
try: self.callbacks.response(self) try: self.callbacks.response(self)
except Exception as e: except Exception as e: RNS.log("Error while executing response received callback from "+str(self)+". The contained exception was: "+str(e), RNS.LOG_ERROR)
RNS.log("Error while executing response received callback from "+str(self)+". The contained exception was: "+str(e), RNS.LOG_ERROR)
def get_request_id(self): def get_request_id(self):
""" """
@@ -1501,31 +1438,23 @@ class RequestReceipt():
""" """
:returns: The response as *bytes* if it is ready, otherwise *None*. :returns: The response as *bytes* if it is ready, otherwise *None*.
""" """
if self.status == RequestReceipt.READY: if self.status == RequestReceipt.READY: return self.response
return self.response else: return None
else:
return None
def get_response_time(self): def get_response_time(self):
""" """
:returns: The response time of the request in seconds. :returns: The response time of the request in seconds.
""" """
if self.status == RequestReceipt.READY: if self.status == RequestReceipt.READY: return self.response_concluded_at - self.started_at
return self.response_concluded_at - self.started_at else: return None
else:
return None
def concluded(self): def concluded(self):
""" """
:returns: True if the associated request has concluded (successfully or with a failure), otherwise False. :returns: True if the associated request has concluded (successfully or with a failure), otherwise False.
""" """
if self.status == RequestReceipt.READY: if self.status == RequestReceipt.READY: return True
return True elif self.status == RequestReceipt.FAILED: return True
elif self.status == RequestReceipt.FAILED: else: return False
return True
else:
return False
class RequestReceiptCallbacks: class RequestReceiptCallbacks:
+46 -73
View File
@@ -244,6 +244,9 @@ class Packet:
self.flags = self.raw[0] self.flags = self.raw[0]
self.hops = self.raw[1] self.hops = self.raw[1]
if self.hops >= RNS.Transport.PATHFINDER_M:
raise ValueError(f"Invalid hop count {self.hops}")
self.header_type = (self.flags & 0b01000000) >> 6 self.header_type = (self.flags & 0b01000000) >> 6
self.context_flag = (self.flags & 0b00100000) >> 5 self.context_flag = (self.flags & 0b00100000) >> 5
self.transport_type = (self.flags & 0b00010000) >> 4 self.transport_type = (self.flags & 0b00010000) >> 4
@@ -268,7 +271,7 @@ class Packet:
return True return True
except Exception as e: except Exception as e:
RNS.log("Received malformed packet, dropping it. The contained exception was: "+str(e), RNS.LOG_EXTREME) if RNS.sl(RNS.LOG_EXTREME) else None RNS.log(f"Received malformed packet, dropping it. The contained exception was: {e}", RNS.LOG_EXTREME) if RNS.sl(RNS.LOG_EXTREME) else None
return False return False
def send(self): def send(self):
@@ -278,6 +281,7 @@ class Packet:
:returns: A :ref:`RNS.PacketReceipt<api-packetreceipt>` instance if *create_receipt* was set to *True* when the packet was instantiated, if not returns *None*. If the packet could not be sent *False* is returned. :returns: A :ref:`RNS.PacketReceipt<api-packetreceipt>` instance if *create_receipt* was set to *True* when the packet was instantiated, if not returns *None*. If the packet could not be sent *False* is returned.
""" """
if not self.sent: if not self.sent:
if not self.packed: self.pack()
if self.destination.type == RNS.Destination.LINK: if self.destination.type == RNS.Destination.LINK:
if self.destination.status == RNS.Link.CLOSED: if self.destination.status == RNS.Link.CLOSED:
RNS.log("Attempt to transmit over a closed link, dropping packet", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log("Attempt to transmit over a closed link, dropping packet", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None
@@ -288,9 +292,7 @@ class Packet:
else: else:
self.destination.last_outbound = time.time() self.destination.last_outbound = time.time()
self.destination.tx += 1 self.destination.tx += 1
self.destination.txbytes += len(self.data) self.destination.txbytes += len(self.ciphertext)
if not self.packed: self.pack()
if RNS.Transport.outbound(self): return self.receipt if RNS.Transport.outbound(self): return self.receipt
else: else:
@@ -313,51 +315,40 @@ class Packet:
# encrypted destinations # encrypted destinations
self.pack() self.pack()
if RNS.Transport.outbound(self): if RNS.Transport.outbound(self): return self.receipt
return self.receipt
else: else:
RNS.log("Re-send failed. No interfaces could process the outbound packet", RNS.LOG_WARNING) RNS.log("Re-send failed. No interfaces could process the outbound packet", RNS.LOG_WARNING)
self.sent = False self.sent = False
self.receipt = None self.receipt = None
return False return False
else:
raise IOError("Packet was not sent yet") else: raise IOError("Packet was not sent yet")
def prove(self, destination=None): def prove(self, destination=None):
if self.fromPacked and hasattr(self, "destination") and self.destination: if self.fromPacked and hasattr(self, "destination") and self.destination:
if self.destination.identity and self.destination.identity.prv: if self.destination.identity and self.destination.identity.prv:
self.destination.identity.prove(self, destination) self.destination.identity.prove(self, destination)
elif self.fromPacked and hasattr(self, "link") and self.link: elif self.fromPacked and hasattr(self, "link") and self.link: self.link.prove_packet(self)
self.link.prove_packet(self) else: RNS.log("Could not prove packet associated with neither a destination nor a link", RNS.LOG_ERROR)
else:
RNS.log("Could not prove packet associated with neither a destination nor a link", RNS.LOG_ERROR)
# Generates a special destination that allows Reticulum # Generates a special destination that allows Reticulum
# to direct the proof back to the proved packet's sender # to direct the proof back to the proved packet's sender
def generate_proof_destination(self): def generate_proof_destination(self): return ProofDestination(self)
return ProofDestination(self)
def validate_proof_packet(self, proof_packet): def validate_proof_packet(self, proof_packet): return self.receipt.validate_proof_packet(proof_packet)
return self.receipt.validate_proof_packet(proof_packet)
def validate_proof(self, proof): def validate_proof(self, proof): return self.receipt.validate_proof(proof)
return self.receipt.validate_proof(proof)
def update_hash(self): def update_hash(self): self.packet_hash = self.get_hash()
self.packet_hash = self.get_hash()
def get_hash(self): def get_hash(self): return RNS.Identity.full_hash(self.get_hashable_part())
return RNS.Identity.full_hash(self.get_hashable_part())
def getTruncatedHash(self): def getTruncatedHash(self): return RNS.Identity.truncated_hash(self.get_hashable_part())
return RNS.Identity.truncated_hash(self.get_hashable_part())
def get_hashable_part(self): def get_hashable_part(self):
hashable_part = bytes([self.raw[0] & 0b00001111]) hashable_part = bytes([self.raw[0] & 0b00001111])
if self.header_type == Packet.HEADER_2: if self.header_type == Packet.HEADER_2: hashable_part += self.raw[(RNS.Identity.TRUNCATED_HASHLENGTH//8)+2:]
hashable_part += self.raw[(RNS.Identity.TRUNCATED_HASHLENGTH//8)+2:] else: hashable_part += self.raw[2:]
else:
hashable_part += self.raw[2:]
return hashable_part return hashable_part
@@ -365,36 +356,29 @@ class Packet:
""" """
:returns: The physical layer *Received Signal Strength Indication* if available, otherwise ``None``. :returns: The physical layer *Received Signal Strength Indication* if available, otherwise ``None``.
""" """
if self.rssi != None: if self.rssi != None: return self.rssi
return self.rssi else: return reticulum.get_packet_rssi(self.packet_hash)
else:
return reticulum.get_packet_rssi(self.packet_hash)
def get_snr(self): def get_snr(self):
""" """
:returns: The physical layer *Signal-to-Noise Ratio* if available, otherwise ``None``. :returns: The physical layer *Signal-to-Noise Ratio* if available, otherwise ``None``.
""" """
if self.snr != None: if self.snr != None: return self.snr
return self.snr else: return reticulum.get_packet_snr(self.packet_hash)
else:
return reticulum.get_packet_snr(self.packet_hash)
def get_q(self): def get_q(self):
""" """
:returns: The physical layer *Link Quality* if available, otherwise ``None``. :returns: The physical layer *Link Quality* if available, otherwise ``None``.
""" """
if self.q != None: if self.q != None: return self.q
return self.q else: return reticulum.get_packet_q(self.packet_hash)
else:
return reticulum.get_packet_q(self.packet_hash)
class ProofDestination: class ProofDestination:
def __init__(self, packet): def __init__(self, packet):
self.hash = packet.get_hash()[:RNS.Reticulum.TRUNCATED_HASHLENGTH//8]; self.hash = packet.get_hash()[:RNS.Reticulum.TRUNCATED_HASHLENGTH//8];
self.type = RNS.Destination.SINGLE self.type = RNS.Destination.SINGLE
def encrypt(self, plaintext): def encrypt(self, plaintext): return plaintext
return plaintext
class PacketReceipt: class PacketReceipt:
@@ -463,18 +447,17 @@ class PacketReceipt:
link.last_proof = self.concluded_at link.last_proof = self.concluded_at
if self.callbacks.delivery != None: if self.callbacks.delivery != None:
try: try: self.callbacks.delivery(self)
self.callbacks.delivery(self)
except Exception as e: except Exception as e:
RNS.log("An error occurred while evaluating external delivery callback for "+str(link), RNS.LOG_ERROR) RNS.log("An error occurred while evaluating external delivery callback for "+str(link), RNS.LOG_ERROR)
RNS.log("The contained exception was: "+str(e), RNS.LOG_ERROR) RNS.log("The contained exception was: "+str(e), RNS.LOG_ERROR)
RNS.trace_exception(e) RNS.trace_exception(e)
return True return True
else:
return False else: return False
else: else: return False
return False
elif len(proof) == PacketReceipt.IMPL_LENGTH: elif len(proof) == PacketReceipt.IMPL_LENGTH:
pass pass
# TODO: Why is this disabled? # TODO: Why is this disabled?
@@ -491,8 +474,7 @@ class PacketReceipt:
# else: # else:
# RNS.log("invalid") # RNS.log("invalid")
# return False # return False
else: else: return False
return False
# Validate a raw proof # Validate a raw proof
def validate_proof(self, proof, proof_packet=None): def validate_proof(self, proof, proof_packet=None):
@@ -509,24 +491,20 @@ class PacketReceipt:
self.proof_packet = proof_packet self.proof_packet = proof_packet
if self.callbacks.delivery != None: if self.callbacks.delivery != None:
try: try: self.callbacks.delivery(self)
self.callbacks.delivery(self)
except Exception as e: except Exception as e:
RNS.log("Error while executing proof validated callback. The contained exception was: "+str(e), RNS.LOG_ERROR) RNS.log("Error while executing proof validated callback. The contained exception was: "+str(e), RNS.LOG_ERROR)
return True return True
else:
return False else: return False
else: else: return False
return False
elif len(proof) == PacketReceipt.IMPL_LENGTH: elif len(proof) == PacketReceipt.IMPL_LENGTH:
# This is an implicit proof # This is an implicit proof
if not hasattr(self.destination, "identity"): if not hasattr(self.destination, "identity"): return False
return False if self.destination.identity == None: return False
if self.destination.identity == None:
return False
signature = proof[:RNS.Identity.SIGLENGTH//8] signature = proof[:RNS.Identity.SIGLENGTH//8]
proof_valid = self.destination.identity.validate(signature, self.hash) proof_valid = self.destination.identity.validate(signature, self.hash)
@@ -537,16 +515,13 @@ class PacketReceipt:
self.proof_packet = proof_packet self.proof_packet = proof_packet
if self.callbacks.delivery != None: if self.callbacks.delivery != None:
try: try: self.callbacks.delivery(self)
self.callbacks.delivery(self) except Exception as e: RNS.log("Error while executing proof validated callback. The contained exception was: "+str(e), RNS.LOG_ERROR)
except Exception as e:
RNS.log("Error while executing proof validated callback. The contained exception was: "+str(e), RNS.LOG_ERROR)
return True return True
else:
return False else: return False
else: else: return False
return False
def get_rtt(self): def get_rtt(self):
""" """
@@ -559,10 +534,8 @@ class PacketReceipt:
def check_timeout(self): def check_timeout(self):
if self.status == PacketReceipt.SENT and self.is_timed_out(): if self.status == PacketReceipt.SENT and self.is_timed_out():
if self.timeout == -1: if self.timeout == -1: self.status = PacketReceipt.CULLED
self.status = PacketReceipt.CULLED else: self.status = PacketReceipt.FAILED
else:
self.status = PacketReceipt.FAILED
self.concluded_at = time.time() self.concluded_at = time.time()
+1 -2
View File
@@ -31,5 +31,4 @@
class Resolver: class Resolver:
@staticmethod @staticmethod
def resolve_identity(full_name): def resolve_identity(full_name): pass
pass
+85 -98
View File
@@ -149,7 +149,7 @@ class Resource:
COMPLETE = 0x06 COMPLETE = 0x06
FAILED = 0x07 FAILED = 0x07
CORRUPT = 0x08 CORRUPT = 0x08
REJECTED = 0x00 REJECTED = 0x09
@staticmethod @staticmethod
def reject(advertisement_packet): def reject(advertisement_packet):
@@ -239,7 +239,7 @@ class Resource:
return None return None
except Exception as e: except Exception as e:
RNS.log("Could not decode resource advertisement, dropping resource", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log(f"Could not decode resource advertisement, dropping resource: {e}", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None
return None return None
# Create a resource for transmission to a remote destination # Create a resource for transmission to a remote destination
@@ -314,30 +314,26 @@ class Resource:
self.input_file = data self.input_file = data
elif isinstance(data, bytes): elif isinstance(data, bytes):
data_size = len(data) data_size = len(data)
self.total_size = data_size + self.metadata_size self.total_size = data_size + self.metadata_size
resource_data = data resource_data = data
self.total_segments = 1 self.total_segments = 1
self.segment_index = 1 self.segment_index = 1
self.split = False self.split = False
elif data == None: elif data == None: pass
pass
else: else: raise TypeError("Invalid data instance type passed to resource initialisation")
raise TypeError("Invalid data instance type passed to resource initialisation")
if resource_data: if resource_data:
if self.has_metadata: data = self.metadata + resource_data if self.has_metadata: data = self.metadata + resource_data
else: data = resource_data else: data = resource_data
self.status = Resource.NONE self.status = Resource.NONE
self.link = link self.link = link
if self.link.mtu: if self.link.mtu: self.sdu = self.link.mtu - RNS.Reticulum.HEADER_MAXSIZE - RNS.Reticulum.IFAC_MIN_SIZE
self.sdu = self.link.mtu - RNS.Reticulum.HEADER_MAXSIZE - RNS.Reticulum.IFAC_MIN_SIZE else: self.sdu = link.mdu or Resource.SDU
else:
self.sdu = link.mdu or Resource.SDU
self.max_retries = Resource.MAX_RETRIES self.max_retries = Resource.MAX_RETRIES
self.max_adv_retries = Resource.MAX_ADV_RETRIES self.max_adv_retries = Resource.MAX_ADV_RETRIES
self.retries_left = self.max_retries self.retries_left = self.max_retries
@@ -482,12 +478,12 @@ class Resource:
def hashmap_update_packet(self, plaintext): def hashmap_update_packet(self, plaintext):
if not self.status == Resource.FAILED: if not self.status == Resource.FAILED:
self.last_activity = time.time() if self.waiting_for_hmu:
self.retries_left = self.max_retries self.last_activity = time.time()
self.retries_left = self.max_retries
update = umsgpack.unpackb(plaintext[RNS.Identity.HASHLENGTH//8:])
self.hashmap_update(update[0], update[1])
update = umsgpack.unpackb(plaintext[RNS.Identity.HASHLENGTH//8:])
self.hashmap_update(update[0], update[1])
def hashmap_update(self, segment, hashmap): def hashmap_update(self, segment, hashmap):
if not self.status == Resource.FAILED: if not self.status == Resource.FAILED:
@@ -495,12 +491,16 @@ class Resource:
seg_len = ResourceAdvertisement.HASHMAP_MAX_LEN seg_len = ResourceAdvertisement.HASHMAP_MAX_LEN
hashes = len(hashmap)//Resource.MAPHASH_LEN hashes = len(hashmap)//Resource.MAPHASH_LEN
for i in range(0,hashes): for i in range(0,hashes):
if self.hashmap[i+segment*seg_len] == None: if self.hashmap[i+segment*seg_len] == None: self.hashmap_height += 1
self.hashmap_height += 1
self.hashmap[i+segment*seg_len] = hashmap[i*Resource.MAPHASH_LEN:(i+1)*Resource.MAPHASH_LEN] self.hashmap[i+segment*seg_len] = hashmap[i*Resource.MAPHASH_LEN:(i+1)*Resource.MAPHASH_LEN]
self.waiting_for_hmu = False if hashes < 1:
self.request_next() RNS.log("Invalid HMU received, cancelling transfer", RNS.LOG_ERROR)
self.cancel()
else:
self.waiting_for_hmu = False
self.request_next()
def get_map_hash(self, data): def get_map_hash(self, data):
return RNS.Identity.full_hash(data+self.random_hash)[:Resource.MAPHASH_LEN] return RNS.Identity.full_hash(data+self.random_hash)[:Resource.MAPHASH_LEN]
@@ -517,6 +517,14 @@ class Resource:
prepare_thread = threading.Thread(target=self.__prepare_next_segment, daemon=True) prepare_thread = threading.Thread(target=self.__prepare_next_segment, daemon=True)
prepare_thread.start() prepare_thread.start()
def ensure_link(self):
if not self.link or self.link.status != RNS.Link.ACTIVE:
RNS.log(f"Invalid link state for {self}, aborting transfer", RNS.LOG_VERBOSE)
try: self.cancel()
except Exception as e: RNS.log(f"Error while cancelling resource on link-state abort: {e}", RNS.LOG_ERROR)
return False
else: return True
def __advertise_job(self): def __advertise_job(self):
self.advertisement_packet = RNS.Packet(self.link, ResourceAdvertisement(self).pack(), context=RNS.Packet.RESOURCE_ADV) self.advertisement_packet = RNS.Packet(self.link, ResourceAdvertisement(self).pack(), context=RNS.Packet.RESOURCE_ADV)
while not self.link.ready_for_new_resource(): while not self.link.ready_for_new_resource():
@@ -524,6 +532,7 @@ class Resource:
sleep(0.25) sleep(0.25)
try: try:
if not self.ensure_link(): return
self.advertisement_packet.send() self.advertisement_packet.send()
self.last_activity = time.time() self.last_activity = time.time()
self.started_transferring = self.last_activity self.started_transferring = self.last_activity
@@ -541,18 +550,13 @@ class Resource:
self.watchdog_job() self.watchdog_job()
def update_eifr(self): def update_eifr(self):
if self.rtt == None: if self.rtt == None: rtt = self.link.rtt
rtt = self.link.rtt else: rtt = self.rtt
else:
rtt = self.rtt
if self.req_data_rtt_rate != 0: if self.req_data_rtt_rate != 0: expected_inflight_rate = self.req_data_rtt_rate*8
expected_inflight_rate = self.req_data_rtt_rate*8
else: else:
if self.previous_eifr != None: if self.previous_eifr != None: expected_inflight_rate = self.previous_eifr
expected_inflight_rate = self.previous_eifr else: expected_inflight_rate = self.link.establishment_cost*8 / rtt
else:
expected_inflight_rate = self.link.establishment_cost*8 / rtt
self.eifr = expected_inflight_rate self.eifr = expected_inflight_rate
if self.link: self.link.expected_rate = self.eifr if self.link: self.link.expected_rate = self.eifr
@@ -566,8 +570,7 @@ class Resource:
this_job_id = self.__watchdog_job_id this_job_id = self.__watchdog_job_id
while self.status < Resource.ASSEMBLING and this_job_id == self.__watchdog_job_id: while self.status < Resource.ASSEMBLING and this_job_id == self.__watchdog_job_id:
while self.watchdog_lock: while self.watchdog_lock: sleep(0.025)
sleep(0.025)
sleep_time = None sleep_time = None
if self.status == Resource.ADVERTISED: if self.status == Resource.ADVERTISED:
@@ -581,6 +584,7 @@ class Resource:
try: try:
RNS.log("No part requests received, retrying resource advertisement...", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log("No part requests received, retrying resource advertisement...", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None
self.retries_left -= 1 self.retries_left -= 1
if not self.ensure_link(): return
self.advertisement_packet = RNS.Packet(self.link, ResourceAdvertisement(self).pack(), context=RNS.Packet.RESOURCE_ADV) self.advertisement_packet = RNS.Packet(self.link, ResourceAdvertisement(self).pack(), context=RNS.Packet.RESOURCE_ADV)
self.advertisement_packet.send() self.advertisement_packet.send()
self.last_activity = time.time() self.last_activity = time.time()
@@ -657,13 +661,13 @@ class Resource:
self.last_part_sent = time.time() self.last_part_sent = time.time()
sleep_time = 0.001 sleep_time = 0.001
elif self.status == Resource.REJECTED: elif self.status >= Resource.ASSEMBLING:
sleep_time = 0.001 sleep_time = 0.001
if sleep_time == 0: if sleep_time == 0:
RNS.log("Warning! Link watchdog sleep time of 0!", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log("Warning! Link watchdog sleep time of 0!", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None
if sleep_time == None or sleep_time < 0: if sleep_time == None or sleep_time < 0:
RNS.log("Timing error, cancelling resource transfer.", RNS.LOG_ERROR) RNS.log(f"Timing error ({sleep_time}/{self.status}), cancelling resource transfer.", RNS.LOG_ERROR)
self.cancel() self.cancel()
if sleep_time != None: if sleep_time != None:
@@ -754,6 +758,7 @@ class Resource:
try: try:
proof = RNS.Identity.full_hash(self.data+self.hash) proof = RNS.Identity.full_hash(self.data+self.hash)
proof_data = self.hash+proof proof_data = self.hash+proof
if not self.ensure_link(): return
proof_packet = RNS.Packet(self.link, proof_data, packet_type=RNS.Packet.PROOF, context=RNS.Packet.RESOURCE_PRF) proof_packet = RNS.Packet(self.link, proof_data, packet_type=RNS.Packet.PROOF, context=RNS.Packet.RESOURCE_PRF)
proof_packet.send() proof_packet.send()
RNS.Transport.cache(proof_packet, force_cache=True) RNS.Transport.cache(proof_packet, force_cache=True)
@@ -776,8 +781,8 @@ class Resource:
advertise = False, advertise = False,
auto_compress = self.auto_compress_option, auto_compress = self.auto_compress_option,
sent_metadata_size = self.metadata_size) sent_metadata_size = self.metadata_size)
if self.__progress_callback:
self.next_segment.progress_callback(self.__progress_callback) if self.__progress_callback: self.next_segment.progress_callback(self.__progress_callback)
def validate_proof(self, proof_data): def validate_proof(self, proof_data):
if not self.status == Resource.FAILED: if not self.status == Resource.FAILED:
@@ -966,6 +971,7 @@ class Resource:
request_packet = RNS.Packet(self.link, request_data, context = RNS.Packet.RESOURCE_REQ) request_packet = RNS.Packet(self.link, request_data, context = RNS.Packet.RESOURCE_REQ)
try: try:
if not self.ensure_link(): return
request_packet.send() request_packet.send()
self.last_activity = time.time() self.last_activity = time.time()
self.req_sent = self.last_activity self.req_sent = self.last_activity
@@ -1010,11 +1016,11 @@ class Resource:
for part in requested_parts: for part in requested_parts:
try: try:
if not self.ensure_link(): return
if not part.sent: if not part.sent:
part.send() part.send()
self.sent_parts += 1 self.sent_parts += 1
else: else: part.resend()
part.resend()
self.last_activity = time.time() self.last_activity = time.time()
self.last_part_sent = self.last_activity self.last_part_sent = self.last_activity
@@ -1032,8 +1038,7 @@ class Resource:
search_end = self.receiver_min_consecutive_height+ResourceAdvertisement.COLLISION_GUARD_SIZE search_end = self.receiver_min_consecutive_height+ResourceAdvertisement.COLLISION_GUARD_SIZE
for part in self.parts[search_start:search_end]: for part in self.parts[search_start:search_end]:
part_index += 1 part_index += 1
if part.map_hash == last_map_hash: if part.map_hash == last_map_hash: break
break
self.receiver_min_consecutive_height = max(part_index-1-Resource.WINDOW_MAX, 0) self.receiver_min_consecutive_height = max(part_index-1-Resource.WINDOW_MAX, 0)
@@ -1041,10 +1046,8 @@ class Resource:
RNS.log("Resource sequencing error, cancelling transfer!", RNS.LOG_ERROR) RNS.log("Resource sequencing error, cancelling transfer!", RNS.LOG_ERROR)
self.cancel() self.cancel()
return return
else: else: segment = part_index // ResourceAdvertisement.HASHMAP_MAX_LEN
segment = part_index // ResourceAdvertisement.HASHMAP_MAX_LEN
hashmap_start = segment*ResourceAdvertisement.HASHMAP_MAX_LEN hashmap_start = segment*ResourceAdvertisement.HASHMAP_MAX_LEN
hashmap_end = min((segment+1)*ResourceAdvertisement.HASHMAP_MAX_LEN, len(self.parts)) hashmap_end = min((segment+1)*ResourceAdvertisement.HASHMAP_MAX_LEN, len(self.parts))
@@ -1052,10 +1055,16 @@ class Resource:
for i in range(hashmap_start,hashmap_end): for i in range(hashmap_start,hashmap_end):
hashmap += self.hashmap[i*Resource.MAPHASH_LEN:(i+1)*Resource.MAPHASH_LEN] hashmap += self.hashmap[i*Resource.MAPHASH_LEN:(i+1)*Resource.MAPHASH_LEN]
if not hashmap:
RNS.log("Resource HMU error, cancelling transfer!", RNS.LOG_ERROR)
self.cancel()
return
hmu = self.hash+umsgpack.packb([segment, hashmap]) hmu = self.hash+umsgpack.packb([segment, hashmap])
hmu_packet = RNS.Packet(self.link, hmu, context = RNS.Packet.RESOURCE_HMU) hmu_packet = RNS.Packet(self.link, hmu, context = RNS.Packet.RESOURCE_HMU)
try: try:
if not self.ensure_link(): return
hmu_packet.send() hmu_packet.send()
self.last_activity = time.time() self.last_activity = time.time()
except Exception as e: except Exception as e:
@@ -1090,10 +1099,14 @@ class Resource:
try: try:
cancel_packet = RNS.Packet(self.link, self.hash, context=RNS.Packet.RESOURCE_ICL) cancel_packet = RNS.Packet(self.link, self.hash, context=RNS.Packet.RESOURCE_ICL)
cancel_packet.send() cancel_packet.send()
except Exception as e: except Exception as e: RNS.log("Could not send resource cancel packet, the contained exception was: "+str(e), RNS.LOG_ERROR)
RNS.log("Could not send resource cancel packet, the contained exception was: "+str(e), RNS.LOG_ERROR)
self.link.cancel_outgoing_resource(self) self.link.cancel_outgoing_resource(self)
else: else:
if self.link.status == RNS.Link.ACTIVE:
try:
cancel_packet = RNS.Packet(self.link, self.hash, context=RNS.Packet.RESOURCE_RCL)
cancel_packet.send()
except Exception as e: RNS.log("Could not send resource cancel packet, the contained exception was: "+str(e), RNS.LOG_ERROR)
self.link.cancel_incoming_resource(self) self.link.cancel_incoming_resource(self)
if self.callback != None: if self.callback != None:
@@ -1241,40 +1254,30 @@ class ResourceAdvertisement:
@staticmethod @staticmethod
def is_request(advertisement_packet): def is_request(advertisement_packet):
adv = ResourceAdvertisement.unpack(advertisement_packet.plaintext) adv = ResourceAdvertisement.unpack(advertisement_packet.plaintext)
if adv.q != None and adv.u: if adv.q != None and adv.u: return True
return True else: return False
else:
return False
@staticmethod @staticmethod
def is_response(advertisement_packet): def is_response(advertisement_packet):
adv = ResourceAdvertisement.unpack(advertisement_packet.plaintext) adv = ResourceAdvertisement.unpack(advertisement_packet.plaintext)
if adv.q != None and adv.p: return True
if adv.q != None and adv.p: else: return False
return True
else:
return False
@staticmethod @staticmethod
def read_request_id(advertisement_packet): def read_request_id(advertisement_packet):
adv = ResourceAdvertisement.unpack(advertisement_packet.plaintext) adv = ResourceAdvertisement.unpack(advertisement_packet.plaintext)
return adv.q return adv.q
@staticmethod @staticmethod
def read_transfer_size(advertisement_packet): def read_transfer_size(advertisement_packet):
adv = ResourceAdvertisement.unpack(advertisement_packet.plaintext) adv = ResourceAdvertisement.unpack(advertisement_packet.plaintext)
return adv.t return adv.t
@staticmethod @staticmethod
def read_size(advertisement_packet): def read_size(advertisement_packet):
adv = ResourceAdvertisement.unpack(advertisement_packet.plaintext) adv = ResourceAdvertisement.unpack(advertisement_packet.plaintext)
return adv.d return adv.d
def __init__(self, resource=None, request_id=None, is_response=False): def __init__(self, resource=None, request_id=None, is_response=False):
self.link = None self.link = None
if resource != None: if resource != None:
@@ -1306,29 +1309,14 @@ class ResourceAdvertisement:
# Flags # Flags
self.f = 0x00 | self.x << 5 | self.p << 4 | self.u << 3 | self.s << 2 | self.c << 1 | self.e self.f = 0x00 | self.x << 5 | self.p << 4 | self.u << 3 | self.s << 2 | self.c << 1 | self.e
def get_transfer_size(self): def get_transfer_size(self): return self.t
return self.t def get_data_size(self): return self.d
def get_parts(self): return self.n
def get_data_size(self): def get_segments(self): return self.l
return self.d def get_hash(self): return self.h
def is_compressed(self): return self.c
def get_parts(self): def has_metadata(self): return self.x
return self.n def get_link(self): return self.link
def get_segments(self):
return self.l
def get_hash(self):
return self.h
def is_compressed(self):
return self.c
def has_metadata(self):
return self.x
def get_link(self):
return self.link
def pack(self, segment=0): def pack(self, segment=0):
hashmap_start = segment*ResourceAdvertisement.HASHMAP_MAX_LEN hashmap_start = segment*ResourceAdvertisement.HASHMAP_MAX_LEN
@@ -1338,23 +1326,20 @@ class ResourceAdvertisement:
for i in range(hashmap_start,hashmap_end): for i in range(hashmap_start,hashmap_end):
hashmap += self.m[i*Resource.MAPHASH_LEN:(i+1)*Resource.MAPHASH_LEN] hashmap += self.m[i*Resource.MAPHASH_LEN:(i+1)*Resource.MAPHASH_LEN]
dictionary = { dictionary = { "t": self.t, # Transfer size
"t": self.t, # Transfer size "d": self.d, # Data size
"d": self.d, # Data size "n": self.n, # Number of parts
"n": self.n, # Number of parts "h": self.h, # Resource hash
"h": self.h, # Resource hash "r": self.r, # Resource random hash
"r": self.r, # Resource random hash "o": self.o, # Original hash
"o": self.o, # Original hash "i": self.i, # Segment index
"i": self.i, # Segment index "l": self.l, # Total segments
"l": self.l, # Total segments "q": self.q, # Request ID
"q": self.q, # Request ID "f": self.f, # Resource flags
"f": self.f, # Resource flags "m": hashmap }
"m": hashmap
}
return umsgpack.packb(dictionary) return umsgpack.packb(dictionary)
@staticmethod @staticmethod
def unpack(data): def unpack(data):
dictionary = umsgpack.unpackb(data) dictionary = umsgpack.unpackb(data)
@@ -1378,4 +1363,6 @@ class ResourceAdvertisement:
adv.p = True if ((adv.f >> 4) & 0x01) == 0x01 else False adv.p = True if ((adv.f >> 4) & 0x01) == 0x01 else False
adv.x = True if ((adv.f >> 5) & 0x01) == 0x01 else False adv.x = True if ((adv.f >> 5) & 0x01) == 0x01 else False
if adv.t > Resource.MAX_EFFICIENT_SIZE*3: raise ValueError("Invalid transfer size")
return adv return adv
+265 -259
View File
@@ -48,6 +48,7 @@ else:
from RNS.vendor.configobj import ConfigObj from RNS.vendor.configobj import ConfigObj
from threading import Lock from threading import Lock
import RNS.vendor.umsgpack as mp
import configparser import configparser
import multiprocessing.connection import multiprocessing.connection
import importlib.util import importlib.util
@@ -251,6 +252,8 @@ class Reticulum:
Reticulum.__network_identity = None Reticulum.__network_identity = None
Reticulum.__transport_enabled = False Reticulum.__transport_enabled = False
Reticulum.__static_transport_identity = False
Reticulum.__local_hops_delta = False
Reticulum.__link_mtu_discovery = Reticulum.LINK_MTU_DISCOVERY Reticulum.__link_mtu_discovery = Reticulum.LINK_MTU_DISCOVERY
Reticulum.__remote_management_enabled = False Reticulum.__remote_management_enabled = False
Reticulum.__use_implicit_proof = True Reticulum.__use_implicit_proof = True
@@ -260,6 +263,7 @@ class Reticulum:
Reticulum.__autoconnect_discovered_interfaces = False Reticulum.__autoconnect_discovered_interfaces = False
Reticulum.__required_discovery_value = None Reticulum.__required_discovery_value = None
Reticulum.__publish_blackhole = False Reticulum.__publish_blackhole = False
Reticulum.__blackhole_update_interval = RNS.Discovery.BlackholeUpdater.UPDATE_INTERVAL
Reticulum.__blackhole_sources = [] Reticulum.__blackhole_sources = []
Reticulum.__interface_sources = [] Reticulum.__interface_sources = []
Reticulum.__default_ar_target = None Reticulum.__default_ar_target = None
@@ -345,7 +349,7 @@ class Reticulum:
self.rpc_type = "AF_INET" self.rpc_type = "AF_INET"
if self.rpc_key == None: if self.rpc_key == None:
self.rpc_key = RNS.Identity.full_hash(RNS.Transport.identity.get_private_key()) self.rpc_key = RNS.Identity.full_hash(RNS.Transport.internal_identity().get_private_key())
if self.is_shared_instance: if self.is_shared_instance:
self.rpc_listener = multiprocessing.connection.Listener(self.rpc_addr, family=self.rpc_type, authkey=self.rpc_key) self.rpc_listener = multiprocessing.connection.Listener(self.rpc_addr, family=self.rpc_type, authkey=self.rpc_key)
@@ -384,11 +388,7 @@ class Reticulum:
def __start_local_interface(self): def __start_local_interface(self):
if self.share_instance: if self.share_instance:
try: try:
interface = LocalInterface.LocalServerInterface( interface = LocalInterface.LocalServerInterface(RNS.Transport, self.local_interface_port, socket_path=self.local_socket_path)
RNS.Transport,
self.local_interface_port,
socket_path=self.local_socket_path
)
interface.OUT = True interface.OUT = True
if hasattr(Reticulum, "_force_shared_instance_bitrate"): if hasattr(Reticulum, "_force_shared_instance_bitrate"):
interface.bitrate = Reticulum._force_shared_instance_bitrate interface.bitrate = Reticulum._force_shared_instance_bitrate
@@ -430,6 +430,7 @@ class Reticulum:
Reticulum.__remote_management_enabled = False Reticulum.__remote_management_enabled = False
Reticulum.__allow_probes = False Reticulum.__allow_probes = False
RNS.log("Connected to locally available Reticulum instance via: "+str(interface), RNS.LOG_DEBUG) RNS.log("Connected to locally available Reticulum instance via: "+str(interface), RNS.LOG_DEBUG)
except Exception as e: except Exception as e:
RNS.log("Local shared instance appears to be running, but it could not be connected", RNS.LOG_ERROR) RNS.log("Local shared instance appears to be running, but it could not be connected", RNS.LOG_ERROR)
RNS.log("The contained exception was: "+str(e), RNS.LOG_ERROR) RNS.log("The contained exception was: "+str(e), RNS.LOG_ERROR)
@@ -452,12 +453,12 @@ class Reticulum:
value = self.config["logging"][option] value = self.config["logging"][option]
if option == "loglevel" and self.requested_loglevel == None: if option == "loglevel" and self.requested_loglevel == None:
RNS.loglevel = int(value) RNS.loglevel = int(value)
if self.requested_verbosity != None: if self.requested_verbosity != None: RNS.loglevel += self.requested_verbosity
RNS.loglevel += self.requested_verbosity if RNS.loglevel < 0: RNS.loglevel = 0
if RNS.loglevel < 0: if RNS.loglevel > 7: RNS.loglevel = 7
RNS.loglevel = 0 elif option == "logtimestamps":
if RNS.loglevel > 7: value = self.config["logging"].as_bool(option)
RNS.loglevel = 7 RNS.logtimestamps = bool(value)
if "reticulum" in self.config: if "reticulum" in self.config:
for option in self.config["reticulum"]: for option in self.config["reticulum"]:
@@ -498,6 +499,14 @@ class Reticulum:
v = self.config["reticulum"].as_bool(option) v = self.config["reticulum"].as_bool(option)
if v == True: Reticulum.__transport_enabled = True if v == True: Reticulum.__transport_enabled = True
if option == "static_transport_identity":
v = self.config["reticulum"].as_bool(option)
if v == True: Reticulum.__static_transport_identity = True
if option == "local_hops_delta":
v = self.config["reticulum"].as_bool(option)
if v == True: Reticulum.__local_hops_delta = True
if option == "network_identity": if option == "network_identity":
if Reticulum.__network_identity == None: if Reticulum.__network_identity == None:
path = self.config["reticulum"][option] path = self.config["reticulum"][option]
@@ -581,6 +590,11 @@ class Reticulum:
except Exception as e: raise ValueError(f"Invalid identity hash for remote blackhole source: {hexhash}") except Exception as e: raise ValueError(f"Invalid identity hash for remote blackhole source: {hexhash}")
if not source_identity_hash in Reticulum.__blackhole_sources: Reticulum.__blackhole_sources.append(source_identity_hash) if not source_identity_hash in Reticulum.__blackhole_sources: Reticulum.__blackhole_sources.append(source_identity_hash)
if option == "blackhole_update_interval":
v = self.config["reticulum"].as_float(option)
if v < 2: v = 2
Reticulum.__blackhole_update_interval = v*60
if option == "interface_discovery_sources": if option == "interface_discovery_sources":
v = self.config["reticulum"].as_list(option) v = self.config["reticulum"].as_list(option)
for hexhash in v: for hexhash in v:
@@ -662,6 +676,9 @@ class Reticulum:
self.shared_instance_type = "tcp" self.shared_instance_type = "tcp"
self.use_af_unix = False self.use_af_unix = False
if self.shared_instance_type == "tcp":
self.local_socket_path = None
if self.local_socket_path == None and self.use_af_unix: if self.local_socket_path == None and self.use_af_unix:
self.local_socket_path = "default" self.local_socket_path = "default"
@@ -700,6 +717,8 @@ class Reticulum:
interface_mode = Interface.Interface.MODE_BOUNDARY interface_mode = Interface.Interface.MODE_BOUNDARY
elif c["mode"] == "gateway" or c["mode"] == "gw": elif c["mode"] == "gateway" or c["mode"] == "gw":
interface_mode = Interface.Interface.MODE_GATEWAY interface_mode = Interface.Interface.MODE_GATEWAY
elif c["mode"] == "internal":
interface_mode = Interface.Interface.MODE_INTERNAL
elif "mode" in c: elif "mode" in c:
c["mode"] = str(c["mode"]).lower() c["mode"] = str(c["mode"]).lower()
@@ -715,27 +734,24 @@ class Reticulum:
interface_mode = Interface.Interface.MODE_BOUNDARY interface_mode = Interface.Interface.MODE_BOUNDARY
elif c["mode"] == "gateway" or c["mode"] == "gw": elif c["mode"] == "gateway" or c["mode"] == "gw":
interface_mode = Interface.Interface.MODE_GATEWAY interface_mode = Interface.Interface.MODE_GATEWAY
elif c["mode"] == "internal":
interface_mode = Interface.Interface.MODE_INTERNAL
ifac_size = None ifac_size = None
if "ifac_size" in c: if "ifac_size" in c:
if c.as_int("ifac_size") >= Reticulum.IFAC_MIN_SIZE*8: if c.as_int("ifac_size") >= Reticulum.IFAC_MIN_SIZE*8: ifac_size = c.as_int("ifac_size")//8
ifac_size = c.as_int("ifac_size")//8
ifac_netname = None ifac_netname = None
if "networkname" in c: if "networkname" in c:
if c["networkname"] != "": if c["networkname"] != "": ifac_netname = c["networkname"]
ifac_netname = c["networkname"]
if "network_name" in c: if "network_name" in c:
if c["network_name"] != "": if c["network_name"] != "": ifac_netname = c["network_name"]
ifac_netname = c["network_name"]
ifac_netkey = None ifac_netkey = None
if "passphrase" in c: if "passphrase" in c:
if c["passphrase"] != "": if c["passphrase"] != "": ifac_netkey = c["passphrase"]
ifac_netkey = c["passphrase"]
if "pass_phrase" in c: if "pass_phrase" in c:
if c["pass_phrase"] != "": if c["pass_phrase"] != "": ifac_netkey = c["pass_phrase"]
ifac_netkey = c["pass_phrase"]
ingress_control = True ingress_control = True
if "ingress_control" in c: ingress_control = c.as_bool("ingress_control") if "ingress_control" in c: ingress_control = c.as_bool("ingress_control")
@@ -764,29 +780,22 @@ class Reticulum:
configured_bitrate = None configured_bitrate = None
if "bitrate" in c: if "bitrate" in c:
if c.as_int("bitrate") >= Reticulum.MINIMUM_BITRATE: if c.as_int("bitrate") >= Reticulum.MINIMUM_BITRATE: configured_bitrate = c.as_int("bitrate")
configured_bitrate = c.as_int("bitrate")
announce_rate_target = None announce_rate_target = None
if "announce_rate_target" in c: if "announce_rate_target" in c:
if c.as_int("announce_rate_target") > 0: if c.as_int("announce_rate_target") > 0: announce_rate_target = c.as_int("announce_rate_target")
announce_rate_target = c.as_int("announce_rate_target")
announce_rate_grace = None announce_rate_grace = None
if "announce_rate_grace" in c: if "announce_rate_grace" in c:
if c.as_int("announce_rate_grace") >= 0: if c.as_int("announce_rate_grace") >= 0: announce_rate_grace = c.as_int("announce_rate_grace")
announce_rate_grace = c.as_int("announce_rate_grace")
announce_rate_penalty = None announce_rate_penalty = None
if "announce_rate_penalty" in c: if "announce_rate_penalty" in c:
if c.as_int("announce_rate_penalty") >= 0: if c.as_int("announce_rate_penalty") >= 0: announce_rate_penalty = c.as_int("announce_rate_penalty")
announce_rate_penalty = c.as_int("announce_rate_penalty")
if announce_rate_target != None and announce_rate_grace == None: if announce_rate_target != None and announce_rate_grace == None: announce_rate_grace = 0
announce_rate_grace = 0 if announce_rate_target != None and announce_rate_penalty == None: announce_rate_penalty = 0
if announce_rate_target != None and announce_rate_penalty == None:
announce_rate_penalty = 0
announce_cap = Reticulum.ANNOUNCE_CAP/100.0 announce_cap = Reticulum.ANNOUNCE_CAP/100.0
if "announce_cap" in c: if "announce_cap" in c:
@@ -796,6 +805,12 @@ class Reticulum:
bootstrap_only = False bootstrap_only = False
if "bootstrap_only" in c: bootstrap_only = c.as_bool("bootstrap_only") if "bootstrap_only" in c: bootstrap_only = c.as_bool("bootstrap_only")
recursive_prs = False
if "recursive_prs" in c: recursive_prs = c.as_bool("recursive_prs")
announces_from_internal = True
if "announces_from_internal" in c: announces_from_internal = c.as_bool("announces_from_internal")
ignore_config_warnings = False ignore_config_warnings = False
if "ignore_config_warnings" in c: ignore_config_warnings = c.as_bool("ignore_config_warnings") if "ignore_config_warnings" in c: ignore_config_warnings = c.as_bool("ignore_config_warnings")
@@ -814,6 +829,7 @@ class Reticulum:
latitude = None latitude = None
longitude = None longitude = None
height = None height = None
discovery_location = None
discovery_frequency = None discovery_frequency = None
discovery_bandwidth = None discovery_bandwidth = None
discovery_modulation = None discovery_modulation = None
@@ -831,6 +847,7 @@ class Reticulum:
if "discovery_encrypt" in c: discovery_encrypt = c.as_bool("discovery_encrypt") if "discovery_encrypt" in c: discovery_encrypt = c.as_bool("discovery_encrypt")
if "reachable_on" in c: reachable_on = c["reachable_on"] if "reachable_on" in c: reachable_on = c["reachable_on"]
if "publish_ifac" in c: publish_ifac = c.as_bool("publish_ifac") if "publish_ifac" in c: publish_ifac = c.as_bool("publish_ifac")
if "location_cmd" in c: discovery_location = c["location_cmd"]
if "latitude" in c: latitude = c.as_float("latitude") if "latitude" in c: latitude = c.as_float("latitude")
if "longitude" in c: longitude = c.as_float("longitude") if "longitude" in c: longitude = c.as_float("longitude")
if "height" in c: height = c.as_float("height") if "height" in c: height = c.as_float("height")
@@ -838,14 +855,14 @@ class Reticulum:
if "discovery_bandwidth" in c: discovery_bandwidth = c.as_int("discovery_bandwidth") if "discovery_bandwidth" in c: discovery_bandwidth = c.as_int("discovery_bandwidth")
if "discovery_modulation" in c: discovery_modulation = c.as_int("discovery_modulation") if "discovery_modulation" in c: discovery_modulation = c.as_int("discovery_modulation")
if not interface_mode in [Interface.Interface.MODE_GATEWAY, Interface.Interface.MODE_ACCESS_POINT]: if not interface_mode in [Interface.Interface.MODE_GATEWAY, Interface.Interface.MODE_ACCESS_POINT, Interface.Interface.MODE_INTERNAL]:
if not ignore_config_warnings: if not ignore_config_warnings:
if c["type"] in ["RNodeInterface", "RNodeMultiInterface"]: if c["type"] in ["RNodeInterface", "RNodeMultiInterface"]:
interface_mode = Interface.Interface.MODE_ACCESS_POINT interface_mode = Interface.Interface.MODE_ACCESS_POINT
RNS.log(f"Discovery enabled on interface {name} without gateway or AP mode. Auto-configured to AP mode.", RNS.LOG_NOTICE) RNS.log(f"Discovery enabled on interface {name} without gateway, internal or AP mode. Auto-configured to AP mode.", RNS.LOG_NOTICE)
else: else:
interface_mode = Interface.Interface.MODE_GATEWAY interface_mode = Interface.Interface.MODE_GATEWAY
RNS.log(f"Discovery enabled on interface {name} without gateway or AP mode. Auto-configured to gateway mode.", RNS.LOG_NOTICE) RNS.log(f"Discovery enabled on interface {name} without gateway, internal or AP mode. Auto-configured to gateway mode.", RNS.LOG_NOTICE)
try: try:
def interface_post_init(interface): def interface_post_init(interface):
@@ -862,38 +879,42 @@ class Reticulum:
if ifac_size != None: interface.ifac_size = ifac_size if ifac_size != None: interface.ifac_size = ifac_size
else: interface.ifac_size = interface.DEFAULT_IFAC_SIZE else: interface.ifac_size = interface.DEFAULT_IFAC_SIZE
interface.discoverable = discoverable interface.discoverable = discoverable
interface.discovery_announce_interval = discovery_announce_interval interface.discovery_announce_interval = discovery_announce_interval
interface.discovery_publish_ifac = publish_ifac interface.discovery_publish_ifac = publish_ifac
interface.reachable_on = reachable_on interface.reachable_on = reachable_on
interface.discovery_name = discovery_name interface.discovery_name = discovery_name
interface.discovery_encrypt = discovery_encrypt interface.discovery_encrypt = discovery_encrypt
interface.discovery_stamp_value = discovery_stamp_value interface.discovery_stamp_value = discovery_stamp_value
interface.discovery_latitude = latitude interface.discovery_location = discovery_location
interface.discovery_longitude = longitude interface.discovery_latitude = latitude
interface.discovery_height = height interface.discovery_longitude = longitude
interface.discovery_frequency = discovery_frequency interface.discovery_height = height
interface.discovery_bandwidth = discovery_bandwidth interface.discovery_frequency = discovery_frequency
interface.discovery_modulation = discovery_modulation interface.discovery_bandwidth = discovery_bandwidth
interface.discovery_modulation = discovery_modulation
interface.announce_rate_target = announce_rate_target interface.recursive_prs = recursive_prs
interface.announce_rate_grace = announce_rate_grace interface.announces_from_internal = announces_from_internal
interface.announce_rate_penalty = announce_rate_penalty interface.announce_rate_target = announce_rate_target
interface.ingress_control = ingress_control interface.announce_rate_grace = announce_rate_grace
if egress_control != None: interface.egress_control = egress_control interface.announce_rate_penalty = announce_rate_penalty
if ic_max_held_announces != None: interface.ic_max_held_announces = ic_max_held_announces interface.ingress_control = ingress_control
if ic_burst_hold != None: interface.ic_burst_hold = ic_burst_hold
if ic_burst_freq_new != None: interface.ic_burst_freq_new = ic_burst_freq_new if egress_control != None: interface.egress_control = egress_control
if ic_burst_freq != None: interface.ic_burst_freq = ic_burst_freq if ic_max_held_announces != None: interface.ic_max_held_announces = ic_max_held_announces
if ic_pr_burst_freq_new != None: interface.ic_pr_burst_freq_new = ic_pr_burst_freq_new if ic_burst_hold != None: interface.ic_burst_hold = ic_burst_hold
if ic_pr_burst_freq != None: interface.ic_pr_burst_freq = ic_pr_burst_freq if ic_burst_freq_new != None: interface.ic_burst_freq_new = ic_burst_freq_new
if ec_pr_freq != None: interface.ec_pr_freq = ec_pr_freq if ic_burst_freq != None: interface.ic_burst_freq = ic_burst_freq
if ic_new_time != None: interface.ic_new_time = ic_new_time if ic_pr_burst_freq_new != None: interface.ic_pr_burst_freq_new = ic_pr_burst_freq_new
if ic_burst_penalty != None: interface.ic_burst_penalty = ic_burst_penalty if ic_pr_burst_freq != None: interface.ic_pr_burst_freq = ic_pr_burst_freq
if ec_pr_freq != None: interface.ec_pr_freq = ec_pr_freq
if ic_new_time != None: interface.ic_new_time = ic_new_time
if ic_burst_penalty != None: interface.ic_burst_penalty = ic_burst_penalty
if ic_held_release_interval != None: interface.ic_held_release_interval = ic_held_release_interval if ic_held_release_interval != None: interface.ic_held_release_interval = ic_held_release_interval
interface.ifac_netname = ifac_netname interface.ifac_netname = ifac_netname
interface.ifac_netkey = ifac_netkey interface.ifac_netkey = ifac_netkey
if interface.ifac_netname != None or interface.ifac_netkey != None: if interface.ifac_netname != None or interface.ifac_netkey != None:
ifac_origin = b"" ifac_origin = b""
@@ -905,12 +926,8 @@ class Reticulum:
ifac_origin += RNS.Identity.full_hash(interface.ifac_netkey.encode("utf-8")) ifac_origin += RNS.Identity.full_hash(interface.ifac_netkey.encode("utf-8"))
ifac_origin_hash = RNS.Identity.full_hash(ifac_origin) ifac_origin_hash = RNS.Identity.full_hash(ifac_origin)
interface.ifac_key = RNS.Cryptography.hkdf( interface.ifac_key = RNS.Cryptography.hkdf(length=64, derive_from=ifac_origin_hash,
length=64, salt=self.ifac_salt, context=None)
derive_from=ifac_origin_hash,
salt=self.ifac_salt,
context=None
)
interface.ifac_identity = RNS.Identity.from_bytes(interface.ifac_key) interface.ifac_identity = RNS.Identity.from_bytes(interface.ifac_key)
interface.ifac_signature = interface.ifac_identity.sign(RNS.Identity.full_hash(interface.ifac_key)) interface.ifac_signature = interface.ifac_identity.sign(RNS.Identity.full_hash(interface.ifac_key))
@@ -1034,7 +1051,9 @@ class Reticulum:
RNS.panic() RNS.panic()
def _add_interface(self, interface, mode = None, configured_bitrate=None, ifac_size=None, ifac_netname=None, ifac_netkey=None, def _add_interface(self, interface, mode = None, configured_bitrate=None, ifac_size=None, ifac_netname=None, ifac_netkey=None,
announce_cap=None, announce_rate_target=None, announce_rate_grace=None, announce_rate_penalty=None, bootstrap_only=False): announce_cap=None, announce_rate_target=None, announce_rate_grace=None, announce_rate_penalty=None,
bootstrap_only=False, recursive_prs=False, announces_from_internal=True):
if not self.is_connected_to_shared_instance: if not self.is_connected_to_shared_instance:
if interface != None and issubclass(type(interface), RNS.Interfaces.Interface.Interface): if interface != None and issubclass(type(interface), RNS.Interfaces.Interface.Interface):
@@ -1049,13 +1068,15 @@ class Reticulum:
if ifac_size != None: interface.ifac_size = ifac_size if ifac_size != None: interface.ifac_size = ifac_size
else: interface.ifac_size = interface.DEFAULT_IFAC_SIZE else: interface.ifac_size = interface.DEFAULT_IFAC_SIZE
interface.announce_cap = announce_cap if announce_cap != None else Reticulum.ANNOUNCE_CAP/100.0 interface.recursive_prs = recursive_prs
interface.announce_rate_target = announce_rate_target interface.announces_from_internal = announces_from_internal
interface.announce_rate_grace = announce_rate_grace interface.announce_cap = announce_cap if announce_cap != None else Reticulum.ANNOUNCE_CAP/100.0
interface.announce_rate_penalty = announce_rate_penalty interface.announce_rate_target = announce_rate_target
interface.announce_rate_grace = announce_rate_grace
interface.announce_rate_penalty = announce_rate_penalty
interface.ifac_netname = ifac_netname interface.ifac_netname = ifac_netname
interface.ifac_netkey = ifac_netkey interface.ifac_netkey = ifac_netkey
if interface.ifac_netname != None or interface.ifac_netkey != None: if interface.ifac_netname != None or interface.ifac_netkey != None:
ifac_origin = b"" ifac_origin = b""
@@ -1067,12 +1088,8 @@ class Reticulum:
ifac_origin += RNS.Identity.full_hash(interface.ifac_netkey.encode("utf-8")) ifac_origin += RNS.Identity.full_hash(interface.ifac_netkey.encode("utf-8"))
ifac_origin_hash = RNS.Identity.full_hash(ifac_origin) ifac_origin_hash = RNS.Identity.full_hash(ifac_origin)
interface.ifac_key = RNS.Cryptography.hkdf( interface.ifac_key = RNS.Cryptography.hkdf(length=64, derive_from=ifac_origin_hash,
length=64, salt=self.ifac_salt, context=None)
derive_from=ifac_origin_hash,
salt=self.ifac_salt,
context=None
)
interface.ifac_identity = RNS.Identity.from_bytes(interface.ifac_key) interface.ifac_identity = RNS.Identity.from_bytes(interface.ifac_key)
interface.ifac_signature = interface.ifac_identity.sign(RNS.Identity.full_hash(interface.ifac_key)) interface.ifac_signature = interface.ifac_identity.sign(RNS.Identity.full_hash(interface.ifac_key))
@@ -1169,63 +1186,66 @@ class Reticulum:
self.config = ConfigObj(__default_rns_config__) self.config = ConfigObj(__default_rns_config__)
self.config.filename = Reticulum.configpath self.config.filename = Reticulum.configpath
if not os.path.isdir(Reticulum.configdir): if not os.path.isdir(Reticulum.configdir): os.makedirs(Reticulum.configdir)
os.makedirs(Reticulum.configdir)
self.config.write() self.config.write()
def rpc_return(self, connection, response):
connection.send_bytes(mp.packb(response))
def rpc_loop(self): def rpc_loop(self):
while RNS.Transport._should_run: while RNS.Transport._should_run:
try: try:
rpc_connection = self.rpc_listener.accept() conn = self.rpc_listener.accept()
call = rpc_connection.recv() call = mp.unpackb(conn.recv_bytes())
if "get" in call: if "get" in call:
path = call["get"] path = call["get"]
if path == "path_table": if path == "path_table":
mh = call["max_hops"] mh = call["max_hops"]
rpc_connection.send(self.get_path_table(max_hops=mh)) self.rpc_return(conn, self.get_path_table(max_hops=mh))
if path == "interface_stats": rpc_connection.send(self.get_interface_stats()) if path == "interface_stats": self.rpc_return(conn, self.get_interface_stats())
if path == "rate_table": rpc_connection.send(self.get_rate_table()) if path == "rate_table": self.rpc_return(conn, self.get_rate_table())
if path == "next_hop_if_name": rpc_connection.send(self.get_next_hop_if_name(call["destination_hash"])) if path == "next_hop_if_name": self.rpc_return(conn, self.get_next_hop_if_name(call["destination_hash"]))
if path == "next_hop": rpc_connection.send(self.get_next_hop(call["destination_hash"])) if path == "next_hop": self.rpc_return(conn, self.get_next_hop(call["destination_hash"]))
if path == "first_hop_timeout": rpc_connection.send(self.get_first_hop_timeout(call["destination_hash"])) if path == "first_hop_timeout": self.rpc_return(conn, self.get_first_hop_timeout(call["destination_hash"]))
if path == "link_count": rpc_connection.send(self.get_link_count()) if path == "link_count": self.rpc_return(conn, self.get_link_count())
if path == "packet_rssi": rpc_connection.send(self.get_packet_rssi(call["packet_hash"])) if path == "packet_rssi": self.rpc_return(conn, self.get_packet_rssi(call["packet_hash"]))
if path == "packet_snr": rpc_connection.send(self.get_packet_snr(call["packet_hash"])) if path == "packet_snr": self.rpc_return(conn, self.get_packet_snr(call["packet_hash"]))
if path == "packet_q": rpc_connection.send(self.get_packet_q(call["packet_hash"])) if path == "packet_q": self.rpc_return(conn, self.get_packet_q(call["packet_hash"]))
if path == "blackholed_identities": rpc_connection.send(self.get_blackholed_identities()) if path == "blackholed_identities": self.rpc_return(conn, self.get_blackholed_identities())
if path == "is_blackholed": self.rpc_return(conn, self.is_blackholed(call["identity_hash"]))
if "drop" in call: if "drop" in call:
path = call["drop"] path = call["drop"]
if path == "path": rpc_connection.send(self.drop_path(call["destination_hash"])) if path == "path": self.rpc_return(conn, self.drop_path(call["destination_hash"]))
if path == "all_via": rpc_connection.send(self.drop_all_via(call["destination_hash"])) if path == "all_via": self.rpc_return(conn, self.drop_all_via(call["destination_hash"]))
if path == "announce_queues": rpc_connection.send(self.drop_announce_queues()) if path == "announce_queues": self.rpc_return(conn, self.drop_announce_queues())
if "blackhole_identity" in call: if "blackhole_identity" in call:
identity_hash = call["blackhole_identity"] identity_hash = call["blackhole_identity"]
until = call["until"] until = call["until"]
reason = call["reason"] reason = call["reason"]
rpc_connection.send(self.blackhole_identity(identity_hash, until=until, reason=reason)) self.rpc_return(conn, self.blackhole_identity(identity_hash, until=until, reason=reason))
if "unblackhole_identity" in call: if "unblackhole_identity" in call:
identity_hash = call["unblackhole_identity"] identity_hash = call["unblackhole_identity"]
rpc_connection.send(self.unblackhole_identity(identity_hash)) self.rpc_return(conn, self.unblackhole_identity(identity_hash))
if "destination_data" in call: if "destination_data" in call:
operation = call["destination_data"] operation = call["destination_data"]
destination_hash = call["destination_hash"] destination_hash = call["destination_hash"]
if operation == "used": rpc_connection.send(self._used_destination_data(destination_hash)) if operation == "used": self.rpc_return(conn, self._used_destination_data(destination_hash))
elif operation == "retain": rpc_connection.send(self._retain_destination_data(destination_hash)) elif operation == "retain": self.rpc_return(conn, self._retain_destination_data(destination_hash))
elif operation == "unretain": rpc_connection.send(self._unretain_destination_data(destination_hash)) elif operation == "unretain": self.rpc_return(conn, self._unretain_destination_data(destination_hash))
if "identity_data" in call: if "identity_data" in call:
operation = call["identity_data"] operation = call["identity_data"]
identity_hash = call["identity_hash"] identity_hash = call["identity_hash"]
if operation == "retain": rpc_connection.send(self._retain_identity(identity_hash)) if operation == "retain": self.rpc_return(conn, self._retain_identity(identity_hash))
rpc_connection.close() conn.close()
except Exception as e: except Exception as e:
RNS.log("An error ocurred while handling RPC call from local client: "+str(e), RNS.LOG_ERROR) RNS.log("An error ocurred while handling RPC call from local client: "+str(e), RNS.LOG_ERROR)
@@ -1236,8 +1256,8 @@ class Reticulum:
if self.is_connected_to_shared_instance: if self.is_connected_to_shared_instance:
try: try:
rpc_connection = self.get_rpc_client() rpc_connection = self.get_rpc_client()
rpc_connection.send({"destination_data": "used", "destination_hash": destination_hash}) rpc_connection.send_bytes(mp.packb({"destination_data": "used", "destination_hash": destination_hash}))
response = rpc_connection.recv() response = mp.unpackb(rpc_connection.recv_bytes())
return response return response
except Exception as e: except Exception as e:
@@ -1250,8 +1270,8 @@ class Reticulum:
if self.is_connected_to_shared_instance: if self.is_connected_to_shared_instance:
try: try:
rpc_connection = self.get_rpc_client() rpc_connection = self.get_rpc_client()
rpc_connection.send({"destination_data": "retain", "destination_hash": destination_hash}) rpc_connection.send_bytes(mp.packb({"destination_data": "retain", "destination_hash": destination_hash}))
response = rpc_connection.recv() response = mp.unpackb(rpc_connection.recv_bytes())
return response return response
except Exception as e: except Exception as e:
@@ -1264,8 +1284,8 @@ class Reticulum:
if self.is_connected_to_shared_instance: if self.is_connected_to_shared_instance:
try: try:
rpc_connection = self.get_rpc_client() rpc_connection = self.get_rpc_client()
rpc_connection.send({"destination_data": "unretain", "destination_hash": destination_hash}) rpc_connection.send_bytes(mp.packb({"destination_data": "unretain", "destination_hash": destination_hash}))
response = rpc_connection.recv() response = mp.unpackb(rpc_connection.recv_bytes())
return response return response
except Exception as e: except Exception as e:
@@ -1281,8 +1301,8 @@ class Reticulum:
if self.is_connected_to_shared_instance: if self.is_connected_to_shared_instance:
try: try:
rpc_connection = self.get_rpc_client() rpc_connection = self.get_rpc_client()
rpc_connection.send({"identity_data": "retain", "identity_hash": identity_hash}) rpc_connection.send_bytes(mp.packb({"identity_data": "retain", "identity_hash": identity_hash}))
response = rpc_connection.recv() response = mp.unpackb(rpc_connection.recv_bytes())
return response return response
except Exception as e: except Exception as e:
@@ -1294,34 +1314,29 @@ class Reticulum:
def get_interface_stats(self): def get_interface_stats(self):
if self.is_connected_to_shared_instance: if self.is_connected_to_shared_instance:
rpc_connection = self.get_rpc_client() rpc_connection = self.get_rpc_client()
rpc_connection.send({"get": "interface_stats"}) rpc_connection.send_bytes(mp.packb({"get": "interface_stats"}))
response = rpc_connection.recv() response = mp.unpackb(rpc_connection.recv_bytes())
return response return response
else: else:
interfaces = [] interfaces = []
for interface in RNS.Transport.interfaces: for interface in RNS.Transport.interfaces:
ifstats = {} ifstats = {}
if hasattr(interface, "clients"): if hasattr(interface, "clients"): ifstats["clients"] = interface.clients
ifstats["clients"] = interface.clients else: ifstats["clients"] = None
else:
ifstats["clients"] = None
if hasattr(interface, "parent_interface") and interface.parent_interface != None: if hasattr(interface, "parent_interface") and interface.parent_interface != None:
ifstats["parent_interface_name"] = str(interface.parent_interface) ifstats["parent_interface_name"] = str(interface.parent_interface)
ifstats["parent_interface_hash"] = interface.parent_interface.get_hash() ifstats["parent_interface_hash"] = interface.parent_interface.get_hash()
if hasattr(interface, "i2p") and hasattr(interface, "connectable"): if hasattr(interface, "i2p") and hasattr(interface, "connectable"):
if interface.connectable: if interface.connectable: ifstats["i2p_connectable"] = True
ifstats["i2p_connectable"] = True else: ifstats["i2p_connectable"] = False
else:
ifstats["i2p_connectable"] = False
if hasattr(interface, "b32"): if hasattr(interface, "b32"):
if interface.b32 != None: if interface.b32 != None: ifstats["i2p_b32"] = interface.b32+".b32.i2p"
ifstats["i2p_b32"] = interface.b32+".b32.i2p" else: ifstats["i2p_b32"] = None
else:
ifstats["i2p_b32"] = None
if hasattr(interface, "i2p_tunnel_state"): if hasattr(interface, "i2p_tunnel_state"):
if interface.i2p_tunnel_state != None: if interface.i2p_tunnel_state != None:
@@ -1336,37 +1351,20 @@ class Reticulum:
else: else:
ifstats["tunnelstate"] = None ifstats["tunnelstate"] = None
if hasattr(interface, "r_airtime_short"): if hasattr(interface, "r_airtime_short"): ifstats["airtime_short"] = interface.r_airtime_short
ifstats["airtime_short"] = interface.r_airtime_short if hasattr(interface, "r_airtime_long"): ifstats["airtime_long"] = interface.r_airtime_long
if hasattr(interface, "r_channel_load_short"): ifstats["channel_load_short"] = interface.r_channel_load_short
if hasattr(interface, "r_airtime_long"): if hasattr(interface, "r_channel_load_long"): ifstats["channel_load_long"] = interface.r_channel_load_long
ifstats["airtime_long"] = interface.r_airtime_long if hasattr(interface, "r_noise_floor"): ifstats["noise_floor"] = interface.r_noise_floor
if hasattr(interface, "r_interference"): ifstats["interference"] = interface.r_interference
if hasattr(interface, "r_channel_load_short"): if hasattr(interface, "cpu_temp"): ifstats["cpu_temp"] = interface.cpu_temp
ifstats["channel_load_short"] = interface.r_channel_load_short if hasattr(interface, "cpu_load"): ifstats["cpu_load"] = interface.cpu_load
if hasattr(interface, "mem_load"): ifstats["mem_load"] = interface.mem_load
if hasattr(interface, "r_channel_load_long"):
ifstats["channel_load_long"] = interface.r_channel_load_long
if hasattr(interface, "r_noise_floor"):
ifstats["noise_floor"] = interface.r_noise_floor
if hasattr(interface, "r_interference"):
ifstats["interference"] = interface.r_interference
if hasattr(interface, "r_interference_l") and type(interface.r_interference_l) == list: if hasattr(interface, "r_interference_l") and type(interface.r_interference_l) == list:
ifstats["interference_last_ts"] = interface.r_interference_l[0] ifstats["interference_last_ts"] = interface.r_interference_l[0]
ifstats["interference_last_dbm"] = interface.r_interference_l[1] ifstats["interference_last_dbm"] = interface.r_interference_l[1]
if hasattr(interface, "cpu_temp"):
ifstats["cpu_temp"] = interface.cpu_temp
if hasattr(interface, "cpu_load"):
ifstats["cpu_load"] = interface.cpu_load
if hasattr(interface, "mem_load"):
ifstats["mem_load"] = interface.mem_load
if hasattr(interface, "switch_id"): if hasattr(interface, "switch_id"):
if interface.switch_id != None: ifstats["switch_id"] = RNS.hexrep(interface.switch_id) if interface.switch_id != None: ifstats["switch_id"] = RNS.hexrep(interface.switch_id)
else: ifstats["switch_id"] = None else: ifstats["switch_id"] = None
@@ -1380,39 +1378,26 @@ class Reticulum:
else: ifstats["endpoint_id"] = None else: ifstats["endpoint_id"] = None
if hasattr(interface, "r_battery_state"): if hasattr(interface, "r_battery_state"):
if interface.r_battery_state != 0x00: if interface.r_battery_state != 0x00: ifstats["battery_state"] = interface.get_battery_state_string()
ifstats["battery_state"] = interface.get_battery_state_string() if hasattr(interface, "r_battery_percent"): ifstats["battery_percent"] = interface.r_battery_percent
if hasattr(interface, "r_battery_percent"):
ifstats["battery_percent"] = interface.r_battery_percent
if hasattr(interface, "bitrate"): if hasattr(interface, "bitrate"):
if interface.bitrate != None: if interface.bitrate != None: ifstats["bitrate"] = interface.bitrate
ifstats["bitrate"] = interface.bitrate else: ifstats["bitrate"] = None
else:
ifstats["bitrate"] = None
if hasattr(interface, "current_rx_speed"): if hasattr(interface, "current_rx_speed"):
if interface.current_rx_speed != None: if interface.current_rx_speed != None: ifstats["rxs"] = interface.current_rx_speed
ifstats["rxs"] = interface.current_rx_speed else: ifstats["rxs"] = 0
else: else: ifstats["rxs"] = 0
ifstats["rxs"] = 0
else:
ifstats["rxs"] = 0
if hasattr(interface, "current_tx_speed"): if hasattr(interface, "current_tx_speed"):
if interface.current_tx_speed != None: if interface.current_tx_speed != None: ifstats["txs"] = interface.current_tx_speed
ifstats["txs"] = interface.current_tx_speed else: ifstats["txs"] = 0
else: else: ifstats["txs"] = 0
ifstats["txs"] = 0
else:
ifstats["txs"] = 0
if hasattr(interface, "peers"): if hasattr(interface, "peers"):
if interface.peers != None: if interface.peers != None: ifstats["peers"] = len(interface.peers)
ifstats["peers"] = len(interface.peers) else: ifstats["peers"] = None
else:
ifstats["peers"] = None
if hasattr(interface, "ifac_signature"): if hasattr(interface, "ifac_signature"):
ifstats["ifac_signature"] = interface.ifac_signature ifstats["ifac_signature"] = interface.ifac_signature
@@ -1420,57 +1405,55 @@ class Reticulum:
ifstats["ifac_netname"] = interface.ifac_netname ifstats["ifac_netname"] = interface.ifac_netname
else: else:
ifstats["ifac_signature"] = None ifstats["ifac_signature"] = None
ifstats["ifac_size"] = None ifstats["ifac_size"] = None
ifstats["ifac_netname"] = None ifstats["ifac_netname"] = None
if hasattr(interface, "autoconnect_source"): if hasattr(interface, "autoconnect_source"): ifstats["autoconnect_source"] = interface.autoconnect_source
ifstats["autoconnect_source"] = interface.autoconnect_source else: ifstats["autoconnect_source"] = None
else:
ifstats["autoconnect_source"] = None
if hasattr(interface, "announce_queue"): if hasattr(interface, "announce_queue"):
if interface.announce_queue != None: if interface.announce_queue != None: ifstats["announce_queue"] = len(interface.announce_queue)
ifstats["announce_queue"] = len(interface.announce_queue) else: ifstats["announce_queue"] = None
else:
ifstats["announce_queue"] = None
ifstats["name"] = str(interface) if hasattr(interface, "blocked_ip_count"):
ifstats["short_name"] = str(interface.name) ifstats["blocked_ips"] = interface.blocked_ip_count
ifstats["hash"] = interface.get_hash()
ifstats["type"] = str(type(interface).__name__) ifstats["name"] = str(interface)
ifstats["rxb"] = interface.rxb ifstats["short_name"] = str(interface.name)
ifstats["txb"] = interface.txb ifstats["hash"] = interface.get_hash()
ifstats["type"] = str(type(interface).__name__)
ifstats["rxb"] = interface.rxb
ifstats["txb"] = interface.txb
ifstats["incoming_announce_frequency"] = interface.incoming_announce_frequency() ifstats["incoming_announce_frequency"] = interface.incoming_announce_frequency()
ifstats["outgoing_announce_frequency"] = interface.outgoing_announce_frequency() ifstats["outgoing_announce_frequency"] = interface.outgoing_announce_frequency()
ifstats["incoming_pr_frequency"] = interface.incoming_pr_frequency() ifstats["incoming_pr_frequency"] = interface.incoming_pr_frequency()
ifstats["outgoing_pr_frequency"] = interface.outgoing_pr_frequency() ifstats["outgoing_pr_frequency"] = interface.outgoing_pr_frequency()
ifstats["announce_rate_target"] = interface.announce_rate_target ifstats["announce_rate_target"] = interface.announce_rate_target
ifstats["announce_rate_penalty"] = interface.announce_rate_penalty ifstats["announce_rate_penalty"] = interface.announce_rate_penalty
ifstats["announce_rate_grace"] = interface.announce_rate_grace ifstats["announce_rate_grace"] = interface.announce_rate_grace
ifstats["held_announces"] = len(interface.held_announces) ifstats["held_announces"] = len(interface.held_announces)
ifstats["burst_active"] = interface.ic_burst_active ifstats["burst_active"] = interface.ic_burst_active
ifstats["burst_activated"] = interface.ic_burst_activated ifstats["burst_activated"] = interface.ic_burst_activated
ifstats["pr_burst_active"] = interface.ic_pr_burst_active ifstats["pr_burst_active"] = interface.ic_pr_burst_active
ifstats["pr_burst_activated"] = interface.ic_pr_burst_activated ifstats["pr_burst_activated"] = interface.ic_pr_burst_activated
ifstats["status"] = interface.online ifstats["status"] = interface.online
ifstats["mode"] = interface.mode ifstats["mode"] = interface.mode
interfaces.append(ifstats) interfaces.append(ifstats)
stats = {} stats = {}
stats["interfaces"] = interfaces stats["interfaces"] = interfaces
stats["rxb"] = RNS.Transport.traffic_rxb stats["rxb"] = RNS.Transport.traffic_rxb
stats["txb"] = RNS.Transport.traffic_txb stats["txb"] = RNS.Transport.traffic_txb
stats["rxs"] = RNS.Transport.speed_rx stats["rxs"] = RNS.Transport.speed_rx
stats["txs"] = RNS.Transport.speed_tx stats["txs"] = RNS.Transport.speed_tx
if Reticulum.transport_enabled(): if Reticulum.transport_enabled():
stats["transport_id"] = RNS.Transport.identity.hash stats["transport_id"] = RNS.Transport.identity.hash
stats["network_id"] = RNS.Transport.network_identity.hash if RNS.Transport.network_identity else None stats["network_id"] = RNS.Transport.network_identity.hash if RNS.Transport.network_identity else None
stats["transport_uptime"] = time.time()-RNS.Transport.start_time stats["transport_uptime"] = time.time()-RNS.Transport.start_time
if Reticulum.probe_destination_enabled(): if Reticulum.probe_destination_enabled(): stats["probe_responder"] = RNS.Transport.probe_destination.hash
stats["probe_responder"] = RNS.Transport.probe_destination.hash else: stats["probe_responder"] = None
else:
stats["probe_responder"] = None
if importlib.util.find_spec('psutil') != None: if importlib.util.find_spec('psutil') != None:
import psutil import psutil
@@ -1484,8 +1467,8 @@ class Reticulum:
def get_path_table(self, max_hops=None): def get_path_table(self, max_hops=None):
if self.is_connected_to_shared_instance: if self.is_connected_to_shared_instance:
rpc_connection = self.get_rpc_client() rpc_connection = self.get_rpc_client()
rpc_connection.send({"get": "path_table", "max_hops": max_hops}) rpc_connection.send_bytes(mp.packb({"get": "path_table", "max_hops": max_hops}))
response = rpc_connection.recv() response = mp.unpackb(rpc_connection.recv_bytes())
return response return response
else: else:
@@ -1493,14 +1476,10 @@ class Reticulum:
for dst_hash in RNS.Transport.path_table: for dst_hash in RNS.Transport.path_table:
path_hops = RNS.Transport.path_table[dst_hash][2] path_hops = RNS.Transport.path_table[dst_hash][2]
if max_hops == None or path_hops <= max_hops: if max_hops == None or path_hops <= max_hops:
entry = { entry = { "hash": dst_hash, "timestamp": RNS.Transport.path_table[dst_hash][0],
"hash": dst_hash, "via": RNS.Transport.path_table[dst_hash][1], "hops": path_hops,
"timestamp": RNS.Transport.path_table[dst_hash][0], "expires": RNS.Transport.path_table[dst_hash][3],
"via": RNS.Transport.path_table[dst_hash][1], "interface": str(RNS.Transport.path_table[dst_hash][5]) }
"hops": path_hops,
"expires": RNS.Transport.path_table[dst_hash][3],
"interface": str(RNS.Transport.path_table[dst_hash][5]),
}
path_table.append(entry) path_table.append(entry)
return path_table return path_table
@@ -1508,8 +1487,8 @@ class Reticulum:
def get_rate_table(self): def get_rate_table(self):
if self.is_connected_to_shared_instance: if self.is_connected_to_shared_instance:
rpc_connection = self.get_rpc_client() rpc_connection = self.get_rpc_client()
rpc_connection.send({"get": "rate_table"}) rpc_connection.send_bytes(mp.packb({"get": "rate_table"}))
response = rpc_connection.recv() response = mp.unpackb(rpc_connection.recv_bytes())
return response return response
else: else:
@@ -1529,8 +1508,8 @@ class Reticulum:
def drop_path(self, destination): def drop_path(self, destination):
if self.is_connected_to_shared_instance: if self.is_connected_to_shared_instance:
rpc_connection = self.get_rpc_client() rpc_connection = self.get_rpc_client()
rpc_connection.send({"drop": "path", "destination_hash": destination}) rpc_connection.send_bytes(mp.packb({"drop": "path", "destination_hash": destination}))
response = rpc_connection.recv() response = mp.unpackb(rpc_connection.recv_bytes())
return response return response
else: else:
@@ -1539,8 +1518,8 @@ class Reticulum:
def drop_all_via(self, transport_hash): def drop_all_via(self, transport_hash):
if self.is_connected_to_shared_instance: if self.is_connected_to_shared_instance:
rpc_connection = self.get_rpc_client() rpc_connection = self.get_rpc_client()
rpc_connection.send({"drop": "all_via", "destination_hash": transport_hash}) rpc_connection.send_bytes(mp.packb({"drop": "all_via", "destination_hash": transport_hash}))
response = rpc_connection.recv() response = mp.unpackb(rpc_connection.recv_bytes())
return response return response
else: else:
@@ -1555,8 +1534,8 @@ class Reticulum:
def drop_announce_queues(self): def drop_announce_queues(self):
if self.is_connected_to_shared_instance: if self.is_connected_to_shared_instance:
rpc_connection = self.get_rpc_client() rpc_connection = self.get_rpc_client()
rpc_connection.send({"drop": "announce_queues"}) rpc_connection.send_bytes(mp.packb({"drop": "announce_queues"}))
response = rpc_connection.recv() response = mp.unpackb(rpc_connection.recv_bytes())
return response return response
else: else:
@@ -1565,8 +1544,8 @@ class Reticulum:
def get_next_hop_if_name(self, destination): def get_next_hop_if_name(self, destination):
if self.is_connected_to_shared_instance: if self.is_connected_to_shared_instance:
rpc_connection = self.get_rpc_client() rpc_connection = self.get_rpc_client()
rpc_connection.send({"get": "next_hop_if_name", "destination_hash": destination}) rpc_connection.send_bytes(mp.packb({"get": "next_hop_if_name", "destination_hash": destination}))
response = rpc_connection.recv() response = mp.unpackb(rpc_connection.recv_bytes())
return response return response
else: else:
@@ -1576,8 +1555,8 @@ class Reticulum:
if self.is_connected_to_shared_instance: if self.is_connected_to_shared_instance:
try: try:
rpc_connection = self.get_rpc_client() rpc_connection = self.get_rpc_client()
rpc_connection.send({"get": "first_hop_timeout", "destination_hash": destination}) rpc_connection.send_bytes(mp.packb({"get": "first_hop_timeout", "destination_hash": destination}))
response = rpc_connection.recv() response = mp.unpackb(rpc_connection.recv_bytes())
if self.is_connected_to_shared_instance and hasattr(self, "_force_shared_instance_bitrate") and self._force_shared_instance_bitrate: if self.is_connected_to_shared_instance and hasattr(self, "_force_shared_instance_bitrate") and self._force_shared_instance_bitrate:
simulated_latency = ((1/self._force_shared_instance_bitrate)*8)*RNS.Reticulum.MTU simulated_latency = ((1/self._force_shared_instance_bitrate)*8)*RNS.Reticulum.MTU
@@ -1595,8 +1574,8 @@ class Reticulum:
def get_next_hop(self, destination): def get_next_hop(self, destination):
if self.is_connected_to_shared_instance: if self.is_connected_to_shared_instance:
rpc_connection = self.get_rpc_client() rpc_connection = self.get_rpc_client()
rpc_connection.send({"get": "next_hop", "destination_hash": destination}) rpc_connection.send_bytes(mp.packb({"get": "next_hop", "destination_hash": destination}))
response = rpc_connection.recv() response = mp.unpackb(rpc_connection.recv_bytes())
return response return response
@@ -1606,8 +1585,8 @@ class Reticulum:
def get_link_count(self): def get_link_count(self):
if self.is_connected_to_shared_instance: if self.is_connected_to_shared_instance:
rpc_connection = self.get_rpc_client() rpc_connection = self.get_rpc_client()
rpc_connection.send({"get": "link_count"}) rpc_connection.send_bytes(mp.packb({"get": "link_count"}))
response = rpc_connection.recv() response = mp.unpackb(rpc_connection.recv_bytes())
return response return response
else: else:
@@ -1616,8 +1595,8 @@ class Reticulum:
def get_packet_rssi(self, packet_hash): def get_packet_rssi(self, packet_hash):
if self.is_connected_to_shared_instance: if self.is_connected_to_shared_instance:
rpc_connection = self.get_rpc_client() rpc_connection = self.get_rpc_client()
rpc_connection.send({"get": "packet_rssi", "packet_hash": packet_hash}) rpc_connection.send_bytes(mp.packb({"get": "packet_rssi", "packet_hash": packet_hash}))
response = rpc_connection.recv() response = mp.unpackb(rpc_connection.recv_bytes())
return response return response
else: else:
@@ -1630,8 +1609,8 @@ class Reticulum:
def get_packet_snr(self, packet_hash): def get_packet_snr(self, packet_hash):
if self.is_connected_to_shared_instance: if self.is_connected_to_shared_instance:
rpc_connection = self.get_rpc_client() rpc_connection = self.get_rpc_client()
rpc_connection.send({"get": "packet_snr", "packet_hash": packet_hash}) rpc_connection.send_bytes(mp.packb({"get": "packet_snr", "packet_hash": packet_hash}))
response = rpc_connection.recv() response = mp.unpackb(rpc_connection.recv_bytes())
return response return response
else: else:
@@ -1644,8 +1623,8 @@ class Reticulum:
def get_packet_q(self, packet_hash): def get_packet_q(self, packet_hash):
if self.is_connected_to_shared_instance: if self.is_connected_to_shared_instance:
rpc_connection = self.get_rpc_client() rpc_connection = self.get_rpc_client()
rpc_connection.send({"get": "packet_q", "packet_hash": packet_hash}) rpc_connection.send_bytes(mp.packb({"get": "packet_q", "packet_hash": packet_hash}))
response = rpc_connection.recv() response = mp.unpackb(rpc_connection.recv_bytes())
return response return response
else: else:
@@ -1667,19 +1646,33 @@ class Reticulum:
def get_blackholed_identities(self): def get_blackholed_identities(self):
if self.is_connected_to_shared_instance: if self.is_connected_to_shared_instance:
rpc_connection = self.get_rpc_client() rpc_connection = self.get_rpc_client()
rpc_connection.send({"get": "blackholed_identities"}) rpc_connection.send_bytes(mp.packb({"get": "blackholed_identities"}))
response = rpc_connection.recv() response = mp.unpackb(rpc_connection.recv_bytes())
return response return response
else: return RNS.Transport.blackholed_identities else: return RNS.Transport.blackholed_identities
def is_blackholed(self, identity):
if type(identity) == RNS.Identity: identity_hash = identity.hash
elif type(identity) == bytes: identity_hash = identity
else: raise TypeError("Invalid identity for blackhole check, must be hash as bytes or RNS.Identity")
if len(identity_hash) != RNS.Reticulum.TRUNCATED_HASHLENGTH//8: raise ValueError("Invalid identity hash length for blackhole check")
if self.is_connected_to_shared_instance:
rpc_connection = self.get_rpc_client()
rpc_connection.send_bytes(mp.packb({"get": "is_blackholed", "identity_hash": identity_hash}))
response = mp.unpackb(rpc_connection.recv_bytes())
return response
else: return identity_hash in RNS.Transport.blackholed_identities
def blackhole_identity(self, identity_hash, until=None, reason=None): def blackhole_identity(self, identity_hash, until=None, reason=None):
if len(identity_hash) != RNS.Reticulum.TRUNCATED_HASHLENGTH//8: return False if len(identity_hash) != RNS.Reticulum.TRUNCATED_HASHLENGTH//8: return False
else: else:
if self.is_connected_to_shared_instance: if self.is_connected_to_shared_instance:
rpc_connection = self.get_rpc_client() rpc_connection = self.get_rpc_client()
rpc_connection.send({"blackhole_identity": identity_hash, "until": until, "reason": reason}) rpc_connection.send_bytes(mp.packb({"blackhole_identity": identity_hash, "until": until, "reason": reason}))
response = rpc_connection.recv() response = mp.unpackb(rpc_connection.recv_bytes())
return response return response
else: return RNS.Transport.blackhole_identity(identity_hash, until=until, reason=reason) else: return RNS.Transport.blackhole_identity(identity_hash, until=until, reason=reason)
@@ -1689,8 +1682,8 @@ class Reticulum:
else: else:
if self.is_connected_to_shared_instance: if self.is_connected_to_shared_instance:
rpc_connection = self.get_rpc_client() rpc_connection = self.get_rpc_client()
rpc_connection.send({"unblackhole_identity": identity_hash}) rpc_connection.send_bytes(mp.packb({"unblackhole_identity": identity_hash}))
response = rpc_connection.recv() response = mp.unpackb(rpc_connection.recv_bytes())
return response return response
else: return RNS.Transport.unblackhole_identity(identity_hash) else: return RNS.Transport.unblackhole_identity(identity_hash)
@@ -1779,6 +1772,10 @@ class Reticulum:
""" """
return Reticulum.__blackhole_sources return Reticulum.__blackhole_sources
@staticmethod
def blackhole_update_interval():
return Reticulum.__blackhole_update_interval
@staticmethod @staticmethod
def discovered_interfaces(): def discovered_interfaces():
""" """
@@ -1806,6 +1803,14 @@ class Reticulum:
def max_autoconnected_interfaces(): def max_autoconnected_interfaces():
return Reticulum.__autoconnect_discovered_interfaces return Reticulum.__autoconnect_discovered_interfaces
@staticmethod
def static_transport_identity():
return Reticulum.__static_transport_identity
@staticmethod
def local_hops_delta():
return Reticulum.__local_hops_delta
# Default configuration file: # Default configuration file:
__default_rns_config__ = '''# This is the default Reticulum config file. __default_rns_config__ = '''# This is the default Reticulum config file.
# You should probably edit it to include any additional, # You should probably edit it to include any additional,
@@ -1893,7 +1898,7 @@ instance_name = default
[logging] [logging]
# Valid log levels are 0 through 7: # Valid log levels are 0 through 8:
# 0: Log only critical information # 0: Log only critical information
# 1: Log errors and lower log levels # 1: Log errors and lower log levels
# 2: Log warnings and lower log levels # 2: Log warnings and lower log levels
@@ -1901,7 +1906,8 @@ instance_name = default
# 4: Log info and lower (this is the default) # 4: Log info and lower (this is the default)
# 5: Verbose logging # 5: Verbose logging
# 6: Debug logging # 6: Debug logging
# 7: Extreme logging # 7: Path logging
# 8: Extreme logging
loglevel = 4 loglevel = 4
+199 -172
View File
@@ -166,6 +166,7 @@ class Transport:
local_client_rssi_cache = [] local_client_rssi_cache = []
local_client_snr_cache = [] local_client_snr_cache = []
local_client_q_cache = [] local_client_q_cache = []
local_hops_delta = 0
LOCAL_CLIENT_CACHE_MAXSIZE = 512 LOCAL_CLIENT_CACHE_MAXSIZE = 512
pending_local_path_requests = {} pending_local_path_requests = {}
@@ -207,8 +208,12 @@ class Transport:
identity = None identity = None
network_identity = None network_identity = None
_identity = None
_should_run = True _should_run = True
@staticmethod
def internal_identity(): return Transport._identity
@staticmethod @staticmethod
def start(reticulum_instance): def start(reticulum_instance):
Transport.owner = reticulum_instance Transport.owner = reticulum_instance
@@ -225,6 +230,14 @@ class Transport:
else: else:
RNS.log("Loaded Transport Identity from storage", RNS.LOG_VERBOSE) if RNS.sl(RNS.LOG_VERBOSE) else None RNS.log("Loaded Transport Identity from storage", RNS.LOG_VERBOSE) if RNS.sl(RNS.LOG_VERBOSE) else None
Transport._identity = Transport.identity
if not RNS.Reticulum.transport_enabled() and not RNS.Reticulum.static_transport_identity():
Transport._identity = Transport.identity
Transport.identity = RNS.Identity()
RNS.log(f"Initialized ephemeral transport identity {RNS.prettyhexrep(Transport.identity.hash)}", RNS.LOG_VERBOSE) if RNS.sl(RNS.LOG_VERBOSE) else None
if RNS.Reticulum.local_hops_delta(): Transport.local_hops_delta = (ord(os.urandom(1))%6)+2
packet_hashlist_path = RNS.Reticulum.storagepath+"/packet_hashlist" packet_hashlist_path = RNS.Reticulum.storagepath+"/packet_hashlist"
if not Transport.owner.is_connected_to_shared_instance: if not Transport.owner.is_connected_to_shared_instance:
if os.path.isfile(packet_hashlist_path): if os.path.isfile(packet_hashlist_path):
@@ -316,7 +329,7 @@ class Transport:
del path_identity del path_identity
if announce_packet != None and receiving_interface != None and blackholed == False: if announce_packet != None and receiving_interface != None and blackholed == False:
announce_packet.unpack() if not announce_packet.unpack(): continue
# We increase the hops, since reading a packet # We increase the hops, since reading a packet
# from cache is equivalent to receiving it again # from cache is equivalent to receiving it again
# over an interface. It is cached with it's non- # over an interface. It is cached with it's non-
@@ -324,15 +337,15 @@ class Transport:
announce_packet.hops += 1 announce_packet.hops += 1
with Transport.path_table_lock: with Transport.path_table_lock:
Transport.path_table[destination_hash] = [timestamp, received_from, hops, expires, random_blobs, receiving_interface, announce_packet.packet_hash] Transport.path_table[destination_hash] = [timestamp, received_from, hops, expires, random_blobs, receiving_interface, announce_packet.packet_hash]
RNS.log("Loaded path table entry for "+RNS.prettyhexrep(destination_hash)+" from storage", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log("Loaded path table entry for "+RNS.prettyhexrep(destination_hash)+" from storage", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
else: else:
RNS.log("Could not reconstruct path table entry from storage for "+RNS.prettyhexrep(destination_hash), RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log("Could not reconstruct path table entry from storage for "+RNS.prettyhexrep(destination_hash), RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
if announce_packet == None: if announce_packet == None:
RNS.log("The announce packet could not be loaded from cache", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log("The announce packet could not be loaded from cache", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
if receiving_interface == None: if receiving_interface == None:
RNS.log("The interface is no longer available", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log("The interface is no longer available", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
if blackholed: if blackholed:
RNS.log("The associated identity is blackholed", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log("The associated identity is blackholed", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
if len(Transport.path_table) == 1: specifier = "entry" if len(Transport.path_table) == 1: specifier = "entry"
else: specifier = "entries" else: specifier = "entries"
@@ -369,7 +382,7 @@ class Transport:
announce_packet = Transport.get_cached_packet(serialised_entry[7], packet_type="announce") announce_packet = Transport.get_cached_packet(serialised_entry[7], packet_type="announce")
if announce_packet != None: if announce_packet != None:
announce_packet.unpack() if not announce_packet.unpack(): continue
# We increase the hops, since reading a packet # We increase the hops, since reading a packet
# from cache is equivalent to receiving it again # from cache is equivalent to receiving it again
# over an interface. It is cached with it's non- # over an interface. It is cached with it's non-
@@ -493,8 +506,7 @@ class Transport:
Transport.speed_rx = rxs Transport.speed_rx = rxs
Transport.speed_tx = txs Transport.speed_tx = txs
except Exception as e: except Exception as e: RNS.log(f"An error occurred while counting interface traffic: {e}", RNS.LOG_ERROR)
RNS.log(f"An error occurred while counting interface traffic: {e}", RNS.LOG_ERROR)
@staticmethod @staticmethod
def jobloop(): def jobloop():
@@ -534,7 +546,7 @@ class Transport:
last_path_request = Transport.path_requests[link.destination.hash] last_path_request = Transport.path_requests[link.destination.hash]
if time.time() - last_path_request > Transport.PATH_REQUEST_MI: if time.time() - last_path_request > Transport.PATH_REQUEST_MI:
RNS.log("Trying to rediscover path for "+RNS.prettyhexrep(link.destination.hash)+" since an attempted link was never established", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log("Trying to rediscover path for "+RNS.prettyhexrep(link.destination.hash)+" since an attempted link was never established", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
if not link.destination.hash in path_requests: if not link.destination.hash in path_requests:
blocked_if = None blocked_if = None
path_requests[link.destination.hash] = blocked_if path_requests[link.destination.hash] = blocked_if
@@ -595,7 +607,7 @@ class Transport:
announce_data = packet.data announce_data = packet.data
announce_identity = RNS.Identity.recall(packet.destination_hash, _no_use=True) announce_identity = RNS.Identity.recall(packet.destination_hash, _no_use=True)
if not announce_identity: if not announce_identity:
RNS.log("Completed announce processing for "+RNS.prettyhexrep(destination_hash)+", the path was cleaned while waiting for announce rebroadcast", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log("Completed announce processing for "+RNS.prettyhexrep(destination_hash)+", the path was cleaned while waiting for announce rebroadcast", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
completed_announces.append(destination_hash) completed_announces.append(destination_hash)
else: else:
@@ -614,12 +626,12 @@ class Transport:
context_flag = packet.context_flag) context_flag = packet.context_flag)
new_packet.hops = announce_entry[4] new_packet.hops = announce_entry[4]
if block_rebroadcasts: RNS.log("Rebroadcasting announce as path response for "+RNS.prettyhexrep(announce_destination.hash)+" with hop count "+str(new_packet.hops), RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None if block_rebroadcasts: RNS.log("Rebroadcasting announce as path response for "+RNS.prettyhexrep(announce_destination.hash)+" with hop count "+str(new_packet.hops), RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
else: RNS.log("Rebroadcasting announce for "+RNS.prettyhexrep(announce_destination.hash)+" with hop count "+str(new_packet.hops), RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None else: RNS.log("Rebroadcasting announce for "+RNS.prettyhexrep(announce_destination.hash)+" with hop count "+str(new_packet.hops), RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
outgoing.append(new_packet) outgoing.append(new_packet)
# This handles an edge case where a peer sends a past # This handles an edge case where a peer sends a path
# request for a destination just after an announce for # request for a destination just after an announce for
# said destination has arrived, but before it has been # said destination has arrived, but before it has been
# rebroadcast locally. In such a case the actual announce # rebroadcast locally. In such a case the actual announce
@@ -628,7 +640,7 @@ class Transport:
if destination_hash in Transport.held_announces: if destination_hash in Transport.held_announces:
held_entry = Transport.held_announces.pop(destination_hash) held_entry = Transport.held_announces.pop(destination_hash)
Transport.announce_table[destination_hash] = held_entry Transport.announce_table[destination_hash] = held_entry
RNS.log("Reinserting held announce into table", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log("Reinserting held announce into table", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
for destination_hash in completed_announces: for destination_hash in completed_announces:
if destination_hash in Transport.announce_table: Transport.announce_table.pop(destination_hash) if destination_hash in Transport.announce_table: Transport.announce_table.pop(destination_hash)
@@ -704,14 +716,14 @@ class Transport:
# If the path has been invalidated between the time of # If the path has been invalidated between the time of
# making the link request and now, try to rediscover it # making the link request and now, try to rediscover it
if not Transport.has_path(link_entry[IDX_LT_DSTHASH]): if not Transport.has_path(link_entry[IDX_LT_DSTHASH]):
RNS.log("Trying to rediscover path for "+RNS.prettyhexrep(link_entry[IDX_LT_DSTHASH])+" since an attempted link was never established, and path is now missing", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log("Trying to rediscover path for "+RNS.prettyhexrep(link_entry[IDX_LT_DSTHASH])+" since an attempted link was never established, and path is now missing", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
path_request_conditions = True path_request_conditions = True
# If this link request was originated from a local client # If this link request was originated from a local client
# attempt to rediscover a path to the destination, if this # attempt to rediscover a path to the destination, if this
# has not already happened recently. # has not already happened recently.
elif not path_request_throttle and lr_taken_hops == 0: elif not path_request_throttle and lr_taken_hops == 0:
RNS.log("Trying to rediscover path for "+RNS.prettyhexrep(link_entry[IDX_LT_DSTHASH])+" since an attempted local client link was never established", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log("Trying to rediscover path for "+RNS.prettyhexrep(link_entry[IDX_LT_DSTHASH])+" since an attempted local client link was never established", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
path_request_conditions = True path_request_conditions = True
# If the link destination was previously only 1 hop # If the link destination was previously only 1 hop
@@ -720,7 +732,7 @@ class Transport:
# In that case, try to discover a new path, and mark # In that case, try to discover a new path, and mark
# the old one as unresponsive. # the old one as unresponsive.
elif not path_request_throttle and Transport.hops_to(link_entry[IDX_LT_DSTHASH]) == 1: elif not path_request_throttle and Transport.hops_to(link_entry[IDX_LT_DSTHASH]) == 1:
RNS.log("Trying to rediscover path for "+RNS.prettyhexrep(link_entry[IDX_LT_DSTHASH])+" since an attempted link was never established, and destination was previously local to an interface on this instance", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log("Trying to rediscover path for "+RNS.prettyhexrep(link_entry[IDX_LT_DSTHASH])+" since an attempted link was never established, and destination was previously local to an interface on this instance", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
path_request_conditions = True path_request_conditions = True
blocked_if = link_entry[IDX_LT_RCVD_IF] blocked_if = link_entry[IDX_LT_RCVD_IF]
@@ -742,7 +754,7 @@ class Transport:
# changed. In that case, we try to discover a new path, # changed. In that case, we try to discover a new path,
# and mark the old one as potentially unresponsive. # and mark the old one as potentially unresponsive.
elif not path_request_throttle and lr_taken_hops == 1: elif not path_request_throttle and lr_taken_hops == 1:
RNS.log("Trying to rediscover path for "+RNS.prettyhexrep(link_entry[IDX_LT_DSTHASH])+" since an attempted link was never established, and link initiator is local to an interface on this instance", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log("Trying to rediscover path for "+RNS.prettyhexrep(link_entry[IDX_LT_DSTHASH])+" since an attempted link was never established, and link initiator is local to an interface on this instance", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
path_request_conditions = True path_request_conditions = True
blocked_if = link_entry[IDX_LT_RCVD_IF] blocked_if = link_entry[IDX_LT_RCVD_IF]
@@ -778,11 +790,11 @@ class Transport:
if time.time() > destination_expiry: if time.time() > destination_expiry:
stale_paths.append(destination_hash) stale_paths.append(destination_hash)
should_collect = True should_collect = True
RNS.log("Path to "+RNS.prettyhexrep(destination_hash)+" timed out and was removed", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log("Path to "+RNS.prettyhexrep(destination_hash)+" timed out and was removed", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
elif not attached_interface in Transport.interfaces: elif not attached_interface in Transport.interfaces:
stale_paths.append(destination_hash) stale_paths.append(destination_hash)
should_collect = True should_collect = True
RNS.log("Path to "+RNS.prettyhexrep(destination_hash)+" was removed since the attached interface no longer exists", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log("Path to "+RNS.prettyhexrep(destination_hash)+" was removed since the attached interface no longer exists", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
# Cull the pending path requests table # Cull the pending path requests table
stale_path_requests = [] stale_path_requests = []
@@ -805,7 +817,7 @@ class Transport:
if time.time() > entry["timeout"]: if time.time() > entry["timeout"]:
stale_discovery_path_requests.append(destination_hash) stale_discovery_path_requests.append(destination_hash)
should_collect = True should_collect = True
RNS.log("Waiting path request for "+RNS.prettyhexrep(destination_hash)+" timed out and was removed", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log("Waiting path request for "+RNS.prettyhexrep(destination_hash)+" timed out and was removed", RNS.LOG_EXTREME) if RNS.sl(RNS.LOG_EXTREME) else None
# Cull the tunnel table # Cull the tunnel table
stale_tunnels = []; ti = 0 stale_tunnels = []; ti = 0
@@ -1135,7 +1147,7 @@ class Transport:
# Insert packet into transport # Insert packet into transport
new_flags = (RNS.Packet.HEADER_2) << 6 | (Transport.TRANSPORT) << 4 | (packet.flags & 0b00001111) new_flags = (RNS.Packet.HEADER_2) << 6 | (Transport.TRANSPORT) << 4 | (packet.flags & 0b00001111)
new_raw = struct.pack("!B", new_flags) new_raw = struct.pack("!B", new_flags)
new_raw += packet.raw[1:2] new_raw += packet.raw[1:2] if not Transport.should_apply_delta(packet, outbound_interface) else struct.pack("!B", Transport.local_hops_delta)
new_raw += path_entry[IDX_PT_NEXT_HOP] new_raw += path_entry[IDX_PT_NEXT_HOP]
new_raw += packet.raw[2:] new_raw += packet.raw[2:]
packet_sent(packet) packet_sent(packet)
@@ -1155,7 +1167,7 @@ class Transport:
# Insert packet into transport # Insert packet into transport
new_flags = (RNS.Packet.HEADER_2) << 6 | (Transport.TRANSPORT) << 4 | (packet.flags & 0b00001111) new_flags = (RNS.Packet.HEADER_2) << 6 | (Transport.TRANSPORT) << 4 | (packet.flags & 0b00001111)
new_raw = struct.pack("!B", new_flags) new_raw = struct.pack("!B", new_flags)
new_raw += packet.raw[1:2] new_raw += packet.raw[1:2] if not Transport.should_apply_delta(packet, outbound_interface) else struct.pack("!B", Transport.local_hops_delta)
new_raw += path_entry[IDX_PT_NEXT_HOP] new_raw += path_entry[IDX_PT_NEXT_HOP]
new_raw += packet.raw[2:] new_raw += packet.raw[2:]
packet_sent(packet) packet_sent(packet)
@@ -1168,7 +1180,9 @@ class Transport:
# simply transmit the packet directly on that one. # simply transmit the packet directly on that one.
else: else:
packet_sent(packet) packet_sent(packet)
Transport.transmit(outbound_interface, packet.raw) if not Transport.should_apply_delta(packet, outbound_interface): raw = packet.raw
else: raw = Transport.mangle_hops(packet.raw, Transport.local_hops_delta)
Transport.transmit(outbound_interface, raw)
sent = True sent = True
# If we don't have a known path for the destination, we'll # If we don't have a known path for the destination, we'll
@@ -1182,63 +1196,68 @@ class Transport:
should_transmit = True should_transmit = True
if packet.destination.type == RNS.Destination.LINK: if packet.destination.type == RNS.Destination.LINK:
if packet.destination.status == RNS.Link.CLOSED: should_transmit = False if packet.destination.status == RNS.Link.CLOSED: continue
if interface != packet.destination.attached_interface: should_transmit = False if interface != packet.destination.attached_interface: continue
if packet.attached_interface != None and interface != packet.attached_interface: if packet.attached_interface != None and interface != packet.attached_interface: continue
should_transmit = False
if packet.packet_type == RNS.Packet.ANNOUNCE: if packet.packet_type == RNS.Packet.ANNOUNCE:
if packet.attached_interface == None: if packet.attached_interface == None:
if interface.mode == RNS.Interfaces.Interface.Interface.MODE_ACCESS_POINT: ac_loglevel = RNS.LOG_PATHING
RNS.log("Blocking announce broadcast on "+str(interface)+" due to AP mode", RNS.LOG_EXTREME) if RNS.sl(RNS.LOG_EXTREME) else None from_interface = Transport.next_hop_interface(packet.destination_hash)
local_destination = None
with Transport.destinations_map_lock:
if packet.destination_hash in Transport.destinations_map:
local_destination = Transport.destinations_map[packet.destination_hash]
if not local_destination and from_interface == None:
RNS.log("Blocking announce broadcast on "+str(interface)+" since next hop interface doesn't exist", ac_loglevel) if RNS.sl(ac_loglevel) else None
should_transmit = False should_transmit = False
elif interface.mode == RNS.Interfaces.Interface.Interface.MODE_ROAMING: elif not local_destination and interface.announces_from_internal == False and from_interface.mode == RNS.Interfaces.Interface.Interface.MODE_INTERNAL:
local_destination = None RNS.log("Blocking announce broadcast on "+str(interface)+" due to internal-mode next hop interface", ac_loglevel) if RNS.sl(ac_loglevel) else None
with Transport.destinations_map_lock: should_transmit = False
if packet.destination_hash in Transport.destinations_map:
local_destination = Transport.destinations_map[packet.destination_hash]
elif interface.mode == RNS.Interfaces.Interface.Interface.MODE_ACCESS_POINT:
RNS.log("Blocking announce broadcast on "+str(interface)+" due to AP mode", ac_loglevel) if RNS.sl(ac_loglevel) else None
should_transmit = False
elif not local_destination and interface.mode == RNS.Interfaces.Interface.Interface.MODE_INTERNAL:
if not hasattr(from_interface, "mode"):
should_transmit = False
RNS.log("Blocking announce broadcast on "+str(interface)+" since next hop interface has no mode configured", ac_loglevel) if RNS.sl(ac_loglevel) else None
else:
if from_interface.mode == RNS.Interfaces.Interface.Interface.MODE_BOUNDARY:
RNS.log("Blocking announce broadcast on "+str(interface)+" due to boundary-mode next-hop interface", ac_loglevel) if RNS.sl(ac_loglevel) else None
should_transmit = False
elif interface.mode == RNS.Interfaces.Interface.Interface.MODE_ROAMING:
if local_destination != None: if local_destination != None:
# RNS.log("Allowing announce broadcast on roaming-mode interface from instance-local destination", RNS.LOG_EXTREME) if RNS.sl(RNS.LOG_EXTREME) else None # RNS.log("Allowing announce broadcast on roaming-mode interface from instance-local destination", ac_loglevel) if RNS.sl(ac_loglevel) else None
pass pass
else: else:
from_interface = Transport.next_hop_interface(packet.destination_hash) if not hasattr(from_interface, "mode"):
if from_interface == None or not hasattr(from_interface, "mode"):
should_transmit = False should_transmit = False
if from_interface == None: RNS.log("Blocking announce broadcast on "+str(interface)+" since next hop interface has no mode configured", ac_loglevel) if RNS.sl(ac_loglevel) else None
RNS.log("Blocking announce broadcast on "+str(interface)+" since next hop interface doesn't exist", RNS.LOG_EXTREME) if RNS.sl(RNS.LOG_EXTREME) else None
elif not hasattr(from_interface, "mode"):
RNS.log("Blocking announce broadcast on "+str(interface)+" since next hop interface has no mode configured", RNS.LOG_EXTREME) if RNS.sl(RNS.LOG_EXTREME) else None
else: else:
if from_interface.mode == RNS.Interfaces.Interface.Interface.MODE_ROAMING: if from_interface.mode == RNS.Interfaces.Interface.Interface.MODE_ROAMING:
RNS.log("Blocking announce broadcast on "+str(interface)+" due to roaming-mode next-hop interface", RNS.LOG_EXTREME) if RNS.sl(RNS.LOG_EXTREME) else None RNS.log("Blocking announce broadcast on "+str(interface)+" due to roaming-mode next-hop interface", ac_loglevel) if RNS.sl(ac_loglevel) else None
should_transmit = False should_transmit = False
elif from_interface.mode == RNS.Interfaces.Interface.Interface.MODE_BOUNDARY: elif from_interface.mode == RNS.Interfaces.Interface.Interface.MODE_BOUNDARY:
RNS.log("Blocking announce broadcast on "+str(interface)+" due to boundary-mode next-hop interface", RNS.LOG_EXTREME) if RNS.sl(RNS.LOG_EXTREME) else None RNS.log("Blocking announce broadcast on "+str(interface)+" due to boundary-mode next-hop interface", ac_loglevel) if RNS.sl(ac_loglevel) else None
should_transmit = False should_transmit = False
elif interface.mode == RNS.Interfaces.Interface.Interface.MODE_BOUNDARY: elif interface.mode == RNS.Interfaces.Interface.Interface.MODE_BOUNDARY:
local_destination = None
with Transport.destinations_map_lock:
if packet.destination_hash in Transport.destinations_map:
local_destination = Transport.destinations_map[packet.destination_hash]
if local_destination != None: if local_destination != None:
# RNS.log("Allowing announce broadcast on boundary-mode interface from instance-local destination", RNS.LOG_EXTREME) if RNS.sl(RNS.LOG_EXTREME) else None # RNS.log("Allowing announce broadcast on boundary-mode interface from instance-local destination", ac_loglevel) if RNS.sl(ac_loglevel) else None
pass pass
else: else:
from_interface = Transport.next_hop_interface(packet.destination_hash) if not hasattr(from_interface, "mode"):
if from_interface == None or not hasattr(from_interface, "mode"):
should_transmit = False should_transmit = False
if from_interface == None: RNS.log("Blocking announce broadcast on "+str(interface)+" since next hop interface has no mode configured", ac_loglevel) if RNS.sl(ac_loglevel) else None
RNS.log("Blocking announce broadcast on "+str(interface)+" since next hop interface doesn't exist", RNS.LOG_EXTREME) if RNS.sl(RNS.LOG_EXTREME) else None
elif not hasattr(from_interface, "mode"):
RNS.log("Blocking announce broadcast on "+str(interface)+" since next hop interface has no mode configured", RNS.LOG_EXTREME) if RNS.sl(RNS.LOG_EXTREME) else None
else: else:
if from_interface.mode == RNS.Interfaces.Interface.Interface.MODE_ROAMING: if from_interface.mode == RNS.Interfaces.Interface.Interface.MODE_ROAMING:
RNS.log("Blocking announce broadcast on "+str(interface)+" due to roaming-mode next-hop interface", RNS.LOG_EXTREME) if RNS.sl(RNS.LOG_EXTREME) else None RNS.log("Blocking announce broadcast on "+str(interface)+" due to roaming-mode next-hop interface", ac_loglevel) if RNS.sl(ac_loglevel) else None
should_transmit = False should_transmit = False
else: else:
@@ -1317,7 +1336,12 @@ class Transport:
Transport.add_packet_hash(packet.packet_hash) Transport.add_packet_hash(packet.packet_hash)
stored_hash = True stored_hash = True
Transport.transmit(interface, packet.raw) if not Transport.should_apply_delta(packet, interface): raw = packet.raw
else:
if packet.packet_type != RNS.Packet.ANNOUNCE: raw = Transport.mangle_hops(packet.raw, Transport.local_hops_delta)
else: raw = Transport.mangle_hops(packet.raw, Transport.local_hops_delta, transport_insert=packet.header_type==RNS.Packet.HEADER_1)
Transport.transmit(interface, raw)
if packet.packet_type == RNS.Packet.ANNOUNCE: interface.sent_announce() if packet.packet_type == RNS.Packet.ANNOUNCE: interface.sent_announce()
if packet.destination.type == RNS.Destination.PLAIN and packet.is_outbound_pr: interface.sent_path_request() if packet.destination.type == RNS.Destination.PLAIN and packet.is_outbound_pr: interface.sent_path_request()
packet_sent(packet) packet_sent(packet)
@@ -1325,6 +1349,17 @@ class Transport:
return sent return sent
@staticmethod
def should_apply_delta(packet, interface):
return not Transport.owner.is_connected_to_shared_instance and packet.hops == 0 and Transport.local_hops_delta != 0 \
and not packet.destination.type == RNS.Destination.PLAIN and not packet.destination.type == RNS.Destination.GROUP \
and not interface in Transport.local_client_interfaces and not Transport.is_shared_instance(interface)
@staticmethod
def mangle_hops(raw, hops, transport_insert=False):
if not transport_insert: return raw[0:1]+struct.pack("!B", hops)+raw[2:]
else: return struct.pack("!B", ord(raw[0:1]) | (RNS.Packet.HEADER_2<<6) | (Transport.TRANSPORT<<4))+struct.pack("!B", hops)+Transport.identity.hash+raw[2:]
@staticmethod @staticmethod
def add_packet_hash(packet_hash): def add_packet_hash(packet_hash):
if not Transport.owner.is_connected_to_shared_instance: if not Transport.owner.is_connected_to_shared_instance:
@@ -1404,10 +1439,8 @@ class Transport:
ifac = raw[2:2+interface.ifac_size] ifac = raw[2:2+interface.ifac_size]
# Generate mask # Generate mask
mask = RNS.Cryptography.hkdf(length=len(raw), mask = RNS.Cryptography.hkdf(length=len(raw), derive_from=ifac,
derive_from=ifac, salt=interface.ifac_key, context=None)
salt=interface.ifac_key,
context=None)
# Unmask payload # Unmask payload
i = 0; unmasked_raw = b"" i = 0; unmasked_raw = b""
for byte in raw: for byte in raw:
@@ -1509,9 +1542,13 @@ class Transport:
# through a shared Reticulum instance # through a shared Reticulum instance
from_local_client = (packet.receiving_interface in Transport.local_client_interfaces) from_local_client = (packet.receiving_interface in Transport.local_client_interfaces)
for_local_client = (packet.packet_type != RNS.Packet.ANNOUNCE) and (packet.destination_hash in Transport.path_table and Transport.path_table[packet.destination_hash][IDX_PT_HOPS] == 0) for_local_client = (packet.packet_type != RNS.Packet.ANNOUNCE) and (packet.destination_hash in Transport.path_table and Transport.path_table[packet.destination_hash][IDX_PT_HOPS] == 0)
for_local_client_link = (packet.packet_type != RNS.Packet.ANNOUNCE) and (packet.destination_hash in Transport.link_table and Transport.link_table[packet.destination_hash][IDX_LT_RCVD_IF] in Transport.local_client_interfaces) local_client_nh = (packet.packet_type != RNS.Packet.ANNOUNCE) and (packet.destination_hash in Transport.link_table and Transport.link_table[packet.destination_hash][IDX_LT_NH_IF] in Transport.local_client_interfaces)
for_local_client_link |= (packet.packet_type != RNS.Packet.ANNOUNCE) and (packet.destination_hash in Transport.link_table and Transport.link_table[packet.destination_hash][IDX_LT_NH_IF] in Transport.local_client_interfaces) local_client_rh = (packet.packet_type != RNS.Packet.ANNOUNCE) and (packet.destination_hash in Transport.link_table and Transport.link_table[packet.destination_hash][IDX_LT_RCVD_IF] in Transport.local_client_interfaces)
proof_for_local_client = (packet.destination_hash in Transport.reverse_table) and (Transport.reverse_table[packet.destination_hash][IDX_RT_RCVD_IF] in Transport.local_client_interfaces) proof_for_local_client = (packet.destination_hash in Transport.reverse_table) and (Transport.reverse_table[packet.destination_hash][IDX_RT_RCVD_IF] in Transport.local_client_interfaces)
to_local_client = for_local_client or proof_for_local_client
instance_local_link = local_client_nh and local_client_rh
for_local_client_link = local_client_nh or local_client_rh
link_request_handled = False
# Plain broadcast packets from local clients are sent # Plain broadcast packets from local clients are sent
# directly on all attached interfaces, since they are # directly on all attached interfaces, since they are
@@ -1573,10 +1610,23 @@ class Transport:
new_raw += struct.pack("!B", packet.hops) new_raw += struct.pack("!B", packet.hops)
new_raw += packet.raw[(RNS.Identity.TRUNCATED_HASHLENGTH//8)+2:] new_raw += packet.raw[(RNS.Identity.TRUNCATED_HASHLENGTH//8)+2:]
elif remaining_hops == 0: elif remaining_hops == 0:
# Just increase hop count and transmit if to_local_client and RNS.Transport.local_hops_delta != 0:
new_raw = packet.raw[0:1] if packet.header_type == RNS.Packet.HEADER_2:
new_raw += struct.pack("!B", packet.hops) # Strip transport headers and transmit
new_raw += packet.raw[2:] new_flags = (RNS.Packet.HEADER_1) << 6 | (Transport.BROADCAST) << 4 | (packet.flags & 0b00001111)
new_raw = struct.pack("!B", new_flags)
new_raw += struct.pack("!B", packet.hops)
new_raw += packet.raw[(RNS.Identity.TRUNCATED_HASHLENGTH//8)+2:]
else:
# Just increase hop count and transmit
new_raw = packet.raw[0:1]
new_raw += struct.pack("!B", packet.hops)
new_raw += packet.raw[2:]
else:
# Just increase hop count and transmit
new_raw = packet.raw[0:1]
new_raw += struct.pack("!B", packet.hops)
new_raw += packet.raw[2:]
outbound_interface = Transport.path_table[packet.destination_hash][IDX_PT_RVCD_IF] outbound_interface = Transport.path_table[packet.destination_hash][IDX_PT_RVCD_IF]
@@ -1591,11 +1641,11 @@ class Transport:
nh_mtu = outbound_interface.HW_MTU nh_mtu = outbound_interface.HW_MTU
if path_mtu: if path_mtu:
if outbound_interface.HW_MTU == None: if outbound_interface.HW_MTU == None:
RNS.log(f"No next-hop HW MTU, disabling link MTU upgrade", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log(f"No next-hop HW MTU, disabling link MTU upgrade", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
path_mtu = None path_mtu = None
new_raw = new_raw[:-RNS.Link.LINK_MTU_SIZE] new_raw = new_raw[:-RNS.Link.LINK_MTU_SIZE]
elif not outbound_interface.AUTOCONFIGURE_MTU and not outbound_interface.FIXED_MTU: elif not outbound_interface.AUTOCONFIGURE_MTU and not outbound_interface.FIXED_MTU:
RNS.log(f"Outbound interface doesn't support MTU autoconfiguration, disabling link MTU upgrade", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log(f"Outbound interface doesn't support MTU autoconfiguration, disabling link MTU upgrade", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
path_mtu = None path_mtu = None
new_raw = new_raw[:-RNS.Link.LINK_MTU_SIZE] new_raw = new_raw[:-RNS.Link.LINK_MTU_SIZE]
else: else:
@@ -1603,7 +1653,7 @@ class Transport:
try: try:
path_mtu = min(nh_mtu, ph_mtu) path_mtu = min(nh_mtu, ph_mtu)
clamped_mtu = RNS.Link.signalling_bytes(path_mtu, mode) clamped_mtu = RNS.Link.signalling_bytes(path_mtu, mode)
RNS.log(f"Clamping link MTU to {RNS.prettysize(path_mtu)}", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log(f"Clamping link MTU to {RNS.prettysize(path_mtu)}", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
new_raw = new_raw[:-RNS.Link.LINK_MTU_SIZE]+clamped_mtu new_raw = new_raw[:-RNS.Link.LINK_MTU_SIZE]+clamped_mtu
except Exception as e: except Exception as e:
RNS.log(f"Dropping link request packet. The contained exception was: {e}", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log(f"Dropping link request packet. The contained exception was: {e}", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None
@@ -1621,6 +1671,7 @@ class Transport:
proof_timeout ] # 8: Proof timeout timestamp proof_timeout ] # 8: Proof timeout timestamp
with Transport.link_table_lock: Transport.link_table[RNS.Link.link_id_from_lr_packet(packet)] = link_entry with Transport.link_table_lock: Transport.link_table[RNS.Link.link_id_from_lr_packet(packet)] = link_entry
link_request_handled = True
else: else:
# Entry format is # Entry format is
@@ -1630,6 +1681,7 @@ class Transport:
with Transport.reverse_table_lock: Transport.reverse_table[packet.getTruncatedHash()] = reverse_entry with Transport.reverse_table_lock: Transport.reverse_table[packet.getTruncatedHash()] = reverse_entry
if Transport.local_hops_delta != 0 and from_local_client and not to_local_client: new_raw = Transport.mangle_hops(new_raw, Transport.local_hops_delta)
Transport.transmit(outbound_interface, new_raw) Transport.transmit(outbound_interface, new_raw)
with Transport.path_table_lock: Transport.path_table[packet.destination_hash][IDX_PT_TIMESTAMP] = time.time() with Transport.path_table_lock: Transport.path_table[packet.destination_hash][IDX_PT_TIMESTAMP] = time.time()
@@ -1673,7 +1725,7 @@ class Transport:
Transport.add_packet_hash(packet.packet_hash) Transport.add_packet_hash(packet.packet_hash)
new_raw = packet.raw[0:1] new_raw = packet.raw[0:1]
new_raw += struct.pack("!B", packet.hops) new_raw += struct.pack("!B", packet.hops if not from_local_client or instance_local_link or Transport.local_hops_delta == 0 else Transport.local_hops_delta)
new_raw += packet.raw[2:] new_raw += packet.raw[2:]
Transport.transmit(outbound_interface, new_raw) Transport.transmit(outbound_interface, new_raw)
Transport.link_table[packet.destination_hash][IDX_LT_TIMESTAMP] = time.time() Transport.link_table[packet.destination_hash][IDX_LT_TIMESTAMP] = time.time()
@@ -1735,8 +1787,7 @@ class Transport:
with Transport.announce_table_lock: with Transport.announce_table_lock:
if packet.destination_hash in Transport.announce_table: Transport.announce_table.pop(packet.destination_hash) if packet.destination_hash in Transport.announce_table: Transport.announce_table.pop(packet.destination_hash)
else: else: received_from = packet.destination_hash
received_from = packet.destination_hash
# Check if this announce should be inserted into # Check if this announce should be inserted into
# announce and destination tables # announce and destination tables
@@ -1753,6 +1804,7 @@ class Transport:
random_blob = packet.data[RNS.Identity.KEYSIZE//8+RNS.Identity.NAME_HASH_LENGTH//8:RNS.Identity.KEYSIZE//8+RNS.Identity.NAME_HASH_LENGTH//8+10] random_blob = packet.data[RNS.Identity.KEYSIZE//8+RNS.Identity.NAME_HASH_LENGTH//8:RNS.Identity.KEYSIZE//8+RNS.Identity.NAME_HASH_LENGTH//8+10]
random_blobs = [] random_blobs = []
with Transport.inbound_announce_lock: with Transport.inbound_announce_lock:
announced_destination_known |= packet.destination_hash in Transport.path_table
if announced_destination_known: if announced_destination_known:
random_blobs = Transport.path_table[packet.destination_hash][IDX_PT_RANDBLOBS] random_blobs = Transport.path_table[packet.destination_hash][IDX_PT_RANDBLOBS]
@@ -1794,7 +1846,7 @@ class Transport:
if not random_blob in random_blobs: if not random_blob in random_blobs:
# TODO: Check that this ^ approach actually # TODO: Check that this ^ approach actually
# works under all circumstances # works under all circumstances
RNS.log("Replacing destination table entry for "+str(RNS.prettyhexrep(packet.destination_hash))+" with new announce due to expired path", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log("Replacing path table entry for "+str(RNS.prettyhexrep(packet.destination_hash))+" with new announce due to expired path", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
Transport.mark_path_unknown_state(packet.destination_hash) Transport.mark_path_unknown_state(packet.destination_hash)
should_add = True should_add = True
else: else:
@@ -1805,7 +1857,7 @@ class Transport:
# this announce before, update the path table. # this announce before, update the path table.
if (announce_emitted > path_announce_emitted): if (announce_emitted > path_announce_emitted):
if not random_blob in random_blobs: if not random_blob in random_blobs:
RNS.log("Replacing destination table entry for "+str(RNS.prettyhexrep(packet.destination_hash))+" with new announce, since it was more recently emitted", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log("Replacing path table entry for "+str(RNS.prettyhexrep(packet.destination_hash))+" with new announce, since it was more recently emitted", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
Transport.mark_path_unknown_state(packet.destination_hash) Transport.mark_path_unknown_state(packet.destination_hash)
should_add = True should_add = True
else: else:
@@ -1817,7 +1869,7 @@ class Transport:
# allow updating the path table to this one. # allow updating the path table to this one.
elif announce_emitted == path_announce_emitted: elif announce_emitted == path_announce_emitted:
if Transport.path_is_unresponsive(packet.destination_hash): if Transport.path_is_unresponsive(packet.destination_hash):
RNS.log("Replacing destination table entry for "+str(RNS.prettyhexrep(packet.destination_hash))+" with new announce, since previously tried path was unresponsive", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log("Replacing path table entry for "+str(RNS.prettyhexrep(packet.destination_hash))+" with new announce, since previously tried path was unresponsive", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
should_add = True should_add = True
else: else:
should_add = False should_add = False
@@ -1825,7 +1877,6 @@ class Transport:
else: else:
# If this destination is unknown in our table # If this destination is unknown in our table
# we should add it # we should add it
Transport.mark_path_unknown_state(packet.destination_hash)
should_add = True should_add = True
if should_add: if should_add:
@@ -1884,7 +1935,7 @@ class Transport:
if (RNS.Reticulum.transport_enabled() or is_from_local_client) and packet.context != RNS.Packet.PATH_RESPONSE: if (RNS.Reticulum.transport_enabled() or is_from_local_client) and packet.context != RNS.Packet.PATH_RESPONSE:
# Insert announce into announce table for retransmission # Insert announce into announce table for retransmission
if rate_blocked: RNS.log("Blocking rebroadcast of announce from "+RNS.prettyhexrep(packet.destination_hash)+" due to excessive announce rate", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None if rate_blocked: RNS.log("Blocking rebroadcast of announce from "+RNS.prettyhexrep(packet.destination_hash)+" due to excessive announce rate", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
else: else:
if is_from_local_client: if is_from_local_client:
# If the announce is from a local client, # If the announce is from a local client,
@@ -1942,17 +1993,10 @@ class Transport:
if is_from_local_client and packet.context == RNS.Packet.PATH_RESPONSE: if is_from_local_client and packet.context == RNS.Packet.PATH_RESPONSE:
for local_interface in Transport.local_client_interfaces: for local_interface in Transport.local_client_interfaces:
if packet.receiving_interface != local_interface: if packet.receiving_interface != local_interface:
new_announce = RNS.Packet( new_announce = RNS.Packet(announce_destination, announce_data, RNS.Packet.ANNOUNCE, # <-- This one?
announce_destination, context = announce_context, header_type = RNS.Packet.HEADER_2,
announce_data, transport_type = Transport.TRANSPORT, transport_id = Transport.identity.hash,
RNS.Packet.ANNOUNCE, # <-- This one? attached_interface = local_interface, context_flag = packet.context_flag)
context = announce_context,
header_type = RNS.Packet.HEADER_2,
transport_type = Transport.TRANSPORT,
transport_id = Transport.identity.hash,
attached_interface = local_interface,
context_flag = packet.context_flag,
)
new_announce.hops = packet.hops new_announce.hops = packet.hops
new_announce.send() new_announce.send()
@@ -1960,17 +2004,10 @@ class Transport:
else: else:
for local_interface in Transport.local_client_interfaces: for local_interface in Transport.local_client_interfaces:
if packet.receiving_interface != local_interface: if packet.receiving_interface != local_interface:
new_announce = RNS.Packet( new_announce = RNS.Packet(announce_destination, announce_data, RNS.Packet.ANNOUNCE,
announce_destination, context = announce_context, header_type = RNS.Packet.HEADER_2,
announce_data, transport_type = Transport.TRANSPORT, transport_id = Transport.identity.hash,
RNS.Packet.ANNOUNCE, attached_interface = local_interface, context_flag = packet.context_flag)
context = announce_context,
header_type = RNS.Packet.HEADER_2,
transport_type = Transport.TRANSPORT,
transport_id = Transport.identity.hash,
attached_interface = local_interface,
context_flag = packet.context_flag,
)
new_announce.hops = packet.hops new_announce.hops = packet.hops
new_announce.send() new_announce.send()
@@ -1984,7 +2021,7 @@ class Transport:
interface_str = " on "+str(attached_interface) interface_str = " on "+str(attached_interface)
RNS.log("Got matching announce, answering waiting discovery path request for "+RNS.prettyhexrep(packet.destination_hash)+interface_str, RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log("Got matching announce, answering waiting discovery path request for "+RNS.prettyhexrep(packet.destination_hash)+interface_str, RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
announce_identity = RNS.Identity.recall(packet.destination_hash, _no_use=False) announce_identity = RNS.Identity.recall(packet.destination_hash, _no_use=False)
announce_destination = RNS.Destination(announce_identity, RNS.Destination.OUT, RNS.Destination.SINGLE, "unknown", "unknown"); announce_destination = RNS.Destination(announce_identity, RNS.Destination.OUT, RNS.Destination.SINGLE, "unknown", "unknown");
announce_destination.hash = packet.destination_hash announce_destination.hash = packet.destination_hash
@@ -1992,17 +2029,10 @@ class Transport:
announce_context = RNS.Packet.NONE announce_context = RNS.Packet.NONE
announce_data = packet.data announce_data = packet.data
new_announce = RNS.Packet( new_announce = RNS.Packet(announce_destination, announce_data, RNS.Packet.ANNOUNCE,
announce_destination, context = RNS.Packet.PATH_RESPONSE, header_type = RNS.Packet.HEADER_2,
announce_data, transport_type = Transport.TRANSPORT, transport_id = Transport.identity.hash,
RNS.Packet.ANNOUNCE, attached_interface = attached_interface, context_flag = packet.context_flag)
context = RNS.Packet.PATH_RESPONSE,
header_type = RNS.Packet.HEADER_2,
transport_type = Transport.TRANSPORT,
transport_id = Transport.identity.hash,
attached_interface = attached_interface,
context_flag = packet.context_flag,
)
new_announce.hops = packet.hops new_announce.hops = packet.hops
new_announce.send() new_announce.send()
@@ -2011,7 +2041,7 @@ class Transport:
path_table_entry = [now, received_from, announce_hops, expires, random_blobs, packet.receiving_interface, packet.packet_hash] path_table_entry = [now, received_from, announce_hops, expires, random_blobs, packet.receiving_interface, packet.packet_hash]
with Transport.path_table_lock: Transport.path_table[packet.destination_hash] = path_table_entry with Transport.path_table_lock: Transport.path_table[packet.destination_hash] = path_table_entry
Transport.mark_path_unknown_state(packet.destination_hash) Transport.mark_path_unknown_state(packet.destination_hash)
RNS.log("Destination "+RNS.prettyhexrep(packet.destination_hash)+" is now "+str(announce_hops)+" hops away via "+RNS.prettyhexrep(received_from)+" on "+str(packet.receiving_interface), RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log("Destination "+RNS.prettyhexrep(packet.destination_hash)+" is now "+str(announce_hops)+" hops away via "+RNS.prettyhexrep(received_from)+" on "+str(packet.receiving_interface), RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
if packet.destination_hash in Transport.path_requests: if packet.destination_hash in Transport.path_requests:
RNS.Reticulum.get_instance()._used_destination_data(packet.destination_hash) RNS.Reticulum.get_instance()._used_destination_data(packet.destination_hash)
@@ -2019,15 +2049,14 @@ class Transport:
# announce to the tunnels table # announce to the tunnels table
if hasattr(packet.receiving_interface, "tunnel_id") and packet.receiving_interface.tunnel_id != None: if hasattr(packet.receiving_interface, "tunnel_id") and packet.receiving_interface.tunnel_id != None:
with Transport.tunnels_lock: with Transport.tunnels_lock:
if not packet.receiving_interface.tunnel_id in Transport.tunnels: if not packet.receiving_interface.tunnel_id in Transport.tunnels: RNS.log(f"Tunnel ID for {packet.receiving_interface} was not found in tunnel table", RNS.LOG_WARNING)
RNS.log(f"Tunnel ID for {packet.receiving_interface} was not found in tunnel table", RNS.LOG_WARNING)
else: else:
tunnel_entry = Transport.tunnels[packet.receiving_interface.tunnel_id] tunnel_entry = Transport.tunnels[packet.receiving_interface.tunnel_id]
paths = tunnel_entry[IDX_TT_PATHS] paths = tunnel_entry[IDX_TT_PATHS]
paths[packet.destination_hash] = [now, received_from, announce_hops, expires, random_blobs, None, packet.packet_hash] paths[packet.destination_hash] = [now, received_from, announce_hops, expires, random_blobs, None, packet.packet_hash]
expires = time.time() + Transport.TUNNEL_TIMEOUT expires = time.time() + Transport.TUNNEL_TIMEOUT
tunnel_entry[IDX_TT_EXPIRES] = expires tunnel_entry[IDX_TT_EXPIRES] = expires
RNS.log("Path to "+RNS.prettyhexrep(packet.destination_hash)+" associated with tunnel "+RNS.prettyhexrep(packet.receiving_interface.tunnel_id), RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log("Path to "+RNS.prettyhexrep(packet.destination_hash)+" associated with tunnel "+RNS.prettyhexrep(packet.receiving_interface.tunnel_id), RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
# Call externally registered callbacks from apps # Call externally registered callbacks from apps
# wanting to know when an announce arrives # wanting to know when an announce arrives
@@ -2038,10 +2067,10 @@ class Transport:
# the handlers aspect filter # the handlers aspect filter
execute_callback = False execute_callback = False
announce_identity = RNS.Identity.recall(packet.destination_hash, _no_use=True) announce_identity = RNS.Identity.recall(packet.destination_hash, _no_use=True)
if handler.aspect_filter == None:
# If the handlers aspect filter is set to # If the handlers aspect filter is set to
# None, we execute the callback in all cases # None, we execute the callback in all cases
execute_callback = True if handler.aspect_filter == None: execute_callback = True
else: else:
handler_expected_hash = RNS.Destination.hash_from_name_and_identity(handler.aspect_filter, announce_identity) handler_expected_hash = RNS.Destination.hash_from_name_and_identity(handler.aspect_filter, announce_identity)
if packet.destination_hash == handler_expected_hash: execute_callback = True if packet.destination_hash == handler_expected_hash: execute_callback = True
@@ -2086,7 +2115,7 @@ class Transport:
RNS.trace_exception(e) RNS.trace_exception(e)
# Handling for link requests to local destinations # Handling for link requests to local destinations
elif packet.packet_type == RNS.Packet.LINKREQUEST: elif packet.packet_type == RNS.Packet.LINKREQUEST and not link_request_handled:
if packet.transport_id == None or packet.transport_id == Transport.identity.hash: if packet.transport_id == None or packet.transport_id == Transport.identity.hash:
destination = None destination = None
with Transport.destinations_map_lock: with Transport.destinations_map_lock:
@@ -2129,7 +2158,7 @@ class Transport:
if packet.context == RNS.Packet.CACHE_REQUEST: if packet.context == RNS.Packet.CACHE_REQUEST:
cached_packet = Transport.get_cached_packet(packet.data) cached_packet = Transport.get_cached_packet(packet.data)
if cached_packet != None: if cached_packet != None:
cached_packet.unpack() if not cached_packet.unpack(): return
RNS.Packet(destination=link, data=cached_packet.data, RNS.Packet(destination=link, data=cached_packet.data,
packet_type=cached_packet.packet_type, context=cached_packet.context).send() packet_type=cached_packet.packet_type, context=cached_packet.context).send()
@@ -2156,13 +2185,11 @@ class Transport:
packet.destination = destination packet.destination = destination
if destination.receive(packet): if destination.receive(packet):
if destination.proof_strategy == RNS.Destination.PROVE_ALL: packet.prove() if destination.proof_strategy == RNS.Destination.PROVE_ALL: packet.prove()
elif destination.proof_strategy == RNS.Destination.PROVE_APP: elif destination.proof_strategy == RNS.Destination.PROVE_APP:
if destination.callbacks.proof_requested: if destination.callbacks.proof_requested:
try: try:
if destination.callbacks.proof_requested(packet): packet.prove() if destination.callbacks.proof_requested(packet): packet.prove()
except Exception as e: except Exception as e: RNS.log("Error while executing proof request callback. The contained exception was: "+str(e), RNS.LOG_ERROR)
RNS.log("Error while executing proof request callback. The contained exception was: "+str(e), RNS.LOG_ERROR)
# Handling for proofs and link-request proofs # Handling for proofs and link-request proofs
elif packet.packet_type == RNS.Packet.PROOF: elif packet.packet_type == RNS.Packet.PROOF:
@@ -2189,19 +2216,17 @@ class Transport:
if peer_identity.validate(signature, signed_data): if peer_identity.validate(signature, signed_data):
RNS.log("Link request proof validated for transport via "+str(link_entry[IDX_LT_RCVD_IF]), RNS.LOG_EXTREME) if RNS.sl(RNS.LOG_EXTREME) else None RNS.log("Link request proof validated for transport via "+str(link_entry[IDX_LT_RCVD_IF]), RNS.LOG_EXTREME) if RNS.sl(RNS.LOG_EXTREME) else None
new_raw = packet.raw[0:1] new_raw = packet.raw[0:1]
new_raw += struct.pack("!B", packet.hops) new_raw += struct.pack("!B", packet.hops if not from_local_client or instance_local_link or Transport.local_hops_delta == 0 else Transport.local_hops_delta)
new_raw += packet.raw[2:] new_raw += packet.raw[2:]
Transport.link_table[packet.destination_hash][IDX_LT_VALIDATED] = True Transport.link_table[packet.destination_hash][IDX_LT_VALIDATED] = True
Transport.transmit(link_entry[IDX_LT_RCVD_IF], new_raw) Transport.transmit(link_entry[IDX_LT_RCVD_IF], new_raw)
if not Transport.owner.is_connected_to_shared_instance: if not Transport.owner.is_connected_to_shared_instance:
RNS.Identity._used_destination_data(link_entry[IDX_LT_DSTHASH]) RNS.Identity._used_destination_data(link_entry[IDX_LT_DSTHASH])
else: else: RNS.log("Invalid link request proof in transport for link "+RNS.prettyhexrep(packet.destination_hash)+", dropping proof.", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None
RNS.log("Invalid link request proof in transport for link "+RNS.prettyhexrep(packet.destination_hash)+", dropping proof.", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None
except Exception as e: RNS.log("Could not transport link request proof. The contained exception was: "+str(e), RNS.LOG_DEBUG) if RNS.sl(LOG_DEBUG) else None except Exception as e: RNS.log("Could not transport link request proof. The contained exception was: "+str(e), RNS.LOG_DEBUG) if RNS.sl(LOG_DEBUG) else None
else: RNS.log("Link request proof received on wrong interface, not transporting it.", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None else: RNS.log("Link request proof received on wrong interface, not transporting it.", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None
else: RNS.log("Received link request proof with hop mismatch, not transporting it", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None else: RNS.log(f"Received link request proof with hop mismatch ({packet.hops}/{link_entry[IDX_LT_NH_IF]}), not transporting it", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None
else: else:
# Check if we can deliver it to a local # Check if we can deliver it to a local
@@ -2256,7 +2281,7 @@ class Transport:
if packet.receiving_interface == reverse_entry[IDX_RT_OUTB_IF]: if packet.receiving_interface == reverse_entry[IDX_RT_OUTB_IF]:
RNS.log("Proof received on correct interface, transporting it via "+str(reverse_entry[IDX_RT_RCVD_IF]), RNS.LOG_EXTREME) if RNS.sl(RNS.LOG_EXTREME) else None RNS.log("Proof received on correct interface, transporting it via "+str(reverse_entry[IDX_RT_RCVD_IF]), RNS.LOG_EXTREME) if RNS.sl(RNS.LOG_EXTREME) else None
new_raw = packet.raw[0:1] new_raw = packet.raw[0:1]
new_raw += struct.pack("!B", packet.hops) new_raw += struct.pack("!B", packet.hops if not from_local_client or proof_for_local_client or Transport.local_hops_delta == 0 else Transport.local_hops_delta)
new_raw += packet.raw[2:] new_raw += packet.raw[2:]
Transport.transmit(reverse_entry[IDX_RT_RCVD_IF], new_raw) Transport.transmit(reverse_entry[IDX_RT_RCVD_IF], new_raw)
else: else:
@@ -2337,14 +2362,14 @@ class Transport:
def handle_tunnel(tunnel_id, interface): def handle_tunnel(tunnel_id, interface):
expires = time.time() + Transport.TUNNEL_TIMEOUT expires = time.time() + Transport.TUNNEL_TIMEOUT
if not tunnel_id in Transport.tunnels: if not tunnel_id in Transport.tunnels:
RNS.log("Tunnel endpoint "+RNS.prettyhexrep(tunnel_id)+" established.", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log("Tunnel endpoint "+RNS.prettyhexrep(tunnel_id)+" established.", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
paths = {} paths = {}
with Transport.tunnels_lock: with Transport.tunnels_lock:
tunnel_entry = [tunnel_id, interface, paths, expires] tunnel_entry = [tunnel_id, interface, paths, expires]
interface.tunnel_id = tunnel_id interface.tunnel_id = tunnel_id
Transport.tunnels[tunnel_id] = tunnel_entry Transport.tunnels[tunnel_id] = tunnel_entry
else: else:
RNS.log("Tunnel endpoint "+RNS.prettyhexrep(tunnel_id)+" reappeared. Restoring paths...", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log("Tunnel endpoint "+RNS.prettyhexrep(tunnel_id)+" reappeared. Restoring paths...", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
tunnel_entry = Transport.tunnels[tunnel_id] tunnel_entry = Transport.tunnels[tunnel_id]
tunnel_entry[IDX_TT_IF] = interface tunnel_entry[IDX_TT_IF] = interface
tunnel_entry[IDX_TT_EXPIRES] = expires tunnel_entry[IDX_TT_EXPIRES] = expires
@@ -2373,21 +2398,21 @@ class Transport:
current_path_timebase = Transport.timebase_from_random_blobs(current_random_blobs) current_path_timebase = Transport.timebase_from_random_blobs(current_random_blobs)
tunnel_announce_timebase = Transport.timebase_from_random_blobs(random_blobs) tunnel_announce_timebase = Transport.timebase_from_random_blobs(random_blobs)
if tunnel_announce_timebase >= current_path_timebase: should_add = True if tunnel_announce_timebase >= current_path_timebase: should_add = True
else: RNS.log("Did not restore path to "+RNS.prettyhexrep(destination_hash)+" because existing path is more recent", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None else: RNS.log("Did not restore path to "+RNS.prettyhexrep(destination_hash)+" because existing path is more recent", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
else: RNS.log("Did not restore path to "+RNS.prettyhexrep(destination_hash)+" because a newer path with fewer hops exist", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None else: RNS.log("Did not restore path to "+RNS.prettyhexrep(destination_hash)+" because a newer path with fewer hops exist", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
else: else:
if time.time() < expires: should_add = True if time.time() < expires: should_add = True
else: RNS.log("Did not restore path to "+RNS.prettyhexrep(destination_hash)+" because it has expired", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None else: RNS.log("Did not restore path to "+RNS.prettyhexrep(destination_hash)+" because it has expired", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
if should_add: if should_add:
with Transport.path_table_lock: Transport.path_table[destination_hash] = new_entry with Transport.path_table_lock: Transport.path_table[destination_hash] = new_entry
RNS.log("Restored path to "+RNS.prettyhexrep(destination_hash)+" is now "+str(announce_hops)+" hops away via "+RNS.prettyhexrep(received_from)+" on "+str(receiving_interface), RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log("Restored path to "+RNS.prettyhexrep(destination_hash)+" is now "+str(announce_hops)+" hops away via "+RNS.prettyhexrep(received_from)+" on "+str(receiving_interface), RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
else: deprecated_paths.append(destination_hash) else: deprecated_paths.append(destination_hash)
for deprecated_path in deprecated_paths: for deprecated_path in deprecated_paths:
RNS.log("Removing path to "+RNS.prettyhexrep(deprecated_path)+" from tunnel "+RNS.prettyhexrep(tunnel_id), RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log("Removing path to "+RNS.prettyhexrep(deprecated_path)+" from tunnel "+RNS.prettyhexrep(tunnel_id), RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
with Transport.tunnels_lock: paths.pop(deprecated_path) with Transport.tunnels_lock: paths.pop(deprecated_path)
@staticmethod @staticmethod
@@ -2654,7 +2679,8 @@ class Transport:
:returns: The destination hash as *bytes* for the next hop to the specified destination, or *None* if the next hop is unknown. :returns: The destination hash as *bytes* for the next hop to the specified destination, or *None* if the next hop is unknown.
""" """
with Transport.path_table_lock: with Transport.path_table_lock:
if destination_hash in Transport.path_table: return Transport.path_table[destination_hash][IDX_PT_NEXT_HOP] if destination_hash in Transport.path_table: return Transport.path_table[destination_hash][IDX_PT_NEXT_HOP]
elif destination_hash in Transport.destinations_map: return Transport.identity.hash
else: return None else: return None
@staticmethod @staticmethod
@@ -2664,7 +2690,8 @@ class Transport:
:returns: The interface for the next hop to the specified destination, or *None* if the interface is unknown. :returns: The interface for the next hop to the specified destination, or *None* if the interface is unknown.
""" """
with Transport.path_table_lock: with Transport.path_table_lock:
if destination_hash in Transport.path_table: return Transport.path_table[destination_hash][IDX_PT_RVCD_IF] if destination_hash in Transport.path_table: return Transport.path_table[destination_hash][IDX_PT_RVCD_IF]
elif destination_hash in Transport.destinations_map: return RNS.Reticulum.get_instance().shared_instance_interface
else: return None else: return None
@staticmethod @staticmethod
@@ -2902,7 +2929,7 @@ class Transport:
tag=tag_bytes) tag=tag_bytes)
else: RNS.log("Ignoring duplicate path request for "+RNS.prettyhexrep(destination_hash)+" with tag "+RNS.prettyhexrep(unique_tag), RNS.LOG_EXTREME) if RNS.sl(RNS.LOG_EXTREME) else None else: RNS.log("Ignoring duplicate path request for "+RNS.prettyhexrep(destination_hash)+" with tag "+RNS.prettyhexrep(unique_tag), RNS.LOG_EXTREME) if RNS.sl(RNS.LOG_EXTREME) else None
else: RNS.log("Ignoring tagless path request for "+RNS.prettyhexrep(destination_hash), RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None else: RNS.log("Ignoring tagless path request for "+RNS.prettyhexrep(destination_hash), RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
except Exception as e: RNS.log(f"Error while handling path request. The contained exception was: {e}", RNS.LOG_ERROR) except Exception as e: RNS.log(f"Error while handling path request. The contained exception was: {e}", RNS.LOG_ERROR)
@staticmethod @staticmethod
@@ -2913,11 +2940,12 @@ class Transport:
if attached_interface != None: if attached_interface != None:
should_ingress_limit = attached_interface.should_ingress_limit_pr() should_ingress_limit = attached_interface.should_ingress_limit_pr()
if RNS.Reticulum.transport_enabled(): if RNS.Reticulum.transport_enabled():
if attached_interface.mode in RNS.Interfaces.Interface.Interface.DISCOVER_PATHS_FOR: should_search_for_unknown = True if attached_interface.recursive_prs: should_search_for_unknown = True
elif attached_interface.mode in RNS.Interfaces.Interface.Interface.DISCOVER_PATHS_FOR: should_search_for_unknown = True
if RNS.sl(RNS.LOG_DEBUG): if RNS.sl(RNS.LOG_PATHING):
interface_str = f" on {attached_interface}" interface_str = f" on {attached_interface}"
RNS.log(f"Path request for {RNS.prettyhexrep(destination_hash)}{interface_str}", RNS.LOG_DEBUG) RNS.log(f"Path request for {RNS.prettyhexrep(destination_hash)}{interface_str}", RNS.LOG_PATHING)
destination_exists_on_local_client = False destination_exists_on_local_client = False
if len(Transport.local_client_interfaces) > 0: if len(Transport.local_client_interfaces) > 0:
@@ -2936,7 +2964,7 @@ class Transport:
if local_destination != None: if local_destination != None:
local_destination.announce(path_response=True, tag=tag, attached_interface=attached_interface) local_destination.announce(path_response=True, tag=tag, attached_interface=attached_interface)
RNS.log("Answering path request for "+RNS.prettyhexrep(destination_hash)+interface_str+", destination is local to this system", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log("Answering path request for "+RNS.prettyhexrep(destination_hash)+interface_str+", destination is local to this system", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
elif (RNS.Reticulum.transport_enabled() or is_from_local_client) and (destination_hash in Transport.path_table): elif (RNS.Reticulum.transport_enabled() or is_from_local_client) and (destination_hash in Transport.path_table):
packet = Transport.get_cached_packet(Transport.path_table[destination_hash][IDX_PT_PACKET], packet_type="announce") packet = Transport.get_cached_packet(Transport.path_table[destination_hash][IDX_PT_PACKET], packet_type="announce")
@@ -2947,10 +2975,10 @@ class Transport:
RNS.log(f"Could not retrieve announce packet from cache while answering path request for {RNS.prettyhexrep(destination_hash)}, ignoring path request", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log(f"Could not retrieve announce packet from cache while answering path request for {RNS.prettyhexrep(destination_hash)}, ignoring path request", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None
elif attached_interface.mode == RNS.Interfaces.Interface.Interface.MODE_ROAMING and attached_interface == received_from: elif attached_interface.mode == RNS.Interfaces.Interface.Interface.MODE_ROAMING and attached_interface == received_from:
RNS.log("Not answering path request on roaming-mode interface, since next hop is on same roaming-mode interface", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log("Not answering path request on roaming-mode interface, since next hop is on same roaming-mode interface", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
else: else:
packet.unpack() if not packet.unpack(): return
packet.hops = Transport.path_table[destination_hash][IDX_PT_HOPS] packet.hops = Transport.path_table[destination_hash][IDX_PT_HOPS]
if requestor_transport_id != None and next_hop == requestor_transport_id: if requestor_transport_id != None and next_hop == requestor_transport_id:
@@ -2960,9 +2988,9 @@ class Transport:
# inefficient. There is probably a better way. Doing # inefficient. There is probably a better way. Doing
# path invalidation here would decrease the network # path invalidation here would decrease the network
# convergence time. Maybe just drop it? # convergence time. Maybe just drop it?
RNS.log("Not answering path request for "+RNS.prettyhexrep(destination_hash)+interface_str+", since next hop is the requestor", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log("Not answering path request for "+RNS.prettyhexrep(destination_hash)+interface_str+", since next hop is the requestor", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
else: else:
RNS.log("Answering path request for "+RNS.prettyhexrep(destination_hash)+interface_str+", path is known", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log("Answering path request for "+RNS.prettyhexrep(destination_hash)+interface_str+", path is known", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
now = time.time() now = time.time()
retries = Transport.PATHFINDER_R retries = Transport.PATHFINDER_R
@@ -3004,7 +3032,7 @@ class Transport:
elif is_from_local_client: elif is_from_local_client:
# Forward path request on all interfaces # Forward path request on all interfaces
# except the local client # except the local client
RNS.log("Forwarding path request from local client for "+RNS.prettyhexrep(destination_hash)+interface_str+" to all other interfaces", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log("Forwarding path request from local client for "+RNS.prettyhexrep(destination_hash)+interface_str+" to all other interfaces", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
request_tag = RNS.Identity.get_random_hash() request_tag = RNS.Identity.get_random_hash()
for interface in Transport.interfaces: for interface in Transport.interfaces:
if not interface == attached_interface: if not interface == attached_interface:
@@ -3012,20 +3040,20 @@ class Transport:
elif should_search_for_unknown: elif should_search_for_unknown:
if destination_hash in Transport.discovery_path_requests: if destination_hash in Transport.discovery_path_requests:
RNS.log("There is already a waiting path request for "+RNS.prettyhexrep(destination_hash)+" on behalf of path request"+interface_str, RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log("There is already a waiting path request for "+RNS.prettyhexrep(destination_hash)+" on behalf of path request"+interface_str, RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
else: else:
# Abort recursive path request if receiving # Abort recursive path request if receiving
# interface has PR burst active, or should # interface has PR burst active, or should
# otherwise ingress limit path requests. # otherwise ingress limit path requests.
if should_ingress_limit: if should_ingress_limit:
if RNS.sl(RNS.LOG_DEBUG): if RNS.sl(RNS.LOG_PATHING):
interface_str = f" for {attached_interface}" if attached_interface else "" interface_str = f" for {attached_interface}" if attached_interface else ""
RNS.log(f"Not sending recursive path request{interface_str} due to active ingress limiting", RNS.LOG_DEBUG) RNS.log(f"Not sending recursive path request{interface_str} due to active ingress limiting", RNS.LOG_PATHING)
return return
# Forward path request on all interfaces # Forward path request on all interfaces
# except the requestor interface # except the requestor interface
RNS.log("Attempting to discover unknown path to "+RNS.prettyhexrep(destination_hash)+" on behalf of path request"+interface_str, RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log("Attempting to discover unknown path to "+RNS.prettyhexrep(destination_hash)+" on behalf of path request"+interface_str, RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
pr_entry = { "destination_hash": destination_hash, "timeout": time.time()+Transport.PATH_REQUEST_TIMEOUT, "requesting_interface": attached_interface } pr_entry = { "destination_hash": destination_hash, "timeout": time.time()+Transport.PATH_REQUEST_TIMEOUT, "requesting_interface": attached_interface }
with Transport.discovery_pr_lock: Transport.discovery_path_requests[destination_hash] = pr_entry with Transport.discovery_pr_lock: Transport.discovery_path_requests[destination_hash] = pr_entry
@@ -3041,36 +3069,35 @@ class Transport:
elif not is_from_local_client and len(Transport.local_client_interfaces) > 0: elif not is_from_local_client and len(Transport.local_client_interfaces) > 0:
# Forward the path request on all local # Forward the path request on all local
# client interfaces # client interfaces
RNS.log("Forwarding path request for "+RNS.prettyhexrep(destination_hash)+interface_str+" to local clients", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log("Forwarding path request for "+RNS.prettyhexrep(destination_hash)+interface_str+" to local clients", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
for interface in Transport.local_client_interfaces: for interface in Transport.local_client_interfaces:
Transport.request_path(destination_hash, on_interface=interface) Transport.request_path(destination_hash, on_interface=interface)
else: else:
RNS.log("Ignoring path request for "+RNS.prettyhexrep(destination_hash)+interface_str+", no path known", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log("Ignoring path request for "+RNS.prettyhexrep(destination_hash)+interface_str+", no path known", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
@staticmethod @staticmethod
def from_local_client(packet): def from_local_client(packet):
if hasattr(packet.receiving_interface, "parent_interface"): if hasattr(packet.receiving_interface, "parent_interface"):
return Transport.is_local_client_interface(packet.receiving_interface) return Transport.is_local_client_interface(packet.receiving_interface)
else: else: return False
return False
@staticmethod @staticmethod
def is_local_client_interface(interface): def is_local_client_interface(interface):
if hasattr(interface, "parent_interface"): if hasattr(interface, "parent_interface"):
if hasattr(interface.parent_interface, "is_local_shared_instance"): if hasattr(interface.parent_interface, "is_local_shared_instance"): return True
return True else: return False
else: else: return False
return False
else: @staticmethod
return False def is_shared_instance(interface):
if hasattr(interface, "is_local_shared_instance"): return True
else: return False
@staticmethod @staticmethod
def interface_to_shared_instance(interface): def interface_to_shared_instance(interface):
if hasattr(interface, "is_connected_to_shared_instance"): if hasattr(interface, "is_connected_to_shared_instance"): return True
return True else: return False
else:
return False
@staticmethod @staticmethod
def detach_interfaces(): def detach_interfaces():
@@ -3261,7 +3288,7 @@ class Transport:
if interface != None: if interface != None:
# Get the destination entry from the destination table # Get the destination entry from the destination table
if not destination_hash in path_table: if not destination_hash in path_table:
RNS.log(f"Skipping persist for path table entry {RNS.prettyhexrep(destination_hash)}, no longer in table", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None RNS.log(f"Skipping persist for path table entry {RNS.prettyhexrep(destination_hash)}, no longer in table", RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
de = path_table[destination_hash] de = path_table[destination_hash]
timestamp = de[IDX_PT_TIMESTAMP] timestamp = de[IDX_PT_TIMESTAMP]
+324
View File
@@ -0,0 +1,324 @@
#!/usr/bin/env python3
# Reticulum License
#
# Copyright (c) 2016-2026 Mark Qvist
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# - The Software shall not be used in any kind of system which includes amongst
# its functions the ability to purposefully do harm to human beings.
#
# - The Software shall not be used, directly or indirectly, in the creation of
# an artificial intelligence, machine learning or language model training
# dataset, including but not limited to any use that contributes to the
# training or development of such a model or algorithm.
#
# - The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
import os
import sys
import RNS
import struct
import base64
import argparse
from RNS.Utilities.rnid import validate_rsg, create_rsg, extract_signed_rsg_data
SSHSIG_MAGIC = b"SSHSIG"
SSHSIG_VERSION = 1
NAMESPACE_GIT = b"git"
RESERVED_EMPTY = b""
HASH_ALGORITHM = b"sha256"
def ssh_string(data): return struct.pack(">I", len(data)) + data
def read_ssh_string(data, offset):
if offset + 4 > len(data): raise ValueError("Not enough data for string length")
length = struct.unpack(">I", data[offset:offset+4])[0]
if offset + 4 + length > len(data): raise ValueError("Not enough data for string content")
return data[offset+4:offset+4+length], offset + 4 + length
def create_ssh_signature(public_key_wire, namespace, reserved, hash_algorithm, signature_data):
# SSHSIG (6 bytes) || version (uint32) || pubkey (ssh-string) || namespace (ssh-string) ||
# reserved (ssh-string) || hash_algorithm (ssh-string) || signature (ssh-string)
sig_blob = SSHSIG_MAGIC
sig_blob += struct.pack(">I", SSHSIG_VERSION)
sig_blob += ssh_string(public_key_wire)
sig_blob += ssh_string(namespace)
sig_blob += ssh_string(reserved)
sig_blob += ssh_string(hash_algorithm)
sig_blob += ssh_string(signature_data)
return sig_blob
def parse_ssh_signature(sig_data):
offset = 0
if not sig_data.startswith(SSHSIG_MAGIC): raise ValueError("Invalid SSH signature: missing SSHSIG magic")
offset += len(SSHSIG_MAGIC)
if offset + 4 > len(sig_data): raise ValueError("Invalid SSH signature: truncated")
version = struct.unpack(">I", sig_data[offset:offset+4])[0]
if version != SSHSIG_VERSION: raise ValueError(f"Unsupported SSH signature version: {version}")
offset += 4
public_key, offset = read_ssh_string(sig_data, offset)
namespace, offset = read_ssh_string(sig_data, offset)
reserved, offset = read_ssh_string(sig_data, offset)
hash_algorithm, offset = read_ssh_string(sig_data, offset)
signature_data, offset = read_ssh_string(sig_data, offset)
return { "version": version,
"public_key": public_key,
"namespace": namespace,
"reserved": reserved,
"hash_algorithm": hash_algorithm,
"signature_data": signature_data }
def armor_ssh_signature(sig_blob):
b64_data = base64.b64encode(sig_blob).decode('ascii')
lines = [b64_data[i:i+70] for i in range(0, len(b64_data), 70)]
result = "-----BEGIN SSH SIGNATURE-----\n"
result += "\n".join(lines) + "\n"
result += "-----END SSH SIGNATURE-----\n"
return result
def unarmor_ssh_signature(armored_data):
lines = armored_data.strip().split('\n')
b64_data = ""
in_sig = False
for line in lines:
if 'BEGIN SSH SIGNATURE' in line: in_sig = True; continue
if 'END SSH SIGNATURE' in line: break
if in_sig: b64_data += line.strip()
if not b64_data: raise ValueError("No signature data found in armored input")
return base64.b64decode(b64_data)
def get_pubkey_wire_format(identity):
return ssh_string(b"ssh-ed25519")+ssh_string(identity.sig_pub_bytes)
def sign(args):
keyfile = args.keyfile
if not keyfile or not os.path.isfile(keyfile):
print(f"Identity file not found: {keyfile}", file=sys.stderr)
return 1
try:
identity = RNS.Identity.from_file(keyfile)
if not identity or not identity.get_private_key():
print("Error: Could not load identity or identity has no private key", file=sys.stderr)
return 1
except Exception as e:
print(f"Error loading identity: {e}", file=sys.stderr)
return 1
if args.file and os.path.isfile(args.file):
with open(args.file, 'rb') as f: message = f.read()
sig_file = args.file + ".sig"
else:
message = sys.stdin.buffer.read()
sig_file = None
try: rsg = create_rsg(identity, message)
except Exception as e:
print(f"Error creating signature: {e}", file=sys.stderr)
return 1
try: ssh_pubkey = get_pubkey_wire_format(identity)
except Exception as e:
print(f"Error converting public key: {e}", file=sys.stderr)
return 1
try:
ssh_sig = create_ssh_signature(public_key_wire=ssh_pubkey, namespace=NAMESPACE_GIT, reserved=RESERVED_EMPTY,
hash_algorithm=HASH_ALGORITHM, signature_data=rsg)
except Exception as e:
print(f"Error creating SSH signature: {e}", file=sys.stderr)
return 1
try: armored = armor_ssh_signature(ssh_sig)
except Exception as e:
print(f"Error armoring signature: {e}", file=sys.stderr)
return 1
if sig_file:
try:
with open(sig_file, 'w') as f: f.write(armored)
except Exception as e:
print(f"Error writing signature file: {e}", file=sys.stderr)
return 1
else: print(armored, end="")
return 0
def find_principals(args):
sigfile = args.sigfile
if not sigfile or not os.path.isfile(sigfile): print("Error: Signature file not found", file=sys.stderr); return 1
try:
with open(sigfile, 'r') as f: armored_sig = f.read()
except Exception as e: print(f"Error reading signature file: {e}", file=sys.stderr); return 1
try: ssh_sig = parse_ssh_signature(unarmor_ssh_signature(armored_sig))
except Exception as e: print(f"Error parsing SSH signature: {e}", file=sys.stderr); return 1
if ssh_sig["namespace"] != NAMESPACE_GIT:
print(f"Error: Namespace mismatch: {ssh_sig['namespace']}", file=sys.stderr)
return 1
rsg = ssh_sig["signature_data"]
try: identity_hash = extract_signed_rsg_data(rsg)["meta"]["signer"]
except Exception as e: print(f"Could not determine signer identity: {e}", file=sys.stderr); return 1
print(RNS.hexrep(identity_hash, delimit=False))
return 0
def check_novalidate(args):
sigfile = args.sigfile
if not sigfile or not os.path.isfile(sigfile): return 1
try:
with open(sigfile, 'r') as f: armored_sig = f.read()
ssh_sig = parse_ssh_signature(unarmor_ssh_signature(armored_sig))
if ssh_sig["namespace"] != NAMESPACE_GIT: return 1
rsg = ssh_sig["signature_data"]
signed_data = extract_signed_rsg_data(rsg)
if not signed_data: return 1
else: return 0
except Exception: return 1
def extract_commit_author(message):
message_lines = message.splitlines()
author = ""
AUTHOR_TARGET = b"author "
for line in message_lines:
if not line.strip(b""): break
elif line.startswith(AUTHOR_TARGET):
try:
spos = line.find(b"<"); epos = line.find(b">")
if spos > len(AUTHOR_TARGET) and epos > spos and epos < len(line)-1:
author = line[spos+1:epos].decode("utf-8")
break
except Exception as e: print(f"Error while determining author from signed commit"); return 1
return author
def extract_commit_committer(message):
message_lines = message.splitlines()
committer = ""
COMMITTER_TARGET = b"committer "
for line in message_lines:
if not line.strip(b""): break
elif line.startswith(COMMITTER_TARGET):
try:
spos = line.find(b"<"); epos = line.find(b">")
if spos > len(COMMITTER_TARGET) and epos > spos and epos < len(line)-1:
committer = line[spos+1:epos].decode("utf-8")
break
except Exception as e: print(f"Error while determining committer from signed commit"); return 1
return committer
def extract_commit_tagger(message):
message_lines = message.splitlines()
tagger = ""
is_tag = False
for line in message_lines:
TAG_TARGET = b"tag "
TAGGER_TARGET = b"tagger "
if not line.strip(b""): break
elif line.startswith(TAG_TARGET): is_tag = True
elif line.startswith(TAGGER_TARGET) and is_tag:
try:
spos = line.find(b"<"); epos = line.find(b">")
if spos > len(TAGGER_TARGET) and epos > spos and epos < len(line)-1:
tagger = line[spos+1:epos].decode("utf-8")
break
except Exception as e: print(f"Error while determining tagger from signed commit"); return 1
return tagger, is_tag
def verify(args):
sigfile = args.sigfile
principal = args.principal
if not sigfile or not os.path.isfile(sigfile): print("Error: Signature file not found", file=sys.stderr); return 1
message = sys.stdin.buffer.read()
try:
with open(sigfile, 'r') as f: armored_sig = f.read()
raw_sig = unarmor_ssh_signature(armored_sig)
ssh_sig = parse_ssh_signature(raw_sig)
except Exception as e: print(f"Error parsing signature: {e}", file=sys.stderr); return 1
author = extract_commit_author(message)
committer = extract_commit_committer(message)
tagger, is_tag = extract_commit_tagger(message)
if ssh_sig["namespace"] != NAMESPACE_GIT: print(f"Invalid commit signature namespace", file=sys.stderr); return 1
rsg = ssh_sig["signature_data"]
valid, signed_data, signing_identity = validate_rsg(rsg, message)
if not valid: print(f"Invalid signature", file=sys.stderr); return 1
if is_tag: author = tagger
signer_hash = RNS.hexrep(signing_identity.hash, delimit=False)
if not author == signer_hash: print(f"Commit not signed by author <{author}>"); return 1
if principal:
if principal != signer_hash: print(f"Principal mismatch", file=sys.stderr); return 1
print(f"Good \"git\" signature for commit, signed with Reticulum Identity key <{signer_hash}>")
return 0
def main():
parser = argparse.ArgumentParser(description="Git commit signer and validator")
parser.add_argument("-Y", dest="op", required=True, choices=["sign", "find-principals", "check-novalidate", "verify"], help="Operation to perform")
parser.add_argument("-n", dest="namespace", default="git", help="Namespace")
parser.add_argument("-f", dest="keyfile", help="Key file (for signing) or allowed signers file (for verification)")
parser.add_argument("-I", dest="principal", help="Principal identity (for verification)")
parser.add_argument("-s", dest="sigfile", help="Signature file")
parser.add_argument("file", nargs="?", help="File to sign (for signing)")
parser.add_argument("-O", dest="ssh_options", action="append", default=[], help="SSH options (for git compatibility, ignored)")
args, unknown = parser.parse_known_args()
for arg in unknown:
if arg.startswith('-O'): continue # TODO: Add options for time validation
else:
print(f"Error: Unknown argument: {arg}", file=sys.stderr)
sys.exit(1)
if args.op == "sign": return sign(args)
elif args.op == "find-principals": return find_principals(args)
elif args.op == "check-novalidate": return check_novalidate(args)
elif args.op == "verify": return verify(args)
else:
print(f"Error: Unknown operation: {args.op}", file=sys.stderr)
return 1
if __name__ == "__main__": sys.exit(main())
+99 -6
View File
@@ -34,6 +34,8 @@ import threading
import subprocess import subprocess
import urllib.parse import urllib.parse
import RNS import RNS
import struct
import base64
from collections import deque from collections import deque
from datetime import datetime from datetime import datetime
from RNS.Utilities.rngit import APP_NAME from RNS.Utilities.rngit import APP_NAME
@@ -42,6 +44,8 @@ from RNS.Utilities.rngit.highlight import SyntaxHighlighter
from RNS.vendor.configobj import ConfigObj from RNS.vendor.configobj import ConfigObj
from RNS.vendor import umsgpack as mp from RNS.vendor import umsgpack as mp
from RNS._version import __version__ from RNS._version import __version__
from RNS.Utilities.rnid import validate_rsg, extract_signed_rsg_data
from RNS.Utilities.rngit.commitsigs import unarmor_ssh_signature, parse_ssh_signature, extract_commit_author
class NomadNetworkNode(): class NomadNetworkNode():
APP_NAME = "nomadnetwork" APP_NAME = "nomadnetwork"
@@ -958,6 +962,15 @@ class NomadNetworkNode():
i_folder = self.icon("folder") i_folder = self.icon("folder")
content_parts.append(f"{self.m_link(f'{i_folder} Browse tree at this commit', self.PATH_TREE, g=group_name, r=repo_name, ref=resolved_hash)}\n\n") content_parts.append(f"{self.m_link(f'{i_folder} Browse tree at this commit', self.PATH_TREE, g=group_name, r=repo_name, ref=resolved_hash)}\n\n")
# Validate and display commit signature status
show_sig = False
sig_status = self.get_commit_signature(repo_path, resolved_hash)
if sig_status["signed"]:
if sig_status["valid"] and sig_status["author_match"]: sig_text = f"`FT66BB85Valid, signed by author`f"; show_sig = True
elif sig_status["valid"]: sig_text = f"`Faa0{self.m_escape(sig_status['message'])}`f"; show_sig = True
else: sig_text = f"`F900{self.m_escape(sig_status['message'])}`f"; show_sig = True
else: sig_text = "Not signed"
# Commit metadata # Commit metadata
if commit_info.get("parents"): if commit_info.get("parents"):
parent_links = [] parent_links = []
@@ -965,14 +978,15 @@ class NomadNetworkNode():
parent_link = self.m_link(parent_hash[:7], self.PATH_COMMIT, g=group_name, r=repo_name, ref=ref, h=parent_hash) parent_link = self.m_link(parent_hash[:7], self.PATH_COMMIT, g=group_name, r=repo_name, ref=ref, h=parent_hash)
parent_links.append(parent_link) parent_links.append(parent_link)
content_parts.append(f"Parents: {' '.join(parent_links)}\n") content_parts.append(f"Parents : {' '.join(parent_links)}\n")
content_parts.append(f"Author: {self.m_escape(commit_info['author_name'])} <{self.m_escape(commit_info['author_email'])}>\n") content_parts.append(f"Author : {self.m_escape(commit_info['author_name'])} <{self.m_escape(commit_info['author_email'])}>\n")
content_parts.append(f"Date: {commit_info['author_date']}\n") content_parts.append(f"Signature : {sig_text}\n") if show_sig else None
content_parts.append(f"Date : {commit_info['author_date']}\n")
if commit_info.get("committer_name") != commit_info.get("author_name"): if commit_info.get("committer_name") != commit_info.get("author_name"):
content_parts.append(f"Commit: {self.m_escape(commit_info['committer_name'])} <{self.m_escape(commit_info['committer_email'])}>\n") content_parts.append(f"Committer : {self.m_escape(commit_info['committer_name'])} <{self.m_escape(commit_info['committer_email'])}>\n")
content_parts.append(f"Date: {commit_info['committer_date']}\n") content_parts.append(f"Date : {commit_info['committer_date']}\n")
content_parts.append("\n") content_parts.append("\n")
@@ -2197,7 +2211,8 @@ class NomadNetworkNode():
"committer_date": lines[6], "committer_date": lines[6],
"message": "\n".join(lines[7:]).strip(), "message": "\n".join(lines[7:]).strip(),
"files": [], "files": [],
"diff": None } "diff": None,
"signature_status": None }
# Get file change statistics # Get file change statistics
stats_result = subprocess.run(["git", "diff-tree", "--numstat", "-r", commit_hash], stats_result = subprocess.run(["git", "diff-tree", "--numstat", "-r", commit_hash],
@@ -2267,6 +2282,84 @@ class NomadNetworkNode():
RNS.log(f"Error getting commit info: {e}", RNS.LOG_WARNING) RNS.log(f"Error getting commit info: {e}", RNS.LOG_WARNING)
return None return None
def get_commit_signature(self, repo_path, commit_hash):
try:
result = subprocess.run(["git", "cat-file", "-p", commit_hash],
cwd=repo_path, capture_output=True, text=True,
timeout=self.GIT_COMMAND_TIMEOUT, check=False)
if result.returncode != 0:
return {"signed": False, "valid": False, "signer_hash": None,
"author_match": False, "message": "Could not read commit object"}
commit_content = result.stdout
lines = commit_content.split("\n")
sig_lines = []
in_signature = False
signed_content_lines = []
for line in lines:
if line.startswith("gpgsig ") or line.startswith("gpgsig-sha256 "):
in_signature = True
sig_start = line.find(" ") + 1
sig_lines.append(line[sig_start:])
elif in_signature:
if line.startswith(" "): sig_lines.append(line[1:])
else:
in_signature = False
signed_content_lines.append(line)
else: signed_content_lines.append(line)
if not sig_lines:
return {"signed": False, "valid": False, "signer_hash": None,
"author_match": False, "message": "Not signed"}
armored_sig = "\n".join(sig_lines)
signed_content = "\n".join(signed_content_lines).encode("utf-8")
try:
sig_data = unarmor_ssh_signature(armored_sig)
try: rsg = parse_ssh_signature(sig_data)["signature_data"]
except ValueError as e:
return {"signed": True, "valid": False, "signer_hash": None,
"author_match": False, "message": "Malformed SSH wrapping for RSG data"}
valid, signed_rsg_data, signing_identity = validate_rsg(rsg, signed_content)
if not valid:
return {"signed": True, "valid": False, "signer_hash": None,
"author_match": False, "message": "Invalid signature"}
signer_hash = RNS.hexrep(signing_identity.hash, delimit=False)
author = extract_commit_author(signed_content)
if not author:
return {"signed": True, "valid": True, "signer_hash": signer_hash,
"author_match": False, "message": "Could not verify author"}
if author == signer_hash:
return {"signed": True, "valid": True, "signer_hash": signer_hash,
"author_match": True, "message": f"Valid, signed by <{signer_hash}>"}
else:
return {"signed": True, "valid": True, "signer_hash": signer_hash,
"author_match": False, "message": f"Invalid signer <{signer_hash}>, author is <{author}>"}
except Exception as e:
RNS.log(f"Error validating commit signature: {e}", RNS.LOG_DEBUG)
return {"signed": True, "valid": False, "signer_hash": None,
"author_match": False, "message": "Signature validation error"}
except subprocess.TimeoutExpired:
RNS.log(f"Timeout checking commit signature", RNS.LOG_WARNING)
return {"signed": False, "valid": False, "signer_hash": None,
"author_match": False, "message": "Timeout"}
except Exception as e:
RNS.log(f"Error checking commit signature: {e}", RNS.LOG_DEBUG)
return {"signed": False, "valid": False, "signer_hash": None,
"author_match": False, "message": "Error"}
def get_readme_content(self, repo_path): def get_readme_content(self, repo_path):
readme_names = [ ("README.mu", False), ("Readme.mu", False), ("readme.mu", False), ("README", False), readme_names = [ ("README.mu", False), ("Readme.mu", False), ("readme.mu", False), ("README", False),
("readme", False), ("README.md", True), ("readme.md", True), ("README.rst", False), ("readme", False), ("README.md", True), ("readme.md", True), ("README.rst", False),
+24 -4
View File
@@ -90,6 +90,7 @@ def program_setup(configdir, rnsconfigdir=None, verbosity=0, quietness=0, servic
if operation == "list": git_client.list_releases(remote=task["remote"]) if operation == "list": git_client.list_releases(remote=task["remote"])
elif operation == "view": git_client.view_release(remote=task["remote"], target=task["target"]) elif operation == "view": git_client.view_release(remote=task["remote"], target=task["target"])
elif operation == "fetch": git_client.fetch_release(remote=task["remote"], target=task["target"], signer=task["signer"], offline=task["offline"]) elif operation == "fetch": git_client.fetch_release(remote=task["remote"], target=task["target"], signer=task["signer"], offline=task["offline"])
elif operation == "verify": git_client.fetch_release(remote=task["remote"], target=task["target"], signer=task["signer"], offline=True)
elif operation == "create": git_client.create_release(remote=task["remote"], target=task["target"], signer=task["signer"], name=task["name"], no_upload=task["no_upload"]) elif operation == "create": git_client.create_release(remote=task["remote"], target=task["target"], signer=task["signer"], name=task["name"], no_upload=task["no_upload"])
elif operation == "delete": git_client.delete_release(remote=task["remote"], target=task["target"]) elif operation == "delete": git_client.delete_release(remote=task["remote"], target=task["target"])
elif operation == "latest": git_client.latest_release(remote=task["remote"], target=task["target"]) elif operation == "latest": git_client.latest_release(remote=task["remote"], target=task["target"])
@@ -167,7 +168,7 @@ def main():
parser.add_argument('-L', '--local', action='store_true', default=False, help="generate release locally, but don't upload") parser.add_argument('-L', '--local', action='store_true', default=False, help="generate release locally, but don't upload")
parser.add_argument('-o', '--offline', action='store_true', default=False, help="verify manifest locally, but don't fetch updates") parser.add_argument('-o', '--offline', action='store_true', default=False, help="verify manifest locally, but don't fetch updates")
parser.add_argument("repository", nargs="?", default=None, help="URL of remote repository, or path to RSM manifest", type=str) parser.add_argument("repository", nargs="?", default=None, help="URL of remote repository, or path to RSM manifest", type=str)
parser.add_argument("operation", nargs="?", default=None, help="list, view, fetch, create, latest or delete", type=str) parser.add_argument("operation", nargs="?", default=None, help="list, view, fetch, verify, create, latest or delete", type=str)
parser.add_argument("target", nargs="?", default=None, help="tag and path to release artifacts directory", type=str) parser.add_argument("target", nargs="?", default=None, help="tag and path to release artifacts directory", type=str)
elif subcommand == "perms": elif subcommand == "perms":
@@ -410,6 +411,24 @@ class ReticulumGitClient():
resolved = resolve(alias) resolved = resolve(alias)
return resolved return resolved
def __commit_hash_from_tag(self, tag, repo_path="./"):
if not ReticulumGitNode._ensure_git(): return None
else:
try:
result = subprocess.run(["git", "rev-list", "-n", "1", tag], cwd=repo_path, capture_output=True, text=True, check=False)
if result.returncode != 0:
RNS.log(f"Could not resolve commit hash for tag {tag}: {result.stderr.strip()}", RNS.LOG_DEBUG)
return None
else:
commit_hash = result.stdout.strip()
if commit_hash: return commit_hash
else: return None
except Exception as e:
RNS.log(f"Error resolving commit hash for tag {tag}: {e}", RNS.LOG_DEBUG)
return None
def abort(self, msg): def abort(self, msg):
print(msg); exit(1) print(msg); exit(1)
@@ -787,7 +806,7 @@ class ReticulumGitClient():
created_ts = rel.get("created", 0) created_ts = rel.get("created", 0)
created = time.strftime("%Y-%m-%d %H:%M", time.localtime(created_ts)) if created_ts else "unknown" created = time.strftime("%Y-%m-%d %H:%M", time.localtime(created_ts)) if created_ts else "unknown"
artifacts = str(rel.get("artifacts", 0)) artifacts = str(rel.get("artifacts", 0))
preview = rel.get("preview", "")[:34] preview = rel.get("preview", "").splitlines()[0][:34]
print(f"{tag:<10} {status:<10} {created:<17} {artifacts:<5} {preview}") print(f"{tag:<10} {status:<10} {created:<17} {artifacts:<5} {preview}")
if latest_release: print(f"\nThe latest release is: {latest_release}") if latest_release: print(f"\nThe latest release is: {latest_release}")
@@ -1015,7 +1034,8 @@ class ReticulumGitClient():
if len(parts) < 2: self.abort("Invalid release specification\nDid you provide both a tag and artifacts path such as \"1.0.0:./dist\"?") if len(parts) < 2: self.abort("Invalid release specification\nDid you provide both a tag and artifacts path such as \"1.0.0:./dist\"?")
tag = parts[0] tag = parts[0]
artifacts_path = os.path.expanduser(parts[1]) artifacts_path = os.path.expanduser(parts[1])
commit_hash = None # TODO: Get commit hash from tag commit_hash = self.__commit_hash_from_tag(tag)
if not commit_hash: print(f"Could not get commit hash for tag {tag}. Does the tag exist in the local repository?")
if not os.path.isdir(artifacts_path): self.abort("Specified artifacts directory does not exist") if not os.path.isdir(artifacts_path): self.abort("Specified artifacts directory does not exist")
artifacts = [f for f in os.listdir(artifacts_path) if os.path.isfile(os.path.join(artifacts_path, f))] artifacts = [f for f in os.listdir(artifacts_path) if os.path.isfile(os.path.join(artifacts_path, f))]
@@ -2665,7 +2685,7 @@ class ReticulumGitNode():
################## ##################
def log_request(self, msg, remote_identity): def log_request(self, msg, remote_identity):
if remote_identity.hash in self.blocked_identities: RNS.log(f"Blocked: {msg}", RNS.LOG_DEBUG) if remote_identity and remote_identity.hash in self.blocked_identities: RNS.log(f"Blocked: {msg}", RNS.LOG_DEBUG)
else: RNS.log(msg, RNS.LOG_VERBOSE) else: RNS.log(msg, RNS.LOG_VERBOSE)
@staticmethod @staticmethod
+2 -3
View File
@@ -492,8 +492,7 @@ def create_rsg(signer_identity, message, embed=False, meta=None, output="bin"):
signed_data = { "hashtype": "sha256", "hash": get_rsg_hash(message), signed_data = { "hashtype": "sha256", "hash": get_rsg_hash(message),
"meta": { "signer": signer_identity.hash, "meta": { "signer": signer_identity.hash,
"pubkey": signer_identity.get_public_key(), "pubkey": signer_identity.get_public_key() } }
"note" : None } } # TODO: Remove default note field in 1.2.9
if embed: if embed:
if type(message) == str: message = message.encode("utf-8") if type(message) == str: message = message.encode("utf-8")
@@ -715,7 +714,7 @@ def validate_message(args, identity, __recursive=False):
elif type(entry) == int: etype = "i" elif type(entry) == int: etype = "i"
elif type(entry) == float: etype = "f" elif type(entry) == float: etype = "f"
elif entry == None: etype = "N" elif entry == None: etype = "N"
if key == "note" and entry == None: return # TODO: Remove this check in 1.2.9 if key == "note" and entry == None: return # TODO: Remove this check in 1.3.3
if type(entry) == bytes: entry = RNS.hexrep(entry, delimit=False) if type(entry) == bytes: entry = RNS.hexrep(entry, delimit=False)
leadin = f"{etype}{indent}{key}="; leadln = len(leadin) leadin = f"{etype}{indent}{key}="; leadln = len(leadin)
entry = f"{entry}"; chunk = entry[:maxwidth]; entry = entry[maxwidth:] entry = f"{entry}"; chunk = entry[:maxwidth]; entry = entry[maxwidth:]
+30 -8
View File
@@ -100,7 +100,7 @@ __example_rns_config__ = '''# This is an example Reticulum config file.
# always-on. This directive is optional and can be removed # always-on. This directive is optional and can be removed
# for brevity. # for brevity.
enable_transport = No enable_transport = no
# By default, the first program to launch the Reticulum # By default, the first program to launch the Reticulum
@@ -112,7 +112,7 @@ enable_transport = No
# user, and should generally be turned on. This directive # user, and should generally be turned on. This directive
# is optional and can be removed for brevity. # is optional and can be removed for brevity.
share_instance = Yes share_instance = yes
# If you want to run multiple *different* shared instances # If you want to run multiple *different* shared instances
@@ -178,7 +178,7 @@ instance_name = default
# the network. If this option is enabled, Reticulum will # the network. If this option is enabled, Reticulum will
# collect interface information discovered from the network. # collect interface information discovered from the network.
# discover_interfaces = No # discover_interfaces = no
# If you only want to discover interfaces from specific # If you only want to discover interfaces from specific
@@ -215,7 +215,7 @@ instance_name = default
# an optional directive, and can be left out for brevity. # an optional directive, and can be left out for brevity.
# This behaviour is disabled by default. # This behaviour is disabled by default.
# panic_on_interface_error = No # panic_on_interface_error = no
# When Transport is enabled, it is possible to allow the # When Transport is enabled, it is possible to allow the
@@ -226,14 +226,15 @@ instance_name = default
# Transport Instance, and printed to the log at startup. # Transport Instance, and printed to the log at startup.
# Optional, and disabled by default. # Optional, and disabled by default.
# respond_to_probes = No # respond_to_probes = no
# You can publish your local list of blackholed identities # You can publish your local list of blackholed identities
# for other transport instances to use for automatic, # for other transport instances to use for automatic,
# network-wide blackhole management. # network-wide blackhole management.
# publish_blackhole = No # publish_blackhole = no
# List of remote transport identities from which to auto- # List of remote transport identities from which to auto-
# matically source lists of blackholed identities. # matically source lists of blackholed identities.
@@ -249,8 +250,22 @@ instance_name = default
# blackhole_sources = 521c87a83afb8f29e4455e77930b973b # blackhole_sources = 521c87a83afb8f29e4455e77930b973b
# You can set the interval in minutes at which remote
# blackhole sources are updated. Defaults to one hour.
# blackhole_update_interval = 60
# When not running as a transport node, it is possible to
# force the use of the same, static transport identity
# for every instance start. Defaults to using a new identity
# at every instance start, if transport is disabled.
# static_transport_identity = no
[logging] [logging]
# Valid log levels are 0 through 7: # Valid log levels are 0 through 8:
# 0: Log only critical information # 0: Log only critical information
# 1: Log errors and lower log levels # 1: Log errors and lower log levels
# 2: Log warnings and lower log levels # 2: Log warnings and lower log levels
@@ -258,10 +273,17 @@ instance_name = default
# 4: Log info and lower (this is the default) # 4: Log info and lower (this is the default)
# 5: Verbose logging # 5: Verbose logging
# 6: Debug logging # 6: Debug logging
# 7: Extreme logging # 7: Path logging
# 8: Extreme logging
loglevel = 4 loglevel = 4
# You can disable timestamp inclusion in logs. Useful if
# you want to use an external logging tool that provides
# its own timestamps or custom formatting.
# logtimestamps = no
# The interfaces section defines the physical and virtual # The interfaces section defines the physical and virtual
# interfaces Reticulum will use to communicate on. This # interfaces Reticulum will use to communicate on. This
+1 -1
View File
@@ -1 +1 @@
__version__ = "0.2.0" __version__ = "0.3.0"
+2 -1
View File
@@ -44,7 +44,8 @@ def setup_argument_parser():
parser = argparse.ArgumentParser(description="Reticulum Remote Shell Utility", epilog="When specifying a command to execute, separate rnsh\noptions from the command and its arguments with --\n\nFor example:\n rnsh -l -- /bin/bash --login\n rnsh <destination> -- ls -la /tmp", formatter_class=argparse.RawDescriptionHelpFormatter) parser = argparse.ArgumentParser(description="Reticulum Remote Shell Utility", epilog="When specifying a command to execute, separate rnsh\noptions from the command and its arguments with --\n\nFor example:\n rnsh -l -- /bin/bash --login\n rnsh <destination> -- ls -la /tmp", formatter_class=argparse.RawDescriptionHelpFormatter)
# Common options # Common options
parser.add_argument("--config", "-c", action="store", default=None, help="path to alternative Reticulum config directory", type=str) parser.add_argument("--config", "-c", action="store", default=None, help="path to config directory", type=str)
parser.add_argument("--rnsconfig", action="store", default=None, help="path to alternative Reticulum config directory", type=str)
parser.add_argument("--identity", "-i", action="store", default=None, help="path to identity file to use", type=str) parser.add_argument("--identity", "-i", action="store", default=None, help="path to identity file to use", type=str)
parser.add_argument("-v", "--verbose", action="count", default=0, help="increase verbosity") parser.add_argument("-v", "--verbose", action="count", default=0, help="increase verbosity")
parser.add_argument("-q", "--quiet", action="count", default=0, help="decrease verbosity") parser.add_argument("-q", "--quiet", action="count", default=0, help="decrease verbosity")
-2
View File
@@ -53,8 +53,6 @@ class permit(AbstractContextManager):
""" """
def __init__(self, *exceptions): self._exceptions = exceptions def __init__(self, *exceptions): self._exceptions = exceptions
def __enter__(self): pass def __enter__(self): pass
def __exit__(self, exctype, excinst, exctb): def __exit__(self, exctype, excinst, exctb):
return exctype is not None and not issubclass(exctype, self._exceptions) return exctype is not None and not issubclass(exctype, self._exceptions)
-1
View File
@@ -55,5 +55,4 @@ class SleepRate:
return sleep_for if sleep_for > 0 else 0 return sleep_for if sleep_for > 0 else 0
async def sleep_async(self): await asyncio.sleep(self.next_sleep_time()) async def sleep_async(self): await asyncio.sleep(self.next_sleep_time())
def sleep_block(self): time.sleep(self.next_sleep_time()) def sleep_block(self): time.sleep(self.next_sleep_time())
+7 -14
View File
@@ -144,7 +144,7 @@ class RemoteExecutionError(Exception):
def __init__(self, msg): self.msg = msg def __init__(self, msg): self.msg = msg
async def _initiate_link(configdir, rnsconfigdir, identitypath=None, verbosity=0, quietness=0, noid=False, destination=None, async def _initiate_link(configdir, rnsconfigdir, identitypath=None, logfile=None, verbosity=0, quietness=0, noid=False, destination=None,
timeout=RNS.Transport.PATH_REQUEST_TIMEOUT): timeout=RNS.Transport.PATH_REQUEST_TIMEOUT):
global _identity, _reticulum, _link, _destination, _remote_exec_grace global _identity, _reticulum, _link, _destination, _remote_exec_grace
@@ -160,11 +160,11 @@ async def _initiate_link(configdir, rnsconfigdir, identitypath=None, verbosity=0
if _reticulum is None: if _reticulum is None:
targetloglevel = compute_target_rns_loglevel(verbosity, quietness, RNS.LOG_ERROR) targetloglevel = compute_target_rns_loglevel(verbosity, quietness, RNS.LOG_ERROR)
RNS.logfile = os.path.join(configdir, "logfile") RNS.logfile = logfile
_reticulum = RNS.Reticulum(configdir=rnsconfigdir, loglevel=targetloglevel, logdest=RNS.LOG_FILE) _reticulum = RNS.Reticulum(configdir=rnsconfigdir, loglevel=targetloglevel, logdest=RNS.LOG_FILE)
if _identity is None: if _identity is None:
_identity = rnsh.prepare_identity(identitypath) _identity = rnsh.prepare_identity(identity_path=identitypath, service_name=None, configdir=configdir)
if not RNS.Transport.has_path(destination_hash): if not RNS.Transport.has_path(destination_hash):
RNS.Transport.request_path(destination_hash) RNS.Transport.request_path(destination_hash)
@@ -211,8 +211,9 @@ async def _handle_error(errmsg: RNS.MessageBase):
raise RemoteExecutionError(f"Remote error: {errmsg.msg}") raise RemoteExecutionError(f"Remote error: {errmsg.msg}")
async def initiate(configdir: str, rnsconfigdir:str, identitypath: str, verbosity: int, quietness: int, noid: bool, destination: str, async def initiate(configdir: str, rnsconfigdir:str, identitypath: str, logfile:str, verbosity: int, quietness: int, noid: bool, destination: str,
timeout: float, command: [str] | None = None): timeout: float, command: [str] | None = None):
global _finished, _link global _finished, _link
if timeout is None: if timeout is None:
timeout = RNS.Transport.PATH_REQUEST_TIMEOUT timeout = RNS.Transport.PATH_REQUEST_TIMEOUT
@@ -239,12 +240,6 @@ async def initiate(configdir: str, rnsconfigdir:str, identitypath: str, verbosit
channel = _link.get_channel() channel = _link.get_channel()
protocol.register_message_types(channel) protocol.register_message_types(channel)
channel.add_message_handler(_client_message_handler) channel.add_message_handler(_client_message_handler)
# Next step after linking and identifying: send version
# if not await _spin(lambda: messenger.is_outlet_ready(outlet), timeout=5, quiet=quietness > 0):
# print("Error bringing up link")
# return 253
channel.send(protocol.VersionInfoMessage()) channel.send(protocol.VersionInfoMessage())
try: try:
vm = _pq.get(timeout=max(outlet.rtt * 20, 5)) vm = _pq.get(timeout=max(outlet.rtt * 20, 5))
@@ -283,10 +278,8 @@ async def initiate(configdir: str, rnsconfigdir:str, identitypath: str, verbosit
return None return None
elif b == "L": elif b == "L":
line_mode = not line_mode line_mode = not line_mode
if line_mode: if line_mode: os.write(1, "\n\rLine-interactive mode enabled\n\r".encode("utf-8"))
os.write(1, "\n\rLine-interactive mode enabled\n\r".encode("utf-8")) else: os.write(1, "\n\rLine-interactive mode disabled\n\r".encode("utf-8"))
else:
os.write(1, "\n\rLine-interactive mode disabled\n\r".encode("utf-8"))
return None return None
return b return b
+12 -5
View File
@@ -118,25 +118,32 @@ def compute_target_rns_loglevel(verbosity: int, quietness: int, base_level: int
except Exception: return base_level except Exception: return base_level
async def listen(configdir, rnsconfigdir, command, identitypath=None, service_name=None, verbosity=0, quietness=0, allowed=None, async def listen(configdir, rnsconfigdir, command, identitypath=None, logfile=None, service_name=None, verbosity=0, quietness=0,
allowed_file=None, disable_auth=None, announce_period=900, no_remote_command=True, remote_cmd_as_args=False, allowed=None, allowed_file=None, disable_auth=None, announce_period=900, no_remote_command=True, remote_cmd_as_args=False,
loop: asyncio.AbstractEventLoop = None): loop: asyncio.AbstractEventLoop = None):
global _identity, _allow_all, _allowed_identity_hashes, _allowed_file, _allowed_file_identity_hashes global _identity, _allow_all, _allowed_identity_hashes, _allowed_file, _allowed_file_identity_hashes
global _reticulum, _cmd, _destination, _no_remote_command, _remote_cmd_as_args, _finished global _reticulum, _cmd, _destination, _no_remote_command, _remote_cmd_as_args, _finished
if not loop: loop = asyncio.get_running_loop() if not loop: loop = asyncio.get_running_loop()
if service_name is None or len(service_name) == 0: if service_name is None or len(service_name) == 0: service_name = "default"
service_name = "default"
RNS.log(f"Using service name {service_name}", RNS.LOG_INFO) RNS.log(f"Using service name {service_name}", RNS.LOG_INFO)
if logfile:
RNS.log(f"Logging to {logfile}", RNS.LOG_NOTICE)
logdest = RNS.LOG_FILE
RNS.logfile = logfile
else:
RNS.log(f"Logging to console", RNS.LOG_NOTICE)
logdest = RNS.LOG_STDOUT
# More -v should increase verbosity (higher RNS.loglevel); -q should decrease it # More -v should increase verbosity (higher RNS.loglevel); -q should decrease it
targetloglevel = compute_target_rns_loglevel(verbosity, quietness, RNS.LOG_INFO) targetloglevel = compute_target_rns_loglevel(verbosity, quietness, RNS.LOG_INFO)
_reticulum = RNS.Reticulum(configdir=rnsconfigdir, loglevel=targetloglevel) _reticulum = RNS.Reticulum(configdir=rnsconfigdir, loglevel=targetloglevel)
_identity = rnsh.prepare_identity(identitypath, service_name) _identity = rnsh.prepare_identity(identity_path=identitypath, service_name=service_name, configdir=configdir)
_destination = RNS.Destination(_identity, RNS.Destination.IN, RNS.Destination.SINGLE, rnsh.APP_NAME) _destination = RNS.Destination(_identity, RNS.Destination.IN, RNS.Destination.SINGLE, rnsh.APP_NAME)
RNS.log(f"rnsh listening for commands on {RNS.prettyhexrep(_destination.hash)}", RNS.LOG_NOTICE) RNS.log(f"rnsh listening for commands on {RNS.prettyhexrep(_destination.hash)}", RNS.LOG_NOTICE)
RNS.logdest = logdest
_cmd = command _cmd = command
if _cmd is None or len(_cmd) == 0: if _cmd is None or len(_cmd) == 0:
+4 -10
View File
@@ -88,8 +88,7 @@ class RetryThread(AbstractContextManager):
self._thread = threading.Thread(name=name, target=self._thread_run, daemon=True) self._thread = threading.Thread(name=name, target=self._thread_run, daemon=True)
self._thread.start() self._thread.start()
def is_alive(self): def is_alive(self): return self._thread.is_alive()
return self._thread.is_alive()
def close(self, loop: asyncio.AbstractEventLoop = None) -> asyncio.Future: def close(self, loop: asyncio.AbstractEventLoop = None) -> asyncio.Future:
RNS.log("Stopping timer thread", RNS.LOG_DEBUG) RNS.log("Stopping timer thread", RNS.LOG_DEBUG)
@@ -102,17 +101,12 @@ class RetryThread(AbstractContextManager):
return self._finished return self._finished
def wait(self, timeout: float = None): def wait(self, timeout: float = None):
if timeout: if timeout: timeout = timeout + time.time()
timeout = timeout + time.time()
while timeout is None or time.time() < timeout: while timeout is None or time.time() < timeout:
with self._lock: with self._lock: task_count = len(self._statuses)
task_count = len(self._statuses) if task_count == 0: return
if task_count == 0:
return
time.sleep(0.1) time.sleep(0.1)
def _thread_run(self): def _thread_run(self):
while self._run and self._finished is None: while self._run and self._finished is None:
time.sleep(self._loop_period) time.sleep(self._loop_period)
+40 -25
View File
@@ -57,43 +57,54 @@ loop: asyncio.AbstractEventLoop | None = None
def _sanitize_service_name(service_name:str) -> str: return re.sub(r'\W+', '', service_name) def _sanitize_service_name(service_name:str) -> str: return re.sub(r'\W+', '', service_name)
def prepare_identity(identity_path, service_name: str = None) -> tuple[RNS.Identity]: def prepare_identity(identity_path=None, service_name=None, configdir=None):
service_name = _sanitize_service_name(service_name or "") service_name = _sanitize_service_name(service_name or "")
if identity_path is None: if not identity_path:
identity_path = RNS.Reticulum.identitypath + "/" + APP_NAME + \ identity_path = f"{configdir}/identity" + (f".{service_name}" if service_name and len(service_name) > 0 else "")
(f".{service_name}" if service_name and len(service_name) > 0 else "")
identity = None identity = None
if os.path.isfile(identity_path): if os.path.isfile(identity_path):
RNS.log(f"Loading identity from {identity_path}", RNS.LOG_VERBOSE)
identity = RNS.Identity.from_file(identity_path) identity = RNS.Identity.from_file(identity_path)
if identity is None: if identity is None:
RNS.log("No valid saved identity found, creating new...", RNS.LOG_INFO) RNS.log(f"Creating identity {identity_path}", RNS.LOG_NOTICE)
identity = RNS.Identity() identity = RNS.Identity()
identity.to_file(identity_path) identity.to_file(identity_path)
return identity return identity
def print_identity(configdir, identitypath, service_name, include_destination: bool): def print_identity(configdir, rnsconfigdir, identitypath, service_name, include_destination: bool):
reticulum = RNS.Reticulum(configdir=configdir, loglevel=RNS.LOG_INFO) reticulum = RNS.Reticulum(configdir=rnsconfigdir, loglevel=RNS.LOG_INFO)
if service_name and len(service_name) > 0: if service_name and len(service_name) > 0: print(f"Using service name \"{service_name}\"")
print(f"Using service name \"{service_name}\"") identity = prepare_identity(identity_path=identitypath, service_name=service_name, configdir=configdir)
identity = prepare_identity(identitypath, service_name)
destination = RNS.Destination(identity, RNS.Destination.IN, RNS.Destination.SINGLE, APP_NAME) destination = RNS.Destination(identity, RNS.Destination.IN, RNS.Destination.SINGLE, APP_NAME)
print("Identity : " + str(identity)) print("Identity : " + str(identity))
if include_destination: if include_destination: print("Listening on : " + RNS.prettyhexrep(destination.hash))
print("Listening on : " + RNS.prettyhexrep(destination.hash))
exit(0) exit(0)
verbose_set = False verbose_set = False
def ensure_config_directory(): def ensure_config_directory(configdir=None):
if os.path.isdir(os.path.expanduser("~/.config/rnsh")): return os.path.expanduser("~/.config/rnsh") if configdir:
elif os.path.isdir(os.path.expanduser("~/.rnsh")): return os.path.expanduser("~/.rnsh") if os.path.isdir(os.path.expanduser(configdir)): return os.path.expanduser(configdir)
else:
try:
RNS.log(f"Creating configuration directory: {os.path.expanduser(configdir)}")
os.makedirs(os.path.expanduser(configdir))
return os.path.expanduser(configdir)
except Exception as e:
RNS.log(f"Could not get or create rnsh configuration directory, aborting", RNS.LOG_CRITICAL)
os._exit(1)
elif os.path.isdir(os.path.expanduser("~/.config/rnsh")): return os.path.expanduser("~/.config/rnsh")
elif os.path.isdir(os.path.expanduser("~/.rnsh")): return os.path.expanduser("~/.rnsh")
else: else:
try: try:
RNS.log(f"Creating configuration directory: {os.path.expanduser('~/.rnsh')}")
os.makedirs(os.path.expanduser("~/.rnsh")) os.makedirs(os.path.expanduser("~/.rnsh"))
return os.path.expanduser("~/.rnsh") return os.path.expanduser("~/.rnsh")
@@ -105,26 +116,30 @@ def ensure_config_directory():
async def _rnsh_cli_main(): async def _rnsh_cli_main():
global verbose_set global verbose_set
args, parser = parse_arguments() args, parser = parse_arguments()
verbose_set = args.verbose > 0 verbose_set = args.verbose > 0
configdir = ensure_config_directory(args.config)
configdir = ensure_config_directory() if not configdir:
RNS.log(f"Could not resolve rnsh configuration directory", RNS.LOG_CRITICAL)
os._exit(1)
if args.print_identity: if args.print_identity:
print_identity(args.config, args.identity, args.service, args.listen) print_identity(configdir, args.rnsconfig, args.identity, args.service, args.listen)
return 0 return 0
logfile = f"{configdir}/logfile"
if args.listen: if args.listen:
allowed_file = None allowed_file = None
dest_len = (RNS.Reticulum.TRUNCATED_HASHLENGTH//8)*2 dest_len = (RNS.Reticulum.TRUNCATED_HASHLENGTH//8)*2
if os.path.isfile(os.path.expanduser("~/.config/rnsh/allowed_identities")): if os.path.isfile(os.path.expanduser(f"{configdir}/allowed_identities")):
allowed_file = os.path.expanduser("~/.config/rnsh/allowed_identities") allowed_file = os.path.expanduser(f"{configdir}/allowed_identities")
elif os.path.isfile(os.path.expanduser("~/.rnsh/allowed_identities")):
allowed_file = os.path.expanduser("~/.rnsh/allowed_identities")
await listener.listen(configdir=configdir, await listener.listen(configdir=configdir,
rnsconfigdir=args.config, rnsconfigdir=args.rnsconfig,
command=args.command, command=args.command,
identitypath=args.identity, identitypath=args.identity,
logfile=logfile,
service_name=args.service, service_name=args.service,
verbosity=args.verbose, verbosity=args.verbose,
quietness=args.quiet, quietness=args.quiet,
@@ -138,8 +153,9 @@ async def _rnsh_cli_main():
if args.destination is not None: if args.destination is not None:
return_code = await initiator.initiate(configdir=configdir, return_code = await initiator.initiate(configdir=configdir,
rnsconfigdir=args.config, rnsconfigdir=args.rnsconfig,
identitypath=args.identity, identitypath=args.identity,
logfile=logfile,
verbosity=args.verbose, verbosity=args.verbose,
quietness=args.quiet, quietness=args.quiet,
noid=args.no_id, noid=args.no_id,
@@ -170,5 +186,4 @@ def main():
if verbose_set and exc: raise exc if verbose_set and exc: raise exc
sys.exit(return_code if return_code is not None else 255) sys.exit(return_code if return_code is not None else 255)
if __name__ == "__main__": main() if __name__ == "__main__": main()
+71 -71
View File
@@ -103,6 +103,8 @@ class ListenerSession:
self.outlet.set_link_closed_callback(self._link_closed) self.outlet.set_link_closed_callback(self._link_closed)
self.loop = loop self.loop = loop
self.state: LSState = None self.state: LSState = None
self.terminated = False
self.authenticated = False
self.remote_identity = None self.remote_identity = None
self.term: str | None = None self.term: str | None = None
self.stdin_is_pipe: bool = False self.stdin_is_pipe: bool = False
@@ -122,8 +124,10 @@ class ListenerSession:
self.return_code_sent = False self.return_code_sent = False
self.process: process.CallbackSubprocess | None = None self.process: process.CallbackSubprocess | None = None
if self.allow_all: self._set_state(LSState.LSSTATE_WAIT_VERS) if not self.allow_all: self._set_state(LSState.LSSTATE_WAIT_IDENT)
else: self._set_state(LSState.LSSTATE_WAIT_IDENT) else:
self._set_state(LSState.LSSTATE_WAIT_VERS)
self.authenticated = True
self.sessions.append(self) self.sessions.append(self)
protocol.register_message_types(self.channel) protocol.register_message_types(self.channel)
@@ -143,37 +147,31 @@ class ListenerSession:
def _call(self, func: callable, delay: float = 0): def _call(self, func: callable, delay: float = 0):
def call_inner(): def call_inner():
if delay == 0: func() if delay == 0: func()
else: self.loop.call_later(delay, func) else: self.loop.call_later(delay, func)
self.loop.call_soon_threadsafe(call_inner) self.loop.call_soon_threadsafe(call_inner)
def send(self, message: RNS.MessageBase): def send(self, message: RNS.MessageBase): self.channel.send(message)
self.channel.send(message) def _protocol_error(self, name: str): self.terminate(f"Protocol error ({name})")
def _protocol_timeout_error(self, name: str): self.terminate(f"Protocol timeout error: {name}")
def _protocol_error(self, name: str):
self.terminate(f"Protocol error ({name})")
def _protocol_timeout_error(self, name: str):
self.terminate(f"Protocol timeout error: {name}")
def terminate(self, error: str = None): def terminate(self, error: str = None):
self.terminated = True
self.state = LSState.LSSTATE_ERROR
with contextlib.suppress(Exception): with contextlib.suppress(Exception):
RNS.log("Terminating session" + (f": {error}" if error else ""), RNS.LOG_DEBUG) RNS.log("Terminating session" + (f": {error}" if error else ""), RNS.LOG_DEBUG)
if error and self.state != LSState.LSSTATE_TEARDOWN: if error and self.state != LSState.LSSTATE_TEARDOWN:
with contextlib.suppress(Exception): with contextlib.suppress(Exception):
self.send(protocol.ErrorMessage(error, True)) self.send(protocol.ErrorMessage(error, True))
self.state = LSState.LSSTATE_ERROR
self._terminate_process() self._terminate_process()
self._call(self._prune, max(self.outlet.rtt * 3, process.CallbackSubprocess.PROCESS_PIPE_TIME+5)) self._call(self._prune, max(self.outlet.rtt * 3, process.CallbackSubprocess.PROCESS_PIPE_TIME+5))
def _prune(self): def _prune(self):
self.state = LSState.LSSTATE_TEARDOWN self.state = LSState.LSSTATE_TEARDOWN
RNS.log("Pruning session", RNS.LOG_DEBUG) RNS.log("Pruning session", RNS.LOG_DEBUG)
with contextlib.suppress(ValueError): with contextlib.suppress(ValueError): self.sessions.remove(self)
self.sessions.remove(self) with contextlib.suppress(Exception): self.outlet.teardown()
with contextlib.suppress(Exception):
self.outlet.teardown()
def _check_protocol_timeout(self, fail_condition: Callable[[], bool], name: str): def _check_protocol_timeout(self, fail_condition: Callable[[], bool], name: str):
timeout = True timeout = True
@@ -183,7 +181,6 @@ class ListenerSession:
def _link_closed(self, outlet: LSOutletBase): def _link_closed(self, outlet: LSOutletBase):
outlet.unset_link_closed_callback() outlet.unset_link_closed_callback()
if outlet != self.outlet: if outlet != self.outlet:
RNS.log("Link closed received from incorrect outlet", RNS.LOG_DEBUG) RNS.log("Link closed received from incorrect outlet", RNS.LOG_DEBUG)
return return
@@ -200,11 +197,14 @@ class ListenerSession:
if self.state not in [LSState.LSSTATE_WAIT_IDENT, LSState.LSSTATE_WAIT_VERS]: if self.state not in [LSState.LSSTATE_WAIT_IDENT, LSState.LSSTATE_WAIT_VERS]:
self._protocol_error(LSState.LSSTATE_WAIT_IDENT.name) self._protocol_error(LSState.LSSTATE_WAIT_IDENT.name)
if not self.allow_all and identity.hash not in self.allowed_identity_hashes and identity.hash not in self.allowed_file_identity_hashes: if self.allow_all or identity.hash in self.allowed_identity_hashes or identity.hash in self.allowed_file_identity_hashes:
self.terminate("Identity is not allowed.") self.authenticated = True
self.remote_identity = identity
self._set_state(LSState.LSSTATE_WAIT_VERS)
self.remote_identity = identity else:
self._set_state(LSState.LSSTATE_WAIT_VERS) self.authenticated = False
self.terminate("Identity not allowed")
@classmethod @classmethod
async def pump_all(cls) -> True: async def pump_all(cls) -> True:
@@ -241,8 +241,7 @@ class ListenerSession:
if compressed_length < max_data_len and compressed_length < chunk_segment_length: if compressed_length < max_data_len and compressed_length < chunk_segment_length:
comp_success = True comp_success = True
break break
else: else: comp_try += 1
comp_try += 1
if comp_success: if comp_success:
diff = max_data_len - len(compressed_chunk) diff = max_data_len - len(compressed_chunk)
@@ -255,10 +254,8 @@ class ListenerSession:
return comp_success, processed_length, chunk return comp_success, processed_length, chunk
try: try:
if self.state != LSState.LSSTATE_RUNNING: if self.state != LSState.LSSTATE_RUNNING: return False
return False elif not self.channel.is_ready_to_send(): return False
elif not self.channel.is_ready_to_send():
return False
elif len(self.stderr_buf) > 0: elif len(self.stderr_buf) > 0:
comp_success, processed_length, data = compress_adaptive(self.stderr_buf) comp_success, processed_length, data = compress_adaptive(self.stderr_buf)
self.stderr_buf = self.stderr_buf[processed_length:] self.stderr_buf = self.stderr_buf[processed_length:]
@@ -267,8 +264,7 @@ class ListenerSession:
msg = protocol.StreamDataMessage(protocol.StreamDataMessage.STREAM_ID_STDERR, msg = protocol.StreamDataMessage(protocol.StreamDataMessage.STREAM_ID_STDERR,
data, send_eof, comp_success) data, send_eof, comp_success)
self.send(msg) self.send(msg)
if send_eof: if send_eof: self.stderr_eof_sent = True
self.stderr_eof_sent = True
return True return True
elif len(self.stdout_buf) > 0: elif len(self.stdout_buf) > 0:
comp_success, processed_length, data = compress_adaptive(self.stdout_buf) comp_success, processed_length, data = compress_adaptive(self.stdout_buf)
@@ -278,8 +274,7 @@ class ListenerSession:
msg = protocol.StreamDataMessage(protocol.StreamDataMessage.STREAM_ID_STDOUT, msg = protocol.StreamDataMessage(protocol.StreamDataMessage.STREAM_ID_STDOUT,
data, send_eof, comp_success) data, send_eof, comp_success)
self.send(msg) self.send(msg)
if send_eof: if send_eof: self.stdout_eof_sent = True
self.stdout_eof_sent = True
return True return True
elif self.return_code is not None and not self.return_code_sent: elif self.return_code is not None and not self.return_code_sent:
msg = protocol.CommandExitedMessage(self.return_code) msg = protocol.CommandExitedMessage(self.return_code)
@@ -295,22 +290,32 @@ class ListenerSession:
def _terminate_process(self): def _terminate_process(self):
with contextlib.suppress(Exception): with contextlib.suppress(Exception):
if self.process and self.process.running: if self.process and self.process.running: self.process.terminate()
self.process.terminate()
def _start_cmd(self, cmdline: [str], pipe_stdin: bool, pipe_stdout: bool, pipe_stderr: bool, tcflags: [any], def _start_cmd(self, cmdline: [str], pipe_stdin: bool, pipe_stdout: bool, pipe_stderr: bool, tcflags: [any],
term: str | None, rows: int, cols: int, hpix: int, vpix: int): term: str | None, rows: int, cols: int, hpix: int, vpix: int):
if self.terminated:
RNS.log(f"Attempt to start command on terminated session: {cmdline}", RNS.LOG_WARNING)
return
if not self.authenticated:
RNS.log(f"Attempt to start command on unauthenticated session: {cmdline}", RNS.LOG_WARNING)
self.terminate("Invalid state")
return
if self.state != LSState.LSSTATE_RUNNING:
RNS.log(f"Attempt to start command on session not in running state: {cmdline}", RNS.LOG_WARNING)
self.terminate("Invalid state")
return
self.cmdline = self.default_command self.cmdline = self.default_command
if not self.allow_remote_command and cmdline and len(cmdline) > 0: if not self.allow_remote_command and cmdline and len(cmdline) > 0:
self.terminate("Remote command line not allowed by listener") self.terminate("Remote command line not allowed by listener")
return return
if self.remote_cmd_as_args and cmdline and len(cmdline) > 0: if self.remote_cmd_as_args and cmdline and len(cmdline) > 0: self.cmdline.extend(cmdline)
self.cmdline.extend(cmdline) elif cmdline and len(cmdline) > 0: self.cmdline = cmdline
elif cmdline and len(cmdline) > 0:
self.cmdline = cmdline
self.stdin_is_pipe = pipe_stdin self.stdin_is_pipe = pipe_stdin
self.stdout_is_pipe = pipe_stdout self.stdout_is_pipe = pipe_stdout
@@ -318,11 +323,8 @@ class ListenerSession:
self.tcflags = tcflags self.tcflags = tcflags
self.term = term self.term = term
def stdout(data: bytes): def stdout(data: bytes): self.stdout_buf.extend(data)
self.stdout_buf.extend(data) def stderr(data: bytes): self.stderr_buf.extend(data)
def stderr(data: bytes):
self.stderr_buf.extend(data)
try: try:
self.process = process.CallbackSubprocess(argv=self.cmdline, self.process = process.CallbackSubprocess(argv=self.cmdline,
@@ -347,22 +349,28 @@ class ListenerSession:
self.cols = cols self.cols = cols
self.hpix = hpix self.hpix = hpix
self.vpix = vpix self.vpix = vpix
with contextlib.suppress(Exception): with contextlib.suppress(Exception): self.process.set_winsize(rows, cols, hpix, vpix)
self.process.set_winsize(rows, cols, hpix, vpix)
def _received_stdin(self, data: bytes, eof: bool): def _received_stdin(self, data: bytes, eof: bool):
if data and len(data) > 0: if data and len(data) > 0: self.process.write(data)
self.process.write(data) if eof: self.process.close_stdin()
if eof:
self.process.close_stdin()
def _handle_message(self, message: RNS.MessageBase): def _handle_message(self, message: RNS.MessageBase):
if self.terminated:
RNS.log(f"Received packet, but session was terminated", RNS.LOG_ERROR)
return
if self.state > LSState.LSSTATE_RUNNING:
RNS.log(f"Received packet, but in state {self.state.name}", RNS.LOG_ERROR)
return
if self.state == LSState.LSSTATE_WAIT_IDENT: if self.state == LSState.LSSTATE_WAIT_IDENT:
# Ignore any messages until the initiator has identified to avoid race conditions # Ignore any messages until the initiator has identified to avoid race conditions
# between identity announcement and early protocol messages. # between identity announcement and early protocol messages.
RNS.log("Ignoring message while waiting for identification", RNS.LOG_DEBUG) RNS.log("Ignoring message while waiting for identification", RNS.LOG_DEBUG)
return return
if self.state == LSState.LSSTATE_WAIT_VERS: elif self.state == LSState.LSSTATE_WAIT_VERS:
if not self.authenticated:
self.terminate("Invalid state")
return
if not isinstance(message, protocol.VersionInfoMessage): if not isinstance(message, protocol.VersionInfoMessage):
self._protocol_error(self.state.name) self._protocol_error(self.state.name)
return return
@@ -374,6 +382,9 @@ class ListenerSession:
self._set_state(LSState.LSSTATE_WAIT_CMD) self._set_state(LSState.LSSTATE_WAIT_CMD)
return return
elif self.state == LSState.LSSTATE_WAIT_CMD: elif self.state == LSState.LSSTATE_WAIT_CMD:
if not self.authenticated:
self.terminate("Invalid state")
return
if not isinstance(message, protocol.ExecuteCommandMesssage): if not isinstance(message, protocol.ExecuteCommandMesssage):
return self._protocol_error(self.state.name) return self._protocol_error(self.state.name)
RNS.log(f"Execute command message on link {self.outlet}: {message.cmdline}", RNS.LOG_VERBOSE) RNS.log(f"Execute command message on link {self.outlet}: {message.cmdline}", RNS.LOG_VERBOSE)
@@ -382,6 +393,9 @@ class ListenerSession:
message.tcflags, message.term, message.rows, message.cols, message.hpix, message.vpix) message.tcflags, message.term, message.rows, message.cols, message.hpix, message.vpix)
return return
elif self.state == LSState.LSSTATE_RUNNING: elif self.state == LSState.LSSTATE_RUNNING:
if not self.authenticated:
self.terminate("Invalid state")
return
if isinstance(message, protocol.WindowSizeMessage): if isinstance(message, protocol.WindowSizeMessage):
self._set_window_size(message.rows, message.cols, message.hpix, message.vpix) self._set_window_size(message.rows, message.cols, message.hpix, message.vpix)
elif isinstance(message, protocol.StreamDataMessage): elif isinstance(message, protocol.StreamDataMessage):
@@ -394,9 +408,6 @@ class ListenerSession:
# echo noop only on listener--used for keepalive/connectivity check # echo noop only on listener--used for keepalive/connectivity check
self.send(message) self.send(message)
return return
elif self.state in [LSState.LSSTATE_ERROR, LSState.LSSTATE_TEARDOWN]:
RNS.log(f"Received packet, but in state {self.state.name}", RNS.LOG_ERROR)
return
else: else:
self._protocol_error("unexpected message") self._protocol_error("unexpected message")
return return
@@ -405,29 +416,20 @@ class ListenerSession:
class RNSOutlet(LSOutletBase): class RNSOutlet(LSOutletBase):
def set_initiator_identified_callback(self, cb: Callable[[LSOutletBase, _TIdentity], None]): def set_initiator_identified_callback(self, cb: Callable[[LSOutletBase, _TIdentity], None]):
def inner_cb(link, identity: _TIdentity): def inner_cb(link, identity: _TIdentity): cb(self, identity)
cb(self, identity)
self.link.set_remote_identified_callback(inner_cb) self.link.set_remote_identified_callback(inner_cb)
def set_link_closed_callback(self, cb: Callable[[LSOutletBase], None]): def set_link_closed_callback(self, cb: Callable[[LSOutletBase], None]):
def inner_cb(link): def inner_cb(link): cb(self)
cb(self)
self.link.set_link_closed_callback(inner_cb) self.link.set_link_closed_callback(inner_cb)
def unset_link_closed_callback(self): def unset_link_closed_callback(self): self.link.set_link_closed_callback(None)
self.link.set_link_closed_callback(None) def teardown(self): self.link.teardown()
def teardown(self):
self.link.teardown()
@property @property
def rtt(self) -> float: def rtt(self) -> float: return self.link.rtt
return self.link.rtt
def __str__(self): def __str__(self): return f"Outlet on {self.link}"
return f"Outlet RNS Link {self.link}"
def __init__(self, link: RNS.Link): def __init__(self, link: RNS.Link):
self.link = link self.link = link
@@ -435,7 +437,5 @@ class RNSOutlet(LSOutletBase):
@staticmethod @staticmethod
def get_outlet(link: RNS.Link): def get_outlet(link: RNS.Link):
if hasattr(link, "lsoutlet"): if hasattr(link, "lsoutlet"): return link.lsoutlet
return link.lsoutlet
return RNSOutlet(link) return RNSOutlet(link)
+4
View File
@@ -423,6 +423,7 @@ def program_setup(configdir, dispall=False, verbosity=0, name_filter=None, json=
elif ifstat["mode"] == RNS.Interfaces.Interface.Interface.MODE_ROAMING: modestr = "Roaming" elif ifstat["mode"] == RNS.Interfaces.Interface.Interface.MODE_ROAMING: modestr = "Roaming"
elif ifstat["mode"] == RNS.Interfaces.Interface.Interface.MODE_BOUNDARY: modestr = "Boundary" elif ifstat["mode"] == RNS.Interfaces.Interface.Interface.MODE_BOUNDARY: modestr = "Boundary"
elif ifstat["mode"] == RNS.Interfaces.Interface.Interface.MODE_GATEWAY: modestr = "Gateway" elif ifstat["mode"] == RNS.Interfaces.Interface.Interface.MODE_GATEWAY: modestr = "Gateway"
elif ifstat["mode"] == RNS.Interfaces.Interface.Interface.MODE_INTERNAL: modestr = "Internal"
else: modestr = "Full" else: modestr = "Full"
@@ -449,6 +450,9 @@ def program_setup(configdir, dispall=False, verbosity=0, name_filter=None, json=
clients_string = "" clients_string = ""
else: else:
clients_string = "Clients : "+str(clients) clients_string = "Clients : "+str(clients)
if "blocked_ips" in ifstat:
p = ifstat["blocked_ips"] > 0
if p: clients_string += "\n Blocked : "+str(ifstat["blocked_ips"])+" IP"+"s" if p else ""
else: else:
clients = None clients = None
+6 -3
View File
@@ -70,7 +70,8 @@ LOG_NOTICE = 3
LOG_INFO = 4 LOG_INFO = 4
LOG_VERBOSE = 5 LOG_VERBOSE = 5
LOG_DEBUG = 6 LOG_DEBUG = 6
LOG_EXTREME = 7 LOG_PATHING = 7
LOG_EXTREME = 8
LOG_STDOUT = 0x91 LOG_STDOUT = 0x91
LOG_FILE = 0x92 LOG_FILE = 0x92
@@ -82,6 +83,7 @@ loglevel = LOG_NOTICE
logfile = None logfile = None
logdest = LOG_STDOUT logdest = LOG_STDOUT
logcall = None logcall = None
logtimestamps = True
logtimefmt = "%Y-%m-%d %H:%M:%S" logtimefmt = "%Y-%m-%d %H:%M:%S"
logtimefmt_p = "%H:%M:%S.%f" logtimefmt_p = "%H:%M:%S.%f"
compact_log_fmt = False compact_log_fmt = False
@@ -101,6 +103,7 @@ def loglevelname(level):
if (level == LOG_INFO): return "[Info] " if (level == LOG_INFO): return "[Info] "
if (level == LOG_VERBOSE): return "[Verbose] " if (level == LOG_VERBOSE): return "[Verbose] "
if (level == LOG_DEBUG): return "[Debug] " if (level == LOG_DEBUG): return "[Debug] "
if (level == LOG_PATHING): return "[Pathing] "
if (level == LOG_EXTREME): return "[Extra] " if (level == LOG_EXTREME): return "[Extra] "
return "Unknown" return "Unknown"
@@ -127,8 +130,8 @@ def log(msg, level=3, _override_destination = False, pt=False):
if loglevel >= level: if loglevel >= level:
if pt: logstring = "["+precise_timestamp_str(time.time())+"] "+loglevelname(level)+" "+msg if pt: logstring = "["+precise_timestamp_str(time.time())+"] "+loglevelname(level)+" "+msg
else: else:
if not compact_log_fmt: logstring = "["+timestamp_str(time.time())+"] "+loglevelname(level)+" "+msg if not compact_log_fmt: logstring = ("["+timestamp_str(time.time())+"] " if logtimestamps else "")+loglevelname(level)+" "+msg
else: logstring = "["+timestamp_str(time.time())+"] "+msg else: logstring = ("["+timestamp_str(time.time())+"] " if logtimestamps else "")+msg
with logging_lock: with logging_lock:
if (logdest == LOG_STDOUT or _always_override_destination or _override_destination): if (logdest == LOG_STDOUT or _always_override_destination or _override_destination):
+1 -1
View File
@@ -1 +1 @@
__version__ = "1.3.1" __version__ = "1.3.9"
Binary file not shown.
Binary file not shown.
+7
View File
@@ -11,6 +11,7 @@ LINE_START_PATTERNS = [
] ]
LINE_ANY_PATTERNS = [ LINE_ANY_PATTERNS = [
# r'<br/>',
# r'<div[^>]*>', # r'<div[^>]*>',
# r'</div>', # r'</div>',
] ]
@@ -36,6 +37,10 @@ def should_remove_line(line, start_patterns, any_patterns):
def clean_markdown_content(content, start_patterns, any_patterns, api_ref=False): def clean_markdown_content(content, start_patterns, any_patterns, api_ref=False):
content = content.replace("**\n : ", "**\n ")
content = content.replace("\n* **", "\n\n* **")
content = content.replace("\n\n\n", "\n\n")
lines = content.split('\n') lines = content.split('\n')
result = [] result = []
skip_next_empty = False skip_next_empty = False
@@ -57,6 +62,8 @@ def clean_markdown_content(content, start_patterns, any_patterns, api_ref=False)
if line.startswith("#### "): line = line.replace("#### ", "#### `") if line.startswith("#### "): line = line.replace("#### ", "#### `")
line = f"{line}`" line = f"{line}`"
line = line.replace("<br/>", "")
result.append(line) result.append(line)
# Remove trailing empty lines from end of file # Remove trailing empty lines from end of file
+1 -1
View File
@@ -1,4 +1,4 @@
# Sphinx build info version 1 # Sphinx build info version 1
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done. # This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 2bd2866b0dd37f224883693bd110b22f config: b7a9e97674355dfa0f0218a058ae09df
tags: 645f666f9bcd5a90fca523b33c5a78b7 tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

+11 -28
View File
@@ -4,18 +4,14 @@
Code Examples Code Examples
************* *************
A number of examples are included in the source distribution of Reticulum. A number of examples are included in the source distribution of Reticulum. You can use these examples to learn how to write your own programs.
You can use these examples to learn how to write your own programs.
.. _example-minimal: .. _example-minimal:
Minimal Minimal
======= =======
The *Minimal* example demonstrates the bare-minimum setup required to connect to The *Minimal* example demonstrates the bare-minimum setup required to connect to a Reticulum network from your program. In about five lines of code, you will have the Reticulum Network Stack initialised, and ready to pass traffic in your program.
a Reticulum network from your program. In about five lines of code, you will
have the Reticulum Network Stack initialised, and ready to pass traffic in your
program.
.. literalinclude:: ../../Examples/Minimal.py .. literalinclude:: ../../Examples/Minimal.py
@@ -26,9 +22,7 @@ This example can also be found at `<https://github.com/markqvist/Reticulum/blob/
Announce Announce
======== ========
The *Announce* example builds upon the previous example by exploring how to The *Announce* example builds upon the previous example by exploring how to announce a destination on the network, and how to let your program receive notifications about announces from relevant destinations.
announce a destination on the network, and how to let your program receive
notifications about announces from relevant destinations.
.. literalinclude:: ../../Examples/Announce.py .. literalinclude:: ../../Examples/Announce.py
@@ -38,8 +32,7 @@ This example can also be found at `<https://github.com/markqvist/Reticulum/blob/
Broadcast Broadcast
========= =========
The *Broadcast* example explores how to transmit plaintext broadcast messages The *Broadcast* example explores how to transmit plaintext broadcast messages over the network.
over the network.
.. literalinclude:: ../../Examples/Broadcast.py .. literalinclude:: ../../Examples/Broadcast.py
@@ -50,8 +43,7 @@ This example can also be found at `<https://github.com/markqvist/Reticulum/blob/
Echo Echo
==== ====
The *Echo* example demonstrates communication between two destinations using The *Echo* example demonstrates communication between two destinations using the Packet interface.
the Packet interface.
.. literalinclude:: ../../Examples/Echo.py .. literalinclude:: ../../Examples/Echo.py
@@ -62,8 +54,7 @@ This example can also be found at `<https://github.com/markqvist/Reticulum/blob/
Link Link
==== ====
The *Link* example explores establishing an encrypted link to a remote The *Link* example explores establishing an encrypted link to a remote destination, and passing traffic back and forth over the link.
destination, and passing traffic back and forth over the link.
.. literalinclude:: ../../Examples/Link.py .. literalinclude:: ../../Examples/Link.py
@@ -74,8 +65,7 @@ This example can also be found at `<https://github.com/markqvist/Reticulum/blob/
Identification Identification
============== ==============
The *Identify* example explores identifying an intiator of a link, once The *Identify* example explores identifying an intiator of a link, once the link has been established.
the link has been established.
.. literalinclude:: ../../Examples/Identify.py .. literalinclude:: ../../Examples/Identify.py
@@ -97,8 +87,7 @@ This example can also be found at `<https://github.com/markqvist/Reticulum/blob/
Channel Channel
======= =======
The *Channel* example explores using a ``Channel`` to send structured The *Channel* example explores using a ``Channel`` to send structured data between peers of a ``Link``.
data between peers of a ``Link``.
.. literalinclude:: ../../Examples/Channel.py .. literalinclude:: ../../Examples/Channel.py
@@ -107,8 +96,7 @@ This example can also be found at `<https://github.com/markqvist/Reticulum/blob/
Buffer Buffer
====== ======
The *Buffer* example explores using buffered readers and writers to send The *Buffer* example explores using buffered readers and writers to send binary data between peers of a ``Link``.
binary data between peers of a ``Link``.
.. literalinclude:: ../../Examples/Buffer.py .. literalinclude:: ../../Examples/Buffer.py
@@ -119,9 +107,7 @@ This example can also be found at `<https://github.com/markqvist/Reticulum/blob/
Filetransfer Filetransfer
============ ============
The *Filetransfer* example implements a basic file-server program that The *Filetransfer* example implements a basic file-server program that allow clients to connect and download files. The program uses the Resource interface to efficiently pass files of any size over a Reticulum :ref:`Link<api-link>`.
allow clients to connect and download files. The program uses the Resource
interface to efficiently pass files of any size over a Reticulum :ref:`Link<api-link>`.
.. literalinclude:: ../../Examples/Filetransfer.py .. literalinclude:: ../../Examples/Filetransfer.py
@@ -132,10 +118,7 @@ This example can also be found at `<https://github.com/markqvist/Reticulum/blob/
Custom Interfaces Custom Interfaces
================= =================
The *ExampleInterface* demonstrates creating custom interfaces for Reticulum. The *ExampleInterface* demonstrates creating custom interfaces for Reticulum. Any number of custom interfaces can be loaded and utilised by Reticulum, and will be fully on-par with natively included interfaces, including all supported :ref:`interface modes<interfaces-modes>` and :ref:`common configuration options<interfaces-options>`.
Any number of custom interfaces can be loaded and utilised by Reticulum, and
will be fully on-par with natively included interfaces, including all supported
:ref:`interface modes<interfaces-modes>` and :ref:`common configuration options<interfaces-options>`.
.. literalinclude:: ../../Examples/ExampleInterface.py .. literalinclude:: ../../Examples/ExampleInterface.py
+96 -290
View File
@@ -2,51 +2,38 @@
Getting Started Fast Getting Started Fast
******************** ********************
The best way to get started with the Reticulum Network Stack depends on what The best way to get started with the Reticulum Network Stack depends on what you want to do. This guide will outline sensible starting paths for different scenarios.
you want to do. This guide will outline sensible starting paths for different
scenarios.
Standalone Reticulum Installation Standalone Reticulum Installation
================================= =================================
If you simply want to install Reticulum and related utilities on a system, If you simply want to install Reticulum and related utilities on a system, the easiest way is via the ``pip`` package manager:
the easiest way is via the ``pip`` package manager:
.. code:: shell .. code:: shell
pip install rns pip install rns
If you do not already have pip installed, you can install it using the package manager If you do not already have pip installed, you can install it using the package manager of your system with a command like ``sudo apt install python3-pip``, ``sudo pamac install python-pip`` or similar.
of your system with a command like ``sudo apt install python3-pip``,
``sudo pamac install python-pip`` or similar.
You can also dowload the Reticulum release wheels from GitHub, or other release channels, You can also dowload the Reticulum release wheels from GitHub, or other release channels, and install them offline using ``pip``:
and install them offline using ``pip``:
.. code:: shell .. code:: shell
pip install ./rns-1.1.2-py3-none-any.whl pip install ./rns-1.1.2-py3-none-any.whl
On platforms that limit user package installation via ``pip``, you may need to manually On platforms that limit user package installation via ``pip``, you may need to manually allow this using the ``--break-system-packages`` command line flag when installing. This will not actually break any packages, unless you have installed Reticulum directly via your operating system's package manager.
allow this using the ``--break-system-packages`` command line flag when installing. This
will not actually break any packages, unless you have installed Reticulum directly via
your operating system's package manager.
.. code:: shell .. code:: shell
pip install rns --break-system-packages pip install rns --break-system-packages
For more detailed installation instructions, please see the For more detailed installation instructions, please see the :ref:`Platform-Specific Install Notes<install-guides>` section.
:ref:`Platform-Specific Install Notes<install-guides>` section.
After installation is complete, it might be helpful to refer to the After installation is complete, it might be helpful to refer to the :ref:`Using Reticulum on Your System<using-main>` chapter.
:ref:`Using Reticulum on Your System<using-main>` chapter.
Resolving Dependency & Installation Issues Resolving Dependency & Installation Issues
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
On some platforms, there may not be binary packages available for all dependencies, and On some platforms, there may not be binary packages available for all dependencies, and ``pip`` installation may fail with an error message. In these cases, the issue can usually be resolved by installing the development essentials packages for your platform:
``pip`` installation may fail with an error message. In these cases, the issue can usually
be resolved by installing the development essentials packages for your platform:
.. code:: shell .. code:: shell
@@ -59,69 +46,38 @@ be resolved by installing the development essentials packages for your platform:
# Fedora # Fedora
sudo dnf groupinstall "Development Tools" "Development Libraries" sudo dnf groupinstall "Development Tools" "Development Libraries"
With the base development packages installed, ``pip`` should be able to compile any missing With the base development packages installed, ``pip`` should be able to compile any missing dependencies from source, and complete installation even on platforms that don't have pre-compiled packages available.
dependencies from source, and complete installation even on platforms that don't have pre-
compiled packages available.
Try Using a Reticulum-based Program Try Using a Reticulum-based Program
============================================= ===================================
If you simply want to try using a program built with Reticulum, a :ref:`range of different If you simply want to try using a program built with Reticulum, a :ref:`range of different programs <software-main>` exist that allow basic communication and a various other useful functions, even over extremely low-bandwidth Reticulum networks.
programs <software-main>` exist that allow basic communication and a various other useful functions,
even over extremely low-bandwidth Reticulum networks.
Using the Included Utilities Using the Included Utilities
============================================= ============================
Reticulum comes with a range of included utilities that make it easier to Reticulum comes with a range of included utilities that make it easier to manage your network, check connectivity and make Reticulum available to other programs on your system.
manage your network, check connectivity and make Reticulum available to other
programs on your system.
You can use ``rnsd`` to run Reticulum as a background or foreground service, You can use ``rnsd`` to run Reticulum as a background or foreground service, and the ``rnstatus``, ``rnpath`` and ``rnprobe`` utilities to view and query network status and connectivity.
and the ``rnstatus``, ``rnpath`` and ``rnprobe`` utilities to view and query
network status and connectivity.
To learn more about these utility programs, have a look at the To learn more about these utility programs, have a look at the :ref:`Using Reticulum on Your System<using-main>` chapter of this manual.
:ref:`Using Reticulum on Your System<using-main>` chapter of this manual.
Creating a Network With Reticulum Creating a Network With Reticulum
============================================= =================================
To create a network, you will need to specify one or more *interfaces* for To create a network, you will need to specify one or more *interfaces* for Reticulum to use. This is done in the Reticulum configuration file, which by default is located at ``~/.reticulum/config``. You can get an example configuration file with all options via ``rnsd --exampleconfig``.
Reticulum to use. This is done in the Reticulum configuration file, which by
default is located at ``~/.reticulum/config``. You can get an example
configuration file with all options via ``rnsd --exampleconfig``.
When Reticulum is started for the first time, it will create a default When Reticulum is started for the first time, it will create a default configuration file, with one active interface. This default interface uses your existing Ethernet and WiFi networks (if any), and only allows you to communicate with other Reticulum peers within your local broadcast domains.
configuration file, with one active interface. This default interface uses
your existing Ethernet and WiFi networks (if any), and only allows you to
communicate with other Reticulum peers within your local broadcast domains.
To communicate further, you will have to add one or more interfaces. The default To communicate further, you will have to add one or more interfaces. The default configuration includes a number of examples, ranging from using TCP over the internet, to LoRa and Packet Radio interfaces.
configuration includes a number of examples, ranging from using TCP over the
internet, to LoRa and Packet Radio interfaces.
With Reticulum, you only need to configure what interfaces you want to communicate With Reticulum, you only need to configure what interfaces you want to communicate over. There is no need to configure address spaces, subnets, routing tables, or other things you might be used to from other network types.
over. There is no need to configure address spaces, subnets, routing tables,
or other things you might be used to from other network types.
Once Reticulum knows which interfaces it should use, it will automatically Once Reticulum knows which interfaces it should use, it will automatically discover topography and configure transport of data to any destinations it knows about.
discover topography and configure transport of data to any destinations it
knows about.
In situations where you already have an established WiFi or Ethernet network, and In situations where you already have an established WiFi or Ethernet network, and many devices that want to utilise the same external Reticulum network paths (for example over LoRa), it will often be sufficient to let one system act as a Reticulum gateway, by adding any external interfaces to the configuration of this system, and then enabling transport on it. Any other device on your local WiFi will then be able to connect to this wider Reticulum network just using the default (:ref:`AutoInterface<interfaces-auto>`) configuration.
many devices that want to utilise the same external Reticulum network paths (for example over
LoRa), it will often be sufficient to let one system act as a Reticulum gateway, by
adding any external interfaces to the configuration of this system, and then enabling transport on it. Any
other device on your local WiFi will then be able to connect to this wider Reticulum
network just using the default (:ref:`AutoInterface<interfaces-auto>`) configuration.
Possibly, the examples in the config file are enough to get you started. If Possibly, the examples in the config file are enough to get you started. If you want more information, you can read the :ref:`Building Networks<networks-main>` and :ref:`Interfaces<interfaces-main>` chapters of this manual, but most importantly, start with reading the next section, :ref:`Bootstrapping Connectivity<bootstrapping-connectivity>`, as this provides the most essential understanding of how to ensure reliable connectivity with a minimum of maintenance.
you want more information, you can read the :ref:`Building Networks<networks-main>`
and :ref:`Interfaces<interfaces-main>` chapters of this manual, but most importantly,
start with reading the next section, :ref:`Bootstrapping Connectivity<bootstrapping-connectivity>`,
as this provides the most essential understanding of how to ensure reliable
connectivity with a minimum of maintenance.
.. _bootstrapping-connectivity: .. _bootstrapping-connectivity:
@@ -216,20 +172,13 @@ As a good starting point, you can find interface definitions for connecting your
Hosting Public Entrypoints Hosting Public Entrypoints
========================== ==========================
If you want to help build a strong global interconnection backbone, you can host a public (or private) entry-point to a Reticulum network over the If you want to help build a strong global interconnection backbone, you can host a public (or private) entry-point to a Reticulum network over the Internet. This section offers some helpful pointers. Once you have set up your public entrypoint, it is a great idea to :ref:`make it discoverable over Reticulum<interfaces-discoverable>`.
Internet. This section offers some helpful pointers. Once you have set up your public entrypoint, it is a great idea to :ref:`make it discoverable over Reticulum<interfaces-discoverable>`.
You will need a machine, physical or virtual with a public IP address, that can be reached by other devices on the Internet. You will need a machine, physical or virtual with a public IP address, that can be reached by other devices on the Internet.
The most efficient and performant way to host a connectable entry-point supporting many The most efficient and performant way to host a connectable entry-point supporting many users is to use the ``BackboneInterface``. This interface type is fully compatible with the ``TCPClientInterface`` and ``TCPServerInterface`` types, but much faster and uses less system resources, allowing your device to handle thousands of connections even on small systems.
users is to use the ``BackboneInterface``. This interface type is fully compatible with
the ``TCPClientInterface`` and ``TCPServerInterface`` types, but much faster and uses
less system resources, allowing your device to handle thousands of connections even on
small systems.
It is also important to set your connectable interface to ``gateway`` mode, since this It is also important to set your connectable interface to ``gateway`` mode, since this will greatly improve network convergence time and path resolution for anyone connecting to your entry-point.
will greatly improve network convergence time and path resolution for anyone connecting
to your entry-point.
.. code:: ini .. code:: ini
@@ -251,8 +200,7 @@ to your entry-point.
announce_rate_penalty = 3600 announce_rate_penalty = 3600
announce_rate_grace = 6 announce_rate_grace = 6
If instead you want to make a private entry-point from the Internet, you can use the If instead you want to make a private entry-point from the Internet, you can use the :ref:`IFAC name and passphrase options<interfaces-options>` to secure your interface with a network name and passphrase.
:ref:`IFAC name and passphrase options<interfaces-options>` to secure your interface with a network name and passphrase.
.. code:: ini .. code:: ini
@@ -268,132 +216,79 @@ If instead you want to make a private entry-point from the Internet, you can use
network_name = private_ret network_name = private_ret
passphrase = 2owjajquafIanPecAc passphrase = 2owjajquafIanPecAc
If you are hosting an entry-point on an operating system that does not support If you are hosting an entry-point on an operating system that does not support ``BackboneInterface``, you can use ``TCPServerInterface`` instead, although it will not be as performant.
``BackboneInterface``, you can use ``TCPServerInterface`` instead, although it will
not be as performant.
Connecting Reticulum Instances Over the Internet Connecting Reticulum Instances Over the Internet
================================================ ================================================
Reticulum currently offers three interfaces suitable for connecting instances over the Internet: :ref:`Backbone<interfaces-backbone>`, :ref:`TCP<interfaces-tcps>` Reticulum currently offers three interfaces suitable for connecting instances over the Internet: :ref:`Backbone<interfaces-backbone>`, :ref:`TCP<interfaces-tcps>` and :ref:`I2P<interfaces-i2p>`. Each interface offers a different set of features, and Reticulum users should carefully choose the interface which best suites their needs.
and :ref:`I2P<interfaces-i2p>`. Each interface offers a different set of features, and Reticulum
users should carefully choose the interface which best suites their needs.
The ``TCPServerInterface`` allows users to host an instance accessible over TCP/IP. This The ``TCPServerInterface`` allows users to host an instance accessible over TCP/IP. This method is generally faster, lower latency, and more energy efficient than using ``I2PInterface``, however it also leaks more data about the server host.
method is generally faster, lower latency, and more energy efficient than using ``I2PInterface``,
however it also leaks more data about the server host.
The ``BackboneInterface`` is a very fast and efficient interface type available on POSIX operating The ``BackboneInterface`` is a very fast and efficient interface type available on POSIX operating systems, designed to handle thousands of connections simultaneously with low memory, processing and I/O overhead. It is fully compatible with the TCP-based interface types.
systems, designed to handle thousands of connections simultaneously with low memory, processing
and I/O overhead. It is fully compatible with the TCP-based interface types.
TCP connections reveal the IP address of both your instance and the server to anyone who can TCP connections reveal the IP address of both your instance and the server to anyone who can inspect the connection. Someone could use this information to determine your location or identity. Adversaries inspecting your packets may be able to record packet metadata like time of transmission and packet size. Even though Reticulum encrypts traffic, TCP does not, so an adversary may be able to use packet inspection to learn that a system is running Reticulum, and what other IP addresses connect to it. Hosting a publicly reachable instance over TCP also requires a publicly reachable IP address, which most Internet connections don't offer anymore.
inspect the connection. Someone could use this information to determine your location or identity. Adversaries
inspecting your packets may be able to record packet metadata like time of transmission and packet size.
Even though Reticulum encrypts traffic, TCP does not, so an adversary may be able to use
packet inspection to learn that a system is running Reticulum, and what other IP addresses connect to it.
Hosting a publicly reachable instance over TCP also requires a publicly reachable IP address,
which most Internet connections don't offer anymore.
The ``I2PInterface`` routes messages through the `Invisible Internet Protocol The ``I2PInterface`` routes messages through the `Invisible Internet Protocol (I2P) <https://geti2p.net/en/>`_. To use this interface, users must also run an I2P daemon in parallel to ``rnsd``. For always-on I2P nodes it is recommended to use `i2pd <https://i2pd.website/>`_.
(I2P) <https://geti2p.net/en/>`_. To use this interface, users must also run an I2P daemon in
parallel to ``rnsd``. For always-on I2P nodes it is recommended to use `i2pd <https://i2pd.website/>`_.
By default, I2P will encrypt and mix all traffic sent over the Internet, and By default, I2P will encrypt and mix all traffic sent over the Internet, and hide both the sender and receiver Reticulum instance IP addresses. Running an I2P node will also relay other I2P user's encrypted packets, which will use extra bandwidth and compute power, but also makes timing attacks and other forms of deep-packet-inspection much more difficult.
hide both the sender and receiver Reticulum instance IP addresses. Running an I2P node
will also relay other I2P user's encrypted packets, which will use extra
bandwidth and compute power, but also makes timing attacks and other forms of
deep-packet-inspection much more difficult.
I2P also allows users to host globally available Reticulum instances from non-public IP's and behind firewalls and NAT. I2P also allows users to host globally available Reticulum instances from non-public IP's and behind firewalls and NAT.
In general it is recommended to use an I2P node if you want to host a publicly accessible In general it is recommended to use an I2P node if you want to host a publicly accessible instance, while preserving anonymity. If you care more about performance, and a slightly easier setup, use TCP.
instance, while preserving anonymity. If you care more about performance, and a slightly
easier setup, use TCP.
Adding Radio Interfaces Adding Radio Interfaces
======================= =======================
Once you have Reticulum installed and working, you can add radio interfaces with Once you have Reticulum installed and working, you can add radio interfaces with any compatible hardware you have available. Reticulum supports a wide range of radio hardware, and if you already have any available, it is very likely that it will work with Reticulum. For information on how to configure this, see the :ref:`Interfaces<interfaces-main>` section of this manual.
any compatible hardware you have available. Reticulum supports a wide range of radio
hardware, and if you already have any available, it is very likely that it will
work with Reticulum. For information on how to configure this, see the
:ref:`Interfaces<interfaces-main>` section of this manual.
If you do not already have transceiver hardware available, you can easily and If you do not already have transceiver hardware available, you can easily and cheaply build an :ref:`RNode<rnode-main>`, which is a general-purpose long-range digital radio transceiver, that integrates easily with Reticulum.
cheaply build an :ref:`RNode<rnode-main>`, which is a general-purpose long-range
digital radio transceiver, that integrates easily with Reticulum.
To build one yourself requires installing a custom firmware on a supported LoRa To build one yourself requires installing a custom firmware on a supported LoRa development board with an auto-install script or web-based flasher. Please see the :ref:`Communications Hardware<hardware-main>` chapter for a guide. If you prefer purchasing a ready-made unit, you can refer to the :ref:`list of suppliers<rnode-suppliers>`.
development board with an auto-install script or web-based flasher.
Please see the :ref:`Communications Hardware<hardware-main>` chapter for a guide.
If you prefer purchasing a ready-made unit, you can refer to the
:ref:`list of suppliers<rnode-suppliers>`.
Other radio-based hardware interfaces are being developed and made available by Other radio-based hardware interfaces are being developed and made available by the broader Reticulum community. You can find more information on such topics over Reticulum-based information sharing systems.
the broader Reticulum community. You can find more information on such topics
over Reticulum-based information sharing systems.
If you have communications hardware that is not already supported by any of the If you have communications hardware that is not already supported by any of the :ref:`existing interface types<interfaces-main>`, it is easy to write (and potentially publish) a :ref:`custom interface module<interfaces-custom>` that makes it compatible with Reticulum.
:ref:`existing interface types<interfaces-main>`, it is easy to write (and potentially
publish) a :ref:`custom interface module<interfaces-custom>` that makes it compatible with Reticulum.
Creating and Using Custom Interfaces Creating and Using Custom Interfaces
==================================== ====================================
While Reticulum includes a flexible and broad range of built-in interfaces, these While Reticulum includes a flexible and broad range of built-in interfaces, these will not cover every conceivable type of communications hardware that Reticulum can potentially use to communicate.
will not cover every conceivable type of communications hardware that Reticulum
can potentially use to communicate.
It is therefore possible to easily write your own interface modules, that can be It is therefore possible to easily write your own interface modules, that can be loaded at run-time and used on-par with any of the built-in interface types.
loaded at run-time and used on-par with any of the built-in interface types.
For more information on this subject, and code examples to build on, please see For more information on this subject, and code examples to build on, please see the :ref:`Configuring Interfaces<interfaces-main>` chapter.
the :ref:`Configuring Interfaces<interfaces-main>` chapter.
Develop a Program with Reticulum Develop a Program with Reticulum
=========================================== ================================
If you want to develop programs that use Reticulum, the easiest way to get If you want to develop programs that use Reticulum, the easiest way to get started is to install the latest release of Reticulum via pip:
started is to install the latest release of Reticulum via pip:
.. code:: .. code::
pip install rns pip install rns
The above command will install Reticulum and dependencies, and you will be The above command will install Reticulum and dependencies, and you will be ready to import and use RNS in your own programs. The next step will most likely be to look at some :ref:`Example Programs<examples-main>`.
ready to import and use RNS in your own programs. The next step will most
likely be to look at some :ref:`Example Programs<examples-main>`.
The entire Reticulum API is documented in the :ref:`API Reference<api-main>` The entire Reticulum API is documented in the :ref:`API Reference<api-main>` chapter of this manual. Before diving in, it's probably a good idea to read this manual in full, but at least start with the :ref:`Understanding Reticulum<understanding-main>` chapter.
chapter of this manual. Before diving in, it's probably a good idea to read
this manual in full, but at least start with the :ref:`Understanding Reticulum<understanding-main>` chapter.
.. _install-guides: .. _install-guides:
Platform-Specific Install Notes Platform-Specific Install Notes
============================================== ===============================
Some platforms require a slightly different installation procedure, or have Some platforms require a slightly different installation procedure, or have various quirks that are worth being aware of. These are listed here.
various quirks that are worth being aware of. These are listed here.
Android Android
^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^
Reticulum can be used on Android in different ways. The easiest way to get Reticulum can be used on Android in different ways. The easiest way to get started is using an app like `Sideband <https://unsigned.io/sideband>`_.
started is using an app like `Sideband <https://unsigned.io/sideband>`_.
For more control and features, you can use Reticulum and related programs via For more control and features, you can use Reticulum and related programs via the `Termux app <https://termux.com/>`_, at the time of writing available on `F-droid <https://f-droid.org>`_.
the `Termux app <https://termux.com/>`_, at the time of writing available on
`F-droid <https://f-droid.org>`_.
Termux is a terminal emulator and Linux environment for Android based devices, Termux is a terminal emulator and Linux environment for Android based devices, which includes the ability to use many different programs and libraries, including Reticulum.
which includes the ability to use many different programs and libraries,
including Reticulum.
To use Reticulum within the Termux environment, you will need to install To use Reticulum within the Termux environment, you will need to install ``python`` and the ``python-cryptography`` library using ``pkg``, the package-manager build into Termux. After that, you can use ``pip`` to install Reticulum.
``python`` and the ``python-cryptography`` library using ``pkg``, the package-manager
build into Termux. After that, you can use ``pip`` to install Reticulum.
From within Termux, execute the following: From within Termux, execute the following:
@@ -412,9 +307,7 @@ From within Termux, execute the following:
# Install Reticulum # Install Reticulum
pip install rns pip install rns
If for some reason the ``python-cryptography`` package is not available for If for some reason the ``python-cryptography`` package is not available for your platform via the Termux package manager, you can attempt to build it locally on your device using the following command:
your platform via the Termux package manager, you can attempt to build it
locally on your device using the following command:
.. code:: shell .. code:: shell
@@ -441,16 +334,12 @@ locally on your device using the following command:
# Reticulum and any related software # Reticulum and any related software
pip install rns pip install rns
It is also possible to include Reticulum in apps compiled and distributed as It is also possible to include Reticulum in apps compiled and distributed as Android APKs. A detailed tutorial and example source code will be included here at a later point. Until then you can use the `Sideband source code <https://github.com/markqvist/sideband>`_ as an example and starting point.
Android APKs. A detailed tutorial and example source code will be included
here at a later point. Until then you can use the `Sideband source code <https://github.com/markqvist/sideband>`_ as an example and starting point.
ARM64 ARM64
^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^
On some architectures, including ARM64, not all dependencies have precompiled On some architectures, including ARM64, not all dependencies have precompiled binaries. On such systems, you may need to install ``python3-dev`` (or similar) before installing Reticulum or programs that depend on Reticulum.
binaries. On such systems, you may need to install ``python3-dev`` (or similar) before
installing Reticulum or programs that depend on Reticulum.
.. code:: shell .. code:: shell
@@ -466,12 +355,8 @@ on your system locally.
Debian Bookworm Debian Bookworm
^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^
On versions of Debian released after April 2023, it is no longer possible by default On versions of Debian released after April 2023, it is no longer possible by default to use ``pip`` to install packages onto your system. Unfortunately, you will need to use the replacement ``pipx`` command instead, which places installed packages in an isolated environment. This should not negatively affect Reticulum, but will not work for including and using Reticulum in your own scripts and programs.
to use ``pip`` to install packages onto your system. Unfortunately, you will need to
use the replacement ``pipx`` command instead, which places installed packages in an
isolated environment. This should not negatively affect Reticulum, but will not work
for including and using Reticulum in your own scripts and programs.
.. code:: shell .. code:: shell
@@ -484,42 +369,30 @@ for including and using Reticulum in your own scripts and programs.
# Install Reticulum # Install Reticulum
pipx install rns pipx install rns
Alternatively, you can restore normal behaviour to ``pip`` by creating or editing Alternatively, you can restore normal behaviour to ``pip`` by creating or editing the configuration file located at ``~/.config/pip/pip.conf``, and adding the following section:
the configuration file located at ``~/.config/pip/pip.conf``, and adding the
following section:
.. code:: ini .. code:: ini
[global] [global]
break-system-packages = true break-system-packages = true
For a one-shot installation of Reticulum, without globally enabling the ``break-system-packages`` For a one-shot installation of Reticulum, without globally enabling the ``break-system-packages`` option, you can use the following command:
option, you can use the following command:
.. code:: shell .. code:: shell
pip install rns --break-system-packages pip install rns --break-system-packages
.. note:: .. note::
The ``--break-system-packages`` directive is a somewhat misleading choice The ``--break-system-packages`` directive is a somewhat misleading choice of words. Setting it will of course not break any system packages, but will simply allow installing ``pip`` packages user- and system-wide. While this *could* in rare cases lead to version conflicts, it does not generally pose any problems, especially not in the case of installing Reticulum.
of words. Setting it will of course not break any system packages, but will simply
allow installing ``pip`` packages user- and system-wide. While this *could* in rare
cases lead to version conflicts, it does not generally pose any problems, especially
not in the case of installing Reticulum.
MacOS MacOS
^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^
To install Reticulum on macOS, you will need to have Python and the ``pip`` package To install Reticulum on macOS, you will need to have Python and the ``pip`` package manager installed.
manager installed.
Systems running macOS can vary quite widely in whether or not Python is pre-installed, Systems running macOS can vary quite widely in whether or not Python is pre-installed, and if it is, which version is installed, and whether the ``pip`` package manager is also installed and set up. If in doubt, you can `download and install <https://www.python.org/downloads/>`_ Python manually.
and if it is, which version is installed, and whether the ``pip`` package manager is
also installed and set up. If in doubt, you can `download and install <https://www.python.org/downloads/>`_
Python manually.
When Python and ``pip`` is available on your system, simply open a terminal window When Python and ``pip`` is available on your system, simply open a terminal window and use one of the following commands:
and use one of the following commands:
.. code:: shell .. code:: shell
@@ -531,16 +404,9 @@ and use one of the following commands:
pip3 install rns --break-system-packages pip3 install rns --break-system-packages
.. note:: .. note::
The ``--break-system-packages`` directive is a somewhat misleading choice The ``--break-system-packages`` directive is a somewhat misleading choice of words. Setting it will of course not break any system packages, but will simply allow installing ``pip`` packages user- and system-wide. While this *could* in rare cases lead to version conflicts, it does not generally pose any problems, especially not in the case of installing Reticulum.
of words. Setting it will of course not break any system packages, but will simply
allow installing ``pip`` packages user- and system-wide. While this *could* in rare
cases lead to version conflicts, it does not generally pose any problems, especially
not in the case of installing Reticulum.
Additionally, some version combinations of macOS and Python require you to Additionally, some version combinations of macOS and Python require you to manually add your installed ``pip`` packages directory to your `PATH` environment variable, before you can use installed commands in your terminal. Usually, adding the following line to your shell init script (for example ``~/.zshrc``) will be enough:
manually add your installed ``pip`` packages directory to your `PATH` environment
variable, before you can use installed commands in your terminal. Usually, adding
the following line to your shell init script (for example ``~/.zshrc``) will be enough:
.. code:: shell .. code:: shell
@@ -550,20 +416,13 @@ Adjust Python version and shell init script location according to your system.
OpenWRT OpenWRT
^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^
On OpenWRT systems with sufficient storage and memory, you can install On OpenWRT systems with sufficient storage and memory, you can install Reticulum and related utilities using the `opkg` package manager and `pip`.
Reticulum and related utilities using the `opkg` package manager and `pip`.
.. note:: .. note::
At the time of releasing this manual, work is underway to create pre-built Reticulum packages for OpenWRT, with full configuration, service and ``uci`` integration. Please see the `feed-reticulum <https://github.com/gretel/feed-reticulum>`_ and `reticulum-openwrt <https://github.com/gretel/reticulum-openwrt>`_ repositories for more information.
At the time of releasing this manual, work is underway to create pre-built To install Reticulum on OpenWRT, first log into a command line session, and then use the following instructions:
Reticulum packages for OpenWRT, with full configuration, service
and ``uci`` integration. Please see the `feed-reticulum <https://github.com/gretel/feed-reticulum>`_
and `reticulum-openwrt <https://github.com/gretel/reticulum-openwrt>`_
repositories for more information.
To install Reticulum on OpenWRT, first log into a command line session, and
then use the following instructions:
.. code:: shell .. code:: shell
@@ -577,30 +436,15 @@ then use the following instructions:
rnsd -vvv rnsd -vvv
.. note:: .. note::
The above instructions have been verified and tested on OpenWRT 21.02 only. It is likely that other versions may require slightly altered installation commands or package names. You will also need enough free space in your overlay FS, and enough free RAM to actually run Reticulum and any related programs and utilities.
The above instructions have been verified and tested on OpenWRT 21.02 only.
It is likely that other versions may require slightly altered installation
commands or package names. You will also need enough free space in your
overlay FS, and enough free RAM to actually run Reticulum and any related
programs and utilities.
Depending on your device configuration, you may need to adjust firewall rules Depending on your device configuration, you may need to adjust firewall rules for Reticulum connectivity to and from your device to work. Until proper packaging is ready, you will also need to manually create a service or startup script to automatically laucnh Reticulum at boot time.
for Reticulum connectivity to and from your device to work. Until proper
packaging is ready, you will also need to manually create a service or startup
script to automatically laucnh Reticulum at boot time.
Please also note that the `AutoInterface` requires link-local IPv6 addresses Please also note that the `AutoInterface` requires link-local IPv6 addresses to be enabled for any Ethernet and WiFi devices you intend to use. If ``ip a`` shows an address starting with ``fe80::`` for the device in question, ``AutoInterface`` should work for that device.
to be enabled for any Ethernet and WiFi devices you intend to use. If ``ip a``
shows an address starting with ``fe80::`` for the device in question,
``AutoInterface`` should work for that device.
Raspberry Pi Raspberry Pi
^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^
It is currently recommended to use a 64-bit version of the Raspberry Pi OS It is currently recommended to use a 64-bit version of the Raspberry Pi OS if you want to run Reticulum on Raspberry Pi computers, since 32-bit versions don't always have packages available for some dependencies. If Python and the `pip` package manager is not already installed, do that first, and then install Reticulum using `pip`.
if you want to run Reticulum on Raspberry Pi computers, since 32-bit versions
don't always have packages available for some dependencies. If Python and the
`pip` package manager is not already installed, do that first, and then
install Reticulum using `pip`.
.. code:: shell .. code:: shell
@@ -611,22 +455,14 @@ install Reticulum using `pip`.
pip install rns --break-system-packages pip install rns --break-system-packages
.. note:: .. note::
The ``--break-system-packages`` directive is a somewhat misleading choice The ``--break-system-packages`` directive is a somewhat misleading choice of words. Setting it will of course not break any system packages, but will simply allow installing ``pip`` packages user- and system-wide. While this *could* in rare cases lead to version conflicts, it does not generally pose any problems, especially not in the case of installing Reticulum.
of words. Setting it will of course not break any system packages, but will simply
allow installing ``pip`` packages user- and system-wide. While this *could* in rare
cases lead to version conflicts, it does not generally pose any problems, especially
not in the case of installing Reticulum.
While it is possible to install and run Reticulum on 32-bit Rasperry Pi OSes, While it is possible to install and run Reticulum on 32-bit Rasperry Pi OSes, it will require manually configuring and installing required build dependencies, and is not detailed in this manual.
it will require manually configuring and installing required build dependencies,
and is not detailed in this manual.
RISC-V RISC-V
^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^
On some architectures, including RISC-V, not all dependencies have precompiled On some architectures, including RISC-V, not all dependencies have precompiled binaries. On such systems, you may need to install ``python3-dev`` (or similar) before installing Reticulum or programs that depend on Reticulum.
binaries. On such systems, you may need to install ``python3-dev`` (or similar) before
installing Reticulum or programs that depend on Reticulum.
.. code:: shell .. code:: shell
@@ -637,17 +473,12 @@ installing Reticulum or programs that depend on Reticulum.
# Install Reticulum # Install Reticulum
python3 -m pip install rns python3 -m pip install rns
With these packages installed, ``pip`` will be able to build any missing dependencies With these packages installed, ``pip`` will be able to build any missing dependencies on your system locally.
on your system locally.
Ubuntu Lunar Ubuntu Lunar
^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^
On versions of Ubuntu released after April 2023, it is no longer possible by default On versions of Ubuntu released after April 2023, it is no longer possible by default to use ``pip`` to install packages onto your system. Unfortunately, you will need to use the replacement ``pipx`` command instead, which places installed packages in an isolated environment. This should not negatively affect Reticulum, but will not work for including and using Reticulum in your own scripts and programs.
to use ``pip`` to install packages onto your system. Unfortunately, you will need to
use the replacement ``pipx`` command instead, which places installed packages in an
isolated environment. This should not negatively affect Reticulum, but will not work
for including and using Reticulum in your own scripts and programs.
.. code:: shell .. code:: shell
@@ -660,42 +491,29 @@ for including and using Reticulum in your own scripts and programs.
# Install Reticulum # Install Reticulum
pipx install rns pipx install rns
Alternatively, you can restore normal behaviour to ``pip`` by creating or editing Alternatively, you can restore normal behaviour to ``pip`` by creating or editing the configuration file located at ``~/.config/pip/pip.conf``, and adding the following section:
the configuration file located at ``~/.config/pip/pip.conf``, and adding the
following section:
.. code:: text .. code:: text
[global] [global]
break-system-packages = true break-system-packages = true
For a one-shot installation of Reticulum, without globally enabling the ``break-system-packages`` For a one-shot installation of Reticulum, without globally enabling the ``break-system-packages`` option, you can use the following command:
option, you can use the following command:
.. code:: text .. code:: text
pip install rns --break-system-packages pip install rns --break-system-packages
.. note:: .. note::
The ``--break-system-packages`` directive is a somewhat misleading choice The ``--break-system-packages`` directive is a somewhat misleading choice of words. Setting it will of course not break any system packages, but will simply allow installing ``pip`` packages user- and system-wide. While this *could* in rare cases lead to version conflicts, it does not generally pose any problems, especially not in the case of installing Reticulum.
of words. Setting it will of course not break any system packages, but will simply
allow installing ``pip`` packages user- and system-wide. While this *could* in rare
cases lead to version conflicts, it does not generally pose any problems, especially
not in the case of installing Reticulum.
Windows Windows
^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^
On Windows operating systems, the easiest way to install Reticulum is by using the On Windows operating systems, the easiest way to install Reticulum is by using the ``pip`` package manager from the command line (either the command prompt or Windows Powershell).
``pip`` package manager from the command line (either the command prompt or Windows
Powershell).
If you don't already have Python installed, `download and install Python <https://www.python.org/downloads/>`_. If you don't already have Python installed, `download and install Python <https://www.python.org/downloads/>`_. At the time of publication of this manual, the recommended version is `Python 3.12.7 <https://www.python.org/downloads/release/python-3127>`_.
At the time of publication of this manual, the recommended version is `Python 3.12.7 <https://www.python.org/downloads/release/python-3127>`_.
**Important!** When asked by the installer, make sure to add the Python program to **Important!** When asked by the installer, make sure to add the Python program to your PATH environment variables. If you don't do this, you will not be able to use the ``pip`` installer, or run the included Reticulum utility programs (such as ``rnsd`` and ``rnstatus``) from the command line.
your PATH environment variables. If you don't do this, you will not be able to
use the ``pip`` installer, or run the included Reticulum utility programs (such as
``rnsd`` and ``rnstatus``) from the command line.
After installing Python, open the command prompt or Windows Powershell, and type: After installing Python, open the command prompt or Windows Powershell, and type:
@@ -703,11 +521,10 @@ After installing Python, open the command prompt or Windows Powershell, and type
pip install rns pip install rns
You can now use Reticulum and all included utility programs directly from your You can now use Reticulum and all included utility programs directly from your preferred command line interface.
preferred command line interface.
Pure-Python Reticulum Pure-Python Reticulum
============================================== =====================
.. warning:: .. warning::
If you use the ``rnspure`` package to run Reticulum on systems that If you use the ``rnspure`` package to run Reticulum on systems that
@@ -715,17 +532,6 @@ Pure-Python Reticulum
important that you read and understand the :ref:`Cryptographic Primitives <understanding-primitives>` important that you read and understand the :ref:`Cryptographic Primitives <understanding-primitives>`
section of this manual. section of this manual.
In some rare cases, and on more obscure system types, it is not possible to In some rare cases, and on more obscure system types, it is not possible to install one or more dependencies. In such situations, you can use the ``rnspure`` package instead of the ``rns`` package, or use ``pip`` with the ``--no-dependencies`` command-line option. The ``rnspure`` package requires no external dependencies for installation. Please note that the actual contents of the ``rns`` and ``rnspure`` packages are *completely identical*. The only difference is that the ``rnspure`` package lists no dependencies required for installation.
install one or more dependencies. In such situations,
you can use the ``rnspure`` package instead of the ``rns`` package, or use ``pip``
with the ``--no-dependencies`` command-line option. The ``rnspure``
package requires no external dependencies for installation. Please note that the
actual contents of the ``rns`` and ``rnspure`` packages are *completely identical*.
The only difference is that the ``rnspure`` package lists no dependencies required
for installation.
No matter how Reticulum is installed and started, it will load external dependencies No matter how Reticulum is installed and started, it will load external dependencies only if they are *needed* and *available*. If for example you want to use Reticulum on a system that cannot support ``pyserial``, it is perfectly possible to do so using the `rnspure` package, but Reticulum will not be able to use serial-based interfaces. All other available modules will still be loaded when needed.
only if they are *needed* and *available*. If for example you want to use Reticulum
on a system that cannot support ``pyserial``, it is perfectly possible to do so using
the `rnspure` package, but Reticulum will not be able to use serial-based interfaces.
All other available modules will still be loaded when needed.
+150 -14
View File
@@ -853,10 +853,28 @@ Or to retrieve all source archives:
If your pattern contains no wildcard characters, it must match an artifact name exactly, which is useful for fetching single, specific artifacts. When a pattern matches multiple artifacts, all matched files are fetched and verified. If no artifacts match the pattern, the fetch aborts with an error indicating no matches were found. If your pattern contains no wildcard characters, it must match an artifact name exactly, which is useful for fetching single, specific artifacts. When a pattern matches multiple artifacts, all matched files are fetched and verified. If no artifacts match the pattern, the fetch aborts with an error indicating no matches were found.
**Offline Verification** Offline Verification
--------------------
Because the release manifest contains embedded signatures, you can verify the integrity of release artifacts offline, without connecting to the repository node. The ``rnid`` and ``rngit`` utilities can validate artifact signatures against ``.rsg`` and manifest files. Because the release manifest contains embedded signatures, you can verify the integrity of release artifacts offline, without connecting to the repository node. The ``rnid`` and ``rngit`` utilities can validate artifact signatures against ``.rsg`` and manifest files.
**Using a release manifest:**
Ensure the release manifest is located in the same directory as the release artifacts, then run:
.. code:: text
# Verify all artifacts in the manifest
$ rngit release myapp-1.2.0.rsm verify
# Or, verify only specific artifacts
$ rngit release myapp-1.2.0.rsm verify "latest:*.whl"
This will load the manifest, and verify all files currently on-disk, but will not attempt to fetch the latest release manifest from the origin, or update local files to match it.
.. note::
The ``verify`` operation is functionally equivalent to using the ``fetch`` operation with the ``--offline`` flag, and they can be used interchangably.
**For individual files:** **For individual files:**
Ensure the ``.rsg`` signature is located in the same directory as the release artifact, then run: Ensure the ``.rsg`` signature is located in the same directory as the release artifact, then run:
@@ -867,16 +885,6 @@ Ensure the ``.rsg`` signature is located in the same directory as the release ar
This validates that the artifact file matches the signature created during the release process. Combined with the manifest's own signature, this provides end-to-end verification from the original release creation to the final installation. This validates that the artifact file matches the signature created during the release process. Combined with the manifest's own signature, this provides end-to-end verification from the original release creation to the final installation.
**For a complete release:**
Ensure the release manifest is located in the same directory as the release artifacts, then run:
.. code:: text
$ rngit release myapp-1.2.0.rsm fetch --offline
This will load the manifest, and verify all files currently on-disk, but will not attempt to fetch the latest release manifest from the origin, or update local files to match it.
.. _git-release-create: .. _git-release-create:
Creating Signed Releases Creating Signed Releases
@@ -886,7 +894,7 @@ Reticulum and the ``rngit`` system makes it easy to create signed releases that
1. Generates an Ed25519 signature for each artifact file using your identity's signing key 1. Generates an Ed25519 signature for each artifact file using your identity's signing key
2. Creates ``.rsg`` signature files alongside each artifact in your distribution directory 2. Creates ``.rsg`` signature files alongside each artifact in your distribution directory
3. Constructs a signed release manifest (``manifest.rsm``) containing metadata, an artifact list, and embedded signatures 3. Constructs a signed ``manifest.rsm`` release manifest containing metadata, an artifact list, and embedded signatures
4. Transmits both artifacts, signatures and manifest to the remote node specified as release origin 4. Transmits both artifacts, signatures and manifest to the remote node specified as release origin
As an example, to create and publish a release from all files in the folder named ``dist``, simply run: As an example, to create and publish a release from all files in the folder named ``dist``, simply run:
@@ -1318,7 +1326,7 @@ Each document is a numbered directory containing:
**Nomad Network Interface** **Nomad Network Interface**
When the Nomad Network page node is enabled, work documents are viewable through the web interface. The work page lists all documents with their status, and clicking a document shows its full content and updates. When the Nomad Network page node is enabled, work documents are viewable through the nomadnet interface. The work page lists all documents with their status, and clicking a document shows its full content and updates.
Cryptographic Attribution Cryptographic Attribution
------------------------- -------------------------
@@ -1373,4 +1381,132 @@ This cryptographic provenance is particularly valuable for distributed teams ope
-d, --id ID document ID -d, --id ID document ID
-v, --verbose -v, --verbose
-q, --quiet -q, --quiet
--version show program's version number and exit --version show program's version number and exit
.. _git-commit-signing:
Commit Signing
==============
The ``rngit`` system includes ``rngcs``, a Git commit signing and validation shim that enables commit signing and validation using Reticulum identities. By hooking into Git's SSH-based signing format, commits can be signed and verified using Reticulum identity keys directly.
Unlike traditional GPG and SSH-based commit signing, which relies on centralized keyservers, cumbersome co-signing procedures or manual per-signer setup, Reticulum commit signing uses self-contained RSG signatures, that can be deterministically resolved to Reticulum identity hashes.
This enables offline verification with no external infrastructure. The signature itself contains everything needed to cryptographically verify the signer's Reticulum identity and that the commit was signed correctly by the claimed identity.
Prerequisites
-------------
Before you can sign commits, you need a Reticulum identity with a private key. If you don't already have one, you can generate it using ``rnid``:
.. code:: text
$ rnid -g ~/.rngit/client_identity
New identity <1a54d64db7e8beca6f2c6cd17b0cb479> written to /home/user/.rngit/client_identity
The identity file must contain the private key to be usable for signing. The corresponding Reticulum identity hash will be used as the commit author identity.
Configuration
-------------
Git must be configured to use SSH-format signatures with the ``rngcs`` signing shim, which is included in RNS. You can configure this either globally or per-repository.
**Global Configuration**
Enabling Reticulum commit signing for all repositories is as simple as:
.. code:: text
$ git config --global gpg.format ssh
$ git config --global gpg.ssh.program rngcs
$ git config --global gpg.ssh.allowedsignersfile none
$ git config --global user.signingKey ~/.rngit/client_identity
With this configuration, all commits you sign with ``git commit -S`` will use your Reticulum identity.
.. note::
The ``gpg.ssh.allowedsignersfile`` configuration key **must** be *set* for ``git`` to allow invoking the signing and verification shim. It is not actually used by ``rngcs``, and can be set to an arbitrary value. All validation operations happen exclusively based on the information in the embedded RSG data.
**Per-Repository Configuration**
To enable signing only for a specific repository:
.. code:: text
$ cd /path/to/repository
$ git config --local gpg.format ssh
$ git config --local gpg.ssh.program rngcs
$ git config --local gpg.ssh.allowedsignersfile none
$ git config --local user.signingKey ~/.rngit/client_identity
This is useful when you want to use different identities for different projects, or when only specific repositories require signed commits.
Author Identity Binding
-----------------------
For the signature to be valid, the Git author email **must** match the Reticulum identity hash of the signing key. You can configure this using a command like the following:
.. code:: text
$ git config --global user.email "1a54d64db7e8beca6f2c6cd17b0cb479"
When ``rngcs`` verifies a commit, it extracts both the Git author field of the signed commit message and the signer identity from the RSG signature, ensuring they match. This binding is necessary to prevent identity spoofing. If someone crafts a commit with your identity hash in the author field but signs with a different key, verification will fail.
Signing Commits
---------------
Once configured, sign commits using the standard Git ``-S`` flag:
.. code:: text
$ git commit -S -m "Refactored module"
[master 8f7e6d5] Refactored module
This will create a self-contained RSG-formatted signature, encode the RSG payload using base64, and wrap it in an ASCII-armored SSH-formatted signature block. The signature is then stored in the commit object's signature header and includes:
- The SHA256 hash of the commit content
- The signer's Reticulum identity hash
- The signer's public key
- The actual signature of the complete envelope
Validating Commit Signatures
----------------------------
Commits are automatically validated when using ``git log --show-signature`` or ``git show --show-signature``. The ``rngcs`` shim handles all verification operations. If any step fails, verification fails and Git displays an error.
To view signature information for commits, use Git's standard ``--show-signature`` option:
.. code:: text
$ git log --show-signature
commit 8f7e6d5c8f7e6d5c8f7e6d5c8f7e6d5c8f7e6d5
Good "git" signature for commit, signed with Reticulum Identity key <1a54d64db7e8beca6f2c6cd17b0cb479>
Author: Developer <1a54d64db7e8beca6f2c6cd17b0cb479>
Date: Mon Jan 15 09:30:00 2026 +0100
Refactored module
The output shows whether the commit signature is valid, and whether the author field matches the signing identity.
.. tip::
If you want to display both the identity hash and LXMF address for authors, you can generate a ``.mailmap`` file that resolves identities to LXMF addresses with the following script:
.. code::
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd $DIR
id_regex="<([0-9a-f]{32})( .*)*>"
extract_id="s/.*$id_regex/\1/g"
rm -f .mailmap
git shortlog -se | grep -Ee "$id_regex" | sed -r "$extract_id" | while read -r id ; do
if lxmf=$(rnid -i $id -H lxmf.delivery | grep -Ee "destination for this Identity is" | sed -r "$extract_id"); then
echo "<$id lxmf:$lxmf> <$id>" >> .mailmap
fi
done
+77 -1
View File
@@ -230,6 +230,51 @@ specify the target Yggdrasil IPv6 address and port, like so:
target_host = 201:5d78:af73:5caf:a4de:a79f:3278:71e5 target_host = 201:5d78:af73:5caf:a4de:a79f:3278:71e5
target_port = 4343 target_port = 4343
Automated Blocking
------------------
Listener instances of ``BackboneInterface`` will automatically block fast-flapping clients,
that repeatedly connect for a short amount of time, and then disconnect. Such behavior usually
occurs from clients trying to spam the network with announces or path requests, by connecting, dumping
a massive amount of requests, and then disconnecting in an attempt to bypass rate limits.
While such bypass attempts only have very limited effect on the amount of spam actually dumped (ingress limits
trigger immediately once a client exceeds rate limits), the behavior is often seen anyways, and
causes log noise and needless interface rotation. The fast-flapping block ensures such clients
are never allocated an interface on the transport instance.
Another common cause can simply be clients using implementations that are broken, or automated
scanning tools attempting to connect to the instance.
.. code:: ini
[[Backbone Listener]]
type = BackboneInterface
enabled = yes
listen_on = 0.0.0.0
port = 4242
# Whether to enable blocking
block_fast_flapping = yes
# How long an IP address stays
# blocked, in minutes. Set to
# 12 hours by default.
fast_flapping_block_time = 720
# The minimum time, in seconds,
# an interface must stay connected
# to be considered not fast-flapping.
fast_flapping_threshold = 20
# Amount of fast flaps a remote
# IP can perform before having
# blocking triggered.
fast_flapping_grace = 5
The configuration options listed in the example above are the *default values*, and you do
not need to add them for automated blocking to work, but you can use them to change the
behavior from the defaults, if necessary.
.. _interfaces-tcps: .. _interfaces-tcps:
TCP Server Interface TCP Server Interface
@@ -998,7 +1043,13 @@ On a real system, you should make the script robust enough to deal with intermit
**Physical Location** **Physical Location**
``latitude``, ``longitude``, ``height`` ``latitude``, ``longitude``, ``height``
Optional physical coordinates for the interface. These are useful for mapping discovered interfaces geographically or for clients to automatically select the nearest access point. Coordinates should be in decimal degrees, height in meters. Optional physical coordinates for the interface. These are useful for mapping discovered interfaces geographically or for clients to automatically select the nearest access point. Coordinates should be in decimal degrees, height in meters above mean sea level.
``location_cmd``
Optional path to executable or script that returns the physical coordinates for the interface. This can be used instead of manually setting ``latitude``, ``longitude`` and ``height``. Reticulum expects the script to output the location data to ``stdout`` on a single line, separated by commas, with values as floating point numbers in the format ``LAT, LON, HEIGHT``. Coordinates should be in decimal degrees, height in meters above mean sea level.
.. note::
The height value for interface discovery is specified in *height above mean sea level*! This is the geoid-corrected height value, and is distinct from GPS altitude. If you manually specify height, it will typically be set to what you find on a topographical map. If you are using a script to output the location data, make sure that you are using the geoid-corrected altitude, not height above the GPS ellipsoid. Most GPS systems will make both figures available.
**Radio Parameters** **Radio Parameters**
@@ -1207,6 +1258,22 @@ These can be used to control various aspects of interface behaviour.
link or a remote TCP tunnel) solely to discover better local link or a remote TCP tunnel) solely to discover better local
infrastructure, which then supersedes the bootstrap interface. infrastructure, which then supersedes the bootstrap interface.
* | The ``recursive_prs`` option allows you to enable recursive path
discovery on an interface regardless of its configured interface
mode. When this option is enabled, Reticulum will attempt to
recursively discover paths for path requests received on this
interface.
* | The ``announces_from_internal`` option controls whether any
announces *received on* an ``internal`` mode interface will
propagate *out* on the interface this option is set on. Note
that this controls *announce propagation*; even if announces
do not propagate out when received, paths to destinations on
``internal`` mode interfaces may still be resolvable by means
of path requests.
.. _interfaces-modes: .. _interfaces-modes:
Interface Modes Interface Modes
@@ -1284,6 +1351,15 @@ the default mode.
public Transport Node available on the Internet, the interface public Transport Node available on the Internet, the interface
connecting over the Internet should be set to ``boundary`` mode. connecting over the Internet should be set to ``boundary`` mode.
* | The ``internal`` mode designates interfaces that belong to a
network different from any marked as ``boundary``. Announces from
a ``boundary`` interface will not propagate to interfaces set as
``internal``, but announces *will* propagate from ``internal`` *to*
``boundary``. Devices on the ``internal`` side of the network will
still be able to resolve paths to destinations across the boundary
when needed, since recursive path requests are enabled for ``internal``
mode interfaces by default.
For a table describing the impact of all modes on announce propagation, For a table describing the impact of all modes on announce propagation,
please see the :ref:`Announce Propagation Rules<understanding-announcepropagation>` section. please see the :ref:`Announce Propagation Rules<understanding-announcepropagation>` section.
+119 -319
View File
@@ -3,64 +3,35 @@
*********************** ***********************
Understanding Reticulum Understanding Reticulum
*********************** ***********************
This chapter will briefly describe the overall purpose and operating principles of Reticulum. This chapter will briefly describe the overall purpose and operating principles of Reticulum. It should give you an overview of how the stack works, and an understanding of how to develop networked applications using Reticulum.
It should give you an overview of how the stack works, and an understanding of how to
develop networked applications using Reticulum.
This chapter is not an exhaustive source of information on Reticulum, at least not yet. Currently, This chapter is not an exhaustive source of information on Reticulum, at least not yet. Currently, the only complete repository, and final authority on how Reticulum actually functions, is the Python reference implementation and API reference. That being said, this chapter is an essential resource in understanding how Reticulum works from a high-level perspective, along with the general principles of Reticulum, and how to apply them when creating your own networks or software.
the only complete repository, and final authority on how Reticulum actually functions, is the Python
reference implementation and API reference. That being said, this chapter is an essential resource in
understanding how Reticulum works from a high-level perspective, along with the general principles of
Reticulum, and how to apply them when creating your own networks or software.
After reading this chapter, you should be well-equipped to understand how a Reticulum network After reading this chapter, you should be well-equipped to understand how a Reticulum network operates, what it can achieve, and how you can use it yourself. This chapter also seeks to provide an overview of the sentiments and the philosophy behind Reticulum, what problems it seeks to solve, and how it approaches those solutions.
operates, what it can achieve, and how you can use it yourself. This chapter also seeks to provide an overview of the
sentiments and the philosophy behind Reticulum, what problems it seeks to solve, and how it
approaches those solutions.
.. _understanding-motivation: .. _understanding-motivation:
Motivation Motivation
========== ==========
The primary motivation for designing and implementing Reticulum has been the current lack of The primary motivation for designing and implementing Reticulum has been the current lack of reliable, functional and secure minimal-infrastructure modes of digital communication. It is my belief that it is highly desirable to create a reliable and efficient way to set up long-range digital communication networks that can securely allow exchange of information between people and machines, with no central point of authority, control, censorship or barrier to entry.
reliable, functional and secure minimal-infrastructure modes of digital communication. It is my
belief that it is highly desirable to create a reliable and efficient way to set up long-range digital
communication networks that can securely allow exchange of information between people and
machines, with no central point of authority, control, censorship or barrier to entry.
Almost all of the various networking systems in use today share a common limitation: They Almost all of the various networking systems in use today share a common limitation: They require large amounts of coordination and centralised trust and power to function. To join such networks, you need approval of gatekeepers in control. This need for coordination and trust inevitably leads to an environment of central control, where it's very easy for infrastructure operators or governments to control or alter traffic, and censor or persecute unwanted actors. It also makes it completely impossible to freely deploy and use networks at will, like one would use other common tools that enhance individual agency and freedom.
require large amounts of coordination and centralised trust and power to function. To join such networks, you need approval
of gatekeepers in control. This need for coordination and trust inevitably leads to an environment of
central control, where it's very easy for infrastructure operators or governments to control or alter
traffic, and censor or persecute unwanted actors. It also makes it completely impossible to freely deploy
and use networks at will, like one would use other common tools that enhance individual agency and freedom.
Reticulum aims to require as little coordination and trust as possible. It aims to make secure, Reticulum aims to require as little coordination and trust as possible. It aims to make secure, anonymous and permissionless networking and information exchange a tool that anyone can just pick up and use.
anonymous and permissionless networking and information exchange a tool that anyone can just pick up and use.
Since Reticulum is completely medium agnostic, it can be used to build networks on whatever is best Since Reticulum is completely medium agnostic, it can be used to build networks on whatever is best suited to the situation, or whatever you have available. In some cases, this might be packet radio links over VHF frequencies, in other cases it might be a 2.4 GHz network using off-the-shelf radios, or it might be using common LoRa development boards.
suited to the situation, or whatever you have available. In some cases, this might be packet radio
links over VHF frequencies, in other cases it might be a 2.4 GHz
network using off-the-shelf radios, or it might be using common LoRa development boards.
At the time of release of this document, the fastest and easiest setup for development and testing is using At the time of release of this document, the fastest and easiest setup for development and testing is using LoRa radio modules with an open source firmware (see the section :ref:`Reference Setup<understanding-referencesystem>`), connected to any kind of computer or mobile device that Reticulum can run on.
LoRa radio modules with an open source firmware (see the section :ref:`Reference Setup<understanding-referencesystem>`),
connected to any kind of computer or mobile device that Reticulum can run on.
The ultimate aim of Reticulum is to allow anyone to be their own network operator, and to make it The ultimate aim of Reticulum is to allow anyone to be their own network operator, and to make it cheap and easy to cover vast areas with a myriad of independent, interconnectable and autonomous networks. Reticulum **is not** *one network*, it **is a tool** to build *thousands of networks*. Networks without kill-switches, surveillance, censorship and control. Networks that can freely interoperate, associate and disassociate with each other, and require no central oversight. Networks for human beings. *Networks for the people*.
cheap and easy to cover vast areas with a myriad of independent, interconnectable and autonomous networks.
Reticulum **is not** *one network*, it **is a tool** to build *thousands of networks*. Networks without
kill-switches, surveillance, censorship and control. Networks that can freely interoperate, associate and disassociate
with each other, and require no central oversight. Networks for human beings. *Networks for the people*.
.. _understanding-goals: .. _understanding-goals:
Goals Goals
===== =====
To be as widely usable and efficient to deploy as possible, the following goals have been used to To be as widely usable and efficient to deploy as possible, the following goals have been used to guide the design of Reticulum:
guide the design of Reticulum:
* **Fully useable as open source software stack** * **Fully useable as open source software stack**
@@ -83,18 +54,18 @@ guide the design of Reticulum:
* **Unlicensed use** * **Unlicensed use**
Reticulum shall be functional over physical communication mediums that do not require any Reticulum shall be functional over physical communication mediums that do not require any
form of license to use. Reticulum must be designed in a way, so it is usable over ISM radio form of license to use. Reticulum must be designed in a way, so it is usable over ISM radio
frequency bands, and can provide functional long distance links in such conditions, for example frequency bands, and can provide functional long distance links in such conditions, for
by connecting a modem to a PMR or CB radio, or by using LoRa or WiFi modules. example by connecting a modem to a PMR or CB radio, or by using LoRa or WiFi modules.
* **Supplied software** * **Supplied software**
In addition to the core networking stack and API, that allows a developer to build In addition to the core networking stack and API, that allows a developer to build
applications with Reticulum, a basic set of Reticulum-based communication tools must be applications with Reticulum, a basic set of Reticulum-based communication tools must be
implemented and released along with Reticulum itself. These shall serve both as a implemented and released along with Reticulum itself. These shall serve both as a
functional, basic communication suite, and as an example and learning resource to others wishing functional, basic communication suite, and as an example and learning resource to others
to build applications with Reticulum. wishing to build applications with Reticulum.
* **Ease of use** * **Ease of use**
The reference implementation of Reticulum is written in Python, to make it easy to use The reference implementation of Reticulum is written in Python, to make it easy to use and
and understand. A programmer with only basic experience should be able to use understand. A programmer with only basic experience should be able to use Reticulum to write
Reticulum to write networked applications. networked applications.
* **Low cost** * **Low cost**
It shall be as cheap as possible to deploy a communication system based on Reticulum. This It shall be as cheap as possible to deploy a communication system based on Reticulum. This
should be achieved by using cheap off-the-shelf hardware that potential users might already should be achieved by using cheap off-the-shelf hardware that potential users might already
@@ -106,53 +77,26 @@ guide the design of Reticulum:
Introduction & Basic Functionality Introduction & Basic Functionality
================================== ==================================
Reticulum is a networking stack suited for high-latency, low-bandwidth links. Reticulum is at its Reticulum is a networking stack suited for high-latency, low-bandwidth links. Reticulum is at its core a *message oriented* system. It is suited for both local point-to-point or point-to-multipoint scenarios where all nodes are within range of each other, as well as scenarios where packets need to be transported over multiple hops in a complex network to reach the recipient.
core a *message oriented* system. It is suited for both local point-to-point or point-to-multipoint
scenarios where all nodes are within range of each other, as well as scenarios where packets need
to be transported over multiple hops in a complex network to reach the recipient.
Reticulum does away with the idea of addresses and ports known from IP, TCP and UDP. Instead Reticulum does away with the idea of addresses and ports known from IP, TCP and UDP. Instead Reticulum uses the singular concept of *destinations*. Any application using Reticulum as its networking stack will need to create one or more destinations to receive data, and know the destinations it needs to send data to.
Reticulum uses the singular concept of *destinations*. Any application using Reticulum as its
networking stack will need to create one or more destinations to receive data, and know the
destinations it needs to send data to.
All destinations in Reticulum are *represented* as a 16 byte hash. This hash is derived from truncating a full All destinations in Reticulum are *represented* as a 16 byte hash. This hash is derived from truncating a full SHA-256 hash of identifying characteristics of the destination. To users, the destination addresses will be displayed as 16 hexadecimal bytes, like this example: ``<13425ec15b621c1d928589718000d814>``.
SHA-256 hash of identifying characteristics of the destination. To users, the destination addresses
will be displayed as 16 hexadecimal bytes, like this example: ``<13425ec15b621c1d928589718000d814>``.
The truncation size of 16 bytes (128 bits) for destinations has been chosen as a reasonable trade-off The truncation size of 16 bytes (128 bits) for destinations has been chosen as a reasonable trade-off between address space and packet overhead. The address space accommodated by this size can support many billions of simultaneously active devices on the same network, while keeping packet overhead low, which is essential on low-bandwidth networks. In the very unlikely case that this address space nears congestion, a one-line code change can upgrade the Reticulum address space all the way up to 256 bits, ensuring the Reticulum address space could potentially support galactic-scale networks. This is obviously complete and ridiculous over-allocation, and as such, the current 128 bits should be sufficient, even far into the future.
between address space
and packet overhead. The address space accommodated by this size can support many billions of
simultaneously active devices on the same network, while keeping packet overhead low, which is
essential on low-bandwidth networks. In the very unlikely case that this address space nears
congestion, a one-line code change can upgrade the Reticulum address space all the way up to 256
bits, ensuring the Reticulum address space could potentially support galactic-scale networks.
This is obviously complete and ridiculous over-allocation, and as such, the current 128 bits should
be sufficient, even far into the future.
By default Reticulum encrypts all data using elliptic curve cryptography and AES. Any packet sent to a By default Reticulum encrypts all data using elliptic curve cryptography and AES. Any packet sent to a destination is encrypted with a per-packet derived key. Reticulum can also set up an encrypted channel to a destination, called a *Link*. Both data sent over Links and single packets offer *Initiator Anonymity*. Links additionally offer *Forward Secrecy* by default, employing an Elliptic Curve Diffie Hellman key exchange on Curve25519 to derive per-link ephemeral keys. Asymmetric, link-less packet communication can also provide forward secrecy, with automatic key ratcheting, by enabling ratchets on a per-destination basis. The multi-hop transport, coordination, verification and reliability layers are fully autonomous and also based on elliptic curve cryptography.
destination is encrypted with a per-packet derived key. Reticulum can also set up an encrypted
channel to a destination, called a *Link*. Both data sent over Links and single packets offer
*Initiator Anonymity*. Links additionally offer *Forward Secrecy* by default, employing an Elliptic Curve
Diffie Hellman key exchange on Curve25519 to derive per-link ephemeral keys. Asymmetric, link-less
packet communication can also provide forward secrecy, with automatic key ratcheting, by enabling
ratchets on a per-destination basis. The multi-hop transport, coordination, verification and reliability
layers are fully autonomous and also based on elliptic curve cryptography.
Reticulum also offers symmetric key encryption for group-oriented communications, as well as Reticulum also offers symmetric key encryption for group-oriented communications, as well as unencrypted packets (for local broadcast purposes **only**).
unencrypted packets (for local broadcast purposes **only**).
Reticulum can connect to a variety of interfaces such as radio modems, data radios and serial ports, Reticulum can connect to a variety of interfaces such as radio modems, data radios and serial ports, and offers the possibility to easily tunnel Reticulum traffic over IP links such as the Internet or private IP networks.
and offers the possibility to easily tunnel Reticulum traffic over IP links such as the Internet or
private IP networks.
.. _understanding-destinations: .. _understanding-destinations:
Destinations Destinations
------------ ------------
To receive and send data with the Reticulum stack, an application needs to create one or more To receive and send data with the Reticulum stack, an application needs to create one or more destinations. Reticulum uses three different basic destination types, and one special:
destinations. Reticulum uses three different basic destination types, and one special:
* **Single** * **Single**
@@ -165,9 +109,9 @@ destinations. Reticulum uses three different basic destination types, and one sp
number of users, or should be readable by anyone. Traffic to a *plain* destination is not encrypted. number of users, or should be readable by anyone. Traffic to a *plain* destination is not encrypted.
Generally, *plain* destinations can be used for broadcast information intended to be public. Generally, *plain* destinations can be used for broadcast information intended to be public.
Plain destinations are only reachable directly, and packets addressed to plain destinations are Plain destinations are only reachable directly, and packets addressed to plain destinations are
never transported over multiple hops in the network. To be transportable over multiple hops in Reticulum, information never transported over multiple hops in the network. To be transportable over multiple hops in
*must* be encrypted, since Reticulum uses the per-packet encryption to verify routing paths and Reticulum, information *must* be encrypted, since Reticulum uses the per-packet encryption to verify
keep them alive. routing paths and keep them alive.
* **Group** * **Group**
The *group* special destination type, that defines a symmetrically encrypted virtual destination. The *group* special destination type, that defines a symmetrically encrypted virtual destination.
Data sent to this destination will be encrypted with a symmetric key, and will be readable by Data sent to this destination will be encrypted with a symmetric key, and will be readable by
@@ -186,16 +130,11 @@ destinations. Reticulum uses three different basic destination types, and one sp
Destination Naming Destination Naming
^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^
Destinations are created and named in an easy to understand dotted notation of *aspects*, and Destinations are created and named in an easy to understand dotted notation of *aspects*, and represented on the network as a hash of this value. The hash is a SHA-256 truncated to 128 bits. The top level aspect should always be a unique identifier for the application using the destination. The next levels of aspects can be defined in any way by the creator of the application.
represented on the network as a hash of this value. The hash is a SHA-256 truncated to 128 bits. The
top level aspect should always be a unique identifier for the application using the destination.
The next levels of aspects can be defined in any way by the creator of the application.
Aspects can be as long and as plentiful as required, and a resulting long destination name will not Aspects can be as long and as plentiful as required, and a resulting long destination name will not impact efficiency, as names are always represented as truncated SHA-256 hashes on the network.
impact efficiency, as names are always represented as truncated SHA-256 hashes on the network.
As an example, a destination for a environmental monitoring application could be made up of the As an example, a destination for a environmental monitoring application could be made up of the application name, a device type and measurement type, like this:
application name, a device type and measurement type, like this:
.. code-block:: text .. code-block:: text
@@ -205,11 +144,7 @@ application name, a device type and measurement type, like this:
full name : environmentlogger.remotesensor.temperature full name : environmentlogger.remotesensor.temperature
hash : 4faf1b2e0a077e6a9d92fa051f256038 hash : 4faf1b2e0a077e6a9d92fa051f256038
For the *single* destination, Reticulum will automatically append the associated public key as a For the *single* destination, Reticulum will automatically append the associated public key as a destination aspect before hashing. This is done to ensure only the correct destination is reached, since anyone can listen to any destination name. Appending the public key ensures that a given packet is only directed at the destination that holds the corresponding private key to decrypt the packet.
destination aspect before hashing. This is done to ensure only the correct destination is reached,
since anyone can listen to any destination name. Appending the public key ensures that a given
packet is only directed at the destination that holds the corresponding private key to decrypt the
packet.
**Take note!** There is a very important concept to understand here: **Take note!** There is a very important concept to understand here:
@@ -218,16 +153,9 @@ packet.
* Each destination that does so will still have a unique destination hash, and thus be uniquely * Each destination that does so will still have a unique destination hash, and thus be uniquely
addressable, because their public keys will differ. addressable, because their public keys will differ.
In actual use of *single* destination naming, it is advisable not to use any uniquely identifying In actual use of *single* destination naming, it is advisable not to use any uniquely identifying features in aspect naming. Aspect names should be general terms describing what kind of destination is represented. The uniquely identifying aspect is always achieved by appending the public key, which expands the destination into a uniquely identifiable one. Reticulum does this automatically.
features in aspect naming. Aspect names should be general terms describing what kind of destination
is represented. The uniquely identifying aspect is always achieved by appending the public key,
which expands the destination into a uniquely identifiable one. Reticulum does this automatically.
Any destination on a Reticulum network can be addressed and reached simply by knowing its Any destination on a Reticulum network can be addressed and reached simply by knowing its destination hash (and public key, but if the public key is not known, it can be requested from the network simply by knowing the destination hash). The use of app names and aspects makes it easy to structure Reticulum programs and makes it possible to filter what information and data your program receives.
destination hash (and public key, but if the public key is not known, it can be requested from the
network simply by knowing the destination hash). The use of app names and aspects makes it easy to
structure Reticulum programs and makes it possible to filter what information and data your program
receives.
To recap, the different destination types should be used in the following situations: To recap, the different destination types should be used in the following situations:
@@ -239,56 +167,30 @@ To recap, the different destination types should be used in the following situat
* **Plain** * **Plain**
When plain-text communication is desirable, for example when broadcasting information, or for local discovery purposes. When plain-text communication is desirable, for example when broadcasting information, or for local discovery purposes.
To communicate with a *single* destination, you need to know its public key. Any method for To communicate with a *single* destination, you need to know its public key. Any method for obtaining the public key is valid, but Reticulum includes a simple mechanism for making other nodes aware of your destinations public key, called the *announce*. It is also possible to request an unknown public key from the network, as all transport instances serve as a distributed ledger of public keys.
obtaining the public key is valid, but Reticulum includes a simple mechanism for making other
nodes aware of your destinations public key, called the *announce*. It is also possible to request
an unknown public key from the network, as all transport instances serve as a distributed ledger
of public keys.
Note that public key information can be shared and verified in other ways than using the Note that public key information can be shared and verified in other ways than using the built-in *announce* functionality, and that it is therefore not required to use the *announce* and *path request* functionality to obtain public keys. It is by far the easiest though, and should definitely be used if there is not a very good reason for doing it differently.
built-in *announce* functionality, and that it is therefore not required to use the *announce* and *path request*
functionality to obtain public keys. It is by far the easiest though, and should definitely be used
if there is not a very good reason for doing it differently.
.. _understanding-keyannouncements: .. _understanding-keyannouncements:
Public Key Announcements Public Key Announcements
------------------------ ------------------------
An *announce* will send a special packet over any relevant interfaces, containing all needed An *announce* will send a special packet over any relevant interfaces, containing all needed information about the destination hash and public key, and can also contain some additional, application specific data. The entire packet is signed by the sender to ensure authenticity. It is not required to use the announce functionality, but in many cases it will be the simplest way to share public keys on the network. The announce mechanism also serves to establish end-to-end connectivity to the announced destination, as the announce propagates through the network.
information about the destination hash and public key, and can also contain some additional,
application specific data. The entire packet is signed by the sender to ensure authenticity. It is not
required to use the announce functionality, but in many cases it will be the simplest way to share
public keys on the network. The announce mechanism also serves to establish end-to-end connectivity
to the announced destination, as the announce propagates through the network.
As an example, an announce in a simple messenger application might contain the following information: As an example, an announce in a simple messenger application might contain the following information:
* The announcers destination hash * The announcers destination hash
* The announcers public key * The announcers public key
* Application specific data, in this case the users nickname and availability status * Application specific data, in this case the users nickname and availability status
* A random blob, making each new announce unique * A random blob, making each new announce unique
* An Ed25519 signature of the above information, verifying authenticity * An Ed25519 signature of the above information, verifying authenticity
With this information, any Reticulum node that receives it will be able to reconstruct an outgoing With this information, any Reticulum node that receives it will be able to reconstruct an outgoing destination to securely communicate with that destination. You might have noticed that there is one piece of information lacking to reconstruct full knowledge of the announced destination, and that is the aspect names of the destination. These are intentionally left out to save bandwidth, since they will be implicit in almost all cases. The receiving application will already know them. If a destination name is not entirely implicit, information can be included in the application specific data part that will allow the receiver to infer the naming.
destination to securely communicate with that destination. You might have noticed that there is one
piece of information lacking to reconstruct full knowledge of the announced destination, and that is
the aspect names of the destination. These are intentionally left out to save bandwidth, since they
will be implicit in almost all cases. The receiving application will already know them. If a destination
name is not entirely implicit, information can be included in the application specific data part that
will allow the receiver to infer the naming.
It is important to note that announces will be forwarded throughout the network according to a It is important to note that announces will be forwarded throughout the network according to a certain pattern. This will be detailed in the section :ref:`The Announce Mechanism in Detail<understanding-announce>`.
certain pattern. This will be detailed in the section
:ref:`The Announce Mechanism in Detail<understanding-announce>`.
In Reticulum, destinations are allowed to move around the network at will. This is very different from In Reticulum, destinations are allowed to move around the network at will. This is very different from protocols such as IP, where an address is always expected to stay within the network segment it was assigned in. This limitation does not exist in Reticulum, and any destination is *completely portable* over the entire topography of the network, and *can even be moved to other Reticulum networks* than the one it was created in, and still become reachable. To update its reachability, a destination simply needs to send an announce on any networks it is part of. After a short while, it will be globally reachable in the network.
protocols such as IP, where an address is always expected to stay within the network segment it was assigned in.
This limitation does not exist in Reticulum, and any destination is *completely portable* over the entire topography
of the network, and *can even be moved to other Reticulum networks* than the one it was created in, and
still become reachable. To update its reachability, a destination simply needs to send an announce on any
networks it is part of. After a short while, it will be globally reachable in the network.
Seeing how *single* destinations are always tied to a private/public key pair leads us to the next topic. Seeing how *single* destinations are always tied to a private/public key pair leads us to the next topic.
@@ -297,33 +199,18 @@ Seeing how *single* destinations are always tied to a private/public key pair le
Identities Identities
---------- ----------
In Reticulum, an *identity* does not necessarily represent a personal identity, but is an abstraction that In Reticulum, an *identity* does not necessarily represent a personal identity, but is an abstraction that can represent any kind of *verifiable entity*. This could very well be a person, but it could also be the control interface of a machine, a program, robot, computer, sensor or something else entirely. In general, any kind of agent that can act, or be acted upon, or store or manipulate information, can be represented as an identity. An *identity* can be used to create any number of destinations.
can represent any kind of *verifiable entity*. This could very well be a person, but it could also be the
control interface of a machine, a program, robot, computer, sensor or something else entirely. In
general, any kind of agent that can act, or be acted upon, or store or manipulate information, can be
represented as an identity. An *identity* can be used to create any number of destinations.
A *single* destination will always have an *identity* tied to it, but not *plain* or *group* A *single* destination will always have an *identity* tied to it, but not *plain* or *group* destinations. Destinations and identities share a multilateral connection. You can create a destination, and if it is not connected to an identity upon creation, it will just create a new one to use automatically. This may be desirable in some situations, but often you will probably want to create the identity first, and then use it to create new destinations.
destinations. Destinations and identities share a multilateral connection. You can create a
destination, and if it is not connected to an identity upon creation, it will just create a new one to use
automatically. This may be desirable in some situations, but often you will probably want to create
the identity first, and then use it to create new destinations.
As an example, we could use an identity to represent the user of a messaging application. As an example, we could use an identity to represent the user of a messaging application. Destinations can then be created by this identity to allow communication to reach the user. In all cases it is of great importance to store the private keys associated with any Reticulum Identity securely and privately, since obtaining access to the identity keys equals obtaining access and controlling reachability to any destinations created by that identity.
Destinations can then be created by this identity to allow communication to reach the user.
In all cases it is of great importance to store the private keys associated with any
Reticulum Identity securely and privately, since obtaining access to the identity keys equals
obtaining access and controlling reachability to any destinations created by that identity.
.. _understanding-gettingfurther: .. _understanding-gettingfurther:
Getting Further Getting Further
--------------- ---------------
The above functions and principles form the core of Reticulum, and would suffice to create The above functions and principles form the core of Reticulum, and would suffice to create functional networked applications in local clusters, for example over radio links where all interested nodes can directly hear each other. But to be truly useful, we need a way to direct traffic over multiple hops in the network.
functional networked applications in local clusters, for example over radio links where all interested
nodes can directly hear each other. But to be truly useful, we need a way to direct traffic over multiple
hops in the network.
In the following sections, two concepts that allow this will be introduced, *paths* and *links*. In the following sections, two concepts that allow this will be introduced, *paths* and *links*.
@@ -332,16 +219,9 @@ In the following sections, two concepts that allow this will be introduced, *pat
Reticulum Transport Reticulum Transport
=================== ===================
The methods of routing used in traditional networks are fundamentally incompatible with the physical medium The methods of routing used in traditional networks are fundamentally incompatible with the physical medium types and circumstances that Reticulum was designed to handle. These mechanisms mostly assume trust at the physical layer, and often needs a lot more bandwidth than Reticulum can assume is available. Since Reticulum is designed to survive running over open radio spectrum, no such trust can be assumed, and bandwidth is often very limited.
types and circumstances that Reticulum was designed to handle. These mechanisms mostly assume trust at the physical layer,
and often needs a lot more bandwidth than Reticulum can assume is available. Since Reticulum is designed to
survive running over open radio spectrum, no such trust can be assumed, and bandwidth is often very limited.
To overcome such challenges, Reticulum’s *Transport* system uses asymmetric elliptic curve cryptography to To overcome such challenges, Reticulum’s *Transport* system uses asymmetric elliptic curve cryptography to implement the concept of *paths* that allow discovery of how to get information closer to a certain destination. It is important to note that no single node in a Reticulum network knows the complete path to a destination. Every Transport node participating in a Reticulum network will only know the most direct way to get a packet one hop closer to it's destination.
implement the concept of *paths* that allow discovery of how to get information closer to a certain
destination. It is important to note that no single node in a Reticulum network knows the complete
path to a destination. Every Transport node participating in a Reticulum network will only
know the most direct way to get a packet one hop closer to it's destination.
.. _understanding-nodetypes: .. _understanding-nodetypes:
@@ -349,16 +229,11 @@ know the most direct way to get a packet one hop closer to it's destination.
Node Types Node Types
---------- ----------
Currently, Reticulum distinguishes between two types of network nodes. All nodes on a Reticulum network Currently, Reticulum distinguishes between two types of network nodes. All nodes on a Reticulum network are *Reticulum Instances*, and some are also *Transport Nodes*. If a system running Reticulum is fixed in one place, and is intended to be kept available most of the time, it is a good contender to be a *Transport Node*.
are *Reticulum Instances*, and some are also *Transport Nodes*. If a system running Reticulum is fixed in
one place, and is intended to be kept available most of the time, it is a good contender to be a *Transport Node*.
Any Reticulum Instance can become a Transport Node by enabling it in the configuration. Any Reticulum Instance can become a Transport Node by enabling it in the configuration. This distinction is made by the user configuring the node, and is used to determine what nodes on the network will help forward traffic, and what nodes rely on other nodes for wider connectivity.
This distinction is made by the user configuring the node, and is used to determine what nodes on the
network will help forward traffic, and what nodes rely on other nodes for wider connectivity.
If a node is an *Instance* it should be given the configuration directive ``enable_transport = No``, which If a node is an *Instance* it should be given the configuration directive ``enable_transport = No``, which is the default setting.
is the default setting.
If it is a *Transport Node*, it should be given the configuration directive ``enable_transport = Yes``. If it is a *Transport Node*, it should be given the configuration directive ``enable_transport = Yes``.
@@ -368,8 +243,7 @@ If it is a *Transport Node*, it should be given the configuration directive ``en
The Announce Mechanism in Detail The Announce Mechanism in Detail
-------------------------------- --------------------------------
When an *announce* for a destination is transmitted by a Reticulum instance, it will be forwarded by When an *announce* for a destination is transmitted by a Reticulum instance, it will be forwarded by any transport node receiving it, but according to some specific rules:
any transport node receiving it, but according to some specific rules:
* | If this exact announce has already been received before, ignore it. * | If this exact announce has already been received before, ignore it.
@@ -400,42 +274,23 @@ any transport node receiving it, but according to some specific rules:
to be transmitted, the newest announce is discarded. If the newest announce contains different to be transmitted, the newest announce is discarded. If the newest announce contains different
application specific data, it will replace the old announce. application specific data, it will replace the old announce.
Once an announce has reached a transport node in the network, any other node in direct contact with that Once an announce has reached a transport node in the network, any other node in direct contact with that transport node will be able to reach the destination the announce originated from, simply by sending a packet addressed to that destination. Any transport node with knowledge of the announce will be able to direct the packet towards the destination by looking up the most efficient next node to the destination.
transport node will be able to reach the destination the announce originated from, simply by sending a packet
addressed to that destination. Any transport node with knowledge of the announce will be able to direct the
packet towards the destination by looking up the most efficient next node to the destination.
According to these rules, an announce will propagate throughout the network in a predictable way, According to these rules, an announce will propagate throughout the network in a predictable way, and make the announced destination reachable in a short amount of time. Fast networks that have the capacity to process many announces can reach full convergence very quickly, even when constantly adding new destinations. Slower segments of such networks might take a bit longer to gain full knowledge about the wide and fast networks they are connected to, but can still do so over time, while prioritising full and quickly converging end-to-end connectivity for their local, slower segments.
and make the announced destination reachable in a short amount of time. Fast networks that have the
capacity to process many announces can reach full convergence very quickly, even when constantly adding
new destinations. Slower segments of such networks might take a bit longer to gain full knowledge about
the wide and fast networks they are connected to, but can still do so over time, while prioritising full
and quickly converging end-to-end connectivity for their local, slower segments.
.. tip:: .. tip::
Even very slow networks, that simply don't have the capacity to ever reach *full* convergence will generally still be able to reach **any other destination on any connected segments**, since interconnecting transport nodes will prioritize announces into the slower segments that are actually requested by nodes on these.
Even very slow networks, that simply don't have the capacity to ever reach *full* convergence This means that slow, low-capacity or low-resource segments **don't** need to have full network knowledge, since paths can always be recursively resolved from other segments that do have knowledge about them.
will generally still be able to reach **any other destination on any connected segments**, since
interconnecting transport nodes will prioritize announces into the slower segments that are
actually requested by nodes on these.
This means that slow, low-capacity or low-resource segments **don't** need to have full network In general, even extremely complex networks, that utilize the maximum 128 hops will converge to full end-to-end connectivity in about one minute, given there is enough bandwidth available to process the required amount of announces.
knowledge, since paths can always be recursively resolved from other segments that do have
knowledge about them.
In general, even extremely complex networks, that utilize the maximum 128 hops will converge to full
end-to-end connectivity in about one minute, given there is enough bandwidth available to process
the required amount of announces.
.. _understanding-paths: .. _understanding-paths:
Reaching the Destination Reaching the Destination
------------------------ ------------------------
In networks with changing topology and trustless connectivity, nodes need a way to establish In networks with changing topology and trustless connectivity, nodes need a way to establish *verified connectivity* with each other. Since the underlying network mediums are assumed to be trustless, Reticulum must provide a way to guarantee that the peer you are communicating with is actually who you expect. Reticulum offers two ways to do this.
*verified connectivity* with each other. Since the underlying network mediums are assumed to be trustless, Reticulum
must provide a way to guarantee that the peer you are communicating with is actually who you
expect. Reticulum offers two ways to do this.
For exchanges of small amounts of information, Reticulum offers the *Packet* API, which works exactly like you would expect - on a per packet level. The following process is employed when sending a packet: For exchanges of small amounts of information, Reticulum offers the *Packet* API, which works exactly like you would expect - on a per packet level. The following process is employed when sending a packet:
@@ -495,35 +350,17 @@ For exchanges of larger amounts of data, or when longer sessions of bidirectiona
the destination using a Reticulum Identity. This authentication is happening inside the encrypted the destination using a Reticulum Identity. This authentication is happening inside the encrypted
link, and is only revealed to the verified destination, and no intermediaries. link, and is only revealed to the verified destination, and no intermediaries.
In a moment, we will discuss the details of how this methodology is In a moment, we will discuss the details of how this methodology is implemented, but let’s first recap what purposes this methodology serves. We first ensure that the node answering our request is actually the one we want to communicate with, and not a malicious actor pretending to be so. At the same time we establish an efficient encrypted channel. The setup of this is relatively cheap in terms of bandwidth, so it can be used just for a short exchange, and then recreated as needed, which will also rotate encryption keys. The link can also be kept alive for longer periods of time, if this is more suitable to the application. The procedure also inserts the *link id* , a hash calculated from the link request packet, into the memory of forwarding nodes, which means that the communicating nodes can thereafter reach each other simply by referring to this *link id*.
implemented, but let’s first recap what purposes this methodology serves. We
first ensure that the node answering our request is actually the one we want to
communicate with, and not a malicious actor pretending to be so. At the same
time we establish an efficient encrypted channel. The setup of this is
relatively cheap in terms of bandwidth, so it can be used just for a short
exchange, and then recreated as needed, which will also rotate encryption keys.
The link can also be kept alive for longer periods of time, if this is more
suitable to the application. The procedure also inserts the *link id* , a hash
calculated from the link request packet, into the memory of forwarding nodes,
which means that the communicating nodes can thereafter reach each other simply
by referring to this *link id*.
The combined bandwidth cost of setting up a link is 3 packets totalling 297 bytes (more info in the The combined bandwidth cost of setting up a link is 3 packets totalling 297 bytes (more info in the :ref:`Binary Packet Format<understanding-packetformat>` section). The amount of bandwidth used on keeping a link open is practically negligible, at 0.45 bits per second. Even on a slow 1200 bits per second packet radio channel, 100 concurrent links will still leave 96% channel capacity for actual data.
:ref:`Binary Packet Format<understanding-packetformat>` section). The amount of bandwidth used on keeping
a link open is practically negligible, at 0.45 bits per second. Even on a slow 1200 bits per second packet
radio channel, 100 concurrent links will still leave 96% channel capacity for actual data.
Link Establishment in Detail Link Establishment in Detail
^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
After exploring the basics of the announce mechanism, finding a path through the network, and an overview After exploring the basics of the announce mechanism, finding a path through the network, and an overview of the link establishment procedure, this section will go into greater detail about the Reticulum link establishment process.
of the link establishment procedure, this section will go into greater detail about the Reticulum link
establishment process.
The *link* in Reticulum terminology should not be viewed as a direct node-to-node link on the The *link* in Reticulum terminology should not be viewed as a direct node-to-node link on the physical layer, but as an abstract channel, that can be open for any amount of time, and can span an arbitrary number of hops, where information will be exchanged between two nodes.
physical layer, but as an abstract channel, that can be open for any amount of time, and can span
an arbitrary number of hops, where information will be exchanged between two nodes.
* | When a node in the network wants to establish verified connectivity with another node, it * | When a node in the network wants to establish verified connectivity with another node, it
@@ -570,30 +407,20 @@ an arbitrary number of hops, where information will be exchanged between two nod
that is used to encrypt the channel. Information can now be exchanged reliably and securely. that is used to encrypt the channel. Information can now be exchanged reliably and securely.
.. note:: .. note::
It’s important to note that this methodology ensures that the source of the request does not need to reveal any identifying information about itself. **The link initiator remains completely anonymous**.
It’s important to note that this methodology ensures that the source of the request does not need to When using *links*, Reticulum will automatically verify all data sent over the link, and can also automate retransmissions if *Resources* are used.
reveal any identifying information about itself. **The link initiator remains completely anonymous**.
When using *links*, Reticulum will automatically verify all data sent over the link, and can also
automate retransmissions if *Resources* are used.
.. _understanding-resources: .. _understanding-resources:
Resources Resources
--------- ---------
For exchanging small amounts of data over a Reticulum network, the :ref:`Packet<api-packet>` interface For exchanging small amounts of data over a Reticulum network, the :ref:`Packet<api-packet>` interface is sufficient, but for exchanging data that would require many packets, an efficient way to coordinate the transfer is needed.
is sufficient, but for exchanging data that would require many packets, an efficient way to coordinate
the transfer is needed.
This is the purpose of the Reticulum :ref:`Resource<api-resource>`. A *Resource* can automatically This is the purpose of the Reticulum :ref:`Resource<api-resource>`. A *Resource* can automatically handle the reliable transfer of an arbitrary amount of data over an established :ref:`Link<api-link>`. Resources can auto-compress data, will handle breaking the data into individual packets, sequencing the transfer, integrity verification and reassembling the data on the other end.
handle the reliable transfer of an arbitrary amount of data over an established :ref:`Link<api-link>`.
Resources can auto-compress data, will handle breaking the data into individual packets, sequencing
the transfer, integrity verification and reassembling the data on the other end.
:ref:`Resources<api-resource>` are programmatically very simple to use, and only requires a few lines :ref:`Resources<api-resource>` are programmatically very simple to use, and only requires a few lines of codes to reliably transfer any amount of data. They can be used to transfer data stored in memory, or stream data directly from files.
of codes to reliably transfer any amount of data. They can be used to transfer data stored in memory,
or stream data directly from files.
.. _understanding-network_identities: .. _understanding-network_identities:
@@ -676,19 +503,11 @@ Once configured, your instances will automatically utilize this identity for sig
Reference Setup Reference Setup
====================== ======================
This section will detail a recommended *Reference Setup* for Reticulum. It is important to This section will detail a recommended *Reference Setup* for Reticulum. It is important to note that Reticulum is designed to be usable on more or less any computing device, and over more or less any medium that allows you to send and receive data, which satisfies some very low minimum requirements.
note that Reticulum is designed to be usable on more or less any computing device, and over more
or less any medium that allows you to send and receive data, which satisfies some very low
minimum requirements.
The communication channel must support at least half-duplex operation, and provide an average The communication channel must support at least half-duplex operation, and provide an average throughput of 5 bits per second or greater, and supports a physical layer MTU of 500 bytes. The Reticulum stack should be able to run on more or less any hardware that can provide a Python 3.x runtime environment.
throughput of 5 bits per second or greater, and supports a physical layer MTU of 500 bytes. The
Reticulum stack should be able to run on more or less any hardware that can provide a Python 3.x
runtime environment.
That being said, this reference setup has been outlined to provide a common platform for anyone That being said, this reference setup has been outlined to provide a common platform for anyone who wants to help in the development of Reticulum, and for everyone who wants to know a recommended setup to get started experimenting. A reference system consists of three parts:
who wants to help in the development of Reticulum, and for everyone who wants to know a
recommended setup to get started experimenting. A reference system consists of three parts:
* **An Interface Device** * **An Interface Device**
Which provides access to the physical medium whereupon the communication Which provides access to the physical medium whereupon the communication
@@ -700,11 +519,7 @@ recommended setup to get started experimenting. A reference system consists of t
* **A Software Stack** * **A Software Stack**
The software implementing the Reticulum protocol and applications using it. The software implementing the Reticulum protocol and applications using it.
The reference setup can be considered a relatively stable platform to develop on, and also to start The reference setup can be considered a relatively stable platform to develop on, and also to start building networks or applications on. While details of the implementation might change at the current stage of development, it is the goal to maintain hardware compatibility for as long as entirely possible, and the current reference setup has been determined to provide a functional platform for many years into the future. The current Reference System Setup is as follows:
building networks or applications on. While details of the implementation might change at the current stage of
development, it is the goal to maintain hardware compatibility for as long as entirely possible, and
the current reference setup has been determined to provide a functional platform for many years
into the future. The current Reference System Setup is as follows:
* **Interface Device** * **Interface Device**
@@ -719,53 +534,34 @@ into the future. The current Reference System Setup is as follows:
operating system. operating system.
.. note:: .. note::
To avoid confusion, it is very important to note, that the reference interface device **does not** use the LoRaWAN standard, but uses a custom MAC layer on top of the plain LoRa modulation! As such, you will need a plain LoRa radio module connected to a controller with the correct firmware. Full details on how to get or make such a device is available on the `RNode Page <https://github.com/markqvist/rnode_firmware>`_.
To avoid confusion, it is very important to note, that the reference interface device **does not** With the current reference setup, it should be possible to get on a Reticulum network for around 100$ even if you have none of the hardware already, and need to purchase everything.
use the LoRaWAN standard, but uses a custom MAC layer on top of the plain LoRa modulation! As such, you will
need a plain LoRa radio module connected to a controller with the correct firmware. Full details on how to
get or make such a device is available on the `RNode Page <https://github.com/markqvist/rnode_firmware>`_.
With the current reference setup, it should be possible to get on a Reticulum network for around 100$ This reference setup is of course just a recommendation for getting started easily, and you should tailor it to your own specific needs, or whatever hardware you have available.
even if you have none of the hardware already, and need to purchase everything.
This reference setup is of course just a recommendation for getting started easily, and you should
tailor it to your own specific needs, or whatever hardware you have available.
.. _understanding-protocolspecifics: .. _understanding-protocolspecifics:
Protocol Specifics Protocol Specifics
================== ==================
This chapter will detail protocol specific information that is essential to the implementation of This chapter will detail protocol specific information that is essential to the implementation of Reticulum, but non-critical in understanding how the protocol works on a general level. It should be treated more as a reference than as essential reading.
Reticulum, but non-critical in understanding how the protocol works on a general level. It should be
treated more as a reference than as essential reading.
Packet Prioritisation Packet Prioritisation
--------------------- ---------------------
Currently, Reticulum is completely priority-agnostic regarding *general* traffic. All traffic is handled Currently, Reticulum is completely priority-agnostic regarding *general* traffic. All traffic is handled on a first-come, first-serve basis. Announce re-transmission and other maintenance traffic is handled according to the re-transmission times and priorities described earlier in this chapter.
on a first-come, first-serve basis. Announce re-transmission and other maintenance traffic is handled
according to the re-transmission times and priorities described earlier in this chapter.
Interface Access Codes Interface Access Codes
---------------------- ----------------------
Reticulum can create named virtual networks, and networks that are only accessible by knowing a preshared Reticulum can create named virtual networks, and networks that are only accessible by knowing a preshared passphrase. The configuration of this is detailed in the :ref:`Common Interface Options<interfaces-options>` section. To implement this feature, Reticulum uses the concept of Interface Access Codes, that are calculated and verified per-packet.
passphrase. The configuration of this is detailed in the :ref:`Common Interface Options<interfaces-options>`
section. To implement this feature, Reticulum uses the concept of Interface Access Codes, that are calculated
and verified per-packet.
An interface with a named virtual network or passphrase authentication enabled will derive a shared Ed25519 An interface with a named virtual network or passphrase authentication enabled will derive a shared Ed25519 signing identity, and for every outbound packet generate a signature of the entire packet. This signature is then inserted into the packet as an Interface Access Code before transmission. Depending on the speed and capabilities of the interface, the IFAC can be the full 512-bit Ed25519 signature, or a truncated version. Configured IFAC length can be inspected for all interfaces with the ``rnstatus`` utility.
signing identity, and for every outbound packet generate a signature of the entire packet. This signature is
then inserted into the packet as an Interface Access Code before transmission. Depending on the speed and
capabilities of the interface, the IFAC can be the full 512-bit Ed25519 signature, or a truncated version.
Configured IFAC length can be inspected for all interfaces with the ``rnstatus`` utility.
Upon receipt, the interface will check that the signature matches the expected value, and drop the packet if it Upon receipt, the interface will check that the signature matches the expected value, and drop the packet if it does not. This ensures that only packets sent with the correct naming and/or passphrase parameters are allowed to pass onto the network.
does not. This ensures that only packets sent with the correct naming and/or passphrase parameters are allowed to
pass onto the network.
.. _understanding-packetformat: .. _understanding-packetformat:
@@ -909,54 +705,71 @@ Wire Format
Announce Propagation Rules Announce Propagation Rules
-------------------------- --------------------------
The following table illustrates the rules for automatically propagating announces The following table illustrates the rules for automatically propagating announces from one interface type to another, for all possible combinations. For the purpose of announce propagation, the *Full* and *Gateway* modes are identical.
from one interface type to another, for all possible combinations. For the purpose
of announce propagation, the *Full* and *Gateway* modes are identical. See the :ref:`Interface Modes<interfaces-modes>` section for a conceptual overview of the different interface modes, and how they are configured.
.. image:: graphics/if_mode_graph_b.png .. image:: graphics/if_mode_graph_b.png
See the :ref:`Interface Modes<interfaces-modes>` section for a conceptual overview Or, represented in table form:
of the different interface modes, and how they are configured.
.. image:: graphics/if_mode_graph_c.png
.. ..
(.. code-block:: text) (.. code-block:: text)
Full ────── ✓ ──┐ ┌── ✓ ── Full Full ────── ✓ ──┐ ┌── ✓ ── Full
AP ──────── ✓ ──┼───> Full >───┼── ✕ ── AP AP ──────── ✓ ──┤ ├── ✕ ── AP
Boundary ── ✓ ──┤ ├── ✓ ── Boundary Boundary ── ✓ ──┼───> Full >───┼── ✓ ── Boundary
Internal ── ✓ ──┤ ├── ✓ ── Internal
Roaming ─── ✓ ──┘ └── ✓ ── Roaming Roaming ─── ✓ ──┘ └── ✓ ── Roaming
Full ────── ✕ ──┐ ┌── ✓ ── Full Full ────── ✕ ──┐ ┌── ✓ ── Full
AP ──────── ✕ ──┼────> AP >────┼── ✕ ── AP AP ──────── ✕ ──┤ ├── ✕ ── AP
Boundary ── ✕ ──┤ ├── ✓ ── Boundary Boundary ── ✕ ──┼────> AP >────┼── ✓ ── Boundary
Internal ── ✕ ──┤ ├── ✓ ── Internal
Roaming ─── ✕ ──┘ └── ✓ ── Roaming Roaming ─── ✕ ──┘ └── ✓ ── Roaming
Full ────── ✓ ──┐ ┌── ✓ ── Full Full ────── ✓ ──┐ ┌── ✓ ── Full
AP ──────── ✓ ──┼─> Roaming >──┼── ✕ ── AP AP ──────── ✓ ──┤ ├── ✕ ── AP
Boundary ── ✕ ──┤ ├── ✕ ── Boundary Boundary ── ✕ ──┼─> Roaming >──┼── ✕ ── Boundary
Internal ── ✕ ──┤ ├── ✓ ── Internal
Roaming ─── ✕ ──┘ └── ✕ ── Roaming Roaming ─── ✕ ──┘ └── ✕ ── Roaming
Full ────── ✓ ──┐ ┌── ✓ ── Full Full ────── ✓ ──┐ ┌── ✓ ── Full
AP ──────── ✓ ──┼─> Boundary >─┼── ✕ ── AP AP ──────── ✓ ──┤ ├── ✕ ── AP
Boundary ── ✓ ──┤ ├── ✓ ── Boundary Boundary ── ✓ ──┼─> Boundary >─┼── ✓ ── Boundary
Internal ── ✓ ──┤ ├── ✕ ── Internal
Roaming ─── ✕ ──┘ └── ✕ ── Roaming Roaming ─── ✕ ──┘ └── ✕ ── Roaming
Full ────── ✓ ──┐ ┌── ✓ ── Full
AP ──────── ✓ ──┤ ├── ✕ ── AP
Boundary ── ✕ ──┼─> Internal >─┼── ✓ ── Boundary
Internal ── ✓ ──┤ ├── ✓ ── Internal
Roaming ─── ✓ ──┘ └── ✕ ── Roaming
dest → Full AP Boundary Roaming Gateway Internal
source ↓
Full ✓ ✕ ✓ ✓ ✓ ✓
Gateway ✓ ✕ ✓ ✓ ✓ ✓
AP ✓ ✕ ✓ ✓ ✓ ✓
Boundary ✓ ✕ ✓ ✕ ✓ ✕
Internal ✓ ✕ ✓ ✕ ✓ ✓
Roaming ✓ ✕ ✕ ✕ ✓ ✓
✓ Will rebroadcast announce
✕ Will not rebroadcast announce
.. _understanding-primitives: .. _understanding-primitives:
Cryptographic Primitives Cryptographic Primitives
------------------------ ------------------------
Reticulum uses a simple suite of efficient, strong and well-tested cryptographic Reticulum uses a simple suite of efficient, strong and well-tested cryptographic primitives, with widely available implementations that can be used both on general-purpose CPUs and on microcontrollers.
primitives, with widely available implementations that can be used both on
general-purpose CPUs and on microcontrollers.
One of the primary considerations for choosing this particular set of primitives is One of the primary considerations for choosing this particular set of primitives is that they can be implemented *safely* with relatively few pitfalls, on practically all current computing platforms.
that they can be implemented *safely* with relatively few pitfalls, on practically
all current computing platforms.
The primitives listed here **are authoritative**. Anything claiming to be Reticulum, The primitives listed here **are authoritative**. Anything claiming to be Reticulum, but not using these exact primitives **is not** Reticulum, and possibly an intentionally compromised or weakened clone. The utilised primitives are:
but not using these exact primitives **is not** Reticulum, and possibly an
intentionally compromised or weakened clone. The utilised primitives are:
* Ed25519 for signatures * Ed25519 for signatures
@@ -980,12 +793,7 @@ intentionally compromised or weakened clone. The utilised primitives are:
* SHA-512 * SHA-512
In the default installation configuration, the ``X25519``, ``Ed25519`` and ``AES-256-CBC`` In the default installation configuration, the ``X25519``, ``Ed25519`` and ``AES-256-CBC`` primitives are provided by `OpenSSL <https://www.openssl.org/>`_ (via the `PyCA/cryptography <https://github.com/pyca/cryptography>`_ package). The hashing functions ``SHA-256`` and ``SHA-512`` are provided by the standard Python `hashlib <https://docs.python.org/3/library/hashlib.html>`_. The ``HKDF``, ``HMAC``, ``Token`` primitives, and the ``PKCS7`` padding function are always provided by the following internal implementations:
primitives are provided by `OpenSSL <https://www.openssl.org/>`_ (via the `PyCA/cryptography <https://github.com/pyca/cryptography>`_
package). The hashing functions ``SHA-256`` and ``SHA-512`` are provided by the standard
Python `hashlib <https://docs.python.org/3/library/hashlib.html>`_. The ``HKDF``, ``HMAC``,
``Token`` primitives, and the ``PKCS7`` padding function are always provided by the
following internal implementations:
- ``RNS/Cryptography/HKDF.py`` - ``RNS/Cryptography/HKDF.py``
- ``RNS/Cryptography/HMAC.py`` - ``RNS/Cryptography/HMAC.py``
@@ -993,17 +801,9 @@ following internal implementations:
- ``RNS/Cryptography/PKCS7.py`` - ``RNS/Cryptography/PKCS7.py``
Reticulum also includes a complete implementation of all necessary primitives in pure Python. Reticulum also includes a complete implementation of all necessary primitives in pure Python. If OpenSSL & PyCA are not available on the system when Reticulum is started, Reticulum will instead use the internal pure-python primitives. A trivial consequence of this is performance, with the OpenSSL backend being *much* faster. The most important consequence however, is the potential loss of security by using primitives that has not seen the same amount of scrutiny, testing and review as those from OpenSSL.
If OpenSSL & PyCA are not available on the system when Reticulum is started, Reticulum will
instead use the internal pure-python primitives. A trivial consequence of this is performance,
with the OpenSSL backend being *much* faster. The most important consequence however, is the
potential loss of security by using primitives that has not seen the same amount of scrutiny,
testing and review as those from OpenSSL.
Using the normal RNS installation procedures, it is not possible to install Reticulum on a Using the normal RNS installation procedures, it is not possible to install Reticulum on a system without the required OpenSSL primitives being available, and if they are not, they will be resolved and installed as a dependency. It is only possible to use the pure-python primitives by manually specifying this, for example by using the ``rnspure`` package.
system without the required OpenSSL primitives being available, and if they are not, they will
be resolved and installed as a dependency. It is only possible to use the pure-python primitives
by manually specifying this, for example by using the ``rnspure`` package.
.. warning:: .. warning::
If you want to use the internal pure-python primitives, it is **highly advisable** that you If you want to use the internal pure-python primitives, it is **highly advisable** that you
+32 -33
View File
@@ -1002,39 +1002,35 @@ available. These are only recognised immediately after a newline character:
destination hexadecimal hash of the destination to connect to destination hexadecimal hash of the destination to connect to
options: options:
-h, --help show this help message and exit -h, --help show this help message and exit
--config, -c CONFIG path to alternative Reticulum config directory --config, -c PATH path to config directory
--identity, -i IDENTITY --rnsconfig, -c PATH path to alternative Reticulum config directory
path to identity file to use --identity, -i IDENTITY path to identity file to use
-v, --verbose increase verbosity -v, --verbose increase verbosity
-q, --quiet decrease verbosity -q, --quiet decrease verbosity
-p, --print-identity print identity and destination info and exit -p, --print-identity print identity and destination info and exit
--version show program's version number and exit --version show program's version number and exit
-l, --listen listen (server) mode; any command specified after -- -l, --listen listen (server) mode; any command specified after --
will be used as the default command when the initiator will be used as the default command when the initiator
does not provide one or when remote command execution does not provide one or when remote command execution
is disabled; if no command is specified, the default is disabled; if no command is specified, the default
shell of the user running rnsh will be used shell of the user running rnsh will be used
-s, --service SERVICE -s, --service SERVICE service name for identity file if not the default
service name for identity file if not the default -b, --announce PERIOD announce on startup and every PERIOD seconds; specify
-b, --announce PERIOD 0 to announce on startup only
announce on startup and every PERIOD seconds; specify -a, --allowed HASH allow this identity to connect (may be specified
0 to announce on startup only multiple times); allowed identities can also be
-a, --allowed HASH allow this identity to connect (may be specified specified in ~/.rnsh/allowed_identities or
multiple times); allowed identities can also be ~/.config/rnsh/allowed_identities, one hash per line
specified in ~/.rnsh/allowed_identities or -n, --no-auth disable authentication (allow any identity to connect)
~/.config/rnsh/allowed_identities, one hash per line
-n, --no-auth disable authentication (allow any identity to connect)
-A, --remote-command-as-args -A, --remote-command-as-args
concatenate remote command to the argument list of the concatenate remote command to the argument list of the
default program or shell default program or shell
-C, --no-remote-command -C, --no-remote-command disable executing command lines received from the
disable executing command lines received from the remote initiator
remote initiator -N, --no-id disable identity announcement on connect
-N, --no-id disable identity announcement on connect -m, --mirror return with the exit code of the remote process
-m, --mirror return with the exit code of the remote process -w, --timeout SECONDS connect and request timeout in seconds
-w, --timeout SECONDS
connect and request timeout in seconds
When specifying a command to execute, separate rnsh options from the command When specifying a command to execute, separate rnsh options from the command
and its arguments with --. For example: and its arguments with --. For example:
@@ -1316,7 +1312,7 @@ To see all identities currently blackholed on your local instance, use the ``-b`
Automated List Sourcing Automated List Sourcing
======================= =======================
Manually blocking identities is effective for immediate threats, but maintaining an up-to-date blocklist for a large network is impractical. Reticulum supports **automated list sourcing**, allowing your node to subscribe to blackhole lists maintained by trusted peers, or a central authority you manage yourself. Manually blocking identities is effective for immediate threats and annoyances, but maintaining an up-to-date blocklist across many nodes on a large network is impractical. Reticulum supports **automated list sourcing**, allowing your node to subscribe to blackhole lists maintained by trusted peers, or a central authority you manage yourself.
.. warning:: .. warning::
**Verify Before Subscribing!** Subscribing to a blackhole source is a powerful action that grants that source the ability to dictate who you can communicate with. Before adding a source to your configuration, verify that the maintainer aligns with your usage policy and values. Blindly subscribing to untrusted lists could inadvertently block legitimate peers or essential services. **Verify Before Subscribing!** Subscribing to a blackhole source is a powerful action that grants that source the ability to dictate who you can communicate with. Before adding a source to your configuration, verify that the maintainer aligns with your usage policy and values. Blindly subscribing to untrusted lists could inadvertently block legitimate peers or essential services.
@@ -1333,6 +1329,9 @@ To enable automated sourcing, add the ``blackhole_sources`` option to the ``[ret
... ...
# Automatically fetch blackhole lists from these trusted sources # Automatically fetch blackhole lists from these trusted sources
blackhole_sources = 521c87a83afb8f29e4455e77930b973b, 68a4aa91ac350c4087564e8a69f84e86 blackhole_sources = 521c87a83afb8f29e4455e77930b973b, 68a4aa91ac350c4087564e8a69f84e86
# Optional update interval, defaults to one hour
blackhole_update_interval = 60
... ...
**How It Works** **How It Works**
+4
View File
@@ -14,6 +14,10 @@ img[src*="if_mode_graph_b.png"] {
background-color: rgb(169, 177, 186); background-color: rgb(169, 177, 186);
} }
img[src*="if_mode_graph_c.png"] {
background-color: rgb(169, 177, 186);
}
dt.sig { dt.sig {
margin-bottom: 0.75rem; margin-bottom: 0.75rem;
margin-top: 1.75rem; margin-top: 1.75rem;
+1 -1
View File
@@ -1,5 +1,5 @@
const DOCUMENTATION_OPTIONS = { const DOCUMENTATION_OPTIONS = {
VERSION: '1.3.1', VERSION: '1.3.9',
LANGUAGE: 'en', LANGUAGE: 'en',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
BUILDER: 'html', BUILDER: 'html',
+5 -5
View File
@@ -7,12 +7,12 @@
<link rel="prefetch" href="_static/rns_logo_512.png" as="image"> <link rel="prefetch" href="_static/rns_logo_512.png" as="image">
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 --> <!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 -->
<title>Distributed Development - Reticulum Network Stack 1.3.1 documentation</title> <title>Distributed Development - Reticulum Network Stack 1.3.9 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" /> <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" />
<link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" /> <link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" />
<link rel="stylesheet" type="text/css" href="_static/custom.css?v=bb3cebc5" /> <link rel="stylesheet" type="text/css" href="_static/custom.css?v=e1715074" />
@@ -180,7 +180,7 @@
</label> </label>
</div> </div>
<div class="header-center"> <div class="header-center">
<a href="index.html"><div class="brand">Reticulum Network Stack 1.3.1 documentation</div></a> <a href="index.html"><div class="brand">Reticulum Network Stack 1.3.9 documentation</div></a>
</div> </div>
<div class="header-right"> <div class="header-right">
<div class="theme-toggle-container theme-toggle-header"> <div class="theme-toggle-container theme-toggle-header">
@@ -204,7 +204,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/> <img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div> </div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.3.1 documentation</span> <span class="sidebar-brand-text">Reticulum Network Stack 1.3.9 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search"> </a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search"> <input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -431,7 +431,7 @@
</aside> </aside>
</div> </div>
</div><script src="_static/documentation_options.js?v=bb516dca"></script> </div><script src="_static/documentation_options.js?v=98c25ec5"></script>
<script src="_static/doctools.js?v=9bcbadda"></script> <script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script> <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script> <script src="_static/scripts/furo.js?v=46bd48cc"></script>
+16 -33
View File
@@ -7,12 +7,12 @@
<link rel="prefetch" href="_static/rns_logo_512.png" as="image"> <link rel="prefetch" href="_static/rns_logo_512.png" as="image">
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 --> <!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 -->
<title>Code Examples - Reticulum Network Stack 1.3.1 documentation</title> <title>Code Examples - Reticulum Network Stack 1.3.9 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" /> <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" />
<link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" /> <link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" />
<link rel="stylesheet" type="text/css" href="_static/custom.css?v=bb3cebc5" /> <link rel="stylesheet" type="text/css" href="_static/custom.css?v=e1715074" />
@@ -180,7 +180,7 @@
</label> </label>
</div> </div>
<div class="header-center"> <div class="header-center">
<a href="index.html"><div class="brand">Reticulum Network Stack 1.3.1 documentation</div></a> <a href="index.html"><div class="brand">Reticulum Network Stack 1.3.9 documentation</div></a>
</div> </div>
<div class="header-right"> <div class="header-right">
<div class="theme-toggle-container theme-toggle-header"> <div class="theme-toggle-container theme-toggle-header">
@@ -204,7 +204,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/> <img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div> </div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.3.1 documentation</span> <span class="sidebar-brand-text">Reticulum Network Stack 1.3.9 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search"> </a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search"> <input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -264,14 +264,10 @@
<article role="main" id="furo-main-content"> <article role="main" id="furo-main-content">
<section id="code-examples"> <section id="code-examples">
<span id="examples-main"></span><h1>Code Examples<a class="headerlink" href="#code-examples" title="Link to this heading"></a></h1> <span id="examples-main"></span><h1>Code Examples<a class="headerlink" href="#code-examples" title="Link to this heading"></a></h1>
<p>A number of examples are included in the source distribution of Reticulum. <p>A number of examples are included in the source distribution of Reticulum. You can use these examples to learn how to write your own programs.</p>
You can use these examples to learn how to write your own programs.</p>
<section id="minimal"> <section id="minimal">
<span id="example-minimal"></span><h2>Minimal<a class="headerlink" href="#minimal" title="Link to this heading"></a></h2> <span id="example-minimal"></span><h2>Minimal<a class="headerlink" href="#minimal" title="Link to this heading"></a></h2>
<p>The <em>Minimal</em> example demonstrates the bare-minimum setup required to connect to <p>The <em>Minimal</em> example demonstrates the bare-minimum setup required to connect to a Reticulum network from your program. In about five lines of code, you will have the Reticulum Network Stack initialised, and ready to pass traffic in your program.</p>
a Reticulum network from your program. In about five lines of code, you will
have the Reticulum Network Stack initialised, and ready to pass traffic in your
program.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1">##########################################################</span> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1">##########################################################</span>
<span class="c1"># This RNS example demonstrates a minimal setup, that #</span> <span class="c1"># This RNS example demonstrates a minimal setup, that #</span>
<span class="c1"># will start up the Reticulum Network Stack, generate a #</span> <span class="c1"># will start up the Reticulum Network Stack, generate a #</span>
@@ -380,9 +376,7 @@ program.</p>
</section> </section>
<section id="announce"> <section id="announce">
<span id="example-announce"></span><h2>Announce<a class="headerlink" href="#announce" title="Link to this heading"></a></h2> <span id="example-announce"></span><h2>Announce<a class="headerlink" href="#announce" title="Link to this heading"></a></h2>
<p>The <em>Announce</em> example builds upon the previous example by exploring how to <p>The <em>Announce</em> example builds upon the previous example by exploring how to announce a destination on the network, and how to let your program receive notifications about announces from relevant destinations.</p>
announce a destination on the network, and how to let your program receive
notifications about announces from relevant destinations.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1">##########################################################</span> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1">##########################################################</span>
<span class="c1"># This RNS example demonstrates setting up announce #</span> <span class="c1"># This RNS example demonstrates setting up announce #</span>
<span class="c1"># callbacks, which will let an application receive a #</span> <span class="c1"># callbacks, which will let an application receive a #</span>
@@ -561,8 +555,7 @@ notifications about announces from relevant destinations.</p>
</section> </section>
<section id="broadcast"> <section id="broadcast">
<span id="example-broadcast"></span><h2>Broadcast<a class="headerlink" href="#broadcast" title="Link to this heading"></a></h2> <span id="example-broadcast"></span><h2>Broadcast<a class="headerlink" href="#broadcast" title="Link to this heading"></a></h2>
<p>The <em>Broadcast</em> example explores how to transmit plaintext broadcast messages <p>The <em>Broadcast</em> example explores how to transmit plaintext broadcast messages over the network.</p>
over the network.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1">##########################################################</span> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1">##########################################################</span>
<span class="c1"># This RNS example demonstrates broadcasting unencrypted #</span> <span class="c1"># This RNS example demonstrates broadcasting unencrypted #</span>
<span class="c1"># information to any listening destinations. #</span> <span class="c1"># information to any listening destinations. #</span>
@@ -690,8 +683,7 @@ over the network.</p>
</section> </section>
<section id="echo"> <section id="echo">
<span id="example-echo"></span><h2>Echo<a class="headerlink" href="#echo" title="Link to this heading"></a></h2> <span id="example-echo"></span><h2>Echo<a class="headerlink" href="#echo" title="Link to this heading"></a></h2>
<p>The <em>Echo</em> example demonstrates communication between two destinations using <p>The <em>Echo</em> example demonstrates communication between two destinations using the Packet interface.</p>
the Packet interface.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1">##########################################################</span> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1">##########################################################</span>
<span class="c1"># This RNS example demonstrates a simple client/server #</span> <span class="c1"># This RNS example demonstrates a simple client/server #</span>
<span class="c1"># echo utility. A client can send an echo request to the #</span> <span class="c1"># echo utility. A client can send an echo request to the #</span>
@@ -1030,8 +1022,7 @@ the Packet interface.</p>
</section> </section>
<section id="link"> <section id="link">
<span id="example-link"></span><h2>Link<a class="headerlink" href="#link" title="Link to this heading"></a></h2> <span id="example-link"></span><h2>Link<a class="headerlink" href="#link" title="Link to this heading"></a></h2>
<p>The <em>Link</em> example explores establishing an encrypted link to a remote <p>The <em>Link</em> example explores establishing an encrypted link to a remote destination, and passing traffic back and forth over the link.</p>
destination, and passing traffic back and forth over the link.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1">##########################################################</span> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1">##########################################################</span>
<span class="c1"># This RNS example demonstrates how to set up a link to #</span> <span class="c1"># This RNS example demonstrates how to set up a link to #</span>
<span class="c1"># a destination, and pass data back and forth over it. #</span> <span class="c1"># a destination, and pass data back and forth over it. #</span>
@@ -1328,8 +1319,7 @@ destination, and passing traffic back and forth over the link.</p>
</section> </section>
<section id="example-identify"> <section id="example-identify">
<span id="identification"></span><h2>Identification<a class="headerlink" href="#example-identify" title="Link to this heading"></a></h2> <span id="identification"></span><h2>Identification<a class="headerlink" href="#example-identify" title="Link to this heading"></a></h2>
<p>The <em>Identify</em> example explores identifying an intiator of a link, once <p>The <em>Identify</em> example explores identifying an intiator of a link, once the link has been established.</p>
the link has been established.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1">##########################################################</span> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1">##########################################################</span>
<span class="c1"># This RNS example demonstrates how to set up a link to #</span> <span class="c1"># This RNS example demonstrates how to set up a link to #</span>
<span class="c1"># a destination, and identify the initiator to it&#39;s peer #</span> <span class="c1"># a destination, and identify the initiator to it&#39;s peer #</span>
@@ -1942,8 +1932,7 @@ the link has been established.</p>
</section> </section>
<section id="channel"> <section id="channel">
<span id="example-channel"></span><h2>Channel<a class="headerlink" href="#channel" title="Link to this heading"></a></h2> <span id="example-channel"></span><h2>Channel<a class="headerlink" href="#channel" title="Link to this heading"></a></h2>
<p>The <em>Channel</em> example explores using a <code class="docutils literal notranslate"><span class="pre">Channel</span></code> to send structured <p>The <em>Channel</em> example explores using a <code class="docutils literal notranslate"><span class="pre">Channel</span></code> to send structured data between peers of a <code class="docutils literal notranslate"><span class="pre">Link</span></code>.</p>
data between peers of a <code class="docutils literal notranslate"><span class="pre">Link</span></code>.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1">##########################################################</span> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1">##########################################################</span>
<span class="c1"># This RNS example demonstrates how to set up a link to #</span> <span class="c1"># This RNS example demonstrates how to set up a link to #</span>
<span class="c1"># a destination, and pass structured messages over it #</span> <span class="c1"># a destination, and pass structured messages over it #</span>
@@ -2339,8 +2328,7 @@ data between peers of a <code class="docutils literal notranslate"><span class="
</section> </section>
<section id="buffer"> <section id="buffer">
<h2>Buffer<a class="headerlink" href="#buffer" title="Link to this heading"></a></h2> <h2>Buffer<a class="headerlink" href="#buffer" title="Link to this heading"></a></h2>
<p>The <em>Buffer</em> example explores using buffered readers and writers to send <p>The <em>Buffer</em> example explores using buffered readers and writers to send binary data between peers of a <code class="docutils literal notranslate"><span class="pre">Link</span></code>.</p>
binary data between peers of a <code class="docutils literal notranslate"><span class="pre">Link</span></code>.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1">##########################################################</span> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1">##########################################################</span>
<span class="c1"># This RNS example demonstrates how to set up a link to #</span> <span class="c1"># This RNS example demonstrates how to set up a link to #</span>
<span class="c1"># a destination, and pass binary data over it using a #</span> <span class="c1"># a destination, and pass binary data over it using a #</span>
@@ -2669,9 +2657,7 @@ binary data between peers of a <code class="docutils literal notranslate"><span
</section> </section>
<section id="filetransfer"> <section id="filetransfer">
<span id="example-filetransfer"></span><h2>Filetransfer<a class="headerlink" href="#filetransfer" title="Link to this heading"></a></h2> <span id="example-filetransfer"></span><h2>Filetransfer<a class="headerlink" href="#filetransfer" title="Link to this heading"></a></h2>
<p>The <em>Filetransfer</em> example implements a basic file-server program that <p>The <em>Filetransfer</em> example implements a basic file-server program that allow clients to connect and download files. The program uses the Resource interface to efficiently pass files of any size over a Reticulum <a class="reference internal" href="reference.html#api-link"><span class="std std-ref">Link</span></a>.</p>
allow clients to connect and download files. The program uses the Resource
interface to efficiently pass files of any size over a Reticulum <a class="reference internal" href="reference.html#api-link"><span class="std std-ref">Link</span></a>.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1">##########################################################</span> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1">##########################################################</span>
<span class="c1"># This RNS example demonstrates a simple filetransfer #</span> <span class="c1"># This RNS example demonstrates a simple filetransfer #</span>
<span class="c1"># server and client program. The server will serve a #</span> <span class="c1"># server and client program. The server will serve a #</span>
@@ -3281,10 +3267,7 @@ interface to efficiently pass files of any size over a Reticulum <a class="refer
</section> </section>
<section id="custom-interfaces"> <section id="custom-interfaces">
<span id="example-custominterface"></span><h2>Custom Interfaces<a class="headerlink" href="#custom-interfaces" title="Link to this heading"></a></h2> <span id="example-custominterface"></span><h2>Custom Interfaces<a class="headerlink" href="#custom-interfaces" title="Link to this heading"></a></h2>
<p>The <em>ExampleInterface</em> demonstrates creating custom interfaces for Reticulum. <p>The <em>ExampleInterface</em> demonstrates creating custom interfaces for Reticulum. Any number of custom interfaces can be loaded and utilised by Reticulum, and will be fully on-par with natively included interfaces, including all supported <a class="reference internal" href="interfaces.html#interfaces-modes"><span class="std std-ref">interface modes</span></a> and <a class="reference internal" href="interfaces.html#interfaces-options"><span class="std std-ref">common configuration options</span></a>.</p>
Any number of custom interfaces can be loaded and utilised by Reticulum, and
will be fully on-par with natively included interfaces, including all supported
<a class="reference internal" href="interfaces.html#interfaces-modes"><span class="std std-ref">interface modes</span></a> and <a class="reference internal" href="interfaces.html#interfaces-options"><span class="std std-ref">common configuration options</span></a>.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># This example illustrates creating a custom interface</span> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># This example illustrates creating a custom interface</span>
<span class="c1"># definition, that can be loaded and used by Reticulum at</span> <span class="c1"># definition, that can be loaded and used by Reticulum at</span>
<span class="c1"># runtime. Any number of custom interfaces can be created</span> <span class="c1"># runtime. Any number of custom interfaces can be created</span>
@@ -3665,7 +3648,7 @@ will be fully on-par with natively included interfaces, including all supported
</aside> </aside>
</div> </div>
</div><script src="_static/documentation_options.js?v=bb516dca"></script> </div><script src="_static/documentation_options.js?v=98c25ec5"></script>
<script src="_static/doctools.js?v=9bcbadda"></script> <script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script> <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script> <script src="_static/scripts/furo.js?v=46bd48cc"></script>
+5 -5
View File
@@ -7,12 +7,12 @@
<link rel="prefetch" href="_static/rns_logo_512.png" as="image"> <link rel="prefetch" href="_static/rns_logo_512.png" as="image">
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 --> <!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 -->
<title>An Explanation of Reticulum for Human Beings - Reticulum Network Stack 1.3.1 documentation</title> <title>An Explanation of Reticulum for Human Beings - Reticulum Network Stack 1.3.9 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" /> <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" />
<link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" /> <link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" />
<link rel="stylesheet" type="text/css" href="_static/custom.css?v=bb3cebc5" /> <link rel="stylesheet" type="text/css" href="_static/custom.css?v=e1715074" />
@@ -180,7 +180,7 @@
</label> </label>
</div> </div>
<div class="header-center"> <div class="header-center">
<a href="index.html"><div class="brand">Reticulum Network Stack 1.3.1 documentation</div></a> <a href="index.html"><div class="brand">Reticulum Network Stack 1.3.9 documentation</div></a>
</div> </div>
<div class="header-right"> <div class="header-right">
<div class="theme-toggle-container theme-toggle-header"> <div class="theme-toggle-container theme-toggle-header">
@@ -204,7 +204,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/> <img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div> </div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.3.1 documentation</span> <span class="sidebar-brand-text">Reticulum Network Stack 1.3.9 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search"> </a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search"> <input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -296,7 +296,7 @@
</aside> </aside>
</div> </div>
</div><script src="_static/documentation_options.js?v=bb516dca"></script> </div><script src="_static/documentation_options.js?v=98c25ec5"></script>
<script src="_static/doctools.js?v=9bcbadda"></script> <script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script> <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script> <script src="_static/scripts/furo.js?v=46bd48cc"></script>
+5 -5
View File
@@ -5,12 +5,12 @@
<meta name="color-scheme" content="light dark"><link rel="index" title="Index" href="#"><link rel="search" title="Search" href="search.html"> <meta name="color-scheme" content="light dark"><link rel="index" title="Index" href="#"><link rel="search" title="Search" href="search.html">
<link rel="prefetch" href="_static/rns_logo_512.png" as="image"> <link rel="prefetch" href="_static/rns_logo_512.png" as="image">
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 --><title>Index - Reticulum Network Stack 1.3.1 documentation</title> <!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 --><title>Index - Reticulum Network Stack 1.3.9 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" /> <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" />
<link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" /> <link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" />
<link rel="stylesheet" type="text/css" href="_static/custom.css?v=bb3cebc5" /> <link rel="stylesheet" type="text/css" href="_static/custom.css?v=e1715074" />
@@ -178,7 +178,7 @@
</label> </label>
</div> </div>
<div class="header-center"> <div class="header-center">
<a href="index.html"><div class="brand">Reticulum Network Stack 1.3.1 documentation</div></a> <a href="index.html"><div class="brand">Reticulum Network Stack 1.3.9 documentation</div></a>
</div> </div>
<div class="header-right"> <div class="header-right">
<div class="theme-toggle-container theme-toggle-header"> <div class="theme-toggle-container theme-toggle-header">
@@ -202,7 +202,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/> <img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div> </div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.3.1 documentation</span> <span class="sidebar-brand-text">Reticulum Network Stack 1.3.9 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search"> </a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search"> <input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -846,7 +846,7 @@
</aside> </aside>
</div> </div>
</div><script src="_static/documentation_options.js?v=bb516dca"></script> </div><script src="_static/documentation_options.js?v=98c25ec5"></script>
<script src="_static/doctools.js?v=9bcbadda"></script> <script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script> <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script> <script src="_static/scripts/furo.js?v=46bd48cc"></script>
+86 -278
View File
@@ -7,12 +7,12 @@
<link rel="prefetch" href="_static/rns_logo_512.png" as="image"> <link rel="prefetch" href="_static/rns_logo_512.png" as="image">
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 --> <!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 -->
<title>Getting Started Fast - Reticulum Network Stack 1.3.1 documentation</title> <title>Getting Started Fast - Reticulum Network Stack 1.3.9 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" /> <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" />
<link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" /> <link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" />
<link rel="stylesheet" type="text/css" href="_static/custom.css?v=bb3cebc5" /> <link rel="stylesheet" type="text/css" href="_static/custom.css?v=e1715074" />
@@ -180,7 +180,7 @@
</label> </label>
</div> </div>
<div class="header-center"> <div class="header-center">
<a href="index.html"><div class="brand">Reticulum Network Stack 1.3.1 documentation</div></a> <a href="index.html"><div class="brand">Reticulum Network Stack 1.3.9 documentation</div></a>
</div> </div>
<div class="header-right"> <div class="header-right">
<div class="theme-toggle-container theme-toggle-header"> <div class="theme-toggle-container theme-toggle-header">
@@ -204,7 +204,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/> <img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div> </div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.3.1 documentation</span> <span class="sidebar-brand-text">Reticulum Network Stack 1.3.9 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search"> </a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search"> <input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -264,40 +264,27 @@
<article role="main" id="furo-main-content"> <article role="main" id="furo-main-content">
<section id="getting-started-fast"> <section id="getting-started-fast">
<h1>Getting Started Fast<a class="headerlink" href="#getting-started-fast" title="Link to this heading"></a></h1> <h1>Getting Started Fast<a class="headerlink" href="#getting-started-fast" title="Link to this heading"></a></h1>
<p>The best way to get started with the Reticulum Network Stack depends on what <p>The best way to get started with the Reticulum Network Stack depends on what you want to do. This guide will outline sensible starting paths for different scenarios.</p>
you want to do. This guide will outline sensible starting paths for different
scenarios.</p>
<section id="standalone-reticulum-installation"> <section id="standalone-reticulum-installation">
<h2>Standalone Reticulum Installation<a class="headerlink" href="#standalone-reticulum-installation" title="Link to this heading"></a></h2> <h2>Standalone Reticulum Installation<a class="headerlink" href="#standalone-reticulum-installation" title="Link to this heading"></a></h2>
<p>If you simply want to install Reticulum and related utilities on a system, <p>If you simply want to install Reticulum and related utilities on a system, the easiest way is via the <code class="docutils literal notranslate"><span class="pre">pip</span></code> package manager:</p>
the easiest way is via the <code class="docutils literal notranslate"><span class="pre">pip</span></code> package manager:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>pip<span class="w"> </span>install<span class="w"> </span>rns <div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>pip<span class="w"> </span>install<span class="w"> </span>rns
</pre></div> </pre></div>
</div> </div>
<p>If you do not already have pip installed, you can install it using the package manager <p>If you do not already have pip installed, you can install it using the package manager of your system with a command like <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">apt</span> <span class="pre">install</span> <span class="pre">python3-pip</span></code>, <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">pamac</span> <span class="pre">install</span> <span class="pre">python-pip</span></code> or similar.</p>
of your system with a command like <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">apt</span> <span class="pre">install</span> <span class="pre">python3-pip</span></code>, <p>You can also dowload the Reticulum release wheels from GitHub, or other release channels, and install them offline using <code class="docutils literal notranslate"><span class="pre">pip</span></code>:</p>
<code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">pamac</span> <span class="pre">install</span> <span class="pre">python-pip</span></code> or similar.</p>
<p>You can also dowload the Reticulum release wheels from GitHub, or other release channels,
and install them offline using <code class="docutils literal notranslate"><span class="pre">pip</span></code>:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>pip<span class="w"> </span>install<span class="w"> </span>./rns-1.1.2-py3-none-any.whl <div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>pip<span class="w"> </span>install<span class="w"> </span>./rns-1.1.2-py3-none-any.whl
</pre></div> </pre></div>
</div> </div>
<p>On platforms that limit user package installation via <code class="docutils literal notranslate"><span class="pre">pip</span></code>, you may need to manually <p>On platforms that limit user package installation via <code class="docutils literal notranslate"><span class="pre">pip</span></code>, you may need to manually allow this using the <code class="docutils literal notranslate"><span class="pre">--break-system-packages</span></code> command line flag when installing. This will not actually break any packages, unless you have installed Reticulum directly via your operating system’s package manager.</p>
allow this using the <code class="docutils literal notranslate"><span class="pre">--break-system-packages</span></code> command line flag when installing. This
will not actually break any packages, unless you have installed Reticulum directly via
your operating system’s package manager.</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>pip<span class="w"> </span>install<span class="w"> </span>rns<span class="w"> </span>--break-system-packages <div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>pip<span class="w"> </span>install<span class="w"> </span>rns<span class="w"> </span>--break-system-packages
</pre></div> </pre></div>
</div> </div>
<p>For more detailed installation instructions, please see the <p>For more detailed installation instructions, please see the <a class="reference internal" href="#install-guides"><span class="std std-ref">Platform-Specific Install Notes</span></a> section.</p>
<a class="reference internal" href="#install-guides"><span class="std std-ref">Platform-Specific Install Notes</span></a> section.</p> <p>After installation is complete, it might be helpful to refer to the <a class="reference internal" href="using.html#using-main"><span class="std std-ref">Using Reticulum on Your System</span></a> chapter.</p>
<p>After installation is complete, it might be helpful to refer to the
<a class="reference internal" href="using.html#using-main"><span class="std std-ref">Using Reticulum on Your System</span></a> chapter.</p>
<section id="resolving-dependency-installation-issues"> <section id="resolving-dependency-installation-issues">
<h3>Resolving Dependency &amp; Installation Issues<a class="headerlink" href="#resolving-dependency-installation-issues" title="Link to this heading"></a></h3> <h3>Resolving Dependency &amp; Installation Issues<a class="headerlink" href="#resolving-dependency-installation-issues" title="Link to this heading"></a></h3>
<p>On some platforms, there may not be binary packages available for all dependencies, and <p>On some platforms, there may not be binary packages available for all dependencies, and <code class="docutils literal notranslate"><span class="pre">pip</span></code> installation may fail with an error message. In these cases, the issue can usually be resolved by installing the development essentials packages for your platform:</p>
<code class="docutils literal notranslate"><span class="pre">pip</span></code> installation may fail with an error message. In these cases, the issue can usually
be resolved by installing the development essentials packages for your platform:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span class="c1"># Debian / Ubuntu / Derivatives</span> <div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span class="c1"># Debian / Ubuntu / Derivatives</span>
sudo<span class="w"> </span>apt<span class="w"> </span>install<span class="w"> </span>build-essential sudo<span class="w"> </span>apt<span class="w"> </span>install<span class="w"> </span>build-essential
@@ -308,59 +295,28 @@ sudo<span class="w"> </span>pamac<span class="w"> </span>install<span class="w">
sudo<span class="w"> </span>dnf<span class="w"> </span>groupinstall<span class="w"> </span><span class="s2">&quot;Development Tools&quot;</span><span class="w"> </span><span class="s2">&quot;Development Libraries&quot;</span> sudo<span class="w"> </span>dnf<span class="w"> </span>groupinstall<span class="w"> </span><span class="s2">&quot;Development Tools&quot;</span><span class="w"> </span><span class="s2">&quot;Development Libraries&quot;</span>
</pre></div> </pre></div>
</div> </div>
<p>With the base development packages installed, <code class="docutils literal notranslate"><span class="pre">pip</span></code> should be able to compile any missing <p>With the base development packages installed, <code class="docutils literal notranslate"><span class="pre">pip</span></code> should be able to compile any missing dependencies from source, and complete installation even on platforms that don’t have pre-compiled packages available.</p>
dependencies from source, and complete installation even on platforms that don’t have pre-
compiled packages available.</p>
</section> </section>
</section> </section>
<section id="try-using-a-reticulum-based-program"> <section id="try-using-a-reticulum-based-program">
<h2>Try Using a Reticulum-based Program<a class="headerlink" href="#try-using-a-reticulum-based-program" title="Link to this heading"></a></h2> <h2>Try Using a Reticulum-based Program<a class="headerlink" href="#try-using-a-reticulum-based-program" title="Link to this heading"></a></h2>
<p>If you simply want to try using a program built with Reticulum, a <a class="reference internal" href="software.html#software-main"><span class="std std-ref">range of different <p>If you simply want to try using a program built with Reticulum, a <a class="reference internal" href="software.html#software-main"><span class="std std-ref">range of different programs</span></a> exist that allow basic communication and a various other useful functions, even over extremely low-bandwidth Reticulum networks.</p>
programs</span></a> exist that allow basic communication and a various other useful functions,
even over extremely low-bandwidth Reticulum networks.</p>
</section> </section>
<section id="using-the-included-utilities"> <section id="using-the-included-utilities">
<h2>Using the Included Utilities<a class="headerlink" href="#using-the-included-utilities" title="Link to this heading"></a></h2> <h2>Using the Included Utilities<a class="headerlink" href="#using-the-included-utilities" title="Link to this heading"></a></h2>
<p>Reticulum comes with a range of included utilities that make it easier to <p>Reticulum comes with a range of included utilities that make it easier to manage your network, check connectivity and make Reticulum available to other programs on your system.</p>
manage your network, check connectivity and make Reticulum available to other <p>You can use <code class="docutils literal notranslate"><span class="pre">rnsd</span></code> to run Reticulum as a background or foreground service, and the <code class="docutils literal notranslate"><span class="pre">rnstatus</span></code>, <code class="docutils literal notranslate"><span class="pre">rnpath</span></code> and <code class="docutils literal notranslate"><span class="pre">rnprobe</span></code> utilities to view and query network status and connectivity.</p>
programs on your system.</p> <p>To learn more about these utility programs, have a look at the <a class="reference internal" href="using.html#using-main"><span class="std std-ref">Using Reticulum on Your System</span></a> chapter of this manual.</p>
<p>You can use <code class="docutils literal notranslate"><span class="pre">rnsd</span></code> to run Reticulum as a background or foreground service,
and the <code class="docutils literal notranslate"><span class="pre">rnstatus</span></code>, <code class="docutils literal notranslate"><span class="pre">rnpath</span></code> and <code class="docutils literal notranslate"><span class="pre">rnprobe</span></code> utilities to view and query
network status and connectivity.</p>
<p>To learn more about these utility programs, have a look at the
<a class="reference internal" href="using.html#using-main"><span class="std std-ref">Using Reticulum on Your System</span></a> chapter of this manual.</p>
</section> </section>
<section id="creating-a-network-with-reticulum"> <section id="creating-a-network-with-reticulum">
<h2>Creating a Network With Reticulum<a class="headerlink" href="#creating-a-network-with-reticulum" title="Link to this heading"></a></h2> <h2>Creating a Network With Reticulum<a class="headerlink" href="#creating-a-network-with-reticulum" title="Link to this heading"></a></h2>
<p>To create a network, you will need to specify one or more <em>interfaces</em> for <p>To create a network, you will need to specify one or more <em>interfaces</em> for Reticulum to use. This is done in the Reticulum configuration file, which by default is located at <code class="docutils literal notranslate"><span class="pre">~/.reticulum/config</span></code>. You can get an example configuration file with all options via <code class="docutils literal notranslate"><span class="pre">rnsd</span> <span class="pre">--exampleconfig</span></code>.</p>
Reticulum to use. This is done in the Reticulum configuration file, which by <p>When Reticulum is started for the first time, it will create a default configuration file, with one active interface. This default interface uses your existing Ethernet and WiFi networks (if any), and only allows you to communicate with other Reticulum peers within your local broadcast domains.</p>
default is located at <code class="docutils literal notranslate"><span class="pre">~/.reticulum/config</span></code>. You can get an example <p>To communicate further, you will have to add one or more interfaces. The default configuration includes a number of examples, ranging from using TCP over the internet, to LoRa and Packet Radio interfaces.</p>
configuration file with all options via <code class="docutils literal notranslate"><span class="pre">rnsd</span> <span class="pre">--exampleconfig</span></code>.</p> <p>With Reticulum, you only need to configure what interfaces you want to communicate over. There is no need to configure address spaces, subnets, routing tables, or other things you might be used to from other network types.</p>
<p>When Reticulum is started for the first time, it will create a default <p>Once Reticulum knows which interfaces it should use, it will automatically discover topography and configure transport of data to any destinations it knows about.</p>
configuration file, with one active interface. This default interface uses <p>In situations where you already have an established WiFi or Ethernet network, and many devices that want to utilise the same external Reticulum network paths (for example over LoRa), it will often be sufficient to let one system act as a Reticulum gateway, by adding any external interfaces to the configuration of this system, and then enabling transport on it. Any other device on your local WiFi will then be able to connect to this wider Reticulum network just using the default (<a class="reference internal" href="interfaces.html#interfaces-auto"><span class="std std-ref">AutoInterface</span></a>) configuration.</p>
your existing Ethernet and WiFi networks (if any), and only allows you to <p>Possibly, the examples in the config file are enough to get you started. If you want more information, you can read the <a class="reference internal" href="networks.html#networks-main"><span class="std std-ref">Building Networks</span></a> and <a class="reference internal" href="interfaces.html#interfaces-main"><span class="std std-ref">Interfaces</span></a> chapters of this manual, but most importantly, start with reading the next section, <a class="reference internal" href="#bootstrapping-connectivity"><span class="std std-ref">Bootstrapping Connectivity</span></a>, as this provides the most essential understanding of how to ensure reliable connectivity with a minimum of maintenance.</p>
communicate with other Reticulum peers within your local broadcast domains.</p>
<p>To communicate further, you will have to add one or more interfaces. The default
configuration includes a number of examples, ranging from using TCP over the
internet, to LoRa and Packet Radio interfaces.</p>
<p>With Reticulum, you only need to configure what interfaces you want to communicate
over. There is no need to configure address spaces, subnets, routing tables,
or other things you might be used to from other network types.</p>
<p>Once Reticulum knows which interfaces it should use, it will automatically
discover topography and configure transport of data to any destinations it
knows about.</p>
<p>In situations where you already have an established WiFi or Ethernet network, and
many devices that want to utilise the same external Reticulum network paths (for example over
LoRa), it will often be sufficient to let one system act as a Reticulum gateway, by
adding any external interfaces to the configuration of this system, and then enabling transport on it. Any
other device on your local WiFi will then be able to connect to this wider Reticulum
network just using the default (<a class="reference internal" href="interfaces.html#interfaces-auto"><span class="std std-ref">AutoInterface</span></a>) configuration.</p>
<p>Possibly, the examples in the config file are enough to get you started. If
you want more information, you can read the <a class="reference internal" href="networks.html#networks-main"><span class="std std-ref">Building Networks</span></a>
and <a class="reference internal" href="interfaces.html#interfaces-main"><span class="std std-ref">Interfaces</span></a> chapters of this manual, but most importantly,
start with reading the next section, <a class="reference internal" href="#bootstrapping-connectivity"><span class="std std-ref">Bootstrapping Connectivity</span></a>,
as this provides the most essential understanding of how to ensure reliable
connectivity with a minimum of maintenance.</p>
</section> </section>
<section id="bootstrapping-connectivity"> <section id="bootstrapping-connectivity">
<span id="id1"></span><h2>Bootstrapping Connectivity<a class="headerlink" href="#bootstrapping-connectivity" title="Link to this heading"></a></h2> <span id="id1"></span><h2>Bootstrapping Connectivity<a class="headerlink" href="#bootstrapping-connectivity" title="Link to this heading"></a></h2>
@@ -425,17 +381,10 @@ connectivity with a minimum of maintenance.</p>
</section> </section>
<section id="hosting-public-entrypoints"> <section id="hosting-public-entrypoints">
<span id="hosting-entrypoints"></span><h2>Hosting Public Entrypoints<a class="headerlink" href="#hosting-public-entrypoints" title="Link to this heading"></a></h2> <span id="hosting-entrypoints"></span><h2>Hosting Public Entrypoints<a class="headerlink" href="#hosting-public-entrypoints" title="Link to this heading"></a></h2>
<p>If you want to help build a strong global interconnection backbone, you can host a public (or private) entry-point to a Reticulum network over the <p>If you want to help build a strong global interconnection backbone, you can host a public (or private) entry-point to a Reticulum network over the Internet. This section offers some helpful pointers. Once you have set up your public entrypoint, it is a great idea to <a class="reference internal" href="interfaces.html#interfaces-discoverable"><span class="std std-ref">make it discoverable over Reticulum</span></a>.</p>
Internet. This section offers some helpful pointers. Once you have set up your public entrypoint, it is a great idea to <a class="reference internal" href="interfaces.html#interfaces-discoverable"><span class="std std-ref">make it discoverable over Reticulum</span></a>.</p>
<p>You will need a machine, physical or virtual with a public IP address, that can be reached by other devices on the Internet.</p> <p>You will need a machine, physical or virtual with a public IP address, that can be reached by other devices on the Internet.</p>
<p>The most efficient and performant way to host a connectable entry-point supporting many <p>The most efficient and performant way to host a connectable entry-point supporting many users is to use the <code class="docutils literal notranslate"><span class="pre">BackboneInterface</span></code>. This interface type is fully compatible with the <code class="docutils literal notranslate"><span class="pre">TCPClientInterface</span></code> and <code class="docutils literal notranslate"><span class="pre">TCPServerInterface</span></code> types, but much faster and uses less system resources, allowing your device to handle thousands of connections even on small systems.</p>
users is to use the <code class="docutils literal notranslate"><span class="pre">BackboneInterface</span></code>. This interface type is fully compatible with <p>It is also important to set your connectable interface to <code class="docutils literal notranslate"><span class="pre">gateway</span></code> mode, since this will greatly improve network convergence time and path resolution for anyone connecting to your entry-point.</p>
the <code class="docutils literal notranslate"><span class="pre">TCPClientInterface</span></code> and <code class="docutils literal notranslate"><span class="pre">TCPServerInterface</span></code> types, but much faster and uses
less system resources, allowing your device to handle thousands of connections even on
small systems.</p>
<p>It is also important to set your connectable interface to <code class="docutils literal notranslate"><span class="pre">gateway</span></code> mode, since this
will greatly improve network convergence time and path resolution for anyone connecting
to your entry-point.</p>
<div class="highlight-ini notranslate"><div class="highlight"><pre><span></span><span class="c1"># This example demonstrates a backbone interface</span> <div class="highlight-ini notranslate"><div class="highlight"><pre><span></span><span class="c1"># This example demonstrates a backbone interface</span>
<span class="c1"># configured for acting as a gateway for users to</span> <span class="c1"># configured for acting as a gateway for users to</span>
<span class="c1"># connect to either a public or private network</span> <span class="c1"># connect to either a public or private network</span>
@@ -455,8 +404,7 @@ to your entry-point.</p>
<span class="w"> </span><span class="na">announce_rate_grace</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">6</span> <span class="w"> </span><span class="na">announce_rate_grace</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">6</span>
</pre></div> </pre></div>
</div> </div>
<p>If instead you want to make a private entry-point from the Internet, you can use the <p>If instead you want to make a private entry-point from the Internet, you can use the <a class="reference internal" href="interfaces.html#interfaces-options"><span class="std std-ref">IFAC name and passphrase options</span></a> to secure your interface with a network name and passphrase.</p>
<a class="reference internal" href="interfaces.html#interfaces-options"><span class="std std-ref">IFAC name and passphrase options</span></a> to secure your interface with a network name and passphrase.</p>
<div class="highlight-ini notranslate"><div class="highlight"><pre><span></span><span class="c1"># A private entry-point requiring a pre-shared</span> <div class="highlight-ini notranslate"><div class="highlight"><pre><span></span><span class="c1"># A private entry-point requiring a pre-shared</span>
<span class="c1"># network name and passphrase to connect to.</span> <span class="c1"># network name and passphrase to connect to.</span>
@@ -470,104 +418,51 @@ to your entry-point.</p>
<span class="w"> </span><span class="na">passphrase</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">2owjajquafIanPecAc</span> <span class="w"> </span><span class="na">passphrase</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">2owjajquafIanPecAc</span>
</pre></div> </pre></div>
</div> </div>
<p>If you are hosting an entry-point on an operating system that does not support <p>If you are hosting an entry-point on an operating system that does not support <code class="docutils literal notranslate"><span class="pre">BackboneInterface</span></code>, you can use <code class="docutils literal notranslate"><span class="pre">TCPServerInterface</span></code> instead, although it will not be as performant.</p>
<code class="docutils literal notranslate"><span class="pre">BackboneInterface</span></code>, you can use <code class="docutils literal notranslate"><span class="pre">TCPServerInterface</span></code> instead, although it will
not be as performant.</p>
</section> </section>
<section id="connecting-reticulum-instances-over-the-internet"> <section id="connecting-reticulum-instances-over-the-internet">
<h2>Connecting Reticulum Instances Over the Internet<a class="headerlink" href="#connecting-reticulum-instances-over-the-internet" title="Link to this heading"></a></h2> <h2>Connecting Reticulum Instances Over the Internet<a class="headerlink" href="#connecting-reticulum-instances-over-the-internet" title="Link to this heading"></a></h2>
<p>Reticulum currently offers three interfaces suitable for connecting instances over the Internet: <a class="reference internal" href="interfaces.html#interfaces-backbone"><span class="std std-ref">Backbone</span></a>, <a class="reference internal" href="interfaces.html#interfaces-tcps"><span class="std std-ref">TCP</span></a> <p>Reticulum currently offers three interfaces suitable for connecting instances over the Internet: <a class="reference internal" href="interfaces.html#interfaces-backbone"><span class="std std-ref">Backbone</span></a>, <a class="reference internal" href="interfaces.html#interfaces-tcps"><span class="std std-ref">TCP</span></a> and <a class="reference internal" href="interfaces.html#interfaces-i2p"><span class="std std-ref">I2P</span></a>. Each interface offers a different set of features, and Reticulum users should carefully choose the interface which best suites their needs.</p>
and <a class="reference internal" href="interfaces.html#interfaces-i2p"><span class="std std-ref">I2P</span></a>. Each interface offers a different set of features, and Reticulum <p>The <code class="docutils literal notranslate"><span class="pre">TCPServerInterface</span></code> allows users to host an instance accessible over TCP/IP. This method is generally faster, lower latency, and more energy efficient than using <code class="docutils literal notranslate"><span class="pre">I2PInterface</span></code>, however it also leaks more data about the server host.</p>
users should carefully choose the interface which best suites their needs.</p> <p>The <code class="docutils literal notranslate"><span class="pre">BackboneInterface</span></code> is a very fast and efficient interface type available on POSIX operating systems, designed to handle thousands of connections simultaneously with low memory, processing and I/O overhead. It is fully compatible with the TCP-based interface types.</p>
<p>The <code class="docutils literal notranslate"><span class="pre">TCPServerInterface</span></code> allows users to host an instance accessible over TCP/IP. This <p>TCP connections reveal the IP address of both your instance and the server to anyone who can inspect the connection. Someone could use this information to determine your location or identity. Adversaries inspecting your packets may be able to record packet metadata like time of transmission and packet size. Even though Reticulum encrypts traffic, TCP does not, so an adversary may be able to use packet inspection to learn that a system is running Reticulum, and what other IP addresses connect to it. Hosting a publicly reachable instance over TCP also requires a publicly reachable IP address, which most Internet connections don’t offer anymore.</p>
method is generally faster, lower latency, and more energy efficient than using <code class="docutils literal notranslate"><span class="pre">I2PInterface</span></code>, <p>The <code class="docutils literal notranslate"><span class="pre">I2PInterface</span></code> routes messages through the <a class="reference external" href="https://geti2p.net/en/">Invisible Internet Protocol (I2P)</a>. To use this interface, users must also run an I2P daemon in parallel to <code class="docutils literal notranslate"><span class="pre">rnsd</span></code>. For always-on I2P nodes it is recommended to use <a class="reference external" href="https://i2pd.website/">i2pd</a>.</p>
however it also leaks more data about the server host.</p> <p>By default, I2P will encrypt and mix all traffic sent over the Internet, and hide both the sender and receiver Reticulum instance IP addresses. Running an I2P node will also relay other I2P user’s encrypted packets, which will use extra bandwidth and compute power, but also makes timing attacks and other forms of deep-packet-inspection much more difficult.</p>
<p>The <code class="docutils literal notranslate"><span class="pre">BackboneInterface</span></code> is a very fast and efficient interface type available on POSIX operating
systems, designed to handle thousands of connections simultaneously with low memory, processing
and I/O overhead. It is fully compatible with the TCP-based interface types.</p>
<p>TCP connections reveal the IP address of both your instance and the server to anyone who can
inspect the connection. Someone could use this information to determine your location or identity. Adversaries
inspecting your packets may be able to record packet metadata like time of transmission and packet size.
Even though Reticulum encrypts traffic, TCP does not, so an adversary may be able to use
packet inspection to learn that a system is running Reticulum, and what other IP addresses connect to it.
Hosting a publicly reachable instance over TCP also requires a publicly reachable IP address,
which most Internet connections don’t offer anymore.</p>
<p>The <code class="docutils literal notranslate"><span class="pre">I2PInterface</span></code> routes messages through the <a class="reference external" href="https://geti2p.net/en/">Invisible Internet Protocol
(I2P)</a>. To use this interface, users must also run an I2P daemon in
parallel to <code class="docutils literal notranslate"><span class="pre">rnsd</span></code>. For always-on I2P nodes it is recommended to use <a class="reference external" href="https://i2pd.website/">i2pd</a>.</p>
<p>By default, I2P will encrypt and mix all traffic sent over the Internet, and
hide both the sender and receiver Reticulum instance IP addresses. Running an I2P node
will also relay other I2P user’s encrypted packets, which will use extra
bandwidth and compute power, but also makes timing attacks and other forms of
deep-packet-inspection much more difficult.</p>
<p>I2P also allows users to host globally available Reticulum instances from non-public IP’s and behind firewalls and NAT.</p> <p>I2P also allows users to host globally available Reticulum instances from non-public IP’s and behind firewalls and NAT.</p>
<p>In general it is recommended to use an I2P node if you want to host a publicly accessible <p>In general it is recommended to use an I2P node if you want to host a publicly accessible instance, while preserving anonymity. If you care more about performance, and a slightly easier setup, use TCP.</p>
instance, while preserving anonymity. If you care more about performance, and a slightly
easier setup, use TCP.</p>
</section> </section>
<section id="adding-radio-interfaces"> <section id="adding-radio-interfaces">
<h2>Adding Radio Interfaces<a class="headerlink" href="#adding-radio-interfaces" title="Link to this heading"></a></h2> <h2>Adding Radio Interfaces<a class="headerlink" href="#adding-radio-interfaces" title="Link to this heading"></a></h2>
<p>Once you have Reticulum installed and working, you can add radio interfaces with <p>Once you have Reticulum installed and working, you can add radio interfaces with any compatible hardware you have available. Reticulum supports a wide range of radio hardware, and if you already have any available, it is very likely that it will work with Reticulum. For information on how to configure this, see the <a class="reference internal" href="interfaces.html#interfaces-main"><span class="std std-ref">Interfaces</span></a> section of this manual.</p>
any compatible hardware you have available. Reticulum supports a wide range of radio <p>If you do not already have transceiver hardware available, you can easily and cheaply build an <a class="reference internal" href="hardware.html#rnode-main"><span class="std std-ref">RNode</span></a>, which is a general-purpose long-range digital radio transceiver, that integrates easily with Reticulum.</p>
hardware, and if you already have any available, it is very likely that it will <p>To build one yourself requires installing a custom firmware on a supported LoRa development board with an auto-install script or web-based flasher. Please see the <a class="reference internal" href="hardware.html#hardware-main"><span class="std std-ref">Communications Hardware</span></a> chapter for a guide. If you prefer purchasing a ready-made unit, you can refer to the <span class="xref std std-ref">list of suppliers</span>.</p>
work with Reticulum. For information on how to configure this, see the <p>Other radio-based hardware interfaces are being developed and made available by the broader Reticulum community. You can find more information on such topics over Reticulum-based information sharing systems.</p>
<a class="reference internal" href="interfaces.html#interfaces-main"><span class="std std-ref">Interfaces</span></a> section of this manual.</p> <p>If you have communications hardware that is not already supported by any of the <a class="reference internal" href="interfaces.html#interfaces-main"><span class="std std-ref">existing interface types</span></a>, it is easy to write (and potentially publish) a <a class="reference internal" href="interfaces.html#interfaces-custom"><span class="std std-ref">custom interface module</span></a> that makes it compatible with Reticulum.</p>
<p>If you do not already have transceiver hardware available, you can easily and
cheaply build an <a class="reference internal" href="hardware.html#rnode-main"><span class="std std-ref">RNode</span></a>, which is a general-purpose long-range
digital radio transceiver, that integrates easily with Reticulum.</p>
<p>To build one yourself requires installing a custom firmware on a supported LoRa
development board with an auto-install script or web-based flasher.
Please see the <a class="reference internal" href="hardware.html#hardware-main"><span class="std std-ref">Communications Hardware</span></a> chapter for a guide.
If you prefer purchasing a ready-made unit, you can refer to the
<span class="xref std std-ref">list of suppliers</span>.</p>
<p>Other radio-based hardware interfaces are being developed and made available by
the broader Reticulum community. You can find more information on such topics
over Reticulum-based information sharing systems.</p>
<p>If you have communications hardware that is not already supported by any of the
<a class="reference internal" href="interfaces.html#interfaces-main"><span class="std std-ref">existing interface types</span></a>, it is easy to write (and potentially
publish) a <a class="reference internal" href="interfaces.html#interfaces-custom"><span class="std std-ref">custom interface module</span></a> that makes it compatible with Reticulum.</p>
</section> </section>
<section id="creating-and-using-custom-interfaces"> <section id="creating-and-using-custom-interfaces">
<h2>Creating and Using Custom Interfaces<a class="headerlink" href="#creating-and-using-custom-interfaces" title="Link to this heading"></a></h2> <h2>Creating and Using Custom Interfaces<a class="headerlink" href="#creating-and-using-custom-interfaces" title="Link to this heading"></a></h2>
<p>While Reticulum includes a flexible and broad range of built-in interfaces, these <p>While Reticulum includes a flexible and broad range of built-in interfaces, these will not cover every conceivable type of communications hardware that Reticulum can potentially use to communicate.</p>
will not cover every conceivable type of communications hardware that Reticulum <p>It is therefore possible to easily write your own interface modules, that can be loaded at run-time and used on-par with any of the built-in interface types.</p>
can potentially use to communicate.</p> <p>For more information on this subject, and code examples to build on, please see the <a class="reference internal" href="interfaces.html#interfaces-main"><span class="std std-ref">Configuring Interfaces</span></a> chapter.</p>
<p>It is therefore possible to easily write your own interface modules, that can be
loaded at run-time and used on-par with any of the built-in interface types.</p>
<p>For more information on this subject, and code examples to build on, please see
the <a class="reference internal" href="interfaces.html#interfaces-main"><span class="std std-ref">Configuring Interfaces</span></a> chapter.</p>
</section> </section>
<section id="develop-a-program-with-reticulum"> <section id="develop-a-program-with-reticulum">
<h2>Develop a Program with Reticulum<a class="headerlink" href="#develop-a-program-with-reticulum" title="Link to this heading"></a></h2> <h2>Develop a Program with Reticulum<a class="headerlink" href="#develop-a-program-with-reticulum" title="Link to this heading"></a></h2>
<p>If you want to develop programs that use Reticulum, the easiest way to get <p>If you want to develop programs that use Reticulum, the easiest way to get started is to install the latest release of Reticulum via pip:</p>
started is to install the latest release of Reticulum via pip:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">pip</span> <span class="n">install</span> <span class="n">rns</span> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">pip</span> <span class="n">install</span> <span class="n">rns</span>
</pre></div> </pre></div>
</div> </div>
<p>The above command will install Reticulum and dependencies, and you will be <p>The above command will install Reticulum and dependencies, and you will be ready to import and use RNS in your own programs. The next step will most likely be to look at some <a class="reference internal" href="examples.html#examples-main"><span class="std std-ref">Example Programs</span></a>.</p>
ready to import and use RNS in your own programs. The next step will most <p>The entire Reticulum API is documented in the <a class="reference internal" href="reference.html#api-main"><span class="std std-ref">API Reference</span></a> chapter of this manual. Before diving in, it’s probably a good idea to read this manual in full, but at least start with the <a class="reference internal" href="understanding.html#understanding-main"><span class="std std-ref">Understanding Reticulum</span></a> chapter.</p>
likely be to look at some <a class="reference internal" href="examples.html#examples-main"><span class="std std-ref">Example Programs</span></a>.</p>
<p>The entire Reticulum API is documented in the <a class="reference internal" href="reference.html#api-main"><span class="std std-ref">API Reference</span></a>
chapter of this manual. Before diving in, it’s probably a good idea to read
this manual in full, but at least start with the <a class="reference internal" href="understanding.html#understanding-main"><span class="std std-ref">Understanding Reticulum</span></a> chapter.</p>
</section> </section>
<section id="platform-specific-install-notes"> <section id="platform-specific-install-notes">
<span id="install-guides"></span><h2>Platform-Specific Install Notes<a class="headerlink" href="#platform-specific-install-notes" title="Link to this heading"></a></h2> <span id="install-guides"></span><h2>Platform-Specific Install Notes<a class="headerlink" href="#platform-specific-install-notes" title="Link to this heading"></a></h2>
<p>Some platforms require a slightly different installation procedure, or have <p>Some platforms require a slightly different installation procedure, or have various quirks that are worth being aware of. These are listed here.</p>
various quirks that are worth being aware of. These are listed here.</p>
<section id="android"> <section id="android">
<h3>Android<a class="headerlink" href="#android" title="Link to this heading"></a></h3> <h3>Android<a class="headerlink" href="#android" title="Link to this heading"></a></h3>
<p>Reticulum can be used on Android in different ways. The easiest way to get <p>Reticulum can be used on Android in different ways. The easiest way to get started is using an app like <a class="reference external" href="https://unsigned.io/sideband">Sideband</a>.</p>
started is using an app like <a class="reference external" href="https://unsigned.io/sideband">Sideband</a>.</p> <p>For more control and features, you can use Reticulum and related programs via the <a class="reference external" href="https://termux.com/">Termux app</a>, at the time of writing available on <a class="reference external" href="https://f-droid.org">F-droid</a>.</p>
<p>For more control and features, you can use Reticulum and related programs via <p>Termux is a terminal emulator and Linux environment for Android based devices, which includes the ability to use many different programs and libraries, including Reticulum.</p>
the <a class="reference external" href="https://termux.com/">Termux app</a>, at the time of writing available on <p>To use Reticulum within the Termux environment, you will need to install <code class="docutils literal notranslate"><span class="pre">python</span></code> and the <code class="docutils literal notranslate"><span class="pre">python-cryptography</span></code> library using <code class="docutils literal notranslate"><span class="pre">pkg</span></code>, the package-manager build into Termux. After that, you can use <code class="docutils literal notranslate"><span class="pre">pip</span></code> to install Reticulum.</p>
<a class="reference external" href="https://f-droid.org">F-droid</a>.</p>
<p>Termux is a terminal emulator and Linux environment for Android based devices,
which includes the ability to use many different programs and libraries,
including Reticulum.</p>
<p>To use Reticulum within the Termux environment, you will need to install
<code class="docutils literal notranslate"><span class="pre">python</span></code> and the <code class="docutils literal notranslate"><span class="pre">python-cryptography</span></code> library using <code class="docutils literal notranslate"><span class="pre">pkg</span></code>, the package-manager
build into Termux. After that, you can use <code class="docutils literal notranslate"><span class="pre">pip</span></code> to install Reticulum.</p>
<p>From within Termux, execute the following:</p> <p>From within Termux, execute the following:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span class="c1"># First, make sure indexes and packages are up to date.</span> <div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span class="c1"># First, make sure indexes and packages are up to date.</span>
pkg<span class="w"> </span>update pkg<span class="w"> </span>update
@@ -583,9 +478,7 @@ pip<span class="w"> </span>install<span class="w"> </span>wheel<span class="w">
pip<span class="w"> </span>install<span class="w"> </span>rns pip<span class="w"> </span>install<span class="w"> </span>rns
</pre></div> </pre></div>
</div> </div>
<p>If for some reason the <code class="docutils literal notranslate"><span class="pre">python-cryptography</span></code> package is not available for <p>If for some reason the <code class="docutils literal notranslate"><span class="pre">python-cryptography</span></code> package is not available for your platform via the Termux package manager, you can attempt to build it locally on your device using the following command:</p>
your platform via the Termux package manager, you can attempt to build it
locally on your device using the following command:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span class="c1"># First, make sure indexes and packages are up to date.</span> <div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span class="c1"># First, make sure indexes and packages are up to date.</span>
pkg<span class="w"> </span>update pkg<span class="w"> </span>update
pkg<span class="w"> </span>upgrade pkg<span class="w"> </span>upgrade
@@ -610,15 +503,11 @@ pip<span class="w"> </span>install<span class="w"> </span>cryptography
pip<span class="w"> </span>install<span class="w"> </span>rns pip<span class="w"> </span>install<span class="w"> </span>rns
</pre></div> </pre></div>
</div> </div>
<p>It is also possible to include Reticulum in apps compiled and distributed as <p>It is also possible to include Reticulum in apps compiled and distributed as Android APKs. A detailed tutorial and example source code will be included here at a later point. Until then you can use the <a class="reference external" href="https://github.com/markqvist/sideband">Sideband source code</a> as an example and starting point.</p>
Android APKs. A detailed tutorial and example source code will be included
here at a later point. Until then you can use the <a class="reference external" href="https://github.com/markqvist/sideband">Sideband source code</a> as an example and starting point.</p>
</section> </section>
<section id="arm64"> <section id="arm64">
<h3>ARM64<a class="headerlink" href="#arm64" title="Link to this heading"></a></h3> <h3>ARM64<a class="headerlink" href="#arm64" title="Link to this heading"></a></h3>
<p>On some architectures, including ARM64, not all dependencies have precompiled <p>On some architectures, including ARM64, not all dependencies have precompiled binaries. On such systems, you may need to install <code class="docutils literal notranslate"><span class="pre">python3-dev</span></code> (or similar) before installing Reticulum or programs that depend on Reticulum.</p>
binaries. On such systems, you may need to install <code class="docutils literal notranslate"><span class="pre">python3-dev</span></code> (or similar) before
installing Reticulum or programs that depend on Reticulum.</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span class="c1"># Install Python and development packages</span> <div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span class="c1"># Install Python and development packages</span>
sudo<span class="w"> </span>apt<span class="w"> </span>update sudo<span class="w"> </span>apt<span class="w"> </span>update
sudo<span class="w"> </span>apt<span class="w"> </span>install<span class="w"> </span>python3<span class="w"> </span>python3-pip<span class="w"> </span>python3-dev sudo<span class="w"> </span>apt<span class="w"> </span>install<span class="w"> </span>python3<span class="w"> </span>python3-pip<span class="w"> </span>python3-dev
@@ -632,11 +521,7 @@ on your system locally.</p>
</section> </section>
<section id="debian-bookworm"> <section id="debian-bookworm">
<h3>Debian Bookworm<a class="headerlink" href="#debian-bookworm" title="Link to this heading"></a></h3> <h3>Debian Bookworm<a class="headerlink" href="#debian-bookworm" title="Link to this heading"></a></h3>
<p>On versions of Debian released after April 2023, it is no longer possible by default <p>On versions of Debian released after April 2023, it is no longer possible by default to use <code class="docutils literal notranslate"><span class="pre">pip</span></code> to install packages onto your system. Unfortunately, you will need to use the replacement <code class="docutils literal notranslate"><span class="pre">pipx</span></code> command instead, which places installed packages in an isolated environment. This should not negatively affect Reticulum, but will not work for including and using Reticulum in your own scripts and programs.</p>
to use <code class="docutils literal notranslate"><span class="pre">pip</span></code> to install packages onto your system. Unfortunately, you will need to
use the replacement <code class="docutils literal notranslate"><span class="pre">pipx</span></code> command instead, which places installed packages in an
isolated environment. This should not negatively affect Reticulum, but will not work
for including and using Reticulum in your own scripts and programs.</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span class="c1"># Install pipx</span> <div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span class="c1"># Install pipx</span>
sudo<span class="w"> </span>apt<span class="w"> </span>install<span class="w"> </span>pipx sudo<span class="w"> </span>apt<span class="w"> </span>install<span class="w"> </span>pipx
@@ -647,37 +532,25 @@ pipx<span class="w"> </span>ensurepath
pipx<span class="w"> </span>install<span class="w"> </span>rns pipx<span class="w"> </span>install<span class="w"> </span>rns
</pre></div> </pre></div>
</div> </div>
<p>Alternatively, you can restore normal behaviour to <code class="docutils literal notranslate"><span class="pre">pip</span></code> by creating or editing <p>Alternatively, you can restore normal behaviour to <code class="docutils literal notranslate"><span class="pre">pip</span></code> by creating or editing the configuration file located at <code class="docutils literal notranslate"><span class="pre">~/.config/pip/pip.conf</span></code>, and adding the following section:</p>
the configuration file located at <code class="docutils literal notranslate"><span class="pre">~/.config/pip/pip.conf</span></code>, and adding the
following section:</p>
<div class="highlight-ini notranslate"><div class="highlight"><pre><span></span><span class="k">[global]</span> <div class="highlight-ini notranslate"><div class="highlight"><pre><span></span><span class="k">[global]</span>
<span class="na">break-system-packages</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">true</span> <span class="na">break-system-packages</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">true</span>
</pre></div> </pre></div>
</div> </div>
<p>For a one-shot installation of Reticulum, without globally enabling the <code class="docutils literal notranslate"><span class="pre">break-system-packages</span></code> <p>For a one-shot installation of Reticulum, without globally enabling the <code class="docutils literal notranslate"><span class="pre">break-system-packages</span></code> option, you can use the following command:</p>
option, you can use the following command:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>pip<span class="w"> </span>install<span class="w"> </span>rns<span class="w"> </span>--break-system-packages <div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>pip<span class="w"> </span>install<span class="w"> </span>rns<span class="w"> </span>--break-system-packages
</pre></div> </pre></div>
</div> </div>
<div class="admonition note"> <div class="admonition note">
<p class="admonition-title">Note</p> <p class="admonition-title">Note</p>
<p>The <code class="docutils literal notranslate"><span class="pre">--break-system-packages</span></code> directive is a somewhat misleading choice <p>The <code class="docutils literal notranslate"><span class="pre">--break-system-packages</span></code> directive is a somewhat misleading choice of words. Setting it will of course not break any system packages, but will simply allow installing <code class="docutils literal notranslate"><span class="pre">pip</span></code> packages user- and system-wide. While this <em>could</em> in rare cases lead to version conflicts, it does not generally pose any problems, especially not in the case of installing Reticulum.</p>
of words. Setting it will of course not break any system packages, but will simply
allow installing <code class="docutils literal notranslate"><span class="pre">pip</span></code> packages user- and system-wide. While this <em>could</em> in rare
cases lead to version conflicts, it does not generally pose any problems, especially
not in the case of installing Reticulum.</p>
</div> </div>
</section> </section>
<section id="macos"> <section id="macos">
<h3>MacOS<a class="headerlink" href="#macos" title="Link to this heading"></a></h3> <h3>MacOS<a class="headerlink" href="#macos" title="Link to this heading"></a></h3>
<p>To install Reticulum on macOS, you will need to have Python and the <code class="docutils literal notranslate"><span class="pre">pip</span></code> package <p>To install Reticulum on macOS, you will need to have Python and the <code class="docutils literal notranslate"><span class="pre">pip</span></code> package manager installed.</p>
manager installed.</p> <p>Systems running macOS can vary quite widely in whether or not Python is pre-installed, and if it is, which version is installed, and whether the <code class="docutils literal notranslate"><span class="pre">pip</span></code> package manager is also installed and set up. If in doubt, you can <a class="reference external" href="https://www.python.org/downloads/">download and install</a> Python manually.</p>
<p>Systems running macOS can vary quite widely in whether or not Python is pre-installed, <p>When Python and <code class="docutils literal notranslate"><span class="pre">pip</span></code> is available on your system, simply open a terminal window and use one of the following commands:</p>
and if it is, which version is installed, and whether the <code class="docutils literal notranslate"><span class="pre">pip</span></code> package manager is
also installed and set up. If in doubt, you can <a class="reference external" href="https://www.python.org/downloads/">download and install</a>
Python manually.</p>
<p>When Python and <code class="docutils literal notranslate"><span class="pre">pip</span></code> is available on your system, simply open a terminal window
and use one of the following commands:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span class="c1"># Install Reticulum and utilities with pip:</span> <div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span class="c1"># Install Reticulum and utilities with pip:</span>
pip3<span class="w"> </span>install<span class="w"> </span>rns pip3<span class="w"> </span>install<span class="w"> </span>rns
@@ -688,16 +561,9 @@ pip3<span class="w"> </span>install<span class="w"> </span>rns<span class="w"> <
</div> </div>
<div class="admonition note"> <div class="admonition note">
<p class="admonition-title">Note</p> <p class="admonition-title">Note</p>
<p>The <code class="docutils literal notranslate"><span class="pre">--break-system-packages</span></code> directive is a somewhat misleading choice <p>The <code class="docutils literal notranslate"><span class="pre">--break-system-packages</span></code> directive is a somewhat misleading choice of words. Setting it will of course not break any system packages, but will simply allow installing <code class="docutils literal notranslate"><span class="pre">pip</span></code> packages user- and system-wide. While this <em>could</em> in rare cases lead to version conflicts, it does not generally pose any problems, especially not in the case of installing Reticulum.</p>
of words. Setting it will of course not break any system packages, but will simply
allow installing <code class="docutils literal notranslate"><span class="pre">pip</span></code> packages user- and system-wide. While this <em>could</em> in rare
cases lead to version conflicts, it does not generally pose any problems, especially
not in the case of installing Reticulum.</p>
</div> </div>
<p>Additionally, some version combinations of macOS and Python require you to <p>Additionally, some version combinations of macOS and Python require you to manually add your installed <code class="docutils literal notranslate"><span class="pre">pip</span></code> packages directory to your <cite>PATH</cite> environment variable, before you can use installed commands in your terminal. Usually, adding the following line to your shell init script (for example <code class="docutils literal notranslate"><span class="pre">~/.zshrc</span></code>) will be enough:</p>
manually add your installed <code class="docutils literal notranslate"><span class="pre">pip</span></code> packages directory to your <cite>PATH</cite> environment
variable, before you can use installed commands in your terminal. Usually, adding
the following line to your shell init script (for example <code class="docutils literal notranslate"><span class="pre">~/.zshrc</span></code>) will be enough:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span class="nb">export</span><span class="w"> </span><span class="nv">PATH</span><span class="o">=</span><span class="nv">$PATH</span>:~/Library/Python/3.9/bin <div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span class="nb">export</span><span class="w"> </span><span class="nv">PATH</span><span class="o">=</span><span class="nv">$PATH</span>:~/Library/Python/3.9/bin
</pre></div> </pre></div>
</div> </div>
@@ -705,18 +571,12 @@ the following line to your shell init script (for example <code class="docutils
</section> </section>
<section id="openwrt"> <section id="openwrt">
<h3>OpenWRT<a class="headerlink" href="#openwrt" title="Link to this heading"></a></h3> <h3>OpenWRT<a class="headerlink" href="#openwrt" title="Link to this heading"></a></h3>
<p>On OpenWRT systems with sufficient storage and memory, you can install <p>On OpenWRT systems with sufficient storage and memory, you can install Reticulum and related utilities using the <cite>opkg</cite> package manager and <cite>pip</cite>.</p>
Reticulum and related utilities using the <cite>opkg</cite> package manager and <cite>pip</cite>.</p>
<div class="admonition note"> <div class="admonition note">
<p class="admonition-title">Note</p> <p class="admonition-title">Note</p>
<p>At the time of releasing this manual, work is underway to create pre-built <p>At the time of releasing this manual, work is underway to create pre-built Reticulum packages for OpenWRT, with full configuration, service and <code class="docutils literal notranslate"><span class="pre">uci</span></code> integration. Please see the <a class="reference external" href="https://github.com/gretel/feed-reticulum">feed-reticulum</a> and <a class="reference external" href="https://github.com/gretel/reticulum-openwrt">reticulum-openwrt</a> repositories for more information.</p>
Reticulum packages for OpenWRT, with full configuration, service
and <code class="docutils literal notranslate"><span class="pre">uci</span></code> integration. Please see the <a class="reference external" href="https://github.com/gretel/feed-reticulum">feed-reticulum</a>
and <a class="reference external" href="https://github.com/gretel/reticulum-openwrt">reticulum-openwrt</a>
repositories for more information.</p>
</div> </div>
<p>To install Reticulum on OpenWRT, first log into a command line session, and <p>To install Reticulum on OpenWRT, first log into a command line session, and then use the following instructions:</p>
then use the following instructions:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span class="c1"># Install dependencies</span> <div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span class="c1"># Install dependencies</span>
opkg<span class="w"> </span>install<span class="w"> </span>python3<span class="w"> </span>python3-pip<span class="w"> </span>python3-cryptography<span class="w"> </span>python3-pyserial opkg<span class="w"> </span>install<span class="w"> </span>python3<span class="w"> </span>python3-pip<span class="w"> </span>python3-cryptography<span class="w"> </span>python3-pyserial
@@ -729,28 +589,14 @@ rnsd<span class="w"> </span>-vvv
</div> </div>
<div class="admonition note"> <div class="admonition note">
<p class="admonition-title">Note</p> <p class="admonition-title">Note</p>
<p>The above instructions have been verified and tested on OpenWRT 21.02 only. <p>The above instructions have been verified and tested on OpenWRT 21.02 only. It is likely that other versions may require slightly altered installation commands or package names. You will also need enough free space in your overlay FS, and enough free RAM to actually run Reticulum and any related programs and utilities.</p>
It is likely that other versions may require slightly altered installation
commands or package names. You will also need enough free space in your
overlay FS, and enough free RAM to actually run Reticulum and any related
programs and utilities.</p>
</div> </div>
<p>Depending on your device configuration, you may need to adjust firewall rules <p>Depending on your device configuration, you may need to adjust firewall rules for Reticulum connectivity to and from your device to work. Until proper packaging is ready, you will also need to manually create a service or startup script to automatically laucnh Reticulum at boot time.</p>
for Reticulum connectivity to and from your device to work. Until proper <p>Please also note that the <cite>AutoInterface</cite> requires link-local IPv6 addresses to be enabled for any Ethernet and WiFi devices you intend to use. If <code class="docutils literal notranslate"><span class="pre">ip</span> <span class="pre">a</span></code> shows an address starting with <code class="docutils literal notranslate"><span class="pre">fe80::</span></code> for the device in question, <code class="docutils literal notranslate"><span class="pre">AutoInterface</span></code> should work for that device.</p>
packaging is ready, you will also need to manually create a service or startup
script to automatically laucnh Reticulum at boot time.</p>
<p>Please also note that the <cite>AutoInterface</cite> requires link-local IPv6 addresses
to be enabled for any Ethernet and WiFi devices you intend to use. If <code class="docutils literal notranslate"><span class="pre">ip</span> <span class="pre">a</span></code>
shows an address starting with <code class="docutils literal notranslate"><span class="pre">fe80::</span></code> for the device in question,
<code class="docutils literal notranslate"><span class="pre">AutoInterface</span></code> should work for that device.</p>
</section> </section>
<section id="raspberry-pi"> <section id="raspberry-pi">
<h3>Raspberry Pi<a class="headerlink" href="#raspberry-pi" title="Link to this heading"></a></h3> <h3>Raspberry Pi<a class="headerlink" href="#raspberry-pi" title="Link to this heading"></a></h3>
<p>It is currently recommended to use a 64-bit version of the Raspberry Pi OS <p>It is currently recommended to use a 64-bit version of the Raspberry Pi OS if you want to run Reticulum on Raspberry Pi computers, since 32-bit versions don’t always have packages available for some dependencies. If Python and the <cite>pip</cite> package manager is not already installed, do that first, and then install Reticulum using <cite>pip</cite>.</p>
if you want to run Reticulum on Raspberry Pi computers, since 32-bit versions
don’t always have packages available for some dependencies. If Python and the
<cite>pip</cite> package manager is not already installed, do that first, and then
install Reticulum using <cite>pip</cite>.</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span class="c1"># Install dependencies</span> <div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span class="c1"># Install dependencies</span>
sudo<span class="w"> </span>apt<span class="w"> </span>install<span class="w"> </span>python3<span class="w"> </span>python3-pip<span class="w"> </span>python3-cryptography<span class="w"> </span>python3-pyserial sudo<span class="w"> </span>apt<span class="w"> </span>install<span class="w"> </span>python3<span class="w"> </span>python3-pip<span class="w"> </span>python3-cryptography<span class="w"> </span>python3-pyserial
@@ -760,21 +606,13 @@ pip<span class="w"> </span>install<span class="w"> </span>rns<span class="w"> </
</div> </div>
<div class="admonition note"> <div class="admonition note">
<p class="admonition-title">Note</p> <p class="admonition-title">Note</p>
<p>The <code class="docutils literal notranslate"><span class="pre">--break-system-packages</span></code> directive is a somewhat misleading choice <p>The <code class="docutils literal notranslate"><span class="pre">--break-system-packages</span></code> directive is a somewhat misleading choice of words. Setting it will of course not break any system packages, but will simply allow installing <code class="docutils literal notranslate"><span class="pre">pip</span></code> packages user- and system-wide. While this <em>could</em> in rare cases lead to version conflicts, it does not generally pose any problems, especially not in the case of installing Reticulum.</p>
of words. Setting it will of course not break any system packages, but will simply
allow installing <code class="docutils literal notranslate"><span class="pre">pip</span></code> packages user- and system-wide. While this <em>could</em> in rare
cases lead to version conflicts, it does not generally pose any problems, especially
not in the case of installing Reticulum.</p>
</div> </div>
<p>While it is possible to install and run Reticulum on 32-bit Rasperry Pi OSes, <p>While it is possible to install and run Reticulum on 32-bit Rasperry Pi OSes, it will require manually configuring and installing required build dependencies, and is not detailed in this manual.</p>
it will require manually configuring and installing required build dependencies,
and is not detailed in this manual.</p>
</section> </section>
<section id="risc-v"> <section id="risc-v">
<h3>RISC-V<a class="headerlink" href="#risc-v" title="Link to this heading"></a></h3> <h3>RISC-V<a class="headerlink" href="#risc-v" title="Link to this heading"></a></h3>
<p>On some architectures, including RISC-V, not all dependencies have precompiled <p>On some architectures, including RISC-V, not all dependencies have precompiled binaries. On such systems, you may need to install <code class="docutils literal notranslate"><span class="pre">python3-dev</span></code> (or similar) before installing Reticulum or programs that depend on Reticulum.</p>
binaries. On such systems, you may need to install <code class="docutils literal notranslate"><span class="pre">python3-dev</span></code> (or similar) before
installing Reticulum or programs that depend on Reticulum.</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span class="c1"># Install Python and development packages</span> <div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span class="c1"># Install Python and development packages</span>
sudo<span class="w"> </span>apt<span class="w"> </span>update sudo<span class="w"> </span>apt<span class="w"> </span>update
sudo<span class="w"> </span>apt<span class="w"> </span>install<span class="w"> </span>python3<span class="w"> </span>python3-pip<span class="w"> </span>python3-dev sudo<span class="w"> </span>apt<span class="w"> </span>install<span class="w"> </span>python3<span class="w"> </span>python3-pip<span class="w"> </span>python3-dev
@@ -783,16 +621,11 @@ sudo<span class="w"> </span>apt<span class="w"> </span>install<span class="w"> <
python3<span class="w"> </span>-m<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>rns python3<span class="w"> </span>-m<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>rns
</pre></div> </pre></div>
</div> </div>
<p>With these packages installed, <code class="docutils literal notranslate"><span class="pre">pip</span></code> will be able to build any missing dependencies <p>With these packages installed, <code class="docutils literal notranslate"><span class="pre">pip</span></code> will be able to build any missing dependencies on your system locally.</p>
on your system locally.</p>
</section> </section>
<section id="ubuntu-lunar"> <section id="ubuntu-lunar">
<h3>Ubuntu Lunar<a class="headerlink" href="#ubuntu-lunar" title="Link to this heading"></a></h3> <h3>Ubuntu Lunar<a class="headerlink" href="#ubuntu-lunar" title="Link to this heading"></a></h3>
<p>On versions of Ubuntu released after April 2023, it is no longer possible by default <p>On versions of Ubuntu released after April 2023, it is no longer possible by default to use <code class="docutils literal notranslate"><span class="pre">pip</span></code> to install packages onto your system. Unfortunately, you will need to use the replacement <code class="docutils literal notranslate"><span class="pre">pipx</span></code> command instead, which places installed packages in an isolated environment. This should not negatively affect Reticulum, but will not work for including and using Reticulum in your own scripts and programs.</p>
to use <code class="docutils literal notranslate"><span class="pre">pip</span></code> to install packages onto your system. Unfortunately, you will need to
use the replacement <code class="docutils literal notranslate"><span class="pre">pipx</span></code> command instead, which places installed packages in an
isolated environment. This should not negatively affect Reticulum, but will not work
for including and using Reticulum in your own scripts and programs.</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span class="c1"># Install pipx</span> <div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span class="c1"># Install pipx</span>
sudo<span class="w"> </span>apt<span class="w"> </span>install<span class="w"> </span>pipx sudo<span class="w"> </span>apt<span class="w"> </span>install<span class="w"> </span>pipx
@@ -803,44 +636,30 @@ pipx<span class="w"> </span>ensurepath
pipx<span class="w"> </span>install<span class="w"> </span>rns pipx<span class="w"> </span>install<span class="w"> </span>rns
</pre></div> </pre></div>
</div> </div>
<p>Alternatively, you can restore normal behaviour to <code class="docutils literal notranslate"><span class="pre">pip</span></code> by creating or editing <p>Alternatively, you can restore normal behaviour to <code class="docutils literal notranslate"><span class="pre">pip</span></code> by creating or editing the configuration file located at <code class="docutils literal notranslate"><span class="pre">~/.config/pip/pip.conf</span></code>, and adding the following section:</p>
the configuration file located at <code class="docutils literal notranslate"><span class="pre">~/.config/pip/pip.conf</span></code>, and adding the
following section:</p>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>[global] <div class="highlight-text notranslate"><div class="highlight"><pre><span></span>[global]
break-system-packages = true break-system-packages = true
</pre></div> </pre></div>
</div> </div>
<p>For a one-shot installation of Reticulum, without globally enabling the <code class="docutils literal notranslate"><span class="pre">break-system-packages</span></code> <p>For a one-shot installation of Reticulum, without globally enabling the <code class="docutils literal notranslate"><span class="pre">break-system-packages</span></code> option, you can use the following command:</p>
option, you can use the following command:</p>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>pip install rns --break-system-packages <div class="highlight-text notranslate"><div class="highlight"><pre><span></span>pip install rns --break-system-packages
</pre></div> </pre></div>
</div> </div>
<div class="admonition note"> <div class="admonition note">
<p class="admonition-title">Note</p> <p class="admonition-title">Note</p>
<p>The <code class="docutils literal notranslate"><span class="pre">--break-system-packages</span></code> directive is a somewhat misleading choice <p>The <code class="docutils literal notranslate"><span class="pre">--break-system-packages</span></code> directive is a somewhat misleading choice of words. Setting it will of course not break any system packages, but will simply allow installing <code class="docutils literal notranslate"><span class="pre">pip</span></code> packages user- and system-wide. While this <em>could</em> in rare cases lead to version conflicts, it does not generally pose any problems, especially not in the case of installing Reticulum.</p>
of words. Setting it will of course not break any system packages, but will simply
allow installing <code class="docutils literal notranslate"><span class="pre">pip</span></code> packages user- and system-wide. While this <em>could</em> in rare
cases lead to version conflicts, it does not generally pose any problems, especially
not in the case of installing Reticulum.</p>
</div> </div>
</section> </section>
<section id="windows"> <section id="windows">
<h3>Windows<a class="headerlink" href="#windows" title="Link to this heading"></a></h3> <h3>Windows<a class="headerlink" href="#windows" title="Link to this heading"></a></h3>
<p>On Windows operating systems, the easiest way to install Reticulum is by using the <p>On Windows operating systems, the easiest way to install Reticulum is by using the <code class="docutils literal notranslate"><span class="pre">pip</span></code> package manager from the command line (either the command prompt or Windows Powershell).</p>
<code class="docutils literal notranslate"><span class="pre">pip</span></code> package manager from the command line (either the command prompt or Windows <p>If you don’t already have Python installed, <a class="reference external" href="https://www.python.org/downloads/">download and install Python</a>. At the time of publication of this manual, the recommended version is <a class="reference external" href="https://www.python.org/downloads/release/python-3127">Python 3.12.7</a>.</p>
Powershell).</p> <p><strong>Important!</strong> When asked by the installer, make sure to add the Python program to your PATH environment variables. If you don’t do this, you will not be able to use the <code class="docutils literal notranslate"><span class="pre">pip</span></code> installer, or run the included Reticulum utility programs (such as <code class="docutils literal notranslate"><span class="pre">rnsd</span></code> and <code class="docutils literal notranslate"><span class="pre">rnstatus</span></code>) from the command line.</p>
<p>If you don’t already have Python installed, <a class="reference external" href="https://www.python.org/downloads/">download and install Python</a>.
At the time of publication of this manual, the recommended version is <a class="reference external" href="https://www.python.org/downloads/release/python-3127">Python 3.12.7</a>.</p>
<p><strong>Important!</strong> When asked by the installer, make sure to add the Python program to
your PATH environment variables. If you don’t do this, you will not be able to
use the <code class="docutils literal notranslate"><span class="pre">pip</span></code> installer, or run the included Reticulum utility programs (such as
<code class="docutils literal notranslate"><span class="pre">rnsd</span></code> and <code class="docutils literal notranslate"><span class="pre">rnstatus</span></code>) from the command line.</p>
<p>After installing Python, open the command prompt or Windows Powershell, and type:</p> <p>After installing Python, open the command prompt or Windows Powershell, and type:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>pip<span class="w"> </span>install<span class="w"> </span>rns <div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>pip<span class="w"> </span>install<span class="w"> </span>rns
</pre></div> </pre></div>
</div> </div>
<p>You can now use Reticulum and all included utility programs directly from your <p>You can now use Reticulum and all included utility programs directly from your preferred command line interface.</p>
preferred command line interface.</p>
</section> </section>
</section> </section>
<section id="pure-python-reticulum"> <section id="pure-python-reticulum">
@@ -852,19 +671,8 @@ do not support <a class="reference external" href="https://github.com/pyca/crypt
important that you read and understand the <a class="reference internal" href="understanding.html#understanding-primitives"><span class="std std-ref">Cryptographic Primitives</span></a> important that you read and understand the <a class="reference internal" href="understanding.html#understanding-primitives"><span class="std std-ref">Cryptographic Primitives</span></a>
section of this manual.</p> section of this manual.</p>
</div> </div>
<p>In some rare cases, and on more obscure system types, it is not possible to <p>In some rare cases, and on more obscure system types, it is not possible to install one or more dependencies. In such situations, you can use the <code class="docutils literal notranslate"><span class="pre">rnspure</span></code> package instead of the <code class="docutils literal notranslate"><span class="pre">rns</span></code> package, or use <code class="docutils literal notranslate"><span class="pre">pip</span></code> with the <code class="docutils literal notranslate"><span class="pre">--no-dependencies</span></code> command-line option. The <code class="docutils literal notranslate"><span class="pre">rnspure</span></code> package requires no external dependencies for installation. Please note that the actual contents of the <code class="docutils literal notranslate"><span class="pre">rns</span></code> and <code class="docutils literal notranslate"><span class="pre">rnspure</span></code> packages are <em>completely identical</em>. The only difference is that the <code class="docutils literal notranslate"><span class="pre">rnspure</span></code> package lists no dependencies required for installation.</p>
install one or more dependencies. In such situations, <p>No matter how Reticulum is installed and started, it will load external dependencies only if they are <em>needed</em> and <em>available</em>. If for example you want to use Reticulum on a system that cannot support <code class="docutils literal notranslate"><span class="pre">pyserial</span></code>, it is perfectly possible to do so using the <cite>rnspure</cite> package, but Reticulum will not be able to use serial-based interfaces. All other available modules will still be loaded when needed.</p>
you can use the <code class="docutils literal notranslate"><span class="pre">rnspure</span></code> package instead of the <code class="docutils literal notranslate"><span class="pre">rns</span></code> package, or use <code class="docutils literal notranslate"><span class="pre">pip</span></code>
with the <code class="docutils literal notranslate"><span class="pre">--no-dependencies</span></code> command-line option. The <code class="docutils literal notranslate"><span class="pre">rnspure</span></code>
package requires no external dependencies for installation. Please note that the
actual contents of the <code class="docutils literal notranslate"><span class="pre">rns</span></code> and <code class="docutils literal notranslate"><span class="pre">rnspure</span></code> packages are <em>completely identical</em>.
The only difference is that the <code class="docutils literal notranslate"><span class="pre">rnspure</span></code> package lists no dependencies required
for installation.</p>
<p>No matter how Reticulum is installed and started, it will load external dependencies
only if they are <em>needed</em> and <em>available</em>. If for example you want to use Reticulum
on a system that cannot support <code class="docutils literal notranslate"><span class="pre">pyserial</span></code>, it is perfectly possible to do so using
the <cite>rnspure</cite> package, but Reticulum will not be able to use serial-based interfaces.
All other available modules will still be loaded when needed.</p>
</section> </section>
</section> </section>
@@ -968,7 +776,7 @@ All other available modules will still be loaded when needed.</p>
</aside> </aside>
</div> </div>
</div><script src="_static/documentation_options.js?v=bb516dca"></script> </div><script src="_static/documentation_options.js?v=98c25ec5"></script>
<script src="_static/doctools.js?v=9bcbadda"></script> <script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script> <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script> <script src="_static/scripts/furo.js?v=46bd48cc"></script>
+134 -14
View File
@@ -7,12 +7,12 @@
<link rel="prefetch" href="_static/rns_logo_512.png" as="image"> <link rel="prefetch" href="_static/rns_logo_512.png" as="image">
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 --> <!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 -->
<title>Git Over Reticulum - Reticulum Network Stack 1.3.1 documentation</title> <title>Git Over Reticulum - Reticulum Network Stack 1.3.9 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" /> <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" />
<link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" /> <link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" />
<link rel="stylesheet" type="text/css" href="_static/custom.css?v=bb3cebc5" /> <link rel="stylesheet" type="text/css" href="_static/custom.css?v=e1715074" />
@@ -180,7 +180,7 @@
</label> </label>
</div> </div>
<div class="header-center"> <div class="header-center">
<a href="index.html"><div class="brand">Reticulum Network Stack 1.3.1 documentation</div></a> <a href="index.html"><div class="brand">Reticulum Network Stack 1.3.9 documentation</div></a>
</div> </div>
<div class="header-right"> <div class="header-right">
<div class="theme-toggle-container theme-toggle-header"> <div class="theme-toggle-container theme-toggle-header">
@@ -204,7 +204,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/> <img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div> </div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.3.1 documentation</span> <span class="sidebar-brand-text">Reticulum Network Stack 1.3.9 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search"> </a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search"> <input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -946,20 +946,30 @@ argument to <code class="docutils literal notranslate"><span class="pre">rngit</
</pre></div> </pre></div>
</div> </div>
<p>If your pattern contains no wildcard characters, it must match an artifact name exactly, which is useful for fetching single, specific artifacts. When a pattern matches multiple artifacts, all matched files are fetched and verified. If no artifacts match the pattern, the fetch aborts with an error indicating no matches were found.</p> <p>If your pattern contains no wildcard characters, it must match an artifact name exactly, which is useful for fetching single, specific artifacts. When a pattern matches multiple artifacts, all matched files are fetched and verified. If no artifacts match the pattern, the fetch aborts with an error indicating no matches were found.</p>
<p><strong>Offline Verification</strong></p> </section>
<section id="offline-verification">
<h3>Offline Verification<a class="headerlink" href="#offline-verification" title="Link to this heading"></a></h3>
<p>Because the release manifest contains embedded signatures, you can verify the integrity of release artifacts offline, without connecting to the repository node. The <code class="docutils literal notranslate"><span class="pre">rnid</span></code> and <code class="docutils literal notranslate"><span class="pre">rngit</span></code> utilities can validate artifact signatures against <code class="docutils literal notranslate"><span class="pre">.rsg</span></code> and manifest files.</p> <p>Because the release manifest contains embedded signatures, you can verify the integrity of release artifacts offline, without connecting to the repository node. The <code class="docutils literal notranslate"><span class="pre">rnid</span></code> and <code class="docutils literal notranslate"><span class="pre">rngit</span></code> utilities can validate artifact signatures against <code class="docutils literal notranslate"><span class="pre">.rsg</span></code> and manifest files.</p>
<p><strong>Using a release manifest:</strong></p>
<p>Ensure the release manifest is located in the same directory as the release artifacts, then run:</p>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span># Verify all artifacts in the manifest
$ rngit release myapp-1.2.0.rsm verify
# Or, verify only specific artifacts
$ rngit release myapp-1.2.0.rsm verify &quot;latest:*.whl&quot;
</pre></div>
</div>
<p>This will load the manifest, and verify all files currently on-disk, but will not attempt to fetch the latest release manifest from the origin, or update local files to match it.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The <code class="docutils literal notranslate"><span class="pre">verify</span></code> operation is functionally equivalent to using the <code class="docutils literal notranslate"><span class="pre">fetch</span></code> operation with the <code class="docutils literal notranslate"><span class="pre">--offline</span></code> flag, and they can be used interchangably.</p>
</div>
<p><strong>For individual files:</strong></p> <p><strong>For individual files:</strong></p>
<p>Ensure the <code class="docutils literal notranslate"><span class="pre">.rsg</span></code> signature is located in the same directory as the release artifact, then run:</p> <p>Ensure the <code class="docutils literal notranslate"><span class="pre">.rsg</span></code> signature is located in the same directory as the release artifact, then run:</p>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>$ rnid -V myapp-1.2.0.tar.gz <div class="highlight-text notranslate"><div class="highlight"><pre><span></span>$ rnid -V myapp-1.2.0.tar.gz
</pre></div> </pre></div>
</div> </div>
<p>This validates that the artifact file matches the signature created during the release process. Combined with the manifest’s own signature, this provides end-to-end verification from the original release creation to the final installation.</p> <p>This validates that the artifact file matches the signature created during the release process. Combined with the manifest’s own signature, this provides end-to-end verification from the original release creation to the final installation.</p>
<p><strong>For a complete release:</strong></p>
<p>Ensure the release manifest is located in the same directory as the release artifacts, then run:</p>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>$ rngit release myapp-1.2.0.rsm fetch --offline
</pre></div>
</div>
<p>This will load the manifest, and verify all files currently on-disk, but will not attempt to fetch the latest release manifest from the origin, or update local files to match it.</p>
</section> </section>
<section id="creating-signed-releases"> <section id="creating-signed-releases">
<span id="git-release-create"></span><h3>Creating Signed Releases<a class="headerlink" href="#creating-signed-releases" title="Link to this heading"></a></h3> <span id="git-release-create"></span><h3>Creating Signed Releases<a class="headerlink" href="#creating-signed-releases" title="Link to this heading"></a></h3>
@@ -967,7 +977,7 @@ argument to <code class="docutils literal notranslate"><span class="pre">rngit</
<ol class="arabic simple"> <ol class="arabic simple">
<li><p>Generates an Ed25519 signature for each artifact file using your identity’s signing key</p></li> <li><p>Generates an Ed25519 signature for each artifact file using your identity’s signing key</p></li>
<li><p>Creates <code class="docutils literal notranslate"><span class="pre">.rsg</span></code> signature files alongside each artifact in your distribution directory</p></li> <li><p>Creates <code class="docutils literal notranslate"><span class="pre">.rsg</span></code> signature files alongside each artifact in your distribution directory</p></li>
<li><p>Constructs a signed release manifest (<code class="docutils literal notranslate"><span class="pre">manifest.rsm</span></code>) containing metadata, an artifact list, and embedded signatures</p></li> <li><p>Constructs a signed <code class="docutils literal notranslate"><span class="pre">manifest.rsm</span></code> release manifest containing metadata, an artifact list, and embedded signatures</p></li>
<li><p>Transmits both artifacts, signatures and manifest to the remote node specified as release origin</p></li> <li><p>Transmits both artifacts, signatures and manifest to the remote node specified as release origin</p></li>
</ol> </ol>
<p>As an example, to create and publish a release from all files in the folder named <code class="docutils literal notranslate"><span class="pre">dist</span></code>, simply run:</p> <p>As an example, to create and publish a release from all files in the folder named <code class="docutils literal notranslate"><span class="pre">dist</span></code>, simply run:</p>
@@ -1296,7 +1306,7 @@ adm:9710b86ba12c42d1d8f30f74fe509286
<li><p><code class="docutils literal notranslate"><span class="pre">N</span></code> - Numbered comment files (msgpack format)</p></li> <li><p><code class="docutils literal notranslate"><span class="pre">N</span></code> - Numbered comment files (msgpack format)</p></li>
</ul> </ul>
<p><strong>Nomad Network Interface</strong></p> <p><strong>Nomad Network Interface</strong></p>
<p>When the Nomad Network page node is enabled, work documents are viewable through the web interface. The work page lists all documents with their status, and clicking a document shows its full content and updates.</p> <p>When the Nomad Network page node is enabled, work documents are viewable through the nomadnet interface. The work page lists all documents with their status, and clicking a document shows its full content and updates.</p>
</section> </section>
<section id="cryptographic-attribution"> <section id="cryptographic-attribution">
<h3>Cryptographic Attribution<a class="headerlink" href="#cryptographic-attribution" title="Link to this heading"></a></h3> <h3>Cryptographic Attribution<a class="headerlink" href="#cryptographic-attribution" title="Link to this heading"></a></h3>
@@ -1346,6 +1356,107 @@ options:
</div> </div>
</section> </section>
</section> </section>
<section id="commit-signing">
<span id="git-commit-signing"></span><h2>Commit Signing<a class="headerlink" href="#commit-signing" title="Link to this heading"></a></h2>
<p>The <code class="docutils literal notranslate"><span class="pre">rngit</span></code> system includes <code class="docutils literal notranslate"><span class="pre">rngcs</span></code>, a Git commit signing and validation shim that enables commit signing and validation using Reticulum identities. By hooking into Git’s SSH-based signing format, commits can be signed and verified using Reticulum identity keys directly.</p>
<p>Unlike traditional GPG and SSH-based commit signing, which relies on centralized keyservers, cumbersome co-signing procedures or manual per-signer setup, Reticulum commit signing uses self-contained RSG signatures, that can be deterministically resolved to Reticulum identity hashes.</p>
<p>This enables offline verification with no external infrastructure. The signature itself contains everything needed to cryptographically verify the signer’s Reticulum identity and that the commit was signed correctly by the claimed identity.</p>
<section id="prerequisites">
<h3>Prerequisites<a class="headerlink" href="#prerequisites" title="Link to this heading"></a></h3>
<p>Before you can sign commits, you need a Reticulum identity with a private key. If you don’t already have one, you can generate it using <code class="docutils literal notranslate"><span class="pre">rnid</span></code>:</p>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>$ rnid -g ~/.rngit/client_identity
New identity &lt;1a54d64db7e8beca6f2c6cd17b0cb479&gt; written to /home/user/.rngit/client_identity
</pre></div>
</div>
<p>The identity file must contain the private key to be usable for signing. The corresponding Reticulum identity hash will be used as the commit author identity.</p>
</section>
<section id="id1">
<h3>Configuration<a class="headerlink" href="#id1" title="Link to this heading"></a></h3>
<p>Git must be configured to use SSH-format signatures with the <code class="docutils literal notranslate"><span class="pre">rngcs</span></code> signing shim, which is included in RNS. You can configure this either globally or per-repository.</p>
<p><strong>Global Configuration</strong></p>
<p>Enabling Reticulum commit signing for all repositories is as simple as:</p>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>$ git config --global gpg.format ssh
$ git config --global gpg.ssh.program rngcs
$ git config --global gpg.ssh.allowedsignersfile none
$ git config --global user.signingKey ~/.rngit/client_identity
</pre></div>
</div>
<p>With this configuration, all commits you sign with <code class="docutils literal notranslate"><span class="pre">git</span> <span class="pre">commit</span> <span class="pre">-S</span></code> will use your Reticulum identity.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The <code class="docutils literal notranslate"><span class="pre">gpg.ssh.allowedsignersfile</span></code> configuration key <strong>must</strong> be <em>set</em> for <code class="docutils literal notranslate"><span class="pre">git</span></code> to allow invoking the signing and verification shim. It is not actually used by <code class="docutils literal notranslate"><span class="pre">rngcs</span></code>, and can be set to an arbitrary value. All validation operations happen exclusively based on the information in the embedded RSG data.</p>
</div>
<p><strong>Per-Repository Configuration</strong></p>
<p>To enable signing only for a specific repository:</p>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>$ cd /path/to/repository
$ git config --local gpg.format ssh
$ git config --local gpg.ssh.program rngcs
$ git config --local gpg.ssh.allowedsignersfile none
$ git config --local user.signingKey ~/.rngit/client_identity
</pre></div>
</div>
<p>This is useful when you want to use different identities for different projects, or when only specific repositories require signed commits.</p>
</section>
<section id="author-identity-binding">
<h3>Author Identity Binding<a class="headerlink" href="#author-identity-binding" title="Link to this heading"></a></h3>
<p>For the signature to be valid, the Git author email <strong>must</strong> match the Reticulum identity hash of the signing key. You can configure this using a command like the following:</p>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>$ git config --global user.email &quot;1a54d64db7e8beca6f2c6cd17b0cb479&quot;
</pre></div>
</div>
<p>When <code class="docutils literal notranslate"><span class="pre">rngcs</span></code> verifies a commit, it extracts both the Git author field of the signed commit message and the signer identity from the RSG signature, ensuring they match. This binding is necessary to prevent identity spoofing. If someone crafts a commit with your identity hash in the author field but signs with a different key, verification will fail.</p>
</section>
<section id="signing-commits">
<h3>Signing Commits<a class="headerlink" href="#signing-commits" title="Link to this heading"></a></h3>
<p>Once configured, sign commits using the standard Git <code class="docutils literal notranslate"><span class="pre">-S</span></code> flag:</p>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>$ git commit -S -m &quot;Refactored module&quot;
[master 8f7e6d5] Refactored module
</pre></div>
</div>
<p>This will create a self-contained RSG-formatted signature, encode the RSG payload using base64, and wrap it in an ASCII-armored SSH-formatted signature block. The signature is then stored in the commit object’s signature header and includes:</p>
<ul class="simple">
<li><p>The SHA256 hash of the commit content</p></li>
<li><p>The signer’s Reticulum identity hash</p></li>
<li><p>The signer’s public key</p></li>
<li><p>The actual signature of the complete envelope</p></li>
</ul>
</section>
<section id="validating-commit-signatures">
<h3>Validating Commit Signatures<a class="headerlink" href="#validating-commit-signatures" title="Link to this heading"></a></h3>
<p>Commits are automatically validated when using <code class="docutils literal notranslate"><span class="pre">git</span> <span class="pre">log</span> <span class="pre">--show-signature</span></code> or <code class="docutils literal notranslate"><span class="pre">git</span> <span class="pre">show</span> <span class="pre">--show-signature</span></code>. The <code class="docutils literal notranslate"><span class="pre">rngcs</span></code> shim handles all verification operations. If any step fails, verification fails and Git displays an error.</p>
<p>To view signature information for commits, use Git’s standard <code class="docutils literal notranslate"><span class="pre">--show-signature</span></code> option:</p>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>$ git log --show-signature
commit 8f7e6d5c8f7e6d5c8f7e6d5c8f7e6d5c8f7e6d5
Good &quot;git&quot; signature for commit, signed with Reticulum Identity key &lt;1a54d64db7e8beca6f2c6cd17b0cb479&gt;
Author: Developer &lt;1a54d64db7e8beca6f2c6cd17b0cb479&gt;
Date: Mon Jan 15 09:30:00 2026 +0100
Refactored module
</pre></div>
</div>
<p>The output shows whether the commit signature is valid, and whether the author field matches the signing identity.</p>
<div class="admonition tip">
<p class="admonition-title">Tip</p>
<p>If you want to display both the identity hash and LXMF address for authors, you can generate a <code class="docutils literal notranslate"><span class="pre">.mailmap</span></code> file that resolves identities to LXMF addresses with the following script:</p>
<div class="highlight-#!/bin/bash notranslate"><div class="highlight"><pre><span></span>DIR=&quot;$( cd &quot;$( dirname &quot;${BASH_SOURCE[0]}&quot; )&quot; &gt;/dev/null 2&gt;&amp;1 &amp;&amp; pwd )&quot;
cd $DIR
id_regex=&quot;&lt;([0-9a-f]{32})( .*)*&gt;&quot;
extract_id=&quot;s/.*$id_regex/\1/g&quot;
rm -f .mailmap
git shortlog -se | grep -Ee &quot;$id_regex&quot; | sed -r &quot;$extract_id&quot; | while read -r id ; do
if lxmf=$(rnid -i $id -H lxmf.delivery | grep -Ee &quot;destination for this Identity is&quot; | sed -r &quot;$extract_id&quot;); then
echo &quot;&lt;$id lxmf:$lxmf&gt; &lt;$id&gt;&quot; &gt;&gt; .mailmap
fi
done
</pre></div>
</div>
</div>
</section>
</section>
</section> </section>
</article> </article>
@@ -1446,6 +1557,7 @@ options:
</li> </li>
<li><a class="reference internal" href="#verified-releases">Verified Releases</a><ul> <li><a class="reference internal" href="#verified-releases">Verified Releases</a><ul>
<li><a class="reference internal" href="#obtaining-verified-releases">Obtaining Verified Releases</a></li> <li><a class="reference internal" href="#obtaining-verified-releases">Obtaining Verified Releases</a></li>
<li><a class="reference internal" href="#offline-verification">Offline Verification</a></li>
<li><a class="reference internal" href="#creating-signed-releases">Creating Signed Releases</a></li> <li><a class="reference internal" href="#creating-signed-releases">Creating Signed Releases</a></li>
</ul> </ul>
</li> </li>
@@ -1463,6 +1575,14 @@ options:
<li><a class="reference internal" href="#cryptographic-attribution">Cryptographic Attribution</a></li> <li><a class="reference internal" href="#cryptographic-attribution">Cryptographic Attribution</a></li>
</ul> </ul>
</li> </li>
<li><a class="reference internal" href="#commit-signing">Commit Signing</a><ul>
<li><a class="reference internal" href="#prerequisites">Prerequisites</a></li>
<li><a class="reference internal" href="#id1">Configuration</a></li>
<li><a class="reference internal" href="#author-identity-binding">Author Identity Binding</a></li>
<li><a class="reference internal" href="#signing-commits">Signing Commits</a></li>
<li><a class="reference internal" href="#validating-commit-signatures">Validating Commit Signatures</a></li>
</ul>
</li>
</ul> </ul>
</li> </li>
</ul> </ul>
@@ -1474,7 +1594,7 @@ options:
</aside> </aside>
</div> </div>
</div><script src="_static/documentation_options.js?v=bb516dca"></script> </div><script src="_static/documentation_options.js?v=98c25ec5"></script>
<script src="_static/doctools.js?v=9bcbadda"></script> <script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script> <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script> <script src="_static/scripts/furo.js?v=46bd48cc"></script>
+5 -5
View File
@@ -7,12 +7,12 @@
<link rel="prefetch" href="_static/rns_logo_512.png" as="image"> <link rel="prefetch" href="_static/rns_logo_512.png" as="image">
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 --> <!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 -->
<title>Communications Hardware - Reticulum Network Stack 1.3.1 documentation</title> <title>Communications Hardware - Reticulum Network Stack 1.3.9 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" /> <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" />
<link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" /> <link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" />
<link rel="stylesheet" type="text/css" href="_static/custom.css?v=bb3cebc5" /> <link rel="stylesheet" type="text/css" href="_static/custom.css?v=e1715074" />
@@ -180,7 +180,7 @@
</label> </label>
</div> </div>
<div class="header-center"> <div class="header-center">
<a href="index.html"><div class="brand">Reticulum Network Stack 1.3.1 documentation</div></a> <a href="index.html"><div class="brand">Reticulum Network Stack 1.3.9 documentation</div></a>
</div> </div>
<div class="header-right"> <div class="header-right">
<div class="theme-toggle-container theme-toggle-header"> <div class="theme-toggle-container theme-toggle-header">
@@ -204,7 +204,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/> <img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div> </div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.3.1 documentation</span> <span class="sidebar-brand-text">Reticulum Network Stack 1.3.9 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search"> </a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search"> <input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -676,7 +676,7 @@ can be used with Reticulum. This includes virtual software modems such as
</aside> </aside>
</div> </div>
</div><script src="_static/documentation_options.js?v=bb516dca"></script> </div><script src="_static/documentation_options.js?v=98c25ec5"></script>
<script src="_static/doctools.js?v=9bcbadda"></script> <script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script> <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script> <script src="_static/scripts/furo.js?v=46bd48cc"></script>
+15 -5
View File
@@ -7,12 +7,12 @@
<link rel="prefetch" href="_static/rns_logo_512.png" as="image"> <link rel="prefetch" href="_static/rns_logo_512.png" as="image">
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 --> <!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 -->
<title>Reticulum Network Stack 1.3.1 documentation</title> <title>Reticulum Network Stack 1.3.9 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" /> <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" />
<link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" /> <link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" />
<link rel="stylesheet" type="text/css" href="_static/custom.css?v=bb3cebc5" /> <link rel="stylesheet" type="text/css" href="_static/custom.css?v=e1715074" />
@@ -180,7 +180,7 @@
</label> </label>
</div> </div>
<div class="header-center"> <div class="header-center">
<a href="#"><div class="brand">Reticulum Network Stack 1.3.1 documentation</div></a> <a href="#"><div class="brand">Reticulum Network Stack 1.3.9 documentation</div></a>
</div> </div>
<div class="header-right"> <div class="header-right">
<div class="theme-toggle-container theme-toggle-header"> <div class="theme-toggle-container theme-toggle-header">
@@ -204,7 +204,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/> <img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div> </div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.3.1 documentation</span> <span class="sidebar-brand-text">Reticulum Network Stack 1.3.9 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search"> </a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search"> <input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -486,6 +486,7 @@ to participate in the development of Reticulum itself.</p>
<li class="toctree-l2"><a class="reference internal" href="interfaces.html#backbone-interface">Backbone Interface</a><ul> <li class="toctree-l2"><a class="reference internal" href="interfaces.html#backbone-interface">Backbone Interface</a><ul>
<li class="toctree-l3"><a class="reference internal" href="interfaces.html#listeners">Listeners</a></li> <li class="toctree-l3"><a class="reference internal" href="interfaces.html#listeners">Listeners</a></li>
<li class="toctree-l3"><a class="reference internal" href="interfaces.html#connecting-remotes">Connecting Remotes</a></li> <li class="toctree-l3"><a class="reference internal" href="interfaces.html#connecting-remotes">Connecting Remotes</a></li>
<li class="toctree-l3"><a class="reference internal" href="interfaces.html#automated-blocking">Automated Blocking</a></li>
</ul> </ul>
</li> </li>
<li class="toctree-l2"><a class="reference internal" href="interfaces.html#tcp-server-interface">TCP Server Interface</a></li> <li class="toctree-l2"><a class="reference internal" href="interfaces.html#tcp-server-interface">TCP Server Interface</a></li>
@@ -581,6 +582,7 @@ to participate in the development of Reticulum itself.</p>
</li> </li>
<li class="toctree-l2"><a class="reference internal" href="git.html#verified-releases">Verified Releases</a><ul> <li class="toctree-l2"><a class="reference internal" href="git.html#verified-releases">Verified Releases</a><ul>
<li class="toctree-l3"><a class="reference internal" href="git.html#obtaining-verified-releases">Obtaining Verified Releases</a></li> <li class="toctree-l3"><a class="reference internal" href="git.html#obtaining-verified-releases">Obtaining Verified Releases</a></li>
<li class="toctree-l3"><a class="reference internal" href="git.html#offline-verification">Offline Verification</a></li>
<li class="toctree-l3"><a class="reference internal" href="git.html#creating-signed-releases">Creating Signed Releases</a></li> <li class="toctree-l3"><a class="reference internal" href="git.html#creating-signed-releases">Creating Signed Releases</a></li>
</ul> </ul>
</li> </li>
@@ -598,6 +600,14 @@ to participate in the development of Reticulum itself.</p>
<li class="toctree-l3"><a class="reference internal" href="git.html#cryptographic-attribution">Cryptographic Attribution</a></li> <li class="toctree-l3"><a class="reference internal" href="git.html#cryptographic-attribution">Cryptographic Attribution</a></li>
</ul> </ul>
</li> </li>
<li class="toctree-l2"><a class="reference internal" href="git.html#commit-signing">Commit Signing</a><ul>
<li class="toctree-l3"><a class="reference internal" href="git.html#prerequisites">Prerequisites</a></li>
<li class="toctree-l3"><a class="reference internal" href="git.html#id1">Configuration</a></li>
<li class="toctree-l3"><a class="reference internal" href="git.html#author-identity-binding">Author Identity Binding</a></li>
<li class="toctree-l3"><a class="reference internal" href="git.html#signing-commits">Signing Commits</a></li>
<li class="toctree-l3"><a class="reference internal" href="git.html#validating-commit-signatures">Validating Commit Signatures</a></li>
</ul>
</li>
</ul> </ul>
</li> </li>
<li class="toctree-l1"><a class="reference internal" href="support.html">Support Reticulum</a><ul> <li class="toctree-l1"><a class="reference internal" href="support.html">Support Reticulum</a><ul>
@@ -710,7 +720,7 @@ to participate in the development of Reticulum itself.</p>
</aside> </aside>
</div> </div>
</div><script src="_static/documentation_options.js?v=bb516dca"></script> </div><script src="_static/documentation_options.js?v=98c25ec5"></script>
<script src="_static/doctools.js?v=9bcbadda"></script> <script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script> <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script> <script src="_static/scripts/furo.js?v=46bd48cc"></script>
+83 -6
View File
@@ -7,12 +7,12 @@
<link rel="prefetch" href="_static/rns_logo_512.png" as="image"> <link rel="prefetch" href="_static/rns_logo_512.png" as="image">
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 --> <!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 -->
<title>Configuring Interfaces - Reticulum Network Stack 1.3.1 documentation</title> <title>Configuring Interfaces - Reticulum Network Stack 1.3.9 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" /> <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" />
<link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" /> <link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" />
<link rel="stylesheet" type="text/css" href="_static/custom.css?v=bb3cebc5" /> <link rel="stylesheet" type="text/css" href="_static/custom.css?v=e1715074" />
@@ -180,7 +180,7 @@
</label> </label>
</div> </div>
<div class="header-center"> <div class="header-center">
<a href="index.html"><div class="brand">Reticulum Network Stack 1.3.1 documentation</div></a> <a href="index.html"><div class="brand">Reticulum Network Stack 1.3.9 documentation</div></a>
</div> </div>
<div class="header-right"> <div class="header-right">
<div class="theme-toggle-container theme-toggle-header"> <div class="theme-toggle-container theme-toggle-header">
@@ -204,7 +204,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/> <img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div> </div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.3.1 documentation</span> <span class="sidebar-brand-text">Reticulum Network Stack 1.3.9 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search"> </a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search"> <input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -460,6 +460,47 @@ specify the target Yggdrasil IPv6 address and port, like so:</p>
</pre></div> </pre></div>
</div> </div>
</section> </section>
<section id="automated-blocking">
<h3>Automated Blocking<a class="headerlink" href="#automated-blocking" title="Link to this heading"></a></h3>
<p>Listener instances of <code class="docutils literal notranslate"><span class="pre">BackboneInterface</span></code> will automatically block fast-flapping clients,
that repeatedly connect for a short amount of time, and then disconnect. Such behavior usually
occurs from clients trying to spam the network with announces or path requests, by connecting, dumping
a massive amount of requests, and then disconnecting in an attempt to bypass rate limits.</p>
<p>While such bypass attempts only have very limited effect on the amount of spam actually dumped (ingress limits
trigger immediately once a client exceeds rate limits), the behavior is often seen anyways, and
causes log noise and needless interface rotation. The fast-flapping block ensures such clients
are never allocated an interface on the transport instance.</p>
<p>Another common cause can simply be clients using implementations that are broken, or automated
scanning tools attempting to connect to the instance.</p>
<div class="highlight-ini notranslate"><div class="highlight"><pre><span></span><span class="k">[[Backbone Listener]]</span>
<span class="w"> </span><span class="na">type</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">BackboneInterface</span>
<span class="w"> </span><span class="na">enabled</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">yes</span>
<span class="w"> </span><span class="na">listen_on</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">0.0.0.0</span>
<span class="w"> </span><span class="na">port</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">4242</span>
<span class="w"> </span><span class="c1"># Whether to enable blocking</span>
<span class="w"> </span><span class="na">block_fast_flapping</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">yes</span>
<span class="w"> </span><span class="c1"># How long an IP address stays</span>
<span class="w"> </span><span class="c1"># blocked, in minutes. Set to</span>
<span class="w"> </span><span class="c1"># 12 hours by default.</span>
<span class="w"> </span><span class="na">fast_flapping_block_time</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">720</span>
<span class="w"> </span><span class="c1"># The minimum time, in seconds,</span>
<span class="w"> </span><span class="c1"># an interface must stay connected</span>
<span class="w"> </span><span class="c1"># to be considered not fast-flapping.</span>
<span class="w"> </span><span class="na">fast_flapping_threshold</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">20</span>
<span class="w"> </span><span class="c1"># Amount of fast flaps a remote</span>
<span class="w"> </span><span class="c1"># IP can perform before having</span>
<span class="w"> </span><span class="c1"># blocking triggered.</span>
<span class="w"> </span><span class="na">fast_flapping_grace</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">5</span>
</pre></div>
</div>
<p>The configuration options listed in the example above are the <em>default values</em>, and you do
not need to add them for automated blocking to work, but you can use them to change the
behavior from the defaults, if necessary.</p>
</section>
</section> </section>
<section id="tcp-server-interface"> <section id="tcp-server-interface">
<span id="interfaces-tcps"></span><h2>TCP Server Interface<a class="headerlink" href="#tcp-server-interface" title="Link to this heading"></a></h2> <span id="interfaces-tcps"></span><h2>TCP Server Interface<a class="headerlink" href="#tcp-server-interface" title="Link to this heading"></a></h2>
@@ -1154,9 +1195,15 @@ curl<span class="w"> </span>-s<span class="w"> </span>ip.me
</dl> </dl>
<p><strong>Physical Location</strong></p> <p><strong>Physical Location</strong></p>
<dl class="simple"> <dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">latitude</span></code>, <code class="docutils literal notranslate"><span class="pre">longitude</span></code>, <code class="docutils literal notranslate"><span class="pre">height</span></code></dt><dd><p>Optional physical coordinates for the interface. These are useful for mapping discovered interfaces geographically or for clients to automatically select the nearest access point. Coordinates should be in decimal degrees, height in meters.</p> <dt><code class="docutils literal notranslate"><span class="pre">latitude</span></code>, <code class="docutils literal notranslate"><span class="pre">longitude</span></code>, <code class="docutils literal notranslate"><span class="pre">height</span></code></dt><dd><p>Optional physical coordinates for the interface. These are useful for mapping discovered interfaces geographically or for clients to automatically select the nearest access point. Coordinates should be in decimal degrees, height in meters above mean sea level.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">location_cmd</span></code></dt><dd><p>Optional path to executable or script that returns the physical coordinates for the interface. This can be used instead of manually setting <code class="docutils literal notranslate"><span class="pre">latitude</span></code>, <code class="docutils literal notranslate"><span class="pre">longitude</span></code> and <code class="docutils literal notranslate"><span class="pre">height</span></code>. Reticulum expects the script to output the location data to <code class="docutils literal notranslate"><span class="pre">stdout</span></code> on a single line, separated by commas, with values as floating point numbers in the format <code class="docutils literal notranslate"><span class="pre">LAT,</span> <span class="pre">LON,</span> <span class="pre">HEIGHT</span></code>. Coordinates should be in decimal degrees, height in meters above mean sea level.</p>
</dd> </dd>
</dl> </dl>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The height value for interface discovery is specified in <em>height above mean sea level</em>! This is the geoid-corrected height value, and is distinct from GPS altitude. If you manually specify height, it will typically be set to what you find on a topographical map. If you are using a script to output the location data, make sure that you are using the geoid-corrected altitude, not height above the GPS ellipsoid. Most GPS systems will make both figures available.</p>
</div>
<p><strong>Radio Parameters</strong></p> <p><strong>Radio Parameters</strong></p>
<p>For physical radio interfaces like <code class="docutils literal notranslate"><span class="pre">RNodeInterface</span></code> or <code class="docutils literal notranslate"><span class="pre">KISSInterface</span></code>, the following optional parameters allow you to broadcast the operating frequency and characteristics, allowing clients to verify compatibility before connecting:</p> <p>For physical radio interfaces like <code class="docutils literal notranslate"><span class="pre">RNodeInterface</span></code> or <code class="docutils literal notranslate"><span class="pre">KISSInterface</span></code>, the following optional parameters allow you to broadcast the operating frequency and characteristics, allowing clients to verify compatibility before connecting:</p>
<dl class="simple"> <dl class="simple">
@@ -1361,6 +1408,24 @@ link or a remote TCP tunnel) solely to discover better local
infrastructure, which then supersedes the bootstrap interface.</div> infrastructure, which then supersedes the bootstrap interface.</div>
</div> </div>
</li> </li>
<li><div class="line-block">
<div class="line">The <code class="docutils literal notranslate"><span class="pre">recursive_prs</span></code> option allows you to enable recursive path
discovery on an interface regardless of its configured interface
mode. When this option is enabled, Reticulum will attempt to
recursively discover paths for path requests received on this
interface.</div>
</div>
</li>
<li><div class="line-block">
<div class="line">The <code class="docutils literal notranslate"><span class="pre">announces_from_internal</span></code> option controls whether any
announces <em>received on</em> an <code class="docutils literal notranslate"><span class="pre">internal</span></code> mode interface will
propagate <em>out</em> on the interface this option is set on. Note
that this controls <em>announce propagation</em>; even if announces
do not propagate out when received, paths to destinations on
<code class="docutils literal notranslate"><span class="pre">internal</span></code> mode interfaces may still be resolvable by means
of path requests.</div>
</div>
</li>
</ul> </ul>
</div></blockquote> </div></blockquote>
</section> </section>
@@ -1451,6 +1516,17 @@ public Transport Node available on the Internet, the interface
connecting over the Internet should be set to <code class="docutils literal notranslate"><span class="pre">boundary</span></code> mode.</div> connecting over the Internet should be set to <code class="docutils literal notranslate"><span class="pre">boundary</span></code> mode.</div>
</div> </div>
</li> </li>
<li><div class="line-block">
<div class="line">The <code class="docutils literal notranslate"><span class="pre">internal</span></code> mode designates interfaces that belong to a
network different from any marked as <code class="docutils literal notranslate"><span class="pre">boundary</span></code>. Announces from
a <code class="docutils literal notranslate"><span class="pre">boundary</span></code> interface will not propagate to interfaces set as
<code class="docutils literal notranslate"><span class="pre">internal</span></code>, but announces <em>will</em> propagate from <code class="docutils literal notranslate"><span class="pre">internal</span></code> <em>to</em>
<code class="docutils literal notranslate"><span class="pre">boundary</span></code>. Devices on the <code class="docutils literal notranslate"><span class="pre">internal</span></code> side of the network will
still be able to resolve paths to destinations across the boundary
when needed, since recursive path requests are enabled for <code class="docutils literal notranslate"><span class="pre">internal</span></code>
mode interfaces by default.</div>
</div>
</li>
</ul> </ul>
</div></blockquote> </div></blockquote>
<p>For a table describing the impact of all modes on announce propagation, <p>For a table describing the impact of all modes on announce propagation,
@@ -1738,6 +1814,7 @@ interface basis under the relevant interface configuration section.</p>
<li><a class="reference internal" href="#backbone-interface">Backbone Interface</a><ul> <li><a class="reference internal" href="#backbone-interface">Backbone Interface</a><ul>
<li><a class="reference internal" href="#listeners">Listeners</a></li> <li><a class="reference internal" href="#listeners">Listeners</a></li>
<li><a class="reference internal" href="#connecting-remotes">Connecting Remotes</a></li> <li><a class="reference internal" href="#connecting-remotes">Connecting Remotes</a></li>
<li><a class="reference internal" href="#automated-blocking">Automated Blocking</a></li>
</ul> </ul>
</li> </li>
<li><a class="reference internal" href="#tcp-server-interface">TCP Server Interface</a></li> <li><a class="reference internal" href="#tcp-server-interface">TCP Server Interface</a></li>
@@ -1774,7 +1851,7 @@ interface basis under the relevant interface configuration section.</p>
</aside> </aside>
</div> </div>
</div><script src="_static/documentation_options.js?v=bb516dca"></script> </div><script src="_static/documentation_options.js?v=98c25ec5"></script>
<script src="_static/doctools.js?v=9bcbadda"></script> <script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script> <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script> <script src="_static/scripts/furo.js?v=46bd48cc"></script>
+5 -5
View File
@@ -7,12 +7,12 @@
<link rel="prefetch" href="_static/rns_logo_512.png" as="image"> <link rel="prefetch" href="_static/rns_logo_512.png" as="image">
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 --> <!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 -->
<title>Reticulum License - Reticulum Network Stack 1.3.1 documentation</title> <title>Reticulum License - Reticulum Network Stack 1.3.9 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" /> <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" />
<link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" /> <link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" />
<link rel="stylesheet" type="text/css" href="_static/custom.css?v=bb3cebc5" /> <link rel="stylesheet" type="text/css" href="_static/custom.css?v=e1715074" />
@@ -180,7 +180,7 @@
</label> </label>
</div> </div>
<div class="header-center"> <div class="header-center">
<a href="index.html"><div class="brand">Reticulum Network Stack 1.3.1 documentation</div></a> <a href="index.html"><div class="brand">Reticulum Network Stack 1.3.9 documentation</div></a>
</div> </div>
<div class="header-right"> <div class="header-right">
<div class="theme-toggle-container theme-toggle-header"> <div class="theme-toggle-container theme-toggle-header">
@@ -204,7 +204,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/> <img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div> </div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.3.1 documentation</span> <span class="sidebar-brand-text">Reticulum Network Stack 1.3.9 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search"> </a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search"> <input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -345,7 +345,7 @@ SOFTWARE.
</aside> </aside>
</div> </div>
</div><script src="_static/documentation_options.js?v=bb516dca"></script> </div><script src="_static/documentation_options.js?v=98c25ec5"></script>
<script src="_static/doctools.js?v=9bcbadda"></script> <script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script> <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script> <script src="_static/scripts/furo.js?v=46bd48cc"></script>
+5 -5
View File
@@ -7,12 +7,12 @@
<link rel="prefetch" href="_static/rns_logo_512.png" as="image"> <link rel="prefetch" href="_static/rns_logo_512.png" as="image">
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 --> <!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 -->
<title>Building Networks - Reticulum Network Stack 1.3.1 documentation</title> <title>Building Networks - Reticulum Network Stack 1.3.9 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" /> <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" />
<link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" /> <link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" />
<link rel="stylesheet" type="text/css" href="_static/custom.css?v=bb3cebc5" /> <link rel="stylesheet" type="text/css" href="_static/custom.css?v=e1715074" />
@@ -180,7 +180,7 @@
</label> </label>
</div> </div>
<div class="header-center"> <div class="header-center">
<a href="index.html"><div class="brand">Reticulum Network Stack 1.3.1 documentation</div></a> <a href="index.html"><div class="brand">Reticulum Network Stack 1.3.9 documentation</div></a>
</div> </div>
<div class="header-right"> <div class="header-right">
<div class="theme-toggle-container theme-toggle-header"> <div class="theme-toggle-container theme-toggle-header">
@@ -204,7 +204,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/> <img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div> </div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.3.1 documentation</span> <span class="sidebar-brand-text">Reticulum Network Stack 1.3.9 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search"> </a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search"> <input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -664,7 +664,7 @@ differently than a mobile device roaming between radio cells.</p>
</aside> </aside>
</div> </div>
</div><script src="_static/documentation_options.js?v=bb516dca"></script> </div><script src="_static/documentation_options.js?v=98c25ec5"></script>
<script src="_static/doctools.js?v=9bcbadda"></script> <script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script> <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script> <script src="_static/scripts/furo.js?v=46bd48cc"></script>
Binary file not shown.
+5 -5
View File
@@ -7,12 +7,12 @@
<link rel="prefetch" href="_static/rns_logo_512.png" as="image"> <link rel="prefetch" href="_static/rns_logo_512.png" as="image">
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 --> <!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 -->
<title>API Reference - Reticulum Network Stack 1.3.1 documentation</title> <title>API Reference - Reticulum Network Stack 1.3.9 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" /> <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" />
<link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" /> <link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" />
<link rel="stylesheet" type="text/css" href="_static/custom.css?v=bb3cebc5" /> <link rel="stylesheet" type="text/css" href="_static/custom.css?v=e1715074" />
@@ -180,7 +180,7 @@
</label> </label>
</div> </div>
<div class="header-center"> <div class="header-center">
<a href="index.html"><div class="brand">Reticulum Network Stack 1.3.1 documentation</div></a> <a href="index.html"><div class="brand">Reticulum Network Stack 1.3.9 documentation</div></a>
</div> </div>
<div class="header-right"> <div class="header-right">
<div class="theme-toggle-container theme-toggle-header"> <div class="theme-toggle-container theme-toggle-header">
@@ -204,7 +204,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/> <img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div> </div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.3.1 documentation</span> <span class="sidebar-brand-text">Reticulum Network Stack 1.3.9 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search"> </a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search"> <input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -2519,7 +2519,7 @@ will announce it.</p>
</aside> </aside>
</div> </div>
</div><script src="_static/documentation_options.js?v=bb516dca"></script> </div><script src="_static/documentation_options.js?v=98c25ec5"></script>
<script src="_static/doctools.js?v=9bcbadda"></script> <script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script> <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script> <script src="_static/scripts/furo.js?v=46bd48cc"></script>
+5 -5
View File
@@ -8,11 +8,11 @@
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 --> <!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 -->
<meta name="robots" content="noindex" /> <meta name="robots" content="noindex" />
<title>Search - Reticulum Network Stack 1.3.1 documentation</title><link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" /> <title>Search - Reticulum Network Stack 1.3.9 documentation</title><link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" />
<link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" /> <link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" />
<link rel="stylesheet" type="text/css" href="_static/custom.css?v=bb3cebc5" /> <link rel="stylesheet" type="text/css" href="_static/custom.css?v=e1715074" />
@@ -180,7 +180,7 @@
</label> </label>
</div> </div>
<div class="header-center"> <div class="header-center">
<a href="index.html"><div class="brand">Reticulum Network Stack 1.3.1 documentation</div></a> <a href="index.html"><div class="brand">Reticulum Network Stack 1.3.9 documentation</div></a>
</div> </div>
<div class="header-right"> <div class="header-right">
<div class="theme-toggle-container theme-toggle-header"> <div class="theme-toggle-container theme-toggle-header">
@@ -204,7 +204,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/> <img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div> </div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.3.1 documentation</span> <span class="sidebar-brand-text">Reticulum Network Stack 1.3.9 documentation</span>
</a><form class="sidebar-search-container" method="get" action="#" role="search"> </a><form class="sidebar-search-container" method="get" action="#" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search"> <input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -304,7 +304,7 @@
</aside> </aside>
</div> </div>
</div><script src="_static/documentation_options.js?v=bb516dca"></script> </div><script src="_static/documentation_options.js?v=98c25ec5"></script>
<script src="_static/doctools.js?v=9bcbadda"></script> <script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script> <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script> <script src="_static/scripts/furo.js?v=46bd48cc"></script>
+1 -1
View File
@@ -1 +1 @@
Search.setIndex({"alltitles":{"A Carrier-Grade Fallacy":[[16,"a-carrier-grade-fallacy"]],"API Reference":[[10,null]],"ARM64":[[3,"arm64"]],"AX.25 KISS Interface":[[7,"ax-25-kiss-interface"]],"Accessing Repository Pages":[[4,"accessing-repository-pages"]],"Adding Radio Interfaces":[[3,"adding-radio-interfaces"]],"An Explanation of Reticulum for Human Beings":[[2,null]],"Anchor In The Flow":[[16,"anchor-in-the-flow"]],"Android":[[3,"android"]],"Announce":[[1,"announce"]],"Announce Propagation Rules":[[13,"announce-propagation-rules"]],"Announce Rate Control":[[7,"announce-rate-control"]],"Announcing Presence":[[16,"announcing-presence"]],"Artifact-Centered Workflows":[[0,"artifact-centered-workflows"]],"Auto Interface":[[7,"auto-interface"]],"Automated List Sourcing":[[14,"automated-list-sourcing"]],"Automatic Mirror Synchronization":[[4,"automatic-mirror-synchronization"]],"Backbone Interface":[[7,"backbone-interface"]],"Blackhole Management":[[14,"blackhole-management"]],"Bootstrapping Connectivity":[[3,"bootstrapping-connectivity"]],"Broadcast":[[1,"broadcast"]],"Buffer":[[1,"buffer"]],"Build Personal Infrastructure":[[3,"build-personal-infrastructure"]],"Building Networks":[[9,null]],"Channel":[[1,"channel"]],"Code Examples":[[1,null]],"Combining Hardware Types":[[5,"combining-hardware-types"]],"Command-Line Interaction":[[4,"command-line-interaction"]],"Common Interface Options":[[7,"common-interface-options"]],"Communications Hardware":[[5,null]],"Composable Primitives":[[0,"composable-primitives"]],"Concepts & Overview":[[9,"concepts-overview"]],"Conceptual Overview":[[13,"conceptual-overview"]],"Configuration":[[4,"configuration"]],"Configuration & Data":[[14,"configuration-data"]],"Configuration Example":[[4,"configuration-example"]],"Configuration Methods":[[4,"configuration-methods"]],"Configuring Interfaces":[[7,null]],"Connect to the Distributed Backbone":[[3,"connect-to-the-distributed-backbone"]],"Connecting Remotes":[[7,"connecting-remotes"]],"Connecting Reticulum Instances Over the Internet":[[3,"connecting-reticulum-instances-over-the-internet"]],"Contributing to the Global Ret":[[3,"contributing-to-the-global-ret"]],"Cost Of A Byte":[[16,"cost-of-a-byte"]],"Creating Empty Repositories":[[4,"creating-empty-repositories"]],"Creating RNodes":[[5,"creating-rnodes"]],"Creating Signed Releases":[[4,"creating-signed-releases"]],"Creating a Network With Reticulum":[[3,"creating-a-network-with-reticulum"]],"Creating and Using Custom Interfaces":[[3,"creating-and-using-custom-interfaces"]],"Creating and Using a Network Identity":[[13,"creating-and-using-a-network-identity"]],"Creator Permissions":[[4,"creator-permissions"]],"Cryptographic Attribution":[[4,"cryptographic-attribution"]],"Cryptographic Primitives":[[13,"cryptographic-primitives"]],"Current Status":[[15,"current-status"]],"Current Usage":[[13,"current-usage"]],"Custom Interfaces":[[1,"custom-interfaces"],[7,"custom-interfaces"]],"Customizing Templates":[[4,"customizing-templates"]],"Death To The Address":[[16,"death-to-the-address"]],"Debian Bookworm":[[3,"debian-bookworm"]],"Decentralization Or Uncentralizability?":[[16,"decentralization-or-uncentralizability"]],"Design Patterns For Post-IP Systems":[[16,"design-patterns-for-post-ip-systems"]],"Destination Naming":[[13,"destination-naming"]],"Destinations":[[13,"destinations"]],"Destinations, Not Addresses":[[9,"destinations-not-addresses"]],"Develop a Program with Reticulum":[[3,"develop-a-program-with-reticulum"]],"Discoverable Interfaces":[[7,"discoverable-interfaces"]],"Discovering Interfaces":[[14,"discovering-interfaces"]],"Discovery Parameters":[[7,"discovery-parameters"]],"Distributed Development":[[0,null]],"Distribution Without Intermediaries":[[0,"distribution-without-intermediaries"]],"Donations":[[12,"donations"]],"Echo":[[1,"echo"]],"Emergent Patterns":[[16,"emergent-patterns"]],"Enabling Discovery":[[7,"enabling-discovery"]],"Enabling the Git Page Node":[[4,"enabling-the-git-page-node"]],"Encryption Is Not A Feature":[[16,"encryption-is-not-a-feature"]],"Ethernet-based Hardware":[[5,"ethernet-based-hardware"]],"Ethics Of The Tool":[[16,"ethics-of-the-tool"]],"Example Configuration":[[7,"example-configuration"]],"Fabric Of The Independent":[[16,"fabric-of-the-independent"]],"Fallacy Of The Cloud":[[16,"fallacy-of-the-cloud"]],"Filetransfer":[[1,"filetransfer"]],"Finding Your Way":[[3,"finding-your-way"]],"Fixed Serial Port Names":[[14,"fixed-serial-port-names"]],"Flow & Time":[[16,"flow-time"]],"Forking Repositories":[[4,"forking-repositories"]],"Formatting & Syntax Highlighting":[[4,"formatting-syntax-highlighting"]],"Future Implications":[[13,"future-implications"]],"Getting Further":[[13,"getting-further"]],"Getting Started Fast":[[3,null]],"Git Configuration Parameters":[[4,"git-configuration-parameters"]],"Git Over Reticulum":[[4,null]],"Goals":[[13,"goals"]],"Heltec LoRa32 v2.0":[[5,"heltec-lora32-v2-0"]],"Heltec LoRa32 v3.0":[[5,"heltec-lora32-v3-0"]],"Heltec LoRa3Line truncated Search.setIndex({"alltitles":{"A Carrier-Grade Fallacy":[[16,"a-carrier-grade-fallacy"]],"API Reference":[[10,null]],"ARM64":[[3,"arm64"]],"AX.25 KISS Interface":[[7,"ax-25-kiss-interface"]],"Accessing Repository Pages":[[4,"accessing-repository-pages"]],"Adding Radio Interfaces":[[3,"adding-radio-interfaces"]],"An Explanation of Reticulum for Human Beings":[[2,null]],"Anchor In The Flow":[[16,"anchor-in-the-flow"]],"Android":[[3,"android"]],"Announce":[[1,"announce"]],"Announce Propagation Rules":[[13,"announce-propagation-rules"]],"Announce Rate Control":[[7,"announce-rate-control"]],"Announcing Presence":[[16,"announcing-presence"]],"Artifact-Centered Workflows":[[0,"artifact-centered-workflows"]],"Author Identity Binding":[[4,"author-identity-binding"]],"Auto Interface":[[7,"auto-interface"]],"Automated Blocking":[[7,"automated-blocking"]],"Automated List Sourcing":[[14,"automated-list-sourcing"]],"Automatic Mirror Synchronization":[[4,"automatic-mirror-synchronization"]],"Backbone Interface":[[7,"backbone-interface"]],"Blackhole Management":[[14,"blackhole-management"]],"Bootstrapping Connectivity":[[3,"bootstrapping-connectivity"]],"Broadcast":[[1,"broadcast"]],"Buffer":[[1,"buffer"]],"Build Personal Infrastructure":[[3,"build-personal-infrastructure"]],"Building Networks":[[9,null]],"Channel":[[1,"channel"]],"Code Examples":[[1,null]],"Combining Hardware Types":[[5,"combining-hardware-types"]],"Command-Line Interaction":[[4,"command-line-interaction"]],"Commit Signing":[[4,"commit-signing"]],"Common Interface Options":[[7,"common-interface-options"]],"Communications Hardware":[[5,null]],"Composable Primitives":[[0,"composable-primitives"]],"Concepts & Overview":[[9,"concepts-overview"]],"Conceptual Overview":[[13,"conceptual-overview"]],"Configuration":[[4,"configuration"],[4,"id1"]],"Configuration & Data":[[14,"configuration-data"]],"Configuration Example":[[4,"configuration-example"]],"Configuration Methods":[[4,"configuration-methods"]],"Configuring Interfaces":[[7,null]],"Connect to the Distributed Backbone":[[3,"connect-to-the-distributed-backbone"]],"Connecting Remotes":[[7,"connecting-remotes"]],"Connecting Reticulum Instances Over the Internet":[[3,"connecting-reticulum-instances-over-the-internet"]],"Contributing to the Global Ret":[[3,"contributing-to-the-global-ret"]],"Cost Of A Byte":[[16,"cost-of-a-byte"]],"Creating Empty Repositories":[[4,"creating-empty-repositories"]],"Creating RNodes":[[5,"creating-rnodes"]],"Creating Signed Releases":[[4,"creating-signed-releases"]],"Creating a Network With Reticulum":[[3,"creating-a-network-with-reticulum"]],"Creating and Using Custom Interfaces":[[3,"creating-and-using-custom-interfaces"]],"Creating and Using a Network Identity":[[13,"creating-and-using-a-network-identity"]],"Creator Permissions":[[4,"creator-permissions"]],"Cryptographic Attribution":[[4,"cryptographic-attribution"]],"Cryptographic Primitives":[[13,"cryptographic-primitives"]],"Current Status":[[15,"current-status"]],"Current Usage":[[13,"current-usage"]],"Custom Interfaces":[[1,"custom-interfaces"],[7,"custom-interfaces"]],"Customizing Templates":[[4,"customizing-templates"]],"Death To The Address":[[16,"death-to-the-address"]],"Debian Bookworm":[[3,"debian-bookworm"]],"Decentralization Or Uncentralizability?":[[16,"decentralization-or-uncentralizability"]],"Design Patterns For Post-IP Systems":[[16,"design-patterns-for-post-ip-systems"]],"Destination Naming":[[13,"destination-naming"]],"Destinations":[[13,"destinations"]],"Destinations, Not Addresses":[[9,"destinations-not-addresses"]],"Develop a Program with Reticulum":[[3,"develop-a-program-with-reticulum"]],"Discoverable Interfaces":[[7,"discoverable-interfaces"]],"Discovering Interfaces":[[14,"discovering-interfaces"]],"Discovery Parameters":[[7,"discovery-parameters"]],"Distributed Development":[[0,null]],"Distribution Without Intermediaries":[[0,"distribution-without-intermediaries"]],"Donations":[[12,"donations"]],"Echo":[[1,"echo"]],"Emergent Patterns":[[16,"emergent-patterns"]],"Enabling Discovery":[[7,"enabling-discovery"]],"Enabling the Git Page Node":[[4,"enabling-the-git-page-node"]],"Encryption Is Not A Feature":[[16,"encryption-is-not-a-feature"]],"Ethernet-based Hardware":[[5,"ethernet-based-hardware"]],"Ethics Of The Tool":[[16,"ethics-of-the-tool"]],"Example Configuration":[[7,"example-configuration"]],"Fabric Of The Independent":[[16,"fabric-of-the-independent"]],"Fallacy Of The Cloud":[[16,"fallacy-of-the-cloud"]],"Filetransfer":[[1,"filetransfer"]],"Finding Your Way":[[3,"finding-your-way"]],"Fixed Serial Port Names":[[14,"fixed-serial-port-names"]],"Flow & Time":[[16,"flow-time"]],"Forking Repositories":[[4,"forking-repositories"]],"Formatting & Syntax Highlighting":[[4,"formatting-syntax-highlighting"]],"Future Implications":[[13,"future-implications"]],"Getting Further":[[13,"getting-further"]],"Getting Started Fast":[[3,null]],"Git Configuration Parameters":[[4,"git-configuration-parameters"]],"Git OveLine truncated
+5 -5
View File
@@ -7,12 +7,12 @@
<link rel="prefetch" href="_static/rns_logo_512.png" as="image"> <link rel="prefetch" href="_static/rns_logo_512.png" as="image">
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 --> <!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 -->
<title>Programs Using Reticulum - Reticulum Network Stack 1.3.1 documentation</title> <title>Programs Using Reticulum - Reticulum Network Stack 1.3.9 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" /> <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" />
<link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" /> <link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" />
<link rel="stylesheet" type="text/css" href="_static/custom.css?v=bb3cebc5" /> <link rel="stylesheet" type="text/css" href="_static/custom.css?v=e1715074" />
@@ -180,7 +180,7 @@
</label> </label>
</div> </div>
<div class="header-center"> <div class="header-center">
<a href="index.html"><div class="brand">Reticulum Network Stack 1.3.1 documentation</div></a> <a href="index.html"><div class="brand">Reticulum Network Stack 1.3.9 documentation</div></a>
</div> </div>
<div class="header-right"> <div class="header-right">
<div class="theme-toggle-container theme-toggle-header"> <div class="theme-toggle-container theme-toggle-header">
@@ -204,7 +204,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/> <img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div> </div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.3.1 documentation</span> <span class="sidebar-brand-text">Reticulum Network Stack 1.3.9 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search"> </a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search"> <input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -513,7 +513,7 @@ plugin system for expandability.</p>
</aside> </aside>
</div> </div>
</div><script src="_static/documentation_options.js?v=bb516dca"></script> </div><script src="_static/documentation_options.js?v=98c25ec5"></script>
<script src="_static/doctools.js?v=9bcbadda"></script> <script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script> <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script> <script src="_static/scripts/furo.js?v=46bd48cc"></script>
+5 -5
View File
@@ -7,12 +7,12 @@
<link rel="prefetch" href="_static/rns_logo_512.png" as="image"> <link rel="prefetch" href="_static/rns_logo_512.png" as="image">
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 --> <!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 -->
<title>Support Reticulum - Reticulum Network Stack 1.3.1 documentation</title> <title>Support Reticulum - Reticulum Network Stack 1.3.9 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" /> <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" />
<link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" /> <link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" />
<link rel="stylesheet" type="text/css" href="_static/custom.css?v=bb3cebc5" /> <link rel="stylesheet" type="text/css" href="_static/custom.css?v=e1715074" />
@@ -180,7 +180,7 @@
</label> </label>
</div> </div>
<div class="header-center"> <div class="header-center">
<a href="index.html"><div class="brand">Reticulum Network Stack 1.3.1 documentation</div></a> <a href="index.html"><div class="brand">Reticulum Network Stack 1.3.9 documentation</div></a>
</div> </div>
<div class="header-right"> <div class="header-right">
<div class="theme-toggle-container theme-toggle-header"> <div class="theme-toggle-container theme-toggle-header">
@@ -204,7 +204,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/> <img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div> </div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.3.1 documentation</span> <span class="sidebar-brand-text">Reticulum Network Stack 1.3.9 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search"> </a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search"> <input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -383,7 +383,7 @@ circumstances, so we rely on old-fashioned human feedback.</p>
</aside> </aside>
</div> </div>
</div><script src="_static/documentation_options.js?v=bb516dca"></script> </div><script src="_static/documentation_options.js?v=98c25ec5"></script>
<script src="_static/doctools.js?v=9bcbadda"></script> <script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script> <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script> <script src="_static/scripts/furo.js?v=46bd48cc"></script>
+92 -312
View File
@@ -7,12 +7,12 @@
<link rel="prefetch" href="_static/rns_logo_512.png" as="image"> <link rel="prefetch" href="_static/rns_logo_512.png" as="image">
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 --> <!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 -->
<title>Understanding Reticulum - Reticulum Network Stack 1.3.1 documentation</title> <title>Understanding Reticulum - Reticulum Network Stack 1.3.9 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" /> <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" />
<link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" /> <link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" />
<link rel="stylesheet" type="text/css" href="_static/custom.css?v=bb3cebc5" /> <link rel="stylesheet" type="text/css" href="_static/custom.css?v=e1715074" />
@@ -180,7 +180,7 @@
</label> </label>
</div> </div>
<div class="header-center"> <div class="header-center">
<a href="index.html"><div class="brand">Reticulum Network Stack 1.3.1 documentation</div></a> <a href="index.html"><div class="brand">Reticulum Network Stack 1.3.9 documentation</div></a>
</div> </div>
<div class="header-right"> <div class="header-right">
<div class="theme-toggle-container theme-toggle-header"> <div class="theme-toggle-container theme-toggle-header">
@@ -204,7 +204,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/> <img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div> </div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.3.1 documentation</span> <span class="sidebar-brand-text">Reticulum Network Stack 1.3.9 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search"> </a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search"> <input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -264,50 +264,21 @@
<article role="main" id="furo-main-content"> <article role="main" id="furo-main-content">
<section id="understanding-reticulum"> <section id="understanding-reticulum">
<span id="understanding-main"></span><h1>Understanding Reticulum<a class="headerlink" href="#understanding-reticulum" title="Link to this heading"></a></h1> <span id="understanding-main"></span><h1>Understanding Reticulum<a class="headerlink" href="#understanding-reticulum" title="Link to this heading"></a></h1>
<p>This chapter will briefly describe the overall purpose and operating principles of Reticulum. <p>This chapter will briefly describe the overall purpose and operating principles of Reticulum. It should give you an overview of how the stack works, and an understanding of how to develop networked applications using Reticulum.</p>
It should give you an overview of how the stack works, and an understanding of how to <p>This chapter is not an exhaustive source of information on Reticulum, at least not yet. Currently, the only complete repository, and final authority on how Reticulum actually functions, is the Python reference implementation and API reference. That being said, this chapter is an essential resource in understanding how Reticulum works from a high-level perspective, along with the general principles of Reticulum, and how to apply them when creating your own networks or software.</p>
develop networked applications using Reticulum.</p> <p>After reading this chapter, you should be well-equipped to understand how a Reticulum network operates, what it can achieve, and how you can use it yourself. This chapter also seeks to provide an overview of the sentiments and the philosophy behind Reticulum, what problems it seeks to solve, and how it approaches those solutions.</p>
<p>This chapter is not an exhaustive source of information on Reticulum, at least not yet. Currently,
the only complete repository, and final authority on how Reticulum actually functions, is the Python
reference implementation and API reference. That being said, this chapter is an essential resource in
understanding how Reticulum works from a high-level perspective, along with the general principles of
Reticulum, and how to apply them when creating your own networks or software.</p>
<p>After reading this chapter, you should be well-equipped to understand how a Reticulum network
operates, what it can achieve, and how you can use it yourself. This chapter also seeks to provide an overview of the
sentiments and the philosophy behind Reticulum, what problems it seeks to solve, and how it
approaches those solutions.</p>
<section id="motivation"> <section id="motivation">
<span id="understanding-motivation"></span><h2>Motivation<a class="headerlink" href="#motivation" title="Link to this heading"></a></h2> <span id="understanding-motivation"></span><h2>Motivation<a class="headerlink" href="#motivation" title="Link to this heading"></a></h2>
<p>The primary motivation for designing and implementing Reticulum has been the current lack of <p>The primary motivation for designing and implementing Reticulum has been the current lack of reliable, functional and secure minimal-infrastructure modes of digital communication. It is my belief that it is highly desirable to create a reliable and efficient way to set up long-range digital communication networks that can securely allow exchange of information between people and machines, with no central point of authority, control, censorship or barrier to entry.</p>
reliable, functional and secure minimal-infrastructure modes of digital communication. It is my <p>Almost all of the various networking systems in use today share a common limitation: They require large amounts of coordination and centralised trust and power to function. To join such networks, you need approval of gatekeepers in control. This need for coordination and trust inevitably leads to an environment of central control, where it’s very easy for infrastructure operators or governments to control or alter traffic, and censor or persecute unwanted actors. It also makes it completely impossible to freely deploy and use networks at will, like one would use other common tools that enhance individual agency and freedom.</p>
belief that it is highly desirable to create a reliable and efficient way to set up long-range digital <p>Reticulum aims to require as little coordination and trust as possible. It aims to make secure, anonymous and permissionless networking and information exchange a tool that anyone can just pick up and use.</p>
communication networks that can securely allow exchange of information between people and <p>Since Reticulum is completely medium agnostic, it can be used to build networks on whatever is best suited to the situation, or whatever you have available. In some cases, this might be packet radio links over VHF frequencies, in other cases it might be a 2.4 GHz network using off-the-shelf radios, or it might be using common LoRa development boards.</p>
machines, with no central point of authority, control, censorship or barrier to entry.</p> <p>At the time of release of this document, the fastest and easiest setup for development and testing is using LoRa radio modules with an open source firmware (see the section <a class="reference internal" href="#understanding-referencesystem"><span class="std std-ref">Reference Setup</span></a>), connected to any kind of computer or mobile device that Reticulum can run on.</p>
<p>Almost all of the various networking systems in use today share a common limitation: They <p>The ultimate aim of Reticulum is to allow anyone to be their own network operator, and to make it cheap and easy to cover vast areas with a myriad of independent, interconnectable and autonomous networks. Reticulum <strong>is not</strong> <em>one network</em>, it <strong>is a tool</strong> to build <em>thousands of networks</em>. Networks without kill-switches, surveillance, censorship and control. Networks that can freely interoperate, associate and disassociate with each other, and require no central oversight. Networks for human beings. <em>Networks for the people</em>.</p>
require large amounts of coordination and centralised trust and power to function. To join such networks, you need approval
of gatekeepers in control. This need for coordination and trust inevitably leads to an environment of
central control, where it’s very easy for infrastructure operators or governments to control or alter
traffic, and censor or persecute unwanted actors. It also makes it completely impossible to freely deploy
and use networks at will, like one would use other common tools that enhance individual agency and freedom.</p>
<p>Reticulum aims to require as little coordination and trust as possible. It aims to make secure,
anonymous and permissionless networking and information exchange a tool that anyone can just pick up and use.</p>
<p>Since Reticulum is completely medium agnostic, it can be used to build networks on whatever is best
suited to the situation, or whatever you have available. In some cases, this might be packet radio
links over VHF frequencies, in other cases it might be a 2.4 GHz
network using off-the-shelf radios, or it might be using common LoRa development boards.</p>
<p>At the time of release of this document, the fastest and easiest setup for development and testing is using
LoRa radio modules with an open source firmware (see the section <a class="reference internal" href="#understanding-referencesystem"><span class="std std-ref">Reference Setup</span></a>),
connected to any kind of computer or mobile device that Reticulum can run on.</p>
<p>The ultimate aim of Reticulum is to allow anyone to be their own network operator, and to make it
cheap and easy to cover vast areas with a myriad of independent, interconnectable and autonomous networks.
Reticulum <strong>is not</strong> <em>one network</em>, it <strong>is a tool</strong> to build <em>thousands of networks</em>. Networks without
kill-switches, surveillance, censorship and control. Networks that can freely interoperate, associate and disassociate
with each other, and require no central oversight. Networks for human beings. <em>Networks for the people</em>.</p>
</section> </section>
<section id="goals"> <section id="goals">
<span id="understanding-goals"></span><h2>Goals<a class="headerlink" href="#goals" title="Link to this heading"></a></h2> <span id="understanding-goals"></span><h2>Goals<a class="headerlink" href="#goals" title="Link to this heading"></a></h2>
<p>To be as widely usable and efficient to deploy as possible, the following goals have been used to <p>To be as widely usable and efficient to deploy as possible, the following goals have been used to guide the design of Reticulum:</p>
guide the design of Reticulum:</p>
<ul class="simple"> <ul class="simple">
<li><dl class="simple"> <li><dl class="simple">
<dt><strong>Fully useable as open source software stack</strong></dt><dd><p>Reticulum must be implemented with, and be able to run using only open source software. This is <dt><strong>Fully useable as open source software stack</strong></dt><dd><p>Reticulum must be implemented with, and be able to run using only open source software. This is
@@ -344,8 +315,8 @@ information about oneself.</p>
<li><dl class="simple"> <li><dl class="simple">
<dt><strong>Unlicensed use</strong></dt><dd><p>Reticulum shall be functional over physical communication mediums that do not require any <dt><strong>Unlicensed use</strong></dt><dd><p>Reticulum shall be functional over physical communication mediums that do not require any
form of license to use. Reticulum must be designed in a way, so it is usable over ISM radio form of license to use. Reticulum must be designed in a way, so it is usable over ISM radio
frequency bands, and can provide functional long distance links in such conditions, for example frequency bands, and can provide functional long distance links in such conditions, for
by connecting a modem to a PMR or CB radio, or by using LoRa or WiFi modules.</p> example by connecting a modem to a PMR or CB radio, or by using LoRa or WiFi modules.</p>
</dd> </dd>
</dl> </dl>
</li> </li>
@@ -353,15 +324,15 @@ by connecting a modem to a PMR or CB radio, or by using LoRa or WiFi modules.</p
<dt><strong>Supplied software</strong></dt><dd><p>In addition to the core networking stack and API, that allows a developer to build <dt><strong>Supplied software</strong></dt><dd><p>In addition to the core networking stack and API, that allows a developer to build
applications with Reticulum, a basic set of Reticulum-based communication tools must be applications with Reticulum, a basic set of Reticulum-based communication tools must be
implemented and released along with Reticulum itself. These shall serve both as a implemented and released along with Reticulum itself. These shall serve both as a
functional, basic communication suite, and as an example and learning resource to others wishing functional, basic communication suite, and as an example and learning resource to others
to build applications with Reticulum.</p> wishing to build applications with Reticulum.</p>
</dd> </dd>
</dl> </dl>
</li> </li>
<li><dl class="simple"> <li><dl class="simple">
<dt><strong>Ease of use</strong></dt><dd><p>The reference implementation of Reticulum is written in Python, to make it easy to use <dt><strong>Ease of use</strong></dt><dd><p>The reference implementation of Reticulum is written in Python, to make it easy to use and
and understand. A programmer with only basic experience should be able to use understand. A programmer with only basic experience should be able to use Reticulum to write
Reticulum to write networked applications.</p> networked applications.</p>
</dd> </dd>
</dl> </dl>
</li> </li>
@@ -377,43 +348,16 @@ needs to be purchased.</p>
</section> </section>
<section id="introduction-basic-functionality"> <section id="introduction-basic-functionality">
<span id="understanding-basicfunctionality"></span><h2>Introduction &amp; Basic Functionality<a class="headerlink" href="#introduction-basic-functionality" title="Link to this heading"></a></h2> <span id="understanding-basicfunctionality"></span><h2>Introduction &amp; Basic Functionality<a class="headerlink" href="#introduction-basic-functionality" title="Link to this heading"></a></h2>
<p>Reticulum is a networking stack suited for high-latency, low-bandwidth links. Reticulum is at its <p>Reticulum is a networking stack suited for high-latency, low-bandwidth links. Reticulum is at its core a <em>message oriented</em> system. It is suited for both local point-to-point or point-to-multipoint scenarios where all nodes are within range of each other, as well as scenarios where packets need to be transported over multiple hops in a complex network to reach the recipient.</p>
core a <em>message oriented</em> system. It is suited for both local point-to-point or point-to-multipoint <p>Reticulum does away with the idea of addresses and ports known from IP, TCP and UDP. Instead Reticulum uses the singular concept of <em>destinations</em>. Any application using Reticulum as its networking stack will need to create one or more destinations to receive data, and know the destinations it needs to send data to.</p>
scenarios where all nodes are within range of each other, as well as scenarios where packets need <p>All destinations in Reticulum are <em>represented</em> as a 16 byte hash. This hash is derived from truncating a full SHA-256 hash of identifying characteristics of the destination. To users, the destination addresses will be displayed as 16 hexadecimal bytes, like this example: <code class="docutils literal notranslate"><span class="pre">&lt;13425ec15b621c1d928589718000d814&gt;</span></code>.</p>
to be transported over multiple hops in a complex network to reach the recipient.</p> <p>The truncation size of 16 bytes (128 bits) for destinations has been chosen as a reasonable trade-off between address space and packet overhead. The address space accommodated by this size can support many billions of simultaneously active devices on the same network, while keeping packet overhead low, which is essential on low-bandwidth networks. In the very unlikely case that this address space nears congestion, a one-line code change can upgrade the Reticulum address space all the way up to 256 bits, ensuring the Reticulum address space could potentially support galactic-scale networks. This is obviously complete and ridiculous over-allocation, and as such, the current 128 bits should be sufficient, even far into the future.</p>
<p>Reticulum does away with the idea of addresses and ports known from IP, TCP and UDP. Instead <p>By default Reticulum encrypts all data using elliptic curve cryptography and AES. Any packet sent to a destination is encrypted with a per-packet derived key. Reticulum can also set up an encrypted channel to a destination, called a <em>Link</em>. Both data sent over Links and single packets offer <em>Initiator Anonymity</em>. Links additionally offer <em>Forward Secrecy</em> by default, employing an Elliptic Curve Diffie Hellman key exchange on Curve25519 to derive per-link ephemeral keys. Asymmetric, link-less packet communication can also provide forward secrecy, with automatic key ratcheting, by enabling ratchets on a per-destination basis. The multi-hop transport, coordination, verification and reliability layers are fully autonomous and also based on elliptic curve cryptography.</p>
Reticulum uses the singular concept of <em>destinations</em>. Any application using Reticulum as its <p>Reticulum also offers symmetric key encryption for group-oriented communications, as well as unencrypted packets (for local broadcast purposes <strong>only</strong>).</p>
networking stack will need to create one or more destinations to receive data, and know the <p>Reticulum can connect to a variety of interfaces such as radio modems, data radios and serial ports, and offers the possibility to easily tunnel Reticulum traffic over IP links such as the Internet or private IP networks.</p>
destinations it needs to send data to.</p>
<p>All destinations in Reticulum are <em>represented</em> as a 16 byte hash. This hash is derived from truncating a full
SHA-256 hash of identifying characteristics of the destination. To users, the destination addresses
will be displayed as 16 hexadecimal bytes, like this example: <code class="docutils literal notranslate"><span class="pre">&lt;13425ec15b621c1d928589718000d814&gt;</span></code>.</p>
<p>The truncation size of 16 bytes (128 bits) for destinations has been chosen as a reasonable trade-off
between address space
and packet overhead. The address space accommodated by this size can support many billions of
simultaneously active devices on the same network, while keeping packet overhead low, which is
essential on low-bandwidth networks. In the very unlikely case that this address space nears
congestion, a one-line code change can upgrade the Reticulum address space all the way up to 256
bits, ensuring the Reticulum address space could potentially support galactic-scale networks.
This is obviously complete and ridiculous over-allocation, and as such, the current 128 bits should
be sufficient, even far into the future.</p>
<p>By default Reticulum encrypts all data using elliptic curve cryptography and AES. Any packet sent to a
destination is encrypted with a per-packet derived key. Reticulum can also set up an encrypted
channel to a destination, called a <em>Link</em>. Both data sent over Links and single packets offer
<em>Initiator Anonymity</em>. Links additionally offer <em>Forward Secrecy</em> by default, employing an Elliptic Curve
Diffie Hellman key exchange on Curve25519 to derive per-link ephemeral keys. Asymmetric, link-less
packet communication can also provide forward secrecy, with automatic key ratcheting, by enabling
ratchets on a per-destination basis. The multi-hop transport, coordination, verification and reliability
layers are fully autonomous and also based on elliptic curve cryptography.</p>
<p>Reticulum also offers symmetric key encryption for group-oriented communications, as well as
unencrypted packets (for local broadcast purposes <strong>only</strong>).</p>
<p>Reticulum can connect to a variety of interfaces such as radio modems, data radios and serial ports,
and offers the possibility to easily tunnel Reticulum traffic over IP links such as the Internet or
private IP networks.</p>
<section id="destinations"> <section id="destinations">
<span id="understanding-destinations"></span><h3>Destinations<a class="headerlink" href="#destinations" title="Link to this heading"></a></h3> <span id="understanding-destinations"></span><h3>Destinations<a class="headerlink" href="#destinations" title="Link to this heading"></a></h3>
<p>To receive and send data with the Reticulum stack, an application needs to create one or more <p>To receive and send data with the Reticulum stack, an application needs to create one or more destinations. Reticulum uses three different basic destination types, and one special:</p>
destinations. Reticulum uses three different basic destination types, and one special:</p>
<ul class="simple"> <ul class="simple">
<li><dl class="simple"> <li><dl class="simple">
<dt><strong>Single</strong></dt><dd><p>The <em>single</em> destination type is the most common type in Reticulum, and should be used for <dt><strong>Single</strong></dt><dd><p>The <em>single</em> destination type is the most common type in Reticulum, and should be used for
@@ -428,9 +372,9 @@ only be readable by the creator of the destination, who holds the corresponding
number of users, or should be readable by anyone. Traffic to a <em>plain</em> destination is not encrypted. number of users, or should be readable by anyone. Traffic to a <em>plain</em> destination is not encrypted.
Generally, <em>plain</em> destinations can be used for broadcast information intended to be public. Generally, <em>plain</em> destinations can be used for broadcast information intended to be public.
Plain destinations are only reachable directly, and packets addressed to plain destinations are Plain destinations are only reachable directly, and packets addressed to plain destinations are
never transported over multiple hops in the network. To be transportable over multiple hops in Reticulum, information never transported over multiple hops in the network. To be transportable over multiple hops in
<em>must</em> be encrypted, since Reticulum uses the per-packet encryption to verify routing paths and Reticulum, information <em>must</em> be encrypted, since Reticulum uses the per-packet encryption to verify
keep them alive.</p> routing paths and keep them alive.</p>
</dd> </dd>
</dl> </dl>
</li> </li>
@@ -455,14 +399,9 @@ out requests and responses, large data transfers and more.</p>
</ul> </ul>
<section id="destination-naming"> <section id="destination-naming">
<span id="understanding-destinationnaming"></span><h4>Destination Naming<a class="headerlink" href="#destination-naming" title="Link to this heading"></a></h4> <span id="understanding-destinationnaming"></span><h4>Destination Naming<a class="headerlink" href="#destination-naming" title="Link to this heading"></a></h4>
<p>Destinations are created and named in an easy to understand dotted notation of <em>aspects</em>, and <p>Destinations are created and named in an easy to understand dotted notation of <em>aspects</em>, and represented on the network as a hash of this value. The hash is a SHA-256 truncated to 128 bits. The top level aspect should always be a unique identifier for the application using the destination. The next levels of aspects can be defined in any way by the creator of the application.</p>
represented on the network as a hash of this value. The hash is a SHA-256 truncated to 128 bits. The <p>Aspects can be as long and as plentiful as required, and a resulting long destination name will not impact efficiency, as names are always represented as truncated SHA-256 hashes on the network.</p>
top level aspect should always be a unique identifier for the application using the destination. <p>As an example, a destination for a environmental monitoring application could be made up of the application name, a device type and measurement type, like this:</p>
The next levels of aspects can be defined in any way by the creator of the application.</p>
<p>Aspects can be as long and as plentiful as required, and a resulting long destination name will not
impact efficiency, as names are always represented as truncated SHA-256 hashes on the network.</p>
<p>As an example, a destination for a environmental monitoring application could be made up of the
application name, a device type and measurement type, like this:</p>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>app name : environmentlogger <div class="highlight-text notranslate"><div class="highlight"><pre><span></span>app name : environmentlogger
aspects : remotesensor, temperature aspects : remotesensor, temperature
@@ -470,26 +409,15 @@ full name : environmentlogger.remotesensor.temperature
hash : 4faf1b2e0a077e6a9d92fa051f256038 hash : 4faf1b2e0a077e6a9d92fa051f256038
</pre></div> </pre></div>
</div> </div>
<p>For the <em>single</em> destination, Reticulum will automatically append the associated public key as a <p>For the <em>single</em> destination, Reticulum will automatically append the associated public key as a destination aspect before hashing. This is done to ensure only the correct destination is reached, since anyone can listen to any destination name. Appending the public key ensures that a given packet is only directed at the destination that holds the corresponding private key to decrypt the packet.</p>
destination aspect before hashing. This is done to ensure only the correct destination is reached,
since anyone can listen to any destination name. Appending the public key ensures that a given
packet is only directed at the destination that holds the corresponding private key to decrypt the
packet.</p>
<p><strong>Take note!</strong> There is a very important concept to understand here:</p> <p><strong>Take note!</strong> There is a very important concept to understand here:</p>
<ul class="simple"> <ul class="simple">
<li><p>Anyone can use the destination name <code class="docutils literal notranslate"><span class="pre">environmentlogger.remotesensor.temperature</span></code></p></li> <li><p>Anyone can use the destination name <code class="docutils literal notranslate"><span class="pre">environmentlogger.remotesensor.temperature</span></code></p></li>
<li><p>Each destination that does so will still have a unique destination hash, and thus be uniquely <li><p>Each destination that does so will still have a unique destination hash, and thus be uniquely
addressable, because their public keys will differ.</p></li> addressable, because their public keys will differ.</p></li>
</ul> </ul>
<p>In actual use of <em>single</em> destination naming, it is advisable not to use any uniquely identifying <p>In actual use of <em>single</em> destination naming, it is advisable not to use any uniquely identifying features in aspect naming. Aspect names should be general terms describing what kind of destination is represented. The uniquely identifying aspect is always achieved by appending the public key, which expands the destination into a uniquely identifiable one. Reticulum does this automatically.</p>
features in aspect naming. Aspect names should be general terms describing what kind of destination <p>Any destination on a Reticulum network can be addressed and reached simply by knowing its destination hash (and public key, but if the public key is not known, it can be requested from the network simply by knowing the destination hash). The use of app names and aspects makes it easy to structure Reticulum programs and makes it possible to filter what information and data your program receives.</p>
is represented. The uniquely identifying aspect is always achieved by appending the public key,
which expands the destination into a uniquely identifiable one. Reticulum does this automatically.</p>
<p>Any destination on a Reticulum network can be addressed and reached simply by knowing its
destination hash (and public key, but if the public key is not known, it can be requested from the
network simply by knowing the destination hash). The use of app names and aspects makes it easy to
structure Reticulum programs and makes it possible to filter what information and data your program
receives.</p>
<p>To recap, the different destination types should be used in the following situations:</p> <p>To recap, the different destination types should be used in the following situations:</p>
<ul class="simple"> <ul class="simple">
<li><dl class="simple"> <li><dl class="simple">
@@ -509,25 +437,13 @@ indirectly, but must first be established through a <em>single</em> destination.
</dl> </dl>
</li> </li>
</ul> </ul>
<p>To communicate with a <em>single</em> destination, you need to know its public key. Any method for <p>To communicate with a <em>single</em> destination, you need to know its public key. Any method for obtaining the public key is valid, but Reticulum includes a simple mechanism for making other nodes aware of your destinations public key, called the <em>announce</em>. It is also possible to request an unknown public key from the network, as all transport instances serve as a distributed ledger of public keys.</p>
obtaining the public key is valid, but Reticulum includes a simple mechanism for making other <p>Note that public key information can be shared and verified in other ways than using the built-in <em>announce</em> functionality, and that it is therefore not required to use the <em>announce</em> and <em>path request</em> functionality to obtain public keys. It is by far the easiest though, and should definitely be used if there is not a very good reason for doing it differently.</p>
nodes aware of your destinations public key, called the <em>announce</em>. It is also possible to request
an unknown public key from the network, as all transport instances serve as a distributed ledger
of public keys.</p>
<p>Note that public key information can be shared and verified in other ways than using the
built-in <em>announce</em> functionality, and that it is therefore not required to use the <em>announce</em> and <em>path request</em>
functionality to obtain public keys. It is by far the easiest though, and should definitely be used
if there is not a very good reason for doing it differently.</p>
</section> </section>
</section> </section>
<section id="public-key-announcements"> <section id="public-key-announcements">
<span id="understanding-keyannouncements"></span><h3>Public Key Announcements<a class="headerlink" href="#public-key-announcements" title="Link to this heading"></a></h3> <span id="understanding-keyannouncements"></span><h3>Public Key Announcements<a class="headerlink" href="#public-key-announcements" title="Link to this heading"></a></h3>
<p>An <em>announce</em> will send a special packet over any relevant interfaces, containing all needed <p>An <em>announce</em> will send a special packet over any relevant interfaces, containing all needed information about the destination hash and public key, and can also contain some additional, application specific data. The entire packet is signed by the sender to ensure authenticity. It is not required to use the announce functionality, but in many cases it will be the simplest way to share public keys on the network. The announce mechanism also serves to establish end-to-end connectivity to the announced destination, as the announce propagates through the network.</p>
information about the destination hash and public key, and can also contain some additional,
application specific data. The entire packet is signed by the sender to ensure authenticity. It is not
required to use the announce functionality, but in many cases it will be the simplest way to share
public keys on the network. The announce mechanism also serves to establish end-to-end connectivity
to the announced destination, as the announce propagates through the network.</p>
<p>As an example, an announce in a simple messenger application might contain the following information:</p> <p>As an example, an announce in a simple messenger application might contain the following information:</p>
<ul class="simple"> <ul class="simple">
<li><p>The announcers destination hash</p></li> <li><p>The announcers destination hash</p></li>
@@ -536,78 +452,37 @@ to the announced destination, as the announce propagates through the network.</p
<li><p>A random blob, making each new announce unique</p></li> <li><p>A random blob, making each new announce unique</p></li>
<li><p>An Ed25519 signature of the above information, verifying authenticity</p></li> <li><p>An Ed25519 signature of the above information, verifying authenticity</p></li>
</ul> </ul>
<p>With this information, any Reticulum node that receives it will be able to reconstruct an outgoing <p>With this information, any Reticulum node that receives it will be able to reconstruct an outgoing destination to securely communicate with that destination. You might have noticed that there is one piece of information lacking to reconstruct full knowledge of the announced destination, and that is the aspect names of the destination. These are intentionally left out to save bandwidth, since they will be implicit in almost all cases. The receiving application will already know them. If a destination name is not entirely implicit, information can be included in the application specific data part that will allow the receiver to infer the naming.</p>
destination to securely communicate with that destination. You might have noticed that there is one <p>It is important to note that announces will be forwarded throughout the network according to a certain pattern. This will be detailed in the section <a class="reference internal" href="#understanding-announce"><span class="std std-ref">The Announce Mechanism in Detail</span></a>.</p>
piece of information lacking to reconstruct full knowledge of the announced destination, and that is <p>In Reticulum, destinations are allowed to move around the network at will. This is very different from protocols such as IP, where an address is always expected to stay within the network segment it was assigned in. This limitation does not exist in Reticulum, and any destination is <em>completely portable</em> over the entire topography of the network, and <em>can even be moved to other Reticulum networks</em> than the one it was created in, and still become reachable. To update its reachability, a destination simply needs to send an announce on any networks it is part of. After a short while, it will be globally reachable in the network.</p>
the aspect names of the destination. These are intentionally left out to save bandwidth, since they
will be implicit in almost all cases. The receiving application will already know them. If a destination
name is not entirely implicit, information can be included in the application specific data part that
will allow the receiver to infer the naming.</p>
<p>It is important to note that announces will be forwarded throughout the network according to a
certain pattern. This will be detailed in the section
<a class="reference internal" href="#understanding-announce"><span class="std std-ref">The Announce Mechanism in Detail</span></a>.</p>
<p>In Reticulum, destinations are allowed to move around the network at will. This is very different from
protocols such as IP, where an address is always expected to stay within the network segment it was assigned in.
This limitation does not exist in Reticulum, and any destination is <em>completely portable</em> over the entire topography
of the network, and <em>can even be moved to other Reticulum networks</em> than the one it was created in, and
still become reachable. To update its reachability, a destination simply needs to send an announce on any
networks it is part of. After a short while, it will be globally reachable in the network.</p>
<p>Seeing how <em>single</em> destinations are always tied to a private/public key pair leads us to the next topic.</p> <p>Seeing how <em>single</em> destinations are always tied to a private/public key pair leads us to the next topic.</p>
</section> </section>
<section id="understanding-identities"> <section id="understanding-identities">
<span id="identities"></span><h3>Identities<a class="headerlink" href="#understanding-identities" title="Link to this heading"></a></h3> <span id="identities"></span><h3>Identities<a class="headerlink" href="#understanding-identities" title="Link to this heading"></a></h3>
<p>In Reticulum, an <em>identity</em> does not necessarily represent a personal identity, but is an abstraction that <p>In Reticulum, an <em>identity</em> does not necessarily represent a personal identity, but is an abstraction that can represent any kind of <em>verifiable entity</em>. This could very well be a person, but it could also be the control interface of a machine, a program, robot, computer, sensor or something else entirely. In general, any kind of agent that can act, or be acted upon, or store or manipulate information, can be represented as an identity. An <em>identity</em> can be used to create any number of destinations.</p>
can represent any kind of <em>verifiable entity</em>. This could very well be a person, but it could also be the <p>A <em>single</em> destination will always have an <em>identity</em> tied to it, but not <em>plain</em> or <em>group</em> destinations. Destinations and identities share a multilateral connection. You can create a destination, and if it is not connected to an identity upon creation, it will just create a new one to use automatically. This may be desirable in some situations, but often you will probably want to create the identity first, and then use it to create new destinations.</p>
control interface of a machine, a program, robot, computer, sensor or something else entirely. In <p>As an example, we could use an identity to represent the user of a messaging application. Destinations can then be created by this identity to allow communication to reach the user. In all cases it is of great importance to store the private keys associated with any Reticulum Identity securely and privately, since obtaining access to the identity keys equals obtaining access and controlling reachability to any destinations created by that identity.</p>
general, any kind of agent that can act, or be acted upon, or store or manipulate information, can be
represented as an identity. An <em>identity</em> can be used to create any number of destinations.</p>
<p>A <em>single</em> destination will always have an <em>identity</em> tied to it, but not <em>plain</em> or <em>group</em>
destinations. Destinations and identities share a multilateral connection. You can create a
destination, and if it is not connected to an identity upon creation, it will just create a new one to use
automatically. This may be desirable in some situations, but often you will probably want to create
the identity first, and then use it to create new destinations.</p>
<p>As an example, we could use an identity to represent the user of a messaging application.
Destinations can then be created by this identity to allow communication to reach the user.
In all cases it is of great importance to store the private keys associated with any
Reticulum Identity securely and privately, since obtaining access to the identity keys equals
obtaining access and controlling reachability to any destinations created by that identity.</p>
</section> </section>
<section id="getting-further"> <section id="getting-further">
<span id="understanding-gettingfurther"></span><h3>Getting Further<a class="headerlink" href="#getting-further" title="Link to this heading"></a></h3> <span id="understanding-gettingfurther"></span><h3>Getting Further<a class="headerlink" href="#getting-further" title="Link to this heading"></a></h3>
<p>The above functions and principles form the core of Reticulum, and would suffice to create <p>The above functions and principles form the core of Reticulum, and would suffice to create functional networked applications in local clusters, for example over radio links where all interested nodes can directly hear each other. But to be truly useful, we need a way to direct traffic over multiple hops in the network.</p>
functional networked applications in local clusters, for example over radio links where all interested
nodes can directly hear each other. But to be truly useful, we need a way to direct traffic over multiple
hops in the network.</p>
<p>In the following sections, two concepts that allow this will be introduced, <em>paths</em> and <em>links</em>.</p> <p>In the following sections, two concepts that allow this will be introduced, <em>paths</em> and <em>links</em>.</p>
</section> </section>
</section> </section>
<section id="reticulum-transport"> <section id="reticulum-transport">
<span id="understanding-transport"></span><h2>Reticulum Transport<a class="headerlink" href="#reticulum-transport" title="Link to this heading"></a></h2> <span id="understanding-transport"></span><h2>Reticulum Transport<a class="headerlink" href="#reticulum-transport" title="Link to this heading"></a></h2>
<p>The methods of routing used in traditional networks are fundamentally incompatible with the physical medium <p>The methods of routing used in traditional networks are fundamentally incompatible with the physical medium types and circumstances that Reticulum was designed to handle. These mechanisms mostly assume trust at the physical layer, and often needs a lot more bandwidth than Reticulum can assume is available. Since Reticulum is designed to survive running over open radio spectrum, no such trust can be assumed, and bandwidth is often very limited.</p>
types and circumstances that Reticulum was designed to handle. These mechanisms mostly assume trust at the physical layer, <p>To overcome such challenges, Reticulum’s <em>Transport</em> system uses asymmetric elliptic curve cryptography to implement the concept of <em>paths</em> that allow discovery of how to get information closer to a certain destination. It is important to note that no single node in a Reticulum network knows the complete path to a destination. Every Transport node participating in a Reticulum network will only know the most direct way to get a packet one hop closer to it’s destination.</p>
and often needs a lot more bandwidth than Reticulum can assume is available. Since Reticulum is designed to
survive running over open radio spectrum, no such trust can be assumed, and bandwidth is often very limited.</p>
<p>To overcome such challenges, Reticulum’s <em>Transport</em> system uses asymmetric elliptic curve cryptography to
implement the concept of <em>paths</em> that allow discovery of how to get information closer to a certain
destination. It is important to note that no single node in a Reticulum network knows the complete
path to a destination. Every Transport node participating in a Reticulum network will only
know the most direct way to get a packet one hop closer to it’s destination.</p>
<section id="node-types"> <section id="node-types">
<span id="understanding-nodetypes"></span><h3>Node Types<a class="headerlink" href="#node-types" title="Link to this heading"></a></h3> <span id="understanding-nodetypes"></span><h3>Node Types<a class="headerlink" href="#node-types" title="Link to this heading"></a></h3>
<p>Currently, Reticulum distinguishes between two types of network nodes. All nodes on a Reticulum network <p>Currently, Reticulum distinguishes between two types of network nodes. All nodes on a Reticulum network are <em>Reticulum Instances</em>, and some are also <em>Transport Nodes</em>. If a system running Reticulum is fixed in one place, and is intended to be kept available most of the time, it is a good contender to be a <em>Transport Node</em>.</p>
are <em>Reticulum Instances</em>, and some are also <em>Transport Nodes</em>. If a system running Reticulum is fixed in <p>Any Reticulum Instance can become a Transport Node by enabling it in the configuration. This distinction is made by the user configuring the node, and is used to determine what nodes on the network will help forward traffic, and what nodes rely on other nodes for wider connectivity.</p>
one place, and is intended to be kept available most of the time, it is a good contender to be a <em>Transport Node</em>.</p> <p>If a node is an <em>Instance</em> it should be given the configuration directive <code class="docutils literal notranslate"><span class="pre">enable_transport</span> <span class="pre">=</span> <span class="pre">No</span></code>, which is the default setting.</p>
<p>Any Reticulum Instance can become a Transport Node by enabling it in the configuration.
This distinction is made by the user configuring the node, and is used to determine what nodes on the
network will help forward traffic, and what nodes rely on other nodes for wider connectivity.</p>
<p>If a node is an <em>Instance</em> it should be given the configuration directive <code class="docutils literal notranslate"><span class="pre">enable_transport</span> <span class="pre">=</span> <span class="pre">No</span></code>, which
is the default setting.</p>
<p>If it is a <em>Transport Node</em>, it should be given the configuration directive <code class="docutils literal notranslate"><span class="pre">enable_transport</span> <span class="pre">=</span> <span class="pre">Yes</span></code>.</p> <p>If it is a <em>Transport Node</em>, it should be given the configuration directive <code class="docutils literal notranslate"><span class="pre">enable_transport</span> <span class="pre">=</span> <span class="pre">Yes</span></code>.</p>
</section> </section>
<section id="the-announce-mechanism-in-detail"> <section id="the-announce-mechanism-in-detail">
<span id="understanding-announce"></span><h3>The Announce Mechanism in Detail<a class="headerlink" href="#the-announce-mechanism-in-detail" title="Link to this heading"></a></h3> <span id="understanding-announce"></span><h3>The Announce Mechanism in Detail<a class="headerlink" href="#the-announce-mechanism-in-detail" title="Link to this heading"></a></h3>
<p>When an <em>announce</em> for a destination is transmitted by a Reticulum instance, it will be forwarded by <p>When an <em>announce</em> for a destination is transmitted by a Reticulum instance, it will be forwarded by any transport node receiving it, but according to some specific rules:</p>
any transport node receiving it, but according to some specific rules:</p>
<ul> <ul>
<li><div class="line-block"> <li><div class="line-block">
<div class="line">If this exact announce has already been received before, ignore it.</div> <div class="line">If this exact announce has already been received before, ignore it.</div>
@@ -654,36 +529,18 @@ application specific data, it will replace the old announce.</div>
</div> </div>
</li> </li>
</ul> </ul>
<p>Once an announce has reached a transport node in the network, any other node in direct contact with that <p>Once an announce has reached a transport node in the network, any other node in direct contact with that transport node will be able to reach the destination the announce originated from, simply by sending a packet addressed to that destination. Any transport node with knowledge of the announce will be able to direct the packet towards the destination by looking up the most efficient next node to the destination.</p>
transport node will be able to reach the destination the announce originated from, simply by sending a packet <p>According to these rules, an announce will propagate throughout the network in a predictable way, and make the announced destination reachable in a short amount of time. Fast networks that have the capacity to process many announces can reach full convergence very quickly, even when constantly adding new destinations. Slower segments of such networks might take a bit longer to gain full knowledge about the wide and fast networks they are connected to, but can still do so over time, while prioritising full and quickly converging end-to-end connectivity for their local, slower segments.</p>
addressed to that destination. Any transport node with knowledge of the announce will be able to direct the
packet towards the destination by looking up the most efficient next node to the destination.</p>
<p>According to these rules, an announce will propagate throughout the network in a predictable way,
and make the announced destination reachable in a short amount of time. Fast networks that have the
capacity to process many announces can reach full convergence very quickly, even when constantly adding
new destinations. Slower segments of such networks might take a bit longer to gain full knowledge about
the wide and fast networks they are connected to, but can still do so over time, while prioritising full
and quickly converging end-to-end connectivity for their local, slower segments.</p>
<div class="admonition tip"> <div class="admonition tip">
<p class="admonition-title">Tip</p> <p class="admonition-title">Tip</p>
<p>Even very slow networks, that simply don’t have the capacity to ever reach <em>full</em> convergence <p>Even very slow networks, that simply don’t have the capacity to ever reach <em>full</em> convergence will generally still be able to reach <strong>any other destination on any connected segments</strong>, since interconnecting transport nodes will prioritize announces into the slower segments that are actually requested by nodes on these.</p>
will generally still be able to reach <strong>any other destination on any connected segments</strong>, since <p>This means that slow, low-capacity or low-resource segments <strong>don’t</strong> need to have full network knowledge, since paths can always be recursively resolved from other segments that do have knowledge about them.</p>
interconnecting transport nodes will prioritize announces into the slower segments that are
actually requested by nodes on these.</p>
<p>This means that slow, low-capacity or low-resource segments <strong>don’t</strong> need to have full network
knowledge, since paths can always be recursively resolved from other segments that do have
knowledge about them.</p>
</div> </div>
<p>In general, even extremely complex networks, that utilize the maximum 128 hops will converge to full <p>In general, even extremely complex networks, that utilize the maximum 128 hops will converge to full end-to-end connectivity in about one minute, given there is enough bandwidth available to process the required amount of announces.</p>
end-to-end connectivity in about one minute, given there is enough bandwidth available to process
the required amount of announces.</p>
</section> </section>
<section id="reaching-the-destination"> <section id="reaching-the-destination">
<span id="understanding-paths"></span><h3>Reaching the Destination<a class="headerlink" href="#reaching-the-destination" title="Link to this heading"></a></h3> <span id="understanding-paths"></span><h3>Reaching the Destination<a class="headerlink" href="#reaching-the-destination" title="Link to this heading"></a></h3>
<p>In networks with changing topology and trustless connectivity, nodes need a way to establish <p>In networks with changing topology and trustless connectivity, nodes need a way to establish <em>verified connectivity</em> with each other. Since the underlying network mediums are assumed to be trustless, Reticulum must provide a way to guarantee that the peer you are communicating with is actually who you expect. Reticulum offers two ways to do this.</p>
<em>verified connectivity</em> with each other. Since the underlying network mediums are assumed to be trustless, Reticulum
must provide a way to guarantee that the peer you are communicating with is actually who you
expect. Reticulum offers two ways to do this.</p>
<p>For exchanges of small amounts of information, Reticulum offers the <em>Packet</em> API, which works exactly like you would expect - on a per packet level. The following process is employed when sending a packet:</p> <p>For exchanges of small amounts of information, Reticulum offers the <em>Packet</em> API, which works exactly like you would expect - on a per packet level. The following process is employed when sending a packet:</p>
<ul> <ul>
<li><div class="line-block"> <li><div class="line-block">
@@ -769,30 +626,12 @@ link, and is only revealed to the verified destination, and no intermediaries.</
</div> </div>
</li> </li>
</ul> </ul>
<p>In a moment, we will discuss the details of how this methodology is <p>In a moment, we will discuss the details of how this methodology is implemented, but let’s first recap what purposes this methodology serves. We first ensure that the node answering our request is actually the one we want to communicate with, and not a malicious actor pretending to be so. At the same time we establish an efficient encrypted channel. The setup of this is relatively cheap in terms of bandwidth, so it can be used just for a short exchange, and then recreated as needed, which will also rotate encryption keys. The link can also be kept alive for longer periods of time, if this is more suitable to the application. The procedure also inserts the <em>link id</em> , a hash calculated from the link request packet, into the memory of forwarding nodes, which means that the communicating nodes can thereafter reach each other simply by referring to this <em>link id</em>.</p>
implemented, but let’s first recap what purposes this methodology serves. We <p>The combined bandwidth cost of setting up a link is 3 packets totalling 297 bytes (more info in the <a class="reference internal" href="#understanding-packetformat"><span class="std std-ref">Binary Packet Format</span></a> section). The amount of bandwidth used on keeping a link open is practically negligible, at 0.45 bits per second. Even on a slow 1200 bits per second packet radio channel, 100 concurrent links will still leave 96% channel capacity for actual data.</p>
first ensure that the node answering our request is actually the one we want to
communicate with, and not a malicious actor pretending to be so. At the same
time we establish an efficient encrypted channel. The setup of this is
relatively cheap in terms of bandwidth, so it can be used just for a short
exchange, and then recreated as needed, which will also rotate encryption keys.
The link can also be kept alive for longer periods of time, if this is more
suitable to the application. The procedure also inserts the <em>link id</em> , a hash
calculated from the link request packet, into the memory of forwarding nodes,
which means that the communicating nodes can thereafter reach each other simply
by referring to this <em>link id</em>.</p>
<p>The combined bandwidth cost of setting up a link is 3 packets totalling 297 bytes (more info in the
<a class="reference internal" href="#understanding-packetformat"><span class="std std-ref">Binary Packet Format</span></a> section). The amount of bandwidth used on keeping
a link open is practically negligible, at 0.45 bits per second. Even on a slow 1200 bits per second packet
radio channel, 100 concurrent links will still leave 96% channel capacity for actual data.</p>
<section id="link-establishment-in-detail"> <section id="link-establishment-in-detail">
<h4>Link Establishment in Detail<a class="headerlink" href="#link-establishment-in-detail" title="Link to this heading"></a></h4> <h4>Link Establishment in Detail<a class="headerlink" href="#link-establishment-in-detail" title="Link to this heading"></a></h4>
<p>After exploring the basics of the announce mechanism, finding a path through the network, and an overview <p>After exploring the basics of the announce mechanism, finding a path through the network, and an overview of the link establishment procedure, this section will go into greater detail about the Reticulum link establishment process.</p>
of the link establishment procedure, this section will go into greater detail about the Reticulum link <p>The <em>link</em> in Reticulum terminology should not be viewed as a direct node-to-node link on the physical layer, but as an abstract channel, that can be open for any amount of time, and can span an arbitrary number of hops, where information will be exchanged between two nodes.</p>
establishment process.</p>
<p>The <em>link</em> in Reticulum terminology should not be viewed as a direct node-to-node link on the
physical layer, but as an abstract channel, that can be open for any amount of time, and can span
an arbitrary number of hops, where information will be exchanged between two nodes.</p>
<ul> <ul>
<li><div class="line-block"> <li><div class="line-block">
<div class="line">When a node in the network wants to establish verified connectivity with another node, it <div class="line">When a node in the network wants to establish verified connectivity with another node, it
@@ -856,25 +695,16 @@ that is used to encrypt the channel. Information can now be exchanged reliably a
</ul> </ul>
<div class="admonition note"> <div class="admonition note">
<p class="admonition-title">Note</p> <p class="admonition-title">Note</p>
<p>It’s important to note that this methodology ensures that the source of the request does not need to <p>It’s important to note that this methodology ensures that the source of the request does not need to reveal any identifying information about itself. <strong>The link initiator remains completely anonymous</strong>.</p>
reveal any identifying information about itself. <strong>The link initiator remains completely anonymous</strong>.</p>
</div> </div>
<p>When using <em>links</em>, Reticulum will automatically verify all data sent over the link, and can also <p>When using <em>links</em>, Reticulum will automatically verify all data sent over the link, and can also automate retransmissions if <em>Resources</em> are used.</p>
automate retransmissions if <em>Resources</em> are used.</p>
</section> </section>
</section> </section>
<section id="resources"> <section id="resources">
<span id="understanding-resources"></span><h3>Resources<a class="headerlink" href="#resources" title="Link to this heading"></a></h3> <span id="understanding-resources"></span><h3>Resources<a class="headerlink" href="#resources" title="Link to this heading"></a></h3>
<p>For exchanging small amounts of data over a Reticulum network, the <a class="reference internal" href="reference.html#api-packet"><span class="std std-ref">Packet</span></a> interface <p>For exchanging small amounts of data over a Reticulum network, the <a class="reference internal" href="reference.html#api-packet"><span class="std std-ref">Packet</span></a> interface is sufficient, but for exchanging data that would require many packets, an efficient way to coordinate the transfer is needed.</p>
is sufficient, but for exchanging data that would require many packets, an efficient way to coordinate <p>This is the purpose of the Reticulum <a class="reference internal" href="reference.html#api-resource"><span class="std std-ref">Resource</span></a>. A <em>Resource</em> can automatically handle the reliable transfer of an arbitrary amount of data over an established <a class="reference internal" href="reference.html#api-link"><span class="std std-ref">Link</span></a>. Resources can auto-compress data, will handle breaking the data into individual packets, sequencing the transfer, integrity verification and reassembling the data on the other end.</p>
the transfer is needed.</p> <p><a class="reference internal" href="reference.html#api-resource"><span class="std std-ref">Resources</span></a> are programmatically very simple to use, and only requires a few lines of codes to reliably transfer any amount of data. They can be used to transfer data stored in memory, or stream data directly from files.</p>
<p>This is the purpose of the Reticulum <a class="reference internal" href="reference.html#api-resource"><span class="std std-ref">Resource</span></a>. A <em>Resource</em> can automatically
handle the reliable transfer of an arbitrary amount of data over an established <a class="reference internal" href="reference.html#api-link"><span class="std std-ref">Link</span></a>.
Resources can auto-compress data, will handle breaking the data into individual packets, sequencing
the transfer, integrity verification and reassembling the data on the other end.</p>
<p><a class="reference internal" href="reference.html#api-resource"><span class="std std-ref">Resources</span></a> are programmatically very simple to use, and only requires a few lines
of codes to reliably transfer any amount of data. They can be used to transfer data stored in memory,
or stream data directly from files.</p>
</section> </section>
</section> </section>
<section id="network-identities"> <section id="network-identities">
@@ -939,17 +769,9 @@ In the <code class="docutils literal notranslate"><span class="pre">[reticulum]<
</section> </section>
<section id="reference-setup"> <section id="reference-setup">
<span id="understanding-referencesystem"></span><h2>Reference Setup<a class="headerlink" href="#reference-setup" title="Link to this heading"></a></h2> <span id="understanding-referencesystem"></span><h2>Reference Setup<a class="headerlink" href="#reference-setup" title="Link to this heading"></a></h2>
<p>This section will detail a recommended <em>Reference Setup</em> for Reticulum. It is important to <p>This section will detail a recommended <em>Reference Setup</em> for Reticulum. It is important to note that Reticulum is designed to be usable on more or less any computing device, and over more or less any medium that allows you to send and receive data, which satisfies some very low minimum requirements.</p>
note that Reticulum is designed to be usable on more or less any computing device, and over more <p>The communication channel must support at least half-duplex operation, and provide an average throughput of 5 bits per second or greater, and supports a physical layer MTU of 500 bytes. The Reticulum stack should be able to run on more or less any hardware that can provide a Python 3.x runtime environment.</p>
or less any medium that allows you to send and receive data, which satisfies some very low <p>That being said, this reference setup has been outlined to provide a common platform for anyone who wants to help in the development of Reticulum, and for everyone who wants to know a recommended setup to get started experimenting. A reference system consists of three parts:</p>
minimum requirements.</p>
<p>The communication channel must support at least half-duplex operation, and provide an average
throughput of 5 bits per second or greater, and supports a physical layer MTU of 500 bytes. The
Reticulum stack should be able to run on more or less any hardware that can provide a Python 3.x
runtime environment.</p>
<p>That being said, this reference setup has been outlined to provide a common platform for anyone
who wants to help in the development of Reticulum, and for everyone who wants to know a
recommended setup to get started experimenting. A reference system consists of three parts:</p>
<ul class="simple"> <ul class="simple">
<li><dl class="simple"> <li><dl class="simple">
<dt><strong>An Interface Device</strong></dt><dd><p>Which provides access to the physical medium whereupon the communication <dt><strong>An Interface Device</strong></dt><dd><p>Which provides access to the physical medium whereupon the communication
@@ -970,11 +792,7 @@ interface device, and provide user interaction.</p>
</dl> </dl>
</li> </li>
</ul> </ul>
<p>The reference setup can be considered a relatively stable platform to develop on, and also to start <p>The reference setup can be considered a relatively stable platform to develop on, and also to start building networks or applications on. While details of the implementation might change at the current stage of development, it is the goal to maintain hardware compatibility for as long as entirely possible, and the current reference setup has been determined to provide a functional platform for many years into the future. The current Reference System Setup is as follows:</p>
building networks or applications on. While details of the implementation might change at the current stage of
development, it is the goal to maintain hardware compatibility for as long as entirely possible, and
the current reference setup has been determined to provide a functional platform for many years
into the future. The current Reference System Setup is as follows:</p>
<ul class="simple"> <ul class="simple">
<li><dl class="simple"> <li><dl class="simple">
<dt><strong>Interface Device</strong></dt><dd><p>A data radio consisting of a LoRa radio module, and a microcontroller with open source <dt><strong>Interface Device</strong></dt><dd><p>A data radio consisting of a LoRa radio module, and a microcontroller with open source
@@ -998,41 +816,23 @@ operating system.</p>
</ul> </ul>
<div class="admonition note"> <div class="admonition note">
<p class="admonition-title">Note</p> <p class="admonition-title">Note</p>
<p>To avoid confusion, it is very important to note, that the reference interface device <strong>does not</strong> <p>To avoid confusion, it is very important to note, that the reference interface device <strong>does not</strong> use the LoRaWAN standard, but uses a custom MAC layer on top of the plain LoRa modulation! As such, you will need a plain LoRa radio module connected to a controller with the correct firmware. Full details on how to get or make such a device is available on the <a class="reference external" href="https://github.com/markqvist/rnode_firmware">RNode Page</a>.</p>
use the LoRaWAN standard, but uses a custom MAC layer on top of the plain LoRa modulation! As such, you will
need a plain LoRa radio module connected to a controller with the correct firmware. Full details on how to
get or make such a device is available on the <a class="reference external" href="https://github.com/markqvist/rnode_firmware">RNode Page</a>.</p>
</div> </div>
<p>With the current reference setup, it should be possible to get on a Reticulum network for around 100$ <p>With the current reference setup, it should be possible to get on a Reticulum network for around 100$ even if you have none of the hardware already, and need to purchase everything.</p>
even if you have none of the hardware already, and need to purchase everything.</p> <p>This reference setup is of course just a recommendation for getting started easily, and you should tailor it to your own specific needs, or whatever hardware you have available.</p>
<p>This reference setup is of course just a recommendation for getting started easily, and you should
tailor it to your own specific needs, or whatever hardware you have available.</p>
</section> </section>
<section id="protocol-specifics"> <section id="protocol-specifics">
<span id="understanding-protocolspecifics"></span><h2>Protocol Specifics<a class="headerlink" href="#protocol-specifics" title="Link to this heading"></a></h2> <span id="understanding-protocolspecifics"></span><h2>Protocol Specifics<a class="headerlink" href="#protocol-specifics" title="Link to this heading"></a></h2>
<p>This chapter will detail protocol specific information that is essential to the implementation of <p>This chapter will detail protocol specific information that is essential to the implementation of Reticulum, but non-critical in understanding how the protocol works on a general level. It should be treated more as a reference than as essential reading.</p>
Reticulum, but non-critical in understanding how the protocol works on a general level. It should be
treated more as a reference than as essential reading.</p>
<section id="packet-prioritisation"> <section id="packet-prioritisation">
<h3>Packet Prioritisation<a class="headerlink" href="#packet-prioritisation" title="Link to this heading"></a></h3> <h3>Packet Prioritisation<a class="headerlink" href="#packet-prioritisation" title="Link to this heading"></a></h3>
<p>Currently, Reticulum is completely priority-agnostic regarding <em>general</em> traffic. All traffic is handled <p>Currently, Reticulum is completely priority-agnostic regarding <em>general</em> traffic. All traffic is handled on a first-come, first-serve basis. Announce re-transmission and other maintenance traffic is handled according to the re-transmission times and priorities described earlier in this chapter.</p>
on a first-come, first-serve basis. Announce re-transmission and other maintenance traffic is handled
according to the re-transmission times and priorities described earlier in this chapter.</p>
</section> </section>
<section id="interface-access-codes"> <section id="interface-access-codes">
<h3>Interface Access Codes<a class="headerlink" href="#interface-access-codes" title="Link to this heading"></a></h3> <h3>Interface Access Codes<a class="headerlink" href="#interface-access-codes" title="Link to this heading"></a></h3>
<p>Reticulum can create named virtual networks, and networks that are only accessible by knowing a preshared <p>Reticulum can create named virtual networks, and networks that are only accessible by knowing a preshared passphrase. The configuration of this is detailed in the <a class="reference internal" href="interfaces.html#interfaces-options"><span class="std std-ref">Common Interface Options</span></a> section. To implement this feature, Reticulum uses the concept of Interface Access Codes, that are calculated and verified per-packet.</p>
passphrase. The configuration of this is detailed in the <a class="reference internal" href="interfaces.html#interfaces-options"><span class="std std-ref">Common Interface Options</span></a> <p>An interface with a named virtual network or passphrase authentication enabled will derive a shared Ed25519 signing identity, and for every outbound packet generate a signature of the entire packet. This signature is then inserted into the packet as an Interface Access Code before transmission. Depending on the speed and capabilities of the interface, the IFAC can be the full 512-bit Ed25519 signature, or a truncated version. Configured IFAC length can be inspected for all interfaces with the <code class="docutils literal notranslate"><span class="pre">rnstatus</span></code> utility.</p>
section. To implement this feature, Reticulum uses the concept of Interface Access Codes, that are calculated <p>Upon receipt, the interface will check that the signature matches the expected value, and drop the packet if it does not. This ensures that only packets sent with the correct naming and/or passphrase parameters are allowed to pass onto the network.</p>
and verified per-packet.</p>
<p>An interface with a named virtual network or passphrase authentication enabled will derive a shared Ed25519
signing identity, and for every outbound packet generate a signature of the entire packet. This signature is
then inserted into the packet as an Interface Access Code before transmission. Depending on the speed and
capabilities of the interface, the IFAC can be the full 512-bit Ed25519 signature, or a truncated version.
Configured IFAC length can be inspected for all interfaces with the <code class="docutils literal notranslate"><span class="pre">rnstatus</span></code> utility.</p>
<p>Upon receipt, the interface will check that the signature matches the expected value, and drop the packet if it
does not. This ensures that only packets sent with the correct naming and/or passphrase parameters are allowed to
pass onto the network.</p>
</section> </section>
<section id="wire-format"> <section id="wire-format">
<span id="understanding-packetformat"></span><h3>Wire Format<a class="headerlink" href="#wire-format" title="Link to this heading"></a></h3> <span id="understanding-packetformat"></span><h3>Wire Format<a class="headerlink" href="#wire-format" title="Link to this heading"></a></h3>
@@ -1168,24 +968,17 @@ but excluding any interface access codes.
</section> </section>
<section id="announce-propagation-rules"> <section id="announce-propagation-rules">
<span id="understanding-announcepropagation"></span><h3>Announce Propagation Rules<a class="headerlink" href="#announce-propagation-rules" title="Link to this heading"></a></h3> <span id="understanding-announcepropagation"></span><h3>Announce Propagation Rules<a class="headerlink" href="#announce-propagation-rules" title="Link to this heading"></a></h3>
<p>The following table illustrates the rules for automatically propagating announces <p>The following table illustrates the rules for automatically propagating announces from one interface type to another, for all possible combinations. For the purpose of announce propagation, the <em>Full</em> and <em>Gateway</em> modes are identical.</p>
from one interface type to another, for all possible combinations. For the purpose <p>See the <a class="reference internal" href="interfaces.html#interfaces-modes"><span class="std std-ref">Interface Modes</span></a> section for a conceptual overview of the different interface modes, and how they are configured.</p>
of announce propagation, the <em>Full</em> and <em>Gateway</em> modes are identical.</p>
<img alt="_images/if_mode_graph_b.png" src="_images/if_mode_graph_b.png" /> <img alt="_images/if_mode_graph_b.png" src="_images/if_mode_graph_b.png" />
<p>See the <a class="reference internal" href="interfaces.html#interfaces-modes"><span class="std std-ref">Interface Modes</span></a> section for a conceptual overview <p>Or, represented in table form:</p>
of the different interface modes, and how they are configured.</p> <img alt="_images/if_mode_graph_c.png" src="_images/if_mode_graph_c.png" />
</section> </section>
<section id="cryptographic-primitives"> <section id="cryptographic-primitives">
<span id="understanding-primitives"></span><h3>Cryptographic Primitives<a class="headerlink" href="#cryptographic-primitives" title="Link to this heading"></a></h3> <span id="understanding-primitives"></span><h3>Cryptographic Primitives<a class="headerlink" href="#cryptographic-primitives" title="Link to this heading"></a></h3>
<p>Reticulum uses a simple suite of efficient, strong and well-tested cryptographic <p>Reticulum uses a simple suite of efficient, strong and well-tested cryptographic primitives, with widely available implementations that can be used both on general-purpose CPUs and on microcontrollers.</p>
primitives, with widely available implementations that can be used both on <p>One of the primary considerations for choosing this particular set of primitives is that they can be implemented <em>safely</em> with relatively few pitfalls, on practically all current computing platforms.</p>
general-purpose CPUs and on microcontrollers.</p> <p>The primitives listed here <strong>are authoritative</strong>. Anything claiming to be Reticulum, but not using these exact primitives <strong>is not</strong> Reticulum, and possibly an intentionally compromised or weakened clone. The utilised primitives are:</p>
<p>One of the primary considerations for choosing this particular set of primitives is
that they can be implemented <em>safely</em> with relatively few pitfalls, on practically
all current computing platforms.</p>
<p>The primitives listed here <strong>are authoritative</strong>. Anything claiming to be Reticulum,
but not using these exact primitives <strong>is not</strong> Reticulum, and possibly an
intentionally compromised or weakened clone. The utilised primitives are:</p>
<ul class="simple"> <ul class="simple">
<li><p>Ed25519 for signatures</p></li> <li><p>Ed25519 for signatures</p></li>
<li><p>X25519 for ECDH key exchanges</p></li> <li><p>X25519 for ECDH key exchanges</p></li>
@@ -1202,28 +995,15 @@ intentionally compromised or weakened clone. The utilised primitives are:</p>
<li><p>SHA-256</p></li> <li><p>SHA-256</p></li>
<li><p>SHA-512</p></li> <li><p>SHA-512</p></li>
</ul> </ul>
<p>In the default installation configuration, the <code class="docutils literal notranslate"><span class="pre">X25519</span></code>, <code class="docutils literal notranslate"><span class="pre">Ed25519</span></code> and <code class="docutils literal notranslate"><span class="pre">AES-256-CBC</span></code> <p>In the default installation configuration, the <code class="docutils literal notranslate"><span class="pre">X25519</span></code>, <code class="docutils literal notranslate"><span class="pre">Ed25519</span></code> and <code class="docutils literal notranslate"><span class="pre">AES-256-CBC</span></code> primitives are provided by <a class="reference external" href="https://www.openssl.org/">OpenSSL</a> (via the <a class="reference external" href="https://github.com/pyca/cryptography">PyCA/cryptography</a> package). The hashing functions <code class="docutils literal notranslate"><span class="pre">SHA-256</span></code> and <code class="docutils literal notranslate"><span class="pre">SHA-512</span></code> are provided by the standard Python <a class="reference external" href="https://docs.python.org/3/library/hashlib.html">hashlib</a>. The <code class="docutils literal notranslate"><span class="pre">HKDF</span></code>, <code class="docutils literal notranslate"><span class="pre">HMAC</span></code>, <code class="docutils literal notranslate"><span class="pre">Token</span></code> primitives, and the <code class="docutils literal notranslate"><span class="pre">PKCS7</span></code> padding function are always provided by the following internal implementations:</p>
primitives are provided by <a class="reference external" href="https://www.openssl.org/">OpenSSL</a> (via the <a class="reference external" href="https://github.com/pyca/cryptography">PyCA/cryptography</a>
package). The hashing functions <code class="docutils literal notranslate"><span class="pre">SHA-256</span></code> and <code class="docutils literal notranslate"><span class="pre">SHA-512</span></code> are provided by the standard
Python <a class="reference external" href="https://docs.python.org/3/library/hashlib.html">hashlib</a>. The <code class="docutils literal notranslate"><span class="pre">HKDF</span></code>, <code class="docutils literal notranslate"><span class="pre">HMAC</span></code>,
<code class="docutils literal notranslate"><span class="pre">Token</span></code> primitives, and the <code class="docutils literal notranslate"><span class="pre">PKCS7</span></code> padding function are always provided by the
following internal implementations:</p>
<ul class="simple"> <ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">RNS/Cryptography/HKDF.py</span></code></p></li> <li><p><code class="docutils literal notranslate"><span class="pre">RNS/Cryptography/HKDF.py</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">RNS/Cryptography/HMAC.py</span></code></p></li> <li><p><code class="docutils literal notranslate"><span class="pre">RNS/Cryptography/HMAC.py</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">RNS/Cryptography/Token.py</span></code></p></li> <li><p><code class="docutils literal notranslate"><span class="pre">RNS/Cryptography/Token.py</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">RNS/Cryptography/PKCS7.py</span></code></p></li> <li><p><code class="docutils literal notranslate"><span class="pre">RNS/Cryptography/PKCS7.py</span></code></p></li>
</ul> </ul>
<p>Reticulum also includes a complete implementation of all necessary primitives in pure Python. <p>Reticulum also includes a complete implementation of all necessary primitives in pure Python. If OpenSSL &amp; PyCA are not available on the system when Reticulum is started, Reticulum will instead use the internal pure-python primitives. A trivial consequence of this is performance, with the OpenSSL backend being <em>much</em> faster. The most important consequence however, is the potential loss of security by using primitives that has not seen the same amount of scrutiny, testing and review as those from OpenSSL.</p>
If OpenSSL &amp; PyCA are not available on the system when Reticulum is started, Reticulum will <p>Using the normal RNS installation procedures, it is not possible to install Reticulum on a system without the required OpenSSL primitives being available, and if they are not, they will be resolved and installed as a dependency. It is only possible to use the pure-python primitives by manually specifying this, for example by using the <code class="docutils literal notranslate"><span class="pre">rnspure</span></code> package.</p>
instead use the internal pure-python primitives. A trivial consequence of this is performance,
with the OpenSSL backend being <em>much</em> faster. The most important consequence however, is the
potential loss of security by using primitives that has not seen the same amount of scrutiny,
testing and review as those from OpenSSL.</p>
<p>Using the normal RNS installation procedures, it is not possible to install Reticulum on a
system without the required OpenSSL primitives being available, and if they are not, they will
be resolved and installed as a dependency. It is only possible to use the pure-python primitives
by manually specifying this, for example by using the <code class="docutils literal notranslate"><span class="pre">rnspure</span></code> package.</p>
<div class="admonition warning"> <div class="admonition warning">
<p class="admonition-title">Warning</p> <p class="admonition-title">Warning</p>
<p>If you want to use the internal pure-python primitives, it is <strong>highly advisable</strong> that you <p>If you want to use the internal pure-python primitives, it is <strong>highly advisable</strong> that you
@@ -1338,7 +1118,7 @@ those risks are acceptable to you.</p>
</aside> </aside>
</div> </div>
</div><script src="_static/documentation_options.js?v=bb516dca"></script> </div><script src="_static/documentation_options.js?v=98c25ec5"></script>
<script src="_static/doctools.js?v=9bcbadda"></script> <script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script> <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script> <script src="_static/scripts/furo.js?v=46bd48cc"></script>
+37 -38
View File
@@ -7,12 +7,12 @@
<link rel="prefetch" href="_static/rns_logo_512.png" as="image"> <link rel="prefetch" href="_static/rns_logo_512.png" as="image">
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 --> <!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 -->
<title>Using Reticulum on Your System - Reticulum Network Stack 1.3.1 documentation</title> <title>Using Reticulum on Your System - Reticulum Network Stack 1.3.9 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" /> <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" />
<link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" /> <link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" />
<link rel="stylesheet" type="text/css" href="_static/custom.css?v=bb3cebc5" /> <link rel="stylesheet" type="text/css" href="_static/custom.css?v=e1715074" />
@@ -180,7 +180,7 @@
</label> </label>
</div> </div>
<div class="header-center"> <div class="header-center">
<a href="index.html"><div class="brand">Reticulum Network Stack 1.3.1 documentation</div></a> <a href="index.html"><div class="brand">Reticulum Network Stack 1.3.9 documentation</div></a>
</div> </div>
<div class="header-right"> <div class="header-right">
<div class="theme-toggle-container theme-toggle-header"> <div class="theme-toggle-container theme-toggle-header">
@@ -204,7 +204,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/> <img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div> </div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.3.1 documentation</span> <span class="sidebar-brand-text">Reticulum Network Stack 1.3.9 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search"> </a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search"> <input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -1106,39 +1106,35 @@ positional arguments:
destination hexadecimal hash of the destination to connect to destination hexadecimal hash of the destination to connect to
options: options:
-h, --help show this help message and exit -h, --help show this help message and exit
--config, -c CONFIG path to alternative Reticulum config directory --config, -c PATH path to config directory
--identity, -i IDENTITY --rnsconfig, -c PATH path to alternative Reticulum config directory
path to identity file to use --identity, -i IDENTITY path to identity file to use
-v, --verbose increase verbosity -v, --verbose increase verbosity
-q, --quiet decrease verbosity -q, --quiet decrease verbosity
-p, --print-identity print identity and destination info and exit -p, --print-identity print identity and destination info and exit
--version show program&#39;s version number and exit --version show program&#39;s version number and exit
-l, --listen listen (server) mode; any command specified after -- -l, --listen listen (server) mode; any command specified after --
will be used as the default command when the initiator will be used as the default command when the initiator
does not provide one or when remote command execution does not provide one or when remote command execution
is disabled; if no command is specified, the default is disabled; if no command is specified, the default
shell of the user running rnsh will be used shell of the user running rnsh will be used
-s, --service SERVICE -s, --service SERVICE service name for identity file if not the default
service name for identity file if not the default -b, --announce PERIOD announce on startup and every PERIOD seconds; specify
-b, --announce PERIOD 0 to announce on startup only
announce on startup and every PERIOD seconds; specify -a, --allowed HASH allow this identity to connect (may be specified
0 to announce on startup only multiple times); allowed identities can also be
-a, --allowed HASH allow this identity to connect (may be specified specified in ~/.rnsh/allowed_identities or
multiple times); allowed identities can also be ~/.config/rnsh/allowed_identities, one hash per line
specified in ~/.rnsh/allowed_identities or -n, --no-auth disable authentication (allow any identity to connect)
~/.config/rnsh/allowed_identities, one hash per line
-n, --no-auth disable authentication (allow any identity to connect)
-A, --remote-command-as-args -A, --remote-command-as-args
concatenate remote command to the argument list of the concatenate remote command to the argument list of the
default program or shell default program or shell
-C, --no-remote-command -C, --no-remote-command disable executing command lines received from the
disable executing command lines received from the remote initiator
remote initiator -N, --no-id disable identity announcement on connect
-N, --no-id disable identity announcement on connect -m, --mirror return with the exit code of the remote process
-m, --mirror return with the exit code of the remote process -w, --timeout SECONDS connect and request timeout in seconds
-w, --timeout SECONDS
connect and request timeout in seconds
When specifying a command to execute, separate rnsh options from the command When specifying a command to execute, separate rnsh options from the command
and its arguments with --. For example: and its arguments with --. For example:
@@ -1374,7 +1370,7 @@ remote_management_allowed = 9fb6d773498fb3feda407ed8ef2c3229, 2d882c5586e548d79b
</section> </section>
<section id="automated-list-sourcing"> <section id="automated-list-sourcing">
<h3>Automated List Sourcing<a class="headerlink" href="#automated-list-sourcing" title="Link to this heading"></a></h3> <h3>Automated List Sourcing<a class="headerlink" href="#automated-list-sourcing" title="Link to this heading"></a></h3>
<p>Manually blocking identities is effective for immediate threats, but maintaining an up-to-date blocklist for a large network is impractical. Reticulum supports <strong>automated list sourcing</strong>, allowing your node to subscribe to blackhole lists maintained by trusted peers, or a central authority you manage yourself.</p> <p>Manually blocking identities is effective for immediate threats and annoyances, but maintaining an up-to-date blocklist across many nodes on a large network is impractical. Reticulum supports <strong>automated list sourcing</strong>, allowing your node to subscribe to blackhole lists maintained by trusted peers, or a central authority you manage yourself.</p>
<div class="admonition warning"> <div class="admonition warning">
<p class="admonition-title">Warning</p> <p class="admonition-title">Warning</p>
<p><strong>Verify Before Subscribing!</strong> Subscribing to a blackhole source is a powerful action that grants that source the ability to dictate who you can communicate with. Before adding a source to your configuration, verify that the maintainer aligns with your usage policy and values. Blindly subscribing to untrusted lists could inadvertently block legitimate peers or essential services.</p> <p><strong>Verify Before Subscribing!</strong> Subscribing to a blackhole source is a powerful action that grants that source the ability to dictate who you can communicate with. Before adding a source to your configuration, verify that the maintainer aligns with your usage policy and values. Blindly subscribing to untrusted lists could inadvertently block legitimate peers or essential services.</p>
@@ -1386,6 +1382,9 @@ remote_management_allowed = 9fb6d773498fb3feda407ed8ef2c3229, 2d882c5586e548d79b
<span class="na">...</span> <span class="na">...</span>
<span class="c1"># Automatically fetch blackhole lists from these trusted sources</span> <span class="c1"># Automatically fetch blackhole lists from these trusted sources</span>
<span class="na">blackhole_sources</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">521c87a83afb8f29e4455e77930b973b, 68a4aa91ac350c4087564e8a69f84e86</span> <span class="na">blackhole_sources</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">521c87a83afb8f29e4455e77930b973b, 68a4aa91ac350c4087564e8a69f84e86</span>
<span class="c1"># Optional update interval, defaults to one hour</span>
<span class="na">blackhole_update_interval</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">60</span>
<span class="na">...</span> <span class="na">...</span>
</pre></div> </pre></div>
</div> </div>
@@ -1636,7 +1635,7 @@ systemctl --user enable rnsd.service
</aside> </aside>
</div> </div>
</div><script src="_static/documentation_options.js?v=bb516dca"></script> </div><script src="_static/documentation_options.js?v=98c25ec5"></script>
<script src="_static/doctools.js?v=9bcbadda"></script> <script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script> <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script> <script src="_static/scripts/furo.js?v=46bd48cc"></script>
+5 -5
View File
@@ -7,12 +7,12 @@
<link rel="prefetch" href="_static/rns_logo_512.png" as="image"> <link rel="prefetch" href="_static/rns_logo_512.png" as="image">
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 --> <!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 -->
<title>What is Reticulum? - Reticulum Network Stack 1.3.1 documentation</title> <title>What is Reticulum? - Reticulum Network Stack 1.3.9 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" /> <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" />
<link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" /> <link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" />
<link rel="stylesheet" type="text/css" href="_static/custom.css?v=bb3cebc5" /> <link rel="stylesheet" type="text/css" href="_static/custom.css?v=e1715074" />
@@ -180,7 +180,7 @@
</label> </label>
</div> </div>
<div class="header-center"> <div class="header-center">
<a href="index.html"><div class="brand">Reticulum Network Stack 1.3.1 documentation</div></a> <a href="index.html"><div class="brand">Reticulum Network Stack 1.3.9 documentation</div></a>
</div> </div>
<div class="header-right"> <div class="header-right">
<div class="theme-toggle-container theme-toggle-header"> <div class="theme-toggle-container theme-toggle-header">
@@ -204,7 +204,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/> <img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div> </div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.3.1 documentation</span> <span class="sidebar-brand-text">Reticulum Network Stack 1.3.9 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search"> </a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search"> <input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -505,7 +505,7 @@ network, and vice versa.</p>
</aside> </aside>
</div> </div>
</div><script src="_static/documentation_options.js?v=bb516dca"></script> </div><script src="_static/documentation_options.js?v=98c25ec5"></script>
<script src="_static/doctools.js?v=9bcbadda"></script> <script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script> <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script> <script src="_static/scripts/furo.js?v=46bd48cc"></script>
+5 -5
View File
@@ -7,12 +7,12 @@
<link rel="prefetch" href="_static/rns_logo_512.png" as="image"> <link rel="prefetch" href="_static/rns_logo_512.png" as="image">
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 --> <!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 -->
<title>Zen of Reticulum - Reticulum Network Stack 1.3.1 documentation</title> <title>Zen of Reticulum - Reticulum Network Stack 1.3.9 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" /> <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" />
<link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" /> <link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" />
<link rel="stylesheet" type="text/css" href="_static/custom.css?v=bb3cebc5" /> <link rel="stylesheet" type="text/css" href="_static/custom.css?v=e1715074" />
@@ -180,7 +180,7 @@
</label> </label>
</div> </div>
<div class="header-center"> <div class="header-center">
<a href="index.html"><div class="brand">Reticulum Network Stack 1.3.1 documentation</div></a> <a href="index.html"><div class="brand">Reticulum Network Stack 1.3.9 documentation</div></a>
</div> </div>
<div class="header-right"> <div class="header-right">
<div class="theme-toggle-container theme-toggle-header"> <div class="theme-toggle-container theme-toggle-header">
@@ -204,7 +204,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/> <img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div> </div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.3.1 documentation</span> <span class="sidebar-brand-text">Reticulum Network Stack 1.3.9 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search"> </a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search"> <input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -677,7 +677,7 @@ Imagine a messaging app. You write it once. It works on a laptop connected to fi
</aside> </aside>
</div> </div>
</div><script src="_static/documentation_options.js?v=bb516dca"></script> </div><script src="_static/documentation_options.js?v=98c25ec5"></script>
<script src="_static/doctools.js?v=9bcbadda"></script> <script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script> <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script> <script src="_static/scripts/furo.js?v=46bd48cc"></script>
+5
View File
@@ -83,10 +83,15 @@ The `rngit` system is not a monolithic application prescribing a specific workfl
The core primitives include: The core primitives include:
* **Repository Hosting**: Bare Git repositories served over Reticulum links, accessible via standard Git commands through the `rns://` URL scheme. * **Repository Hosting**: Bare Git repositories served over Reticulum links, accessible via standard Git commands through the `rns://` URL scheme.
* **Identity-Based Access Control**: Fine-grained permissions managed through cryptographically verifiable identity hashes, configurable at the group, repository, or document level. * **Identity-Based Access Control**: Fine-grained permissions managed through cryptographically verifiable identity hashes, configurable at the group, repository, or document level.
* **Release Distribution**: Cryptographically signed release artifacts with embedded provenance information, verifiable offline and distributable through any Reticulum or physical path. * **Release Distribution**: Cryptographically signed release artifacts with embedded provenance information, verifiable offline and distributable through any Reticulum or physical path.
* **Work Document Tracking**: Structured, threaded work management attached to repositories, with precise permission controls, and the ability to contain updates or discussions. * **Work Document Tracking**: Structured, threaded work management attached to repositories, with precise permission controls, and the ability to contain updates or discussions.
* **Forking and Mirroring**: Automated replication of repositories from any accessible Git URL, with metadata tracking upstream relationships for synchronization. * **Forking and Mirroring**: Automated replication of repositories from any accessible Git URL, with metadata tracking upstream relationships for synchronization.
* **Nomad Network Integration**: Page node functionality for browsing repository contents, commit history, and release information through the Nomad Network protocol. * **Nomad Network Integration**: Page node functionality for browsing repository contents, commit history, and release information through the Nomad Network protocol.
These primitives can be composed into workflows ranging from single-developer projects to complex multi-organizational collaborations. A solo developer might use only repository hosting and release distribution. A research group might add work document tracking for structured peer review. A software distribution network might combine mirroring with cryptographic release verification to create resilient update channels. These primitives can be composed into workflows ranging from single-developer projects to complex multi-organizational collaborations. A solo developer might use only repository hosting and release distribution. A research group might add work document tracking for structured peer review. A software distribution network might combine mirroring with cryptographic release verification to create resilient update channels.
+11 -57
View File
@@ -1,14 +1,10 @@
# Code Examples # Code Examples
A number of examples are included in the source distribution of Reticulum. A number of examples are included in the source distribution of Reticulum. You can use these examples to learn how to write your own programs.
You can use these examples to learn how to write your own programs.
## Minimal ## Minimal
The *Minimal* example demonstrates the bare-minimum setup required to connect to The *Minimal* example demonstrates the bare-minimum setup required to connect to a Reticulum network from your program. In about five lines of code, you will have the Reticulum Network Stack initialised, and ready to pass traffic in your program.
a Reticulum network from your program. In about five lines of code, you will
have the Reticulum Network Stack initialised, and ready to pass traffic in your
program.
```default ```default
########################################################## ##########################################################
@@ -61,7 +57,6 @@ def program_setup(configpath):
# Let's hand over control to the announce loop # Let's hand over control to the announce loop
announceLoop(destination) announceLoop(destination)
def announceLoop(destination): def announceLoop(destination):
# Let the user know that everything is ready # Let the user know that everything is ready
RNS.log( RNS.log(
@@ -79,7 +74,6 @@ def announceLoop(destination):
destination.announce() destination.announce()
RNS.log("Sent announce from "+RNS.prettyhexrep(destination.hash)) RNS.log("Sent announce from "+RNS.prettyhexrep(destination.hash))
########################################################## ##########################################################
#### Program Startup ##################################### #### Program Startup #####################################
########################################################## ##########################################################
@@ -119,9 +113,7 @@ This example can also be found at [https://github.com/markqvist/Reticulum/blob/m
## Announce ## Announce
The *Announce* example builds upon the previous example by exploring how to The *Announce* example builds upon the previous example by exploring how to announce a destination on the network, and how to let your program receive notifications about announces from relevant destinations.
announce a destination on the network, and how to let your program receive
notifications about announces from relevant destinations.
```default ```default
########################################################## ##########################################################
@@ -202,7 +194,6 @@ def program_setup(configpath):
# Let's hand over control to the announce loop # Let's hand over control to the announce loop
announceLoop(destination_1, destination_2) announceLoop(destination_1, destination_2)
def announceLoop(destination_1, destination_2): def announceLoop(destination_1, destination_2):
# Let the user know that everything is ready # Let the user know that everything is ready
RNS.log("Announce example running, hit enter to manually send an announce (Ctrl-C to quit)") RNS.log("Announce example running, hit enter to manually send an announce (Ctrl-C to quit)")
@@ -302,8 +293,7 @@ This example can also be found at [https://github.com/markqvist/Reticulum/blob/m
## Broadcast ## Broadcast
The *Broadcast* example explores how to transmit plaintext broadcast messages The *Broadcast* example explores how to transmit plaintext broadcast messages over the network.
over the network.
```default ```default
########################################################## ##########################################################
@@ -380,7 +370,6 @@ def broadcastLoop(destination):
packet.send() packet.send()
########################################################## ##########################################################
#### Program Startup ##################################### #### Program Startup #####################################
########################################################## ##########################################################
@@ -433,8 +422,7 @@ This example can also be found at [https://github.com/markqvist/Reticulum/blob/m
## Echo ## Echo
The *Echo* example demonstrates communication between two destinations using The *Echo* example demonstrates communication between two destinations using the Packet interface.
the Packet interface.
```default ```default
########################################################## ##########################################################
@@ -454,7 +442,6 @@ import RNS
# them all within the app namespace "example_utilities" # them all within the app namespace "example_utilities"
APP_NAME = "example_utilities" APP_NAME = "example_utilities"
########################################################## ##########################################################
#### Server Part ######################################### #### Server Part #########################################
########################################################## ##########################################################
@@ -500,7 +487,6 @@ def server(configpath):
# Let's Wait for client requests or user input # Let's Wait for client requests or user input
announceLoop(echo_destination) announceLoop(echo_destination)
def announceLoop(destination): def announceLoop(destination):
# Let the user know that everything is ready # Let the user know that everything is ready
RNS.log( RNS.log(
@@ -518,7 +504,6 @@ def announceLoop(destination):
destination.announce() destination.announce()
RNS.log("Sent announce from "+RNS.prettyhexrep(destination.hash)) RNS.log("Sent announce from "+RNS.prettyhexrep(destination.hash))
def server_callback(message, packet): def server_callback(message, packet):
global reticulum global reticulum
@@ -547,7 +532,6 @@ def server_callback(message, packet):
RNS.log("Received packet from echo client, proof sent"+reception_stats) RNS.log("Received packet from echo client, proof sent"+reception_stats)
########################################################## ##########################################################
#### Client Part ######################################### #### Client Part #########################################
########################################################## ##########################################################
@@ -698,7 +682,6 @@ def packet_timed_out(receipt):
if receipt.status == RNS.PacketReceipt.FAILED: if receipt.status == RNS.PacketReceipt.FAILED:
RNS.log("Packet "+RNS.prettyhexrep(receipt.hash)+" timed out") RNS.log("Packet "+RNS.prettyhexrep(receipt.hash)+" timed out")
########################################################## ##########################################################
#### Program Startup ##################################### #### Program Startup #####################################
########################################################## ##########################################################
@@ -775,8 +758,7 @@ This example can also be found at [https://github.com/markqvist/Reticulum/blob/m
## Link ## Link
The *Link* example explores establishing an encrypted link to a remote The *Link* example explores establishing an encrypted link to a remote destination, and passing traffic back and forth over the link.
destination, and passing traffic back and forth over the link.
```default ```default
########################################################## ##########################################################
@@ -877,7 +859,6 @@ def server_packet_received(message, packet):
reply_data = reply_text.encode("utf-8") reply_data = reply_text.encode("utf-8")
RNS.Packet(latest_client_link, reply_data).send() RNS.Packet(latest_client_link, reply_data).send()
########################################################## ##########################################################
#### Client Part ######################################### #### Client Part #########################################
########################################################## ##########################################################
@@ -1014,7 +995,6 @@ def client_packet_received(message, packet):
print("> ", end=" ") print("> ", end=" ")
sys.stdout.flush() sys.stdout.flush()
########################################################## ##########################################################
#### Program Startup ##################################### #### Program Startup #####################################
########################################################## ##########################################################
@@ -1075,8 +1055,7 @@ This example can also be found at [https://github.com/markqvist/Reticulum/blob/m
## Identification ## Identification
The *Identify* example explores identifying an intiator of a link, once The *Identify* example explores identifying an intiator of a link, once the link has been established.
the link has been established.
```default ```default
########################################################## ##########################################################
@@ -1187,7 +1166,6 @@ def server_packet_received(message, packet):
reply_data = reply_text.encode("utf-8") reply_data = reply_text.encode("utf-8")
RNS.Packet(latest_client_link, reply_data).send() RNS.Packet(latest_client_link, reply_data).send()
########################################################## ##########################################################
#### Client Part ######################################### #### Client Part #########################################
########################################################## ##########################################################
@@ -1337,7 +1315,6 @@ def client_packet_received(message, packet):
print("> ", end=" ") print("> ", end=" ")
sys.stdout.flush() sys.stdout.flush()
########################################################## ##########################################################
#### Program Startup ##################################### #### Program Startup #####################################
########################################################## ##########################################################
@@ -1499,7 +1476,6 @@ def client_connected(link):
def client_disconnected(link): def client_disconnected(link):
RNS.log("Client disconnected") RNS.log("Client disconnected")
########################################################## ##########################################################
#### Client Part ######################################### #### Client Part #########################################
########################################################## ##########################################################
@@ -1588,7 +1564,6 @@ def client_loop():
failed_callback = request_failed failed_callback = request_failed
) )
except Exception as e: except Exception as e:
RNS.log("Error while sending request over the link: "+str(e)) RNS.log("Error while sending request over the link: "+str(e))
should_quit = True should_quit = True
@@ -1606,7 +1581,6 @@ def request_received(request_receipt):
def request_failed(request_receipt): def request_failed(request_receipt):
RNS.log("The request "+RNS.prettyhexrep(request_receipt.request_id)+" failed.") RNS.log("The request "+RNS.prettyhexrep(request_receipt.request_id)+" failed.")
# This function is called when a link # This function is called when a link
# has been established with the server # has been established with the server
def link_established(link): def link_established(link):
@@ -1632,7 +1606,6 @@ def link_closed(link):
time.sleep(1.5) time.sleep(1.5)
sys.exit(0) sys.exit(0)
########################################################## ##########################################################
#### Program Startup ##################################### #### Program Startup #####################################
########################################################## ##########################################################
@@ -1693,8 +1666,7 @@ This example can also be found at [https://github.com/markqvist/Reticulum/blob/m
## Channel ## Channel
The *Channel* example explores using a `Channel` to send structured The *Channel* example explores using a `Channel` to send structured data between peers of a `Link`.
data between peers of a `Link`.
```default ```default
########################################################## ##########################################################
@@ -1784,7 +1756,6 @@ class StringMessage(RNS.MessageBase):
def unpack(self, raw): def unpack(self, raw):
self.data, self.timestamp = umsgpack.unpackb(raw) self.data, self.timestamp = umsgpack.unpackb(raw)
########################################################## ##########################################################
#### Server Part ######################################### #### Server Part #########################################
########################################################## ##########################################################
@@ -1888,7 +1859,6 @@ def server_message_received(message):
# handlers are skipped. # handlers are skipped.
return True return True
########################################################## ##########################################################
#### Client Part ######################################### #### Client Part #########################################
########################################################## ##########################################################
@@ -2031,7 +2001,6 @@ def client_message_received(message):
print("> ", end=" ") print("> ", end=" ")
sys.stdout.flush() sys.stdout.flush()
########################################################## ##########################################################
#### Program Startup ##################################### #### Program Startup #####################################
########################################################## ##########################################################
@@ -2092,8 +2061,7 @@ This example can also be found at [https://github.com/markqvist/Reticulum/blob/m
## Buffer ## Buffer
The *Buffer* example explores using buffered readers and writers to send The *Buffer* example explores using buffered readers and writers to send binary data between peers of a `Link`.
binary data between peers of a `Link`.
```default ```default
########################################################## ##########################################################
@@ -2117,7 +2085,6 @@ from RNS.vendor import umsgpack
# them all within the app namespace "example_utilities" # them all within the app namespace "example_utilities"
APP_NAME = "example_utilities" APP_NAME = "example_utilities"
########################################################## ##########################################################
#### Server Part ######################################### #### Server Part #########################################
########################################################## ##########################################################
@@ -2190,7 +2157,6 @@ def client_connected(link):
if latest_buffer: if latest_buffer:
latest_buffer.close() latest_buffer.close()
# Create buffer objects. # Create buffer objects.
# The stream_id parameter to these functions is # The stream_id parameter to these functions is
# a bit like a file descriptor, except that it # a bit like a file descriptor, except that it
@@ -2227,7 +2193,6 @@ def server_buffer_ready(ready_bytes: int):
########################################################## ##########################################################
#### Client Part ######################################### #### Client Part #########################################
########################################################## ##########################################################
@@ -2319,7 +2284,6 @@ def client_loop():
# Flush the buffer to force the data to be sent. # Flush the buffer to force the data to be sent.
buffer.flush() buffer.flush()
except Exception as e: except Exception as e:
RNS.log("Error while sending data over the link buffer: "+str(e)) RNS.log("Error while sending data over the link buffer: "+str(e))
should_quit = True should_quit = True
@@ -2363,7 +2327,6 @@ def client_buffer_ready(ready_bytes: int):
print("> ", end=" ") print("> ", end=" ")
sys.stdout.flush() sys.stdout.flush()
########################################################## ##########################################################
#### Program Startup ##################################### #### Program Startup #####################################
########################################################## ##########################################################
@@ -2424,9 +2387,7 @@ This example can also be found at [https://github.com/markqvist/Reticulum/blob/m
## Filetransfer ## Filetransfer
The *Filetransfer* example implements a basic file-server program that The *Filetransfer* example implements a basic file-server program that allow clients to connect and download files. The program uses the Resource interface to efficiently pass files of any size over a Reticulum [Link](reference.md#api-link).
allow clients to connect and download files. The program uses the Resource
interface to efficiently pass files of any size over a Reticulum [Link](reference.md#api-link).
```default ```default
########################################################## ##########################################################
@@ -2639,7 +2600,6 @@ download_time = 0
transfer_size = 0 transfer_size = 0
file_size = 0 file_size = 0
# This initialisation is executed when the users chooses # This initialisation is executed when the users chooses
# to run as a client # to run as a client
def client(destination_hexhash, configpath): def client(destination_hexhash, configpath):
@@ -2660,7 +2620,6 @@ def client(destination_hexhash, configpath):
# We must first initialise Reticulum # We must first initialise Reticulum
reticulum = RNS.Reticulum(configpath) reticulum = RNS.Reticulum(configpath)
# Check if we know a path to the destination # Check if we know a path to the destination
if not RNS.Transport.has_path(destination_hash): if not RNS.Transport.has_path(destination_hash):
RNS.log("Destination is not yet known. Requesting path and waiting for announce to arrive...") RNS.log("Destination is not yet known. Requesting path and waiting for announce to arrive...")
@@ -2895,7 +2854,6 @@ def filelist_timeout_job():
RNS.log("Timed out waiting for filelist, exiting") RNS.log("Timed out waiting for filelist, exiting")
sys.exit(0) sys.exit(0)
# When a link is closed, we'll inform the # When a link is closed, we'll inform the
# user, and exit the program # user, and exit the program
def link_closed(link): def link_closed(link):
@@ -3038,10 +2996,7 @@ This example can also be found at [https://github.com/markqvist/Reticulum/blob/m
## Custom Interfaces ## Custom Interfaces
The *ExampleInterface* demonstrates creating custom interfaces for Reticulum. The *ExampleInterface* demonstrates creating custom interfaces for Reticulum. Any number of custom interfaces can be loaded and utilised by Reticulum, and will be fully on-par with natively included interfaces, including all supported [interface modes](interfaces.md#interfaces-modes) and [common configuration options](interfaces.md#interfaces-options).
Any number of custom interfaces can be loaded and utilised by Reticulum, and
will be fully on-par with natively included interfaces, including all supported
[interface modes](interfaces.md#interfaces-modes) and [common configuration options](interfaces.md#interfaces-options).
```default ```default
# This example illustrates creating a custom interface # This example illustrates creating a custom interface
@@ -3226,7 +3181,6 @@ class ExampleInterface(Interface):
self.online = True self.online = True
RNS.log("Serial port "+self.port+" is now open", RNS.LOG_VERBOSE) RNS.log("Serial port "+self.port+" is now open", RNS.LOG_VERBOSE)
# This method will be called from our read-loop # This method will be called from our read-loop
# whenever a full packet has been received over # whenever a full packet has been received over
# the underlying medium. # the underlying medium.
+83 -273
View File
@@ -1,49 +1,36 @@
# Getting Started Fast # Getting Started Fast
The best way to get started with the Reticulum Network Stack depends on what The best way to get started with the Reticulum Network Stack depends on what you want to do. This guide will outline sensible starting paths for different scenarios.
you want to do. This guide will outline sensible starting paths for different
scenarios.
## Standalone Reticulum Installation ## Standalone Reticulum Installation
If you simply want to install Reticulum and related utilities on a system, If you simply want to install Reticulum and related utilities on a system, the easiest way is via the `pip` package manager:
the easiest way is via the `pip` package manager:
```shell ```shell
pip install rns pip install rns
``` ```
If you do not already have pip installed, you can install it using the package manager If you do not already have pip installed, you can install it using the package manager of your system with a command like `sudo apt install python3-pip`, `sudo pamac install python-pip` or similar.
of your system with a command like `sudo apt install python3-pip`,
`sudo pamac install python-pip` or similar.
You can also dowload the Reticulum release wheels from GitHub, or other release channels, You can also dowload the Reticulum release wheels from GitHub, or other release channels, and install them offline using `pip`:
and install them offline using `pip`:
```shell ```shell
pip install ./rns-1.1.2-py3-none-any.whl pip install ./rns-1.1.2-py3-none-any.whl
``` ```
On platforms that limit user package installation via `pip`, you may need to manually On platforms that limit user package installation via `pip`, you may need to manually allow this using the `--break-system-packages` command line flag when installing. This will not actually break any packages, unless you have installed Reticulum directly via your operating system’s package manager.
allow this using the `--break-system-packages` command line flag when installing. This
will not actually break any packages, unless you have installed Reticulum directly via
your operating system’s package manager.
```shell ```shell
pip install rns --break-system-packages pip install rns --break-system-packages
``` ```
For more detailed installation instructions, please see the For more detailed installation instructions, please see the [Platform-Specific Install Notes](#install-guides) section.
[Platform-Specific Install Notes](#install-guides) section.
After installation is complete, it might be helpful to refer to the After installation is complete, it might be helpful to refer to the [Using Reticulum on Your System](using.md#using-main) chapter.
[Using Reticulum on Your System](using.md#using-main) chapter.
### Resolving Dependency & Installation Issues ### Resolving Dependency & Installation Issues
On some platforms, there may not be binary packages available for all dependencies, and On some platforms, there may not be binary packages available for all dependencies, and `pip` installation may fail with an error message. In these cases, the issue can usually be resolved by installing the development essentials packages for your platform:
`pip` installation may fail with an error message. In these cases, the issue can usually
be resolved by installing the development essentials packages for your platform:
```shell ```shell
# Debian / Ubuntu / Derivatives # Debian / Ubuntu / Derivatives
@@ -56,66 +43,35 @@ sudo pamac install base-devel
sudo dnf groupinstall "Development Tools" "Development Libraries" sudo dnf groupinstall "Development Tools" "Development Libraries"
``` ```
With the base development packages installed, `pip` should be able to compile any missing With the base development packages installed, `pip` should be able to compile any missing dependencies from source, and complete installation even on platforms that don’t have pre-compiled packages available.
dependencies from source, and complete installation even on platforms that don’t have pre-
compiled packages available.
## Try Using a Reticulum-based Program ## Try Using a Reticulum-based Program
If you simply want to try using a program built with Reticulum, a [range of different If you simply want to try using a program built with Reticulum, a [range of different programs](software.md#software-main) exist that allow basic communication and a various other useful functions, even over extremely low-bandwidth Reticulum networks.
programs](software.md#software-main) exist that allow basic communication and a various other useful functions,
even over extremely low-bandwidth Reticulum networks.
## Using the Included Utilities ## Using the Included Utilities
Reticulum comes with a range of included utilities that make it easier to Reticulum comes with a range of included utilities that make it easier to manage your network, check connectivity and make Reticulum available to other programs on your system.
manage your network, check connectivity and make Reticulum available to other
programs on your system.
You can use `rnsd` to run Reticulum as a background or foreground service, You can use `rnsd` to run Reticulum as a background or foreground service, and the `rnstatus`, `rnpath` and `rnprobe` utilities to view and query network status and connectivity.
and the `rnstatus`, `rnpath` and `rnprobe` utilities to view and query
network status and connectivity.
To learn more about these utility programs, have a look at the To learn more about these utility programs, have a look at the [Using Reticulum on Your System](using.md#using-main) chapter of this manual.
[Using Reticulum on Your System](using.md#using-main) chapter of this manual.
## Creating a Network With Reticulum ## Creating a Network With Reticulum
To create a network, you will need to specify one or more *interfaces* for To create a network, you will need to specify one or more *interfaces* for Reticulum to use. This is done in the Reticulum configuration file, which by default is located at `~/.reticulum/config`. You can get an example configuration file with all options via `rnsd --exampleconfig`.
Reticulum to use. This is done in the Reticulum configuration file, which by
default is located at `~/.reticulum/config`. You can get an example
configuration file with all options via `rnsd --exampleconfig`.
When Reticulum is started for the first time, it will create a default When Reticulum is started for the first time, it will create a default configuration file, with one active interface. This default interface uses your existing Ethernet and WiFi networks (if any), and only allows you to communicate with other Reticulum peers within your local broadcast domains.
configuration file, with one active interface. This default interface uses
your existing Ethernet and WiFi networks (if any), and only allows you to
communicate with other Reticulum peers within your local broadcast domains.
To communicate further, you will have to add one or more interfaces. The default To communicate further, you will have to add one or more interfaces. The default configuration includes a number of examples, ranging from using TCP over the internet, to LoRa and Packet Radio interfaces.
configuration includes a number of examples, ranging from using TCP over the
internet, to LoRa and Packet Radio interfaces.
With Reticulum, you only need to configure what interfaces you want to communicate With Reticulum, you only need to configure what interfaces you want to communicate over. There is no need to configure address spaces, subnets, routing tables, or other things you might be used to from other network types.
over. There is no need to configure address spaces, subnets, routing tables,
or other things you might be used to from other network types.
Once Reticulum knows which interfaces it should use, it will automatically Once Reticulum knows which interfaces it should use, it will automatically discover topography and configure transport of data to any destinations it knows about.
discover topography and configure transport of data to any destinations it
knows about.
In situations where you already have an established WiFi or Ethernet network, and In situations where you already have an established WiFi or Ethernet network, and many devices that want to utilise the same external Reticulum network paths (for example over LoRa), it will often be sufficient to let one system act as a Reticulum gateway, by adding any external interfaces to the configuration of this system, and then enabling transport on it. Any other device on your local WiFi will then be able to connect to this wider Reticulum network just using the default ([AutoInterface](interfaces.md#interfaces-auto)) configuration.
many devices that want to utilise the same external Reticulum network paths (for example over
LoRa), it will often be sufficient to let one system act as a Reticulum gateway, by
adding any external interfaces to the configuration of this system, and then enabling transport on it. Any
other device on your local WiFi will then be able to connect to this wider Reticulum
network just using the default ([AutoInterface](interfaces.md#interfaces-auto)) configuration.
Possibly, the examples in the config file are enough to get you started. If Possibly, the examples in the config file are enough to get you started. If you want more information, you can read the [Building Networks](networks.md#networks-main) and [Interfaces](interfaces.md#interfaces-main) chapters of this manual, but most importantly, start with reading the next section, [Bootstrapping Connectivity](#bootstrapping-connectivity), as this provides the most essential understanding of how to ensure reliable connectivity with a minimum of maintenance.
you want more information, you can read the [Building Networks](networks.md#networks-main)
and [Interfaces](interfaces.md#interfaces-main) chapters of this manual, but most importantly,
start with reading the next section, [Bootstrapping Connectivity](#bootstrapping-connectivity),
as this provides the most essential understanding of how to ensure reliable
connectivity with a minimum of maintenance.
## Bootstrapping Connectivity ## Bootstrapping Connectivity
@@ -161,7 +117,9 @@ We strongly encourage everyone, even home users, to think in terms of building *
There is no requirement to commit to a single strategy. The most robust setups often mix static, dynamic, and discovered interfaces. There is no requirement to commit to a single strategy. The most robust setups often mix static, dynamic, and discovered interfaces.
* **Static Interfaces:** You maintain a permanent interface to a trusted friend or organization using a static configuration. * **Static Interfaces:** You maintain a permanent interface to a trusted friend or organization using a static configuration.
* **Bootstrap Links:** You connect a `bootstrap_only` interface to a public gateway on the Internet to scan for new connectable peers or to regain connectivity if your other interfaces fail. * **Bootstrap Links:** You connect a `bootstrap_only` interface to a public gateway on the Internet to scan for new connectable peers or to regain connectivity if your other interfaces fail.
* **Local Wide-Area Connectivity:** You run a `RNodeInterface` on a shared frequency, giving you completely self-sovereign and private wide-area access to both your own network and other Reticulum peers globally, without any “service providers” being able to control or monitor how you interact with people. * **Local Wide-Area Connectivity:** You run a `RNodeInterface` on a shared frequency, giving you completely self-sovereign and private wide-area access to both your own network and other Reticulum peers globally, without any “service providers” being able to control or monitor how you interact with people.
By combining these methods, you create a system that is secure against single points of failure, adaptable to changing network conditions, and better integrated into your physical and social reality. By combining these methods, you create a system that is secure against single points of failure, adaptable to changing network conditions, and better integrated into your physical and social reality.
@@ -186,20 +144,13 @@ As a good starting point, you can find interface definitions for connecting your
## Hosting Public Entrypoints ## Hosting Public Entrypoints
If you want to help build a strong global interconnection backbone, you can host a public (or private) entry-point to a Reticulum network over the If you want to help build a strong global interconnection backbone, you can host a public (or private) entry-point to a Reticulum network over the Internet. This section offers some helpful pointers. Once you have set up your public entrypoint, it is a great idea to [make it discoverable over Reticulum](interfaces.md#interfaces-discoverable).
Internet. This section offers some helpful pointers. Once you have set up your public entrypoint, it is a great idea to [make it discoverable over Reticulum](interfaces.md#interfaces-discoverable).
You will need a machine, physical or virtual with a public IP address, that can be reached by other devices on the Internet. You will need a machine, physical or virtual with a public IP address, that can be reached by other devices on the Internet.
The most efficient and performant way to host a connectable entry-point supporting many The most efficient and performant way to host a connectable entry-point supporting many users is to use the `BackboneInterface`. This interface type is fully compatible with the `TCPClientInterface` and `TCPServerInterface` types, but much faster and uses less system resources, allowing your device to handle thousands of connections even on small systems.
users is to use the `BackboneInterface`. This interface type is fully compatible with
the `TCPClientInterface` and `TCPServerInterface` types, but much faster and uses
less system resources, allowing your device to handle thousands of connections even on
small systems.
It is also important to set your connectable interface to `gateway` mode, since this It is also important to set your connectable interface to `gateway` mode, since this will greatly improve network convergence time and path resolution for anyone connecting to your entry-point.
will greatly improve network convergence time and path resolution for anyone connecting
to your entry-point.
```ini ```ini
# This example demonstrates a backbone interface # This example demonstrates a backbone interface
@@ -221,8 +172,7 @@ to your entry-point.
announce_rate_grace = 6 announce_rate_grace = 6
``` ```
If instead you want to make a private entry-point from the Internet, you can use the If instead you want to make a private entry-point from the Internet, you can use the [IFAC name and passphrase options](interfaces.md#interfaces-options) to secure your interface with a network name and passphrase.
[IFAC name and passphrase options](interfaces.md#interfaces-options) to secure your interface with a network name and passphrase.
```ini ```ini
# A private entry-point requiring a pre-shared # A private entry-point requiring a pre-shared
@@ -238,124 +188,71 @@ If instead you want to make a private entry-point from the Internet, you can use
passphrase = 2owjajquafIanPecAc passphrase = 2owjajquafIanPecAc
``` ```
If you are hosting an entry-point on an operating system that does not support If you are hosting an entry-point on an operating system that does not support `BackboneInterface`, you can use `TCPServerInterface` instead, although it will not be as performant.
`BackboneInterface`, you can use `TCPServerInterface` instead, although it will
not be as performant.
## Connecting Reticulum Instances Over the Internet ## Connecting Reticulum Instances Over the Internet
Reticulum currently offers three interfaces suitable for connecting instances over the Internet: [Backbone](interfaces.md#interfaces-backbone), [TCP](interfaces.md#interfaces-tcps) Reticulum currently offers three interfaces suitable for connecting instances over the Internet: [Backbone](interfaces.md#interfaces-backbone), [TCP](interfaces.md#interfaces-tcps) and [I2P](interfaces.md#interfaces-i2p). Each interface offers a different set of features, and Reticulum users should carefully choose the interface which best suites their needs.
and [I2P](interfaces.md#interfaces-i2p). Each interface offers a different set of features, and Reticulum
users should carefully choose the interface which best suites their needs.
The `TCPServerInterface` allows users to host an instance accessible over TCP/IP. This The `TCPServerInterface` allows users to host an instance accessible over TCP/IP. This method is generally faster, lower latency, and more energy efficient than using `I2PInterface`, however it also leaks more data about the server host.
method is generally faster, lower latency, and more energy efficient than using `I2PInterface`,
however it also leaks more data about the server host.
The `BackboneInterface` is a very fast and efficient interface type available on POSIX operating The `BackboneInterface` is a very fast and efficient interface type available on POSIX operating systems, designed to handle thousands of connections simultaneously with low memory, processing and I/O overhead. It is fully compatible with the TCP-based interface types.
systems, designed to handle thousands of connections simultaneously with low memory, processing
and I/O overhead. It is fully compatible with the TCP-based interface types.
TCP connections reveal the IP address of both your instance and the server to anyone who can TCP connections reveal the IP address of both your instance and the server to anyone who can inspect the connection. Someone could use this information to determine your location or identity. Adversaries inspecting your packets may be able to record packet metadata like time of transmission and packet size. Even though Reticulum encrypts traffic, TCP does not, so an adversary may be able to use packet inspection to learn that a system is running Reticulum, and what other IP addresses connect to it. Hosting a publicly reachable instance over TCP also requires a publicly reachable IP address, which most Internet connections don’t offer anymore.
inspect the connection. Someone could use this information to determine your location or identity. Adversaries
inspecting your packets may be able to record packet metadata like time of transmission and packet size.
Even though Reticulum encrypts traffic, TCP does not, so an adversary may be able to use
packet inspection to learn that a system is running Reticulum, and what other IP addresses connect to it.
Hosting a publicly reachable instance over TCP also requires a publicly reachable IP address,
which most Internet connections don’t offer anymore.
The `I2PInterface` routes messages through the [Invisible Internet Protocol The `I2PInterface` routes messages through the [Invisible Internet Protocol (I2P)](https://geti2p.net/en/). To use this interface, users must also run an I2P daemon in parallel to `rnsd`. For always-on I2P nodes it is recommended to use [i2pd](https://i2pd.website/).
(I2P)](https://geti2p.net/en/). To use this interface, users must also run an I2P daemon in
parallel to `rnsd`. For always-on I2P nodes it is recommended to use [i2pd](https://i2pd.website/).
By default, I2P will encrypt and mix all traffic sent over the Internet, and By default, I2P will encrypt and mix all traffic sent over the Internet, and hide both the sender and receiver Reticulum instance IP addresses. Running an I2P node will also relay other I2P user’s encrypted packets, which will use extra bandwidth and compute power, but also makes timing attacks and other forms of deep-packet-inspection much more difficult.
hide both the sender and receiver Reticulum instance IP addresses. Running an I2P node
will also relay other I2P user’s encrypted packets, which will use extra
bandwidth and compute power, but also makes timing attacks and other forms of
deep-packet-inspection much more difficult.
I2P also allows users to host globally available Reticulum instances from non-public IP’s and behind firewalls and NAT. I2P also allows users to host globally available Reticulum instances from non-public IP’s and behind firewalls and NAT.
In general it is recommended to use an I2P node if you want to host a publicly accessible In general it is recommended to use an I2P node if you want to host a publicly accessible instance, while preserving anonymity. If you care more about performance, and a slightly easier setup, use TCP.
instance, while preserving anonymity. If you care more about performance, and a slightly
easier setup, use TCP.
## Adding Radio Interfaces ## Adding Radio Interfaces
Once you have Reticulum installed and working, you can add radio interfaces with Once you have Reticulum installed and working, you can add radio interfaces with any compatible hardware you have available. Reticulum supports a wide range of radio hardware, and if you already have any available, it is very likely that it will work with Reticulum. For information on how to configure this, see the [Interfaces](interfaces.md#interfaces-main) section of this manual.
any compatible hardware you have available. Reticulum supports a wide range of radio
hardware, and if you already have any available, it is very likely that it will
work with Reticulum. For information on how to configure this, see the
[Interfaces](interfaces.md#interfaces-main) section of this manual.
If you do not already have transceiver hardware available, you can easily and If you do not already have transceiver hardware available, you can easily and cheaply build an [RNode](hardware.md#rnode-main), which is a general-purpose long-range digital radio transceiver, that integrates easily with Reticulum.
cheaply build an [RNode](hardware.md#rnode-main), which is a general-purpose long-range
digital radio transceiver, that integrates easily with Reticulum.
To build one yourself requires installing a custom firmware on a supported LoRa To build one yourself requires installing a custom firmware on a supported LoRa development board with an auto-install script or web-based flasher. Please see the [Communications Hardware](hardware.md#hardware-main) chapter for a guide. If you prefer purchasing a ready-made unit, you can refer to the list of suppliers.
development board with an auto-install script or web-based flasher.
Please see the [Communications Hardware](hardware.md#hardware-main) chapter for a guide.
If you prefer purchasing a ready-made unit, you can refer to the
list of suppliers.
Other radio-based hardware interfaces are being developed and made available by Other radio-based hardware interfaces are being developed and made available by the broader Reticulum community. You can find more information on such topics over Reticulum-based information sharing systems.
the broader Reticulum community. You can find more information on such topics
over Reticulum-based information sharing systems.
If you have communications hardware that is not already supported by any of the If you have communications hardware that is not already supported by any of the [existing interface types](interfaces.md#interfaces-main), it is easy to write (and potentially publish) a [custom interface module](interfaces.md#interfaces-custom) that makes it compatible with Reticulum.
[existing interface types](interfaces.md#interfaces-main), it is easy to write (and potentially
publish) a [custom interface module](interfaces.md#interfaces-custom) that makes it compatible with Reticulum.
## Creating and Using Custom Interfaces ## Creating and Using Custom Interfaces
While Reticulum includes a flexible and broad range of built-in interfaces, these While Reticulum includes a flexible and broad range of built-in interfaces, these will not cover every conceivable type of communications hardware that Reticulum can potentially use to communicate.
will not cover every conceivable type of communications hardware that Reticulum
can potentially use to communicate.
It is therefore possible to easily write your own interface modules, that can be It is therefore possible to easily write your own interface modules, that can be loaded at run-time and used on-par with any of the built-in interface types.
loaded at run-time and used on-par with any of the built-in interface types.
For more information on this subject, and code examples to build on, please see For more information on this subject, and code examples to build on, please see the [Configuring Interfaces](interfaces.md#interfaces-main) chapter.
the [Configuring Interfaces](interfaces.md#interfaces-main) chapter.
## Develop a Program with Reticulum ## Develop a Program with Reticulum
If you want to develop programs that use Reticulum, the easiest way to get If you want to develop programs that use Reticulum, the easiest way to get started is to install the latest release of Reticulum via pip:
started is to install the latest release of Reticulum via pip:
```default ```default
pip install rns pip install rns
``` ```
The above command will install Reticulum and dependencies, and you will be The above command will install Reticulum and dependencies, and you will be ready to import and use RNS in your own programs. The next step will most likely be to look at some [Example Programs](examples.md#examples-main).
ready to import and use RNS in your own programs. The next step will most
likely be to look at some [Example Programs](examples.md#examples-main).
The entire Reticulum API is documented in the [API Reference](reference.md#api-main) The entire Reticulum API is documented in the [API Reference](reference.md#api-main) chapter of this manual. Before diving in, it’s probably a good idea to read this manual in full, but at least start with the [Understanding Reticulum](understanding.md#understanding-main) chapter.
chapter of this manual. Before diving in, it’s probably a good idea to read
this manual in full, but at least start with the [Understanding Reticulum](understanding.md#understanding-main) chapter.
## Platform-Specific Install Notes ## Platform-Specific Install Notes
Some platforms require a slightly different installation procedure, or have Some platforms require a slightly different installation procedure, or have various quirks that are worth being aware of. These are listed here.
various quirks that are worth being aware of. These are listed here.
### Android ### Android
Reticulum can be used on Android in different ways. The easiest way to get Reticulum can be used on Android in different ways. The easiest way to get started is using an app like [Sideband](https://unsigned.io/sideband).
started is using an app like [Sideband](https://unsigned.io/sideband).
For more control and features, you can use Reticulum and related programs via For more control and features, you can use Reticulum and related programs via the [Termux app](https://termux.com/), at the time of writing available on [F-droid](https://f-droid.org).
the [Termux app](https://termux.com/), at the time of writing available on
[F-droid](https://f-droid.org).
Termux is a terminal emulator and Linux environment for Android based devices, Termux is a terminal emulator and Linux environment for Android based devices, which includes the ability to use many different programs and libraries, including Reticulum.
which includes the ability to use many different programs and libraries,
including Reticulum.
To use Reticulum within the Termux environment, you will need to install To use Reticulum within the Termux environment, you will need to install `python` and the `python-cryptography` library using `pkg`, the package-manager build into Termux. After that, you can use `pip` to install Reticulum.
`python` and the `python-cryptography` library using `pkg`, the package-manager
build into Termux. After that, you can use `pip` to install Reticulum.
From within Termux, execute the following: From within Termux, execute the following:
@@ -374,9 +271,7 @@ pip install wheel pip --upgrade
pip install rns pip install rns
``` ```
If for some reason the `python-cryptography` package is not available for If for some reason the `python-cryptography` package is not available for your platform via the Termux package manager, you can attempt to build it locally on your device using the following command:
your platform via the Termux package manager, you can attempt to build it
locally on your device using the following command:
```shell ```shell
# First, make sure indexes and packages are up to date. # First, make sure indexes and packages are up to date.
@@ -403,15 +298,11 @@ pip install cryptography
pip install rns pip install rns
``` ```
It is also possible to include Reticulum in apps compiled and distributed as It is also possible to include Reticulum in apps compiled and distributed as Android APKs. A detailed tutorial and example source code will be included here at a later point. Until then you can use the [Sideband source code](https://github.com/markqvist/sideband) as an example and starting point.
Android APKs. A detailed tutorial and example source code will be included
here at a later point. Until then you can use the [Sideband source code](https://github.com/markqvist/sideband) as an example and starting point.
### ARM64 ### ARM64
On some architectures, including ARM64, not all dependencies have precompiled On some architectures, including ARM64, not all dependencies have precompiled binaries. On such systems, you may need to install `python3-dev` (or similar) before installing Reticulum or programs that depend on Reticulum.
binaries. On such systems, you may need to install `python3-dev` (or similar) before
installing Reticulum or programs that depend on Reticulum.
```shell ```shell
# Install Python and development packages # Install Python and development packages
@@ -427,11 +318,7 @@ on your system locally.
### Debian Bookworm ### Debian Bookworm
On versions of Debian released after April 2023, it is no longer possible by default On versions of Debian released after April 2023, it is no longer possible by default to use `pip` to install packages onto your system. Unfortunately, you will need to use the replacement `pipx` command instead, which places installed packages in an isolated environment. This should not negatively affect Reticulum, but will not work for including and using Reticulum in your own scripts and programs.
to use `pip` to install packages onto your system. Unfortunately, you will need to
use the replacement `pipx` command instead, which places installed packages in an
isolated environment. This should not negatively affect Reticulum, but will not work
for including and using Reticulum in your own scripts and programs.
```shell ```shell
# Install pipx # Install pipx
@@ -444,41 +331,29 @@ pipx ensurepath
pipx install rns pipx install rns
``` ```
Alternatively, you can restore normal behaviour to `pip` by creating or editing Alternatively, you can restore normal behaviour to `pip` by creating or editing the configuration file located at `~/.config/pip/pip.conf`, and adding the following section:
the configuration file located at `~/.config/pip/pip.conf`, and adding the
following section:
```ini ```ini
[global] [global]
break-system-packages = true break-system-packages = true
``` ```
For a one-shot installation of Reticulum, without globally enabling the `break-system-packages` For a one-shot installation of Reticulum, without globally enabling the `break-system-packages` option, you can use the following command:
option, you can use the following command:
```shell ```shell
pip install rns --break-system-packages pip install rns --break-system-packages
``` ```
#### NOTE #### NOTE
The `--break-system-packages` directive is a somewhat misleading choice The `--break-system-packages` directive is a somewhat misleading choice of words. Setting it will of course not break any system packages, but will simply allow installing `pip` packages user- and system-wide. While this *could* in rare cases lead to version conflicts, it does not generally pose any problems, especially not in the case of installing Reticulum.
of words. Setting it will of course not break any system packages, but will simply
allow installing `pip` packages user- and system-wide. While this *could* in rare
cases lead to version conflicts, it does not generally pose any problems, especially
not in the case of installing Reticulum.
### MacOS ### MacOS
To install Reticulum on macOS, you will need to have Python and the `pip` package To install Reticulum on macOS, you will need to have Python and the `pip` package manager installed.
manager installed.
Systems running macOS can vary quite widely in whether or not Python is pre-installed, Systems running macOS can vary quite widely in whether or not Python is pre-installed, and if it is, which version is installed, and whether the `pip` package manager is also installed and set up. If in doubt, you can [download and install](https://www.python.org/downloads/) Python manually.
and if it is, which version is installed, and whether the `pip` package manager is
also installed and set up. If in doubt, you can [download and install](https://www.python.org/downloads/)
Python manually.
When Python and `pip` is available on your system, simply open a terminal window When Python and `pip` is available on your system, simply open a terminal window and use one of the following commands:
and use one of the following commands:
```shell ```shell
# Install Reticulum and utilities with pip: # Install Reticulum and utilities with pip:
@@ -490,16 +365,9 @@ pip3 install rns --break-system-packages
``` ```
#### NOTE #### NOTE
The `--break-system-packages` directive is a somewhat misleading choice The `--break-system-packages` directive is a somewhat misleading choice of words. Setting it will of course not break any system packages, but will simply allow installing `pip` packages user- and system-wide. While this *could* in rare cases lead to version conflicts, it does not generally pose any problems, especially not in the case of installing Reticulum.
of words. Setting it will of course not break any system packages, but will simply
allow installing `pip` packages user- and system-wide. While this *could* in rare
cases lead to version conflicts, it does not generally pose any problems, especially
not in the case of installing Reticulum.
Additionally, some version combinations of macOS and Python require you to Additionally, some version combinations of macOS and Python require you to manually add your installed `pip` packages directory to your PATH environment variable, before you can use installed commands in your terminal. Usually, adding the following line to your shell init script (for example `~/.zshrc`) will be enough:
manually add your installed `pip` packages directory to your PATH environment
variable, before you can use installed commands in your terminal. Usually, adding
the following line to your shell init script (for example `~/.zshrc`) will be enough:
```shell ```shell
export PATH=$PATH:~/Library/Python/3.9/bin export PATH=$PATH:~/Library/Python/3.9/bin
@@ -509,18 +377,12 @@ Adjust Python version and shell init script location according to your system.
### OpenWRT ### OpenWRT
On OpenWRT systems with sufficient storage and memory, you can install On OpenWRT systems with sufficient storage and memory, you can install Reticulum and related utilities using the opkg package manager and pip.
Reticulum and related utilities using the opkg package manager and pip.
#### NOTE #### NOTE
At the time of releasing this manual, work is underway to create pre-built At the time of releasing this manual, work is underway to create pre-built Reticulum packages for OpenWRT, with full configuration, service and `uci` integration. Please see the [feed-reticulum](https://github.com/gretel/feed-reticulum) and [reticulum-openwrt](https://github.com/gretel/reticulum-openwrt) repositories for more information.
Reticulum packages for OpenWRT, with full configuration, service
and `uci` integration. Please see the [feed-reticulum](https://github.com/gretel/feed-reticulum)
and [reticulum-openwrt](https://github.com/gretel/reticulum-openwrt)
repositories for more information.
To install Reticulum on OpenWRT, first log into a command line session, and To install Reticulum on OpenWRT, first log into a command line session, and then use the following instructions:
then use the following instructions:
```shell ```shell
# Install dependencies # Install dependencies
@@ -534,29 +396,15 @@ rnsd -vvv
``` ```
#### NOTE #### NOTE
The above instructions have been verified and tested on OpenWRT 21.02 only. The above instructions have been verified and tested on OpenWRT 21.02 only. It is likely that other versions may require slightly altered installation commands or package names. You will also need enough free space in your overlay FS, and enough free RAM to actually run Reticulum and any related programs and utilities.
It is likely that other versions may require slightly altered installation
commands or package names. You will also need enough free space in your
overlay FS, and enough free RAM to actually run Reticulum and any related
programs and utilities.
Depending on your device configuration, you may need to adjust firewall rules Depending on your device configuration, you may need to adjust firewall rules for Reticulum connectivity to and from your device to work. Until proper packaging is ready, you will also need to manually create a service or startup script to automatically laucnh Reticulum at boot time.
for Reticulum connectivity to and from your device to work. Until proper
packaging is ready, you will also need to manually create a service or startup
script to automatically laucnh Reticulum at boot time.
Please also note that the AutoInterface requires link-local IPv6 addresses Please also note that the AutoInterface requires link-local IPv6 addresses to be enabled for any Ethernet and WiFi devices you intend to use. If `ip a` shows an address starting with `fe80::` for the device in question, `AutoInterface` should work for that device.
to be enabled for any Ethernet and WiFi devices you intend to use. If `ip a`
shows an address starting with `fe80::` for the device in question,
`AutoInterface` should work for that device.
### Raspberry Pi ### Raspberry Pi
It is currently recommended to use a 64-bit version of the Raspberry Pi OS It is currently recommended to use a 64-bit version of the Raspberry Pi OS if you want to run Reticulum on Raspberry Pi computers, since 32-bit versions don’t always have packages available for some dependencies. If Python and the pip package manager is not already installed, do that first, and then install Reticulum using pip.
if you want to run Reticulum on Raspberry Pi computers, since 32-bit versions
don’t always have packages available for some dependencies. If Python and the
pip package manager is not already installed, do that first, and then
install Reticulum using pip.
```shell ```shell
# Install dependencies # Install dependencies
@@ -567,21 +415,13 @@ pip install rns --break-system-packages
``` ```
#### NOTE #### NOTE
The `--break-system-packages` directive is a somewhat misleading choice The `--break-system-packages` directive is a somewhat misleading choice of words. Setting it will of course not break any system packages, but will simply allow installing `pip` packages user- and system-wide. While this *could* in rare cases lead to version conflicts, it does not generally pose any problems, especially not in the case of installing Reticulum.
of words. Setting it will of course not break any system packages, but will simply
allow installing `pip` packages user- and system-wide. While this *could* in rare
cases lead to version conflicts, it does not generally pose any problems, especially
not in the case of installing Reticulum.
While it is possible to install and run Reticulum on 32-bit Rasperry Pi OSes, While it is possible to install and run Reticulum on 32-bit Rasperry Pi OSes, it will require manually configuring and installing required build dependencies, and is not detailed in this manual.
it will require manually configuring and installing required build dependencies,
and is not detailed in this manual.
### RISC-V ### RISC-V
On some architectures, including RISC-V, not all dependencies have precompiled On some architectures, including RISC-V, not all dependencies have precompiled binaries. On such systems, you may need to install `python3-dev` (or similar) before installing Reticulum or programs that depend on Reticulum.
binaries. On such systems, you may need to install `python3-dev` (or similar) before
installing Reticulum or programs that depend on Reticulum.
```shell ```shell
# Install Python and development packages # Install Python and development packages
@@ -592,16 +432,11 @@ sudo apt install python3 python3-pip python3-dev
python3 -m pip install rns python3 -m pip install rns
``` ```
With these packages installed, `pip` will be able to build any missing dependencies With these packages installed, `pip` will be able to build any missing dependencies on your system locally.
on your system locally.
### Ubuntu Lunar ### Ubuntu Lunar
On versions of Ubuntu released after April 2023, it is no longer possible by default On versions of Ubuntu released after April 2023, it is no longer possible by default to use `pip` to install packages onto your system. Unfortunately, you will need to use the replacement `pipx` command instead, which places installed packages in an isolated environment. This should not negatively affect Reticulum, but will not work for including and using Reticulum in your own scripts and programs.
to use `pip` to install packages onto your system. Unfortunately, you will need to
use the replacement `pipx` command instead, which places installed packages in an
isolated environment. This should not negatively affect Reticulum, but will not work
for including and using Reticulum in your own scripts and programs.
```shell ```shell
# Install pipx # Install pipx
@@ -614,42 +449,29 @@ pipx ensurepath
pipx install rns pipx install rns
``` ```
Alternatively, you can restore normal behaviour to `pip` by creating or editing Alternatively, you can restore normal behaviour to `pip` by creating or editing the configuration file located at `~/.config/pip/pip.conf`, and adding the following section:
the configuration file located at `~/.config/pip/pip.conf`, and adding the
following section:
```text ```text
[global] [global]
break-system-packages = true break-system-packages = true
``` ```
For a one-shot installation of Reticulum, without globally enabling the `break-system-packages` For a one-shot installation of Reticulum, without globally enabling the `break-system-packages` option, you can use the following command:
option, you can use the following command:
```text ```text
pip install rns --break-system-packages pip install rns --break-system-packages
``` ```
#### NOTE #### NOTE
The `--break-system-packages` directive is a somewhat misleading choice The `--break-system-packages` directive is a somewhat misleading choice of words. Setting it will of course not break any system packages, but will simply allow installing `pip` packages user- and system-wide. While this *could* in rare cases lead to version conflicts, it does not generally pose any problems, especially not in the case of installing Reticulum.
of words. Setting it will of course not break any system packages, but will simply
allow installing `pip` packages user- and system-wide. While this *could* in rare
cases lead to version conflicts, it does not generally pose any problems, especially
not in the case of installing Reticulum.
### Windows ### Windows
On Windows operating systems, the easiest way to install Reticulum is by using the On Windows operating systems, the easiest way to install Reticulum is by using the `pip` package manager from the command line (either the command prompt or Windows Powershell).
`pip` package manager from the command line (either the command prompt or Windows
Powershell).
If you don’t already have Python installed, [download and install Python](https://www.python.org/downloads/). If you don’t already have Python installed, [download and install Python](https://www.python.org/downloads/). At the time of publication of this manual, the recommended version is [Python 3.12.7](https://www.python.org/downloads/release/python-3127).
At the time of publication of this manual, the recommended version is [Python 3.12.7](https://www.python.org/downloads/release/python-3127).
**Important!** When asked by the installer, make sure to add the Python program to **Important!** When asked by the installer, make sure to add the Python program to your PATH environment variables. If you don’t do this, you will not be able to use the `pip` installer, or run the included Reticulum utility programs (such as `rnsd` and `rnstatus`) from the command line.
your PATH environment variables. If you don’t do this, you will not be able to
use the `pip` installer, or run the included Reticulum utility programs (such as
`rnsd` and `rnstatus`) from the command line.
After installing Python, open the command prompt or Windows Powershell, and type: After installing Python, open the command prompt or Windows Powershell, and type:
@@ -657,8 +479,7 @@ After installing Python, open the command prompt or Windows Powershell, and type
pip install rns pip install rns
``` ```
You can now use Reticulum and all included utility programs directly from your You can now use Reticulum and all included utility programs directly from your preferred command line interface.
preferred command line interface.
## Pure-Python Reticulum ## Pure-Python Reticulum
@@ -668,17 +489,6 @@ do not support [PyCA/cryptography](https://github.com/pyca/cryptography), it is
important that you read and understand the [Cryptographic Primitives](understanding.md#understanding-primitives) important that you read and understand the [Cryptographic Primitives](understanding.md#understanding-primitives)
section of this manual. section of this manual.
In some rare cases, and on more obscure system types, it is not possible to In some rare cases, and on more obscure system types, it is not possible to install one or more dependencies. In such situations, you can use the `rnspure` package instead of the `rns` package, or use `pip` with the `--no-dependencies` command-line option. The `rnspure` package requires no external dependencies for installation. Please note that the actual contents of the `rns` and `rnspure` packages are *completely identical*. The only difference is that the `rnspure` package lists no dependencies required for installation.
install one or more dependencies. In such situations,
you can use the `rnspure` package instead of the `rns` package, or use `pip`
with the `--no-dependencies` command-line option. The `rnspure`
package requires no external dependencies for installation. Please note that the
actual contents of the `rns` and `rnspure` packages are *completely identical*.
The only difference is that the `rnspure` package lists no dependencies required
for installation.
No matter how Reticulum is installed and started, it will load external dependencies No matter how Reticulum is installed and started, it will load external dependencies only if they are *needed* and *available*. If for example you want to use Reticulum on a system that cannot support `pyserial`, it is perfectly possible to do so using the rnspure package, but Reticulum will not be able to use serial-based interfaces. All other available modules will still be loaded when needed.
only if they are *needed* and *available*. If for example you want to use Reticulum
on a system that cannot support `pyserial`, it is perfectly possible to do so using
the rnspure package, but Reticulum will not be able to use serial-based interfaces.
All other available modules will still be loaded when needed.
+121 -14
View File
@@ -797,10 +797,27 @@ $ rngit release rns://remote_node/public/myrepo fetch "1.2.0:source_*.tgz"
If your pattern contains no wildcard characters, it must match an artifact name exactly, which is useful for fetching single, specific artifacts. When a pattern matches multiple artifacts, all matched files are fetched and verified. If no artifacts match the pattern, the fetch aborts with an error indicating no matches were found. If your pattern contains no wildcard characters, it must match an artifact name exactly, which is useful for fetching single, specific artifacts. When a pattern matches multiple artifacts, all matched files are fetched and verified. If no artifacts match the pattern, the fetch aborts with an error indicating no matches were found.
**Offline Verification** ### Offline Verification
Because the release manifest contains embedded signatures, you can verify the integrity of release artifacts offline, without connecting to the repository node. The `rnid` and `rngit` utilities can validate artifact signatures against `.rsg` and manifest files. Because the release manifest contains embedded signatures, you can verify the integrity of release artifacts offline, without connecting to the repository node. The `rnid` and `rngit` utilities can validate artifact signatures against `.rsg` and manifest files.
**Using a release manifest:**
Ensure the release manifest is located in the same directory as the release artifacts, then run:
```text
# Verify all artifacts in the manifest
$ rngit release myapp-1.2.0.rsm verify
# Or, verify only specific artifacts
$ rngit release myapp-1.2.0.rsm verify "latest:*.whl"
```
This will load the manifest, and verify all files currently on-disk, but will not attempt to fetch the latest release manifest from the origin, or update local files to match it.
#### NOTE
The `verify` operation is functionally equivalent to using the `fetch` operation with the `--offline` flag, and they can be used interchangably.
**For individual files:** **For individual files:**
Ensure the `.rsg` signature is located in the same directory as the release artifact, then run: Ensure the `.rsg` signature is located in the same directory as the release artifact, then run:
@@ -811,23 +828,13 @@ $ rnid -V myapp-1.2.0.tar.gz
This validates that the artifact file matches the signature created during the release process. Combined with the manifest’s own signature, this provides end-to-end verification from the original release creation to the final installation. This validates that the artifact file matches the signature created during the release process. Combined with the manifest’s own signature, this provides end-to-end verification from the original release creation to the final installation.
**For a complete release:**
Ensure the release manifest is located in the same directory as the release artifacts, then run:
```text
$ rngit release myapp-1.2.0.rsm fetch --offline
```
This will load the manifest, and verify all files currently on-disk, but will not attempt to fetch the latest release manifest from the origin, or update local files to match it.
### Creating Signed Releases ### Creating Signed Releases
Reticulum and the `rngit` system makes it easy to create signed releases that your users can verify and update securely. When you create a release using `rngit`, the program automatically: Reticulum and the `rngit` system makes it easy to create signed releases that your users can verify and update securely. When you create a release using `rngit`, the program automatically:
1. Generates an Ed25519 signature for each artifact file using your identity’s signing key 1. Generates an Ed25519 signature for each artifact file using your identity’s signing key
2. Creates `.rsg` signature files alongside each artifact in your distribution directory 2. Creates `.rsg` signature files alongside each artifact in your distribution directory
3. Constructs a signed release manifest (`manifest.rsm`) containing metadata, an artifact list, and embedded signatures 3. Constructs a signed `manifest.rsm` release manifest containing metadata, an artifact list, and embedded signatures
4. Transmits both artifacts, signatures and manifest to the remote node specified as release origin 4. Transmits both artifacts, signatures and manifest to the remote node specified as release origin
As an example, to create and publish a release from all files in the folder named `dist`, simply run: As an example, to create and publish a release from all files in the folder named `dist`, simply run:
@@ -1243,7 +1250,7 @@ Each document is a numbered directory containing:
**Nomad Network Interface** **Nomad Network Interface**
When the Nomad Network page node is enabled, work documents are viewable through the web interface. The work page lists all documents with their status, and clicking a document shows its full content and updates. When the Nomad Network page node is enabled, work documents are viewable through the nomadnet interface. The work page lists all documents with their status, and clicking a document shows its full content and updates.
### Cryptographic Attribution ### Cryptographic Attribution
@@ -1297,4 +1304,104 @@ options:
-v, --verbose -v, --verbose
-q, --quiet -q, --quiet
--version show program's version number and exit --version show program's version number and exit
``` ```
## Commit Signing
The `rngit` system includes `rngcs`, a Git commit signing and validation shim that enables commit signing and validation using Reticulum identities. By hooking into Git’s SSH-based signing format, commits can be signed and verified using Reticulum identity keys directly.
Unlike traditional GPG and SSH-based commit signing, which relies on centralized keyservers, cumbersome co-signing procedures or manual per-signer setup, Reticulum commit signing uses self-contained RSG signatures, that can be deterministically resolved to Reticulum identity hashes.
This enables offline verification with no external infrastructure. The signature itself contains everything needed to cryptographically verify the signer’s Reticulum identity and that the commit was signed correctly by the claimed identity.
### Prerequisites
Before you can sign commits, you need a Reticulum identity with a private key. If you don’t already have one, you can generate it using `rnid`:
```text
$ rnid -g ~/.rngit/client_identity
New identity <1a54d64db7e8beca6f2c6cd17b0cb479> written to /home/user/.rngit/client_identity
```
The identity file must contain the private key to be usable for signing. The corresponding Reticulum identity hash will be used as the commit author identity.
### Configuration
Git must be configured to use SSH-format signatures with the `rngcs` signing shim, which is included in RNS. You can configure this either globally or per-repository.
**Global Configuration**
Enabling Reticulum commit signing for all repositories is as simple as:
```text
$ git config --global gpg.format ssh
$ git config --global gpg.ssh.program rngcs
$ git config --global gpg.ssh.allowedsignersfile none
$ git config --global user.signingKey ~/.rngit/client_identity
```
With this configuration, all commits you sign with `git commit -S` will use your Reticulum identity.
#### NOTE
The `gpg.ssh.allowedsignersfile` configuration key **must** be *set* for `git` to allow invoking the signing and verification shim. It is not actually used by `rngcs`, and can be set to an arbitrary value. All validation operations happen exclusively based on the information in the embedded RSG data.
**Per-Repository Configuration**
To enable signing only for a specific repository:
```text
$ cd /path/to/repository
$ git config --local gpg.format ssh
$ git config --local gpg.ssh.program rngcs
$ git config --local gpg.ssh.allowedsignersfile none
$ git config --local user.signingKey ~/.rngit/client_identity
```
This is useful when you want to use different identities for different projects, or when only specific repositories require signed commits.
### Author Identity Binding
For the signature to be valid, the Git author email **must** match the Reticulum identity hash of the signing key. You can configure this using a command like the following:
```text
$ git config --global user.email "1a54d64db7e8beca6f2c6cd17b0cb479"
```
When `rngcs` verifies a commit, it extracts both the Git author field of the signed commit message and the signer identity from the RSG signature, ensuring they match. This binding is necessary to prevent identity spoofing. If someone crafts a commit with your identity hash in the author field but signs with a different key, verification will fail.
### Signing Commits
Once configured, sign commits using the standard Git `-S` flag:
```text
$ git commit -S -m "Refactored module"
[master 8f7e6d5] Refactored module
```
This will create a self-contained RSG-formatted signature, encode the RSG payload using base64, and wrap it in an ASCII-armored SSH-formatted signature block. The signature is then stored in the commit object’s signature header and includes:
- The SHA256 hash of the commit content
- The signer’s Reticulum identity hash
- The signer’s public key
- The actual signature of the complete envelope
### Validating Commit Signatures
Commits are automatically validated when using `git log --show-signature` or `git show --show-signature`. The `rngcs` shim handles all verification operations. If any step fails, verification fails and Git displays an error.
To view signature information for commits, use Git’s standard `--show-signature` option:
```text
$ git log --show-signature
commit 8f7e6d5c8f7e6d5c8f7e6d5c8f7e6d5c8f7e6d5
Good "git" signature for commit, signed with Reticulum Identity key <1a54d64db7e8beca6f2c6cd17b0cb479>
Author: Developer <1a54d64db7e8beca6f2c6cd17b0cb479>
Date: Mon Jan 15 09:30:00 2026 +0100
Refactored module
```
The output shows whether the commit signature is valid, and whether the author field matches the signing identity.
+8
View File
@@ -161,6 +161,7 @@ to participate in the development of Reticulum itself.
* [Backbone Interface](interfaces.md#backbone-interface) * [Backbone Interface](interfaces.md#backbone-interface)
* [Listeners](interfaces.md#listeners) * [Listeners](interfaces.md#listeners)
* [Connecting Remotes](interfaces.md#connecting-remotes) * [Connecting Remotes](interfaces.md#connecting-remotes)
* [Automated Blocking](interfaces.md#automated-blocking)
* [TCP Server Interface](interfaces.md#tcp-server-interface) * [TCP Server Interface](interfaces.md#tcp-server-interface)
* [TCP Client Interface](interfaces.md#tcp-client-interface) * [TCP Client Interface](interfaces.md#tcp-client-interface)
* [UDP Interface](interfaces.md#udp-interface) * [UDP Interface](interfaces.md#udp-interface)
@@ -234,6 +235,7 @@ to participate in the development of Reticulum itself.
* [Configuration Example](git.md#configuration-example) * [Configuration Example](git.md#configuration-example)
* [Verified Releases](git.md#verified-releases) * [Verified Releases](git.md#verified-releases)
* [Obtaining Verified Releases](git.md#obtaining-verified-releases) * [Obtaining Verified Releases](git.md#obtaining-verified-releases)
* [Offline Verification](git.md#offline-verification)
* [Creating Signed Releases](git.md#creating-signed-releases) * [Creating Signed Releases](git.md#creating-signed-releases)
* [Release Management](git.md#release-management) * [Release Management](git.md#release-management)
* [The Release Workflow](git.md#the-release-workflow) * [The Release Workflow](git.md#the-release-workflow)
@@ -245,6 +247,12 @@ to participate in the development of Reticulum itself.
* [State Management](git.md#state-management) * [State Management](git.md#state-management)
* [Managing Work Document Permissions](git.md#managing-work-document-permissions) * [Managing Work Document Permissions](git.md#managing-work-document-permissions)
* [Cryptographic Attribution](git.md#cryptographic-attribution) * [Cryptographic Attribution](git.md#cryptographic-attribution)
* [Commit Signing](git.md#commit-signing)
* [Prerequisites](git.md#prerequisites)
* [Configuration](git.md#id1)
* [Author Identity Binding](git.md#author-identity-binding)
* [Signing Commits](git.md#signing-commits)
* [Validating Commit Signatures](git.md#validating-commit-signatures)
* [Support Reticulum](support.md) * [Support Reticulum](support.md)
* [Donations](support.md#donations) * [Donations](support.md#donations)
* [Provide Feedback](support.md#provide-feedback) * [Provide Feedback](support.md#provide-feedback)
+111 -37
View File
@@ -212,6 +212,51 @@ specify the target Yggdrasil IPv6 address and port, like so:
target_port = 4343 target_port = 4343
``` ```
### Automated Blocking
Listener instances of `BackboneInterface` will automatically block fast-flapping clients,
that repeatedly connect for a short amount of time, and then disconnect. Such behavior usually
occurs from clients trying to spam the network with announces or path requests, by connecting, dumping
a massive amount of requests, and then disconnecting in an attempt to bypass rate limits.
While such bypass attempts only have very limited effect on the amount of spam actually dumped (ingress limits
trigger immediately once a client exceeds rate limits), the behavior is often seen anyways, and
causes log noise and needless interface rotation. The fast-flapping block ensures such clients
are never allocated an interface on the transport instance.
Another common cause can simply be clients using implementations that are broken, or automated
scanning tools attempting to connect to the instance.
```ini
[[Backbone Listener]]
type = BackboneInterface
enabled = yes
listen_on = 0.0.0.0
port = 4242
# Whether to enable blocking
block_fast_flapping = yes
# How long an IP address stays
# blocked, in minutes. Set to
# 12 hours by default.
fast_flapping_block_time = 720
# The minimum time, in seconds,
# an interface must stay connected
# to be considered not fast-flapping.
fast_flapping_threshold = 20
# Amount of fast flaps a remote
# IP can perform before having
# blocking triggered.
fast_flapping_grace = 5
```
The configuration options listed in the example above are the *default values*, and you do
not need to add them for automated blocking to work, but you can use them to change the
behavior from the defaults, if necessary.
## TCP Server Interface ## TCP Server Interface
The TCP Server interface is suitable for allowing other peers to connect over The TCP Server interface is suitable for allowing other peers to connect over
@@ -901,10 +946,10 @@ When `discoverable` is enabled, a variety of additional options become available
`reachable_on` `reachable_on`
: Specifies the address that remote peers should use to connect to this interface. : Specifies the address that remote peers should use to connect to this interface.
<br/>
* For TCP and Backbone interfaces, this is typically the public IP address or hostname. Do not include the port, this is fetched automatically from the interface. * For TCP and Backbone interfaces, this is typically the public IP address or hostname. Do not include the port, this is fetched automatically from the interface.
* For I2P interfaces, this is usually the I2P `b32` address. This value is fetched automatically from the `I2PInterface` once it is up and connected to the I2P network, so you should not set this manually, unless you absolutely know what you’re doing. * For I2P interfaces, this is usually the I2P `b32` address. This value is fetched automatically from the `I2PInterface` once it is up and connected to the I2P network, so you should not set this manually, unless you absolutely know what you’re doing.
<br/>
**Dynamic Resolution:** This option also accepts a path to an external executable script or binary. If a path is provided, Reticulum will execute the script and use its `stdout` as the reachability address. This is useful for devices behind dynamic DNS, NATs, or complex cloud environments where the external IP is not known locally. The script must simply print the address to stdout and exit. **Dynamic Resolution:** This option also accepts a path to an external executable script or binary. If a path is provided, Reticulum will execute the script and use its `stdout` as the reachability address. This is useful for devices behind dynamic DNS, NATs, or complex cloud environments where the external IP is not known locally. The script must simply print the address to stdout and exit.
#### NOTE #### NOTE
@@ -939,7 +984,13 @@ If you enable `discovery_encrypt` but do not configure a valid `network_identity
**Physical Location** **Physical Location**
`latitude`, `longitude`, `height` `latitude`, `longitude`, `height`
: Optional physical coordinates for the interface. These are useful for mapping discovered interfaces geographically or for clients to automatically select the nearest access point. Coordinates should be in decimal degrees, height in meters. : Optional physical coordinates for the interface. These are useful for mapping discovered interfaces geographically or for clients to automatically select the nearest access point. Coordinates should be in decimal degrees, height in meters above mean sea level.
`location_cmd`
: Optional path to executable or script that returns the physical coordinates for the interface. This can be used instead of manually setting `latitude`, `longitude` and `height`. Reticulum expects the script to output the location data to `stdout` on a single line, separated by commas, with values as floating point numbers in the format `LAT, LON, HEIGHT`. Coordinates should be in decimal degrees, height in meters above mean sea level.
#### NOTE
The height value for interface discovery is specified in *height above mean sea level*! This is the geoid-corrected height value, and is distinct from GPS altitude. If you manually specify height, it will typically be set to what you find on a topographical map. If you are using a script to output the location data, make sure that you are using the geoid-corrected altitude, not height above the GPS ellipsoid. Most GPS systems will make both figures available.
**Radio Parameters** **Radio Parameters**
@@ -1064,10 +1115,10 @@ These can be used to control various aspects of interface behaviour.
> to bring up the interface. Defaults to `False`. For any > to bring up the interface. Defaults to `False`. For any
> interface to be brought up, the `enabled` option > interface to be brought up, the `enabled` option
> must be set to `True` or `Yes`. > must be set to `True` or `Yes`.
> <br/> >
> * The `mode` option allows selecting the high-level behaviour > * The `mode` option allows selecting the high-level behaviour
> of the interface from a number of options. > of the interface from a number of options.
> <br/> >
> > - The default value is `full`. In this mode, all discovery, > > - The default value is `full`. In this mode, all discovery,
> > meshing and transport functionality is available. > > meshing and transport functionality is available.
> > - In the `access_point` (or shorthand `ap`) mode, the > > - In the `access_point` (or shorthand `ap`) mode, the
@@ -1083,15 +1134,15 @@ These can be used to control various aspects of interface behaviour.
> * The `outgoing` option sets whether an interface is allowed > * The `outgoing` option sets whether an interface is allowed
> to transmit. Defaults to `True`. If set to `False` or `No` > to transmit. Defaults to `True`. If set to `False` or `No`
> the interface will only receive data, and never transmit. > the interface will only receive data, and never transmit.
> <br/> >
> * The `network_name` option sets the virtual network name for > * The `network_name` option sets the virtual network name for
> the interface. This allows multiple separate network segments > the interface. This allows multiple separate network segments
> to exist on the same physical channel or medium. > to exist on the same physical channel or medium.
> <br/> >
> * The `passphrase` option sets an authentication passphrase on > * The `passphrase` option sets an authentication passphrase on
> the interface. This option can be used in conjunction with the > the interface. This option can be used in conjunction with the
> `network_name` option, or be used alone. > `network_name` option, or be used alone.
> <br/> >
> * The `ifac_size` option allows customising the length of the > * The `ifac_size` option allows customising the length of the
> Interface Authentication Codes carried by each packet on named > Interface Authentication Codes carried by each packet on named
> and/or authenticated network segments. It is set by default to > and/or authenticated network segments. It is set by default to
@@ -1099,13 +1150,13 @@ These can be used to control various aspects of interface behaviour.
> to a custom size between 8 and 512 bits by using this option. > to a custom size between 8 and 512 bits by using this option.
> In normal usage, this option should not be changed from the > In normal usage, this option should not be changed from the
> default. > default.
> <br/> >
> * The `announce_cap` option lets you configure the maximum > * The `announce_cap` option lets you configure the maximum
> bandwidth to allocate, at any given time, to propagating > bandwidth to allocate, at any given time, to propagating
> announces and other network upkeep traffic. It is configured at > announces and other network upkeep traffic. It is configured at
> 2% by default, and should normally not need to be changed. Can > 2% by default, and should normally not need to be changed. Can
> be set to any value between `1` and `100`. > be set to any value between `1` and `100`.
> <br/> >
> > *If an interface exceeds its announce cap, it will queue announces > > *If an interface exceeds its announce cap, it will queue announces
> > for later transmission. Reticulum will always prioritise propagating > > for later transmission. Reticulum will always prioritise propagating
> > announces from nearby nodes first. This ensures that the local > > announces from nearby nodes first. This ensures that the local
@@ -1126,7 +1177,7 @@ These can be used to control various aspects of interface behaviour.
> any. In most cases, the automatically found rate should be > any. In most cases, the automatically found rate should be
> sufficient, but it can be configured by using the `bitrate` > sufficient, but it can be configured by using the `bitrate`
> option, to set the interface speed in *bits per second*. > option, to set the interface speed in *bits per second*.
> <br/> >
> * The `bootstrap_only` option designates an interface as a temporary > * The `bootstrap_only` option designates an interface as a temporary
> bridge for initial connectivity. If this option is enabled, the > bridge for initial connectivity. If this option is enabled, the
> interface will be monitored and automatically detached once the > interface will be monitored and automatically detached once the
@@ -1135,7 +1186,21 @@ These can be used to control various aspects of interface behaviour.
> for using a slow or expensive connection (such as a single LoRa > for using a slow or expensive connection (such as a single LoRa
> link or a remote TCP tunnel) solely to discover better local > link or a remote TCP tunnel) solely to discover better local
> infrastructure, which then supersedes the bootstrap interface. > infrastructure, which then supersedes the bootstrap interface.
> <br/> >
> * The `recursive_prs` option allows you to enable recursive path
> discovery on an interface regardless of its configured interface
> mode. When this option is enabled, Reticulum will attempt to
> recursively discover paths for path requests received on this
> interface.
>
> * The `announces_from_internal` option controls whether any
> announces *received on* an `internal` mode interface will
> propagate *out* on the interface this option is set on. Note
> that this controls *announce propagation*; even if announces
> do not propagate out when received, paths to destinations on
> `internal` mode interfaces may still be resolvable by means
> of path requests.
>
## Interface Modes ## Interface Modes
@@ -1152,7 +1217,7 @@ the default mode.
> * The default mode is `full`. In this mode, all discovery, > * The default mode is `full`. In this mode, all discovery,
> meshing and transport functionality is activated. > meshing and transport functionality is activated.
> <br/> >
> * The `gateway` mode (or shorthand `gw`) also has all > * The `gateway` mode (or shorthand `gw`) also has all
> discovery, meshing and transport functionality available, > discovery, meshing and transport functionality available,
> but will additionally try to discover unknown paths on > but will additionally try to discover unknown paths on
@@ -1162,18 +1227,18 @@ the default mode.
> will try to discover this path via all other active interfaces, > will try to discover this path via all other active interfaces,
> and forward the discovered path to the requestor if one is > and forward the discovered path to the requestor if one is
> found. > found.
> <br/> >
> If you want to allow other nodes to widely resolve paths or connect > If you want to allow other nodes to widely resolve paths or connect
> to a network via an interface, it might be useful to put it in this > to a network via an interface, it might be useful to put it in this
> mode. By creating a chain of `gateway` interfaces, other > mode. By creating a chain of `gateway` interfaces, other
> nodes will be able to immediately discover paths to any > nodes will be able to immediately discover paths to any
> destination along the chain. > destination along the chain.
> <br/> >
> *Please note!* It is the interface *facing the clients* that > *Please note!* It is the interface *facing the clients* that
> must be put into `gateway` mode for this to work, not > must be put into `gateway` mode for this to work, not
> the interface facing the wider network (for this, the `boundary` > the interface facing the wider network (for this, the `boundary`
> mode can be useful, though). > mode can be useful, though).
> <br/> >
> * In the `access_point` (or shorthand `ap`) mode, the > * In the `access_point` (or shorthand `ap`) mode, the
> interface will operate as a network access point. In this > interface will operate as a network access point. In this
> mode, announces will not be automatically broadcasted on > mode, announces will not be automatically broadcasted on
@@ -1181,13 +1246,13 @@ the default mode.
> will have a much shorter expiry time. In addition, path > will have a much shorter expiry time. In addition, path
> requests from clients on the access point interface will > requests from clients on the access point interface will
> be handled in the same way as the `gateway` interface. > be handled in the same way as the `gateway` interface.
> <br/> >
> This mode is useful for creating interfaces that remain > This mode is useful for creating interfaces that remain
> quiet, until someone actually starts using them. An example > quiet, until someone actually starts using them. An example
> of this could be a radio interface serving a wide area, > of this could be a radio interface serving a wide area,
> where users are expected to connect momentarily, use the > where users are expected to connect momentarily, use the
> network, and then disappear again. > network, and then disappear again.
> <br/> >
> * The `roaming` mode should be used on interfaces that are > * The `roaming` mode should be used on interfaces that are
> roaming (physically mobile), seen from the perspective of > roaming (physically mobile), seen from the perspective of
> other nodes in the network. As an example, if a vehicle is > other nodes in the network. As an example, if a vehicle is
@@ -1202,7 +1267,7 @@ the default mode.
> side of the network will also be able to reach devices > side of the network will also be able to reach devices
> internal to the vehicle, when it is in range. Paths via > internal to the vehicle, when it is in range. Paths via
> `roaming` interfaces also expire faster. > `roaming` interfaces also expire faster.
> <br/> >
> * The purpose of the `boundary` mode is to specify interfaces > * The purpose of the `boundary` mode is to specify interfaces
> that establish connectivity with network segments that are > that establish connectivity with network segments that are
> significantly different than the one this node exists on. > significantly different than the one this node exists on.
@@ -1210,7 +1275,16 @@ the default mode.
> network, but also has a high-speed connection to a > network, but also has a high-speed connection to a
> public Transport Node available on the Internet, the interface > public Transport Node available on the Internet, the interface
> connecting over the Internet should be set to `boundary` mode. > connecting over the Internet should be set to `boundary` mode.
> <br/> >
> * The `internal` mode designates interfaces that belong to a
> network different from any marked as `boundary`. Announces from
> a `boundary` interface will not propagate to interfaces set as
> `internal`, but announces *will* propagate from `internal` *to*
> `boundary`. Devices on the `internal` side of the network will
> still be able to resolve paths to destinations across the boundary
> when needed, since recursive path requests are enabled for `internal`
> mode interfaces by default.
>
For a table describing the impact of all modes on announce propagation, For a table describing the impact of all modes on announce propagation,
please see the [Announce Propagation Rules](understanding.md#understanding-announcepropagation) section. please see the [Announce Propagation Rules](understanding.md#understanding-announcepropagation) section.
@@ -1233,16 +1307,16 @@ re-broadcasted to other interfaces*.
> announces *received* on this interface will only be re-transmitted and > announces *received* on this interface will only be re-transmitted and
> propagated to other interfaces once every hour, no matter how often they > propagated to other interfaces once every hour, no matter how often they
> are received. > are received.
> <br/> >
> * The optional `announce_rate_grace` defines the number of times a destination > * The optional `announce_rate_grace` defines the number of times a destination
> can violate the announce rate before the target rate is enforced. > can violate the announce rate before the target rate is enforced.
> <br/> >
> * The optional `announce_rate_penalty` configures an extra amount of > * The optional `announce_rate_penalty` configures an extra amount of
> time that is added to the normal rate target. As an example, if a penalty > time that is added to the normal rate target. As an example, if a penalty
> of `7200` seconds is defined, once the rate target is enforced, the > of `7200` seconds is defined, once the rate target is enforced, the
> destination in question will only have its announces propagated every > destination in question will only have its announces propagated every
> 3 hours, until it lowers its actual announce rate to within the target. > 3 hours, until it lowers its actual announce rate to within the target.
> <br/> >
You can also configure default announce rate parameters for all interfaces that You can also configure default announce rate parameters for all interfaces that
do not have these parameters set explicitly by setting the `default_ar_target` do not have these parameters set explicitly by setting the `default_ar_target`
@@ -1309,41 +1383,41 @@ but all the parameters are exposed for configuration if needed.
> * The `ingress_control` option tells Reticulum whether or not > * The `ingress_control` option tells Reticulum whether or not
> to enable ingress control on the interface. Defaults to `True`. > to enable ingress control on the interface. Defaults to `True`.
> <br/> >
> * The `ic_new_time` option configures how long (in seconds) an > * The `ic_new_time` option configures how long (in seconds) an
> interface is considered newly spawned. Defaults to `2*60*60` seconds. This > interface is considered newly spawned. Defaults to `2*60*60` seconds. This
> option is useful on publicly accessible interfaces that spawn new > option is useful on publicly accessible interfaces that spawn new
> sub-interfaces when a new client connects. > sub-interfaces when a new client connects.
> <br/> >
> * The `ic_burst_freq_new` option sets the maximum announce ingress > * The `ic_burst_freq_new` option sets the maximum announce ingress
> frequency for newly spawned interfaces. Defaults to `3.5` > frequency for newly spawned interfaces. Defaults to `3.5`
> announces per second. > announces per second.
> <br/> >
> * The `ic_burst_freq` option sets the maximum announce ingress > * The `ic_burst_freq` option sets the maximum announce ingress
> frequency for other interfaces. Defaults to `12` announces > frequency for other interfaces. Defaults to `12` announces
> per second. > per second.
> <br/> >
> > *If an interface exceeds its burst frequency, incoming announces > > *If an interface exceeds its burst frequency, incoming announces
> > for unknown destinations will be temporarily held in a queue, and > > for unknown destinations will be temporarily held in a queue, and
> > not processed until later.* > > not processed until later.*
> * The `ic_max_held_announces` option sets the maximum amount of > * The `ic_max_held_announces` option sets the maximum amount of
> unique announces that will be held in the queue. Any additional > unique announces that will be held in the queue. Any additional
> unique announces will be dropped. Defaults to `256` announces. > unique announces will be dropped. Defaults to `256` announces.
> <br/> >
> * The `ic_burst_hold` option sets how much time (in seconds) must > * The `ic_burst_hold` option sets how much time (in seconds) must
> pass after the burst frequency drops below its threshold, for the > pass after the burst frequency drops below its threshold, for the
> announce burst to be considered cleared. Defaults to `60` > announce burst to be considered cleared. Defaults to `60`
> seconds. > seconds.
> <br/> >
> * The `ic_burst_penalty` option sets how much time (in seconds) must > * The `ic_burst_penalty` option sets how much time (in seconds) must
> pass after the burst is considered cleared, before held announces can > pass after the burst is considered cleared, before held announces can
> start being released from the queue. Defaults to `5*60` > start being released from the queue. Defaults to `5*60`
> seconds. > seconds.
> <br/> >
> * The `ic_held_release_interval` option sets how much time (in seconds) > * The `ic_held_release_interval` option sets how much time (in seconds)
> must pass between releasing each held announce from the queue. Defaults > must pass between releasing each held announce from the queue. Defaults
> to `30` seconds. > to `30` seconds.
> <br/> >
All of the above settings can be configured both as instance-wide defaults All of the above settings can be configured both as instance-wide defaults
under the `[reticulum]` section of the configuration file, or on a per- under the `[reticulum]` section of the configuration file, or on a per-
@@ -1373,28 +1447,28 @@ but all the parameters are exposed for configuration if needed.
> * The `ingress_control` option tells Reticulum whether or not > * The `ingress_control` option tells Reticulum whether or not
> to enable ingress control on the interface. Defaults to `True`. > to enable ingress control on the interface. Defaults to `True`.
> <br/> >
> * The `ic_new_time` option configures how long (in seconds) an > * The `ic_new_time` option configures how long (in seconds) an
> interface is considered newly spawned. Defaults to `2*60*60` seconds. This > interface is considered newly spawned. Defaults to `2*60*60` seconds. This
> option is useful on publicly accessible interfaces that spawn new > option is useful on publicly accessible interfaces that spawn new
> sub-interfaces when a new client connects. > sub-interfaces when a new client connects.
> <br/> >
> * The `ic_pr_burst_freq_new` option sets the maximum path request > * The `ic_pr_burst_freq_new` option sets the maximum path request
> ingress frequency for newly spawned interfaces. Defaults to `3` > ingress frequency for newly spawned interfaces. Defaults to `3`
> path requests per second. > path requests per second.
> <br/> >
> * The `ic_pr_burst_freq` option sets the maximum path request > * The `ic_pr_burst_freq` option sets the maximum path request
> ingress frequency for other interfaces. Defaults to `8` path requests > ingress frequency for other interfaces. Defaults to `8` path requests
> per second. > per second.
> <br/> >
> > *If an interface exceeds its burst frequency, incoming path requests > > *If an interface exceeds its burst frequency, incoming path requests
> > from that system will not traverse the network further.* > > from that system will not traverse the network further.*
> * The `egress_control` option enables hard-limiting path request egress > * The `egress_control` option enables hard-limiting path request egress
> control per-interface. Defaults to `False` > control per-interface. Defaults to `False`
> <br/> >
> * The `ec_pr_freq` option sets the hard limit for outbound path requests > * The `ec_pr_freq` option sets the hard limit for outbound path requests
> per second on a given interface. > per second on a given interface.
> <br/> >
All of the above settings can be configured both as instance-wide defaults All of the above settings can be configured both as instance-wide defaults
under the `[reticulum]` section of the configuration file, or on a per- under the `[reticulum]` section of the configuration file, or on a per-
+26 -9
View File
@@ -46,11 +46,11 @@ with Reticulum:
> (called *destinations* in Reticulum terminology) as it needs, which become > (called *destinations* in Reticulum terminology) as it needs, which become
> globally reachable to the rest of the network. There is no central point of > globally reachable to the rest of the network. There is no central point of
> control over the address space. > control over the address space.
> <br/> >
> * Reticulum was designed to handle both very small, and very large networks. > * Reticulum was designed to handle both very small, and very large networks.
> While the address space can support billions of endpoints, Reticulum is > While the address space can support billions of endpoints, Reticulum is
> also very useful when just a few devices needs to communicate. > also very useful when just a few devices needs to communicate.
> <br/> >
> * Low-bandwidth networks, like LoRa and packet radio, can interoperate and > * Low-bandwidth networks, like LoRa and packet radio, can interoperate and
> interconnect with much larger and higher bandwidth networks without issue. > interconnect with much larger and higher bandwidth networks without issue.
> Reticulum automatically manages the flow of information to and from various > Reticulum automatically manages the flow of information to and from various
@@ -60,27 +60,27 @@ with Reticulum:
> it will try as best as possible to comply with this, while still respecting > it will try as best as possible to comply with this, while still respecting
> bandwidth limits, but you *will* waste a lot of precious bandwidth and airtime, > bandwidth limits, but you *will* waste a lot of precious bandwidth and airtime,
> and your LoRa network will not work very well. > and your LoRa network will not work very well.
> <br/> >
> * Reticulum provides sender/initiator anonymity by default. There is no way > * Reticulum provides sender/initiator anonymity by default. There is no way
> to filter traffic or discriminate it based on the source of the traffic. > to filter traffic or discriminate it based on the source of the traffic.
> <br/> >
> * All traffic is encrypted using ephemeral keys generated by an Elliptic Curve > * All traffic is encrypted using ephemeral keys generated by an Elliptic Curve
> Diffie-Hellman key exchange on Curve25519. There is no way to inspect traffic > Diffie-Hellman key exchange on Curve25519. There is no way to inspect traffic
> contents, and no way to prioritise or throttle certain kinds of traffic. > contents, and no way to prioritise or throttle certain kinds of traffic.
> All transport and routing layers are thus completely agnostic to traffic type, > All transport and routing layers are thus completely agnostic to traffic type,
> and will pass all traffic equally. > and will pass all traffic equally.
> <br/> >
> * Reticulum can function both with and without infrastructure. When *transport > * Reticulum can function both with and without infrastructure. When *transport
> nodes* are available, they can route traffic over multiple hops for other > nodes* are available, they can route traffic over multiple hops for other
> nodes, and will function as a distributed cryptographic keystore. When there > nodes, and will function as a distributed cryptographic keystore. When there
> is no transport nodes available, all nodes that are within communication range > is no transport nodes available, all nodes that are within communication range
> can still communicate. > can still communicate.
> <br/> >
> * Every node can become a transport node, simply by enabling it in it’s > * Every node can become a transport node, simply by enabling it in it’s
> configuration, but there is no need for every node on the network to be a > configuration, but there is no need for every node on the network to be a
> transport node. Letting every node be a transport node will in most cases > transport node. Letting every node be a transport node will in most cases
> degrade the performance and reliability of the network. > degrade the performance and reliability of the network.
> <br/> >
> > *In general terms, if a node is stationary, well-connected and kept running > > *In general terms, if a node is stationary, well-connected and kept running
> > most of the time, it is a good candidate to be a transport node. For optimal > > most of the time, it is a good candidate to be a transport node. For optimal
> > performance, a network should contain the amount of transport nodes that > > performance, a network should contain the amount of transport nodes that
@@ -92,14 +92,14 @@ with Reticulum:
> entirely new, and so far, mostly unexplored class of networked applications, > entirely new, and so far, mostly unexplored class of networked applications,
> where networks, and the information flow within them can form and dissolve > where networks, and the information flow within them can form and dissolve
> organically. > organically.
> <br/> >
> * You can just as easily create closed networks, since Reticulum allows you to > * You can just as easily create closed networks, since Reticulum allows you to
> add authentication to any interface. This means you can restrict access on > add authentication to any interface. This means you can restrict access on
> any interface type, even when using legacy devices, such as modems. You can > any interface type, even when using legacy devices, such as modems. You can
> also mix authenticated and open interfaces on the same system. See the > also mix authenticated and open interfaces on the same system. See the
> [Common Interface Options](interfaces.md#interfaces-options) section of the [Interfaces](interfaces.md#interfaces-main) > [Common Interface Options](interfaces.md#interfaces-options) section of the [Interfaces](interfaces.md#interfaces-main)
> chapter of this manual for information on how to set up interface authentication. > chapter of this manual for information on how to set up interface authentication.
> <br/> >
Reticulum allows you to mix very different kinds of networking mediums into a Reticulum allows you to mix very different kinds of networking mediums into a
unified mesh, or to keep everything within one medium. You could build a “virtual unified mesh, or to keep everything within one medium. You could build a “virtual
@@ -142,16 +142,19 @@ This has profound implications for network design:
* **No address allocation planning:** You never need to reserve address ranges, * **No address allocation planning:** You never need to reserve address ranges,
plan subnets, or coordinate with other network operators. Nodes simply generate plan subnets, or coordinate with other network operators. Nodes simply generate
destinations and announce them. destinations and announce them.
* **Global portability:** A destination is not tied to a physical location or * **Global portability:** A destination is not tied to a physical location or
network segment. A node can move its destinations across interfaces, mediums, network segment. A node can move its destinations across interfaces, mediums,
or even between entirely separate Reticulum networks simply by sending an or even between entirely separate Reticulum networks simply by sending an
announce on the new medium. announce on the new medium.
* **Implicit authentication:** Because destinations are bound to public keys, * **Implicit authentication:** Because destinations are bound to public keys,
communication to a destination is inherently cryptographically authenticated. communication to a destination is inherently cryptographically authenticated.
Only the holder of the corresponding private key can decrypt and respond to Only the holder of the corresponding private key can decrypt and respond to
traffic addressed to that destination. This also makes application-level traffic addressed to that destination. This also makes application-level
authentication *much* simpler, since it can directly use the foundational authentication *much* simpler, since it can directly use the foundational
identity verification built into the core networking layer. identity verification built into the core networking layer.
* **Identity abstraction:** A single Reticulum Identity can create multiple * **Identity abstraction:** A single Reticulum Identity can create multiple
destinations. This allows a single entity (a person, a device, a service) to destinations. This allows a single entity (a person, a device, a service) to
present multiple endpoints without needing multiple cryptographic keypairs. present multiple endpoints without needing multiple cryptographic keypairs.
@@ -191,9 +194,11 @@ The distinction is important. **Not** every node should be a Transport Node:
* **Resource consumption:** Transport nodes maintain path tables, process * **Resource consumption:** Transport nodes maintain path tables, process
announces, and forward traffic. This requires memory and CPU resources that announces, and forward traffic. This requires memory and CPU resources that
may be limited on low-powered devices. may be limited on low-powered devices.
* **Stability requirements:** Transport nodes contribute to network convergence. * **Stability requirements:** Transport nodes contribute to network convergence.
If Transport Nodes frequently go offline, path tables become stale and If Transport Nodes frequently go offline, path tables become stale and
convergence suffers. Stable, always-on nodes make better Transport Nodes. convergence suffers. Stable, always-on nodes make better Transport Nodes.
* **Bandwidth considerations:** Transport nodes process and rebroadcast network * **Bandwidth considerations:** Transport nodes process and rebroadcast network
maintenance traffic. On very low-bandwidth mediums, having too many Transport maintenance traffic. On very low-bandwidth mediums, having too many Transport
Nodes will consume capacity that should be used for actual data. Nodes will consume capacity that should be used for actual data.
@@ -228,15 +233,19 @@ of communication is secured cryptographically:
* **Traffic encryption:** All traffic to single destinations is encrypted using * **Traffic encryption:** All traffic to single destinations is encrypted using
ephemeral keys. ephemeral keys.
* **Source anonymity:** Reticulum packets do not include source addresses. * **Source anonymity:** Reticulum packets do not include source addresses.
An observer intercepting a packet cannot determine who sent it, only who it is An observer intercepting a packet cannot determine who sent it, only who it is
addressed to (unless IFAC is enabled, in which case nothing can be determined). addressed to (unless IFAC is enabled, in which case nothing can be determined).
This provides initiator anonymity by default. This provides initiator anonymity by default.
* **Path verification:** The announce mechanism includes cryptographic signatures that * **Path verification:** The announce mechanism includes cryptographic signatures that
prove the authenticity of destination announcements. prove the authenticity of destination announcements.
* **Unforgeable delivery confirmations:** When a destination proves receipt of a * **Unforgeable delivery confirmations:** When a destination proves receipt of a
packet, the proof is signed with the destination’s identity key. This prevents packet, the proof is signed with the destination’s identity key. This prevents
false acknowledgments and ensures reliable delivery verification. false acknowledgments and ensures reliable delivery verification.
* **Interface authentication:** When using Interface Access Codes (IFAC), packets * **Interface authentication:** When using Interface Access Codes (IFAC), packets
on authenticated interfaces carry signatures derived from a shared secret. Only on authenticated interfaces carry signatures derived from a shared secret. Only
nodes with the correct network name and passphrase can generate valid packets, allowing creation nodes with the correct network name and passphrase can generate valid packets, allowing creation
@@ -248,10 +257,12 @@ The trustless design has important consequences for network design:
join without pre-approval. Because traffic is encrypted and authenticated end- join without pre-approval. Because traffic is encrypted and authenticated end-
to-end, participants cannot interfere with each other’s private communication, to-end, participants cannot interfere with each other’s private communication,
even if they share the same transport infrastructure. even if they share the same transport infrastructure.
* **No traffic inspection or prioritization:** Because traffic contents and * **No traffic inspection or prioritization:** Because traffic contents and
sources are opaque to intermediate nodes, there is no mechanism for filtering, sources are opaque to intermediate nodes, there is no mechanism for filtering,
prioritizing, or throttling traffic based on its type or origin. All traffic prioritizing, or throttling traffic based on its type or origin. All traffic
is treated equally. From a neutrality perspective, this is a feature. is treated equally. From a neutrality perspective, this is a feature.
* **Adversarial resilience:** The network can operate even if some nodes are * **Adversarial resilience:** The network can operate even if some nodes are
malicious or controlled by adversaries. While a malicious Transport Node could malicious or controlled by adversaries. While a malicious Transport Node could
refuse to forward certain traffic or drop packets, it cannot decrypt, modify, refuse to forward certain traffic or drop packets, it cannot decrypt, modify,
@@ -280,12 +291,15 @@ to seamlessly mix mediums with vastly different characteristics:
interconnect with gigabit Ethernet backbones. Reticulum automatically manages interconnect with gigabit Ethernet backbones. Reticulum automatically manages
the flow of information, prioritizing local traffic on slow segments while the flow of information, prioritizing local traffic on slow segments while
allowing global convergence. allowing global convergence.
* **Latency:** Satellite links with multi-second latency can coexist with local * **Latency:** Satellite links with multi-second latency can coexist with local
links measured in milliseconds. The transport system handles timing, asynchronous links measured in milliseconds. The transport system handles timing, asynchronous
delivery and retransmissions transparently. delivery and retransmissions transparently.
* **Topology:** Point-to-point microwave links, broadcast radio networks, * **Topology:** Point-to-point microwave links, broadcast radio networks,
switched Ethernet fabrics, and virtual tunnels over the Internet can all be switched Ethernet fabrics, and virtual tunnels over the Internet can all be
part of the same Reticulum network. part of the same Reticulum network.
* **Reliability:** Intermittent connections that come and go (such as mobile * **Reliability:** Intermittent connections that come and go (such as mobile
devices or opportunistic radio contacts) can participate alongside always-on devices or opportunistic radio contacts) can participate alongside always-on
infrastructure. Reticulum gracefully handles link loss and reconnection. infrastructure. Reticulum gracefully handles link loss and reconnection.
@@ -295,12 +309,15 @@ This heterogeneity is achieved through several design elements:
* **Expandable, medium-agnostic interface system:** Reticulum communicates with the physical * **Expandable, medium-agnostic interface system:** Reticulum communicates with the physical
world through interface modules. Adding support for a new medium is a matter world through interface modules. Adding support for a new medium is a matter
of implementing an interface class. The protocol itself remains unchanged. of implementing an interface class. The protocol itself remains unchanged.
* **Interface modes:** Different modes (`full`, `gateway`, `access_point`, * **Interface modes:** Different modes (`full`, `gateway`, `access_point`,
`roaming`, `boundary`) allow you to configure how interfaces interact with `roaming`, `boundary`) allow you to configure how interfaces interact with
the wider network based on their characteristics and role. the wider network based on their characteristics and role.
* **Announce propagation rules:** Announces are forwarded between interfaces * **Announce propagation rules:** Announces are forwarded between interfaces
according to rules that account for bandwidth limitations and interface modes. according to rules that account for bandwidth limitations and interface modes.
Slow segments are not overwhelmed by traffic from fast segments. Slow segments are not overwhelmed by traffic from fast segments.
* **Local traffic prioritization:** When bandwidth is constrained, Reticulum * **Local traffic prioritization:** When bandwidth is constrained, Reticulum
prioritizes announces for nearby destinations. This ensures that local prioritizes announces for nearby destinations. This ensures that local
connectivity remains functional even when global convergence is incomplete. connectivity remains functional even when global convergence is incomplete.
+42
View File
@@ -198,6 +198,7 @@ search for an identity from a known *identity hash*, by setting the
* **Parameters:** * **Parameters:**
* **target_hash** – Destination or identity hash as *bytes*. * **target_hash** – Destination or identity hash as *bytes*.
* **from_identity_hash** – Whether to search based on identity hash instead of destination hash as *bool*. * **from_identity_hash** – Whether to search based on identity hash instead of destination hash as *bool*.
* **Returns:** * **Returns:**
An [RNS.Identity](#api-identity) instance that can be used to create an outgoing [RNS.Destination](#api-destination), or *None* if the destination is unknown. An [RNS.Identity](#api-identity) instance that can be used to create an outgoing [RNS.Destination](#api-destination), or *None* if the destination is unknown.
@@ -207,6 +208,7 @@ Recall last heard app_data for a destination hash.
* **Parameters:** * **Parameters:**
**destination_hash** – Destination hash as *bytes*. **destination_hash** – Destination hash as *bytes*.
* **Returns:** * **Returns:**
*Bytes* containing app_data, or *None* if the destination is unknown. *Bytes* containing app_data, or *None* if the destination is unknown.
@@ -216,6 +218,7 @@ Get a SHA-256 hash of passed data.
* **Parameters:** * **Parameters:**
**data** – Data to be hashed as *bytes*. **data** – Data to be hashed as *bytes*.
* **Returns:** * **Returns:**
SHA-256 hash as *bytes*. SHA-256 hash as *bytes*.
@@ -225,6 +228,7 @@ Get a truncated SHA-256 hash of passed data.
* **Parameters:** * **Parameters:**
**data** – Data to be hashed as *bytes*. **data** – Data to be hashed as *bytes*.
* **Returns:** * **Returns:**
Truncated SHA-256 hash as *bytes*. Truncated SHA-256 hash as *bytes*.
@@ -234,6 +238,7 @@ Get a random SHA-256 hash.
* **Parameters:** * **Parameters:**
**data** – Data to be hashed as *bytes*. **data** – Data to be hashed as *bytes*.
* **Returns:** * **Returns:**
Truncated SHA-256 hash of random data as *bytes*. Truncated SHA-256 hash of random data as *bytes*.
@@ -243,6 +248,7 @@ Get the ID of the currently used ratchet key for a given destination hash
* **Parameters:** * **Parameters:**
**destination_hash** – A destination hash as *bytes*. **destination_hash** – A destination hash as *bytes*.
* **Returns:** * **Returns:**
A ratchet ID as *bytes* or *None*. A ratchet ID as *bytes* or *None*.
@@ -253,6 +259,7 @@ Can be used to load previously created and saved identities into Reticulum.
* **Parameters:** * **Parameters:**
**prv_bytes** – The *bytes* of private a saved private key. **HAZARD!** Never use this to generate a new key by feeding random data in prv_bytes. **prv_bytes** – The *bytes* of private a saved private key. **HAZARD!** Never use this to generate a new key by feeding random data in prv_bytes.
* **Returns:** * **Returns:**
A [RNS.Identity](#api-identity) instance, or *None* if the *bytes* data was invalid. A [RNS.Identity](#api-identity) instance, or *None* if the *bytes* data was invalid.
@@ -263,6 +270,7 @@ Can be used to load previously created and saved identities into Reticulum.
* **Parameters:** * **Parameters:**
**path** – The full path to the saved [RNS.Identity](#api-identity) data **path** – The full path to the saved [RNS.Identity](#api-identity) data
* **Returns:** * **Returns:**
A [RNS.Identity](#api-identity) instance, or *None* if the loaded data was invalid. A [RNS.Identity](#api-identity) instance, or *None* if the loaded data was invalid.
@@ -274,6 +282,7 @@ communication for the identity. Be very careful with this method.
* **Parameters:** * **Parameters:**
**path** – The full path specifying where to save the identity. **path** – The full path specifying where to save the identity.
* **Returns:** * **Returns:**
True if the file was saved, otherwise False. True if the file was saved, otherwise False.
@@ -283,6 +292,7 @@ Saves the public identity to a file.
* **Parameters:** * **Parameters:**
**path** – The full path specifying where to save the identity. **path** – The full path specifying where to save the identity.
* **Returns:** * **Returns:**
True if the file was saved, otherwise False. True if the file was saved, otherwise False.
@@ -302,6 +312,7 @@ Load a private key into the instance.
* **Parameters:** * **Parameters:**
**prv_bytes** – The private key as *bytes*. **prv_bytes** – The private key as *bytes*.
* **Returns:** * **Returns:**
True if the key was loaded, otherwise False. True if the key was loaded, otherwise False.
@@ -311,6 +322,7 @@ Load a public key into the instance.
* **Parameters:** * **Parameters:**
**pub_bytes** – The public key as *bytes*. **pub_bytes** – The public key as *bytes*.
* **Returns:** * **Returns:**
True if the key was loaded, otherwise False. True if the key was loaded, otherwise False.
@@ -320,8 +332,10 @@ Encrypts information for the identity.
* **Parameters:** * **Parameters:**
**plaintext** – The plaintext to be encrypted as *bytes*. **plaintext** – The plaintext to be encrypted as *bytes*.
* **Returns:** * **Returns:**
Ciphertext token as *bytes*. Ciphertext token as *bytes*.
* **Raises:** * **Raises:**
*KeyError* if the instance does not hold a public key. *KeyError* if the instance does not hold a public key.
@@ -331,8 +345,10 @@ Decrypts information for the identity.
* **Parameters:** * **Parameters:**
**ciphertext** – The ciphertext to be decrypted as *bytes*. **ciphertext** – The ciphertext to be decrypted as *bytes*.
* **Returns:** * **Returns:**
Plaintext as *bytes*, or *None* if decryption fails. Plaintext as *bytes*, or *None* if decryption fails.
* **Raises:** * **Raises:**
*KeyError* if the instance does not hold a private key. *KeyError* if the instance does not hold a private key.
@@ -342,8 +358,10 @@ Signs information by the identity.
* **Parameters:** * **Parameters:**
**message** – The message to be signed as *bytes*. **message** – The message to be signed as *bytes*.
* **Returns:** * **Returns:**
Signature as *bytes*. Signature as *bytes*.
* **Raises:** * **Raises:**
*KeyError* if the instance does not hold a private key. *KeyError* if the instance does not hold a private key.
@@ -354,8 +372,10 @@ Validates the signature of a signed message.
* **Parameters:** * **Parameters:**
* **signature** – The signature to be validated as *bytes*. * **signature** – The signature to be validated as *bytes*.
* **message** – The message to be validated as *bytes*. * **message** – The message to be validated as *bytes*.
* **Returns:** * **Returns:**
True if the signature is valid, otherwise False. True if the signature is valid, otherwise False.
* **Raises:** * **Raises:**
*KeyError* if the instance does not hold a public key. *KeyError* if the instance does not hold a public key.
@@ -418,6 +438,7 @@ Set or query whether the destination accepts incoming link requests.
* **Parameters:** * **Parameters:**
**accepts** – If `True` or `False`, this method sets whether the destination accepts incoming link requests. If not provided or `None`, the method returns whether the destination currently accepts link requests. **accepts** – If `True` or `False`, this method sets whether the destination accepts incoming link requests. If not provided or `None`, the method returns whether the destination currently accepts link requests.
* **Returns:** * **Returns:**
`True` or `False` depending on whether the destination accepts incoming link requests, if the *accepts* parameter is not provided or `None`. `True` or `False` depending on whether the destination accepts incoming link requests, if the *accepts* parameter is not provided or `None`.
@@ -463,6 +484,7 @@ Registers a request handler.
* **allow** – One of `RNS.Destination.ALLOW_NONE`, `RNS.Destination.ALLOW_ALL` or `RNS.Destination.ALLOW_LIST`. If `RNS.Destination.ALLOW_LIST` is set, the request handler will only respond to requests for identified peers in the supplied list. * **allow** – One of `RNS.Destination.ALLOW_NONE`, `RNS.Destination.ALLOW_ALL` or `RNS.Destination.ALLOW_LIST`. If `RNS.Destination.ALLOW_LIST` is set, the request handler will only respond to requests for identified peers in the supplied list.
* **allowed_list** – A list of *bytes-like* [RNS.Identity](#api-identity) hashes. * **allowed_list** – A list of *bytes-like* [RNS.Identity](#api-identity) hashes.
* **auto_compress** – If `True` or `False`, determines whether automatic compression of responses should be carried out. If set to an integer value, responses will only be auto-compressed if under this size in bytes. If omitted, the default compression settings will be followed. * **auto_compress** – If `True` or `False`, determines whether automatic compression of responses should be carried out. If set to an integer value, responses will only be auto-compressed if under this size in bytes. If omitted, the default compression settings will be followed.
* **Raises:** * **Raises:**
`ValueError` if any of the supplied arguments are invalid. `ValueError` if any of the supplied arguments are invalid.
@@ -472,6 +494,7 @@ Deregisters a request handler.
* **Parameters:** * **Parameters:**
**path** – The path for the request handler to be deregistered. **path** – The path for the request handler to be deregistered.
* **Returns:** * **Returns:**
True if the handler was deregistered, otherwise False. True if the handler was deregistered, otherwise False.
@@ -489,6 +512,7 @@ Enabling ratchets will have a small impact on announce size, adding 32 bytes to
* **Parameters:** * **Parameters:**
**ratchets_path** – The path to a file to store ratchet data in. **ratchets_path** – The path to a file to store ratchet data in.
* **Returns:** * **Returns:**
True if the operation succeeded, otherwise False. True if the operation succeeded, otherwise False.
@@ -505,6 +529,7 @@ and try to use when decrypting incoming packets. Defaults to `Destination.RATCHE
* **Parameters:** * **Parameters:**
**retained_ratchets** – The number of generated ratchets to retain. **retained_ratchets** – The number of generated ratchets to retain.
* **Returns:** * **Returns:**
True if the operation succeeded, False if not. True if the operation succeeded, False if not.
@@ -515,6 +540,7 @@ Defaults to `Destination.RATCHET_INTERVAL`.
* **Parameters:** * **Parameters:**
**interval** – The minimum interval in seconds. **interval** – The minimum interval in seconds.
* **Returns:** * **Returns:**
True if the operation succeeded, False if not. True if the operation succeeded, False if not.
@@ -538,6 +564,7 @@ For a `RNS.Destination.GROUP` type destination, loads a symmetric private key.
* **Parameters:** * **Parameters:**
**key** – A *bytes-like* containing the symmetric key. **key** – A *bytes-like* containing the symmetric key.
* **Raises:** * **Raises:**
`TypeError` if called on an incompatible type of destination. `TypeError` if called on an incompatible type of destination.
@@ -547,6 +574,7 @@ Encrypts information for `RNS.Destination.SINGLE` or `RNS.Destination.GROUP` typ
* **Parameters:** * **Parameters:**
**plaintext** – A *bytes-like* containing the plaintext to be encrypted. **plaintext** – A *bytes-like* containing the plaintext to be encrypted.
* **Raises:** * **Raises:**
`ValueError` if destination does not hold a necessary key for encryption. `ValueError` if destination does not hold a necessary key for encryption.
@@ -556,6 +584,7 @@ Decrypts information for `RNS.Destination.SINGLE` or `RNS.Destination.GROUP` typ
* **Parameters:** * **Parameters:**
**ciphertext** – *Bytes* containing the ciphertext to be decrypted. **ciphertext** – *Bytes* containing the ciphertext to be decrypted.
* **Raises:** * **Raises:**
`ValueError` if destination does not hold a necessary key for decryption. `ValueError` if destination does not hold a necessary key for decryption.
@@ -565,6 +594,7 @@ Signs information for `RNS.Destination.SINGLE` type destination.
* **Parameters:** * **Parameters:**
**message** – *Bytes* containing the message to be signed. **message** – *Bytes* containing the message to be signed.
* **Returns:** * **Returns:**
A *bytes-like* containing the message signature, or *None* if the destination could not sign the message. A *bytes-like* containing the message signature, or *None* if the destination could not sign the message.
@@ -737,6 +767,7 @@ Sends a request to the remote peer.
* **failed_callback** – An optional function or method with the signature *failed_callback(request_receipt)* to be called when a request fails. See the [Request Example](examples.md#example-request) for more info. * **failed_callback** – An optional function or method with the signature *failed_callback(request_receipt)* to be called when a request fails. See the [Request Example](examples.md#example-request) for more info.
* **progress_callback** – An optional function or method with the signature *progress_callback(request_receipt)* to be called when progress is made receiving the response. Progress can be accessed as a float between 0.0 and 1.0 by the *request_receipt.progress* property. * **progress_callback** – An optional function or method with the signature *progress_callback(request_receipt)* to be called when progress is made receiving the response. Progress can be accessed as a float between 0.0 and 1.0 by the *request_receipt.progress* property.
* **timeout** – An optional timeout in seconds for the request. If *None* is supplied it will be calculated based on link RTT. * **timeout** – An optional timeout in seconds for the request. If *None* is supplied it will be calculated based on link RTT.
* **Returns:** * **Returns:**
A [RNS.RequestReceipt](#api-requestreceipt) instance if the request was sent, or *False* if it was not. A [RNS.RequestReceipt](#api-requestreceipt) instance if the request was sent, or *False* if it was not.
@@ -888,6 +919,7 @@ Sets the resource strategy for the link.
* **Parameters:** * **Parameters:**
**resource_strategy** – One of `RNS.Link.ACCEPT_NONE`, `RNS.Link.ACCEPT_ALL` or `RNS.Link.ACCEPT_APP`. If `RNS.Link.ACCEPT_APP` is set, the resource_callback will be called to determine whether the resource should be accepted or not. **resource_strategy** – One of `RNS.Link.ACCEPT_NONE`, `RNS.Link.ACCEPT_ALL` or `RNS.Link.ACCEPT_APP`. If `RNS.Link.ACCEPT_APP` is set, the resource_callback will be called to determine whether the resource should be accepted or not.
* **Raises:** * **Raises:**
*TypeError* if the resource strategy is unsupported. *TypeError* if the resource strategy is unsupported.
@@ -1121,6 +1153,7 @@ of this object, see the Python documentation for
* **stream_id** – the local stream id to receive from * **stream_id** – the local stream id to receive from
* **channel** – the channel to receive on * **channel** – the channel to receive on
* **ready_callback** – function to call when new data is available * **ready_callback** – function to call when new data is available
* **Returns:** * **Returns:**
a BufferedReader object a BufferedReader object
@@ -1136,6 +1169,7 @@ of this object, see the Python documentation for
* **Parameters:** * **Parameters:**
* **stream_id** – the remote stream id to send to * **stream_id** – the remote stream id to send to
* **channel** – the channel to send on * **channel** – the channel to send on
* **Returns:** * **Returns:**
a BufferedWriter object a BufferedWriter object
@@ -1156,6 +1190,7 @@ of this object, see the Python documentation for
* **send_stream_id** – the remote stream id to send to * **send_stream_id** – the remote stream id to send to
* **channel** – the channel to send and receive on * **channel** – the channel to send and receive on
* **ready_callback** – function to call when new data is available * **ready_callback** – function to call when new data is available
* **Returns:** * **Returns:**
a BufferedRWPair object a BufferedRWPair object
@@ -1251,6 +1286,7 @@ Deregisters an announce handler.
* **Parameters:** * **Parameters:**
**destination_hash** – A destination hash as *bytes*. **destination_hash** – A destination hash as *bytes*.
* **Returns:** * **Returns:**
*True* if a path to the destination is known, otherwise *False*. *True* if a path to the destination is known, otherwise *False*.
@@ -1258,6 +1294,7 @@ Deregisters an announce handler.
* **Parameters:** * **Parameters:**
**destination_hash** – A destination hash as *bytes*. **destination_hash** – A destination hash as *bytes*.
* **Returns:** * **Returns:**
The number of hops to the specified destination, or `RNS.Transport.PATHFINDER_M` if the number of hops is unknown. The number of hops to the specified destination, or `RNS.Transport.PATHFINDER_M` if the number of hops is unknown.
@@ -1265,6 +1302,7 @@ Deregisters an announce handler.
* **Parameters:** * **Parameters:**
**destination_hash** – A destination hash as *bytes*. **destination_hash** – A destination hash as *bytes*.
* **Returns:** * **Returns:**
The destination hash as *bytes* for the next hop to the specified destination, or *None* if the next hop is unknown. The destination hash as *bytes* for the next hop to the specified destination, or *None* if the next hop is unknown.
@@ -1272,6 +1310,7 @@ Deregisters an announce handler.
* **Parameters:** * **Parameters:**
**destination_hash** – A destination hash as *bytes*. **destination_hash** – A destination hash as *bytes*.
* **Returns:** * **Returns:**
The interface for the next hop to the specified destination, or *None* if the interface is unknown. The interface for the next hop to the specified destination, or *None* if the interface is unknown.
@@ -1284,6 +1323,7 @@ blocks until the path is available, or the timeout is reached.
* **destination_hash** – A destination hash as *bytes*. * **destination_hash** – A destination hash as *bytes*.
* **timeout** – An optional timeout in seconds. * **timeout** – An optional timeout in seconds.
* **on_interface** – If specified, the path request will only be sent on this interface. In normal use, Reticulum handles this automatically, and this parameter should not be used. * **on_interface** – If specified, the path request will only be sent on this interface. In normal use, Reticulum handles this automatically, and this parameter should not be used.
* **Returns:** * **Returns:**
*True* if a path to the destination is found, otherwise *False*. *True* if a path to the destination is found, otherwise *False*.
@@ -1305,6 +1345,7 @@ Blackholes an identity.
* **identity_hash** – The identity hash to blackhole as *bytes*. * **identity_hash** – The identity hash to blackhole as *bytes*.
* **until** – Optional unix timestamp of when the blackhole expires as *float* or *int*. * **until** – Optional unix timestamp of when the blackhole expires as *float* or *int*.
* **reason** – Optional reason for the blackhole as *str*. * **reason** – Optional reason for the blackhole as *str*.
* **Returns:** * **Returns:**
*True* if successful, otherwise *False*. *True* if successful, otherwise *False*.
@@ -1314,5 +1355,6 @@ Lifts blackhole for an identity.
* **Parameters:** * **Parameters:**
**identity_hash** – The identity hash to blackhole as *bytes*. **identity_hash** – The identity hash to blackhole as *bytes*.
* **Returns:** * **Returns:**
*True* if successful, otherwise *False*. *True* if successful, otherwise *False*.
+192 -373
View File
@@ -1,164 +1,119 @@
# Understanding Reticulum # Understanding Reticulum
This chapter will briefly describe the overall purpose and operating principles of Reticulum. This chapter will briefly describe the overall purpose and operating principles of Reticulum. It should give you an overview of how the stack works, and an understanding of how to develop networked applications using Reticulum.
It should give you an overview of how the stack works, and an understanding of how to
develop networked applications using Reticulum.
This chapter is not an exhaustive source of information on Reticulum, at least not yet. Currently, This chapter is not an exhaustive source of information on Reticulum, at least not yet. Currently, the only complete repository, and final authority on how Reticulum actually functions, is the Python reference implementation and API reference. That being said, this chapter is an essential resource in understanding how Reticulum works from a high-level perspective, along with the general principles of Reticulum, and how to apply them when creating your own networks or software.
the only complete repository, and final authority on how Reticulum actually functions, is the Python
reference implementation and API reference. That being said, this chapter is an essential resource in
understanding how Reticulum works from a high-level perspective, along with the general principles of
Reticulum, and how to apply them when creating your own networks or software.
After reading this chapter, you should be well-equipped to understand how a Reticulum network After reading this chapter, you should be well-equipped to understand how a Reticulum network operates, what it can achieve, and how you can use it yourself. This chapter also seeks to provide an overview of the sentiments and the philosophy behind Reticulum, what problems it seeks to solve, and how it approaches those solutions.
operates, what it can achieve, and how you can use it yourself. This chapter also seeks to provide an overview of the
sentiments and the philosophy behind Reticulum, what problems it seeks to solve, and how it
approaches those solutions.
## Motivation ## Motivation
The primary motivation for designing and implementing Reticulum has been the current lack of The primary motivation for designing and implementing Reticulum has been the current lack of reliable, functional and secure minimal-infrastructure modes of digital communication. It is my belief that it is highly desirable to create a reliable and efficient way to set up long-range digital communication networks that can securely allow exchange of information between people and machines, with no central point of authority, control, censorship or barrier to entry.
reliable, functional and secure minimal-infrastructure modes of digital communication. It is my
belief that it is highly desirable to create a reliable and efficient way to set up long-range digital
communication networks that can securely allow exchange of information between people and
machines, with no central point of authority, control, censorship or barrier to entry.
Almost all of the various networking systems in use today share a common limitation: They Almost all of the various networking systems in use today share a common limitation: They require large amounts of coordination and centralised trust and power to function. To join such networks, you need approval of gatekeepers in control. This need for coordination and trust inevitably leads to an environment of central control, where it’s very easy for infrastructure operators or governments to control or alter traffic, and censor or persecute unwanted actors. It also makes it completely impossible to freely deploy and use networks at will, like one would use other common tools that enhance individual agency and freedom.
require large amounts of coordination and centralised trust and power to function. To join such networks, you need approval
of gatekeepers in control. This need for coordination and trust inevitably leads to an environment of
central control, where it’s very easy for infrastructure operators or governments to control or alter
traffic, and censor or persecute unwanted actors. It also makes it completely impossible to freely deploy
and use networks at will, like one would use other common tools that enhance individual agency and freedom.
Reticulum aims to require as little coordination and trust as possible. It aims to make secure, Reticulum aims to require as little coordination and trust as possible. It aims to make secure, anonymous and permissionless networking and information exchange a tool that anyone can just pick up and use.
anonymous and permissionless networking and information exchange a tool that anyone can just pick up and use.
Since Reticulum is completely medium agnostic, it can be used to build networks on whatever is best Since Reticulum is completely medium agnostic, it can be used to build networks on whatever is best suited to the situation, or whatever you have available. In some cases, this might be packet radio links over VHF frequencies, in other cases it might be a 2.4 GHz network using off-the-shelf radios, or it might be using common LoRa development boards.
suited to the situation, or whatever you have available. In some cases, this might be packet radio
links over VHF frequencies, in other cases it might be a 2.4 GHz
network using off-the-shelf radios, or it might be using common LoRa development boards.
At the time of release of this document, the fastest and easiest setup for development and testing is using At the time of release of this document, the fastest and easiest setup for development and testing is using LoRa radio modules with an open source firmware (see the section [Reference Setup](#understanding-referencesystem)), connected to any kind of computer or mobile device that Reticulum can run on.
LoRa radio modules with an open source firmware (see the section [Reference Setup](#understanding-referencesystem)),
connected to any kind of computer or mobile device that Reticulum can run on.
The ultimate aim of Reticulum is to allow anyone to be their own network operator, and to make it The ultimate aim of Reticulum is to allow anyone to be their own network operator, and to make it cheap and easy to cover vast areas with a myriad of independent, interconnectable and autonomous networks. Reticulum **is not** *one network*, it **is a tool** to build *thousands of networks*. Networks without kill-switches, surveillance, censorship and control. Networks that can freely interoperate, associate and disassociate with each other, and require no central oversight. Networks for human beings. *Networks for the people*.
cheap and easy to cover vast areas with a myriad of independent, interconnectable and autonomous networks.
Reticulum **is not** *one network*, it **is a tool** to build *thousands of networks*. Networks without
kill-switches, surveillance, censorship and control. Networks that can freely interoperate, associate and disassociate
with each other, and require no central oversight. Networks for human beings. *Networks for the people*.
## Goals ## Goals
To be as widely usable and efficient to deploy as possible, the following goals have been used to To be as widely usable and efficient to deploy as possible, the following goals have been used to guide the design of Reticulum:
guide the design of Reticulum:
* **Fully useable as open source software stack** * **Fully useable as open source software stack**
: Reticulum must be implemented with, and be able to run using only open source software. This is Reticulum must be implemented with, and be able to run using only open source software. This is
critical to ensuring the availability, security and transparency of the system. critical to ensuring the availability, security and transparency of the system.
* **Hardware layer agnosticism** * **Hardware layer agnosticism**
: Reticulum must be fully hardware agnostic, and shall be useable over a wide range of Reticulum must be fully hardware agnostic, and shall be useable over a wide range of
physical networking layers, such as data radios, serial lines, modems, handheld transceivers, physical networking layers, such as data radios, serial lines, modems, handheld transceivers,
wired Ethernet, WiFi, or anything else that can carry a digital data stream. Hardware made for wired Ethernet, WiFi, or anything else that can carry a digital data stream. Hardware made for
dedicated Reticulum use shall be as cheap as possible and use off-the-shelf components, so dedicated Reticulum use shall be as cheap as possible and use off-the-shelf components, so
it can be easily modified and replicated by anyone interested in doing so. it can be easily modified and replicated by anyone interested in doing so.
* **Very low bandwidth requirements** * **Very low bandwidth requirements**
: Reticulum should be able to function reliably over links with a transmission capacity as low Reticulum should be able to function reliably over links with a transmission capacity as low
as *5 bits per second*. as *5 bits per second*.
* **Encryption by default** * **Encryption by default**
: Reticulum must use strong encryption by default for all communication. Reticulum must use strong encryption by default for all communication.
* **Initiator Anonymity** * **Initiator Anonymity**
: It must be possible to communicate over a Reticulum network without revealing any identifying It must be possible to communicate over a Reticulum network without revealing any identifying
information about oneself. information about oneself.
* **Unlicensed use** * **Unlicensed use**
: Reticulum shall be functional over physical communication mediums that do not require any Reticulum shall be functional over physical communication mediums that do not require any
form of license to use. Reticulum must be designed in a way, so it is usable over ISM radio form of license to use. Reticulum must be designed in a way, so it is usable over ISM radio
frequency bands, and can provide functional long distance links in such conditions, for example frequency bands, and can provide functional long distance links in such conditions, for
by connecting a modem to a PMR or CB radio, or by using LoRa or WiFi modules. example by connecting a modem to a PMR or CB radio, or by using LoRa or WiFi modules.
* **Supplied software** * **Supplied software**
: In addition to the core networking stack and API, that allows a developer to build In addition to the core networking stack and API, that allows a developer to build
applications with Reticulum, a basic set of Reticulum-based communication tools must be applications with Reticulum, a basic set of Reticulum-based communication tools must be
implemented and released along with Reticulum itself. These shall serve both as a implemented and released along with Reticulum itself. These shall serve both as a
functional, basic communication suite, and as an example and learning resource to others wishing functional, basic communication suite, and as an example and learning resource to others
to build applications with Reticulum. wishing to build applications with Reticulum.
* **Ease of use** * **Ease of use**
: The reference implementation of Reticulum is written in Python, to make it easy to use The reference implementation of Reticulum is written in Python, to make it easy to use and
and understand. A programmer with only basic experience should be able to use understand. A programmer with only basic experience should be able to use Reticulum to write
Reticulum to write networked applications. networked applications.
* **Low cost** * **Low cost**
: It shall be as cheap as possible to deploy a communication system based on Reticulum. This It shall be as cheap as possible to deploy a communication system based on Reticulum. This
should be achieved by using cheap off-the-shelf hardware that potential users might already should be achieved by using cheap off-the-shelf hardware that potential users might already
own. The cost of setting up a functioning node should be less than $100 even if all parts own. The cost of setting up a functioning node should be less than $100 even if all parts
needs to be purchased. needs to be purchased.
## Introduction & Basic Functionality ## Introduction & Basic Functionality
Reticulum is a networking stack suited for high-latency, low-bandwidth links. Reticulum is at its Reticulum is a networking stack suited for high-latency, low-bandwidth links. Reticulum is at its core a *message oriented* system. It is suited for both local point-to-point or point-to-multipoint scenarios where all nodes are within range of each other, as well as scenarios where packets need to be transported over multiple hops in a complex network to reach the recipient.
core a *message oriented* system. It is suited for both local point-to-point or point-to-multipoint
scenarios where all nodes are within range of each other, as well as scenarios where packets need
to be transported over multiple hops in a complex network to reach the recipient.
Reticulum does away with the idea of addresses and ports known from IP, TCP and UDP. Instead Reticulum does away with the idea of addresses and ports known from IP, TCP and UDP. Instead Reticulum uses the singular concept of *destinations*. Any application using Reticulum as its networking stack will need to create one or more destinations to receive data, and know the destinations it needs to send data to.
Reticulum uses the singular concept of *destinations*. Any application using Reticulum as its
networking stack will need to create one or more destinations to receive data, and know the
destinations it needs to send data to.
All destinations in Reticulum are *represented* as a 16 byte hash. This hash is derived from truncating a full All destinations in Reticulum are *represented* as a 16 byte hash. This hash is derived from truncating a full SHA-256 hash of identifying characteristics of the destination. To users, the destination addresses will be displayed as 16 hexadecimal bytes, like this example: `<13425ec15b621c1d928589718000d814>`.
SHA-256 hash of identifying characteristics of the destination. To users, the destination addresses
will be displayed as 16 hexadecimal bytes, like this example: `<13425ec15b621c1d928589718000d814>`.
The truncation size of 16 bytes (128 bits) for destinations has been chosen as a reasonable trade-off The truncation size of 16 bytes (128 bits) for destinations has been chosen as a reasonable trade-off between address space and packet overhead. The address space accommodated by this size can support many billions of simultaneously active devices on the same network, while keeping packet overhead low, which is essential on low-bandwidth networks. In the very unlikely case that this address space nears congestion, a one-line code change can upgrade the Reticulum address space all the way up to 256 bits, ensuring the Reticulum address space could potentially support galactic-scale networks. This is obviously complete and ridiculous over-allocation, and as such, the current 128 bits should be sufficient, even far into the future.
between address space
and packet overhead. The address space accommodated by this size can support many billions of
simultaneously active devices on the same network, while keeping packet overhead low, which is
essential on low-bandwidth networks. In the very unlikely case that this address space nears
congestion, a one-line code change can upgrade the Reticulum address space all the way up to 256
bits, ensuring the Reticulum address space could potentially support galactic-scale networks.
This is obviously complete and ridiculous over-allocation, and as such, the current 128 bits should
be sufficient, even far into the future.
By default Reticulum encrypts all data using elliptic curve cryptography and AES. Any packet sent to a By default Reticulum encrypts all data using elliptic curve cryptography and AES. Any packet sent to a destination is encrypted with a per-packet derived key. Reticulum can also set up an encrypted channel to a destination, called a *Link*. Both data sent over Links and single packets offer *Initiator Anonymity*. Links additionally offer *Forward Secrecy* by default, employing an Elliptic Curve Diffie Hellman key exchange on Curve25519 to derive per-link ephemeral keys. Asymmetric, link-less packet communication can also provide forward secrecy, with automatic key ratcheting, by enabling ratchets on a per-destination basis. The multi-hop transport, coordination, verification and reliability layers are fully autonomous and also based on elliptic curve cryptography.
destination is encrypted with a per-packet derived key. Reticulum can also set up an encrypted
channel to a destination, called a *Link*. Both data sent over Links and single packets offer
*Initiator Anonymity*. Links additionally offer *Forward Secrecy* by default, employing an Elliptic Curve
Diffie Hellman key exchange on Curve25519 to derive per-link ephemeral keys. Asymmetric, link-less
packet communication can also provide forward secrecy, with automatic key ratcheting, by enabling
ratchets on a per-destination basis. The multi-hop transport, coordination, verification and reliability
layers are fully autonomous and also based on elliptic curve cryptography.
Reticulum also offers symmetric key encryption for group-oriented communications, as well as Reticulum also offers symmetric key encryption for group-oriented communications, as well as unencrypted packets (for local broadcast purposes **only**).
unencrypted packets (for local broadcast purposes **only**).
Reticulum can connect to a variety of interfaces such as radio modems, data radios and serial ports, Reticulum can connect to a variety of interfaces such as radio modems, data radios and serial ports, and offers the possibility to easily tunnel Reticulum traffic over IP links such as the Internet or private IP networks.
and offers the possibility to easily tunnel Reticulum traffic over IP links such as the Internet or
private IP networks.
### Destinations ### Destinations
To receive and send data with the Reticulum stack, an application needs to create one or more To receive and send data with the Reticulum stack, an application needs to create one or more destinations. Reticulum uses three different basic destination types, and one special:
destinations. Reticulum uses three different basic destination types, and one special:
* **Single** * **Single**
: The *single* destination type is the most common type in Reticulum, and should be used for The *single* destination type is the most common type in Reticulum, and should be used for
most purposes. It is always identified by a unique public key. Any data sent to this most purposes. It is always identified by a unique public key. Any data sent to this
destination will be encrypted using ephemeral keys derived from an ECDH key exchange, and will destination will be encrypted using ephemeral keys derived from an ECDH key exchange, and will
only be readable by the creator of the destination, who holds the corresponding private key. only be readable by the creator of the destination, who holds the corresponding private key.
* **Plain** * **Plain**
: A *plain* destination type is unencrypted, and suited for traffic that should be broadcast to a A *plain* destination type is unencrypted, and suited for traffic that should be broadcast to a
number of users, or should be readable by anyone. Traffic to a *plain* destination is not encrypted. number of users, or should be readable by anyone. Traffic to a *plain* destination is not encrypted.
Generally, *plain* destinations can be used for broadcast information intended to be public. Generally, *plain* destinations can be used for broadcast information intended to be public.
Plain destinations are only reachable directly, and packets addressed to plain destinations are Plain destinations are only reachable directly, and packets addressed to plain destinations are
never transported over multiple hops in the network. To be transportable over multiple hops in Reticulum, information never transported over multiple hops in the network. To be transportable over multiple hops in
*must* be encrypted, since Reticulum uses the per-packet encryption to verify routing paths and Reticulum, information *must* be encrypted, since Reticulum uses the per-packet encryption to verify
keep them alive. routing paths and keep them alive.
* **Group** * **Group**
: The *group* special destination type, that defines a symmetrically encrypted virtual destination. The *group* special destination type, that defines a symmetrically encrypted virtual destination.
Data sent to this destination will be encrypted with a symmetric key, and will be readable by Data sent to this destination will be encrypted with a symmetric key, and will be readable by
anyone in possession of the key, but as with the *plain* destination type, packets to this type anyone in possession of the key, but as with the *plain* destination type, packets to this type
of destination are not currently transported over multiple hops, although a planned upgrade of destination are not currently transported over multiple hops, although a planned upgrade
to Reticulum will allow globally reachable *group* destinations. to Reticulum will allow globally reachable *group* destinations.
* **Link** * **Link**
: A *link* is a special destination type, that serves as an abstract channel to a *single* A *link* is a special destination type, that serves as an abstract channel to a *single*
destination, directly connected or over multiple hops. The *link* also offers reliability and destination, directly connected or over multiple hops. The *link* also offers reliability and
more efficient encryption, forward secrecy, initiator anonymity, and as such can be useful even more efficient encryption, forward secrecy, initiator anonymity, and as such can be useful even
when a node is directly reachable. It also offers a more capable API and allows easily carrying when a node is directly reachable. It also offers a more capable API and allows easily carrying
@@ -166,16 +121,11 @@ destinations. Reticulum uses three different basic destination types, and one sp
#### Destination Naming #### Destination Naming
Destinations are created and named in an easy to understand dotted notation of *aspects*, and Destinations are created and named in an easy to understand dotted notation of *aspects*, and represented on the network as a hash of this value. The hash is a SHA-256 truncated to 128 bits. The top level aspect should always be a unique identifier for the application using the destination. The next levels of aspects can be defined in any way by the creator of the application.
represented on the network as a hash of this value. The hash is a SHA-256 truncated to 128 bits. The
top level aspect should always be a unique identifier for the application using the destination.
The next levels of aspects can be defined in any way by the creator of the application.
Aspects can be as long and as plentiful as required, and a resulting long destination name will not Aspects can be as long and as plentiful as required, and a resulting long destination name will not impact efficiency, as names are always represented as truncated SHA-256 hashes on the network.
impact efficiency, as names are always represented as truncated SHA-256 hashes on the network.
As an example, a destination for a environmental monitoring application could be made up of the As an example, a destination for a environmental monitoring application could be made up of the application name, a device type and measurement type, like this:
application name, a device type and measurement type, like this:
```text ```text
app name : environmentlogger app name : environmentlogger
@@ -185,11 +135,7 @@ full name : environmentlogger.remotesensor.temperature
hash : 4faf1b2e0a077e6a9d92fa051f256038 hash : 4faf1b2e0a077e6a9d92fa051f256038
``` ```
For the *single* destination, Reticulum will automatically append the associated public key as a For the *single* destination, Reticulum will automatically append the associated public key as a destination aspect before hashing. This is done to ensure only the correct destination is reached, since anyone can listen to any destination name. Appending the public key ensures that a given packet is only directed at the destination that holds the corresponding private key to decrypt the packet.
destination aspect before hashing. This is done to ensure only the correct destination is reached,
since anyone can listen to any destination name. Appending the public key ensures that a given
packet is only directed at the destination that holds the corresponding private key to decrypt the
packet.
**Take note!** There is a very important concept to understand here: **Take note!** There is a very important concept to understand here:
@@ -197,46 +143,29 @@ packet.
* Each destination that does so will still have a unique destination hash, and thus be uniquely * Each destination that does so will still have a unique destination hash, and thus be uniquely
addressable, because their public keys will differ. addressable, because their public keys will differ.
In actual use of *single* destination naming, it is advisable not to use any uniquely identifying In actual use of *single* destination naming, it is advisable not to use any uniquely identifying features in aspect naming. Aspect names should be general terms describing what kind of destination is represented. The uniquely identifying aspect is always achieved by appending the public key, which expands the destination into a uniquely identifiable one. Reticulum does this automatically.
features in aspect naming. Aspect names should be general terms describing what kind of destination
is represented. The uniquely identifying aspect is always achieved by appending the public key,
which expands the destination into a uniquely identifiable one. Reticulum does this automatically.
Any destination on a Reticulum network can be addressed and reached simply by knowing its Any destination on a Reticulum network can be addressed and reached simply by knowing its destination hash (and public key, but if the public key is not known, it can be requested from the network simply by knowing the destination hash). The use of app names and aspects makes it easy to structure Reticulum programs and makes it possible to filter what information and data your program receives.
destination hash (and public key, but if the public key is not known, it can be requested from the
network simply by knowing the destination hash). The use of app names and aspects makes it easy to
structure Reticulum programs and makes it possible to filter what information and data your program
receives.
To recap, the different destination types should be used in the following situations: To recap, the different destination types should be used in the following situations:
* **Single** * **Single**
: When private communication between two endpoints is needed. Supports multiple hops. When private communication between two endpoints is needed. Supports multiple hops.
* **Group** * **Group**
: When private communication between two or more endpoints is needed. Supports multiple hops When private communication between two or more endpoints is needed. Supports multiple hops
indirectly, but must first be established through a *single* destination. indirectly, but must first be established through a *single* destination.
* **Plain** * **Plain**
: When plain-text communication is desirable, for example when broadcasting information, or for local discovery purposes. When plain-text communication is desirable, for example when broadcasting information, or for local discovery purposes.
To communicate with a *single* destination, you need to know its public key. Any method for To communicate with a *single* destination, you need to know its public key. Any method for obtaining the public key is valid, but Reticulum includes a simple mechanism for making other nodes aware of your destinations public key, called the *announce*. It is also possible to request an unknown public key from the network, as all transport instances serve as a distributed ledger of public keys.
obtaining the public key is valid, but Reticulum includes a simple mechanism for making other
nodes aware of your destinations public key, called the *announce*. It is also possible to request
an unknown public key from the network, as all transport instances serve as a distributed ledger
of public keys.
Note that public key information can be shared and verified in other ways than using the Note that public key information can be shared and verified in other ways than using the built-in *announce* functionality, and that it is therefore not required to use the *announce* and *path request* functionality to obtain public keys. It is by far the easiest though, and should definitely be used if there is not a very good reason for doing it differently.
built-in *announce* functionality, and that it is therefore not required to use the *announce* and *path request*
functionality to obtain public keys. It is by far the easiest though, and should definitely be used
if there is not a very good reason for doing it differently.
### Public Key Announcements ### Public Key Announcements
An *announce* will send a special packet over any relevant interfaces, containing all needed An *announce* will send a special packet over any relevant interfaces, containing all needed information about the destination hash and public key, and can also contain some additional, application specific data. The entire packet is signed by the sender to ensure authenticity. It is not required to use the announce functionality, but in many cases it will be the simplest way to share public keys on the network. The announce mechanism also serves to establish end-to-end connectivity to the announced destination, as the announce propagates through the network.
information about the destination hash and public key, and can also contain some additional,
application specific data. The entire packet is signed by the sender to ensure authenticity. It is not
required to use the announce functionality, but in many cases it will be the simplest way to share
public keys on the network. The announce mechanism also serves to establish end-to-end connectivity
to the announced destination, as the announce propagates through the network.
As an example, an announce in a simple messenger application might contain the following information: As an example, an announce in a simple messenger application might contain the following information:
@@ -246,259 +175,187 @@ As an example, an announce in a simple messenger application might contain the f
* A random blob, making each new announce unique * A random blob, making each new announce unique
* An Ed25519 signature of the above information, verifying authenticity * An Ed25519 signature of the above information, verifying authenticity
With this information, any Reticulum node that receives it will be able to reconstruct an outgoing With this information, any Reticulum node that receives it will be able to reconstruct an outgoing destination to securely communicate with that destination. You might have noticed that there is one piece of information lacking to reconstruct full knowledge of the announced destination, and that is the aspect names of the destination. These are intentionally left out to save bandwidth, since they will be implicit in almost all cases. The receiving application will already know them. If a destination name is not entirely implicit, information can be included in the application specific data part that will allow the receiver to infer the naming.
destination to securely communicate with that destination. You might have noticed that there is one
piece of information lacking to reconstruct full knowledge of the announced destination, and that is
the aspect names of the destination. These are intentionally left out to save bandwidth, since they
will be implicit in almost all cases. The receiving application will already know them. If a destination
name is not entirely implicit, information can be included in the application specific data part that
will allow the receiver to infer the naming.
It is important to note that announces will be forwarded throughout the network according to a It is important to note that announces will be forwarded throughout the network according to a certain pattern. This will be detailed in the section [The Announce Mechanism in Detail](#understanding-announce).
certain pattern. This will be detailed in the section
[The Announce Mechanism in Detail](#understanding-announce).
In Reticulum, destinations are allowed to move around the network at will. This is very different from In Reticulum, destinations are allowed to move around the network at will. This is very different from protocols such as IP, where an address is always expected to stay within the network segment it was assigned in. This limitation does not exist in Reticulum, and any destination is *completely portable* over the entire topography of the network, and *can even be moved to other Reticulum networks* than the one it was created in, and still become reachable. To update its reachability, a destination simply needs to send an announce on any networks it is part of. After a short while, it will be globally reachable in the network.
protocols such as IP, where an address is always expected to stay within the network segment it was assigned in.
This limitation does not exist in Reticulum, and any destination is *completely portable* over the entire topography
of the network, and *can even be moved to other Reticulum networks* than the one it was created in, and
still become reachable. To update its reachability, a destination simply needs to send an announce on any
networks it is part of. After a short while, it will be globally reachable in the network.
Seeing how *single* destinations are always tied to a private/public key pair leads us to the next topic. Seeing how *single* destinations are always tied to a private/public key pair leads us to the next topic.
### Identities ### Identities
In Reticulum, an *identity* does not necessarily represent a personal identity, but is an abstraction that In Reticulum, an *identity* does not necessarily represent a personal identity, but is an abstraction that can represent any kind of *verifiable entity*. This could very well be a person, but it could also be the control interface of a machine, a program, robot, computer, sensor or something else entirely. In general, any kind of agent that can act, or be acted upon, or store or manipulate information, can be represented as an identity. An *identity* can be used to create any number of destinations.
can represent any kind of *verifiable entity*. This could very well be a person, but it could also be the
control interface of a machine, a program, robot, computer, sensor or something else entirely. In
general, any kind of agent that can act, or be acted upon, or store or manipulate information, can be
represented as an identity. An *identity* can be used to create any number of destinations.
A *single* destination will always have an *identity* tied to it, but not *plain* or *group* A *single* destination will always have an *identity* tied to it, but not *plain* or *group* destinations. Destinations and identities share a multilateral connection. You can create a destination, and if it is not connected to an identity upon creation, it will just create a new one to use automatically. This may be desirable in some situations, but often you will probably want to create the identity first, and then use it to create new destinations.
destinations. Destinations and identities share a multilateral connection. You can create a
destination, and if it is not connected to an identity upon creation, it will just create a new one to use
automatically. This may be desirable in some situations, but often you will probably want to create
the identity first, and then use it to create new destinations.
As an example, we could use an identity to represent the user of a messaging application. As an example, we could use an identity to represent the user of a messaging application. Destinations can then be created by this identity to allow communication to reach the user. In all cases it is of great importance to store the private keys associated with any Reticulum Identity securely and privately, since obtaining access to the identity keys equals obtaining access and controlling reachability to any destinations created by that identity.
Destinations can then be created by this identity to allow communication to reach the user.
In all cases it is of great importance to store the private keys associated with any
Reticulum Identity securely and privately, since obtaining access to the identity keys equals
obtaining access and controlling reachability to any destinations created by that identity.
### Getting Further ### Getting Further
The above functions and principles form the core of Reticulum, and would suffice to create The above functions and principles form the core of Reticulum, and would suffice to create functional networked applications in local clusters, for example over radio links where all interested nodes can directly hear each other. But to be truly useful, we need a way to direct traffic over multiple hops in the network.
functional networked applications in local clusters, for example over radio links where all interested
nodes can directly hear each other. But to be truly useful, we need a way to direct traffic over multiple
hops in the network.
In the following sections, two concepts that allow this will be introduced, *paths* and *links*. In the following sections, two concepts that allow this will be introduced, *paths* and *links*.
## Reticulum Transport ## Reticulum Transport
The methods of routing used in traditional networks are fundamentally incompatible with the physical medium The methods of routing used in traditional networks are fundamentally incompatible with the physical medium types and circumstances that Reticulum was designed to handle. These mechanisms mostly assume trust at the physical layer, and often needs a lot more bandwidth than Reticulum can assume is available. Since Reticulum is designed to survive running over open radio spectrum, no such trust can be assumed, and bandwidth is often very limited.
types and circumstances that Reticulum was designed to handle. These mechanisms mostly assume trust at the physical layer,
and often needs a lot more bandwidth than Reticulum can assume is available. Since Reticulum is designed to
survive running over open radio spectrum, no such trust can be assumed, and bandwidth is often very limited.
To overcome such challenges, Reticulum’s *Transport* system uses asymmetric elliptic curve cryptography to To overcome such challenges, Reticulum’s *Transport* system uses asymmetric elliptic curve cryptography to implement the concept of *paths* that allow discovery of how to get information closer to a certain destination. It is important to note that no single node in a Reticulum network knows the complete path to a destination. Every Transport node participating in a Reticulum network will only know the most direct way to get a packet one hop closer to it’s destination.
implement the concept of *paths* that allow discovery of how to get information closer to a certain
destination. It is important to note that no single node in a Reticulum network knows the complete
path to a destination. Every Transport node participating in a Reticulum network will only
know the most direct way to get a packet one hop closer to it’s destination.
### Node Types ### Node Types
Currently, Reticulum distinguishes between two types of network nodes. All nodes on a Reticulum network Currently, Reticulum distinguishes between two types of network nodes. All nodes on a Reticulum network are *Reticulum Instances*, and some are also *Transport Nodes*. If a system running Reticulum is fixed in one place, and is intended to be kept available most of the time, it is a good contender to be a *Transport Node*.
are *Reticulum Instances*, and some are also *Transport Nodes*. If a system running Reticulum is fixed in
one place, and is intended to be kept available most of the time, it is a good contender to be a *Transport Node*.
Any Reticulum Instance can become a Transport Node by enabling it in the configuration. Any Reticulum Instance can become a Transport Node by enabling it in the configuration. This distinction is made by the user configuring the node, and is used to determine what nodes on the network will help forward traffic, and what nodes rely on other nodes for wider connectivity.
This distinction is made by the user configuring the node, and is used to determine what nodes on the
network will help forward traffic, and what nodes rely on other nodes for wider connectivity.
If a node is an *Instance* it should be given the configuration directive `enable_transport = No`, which If a node is an *Instance* it should be given the configuration directive `enable_transport = No`, which is the default setting.
is the default setting.
If it is a *Transport Node*, it should be given the configuration directive `enable_transport = Yes`. If it is a *Transport Node*, it should be given the configuration directive `enable_transport = Yes`.
### The Announce Mechanism in Detail ### The Announce Mechanism in Detail
When an *announce* for a destination is transmitted by a Reticulum instance, it will be forwarded by When an *announce* for a destination is transmitted by a Reticulum instance, it will be forwarded by any transport node receiving it, but according to some specific rules:
any transport node receiving it, but according to some specific rules:
* If this exact announce has already been received before, ignore it. * If this exact announce has already been received before, ignore it.
<br/>
* If not, record into a table which Transport Node the announce was received from, and how many times in * If not, record into a table which Transport Node the announce was received from, and how many times in
total it has been retransmitted to get here. total it has been retransmitted to get here.
<br/>
* If the announce has been retransmitted *m+1* times, it will not be forwarded any more. By default, *m* is * If the announce has been retransmitted *m+1* times, it will not be forwarded any more. By default, *m* is
set to 128. set to 128.
<br/>
* After a randomised delay, the announce will be retransmitted on all interfaces that have bandwidth * After a randomised delay, the announce will be retransmitted on all interfaces that have bandwidth
available for processing announces. By default, the maximum bandwidth allocation for processing available for processing announces. By default, the maximum bandwidth allocation for processing
announces is set at 2%, but can be configured on a per-interface basis. announces is set at 2%, but can be configured on a per-interface basis.
<br/>
* If any given interface does not have enough bandwidth available for retransmitting the announce, * If any given interface does not have enough bandwidth available for retransmitting the announce,
the announce will be assigned a priority inversely proportional to its hop count, and be inserted the announce will be assigned a priority inversely proportional to its hop count, and be inserted
into a queue managed by the interface. into a queue managed by the interface.
<br/>
* When the interface has bandwidth available for processing an announce, it will prioritise announces * When the interface has bandwidth available for processing an announce, it will prioritise announces
for destinations that are closest in terms of hops, thus prioritising reachability and connectivity for destinations that are closest in terms of hops, thus prioritising reachability and connectivity
of local nodes, even on slow networks that connect to wider and faster networks. of local nodes, even on slow networks that connect to wider and faster networks.
<br/>
* After the announce has been re-transmitted, and if no other nodes are heard retransmitting the announce * After the announce has been re-transmitted, and if no other nodes are heard retransmitting the announce
with a greater hop count than when it left this node, transmitting it will be retried *r* times. By default, with a greater hop count than when it left this node, transmitting it will be retried *r* times. By default,
*r* is set to 1. *r* is set to 1.
<br/>
* If a newer announce from the same destination arrives, while an identical one is already waiting * If a newer announce from the same destination arrives, while an identical one is already waiting
to be transmitted, the newest announce is discarded. If the newest announce contains different to be transmitted, the newest announce is discarded. If the newest announce contains different
application specific data, it will replace the old announce. application specific data, it will replace the old announce.
<br/>
Once an announce has reached a transport node in the network, any other node in direct contact with that Once an announce has reached a transport node in the network, any other node in direct contact with that transport node will be able to reach the destination the announce originated from, simply by sending a packet addressed to that destination. Any transport node with knowledge of the announce will be able to direct the packet towards the destination by looking up the most efficient next node to the destination.
transport node will be able to reach the destination the announce originated from, simply by sending a packet
addressed to that destination. Any transport node with knowledge of the announce will be able to direct the
packet towards the destination by looking up the most efficient next node to the destination.
According to these rules, an announce will propagate throughout the network in a predictable way, According to these rules, an announce will propagate throughout the network in a predictable way, and make the announced destination reachable in a short amount of time. Fast networks that have the capacity to process many announces can reach full convergence very quickly, even when constantly adding new destinations. Slower segments of such networks might take a bit longer to gain full knowledge about the wide and fast networks they are connected to, but can still do so over time, while prioritising full and quickly converging end-to-end connectivity for their local, slower segments.
and make the announced destination reachable in a short amount of time. Fast networks that have the
capacity to process many announces can reach full convergence very quickly, even when constantly adding
new destinations. Slower segments of such networks might take a bit longer to gain full knowledge about
the wide and fast networks they are connected to, but can still do so over time, while prioritising full
and quickly converging end-to-end connectivity for their local, slower segments.
In general, even extremely complex networks, that utilize the maximum 128 hops will converge to full In general, even extremely complex networks, that utilize the maximum 128 hops will converge to full end-to-end connectivity in about one minute, given there is enough bandwidth available to process the required amount of announces.
end-to-end connectivity in about one minute, given there is enough bandwidth available to process
the required amount of announces.
### Reaching the Destination ### Reaching the Destination
In networks with changing topology and trustless connectivity, nodes need a way to establish In networks with changing topology and trustless connectivity, nodes need a way to establish *verified connectivity* with each other. Since the underlying network mediums are assumed to be trustless, Reticulum must provide a way to guarantee that the peer you are communicating with is actually who you expect. Reticulum offers two ways to do this.
*verified connectivity* with each other. Since the underlying network mediums are assumed to be trustless, Reticulum
must provide a way to guarantee that the peer you are communicating with is actually who you
expect. Reticulum offers two ways to do this.
For exchanges of small amounts of information, Reticulum offers the *Packet* API, which works exactly like you would expect - on a per packet level. The following process is employed when sending a packet: For exchanges of small amounts of information, Reticulum offers the *Packet* API, which works exactly like you would expect - on a per packet level. The following process is employed when sending a packet:
* A packet is always created with an associated destination and some payload data. When the packet is sent * A packet is always created with an associated destination and some payload data. When the packet is sent
to a *single* destination type, Reticulum will automatically create an ephemeral encryption key, perform to a *single* destination type, Reticulum will automatically create an ephemeral encryption key, perform
an ECDH key exchange with the destination’s public key (or ratchet key, if available), and encrypt the information. an ECDH key exchange with the destination’s public key (or ratchet key, if available), and encrypt the information.
<br/>
* It is important to note that this key exchange does not require any network traffic. The sender already * It is important to note that this key exchange does not require any network traffic. The sender already
knows the public key of the destination from an earlier received announce, and can thus perform the ECDH knows the public key of the destination from an earlier received announce, and can thus perform the ECDH
key exchange locally, before sending the packet. key exchange locally, before sending the packet.
<br/>
* The public part of the newly generated ephemeral key-pair is included with the encrypted token, and sent * The public part of the newly generated ephemeral key-pair is included with the encrypted token, and sent
along with the encrypted payload data in the packet. along with the encrypted payload data in the packet.
<br/>
* When the destination receives the packet, it can itself perform an ECDH key exchange and decrypt the * When the destination receives the packet, it can itself perform an ECDH key exchange and decrypt the
packet. packet.
<br/>
* A new ephemeral key is used for every packet sent in this way. * A new ephemeral key is used for every packet sent in this way.
<br/>
* Once the packet has been received and decrypted by the addressed destination, that destination can opt * Once the packet has been received and decrypted by the addressed destination, that destination can opt
to *prove* its receipt of the packet. It does this by calculating the SHA-256 hash of the received packet, to *prove* its receipt of the packet. It does this by calculating the SHA-256 hash of the received packet,
and signing this hash with its Ed25519 signing key. Transport nodes in the network can then direct this and signing this hash with its Ed25519 signing key. Transport nodes in the network can then direct this
*proof* back to the packets origin, where the signature can be verified against the destination’s known *proof* back to the packets origin, where the signature can be verified against the destination’s known
public signing key. public signing key.
<br/>
* In case the packet is addressed to a *group* destination type, the packet will be encrypted with the * In case the packet is addressed to a *group* destination type, the packet will be encrypted with the
pre-shared AES-256 key associated with the destination. In case the packet is addressed to a *plain* pre-shared AES-256 key associated with the destination. In case the packet is addressed to a *plain*
destination type, the payload data will not be encrypted. Neither of these two destination types can offer destination type, the payload data will not be encrypted. Neither of these two destination types can offer
forward secrecy. In general, it is recommended to always use the *single* destination type, unless it is forward secrecy. In general, it is recommended to always use the *single* destination type, unless it is
strictly necessary to use one of the others. strictly necessary to use one of the others.
<br/>
For exchanges of larger amounts of data, or when longer sessions of bidirectional communication is desired, Reticulum offers the *Link* API. To establish a *link*, the following process is employed: For exchanges of larger amounts of data, or when longer sessions of bidirectional communication is desired, Reticulum offers the *Link* API. To establish a *link*, the following process is employed:
* First, the node that wishes to establish a link will send out a *link request* packet, that * First, the node that wishes to establish a link will send out a *link request* packet, that
traverses the network and locates the desired destination. Along the way, the Transport Nodes that traverses the network and locates the desired destination. Along the way, the Transport Nodes that
forward the packet will take note of this *link request*, and mark it as pending. forward the packet will take note of this *link request*, and mark it as pending.
<br/>
* Second, if the destination accepts the *link request* , it will send back a packet that proves the * Second, if the destination accepts the *link request* , it will send back a packet that proves the
authenticity of its identity (and the receipt of the link request) to the initiating node. All authenticity of its identity (and the receipt of the link request) to the initiating node. All
nodes that initially forwarded the packet will also be able to verify this proof, and thus nodes that initially forwarded the packet will also be able to verify this proof, and thus
accept the validity of the *link* throughout the network. The link is now marked as *established*. accept the validity of the *link* throughout the network. The link is now marked as *established*.
<br/>
* When the validity of the *link* has been accepted by forwarding nodes, these nodes will * When the validity of the *link* has been accepted by forwarding nodes, these nodes will
remember the *link* , and it can subsequently be used by referring to a hash representing it. remember the *link* , and it can subsequently be used by referring to a hash representing it.
<br/>
* As a part of the *link request*, an Elliptic Curve Diffie-Hellman key exchange takes place, that sets up an * As a part of the *link request*, an Elliptic Curve Diffie-Hellman key exchange takes place, that sets up an
efficiently encrypted tunnel between the two nodes. As such, this mode of communication is preferred, efficiently encrypted tunnel between the two nodes. As such, this mode of communication is preferred,
even for situations when nodes can directly communicate, when the amount of data to be exchanged numbers even for situations when nodes can directly communicate, when the amount of data to be exchanged numbers
in the tens of packets, or whenever the use of the more advanced API functions is desired. in the tens of packets, or whenever the use of the more advanced API functions is desired.
<br/>
* When a *link* has been set up, it automatically provides message receipt functionality, through * When a *link* has been set up, it automatically provides message receipt functionality, through
the same *proof* mechanism discussed before, so the sending node can obtain verified confirmation the same *proof* mechanism discussed before, so the sending node can obtain verified confirmation
that the information reached the intended recipient. that the information reached the intended recipient.
<br/>
* Once the *link* has been set up, the initiator can remain anonymous, or choose to authenticate towards * Once the *link* has been set up, the initiator can remain anonymous, or choose to authenticate towards
the destination using a Reticulum Identity. This authentication is happening inside the encrypted the destination using a Reticulum Identity. This authentication is happening inside the encrypted
link, and is only revealed to the verified destination, and no intermediaries. link, and is only revealed to the verified destination, and no intermediaries.
<br/>
In a moment, we will discuss the details of how this methodology is In a moment, we will discuss the details of how this methodology is implemented, but let’s first recap what purposes this methodology serves. We first ensure that the node answering our request is actually the one we want to communicate with, and not a malicious actor pretending to be so. At the same time we establish an efficient encrypted channel. The setup of this is relatively cheap in terms of bandwidth, so it can be used just for a short exchange, and then recreated as needed, which will also rotate encryption keys. The link can also be kept alive for longer periods of time, if this is more suitable to the application. The procedure also inserts the *link id* , a hash calculated from the link request packet, into the memory of forwarding nodes, which means that the communicating nodes can thereafter reach each other simply by referring to this *link id*.
implemented, but let’s first recap what purposes this methodology serves. We
first ensure that the node answering our request is actually the one we want to
communicate with, and not a malicious actor pretending to be so. At the same
time we establish an efficient encrypted channel. The setup of this is
relatively cheap in terms of bandwidth, so it can be used just for a short
exchange, and then recreated as needed, which will also rotate encryption keys.
The link can also be kept alive for longer periods of time, if this is more
suitable to the application. The procedure also inserts the *link id* , a hash
calculated from the link request packet, into the memory of forwarding nodes,
which means that the communicating nodes can thereafter reach each other simply
by referring to this *link id*.
The combined bandwidth cost of setting up a link is 3 packets totalling 297 bytes (more info in the The combined bandwidth cost of setting up a link is 3 packets totalling 297 bytes (more info in the [Binary Packet Format](#understanding-packetformat) section). The amount of bandwidth used on keeping a link open is practically negligible, at 0.45 bits per second. Even on a slow 1200 bits per second packet radio channel, 100 concurrent links will still leave 96% channel capacity for actual data.
[Binary Packet Format](#understanding-packetformat) section). The amount of bandwidth used on keeping
a link open is practically negligible, at 0.45 bits per second. Even on a slow 1200 bits per second packet
radio channel, 100 concurrent links will still leave 96% channel capacity for actual data.
#### Link Establishment in Detail #### Link Establishment in Detail
After exploring the basics of the announce mechanism, finding a path through the network, and an overview After exploring the basics of the announce mechanism, finding a path through the network, and an overview of the link establishment procedure, this section will go into greater detail about the Reticulum link establishment process.
of the link establishment procedure, this section will go into greater detail about the Reticulum link
establishment process.
The *link* in Reticulum terminology should not be viewed as a direct node-to-node link on the The *link* in Reticulum terminology should not be viewed as a direct node-to-node link on the physical layer, but as an abstract channel, that can be open for any amount of time, and can span an arbitrary number of hops, where information will be exchanged between two nodes.
physical layer, but as an abstract channel, that can be open for any amount of time, and can span
an arbitrary number of hops, where information will be exchanged between two nodes.
* When a node in the network wants to establish verified connectivity with another node, it * When a node in the network wants to establish verified connectivity with another node, it
will randomly generate a new X25519 private/public key pair. It then creates a *link request* will randomly generate a new X25519 private/public key pair. It then creates a *link request*
packet, and broadcast it. packet, and broadcast it.
<br/>
<br/>
*It should be noted that the X25519 public/private keypair mentioned above is two separate keypairs: *It should be noted that the X25519 public/private keypair mentioned above is two separate keypairs:
An encryption key pair, used for derivation of a shared symmetric key, and a signing key pair, used An encryption key pair, used for derivation of a shared symmetric key, and a signing key pair, used
for signing and verifying messages on the link. They are sent together over the wire, and can be for signing and verifying messages on the link. They are sent together over the wire, and can be
considered as single public key for simplicity in this explanation.* considered as single public key for simplicity in this explanation.*
<br/>
* The *link request* is addressed to the destination hash of the desired destination, and * The *link request* is addressed to the destination hash of the desired destination, and
contains the following data: The newly generated X25519 public key *LKi*. contains the following data: The newly generated X25519 public key *LKi*.
<br/>
* The broadcasted packet will be directed through the network according to the rules laid out * The broadcasted packet will be directed through the network according to the rules laid out
previously. previously.
<br/>
* Any node that forwards the link request will store a *link id* in it’s *link table* , along with the * Any node that forwards the link request will store a *link id* in it’s *link table* , along with the
amount of hops the packet had taken when received. The link id is a hash of the entire link amount of hops the packet had taken when received. The link id is a hash of the entire link
request packet. If the link request packet is not *proven* by the addressed destination within some request packet. If the link request packet is not *proven* by the addressed destination within some
set amount of time, the entry will be dropped from the *link table* again. set amount of time, the entry will be dropped from the *link table* again.
<br/>
* When the destination receives the link request packet, it will decide whether to accept the request. * When the destination receives the link request packet, it will decide whether to accept the request.
If it is accepted, the destination will also generate a new X25519 private/public key pair, and If it is accepted, the destination will also generate a new X25519 private/public key pair, and
perform a Diffie Hellman Key Exchange, deriving a new symmetric key that will be used to encrypt the perform a Diffie Hellman Key Exchange, deriving a new symmetric key that will be used to encrypt the
channel, once it has been established. channel, once it has been established.
<br/>
* A *link proof* packet is now constructed and transmitted over the network. This packet is * A *link proof* packet is now constructed and transmitted over the network. This packet is
addressed to the *link id* of the *link*. It contains the following data: The newly generated X25519 addressed to the *link id* of the *link*. It contains the following data: The newly generated X25519
public key *LKr* and an Ed25519 signature of the *link id* and *LKr* made by the *original signing key* of public key *LKr* and an Ed25519 signature of the *link id* and *LKr* made by the *original signing key* of
the addressed destination. the addressed destination.
<br/>
* By verifying this *link proof* packet, all nodes that originally transported the *link request* * By verifying this *link proof* packet, all nodes that originally transported the *link request*
packet to the destination from the originator can now verify that the intended destination received packet to the destination from the originator can now verify that the intended destination received
the request and accepted it, and that the path they chose for forwarding the request was valid. the request and accepted it, and that the path they chose for forwarding the request was valid.
@@ -506,34 +363,25 @@ an arbitrary number of hops, where information will be exchanged between two nod
An abstract bi-directional communication channel has now been established along a path in the network. An abstract bi-directional communication channel has now been established along a path in the network.
Packets can now be exchanged bi-directionally from either end of the link simply by adressing the Packets can now be exchanged bi-directionally from either end of the link simply by adressing the
packets to the *link id* of the link. packets to the *link id* of the link.
<br/>
* When the source receives the *proof* , it will know unequivocally that a verified path has been * When the source receives the *proof* , it will know unequivocally that a verified path has been
established to the destination. It can now also use the X25519 public key contained in the established to the destination. It can now also use the X25519 public key contained in the
*link proof* to perform it’s own Diffie Hellman Key Exchange and derive the symmetric key *link proof* to perform it’s own Diffie Hellman Key Exchange and derive the symmetric key
that is used to encrypt the channel. Information can now be exchanged reliably and securely. that is used to encrypt the channel. Information can now be exchanged reliably and securely.
<br/>
#### NOTE #### NOTE
It’s important to note that this methodology ensures that the source of the request does not need to It’s important to note that this methodology ensures that the source of the request does not need to reveal any identifying information about itself. **The link initiator remains completely anonymous**.
reveal any identifying information about itself. **The link initiator remains completely anonymous**.
When using *links*, Reticulum will automatically verify all data sent over the link, and can also When using *links*, Reticulum will automatically verify all data sent over the link, and can also automate retransmissions if *Resources* are used.
automate retransmissions if *Resources* are used.
### Resources ### Resources
For exchanging small amounts of data over a Reticulum network, the [Packet](reference.md#api-packet) interface For exchanging small amounts of data over a Reticulum network, the [Packet](reference.md#api-packet) interface is sufficient, but for exchanging data that would require many packets, an efficient way to coordinate the transfer is needed.
is sufficient, but for exchanging data that would require many packets, an efficient way to coordinate
the transfer is needed.
This is the purpose of the Reticulum [Resource](reference.md#api-resource). A *Resource* can automatically This is the purpose of the Reticulum [Resource](reference.md#api-resource). A *Resource* can automatically handle the reliable transfer of an arbitrary amount of data over an established [Link](reference.md#api-link). Resources can auto-compress data, will handle breaking the data into individual packets, sequencing the transfer, integrity verification and reassembling the data on the other end.
handle the reliable transfer of an arbitrary amount of data over an established [Link](reference.md#api-link).
Resources can auto-compress data, will handle breaking the data into individual packets, sequencing
the transfer, integrity verification and reassembling the data on the other end.
[Resources](reference.md#api-resource) are programmatically very simple to use, and only requires a few lines [Resources](reference.md#api-resource) are programmatically very simple to use, and only requires a few lines of codes to reliably transfer any amount of data. They can be used to transfer data stored in memory, or stream data directly from files.
of codes to reliably transfer any amount of data. They can be used to transfer data stored in memory,
or stream data directly from files.
## Network Identities ## Network Identities
@@ -568,8 +416,11 @@ While the current implementation focuses on interface discovery, the concept of
As the ecosystem evolves, Network Identities will facilitate: As the ecosystem evolves, Network Identities will facilitate:
* **Distributed Name Resolution:** A system where networks can publish name-to-identity mappings, allowing human-readable names to resolve without centralized servers. * **Distributed Name Resolution:** A system where networks can publish name-to-identity mappings, allowing human-readable names to resolve without centralized servers.
* **Service Publishing:** Networks will be able to announce specific capabilities, services, or information endpoints available publicly or to their members. * **Service Publishing:** Networks will be able to announce specific capabilities, services, or information endpoints available publicly or to their members.
* **Inter-Network Federation:** Trust relationships between different networks, allowing for seamless but managed flow of traffic and information across distinct administrative boundaries. * **Inter-Network Federation:** Trust relationships between different networks, allowing for seamless but managed flow of traffic and information across distinct administrative boundaries.
* **Distributed Blackhole Management:** A reputation-based system for blackhole list distribution, where trusted Network Identities can sign and publish lists of blackholed identities. This allows communities to collaboratively enforce security standards and filter spam or malicious identities across the parts of the wider mesh that they are responsible for. * **Distributed Blackhole Management:** A reputation-based system for blackhole list distribution, where trusted Network Identities can sign and publish lists of blackholed identities. This allows communities to collaboratively enforce security standards and filter spam or malicious identities across the parts of the wider mesh that they are responsible for.
By adopting the use of Network Identities now, you are preparing your infrastructure to be compatible with this future functionality. By adopting the use of Network Identities now, you are preparing your infrastructure to be compatible with this future functionality.
@@ -598,87 +449,61 @@ Once configured, your instances will automatically utilize this identity for sig
## Reference Setup ## Reference Setup
This section will detail a recommended *Reference Setup* for Reticulum. It is important to This section will detail a recommended *Reference Setup* for Reticulum. It is important to note that Reticulum is designed to be usable on more or less any computing device, and over more or less any medium that allows you to send and receive data, which satisfies some very low minimum requirements.
note that Reticulum is designed to be usable on more or less any computing device, and over more
or less any medium that allows you to send and receive data, which satisfies some very low
minimum requirements.
The communication channel must support at least half-duplex operation, and provide an average The communication channel must support at least half-duplex operation, and provide an average throughput of 5 bits per second or greater, and supports a physical layer MTU of 500 bytes. The Reticulum stack should be able to run on more or less any hardware that can provide a Python 3.x runtime environment.
throughput of 5 bits per second or greater, and supports a physical layer MTU of 500 bytes. The
Reticulum stack should be able to run on more or less any hardware that can provide a Python 3.x
runtime environment.
That being said, this reference setup has been outlined to provide a common platform for anyone That being said, this reference setup has been outlined to provide a common platform for anyone who wants to help in the development of Reticulum, and for everyone who wants to know a recommended setup to get started experimenting. A reference system consists of three parts:
who wants to help in the development of Reticulum, and for everyone who wants to know a
recommended setup to get started experimenting. A reference system consists of three parts:
* **An Interface Device** * **An Interface Device**
: Which provides access to the physical medium whereupon the communication Which provides access to the physical medium whereupon the communication
takes place, for example a radio with an integrated modem. A setup with a separate modem takes place, for example a radio with an integrated modem. A setup with a separate modem
connected to a radio would also be an interface device. connected to a radio would also be an interface device.
* **A Host Device**
: Some sort of computing device that can run the necessary software, communicate with the
interface device, and provide user interaction.
* **A Software Stack**
: The software implementing the Reticulum protocol and applications using it.
The reference setup can be considered a relatively stable platform to develop on, and also to start * **A Host Device**
building networks or applications on. While details of the implementation might change at the current stage of Some sort of computing device that can run the necessary software, communicate with the
development, it is the goal to maintain hardware compatibility for as long as entirely possible, and interface device, and provide user interaction.
the current reference setup has been determined to provide a functional platform for many years
into the future. The current Reference System Setup is as follows: * **A Software Stack**
The software implementing the Reticulum protocol and applications using it.
The reference setup can be considered a relatively stable platform to develop on, and also to start building networks or applications on. While details of the implementation might change at the current stage of development, it is the goal to maintain hardware compatibility for as long as entirely possible, and the current reference setup has been determined to provide a functional platform for many years into the future. The current Reference System Setup is as follows:
* **Interface Device** * **Interface Device**
: A data radio consisting of a LoRa radio module, and a microcontroller with open source A data radio consisting of a LoRa radio module, and a microcontroller with open source
firmware, that can connect to host devices via USB. It operates in either the 430, 868 or 900 firmware, that can connect to host devices via USB. It operates in either the 430, 868 or 900
MHz frequency bands. More details can be found on the [RNode Page](https://github.com/markqvist/rnode_firmware). MHz frequency bands. More details can be found on the [RNode Page](https://github.com/markqvist/rnode_firmware).
* **Host Device** * **Host Device**
: Any computer device running Linux and Python. A Raspberry Pi with a Debian based OS is Any computer device running Linux and Python. A Raspberry Pi with a Debian based OS is
a good place to start, but anything can be used. a good place to start, but anything can be used.
* **Software Stack** * **Software Stack**
: The most recently released Python Implementation of Reticulum, running on a Linux-based The most recently released Python Implementation of Reticulum, running on a Linux-based
operating system. operating system.
#### NOTE #### NOTE
To avoid confusion, it is very important to note, that the reference interface device **does not** To avoid confusion, it is very important to note, that the reference interface device **does not** use the LoRaWAN standard, but uses a custom MAC layer on top of the plain LoRa modulation! As such, you will need a plain LoRa radio module connected to a controller with the correct firmware. Full details on how to get or make such a device is available on the [RNode Page](https://github.com/markqvist/rnode_firmware).
use the LoRaWAN standard, but uses a custom MAC layer on top of the plain LoRa modulation! As such, you will
need a plain LoRa radio module connected to a controller with the correct firmware. Full details on how to
get or make such a device is available on the [RNode Page](https://github.com/markqvist/rnode_firmware).
With the current reference setup, it should be possible to get on a Reticulum network for around 100$ With the current reference setup, it should be possible to get on a Reticulum network for around 100$ even if you have none of the hardware already, and need to purchase everything.
even if you have none of the hardware already, and need to purchase everything.
This reference setup is of course just a recommendation for getting started easily, and you should This reference setup is of course just a recommendation for getting started easily, and you should tailor it to your own specific needs, or whatever hardware you have available.
tailor it to your own specific needs, or whatever hardware you have available.
## Protocol Specifics ## Protocol Specifics
This chapter will detail protocol specific information that is essential to the implementation of This chapter will detail protocol specific information that is essential to the implementation of Reticulum, but non-critical in understanding how the protocol works on a general level. It should be treated more as a reference than as essential reading.
Reticulum, but non-critical in understanding how the protocol works on a general level. It should be
treated more as a reference than as essential reading.
### Packet Prioritisation ### Packet Prioritisation
Currently, Reticulum is completely priority-agnostic regarding *general* traffic. All traffic is handled Currently, Reticulum is completely priority-agnostic regarding *general* traffic. All traffic is handled on a first-come, first-serve basis. Announce re-transmission and other maintenance traffic is handled according to the re-transmission times and priorities described earlier in this chapter.
on a first-come, first-serve basis. Announce re-transmission and other maintenance traffic is handled
according to the re-transmission times and priorities described earlier in this chapter.
### Interface Access Codes ### Interface Access Codes
Reticulum can create named virtual networks, and networks that are only accessible by knowing a preshared Reticulum can create named virtual networks, and networks that are only accessible by knowing a preshared passphrase. The configuration of this is detailed in the [Common Interface Options](interfaces.md#interfaces-options) section. To implement this feature, Reticulum uses the concept of Interface Access Codes, that are calculated and verified per-packet.
passphrase. The configuration of this is detailed in the [Common Interface Options](interfaces.md#interfaces-options)
section. To implement this feature, Reticulum uses the concept of Interface Access Codes, that are calculated
and verified per-packet.
An interface with a named virtual network or passphrase authentication enabled will derive a shared Ed25519 An interface with a named virtual network or passphrase authentication enabled will derive a shared Ed25519 signing identity, and for every outbound packet generate a signature of the entire packet. This signature is then inserted into the packet as an Interface Access Code before transmission. Depending on the speed and capabilities of the interface, the IFAC can be the full 512-bit Ed25519 signature, or a truncated version. Configured IFAC length can be inspected for all interfaces with the `rnstatus` utility.
signing identity, and for every outbound packet generate a signature of the entire packet. This signature is
then inserted into the packet as an Interface Access Code before transmission. Depending on the speed and
capabilities of the interface, the IFAC can be the full 512-bit Ed25519 signature, or a truncated version.
Configured IFAC length can be inspected for all interfaces with the `rnstatus` utility.
Upon receipt, the interface will check that the signature matches the expected value, and drop the packet if it Upon receipt, the interface will check that the signature matches the expected value, and drop the packet if it does not. This ensures that only packets sent with the correct naming and/or passphrase parameters are allowed to pass onto the network.
does not. This ensures that only packets sent with the correct naming and/or passphrase parameters are allowed to
pass onto the network.
### Wire Format ### Wire Format
@@ -716,25 +541,21 @@ IFAC Flag
open 0 Packet for publically accessible interface open 0 Packet for publically accessible interface
authenticated 1 Interface authentication is included in packet authenticated 1 Interface authentication is included in packet
Header Types Header Types
----------------- -----------------
type 1 0 Two byte header, one 16 byte address field type 1 0 Two byte header, one 16 byte address field
type 2 1 Two byte header, two 16 byte address fields type 2 1 Two byte header, two 16 byte address fields
Context Flag Context Flag
----------------- -----------------
unset 0 The context flag is used for various types unset 0 The context flag is used for various types
set 1 of signalling, depending on packet context set 1 of signalling, depending on packet context
Propagation Types Propagation Types
----------------- -----------------
broadcast 0 broadcast 0
transport 1 transport 1
Destination Types Destination Types
----------------- -----------------
single 00 single 00
@@ -742,7 +563,6 @@ group 01
plain 10 plain 10
link 11 link 11
Packet Types Packet Types
----------------- -----------------
data 00 data 00
@@ -750,7 +570,6 @@ announce 01
link request 10 link request 10
proof 11 proof 11
+- Packet Example -+ +- Packet Example -+
HEADER FIELD DESTINATION FIELDS CONTEXT FIELD DATA FIELD HEADER FIELD DESTINATION FIELDS CONTEXT FIELD DATA FIELD
@@ -765,7 +584,6 @@ proof 11
|+------------- Header Type = HEADER_2 (two byte header, two address fields) |+------------- Header Type = HEADER_2 (two byte header, two address fields)
+-------------- Access Codes = DISABLED +-------------- Access Codes = DISABLED
+- Packet Example -+ +- Packet Example -+
HEADER FIELD DESTINATION FIELD CONTEXT FIELD DATA FIELD HEADER FIELD DESTINATION FIELD CONTEXT FIELD DATA FIELD
@@ -780,7 +598,6 @@ proof 11
|+------------- Header Type = HEADER_1 (two byte header, one address field) |+------------- Header Type = HEADER_1 (two byte header, one address field)
+-------------- Access Codes = DISABLED +-------------- Access Codes = DISABLED
+- Packet Example -+ +- Packet Example -+
HEADER FIELD IFAC FIELD DESTINATION FIELD CONTEXT FIELD DATA FIELD HEADER FIELD IFAC FIELD DESTINATION FIELD CONTEXT FIELD DATA FIELD
@@ -795,7 +612,6 @@ proof 11
|+------------- Header Type = HEADER_1 (two byte header, one address field) |+------------- Header Type = HEADER_1 (two byte header, one address field)
+-------------- Access Codes = ENABLED +-------------- Access Codes = ENABLED
Size examples of different packet types Size examples of different packet types
--------------------------------------- ---------------------------------------
@@ -814,49 +630,65 @@ but excluding any interface access codes.
### Announce Propagation Rules ### Announce Propagation Rules
The following table illustrates the rules for automatically propagating announces The following table illustrates the rules for automatically propagating announces from one interface type to another, for all possible combinations. For the purpose of announce propagation, the *Full* and *Gateway* modes are identical.
from one interface type to another, for all possible combinations. For the purpose
of announce propagation, the *Full* and *Gateway* modes are identical. See the [Interface Modes](interfaces.md#interfaces-modes) section for a conceptual overview of the different interface modes, and how they are configured.
![image](graphics/if_mode_graph_b.png) ![image](graphics/if_mode_graph_b.png)
See the [Interface Modes](interfaces.md#interfaces-modes) section for a conceptual overview Or, represented in table form:
of the different interface modes, and how they are configured.
![image](graphics/if_mode_graph_c.png)
<!-- (.. code-block:: text) <!-- (.. code-block:: text)
Full ────── ✓ ──┐ ┌── ✓ ── Full Full ────── ✓ ──┐ ┌── ✓ ── Full
AP ──────── ✓ ──┼───> Full >───┼── ✕ ── AP AP ──────── ✓ ──┤ ├── ✕ ── AP
Boundary ── ✓ ──┤ ├── ✓ ── Boundary Boundary ── ✓ ──┼───> Full >───┼── ✓ ── Boundary
Internal ── ✓ ──┤ ├── ✓ ── Internal
Roaming ─── ✓ ──┘ └── ✓ ── Roaming Roaming ─── ✓ ──┘ └── ✓ ── Roaming
Full ────── ✕ ──┐ ┌── ✓ ── Full Full ────── ✕ ──┐ ┌── ✓ ── Full
AP ──────── ✕ ──┼────> AP >────┼── ✕ ── AP AP ──────── ✕ ──┤ ├── ✕ ── AP
Boundary ── ✕ ──┤ ├── ✓ ── Boundary Boundary ── ✕ ──┼────> AP >────┼── ✓ ── Boundary
Internal ── ✕ ──┤ ├── ✓ ── Internal
Roaming ─── ✕ ──┘ └── ✓ ── Roaming Roaming ─── ✕ ──┘ └── ✓ ── Roaming
Full ────── ✓ ──┐ ┌── ✓ ── Full Full ────── ✓ ──┐ ┌── ✓ ── Full
AP ──────── ✓ ──┼─> Roaming >──┼── ✕ ── AP AP ──────── ✓ ──┤ ├── ✕ ── AP
Boundary ── ✕ ──┤ ├── ✕ ── Boundary Boundary ── ✕ ──┼─> Roaming >──┼── ✕ ── Boundary
Internal ── ✕ ──┤ ├── ✓ ── Internal
Roaming ─── ✕ ──┘ └── ✕ ── Roaming Roaming ─── ✕ ──┘ └── ✕ ── Roaming
Full ────── ✓ ──┐ ┌── ✓ ── Full Full ────── ✓ ──┐ ┌── ✓ ── Full
AP ──────── ✓ ──┼─> Boundary >─┼── ✕ ── AP AP ──────── ✓ ──┤ ├── ✕ ── AP
Boundary ── ✓ ──┤ ├── ✓ ── Boundary Boundary ── ✓ ──┼─> Boundary >─┼── ✓ ── Boundary
Roaming ─── ✕ ──┘ └── ✕ ── Roaming --> Internal ── ✓ ──┤ ├── ✕ ── Internal
Roaming ─── ✕ ──┘ └── ✕ ── Roaming
Full ────── ✓ ──┐ ┌── ✓ ── Full
AP ──────── ✓ ──┤ ├── ✕ ── AP
Boundary ── ✕ ──┼─> Internal >─┼── ✓ ── Boundary
Internal ── ✓ ──┤ ├── ✓ ── Internal
Roaming ─── ✓ ──┘ └── ✕ ── Roaming
dest → Full AP Boundary Roaming Gateway Internal
source ↓
Full ✓ ✕ ✓ ✓ ✓ ✓
Gateway ✓ ✕ ✓ ✓ ✓ ✓
AP ✓ ✕ ✓ ✓ ✓ ✓
Boundary ✓ ✕ ✓ ✕ ✓ ✕
Internal ✓ ✕ ✓ ✕ ✓ ✓
Roaming ✓ ✕ ✕ ✕ ✓ ✓
✓ Will rebroadcast announce
✕ Will not rebroadcast announce -->
### Cryptographic Primitives ### Cryptographic Primitives
Reticulum uses a simple suite of efficient, strong and well-tested cryptographic Reticulum uses a simple suite of efficient, strong and well-tested cryptographic primitives, with widely available implementations that can be used both on general-purpose CPUs and on microcontrollers.
primitives, with widely available implementations that can be used both on
general-purpose CPUs and on microcontrollers.
One of the primary considerations for choosing this particular set of primitives is One of the primary considerations for choosing this particular set of primitives is that they can be implemented *safely* with relatively few pitfalls, on practically all current computing platforms.
that they can be implemented *safely* with relatively few pitfalls, on practically
all current computing platforms.
The primitives listed here **are authoritative**. Anything claiming to be Reticulum, The primitives listed here **are authoritative**. Anything claiming to be Reticulum, but not using these exact primitives **is not** Reticulum, and possibly an intentionally compromised or weakened clone. The utilised primitives are:
but not using these exact primitives **is not** Reticulum, and possibly an
intentionally compromised or weakened clone. The utilised primitives are:
* Ed25519 for signatures * Ed25519 for signatures
* X25519 for ECDH key exchanges * X25519 for ECDH key exchanges
@@ -870,29 +702,16 @@ intentionally compromised or weakened clone. The utilised primitives are:
* SHA-256 * SHA-256
* SHA-512 * SHA-512
In the default installation configuration, the `X25519`, `Ed25519` and `AES-256-CBC` In the default installation configuration, the `X25519`, `Ed25519` and `AES-256-CBC` primitives are provided by [OpenSSL](https://www.openssl.org/) (via the [PyCA/cryptography](https://github.com/pyca/cryptography) package). The hashing functions `SHA-256` and `SHA-512` are provided by the standard Python [hashlib](https://docs.python.org/3/library/hashlib.html). The `HKDF`, `HMAC`, `Token` primitives, and the `PKCS7` padding function are always provided by the following internal implementations:
primitives are provided by [OpenSSL](https://www.openssl.org/) (via the [PyCA/cryptography](https://github.com/pyca/cryptography)
package). The hashing functions `SHA-256` and `SHA-512` are provided by the standard
Python [hashlib](https://docs.python.org/3/library/hashlib.html). The `HKDF`, `HMAC`,
`Token` primitives, and the `PKCS7` padding function are always provided by the
following internal implementations:
- `RNS/Cryptography/HKDF.py` - `RNS/Cryptography/HKDF.py`
- `RNS/Cryptography/HMAC.py` - `RNS/Cryptography/HMAC.py`
- `RNS/Cryptography/Token.py` - `RNS/Cryptography/Token.py`
- `RNS/Cryptography/PKCS7.py` - `RNS/Cryptography/PKCS7.py`
Reticulum also includes a complete implementation of all necessary primitives in pure Python. Reticulum also includes a complete implementation of all necessary primitives in pure Python. If OpenSSL & PyCA are not available on the system when Reticulum is started, Reticulum will instead use the internal pure-python primitives. A trivial consequence of this is performance, with the OpenSSL backend being *much* faster. The most important consequence however, is the potential loss of security by using primitives that has not seen the same amount of scrutiny, testing and review as those from OpenSSL.
If OpenSSL & PyCA are not available on the system when Reticulum is started, Reticulum will
instead use the internal pure-python primitives. A trivial consequence of this is performance,
with the OpenSSL backend being *much* faster. The most important consequence however, is the
potential loss of security by using primitives that has not seen the same amount of scrutiny,
testing and review as those from OpenSSL.
Using the normal RNS installation procedures, it is not possible to install Reticulum on a Using the normal RNS installation procedures, it is not possible to install Reticulum on a system without the required OpenSSL primitives being available, and if they are not, they will be resolved and installed as a dependency. It is only possible to use the pure-python primitives by manually specifying this, for example by using the `rnspure` package.
system without the required OpenSSL primitives being available, and if they are not, they will
be resolved and installed as a dependency. It is only possible to use the pure-python primitives
by manually specifying this, for example by using the `rnspure` package.
#### WARNING #### WARNING
If you want to use the internal pure-python primitives, it is **highly advisable** that you If you want to use the internal pure-python primitives, it is **highly advisable** that you
+33 -43
View File
@@ -58,7 +58,6 @@ configuration file is created. The default configuration looks like this:
# configuration example, you can run the command: # configuration example, you can run the command:
# rnsd --exampleconfig # rnsd --exampleconfig
[reticulum] [reticulum]
# If you enable Transport, your system will route traffic # If you enable Transport, your system will route traffic
@@ -70,7 +69,6 @@ configuration file is created. The default configuration looks like this:
enable_transport = No enable_transport = No
# By default, the first program to launch the Reticulum # By default, the first program to launch the Reticulum
# Network Stack will create a shared instance, that other # Network Stack will create a shared instance, that other
# programs can communicate with. Only the shared instance # programs can communicate with. Only the shared instance
@@ -82,7 +80,6 @@ enable_transport = No
share_instance = Yes share_instance = Yes
# If you want to run multiple *different* shared instances # If you want to run multiple *different* shared instances
# on the same system, you will need to specify different # on the same system, you will need to specify different
# instance names for each. On platforms supporting domain # instance names for each. On platforms supporting domain
@@ -97,14 +94,12 @@ instance_name = default
# shared_instance_port = 37428 # shared_instance_port = 37428
# instance_control_port = 37429 # instance_control_port = 37429
# If you want to explicitly use TCP for shared instance # If you want to explicitly use TCP for shared instance
# communication, instead of domain sockets, this is also # communication, instead of domain sockets, this is also
# possible, by using the following option: # possible, by using the following option:
# shared_instance_type = tcp # shared_instance_type = tcp
# On systems where running instances may not have access # On systems where running instances may not have access
# to the same shared Reticulum configuration directory, # to the same shared Reticulum configuration directory,
# it is still possible to allow full interactivity for # it is still possible to allow full interactivity for
@@ -115,7 +110,6 @@ instance_name = default
# rpc_key = e5c032d3ec4e64a6aca9927ba8ab73336780f6d71790 # rpc_key = e5c032d3ec4e64a6aca9927ba8ab73336780f6d71790
# It is possible to allow remote management of Reticulum # It is possible to allow remote management of Reticulum
# systems using the various built-in utilities, such as # systems using the various built-in utilities, such as
# rnstatus and rnpath. You will need to specify one or # rnstatus and rnpath. You will need to specify one or
@@ -127,7 +121,6 @@ instance_name = default
# enable_remote_management = yes # enable_remote_management = yes
# remote_management_allowed = 9fb6d773498fb3feda407ed8ef2c3229, 2d882c5586e548d79b5af27bca1776dc # remote_management_allowed = 9fb6d773498fb3feda407ed8ef2c3229, 2d882c5586e548d79b5af27bca1776dc
# You can configure Reticulum to panic and forcibly close # You can configure Reticulum to panic and forcibly close
# if an unrecoverable interface error occurs, such as the # if an unrecoverable interface error occurs, such as the
# hardware device for an interface disappearing. This is # hardware device for an interface disappearing. This is
@@ -136,7 +129,6 @@ instance_name = default
# panic_on_interface_error = No # panic_on_interface_error = No
# When Transport is enabled, it is possible to allow the # When Transport is enabled, it is possible to allow the
# Transport Instance to respond to probe requests from # Transport Instance to respond to probe requests from
# the rnprobe utility. This can be a useful tool to test # the rnprobe utility. This can be a useful tool to test
@@ -147,7 +139,6 @@ instance_name = default
# respond_to_probes = No # respond_to_probes = No
[logging] [logging]
# Valid log levels are 0 through 7: # Valid log levels are 0 through 7:
# 0: Log only critical information # 0: Log only critical information
@@ -161,7 +152,6 @@ instance_name = default
loglevel = 4 loglevel = 4
# The interfaces section defines the physical and virtual # The interfaces section defines the physical and virtual
# interfaces Reticulum will use to communicate on. This # interfaces Reticulum will use to communicate on. This
# section will contain examples for a variety of interface # section will contain examples for a variety of interface
@@ -975,39 +965,35 @@ positional arguments:
destination hexadecimal hash of the destination to connect to destination hexadecimal hash of the destination to connect to
options: options:
-h, --help show this help message and exit -h, --help show this help message and exit
--config, -c CONFIG path to alternative Reticulum config directory --config, -c PATH path to config directory
--identity, -i IDENTITY --rnsconfig, -c PATH path to alternative Reticulum config directory
path to identity file to use --identity, -i IDENTITY path to identity file to use
-v, --verbose increase verbosity -v, --verbose increase verbosity
-q, --quiet decrease verbosity -q, --quiet decrease verbosity
-p, --print-identity print identity and destination info and exit -p, --print-identity print identity and destination info and exit
--version show program's version number and exit --version show program's version number and exit
-l, --listen listen (server) mode; any command specified after -- -l, --listen listen (server) mode; any command specified after --
will be used as the default command when the initiator will be used as the default command when the initiator
does not provide one or when remote command execution does not provide one or when remote command execution
is disabled; if no command is specified, the default is disabled; if no command is specified, the default
shell of the user running rnsh will be used shell of the user running rnsh will be used
-s, --service SERVICE -s, --service SERVICE service name for identity file if not the default
service name for identity file if not the default -b, --announce PERIOD announce on startup and every PERIOD seconds; specify
-b, --announce PERIOD 0 to announce on startup only
announce on startup and every PERIOD seconds; specify -a, --allowed HASH allow this identity to connect (may be specified
0 to announce on startup only multiple times); allowed identities can also be
-a, --allowed HASH allow this identity to connect (may be specified specified in ~/.rnsh/allowed_identities or
multiple times); allowed identities can also be ~/.config/rnsh/allowed_identities, one hash per line
specified in ~/.rnsh/allowed_identities or -n, --no-auth disable authentication (allow any identity to connect)
~/.config/rnsh/allowed_identities, one hash per line
-n, --no-auth disable authentication (allow any identity to connect)
-A, --remote-command-as-args -A, --remote-command-as-args
concatenate remote command to the argument list of the concatenate remote command to the argument list of the
default program or shell default program or shell
-C, --no-remote-command -C, --no-remote-command disable executing command lines received from the
disable executing command lines received from the remote initiator
remote initiator -N, --no-id disable identity announcement on connect
-N, --no-id disable identity announcement on connect -m, --mirror return with the exit code of the remote process
-m, --mirror return with the exit code of the remote process -w, --timeout SECONDS connect and request timeout in seconds
-w, --timeout SECONDS
connect and request timeout in seconds
When specifying a command to execute, separate rnsh options from the command When specifying a command to execute, separate rnsh options from the command
and its arguments with --. For example: and its arguments with --. For example:
@@ -1227,6 +1213,7 @@ This provides users and operators with control over what they want to allow *on
This functionality serves a dual purpose: This functionality serves a dual purpose:
* **For Individual Users:** It offers a simple way to maintain a quiet and efficient local network by manually blocking spammy or unwanted peers. * **For Individual Users:** It offers a simple way to maintain a quiet and efficient local network by manually blocking spammy or unwanted peers.
* **For Network Operators:** It enables the creation of federated, community-wide security standards. By publishing and sharing blackhole lists, operators can protect large infrastructures and distribute spam filtering rules across the mesh without manual intervention. * **For Network Operators:** It enables the creation of federated, community-wide security standards. By publishing and sharing blackhole lists, operators can protect large infrastructures and distribute spam filtering rules across the mesh without manual intervention.
### Local Blackhole Management ### Local Blackhole Management
@@ -1271,7 +1258,7 @@ $ rnpath -b
### Automated List Sourcing ### Automated List Sourcing
Manually blocking identities is effective for immediate threats, but maintaining an up-to-date blocklist for a large network is impractical. Reticulum supports **automated list sourcing**, allowing your node to subscribe to blackhole lists maintained by trusted peers, or a central authority you manage yourself. Manually blocking identities is effective for immediate threats and annoyances, but maintaining an up-to-date blocklist across many nodes on a large network is impractical. Reticulum supports **automated list sourcing**, allowing your node to subscribe to blackhole lists maintained by trusted peers, or a central authority you manage yourself.
#### WARNING #### WARNING
**Verify Before Subscribing!** Subscribing to a blackhole source is a powerful action that grants that source the ability to dictate who you can communicate with. Before adding a source to your configuration, verify that the maintainer aligns with your usage policy and values. Blindly subscribing to untrusted lists could inadvertently block legitimate peers or essential services. **Verify Before Subscribing!** Subscribing to a blackhole source is a powerful action that grants that source the ability to dictate who you can communicate with. Before adding a source to your configuration, verify that the maintainer aligns with your usage policy and values. Blindly subscribing to untrusted lists could inadvertently block legitimate peers or essential services.
@@ -1287,6 +1274,9 @@ To enable automated sourcing, add the `blackhole_sources` option to the `[reticu
... ...
# Automatically fetch blackhole lists from these trusted sources # Automatically fetch blackhole lists from these trusted sources
blackhole_sources = 521c87a83afb8f29e4455e77930b973b, 68a4aa91ac350c4087564e8a69f84e86 blackhole_sources = 521c87a83afb8f29e4455e77930b973b, 68a4aa91ac350c4087564e8a69f84e86
# Optional update interval, defaults to one hour
blackhole_update_interval = 60
... ...
``` ```
+4
View File
@@ -14,6 +14,10 @@ img[src*="if_mode_graph_b.png"] {
background-color: rgb(169, 177, 186); background-color: rgb(169, 177, 186);
} }
img[src*="if_mode_graph_c.png"] {
background-color: rgb(169, 177, 186);
}
dt.sig { dt.sig {
margin-bottom: 0.75rem; margin-bottom: 0.75rem;
margin-top: 1.75rem; margin-top: 1.75rem;
+11 -28
View File
@@ -4,18 +4,14 @@
Code Examples Code Examples
************* *************
A number of examples are included in the source distribution of Reticulum. A number of examples are included in the source distribution of Reticulum. You can use these examples to learn how to write your own programs.
You can use these examples to learn how to write your own programs.
.. _example-minimal: .. _example-minimal:
Minimal Minimal
======= =======
The *Minimal* example demonstrates the bare-minimum setup required to connect to The *Minimal* example demonstrates the bare-minimum setup required to connect to a Reticulum network from your program. In about five lines of code, you will have the Reticulum Network Stack initialised, and ready to pass traffic in your program.
a Reticulum network from your program. In about five lines of code, you will
have the Reticulum Network Stack initialised, and ready to pass traffic in your
program.
.. literalinclude:: ../../Examples/Minimal.py .. literalinclude:: ../../Examples/Minimal.py
@@ -26,9 +22,7 @@ This example can also be found at `<https://github.com/markqvist/Reticulum/blob/
Announce Announce
======== ========
The *Announce* example builds upon the previous example by exploring how to The *Announce* example builds upon the previous example by exploring how to announce a destination on the network, and how to let your program receive notifications about announces from relevant destinations.
announce a destination on the network, and how to let your program receive
notifications about announces from relevant destinations.
.. literalinclude:: ../../Examples/Announce.py .. literalinclude:: ../../Examples/Announce.py
@@ -38,8 +32,7 @@ This example can also be found at `<https://github.com/markqvist/Reticulum/blob/
Broadcast Broadcast
========= =========
The *Broadcast* example explores how to transmit plaintext broadcast messages The *Broadcast* example explores how to transmit plaintext broadcast messages over the network.
over the network.
.. literalinclude:: ../../Examples/Broadcast.py .. literalinclude:: ../../Examples/Broadcast.py
@@ -50,8 +43,7 @@ This example can also be found at `<https://github.com/markqvist/Reticulum/blob/
Echo Echo
==== ====
The *Echo* example demonstrates communication between two destinations using The *Echo* example demonstrates communication between two destinations using the Packet interface.
the Packet interface.
.. literalinclude:: ../../Examples/Echo.py .. literalinclude:: ../../Examples/Echo.py
@@ -62,8 +54,7 @@ This example can also be found at `<https://github.com/markqvist/Reticulum/blob/
Link Link
==== ====
The *Link* example explores establishing an encrypted link to a remote The *Link* example explores establishing an encrypted link to a remote destination, and passing traffic back and forth over the link.
destination, and passing traffic back and forth over the link.
.. literalinclude:: ../../Examples/Link.py .. literalinclude:: ../../Examples/Link.py
@@ -74,8 +65,7 @@ This example can also be found at `<https://github.com/markqvist/Reticulum/blob/
Identification Identification
============== ==============
The *Identify* example explores identifying an intiator of a link, once The *Identify* example explores identifying an intiator of a link, once the link has been established.
the link has been established.
.. literalinclude:: ../../Examples/Identify.py .. literalinclude:: ../../Examples/Identify.py
@@ -97,8 +87,7 @@ This example can also be found at `<https://github.com/markqvist/Reticulum/blob/
Channel Channel
======= =======
The *Channel* example explores using a ``Channel`` to send structured The *Channel* example explores using a ``Channel`` to send structured data between peers of a ``Link``.
data between peers of a ``Link``.
.. literalinclude:: ../../Examples/Channel.py .. literalinclude:: ../../Examples/Channel.py
@@ -107,8 +96,7 @@ This example can also be found at `<https://github.com/markqvist/Reticulum/blob/
Buffer Buffer
====== ======
The *Buffer* example explores using buffered readers and writers to send The *Buffer* example explores using buffered readers and writers to send binary data between peers of a ``Link``.
binary data between peers of a ``Link``.
.. literalinclude:: ../../Examples/Buffer.py .. literalinclude:: ../../Examples/Buffer.py
@@ -119,9 +107,7 @@ This example can also be found at `<https://github.com/markqvist/Reticulum/blob/
Filetransfer Filetransfer
============ ============
The *Filetransfer* example implements a basic file-server program that The *Filetransfer* example implements a basic file-server program that allow clients to connect and download files. The program uses the Resource interface to efficiently pass files of any size over a Reticulum :ref:`Link<api-link>`.
allow clients to connect and download files. The program uses the Resource
interface to efficiently pass files of any size over a Reticulum :ref:`Link<api-link>`.
.. literalinclude:: ../../Examples/Filetransfer.py .. literalinclude:: ../../Examples/Filetransfer.py
@@ -132,10 +118,7 @@ This example can also be found at `<https://github.com/markqvist/Reticulum/blob/
Custom Interfaces Custom Interfaces
================= =================
The *ExampleInterface* demonstrates creating custom interfaces for Reticulum. The *ExampleInterface* demonstrates creating custom interfaces for Reticulum. Any number of custom interfaces can be loaded and utilised by Reticulum, and will be fully on-par with natively included interfaces, including all supported :ref:`interface modes<interfaces-modes>` and :ref:`common configuration options<interfaces-options>`.
Any number of custom interfaces can be loaded and utilised by Reticulum, and
will be fully on-par with natively included interfaces, including all supported
:ref:`interface modes<interfaces-modes>` and :ref:`common configuration options<interfaces-options>`.
.. literalinclude:: ../../Examples/ExampleInterface.py .. literalinclude:: ../../Examples/ExampleInterface.py
+96 -290
View File
@@ -2,51 +2,38 @@
Getting Started Fast Getting Started Fast
******************** ********************
The best way to get started with the Reticulum Network Stack depends on what The best way to get started with the Reticulum Network Stack depends on what you want to do. This guide will outline sensible starting paths for different scenarios.
you want to do. This guide will outline sensible starting paths for different
scenarios.
Standalone Reticulum Installation Standalone Reticulum Installation
================================= =================================
If you simply want to install Reticulum and related utilities on a system, If you simply want to install Reticulum and related utilities on a system, the easiest way is via the ``pip`` package manager:
the easiest way is via the ``pip`` package manager:
.. code:: shell .. code:: shell
pip install rns pip install rns
If you do not already have pip installed, you can install it using the package manager If you do not already have pip installed, you can install it using the package manager of your system with a command like ``sudo apt install python3-pip``, ``sudo pamac install python-pip`` or similar.
of your system with a command like ``sudo apt install python3-pip``,
``sudo pamac install python-pip`` or similar.
You can also dowload the Reticulum release wheels from GitHub, or other release channels, You can also dowload the Reticulum release wheels from GitHub, or other release channels, and install them offline using ``pip``:
and install them offline using ``pip``:
.. code:: shell .. code:: shell
pip install ./rns-1.1.2-py3-none-any.whl pip install ./rns-1.1.2-py3-none-any.whl
On platforms that limit user package installation via ``pip``, you may need to manually On platforms that limit user package installation via ``pip``, you may need to manually allow this using the ``--break-system-packages`` command line flag when installing. This will not actually break any packages, unless you have installed Reticulum directly via your operating system's package manager.
allow this using the ``--break-system-packages`` command line flag when installing. This
will not actually break any packages, unless you have installed Reticulum directly via
your operating system's package manager.
.. code:: shell .. code:: shell
pip install rns --break-system-packages pip install rns --break-system-packages
For more detailed installation instructions, please see the For more detailed installation instructions, please see the :ref:`Platform-Specific Install Notes<install-guides>` section.
:ref:`Platform-Specific Install Notes<install-guides>` section.
After installation is complete, it might be helpful to refer to the After installation is complete, it might be helpful to refer to the :ref:`Using Reticulum on Your System<using-main>` chapter.
:ref:`Using Reticulum on Your System<using-main>` chapter.
Resolving Dependency & Installation Issues Resolving Dependency & Installation Issues
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
On some platforms, there may not be binary packages available for all dependencies, and On some platforms, there may not be binary packages available for all dependencies, and ``pip`` installation may fail with an error message. In these cases, the issue can usually be resolved by installing the development essentials packages for your platform:
``pip`` installation may fail with an error message. In these cases, the issue can usually
be resolved by installing the development essentials packages for your platform:
.. code:: shell .. code:: shell
@@ -59,69 +46,38 @@ be resolved by installing the development essentials packages for your platform:
# Fedora # Fedora
sudo dnf groupinstall "Development Tools" "Development Libraries" sudo dnf groupinstall "Development Tools" "Development Libraries"
With the base development packages installed, ``pip`` should be able to compile any missing With the base development packages installed, ``pip`` should be able to compile any missing dependencies from source, and complete installation even on platforms that don't have pre-compiled packages available.
dependencies from source, and complete installation even on platforms that don't have pre-
compiled packages available.
Try Using a Reticulum-based Program Try Using a Reticulum-based Program
============================================= ===================================
If you simply want to try using a program built with Reticulum, a :ref:`range of different If you simply want to try using a program built with Reticulum, a :ref:`range of different programs <software-main>` exist that allow basic communication and a various other useful functions, even over extremely low-bandwidth Reticulum networks.
programs <software-main>` exist that allow basic communication and a various other useful functions,
even over extremely low-bandwidth Reticulum networks.
Using the Included Utilities Using the Included Utilities
============================================= ============================
Reticulum comes with a range of included utilities that make it easier to Reticulum comes with a range of included utilities that make it easier to manage your network, check connectivity and make Reticulum available to other programs on your system.
manage your network, check connectivity and make Reticulum available to other
programs on your system.
You can use ``rnsd`` to run Reticulum as a background or foreground service, You can use ``rnsd`` to run Reticulum as a background or foreground service, and the ``rnstatus``, ``rnpath`` and ``rnprobe`` utilities to view and query network status and connectivity.
and the ``rnstatus``, ``rnpath`` and ``rnprobe`` utilities to view and query
network status and connectivity.
To learn more about these utility programs, have a look at the To learn more about these utility programs, have a look at the :ref:`Using Reticulum on Your System<using-main>` chapter of this manual.
:ref:`Using Reticulum on Your System<using-main>` chapter of this manual.
Creating a Network With Reticulum Creating a Network With Reticulum
============================================= =================================
To create a network, you will need to specify one or more *interfaces* for To create a network, you will need to specify one or more *interfaces* for Reticulum to use. This is done in the Reticulum configuration file, which by default is located at ``~/.reticulum/config``. You can get an example configuration file with all options via ``rnsd --exampleconfig``.
Reticulum to use. This is done in the Reticulum configuration file, which by
default is located at ``~/.reticulum/config``. You can get an example
configuration file with all options via ``rnsd --exampleconfig``.
When Reticulum is started for the first time, it will create a default When Reticulum is started for the first time, it will create a default configuration file, with one active interface. This default interface uses your existing Ethernet and WiFi networks (if any), and only allows you to communicate with other Reticulum peers within your local broadcast domains.
configuration file, with one active interface. This default interface uses
your existing Ethernet and WiFi networks (if any), and only allows you to
communicate with other Reticulum peers within your local broadcast domains.
To communicate further, you will have to add one or more interfaces. The default To communicate further, you will have to add one or more interfaces. The default configuration includes a number of examples, ranging from using TCP over the internet, to LoRa and Packet Radio interfaces.
configuration includes a number of examples, ranging from using TCP over the
internet, to LoRa and Packet Radio interfaces.
With Reticulum, you only need to configure what interfaces you want to communicate With Reticulum, you only need to configure what interfaces you want to communicate over. There is no need to configure address spaces, subnets, routing tables, or other things you might be used to from other network types.
over. There is no need to configure address spaces, subnets, routing tables,
or other things you might be used to from other network types.
Once Reticulum knows which interfaces it should use, it will automatically Once Reticulum knows which interfaces it should use, it will automatically discover topography and configure transport of data to any destinations it knows about.
discover topography and configure transport of data to any destinations it
knows about.
In situations where you already have an established WiFi or Ethernet network, and In situations where you already have an established WiFi or Ethernet network, and many devices that want to utilise the same external Reticulum network paths (for example over LoRa), it will often be sufficient to let one system act as a Reticulum gateway, by adding any external interfaces to the configuration of this system, and then enabling transport on it. Any other device on your local WiFi will then be able to connect to this wider Reticulum network just using the default (:ref:`AutoInterface<interfaces-auto>`) configuration.
many devices that want to utilise the same external Reticulum network paths (for example over
LoRa), it will often be sufficient to let one system act as a Reticulum gateway, by
adding any external interfaces to the configuration of this system, and then enabling transport on it. Any
other device on your local WiFi will then be able to connect to this wider Reticulum
network just using the default (:ref:`AutoInterface<interfaces-auto>`) configuration.
Possibly, the examples in the config file are enough to get you started. If Possibly, the examples in the config file are enough to get you started. If you want more information, you can read the :ref:`Building Networks<networks-main>` and :ref:`Interfaces<interfaces-main>` chapters of this manual, but most importantly, start with reading the next section, :ref:`Bootstrapping Connectivity<bootstrapping-connectivity>`, as this provides the most essential understanding of how to ensure reliable connectivity with a minimum of maintenance.
you want more information, you can read the :ref:`Building Networks<networks-main>`
and :ref:`Interfaces<interfaces-main>` chapters of this manual, but most importantly,
start with reading the next section, :ref:`Bootstrapping Connectivity<bootstrapping-connectivity>`,
as this provides the most essential understanding of how to ensure reliable
connectivity with a minimum of maintenance.
.. _bootstrapping-connectivity: .. _bootstrapping-connectivity:
@@ -216,20 +172,13 @@ As a good starting point, you can find interface definitions for connecting your
Hosting Public Entrypoints Hosting Public Entrypoints
========================== ==========================
If you want to help build a strong global interconnection backbone, you can host a public (or private) entry-point to a Reticulum network over the If you want to help build a strong global interconnection backbone, you can host a public (or private) entry-point to a Reticulum network over the Internet. This section offers some helpful pointers. Once you have set up your public entrypoint, it is a great idea to :ref:`make it discoverable over Reticulum<interfaces-discoverable>`.
Internet. This section offers some helpful pointers. Once you have set up your public entrypoint, it is a great idea to :ref:`make it discoverable over Reticulum<interfaces-discoverable>`.
You will need a machine, physical or virtual with a public IP address, that can be reached by other devices on the Internet. You will need a machine, physical or virtual with a public IP address, that can be reached by other devices on the Internet.
The most efficient and performant way to host a connectable entry-point supporting many The most efficient and performant way to host a connectable entry-point supporting many users is to use the ``BackboneInterface``. This interface type is fully compatible with the ``TCPClientInterface`` and ``TCPServerInterface`` types, but much faster and uses less system resources, allowing your device to handle thousands of connections even on small systems.
users is to use the ``BackboneInterface``. This interface type is fully compatible with
the ``TCPClientInterface`` and ``TCPServerInterface`` types, but much faster and uses
less system resources, allowing your device to handle thousands of connections even on
small systems.
It is also important to set your connectable interface to ``gateway`` mode, since this It is also important to set your connectable interface to ``gateway`` mode, since this will greatly improve network convergence time and path resolution for anyone connecting to your entry-point.
will greatly improve network convergence time and path resolution for anyone connecting
to your entry-point.
.. code:: ini .. code:: ini
@@ -251,8 +200,7 @@ to your entry-point.
announce_rate_penalty = 3600 announce_rate_penalty = 3600
announce_rate_grace = 6 announce_rate_grace = 6
If instead you want to make a private entry-point from the Internet, you can use the If instead you want to make a private entry-point from the Internet, you can use the :ref:`IFAC name and passphrase options<interfaces-options>` to secure your interface with a network name and passphrase.
:ref:`IFAC name and passphrase options<interfaces-options>` to secure your interface with a network name and passphrase.
.. code:: ini .. code:: ini
@@ -268,132 +216,79 @@ If instead you want to make a private entry-point from the Internet, you can use
network_name = private_ret network_name = private_ret
passphrase = 2owjajquafIanPecAc passphrase = 2owjajquafIanPecAc
If you are hosting an entry-point on an operating system that does not support If you are hosting an entry-point on an operating system that does not support ``BackboneInterface``, you can use ``TCPServerInterface`` instead, although it will not be as performant.
``BackboneInterface``, you can use ``TCPServerInterface`` instead, although it will
not be as performant.
Connecting Reticulum Instances Over the Internet Connecting Reticulum Instances Over the Internet
================================================ ================================================
Reticulum currently offers three interfaces suitable for connecting instances over the Internet: :ref:`Backbone<interfaces-backbone>`, :ref:`TCP<interfaces-tcps>` Reticulum currently offers three interfaces suitable for connecting instances over the Internet: :ref:`Backbone<interfaces-backbone>`, :ref:`TCP<interfaces-tcps>` and :ref:`I2P<interfaces-i2p>`. Each interface offers a different set of features, and Reticulum users should carefully choose the interface which best suites their needs.
and :ref:`I2P<interfaces-i2p>`. Each interface offers a different set of features, and Reticulum
users should carefully choose the interface which best suites their needs.
The ``TCPServerInterface`` allows users to host an instance accessible over TCP/IP. This The ``TCPServerInterface`` allows users to host an instance accessible over TCP/IP. This method is generally faster, lower latency, and more energy efficient than using ``I2PInterface``, however it also leaks more data about the server host.
method is generally faster, lower latency, and more energy efficient than using ``I2PInterface``,
however it also leaks more data about the server host.
The ``BackboneInterface`` is a very fast and efficient interface type available on POSIX operating The ``BackboneInterface`` is a very fast and efficient interface type available on POSIX operating systems, designed to handle thousands of connections simultaneously with low memory, processing and I/O overhead. It is fully compatible with the TCP-based interface types.
systems, designed to handle thousands of connections simultaneously with low memory, processing
and I/O overhead. It is fully compatible with the TCP-based interface types.
TCP connections reveal the IP address of both your instance and the server to anyone who can TCP connections reveal the IP address of both your instance and the server to anyone who can inspect the connection. Someone could use this information to determine your location or identity. Adversaries inspecting your packets may be able to record packet metadata like time of transmission and packet size. Even though Reticulum encrypts traffic, TCP does not, so an adversary may be able to use packet inspection to learn that a system is running Reticulum, and what other IP addresses connect to it. Hosting a publicly reachable instance over TCP also requires a publicly reachable IP address, which most Internet connections don't offer anymore.
inspect the connection. Someone could use this information to determine your location or identity. Adversaries
inspecting your packets may be able to record packet metadata like time of transmission and packet size.
Even though Reticulum encrypts traffic, TCP does not, so an adversary may be able to use
packet inspection to learn that a system is running Reticulum, and what other IP addresses connect to it.
Hosting a publicly reachable instance over TCP also requires a publicly reachable IP address,
which most Internet connections don't offer anymore.
The ``I2PInterface`` routes messages through the `Invisible Internet Protocol The ``I2PInterface`` routes messages through the `Invisible Internet Protocol (I2P) <https://geti2p.net/en/>`_. To use this interface, users must also run an I2P daemon in parallel to ``rnsd``. For always-on I2P nodes it is recommended to use `i2pd <https://i2pd.website/>`_.
(I2P) <https://geti2p.net/en/>`_. To use this interface, users must also run an I2P daemon in
parallel to ``rnsd``. For always-on I2P nodes it is recommended to use `i2pd <https://i2pd.website/>`_.
By default, I2P will encrypt and mix all traffic sent over the Internet, and By default, I2P will encrypt and mix all traffic sent over the Internet, and hide both the sender and receiver Reticulum instance IP addresses. Running an I2P node will also relay other I2P user's encrypted packets, which will use extra bandwidth and compute power, but also makes timing attacks and other forms of deep-packet-inspection much more difficult.
hide both the sender and receiver Reticulum instance IP addresses. Running an I2P node
will also relay other I2P user's encrypted packets, which will use extra
bandwidth and compute power, but also makes timing attacks and other forms of
deep-packet-inspection much more difficult.
I2P also allows users to host globally available Reticulum instances from non-public IP's and behind firewalls and NAT. I2P also allows users to host globally available Reticulum instances from non-public IP's and behind firewalls and NAT.
In general it is recommended to use an I2P node if you want to host a publicly accessible In general it is recommended to use an I2P node if you want to host a publicly accessible instance, while preserving anonymity. If you care more about performance, and a slightly easier setup, use TCP.
instance, while preserving anonymity. If you care more about performance, and a slightly
easier setup, use TCP.
Adding Radio Interfaces Adding Radio Interfaces
======================= =======================
Once you have Reticulum installed and working, you can add radio interfaces with Once you have Reticulum installed and working, you can add radio interfaces with any compatible hardware you have available. Reticulum supports a wide range of radio hardware, and if you already have any available, it is very likely that it will work with Reticulum. For information on how to configure this, see the :ref:`Interfaces<interfaces-main>` section of this manual.
any compatible hardware you have available. Reticulum supports a wide range of radio
hardware, and if you already have any available, it is very likely that it will
work with Reticulum. For information on how to configure this, see the
:ref:`Interfaces<interfaces-main>` section of this manual.
If you do not already have transceiver hardware available, you can easily and If you do not already have transceiver hardware available, you can easily and cheaply build an :ref:`RNode<rnode-main>`, which is a general-purpose long-range digital radio transceiver, that integrates easily with Reticulum.
cheaply build an :ref:`RNode<rnode-main>`, which is a general-purpose long-range
digital radio transceiver, that integrates easily with Reticulum.
To build one yourself requires installing a custom firmware on a supported LoRa To build one yourself requires installing a custom firmware on a supported LoRa development board with an auto-install script or web-based flasher. Please see the :ref:`Communications Hardware<hardware-main>` chapter for a guide. If you prefer purchasing a ready-made unit, you can refer to the :ref:`list of suppliers<rnode-suppliers>`.
development board with an auto-install script or web-based flasher.
Please see the :ref:`Communications Hardware<hardware-main>` chapter for a guide.
If you prefer purchasing a ready-made unit, you can refer to the
:ref:`list of suppliers<rnode-suppliers>`.
Other radio-based hardware interfaces are being developed and made available by Other radio-based hardware interfaces are being developed and made available by the broader Reticulum community. You can find more information on such topics over Reticulum-based information sharing systems.
the broader Reticulum community. You can find more information on such topics
over Reticulum-based information sharing systems.
If you have communications hardware that is not already supported by any of the If you have communications hardware that is not already supported by any of the :ref:`existing interface types<interfaces-main>`, it is easy to write (and potentially publish) a :ref:`custom interface module<interfaces-custom>` that makes it compatible with Reticulum.
:ref:`existing interface types<interfaces-main>`, it is easy to write (and potentially
publish) a :ref:`custom interface module<interfaces-custom>` that makes it compatible with Reticulum.
Creating and Using Custom Interfaces Creating and Using Custom Interfaces
==================================== ====================================
While Reticulum includes a flexible and broad range of built-in interfaces, these While Reticulum includes a flexible and broad range of built-in interfaces, these will not cover every conceivable type of communications hardware that Reticulum can potentially use to communicate.
will not cover every conceivable type of communications hardware that Reticulum
can potentially use to communicate.
It is therefore possible to easily write your own interface modules, that can be It is therefore possible to easily write your own interface modules, that can be loaded at run-time and used on-par with any of the built-in interface types.
loaded at run-time and used on-par with any of the built-in interface types.
For more information on this subject, and code examples to build on, please see For more information on this subject, and code examples to build on, please see the :ref:`Configuring Interfaces<interfaces-main>` chapter.
the :ref:`Configuring Interfaces<interfaces-main>` chapter.
Develop a Program with Reticulum Develop a Program with Reticulum
=========================================== ================================
If you want to develop programs that use Reticulum, the easiest way to get If you want to develop programs that use Reticulum, the easiest way to get started is to install the latest release of Reticulum via pip:
started is to install the latest release of Reticulum via pip:
.. code:: .. code::
pip install rns pip install rns
The above command will install Reticulum and dependencies, and you will be The above command will install Reticulum and dependencies, and you will be ready to import and use RNS in your own programs. The next step will most likely be to look at some :ref:`Example Programs<examples-main>`.
ready to import and use RNS in your own programs. The next step will most
likely be to look at some :ref:`Example Programs<examples-main>`.
The entire Reticulum API is documented in the :ref:`API Reference<api-main>` The entire Reticulum API is documented in the :ref:`API Reference<api-main>` chapter of this manual. Before diving in, it's probably a good idea to read this manual in full, but at least start with the :ref:`Understanding Reticulum<understanding-main>` chapter.
chapter of this manual. Before diving in, it's probably a good idea to read
this manual in full, but at least start with the :ref:`Understanding Reticulum<understanding-main>` chapter.
.. _install-guides: .. _install-guides:
Platform-Specific Install Notes Platform-Specific Install Notes
============================================== ===============================
Some platforms require a slightly different installation procedure, or have Some platforms require a slightly different installation procedure, or have various quirks that are worth being aware of. These are listed here.
various quirks that are worth being aware of. These are listed here.
Android Android
^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^
Reticulum can be used on Android in different ways. The easiest way to get Reticulum can be used on Android in different ways. The easiest way to get started is using an app like `Sideband <https://unsigned.io/sideband>`_.
started is using an app like `Sideband <https://unsigned.io/sideband>`_.
For more control and features, you can use Reticulum and related programs via For more control and features, you can use Reticulum and related programs via the `Termux app <https://termux.com/>`_, at the time of writing available on `F-droid <https://f-droid.org>`_.
the `Termux app <https://termux.com/>`_, at the time of writing available on
`F-droid <https://f-droid.org>`_.
Termux is a terminal emulator and Linux environment for Android based devices, Termux is a terminal emulator and Linux environment for Android based devices, which includes the ability to use many different programs and libraries, including Reticulum.
which includes the ability to use many different programs and libraries,
including Reticulum.
To use Reticulum within the Termux environment, you will need to install To use Reticulum within the Termux environment, you will need to install ``python`` and the ``python-cryptography`` library using ``pkg``, the package-manager build into Termux. After that, you can use ``pip`` to install Reticulum.
``python`` and the ``python-cryptography`` library using ``pkg``, the package-manager
build into Termux. After that, you can use ``pip`` to install Reticulum.
From within Termux, execute the following: From within Termux, execute the following:
@@ -412,9 +307,7 @@ From within Termux, execute the following:
# Install Reticulum # Install Reticulum
pip install rns pip install rns
If for some reason the ``python-cryptography`` package is not available for If for some reason the ``python-cryptography`` package is not available for your platform via the Termux package manager, you can attempt to build it locally on your device using the following command:
your platform via the Termux package manager, you can attempt to build it
locally on your device using the following command:
.. code:: shell .. code:: shell
@@ -441,16 +334,12 @@ locally on your device using the following command:
# Reticulum and any related software # Reticulum and any related software
pip install rns pip install rns
It is also possible to include Reticulum in apps compiled and distributed as It is also possible to include Reticulum in apps compiled and distributed as Android APKs. A detailed tutorial and example source code will be included here at a later point. Until then you can use the `Sideband source code <https://github.com/markqvist/sideband>`_ as an example and starting point.
Android APKs. A detailed tutorial and example source code will be included
here at a later point. Until then you can use the `Sideband source code <https://github.com/markqvist/sideband>`_ as an example and starting point.
ARM64 ARM64
^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^
On some architectures, including ARM64, not all dependencies have precompiled On some architectures, including ARM64, not all dependencies have precompiled binaries. On such systems, you may need to install ``python3-dev`` (or similar) before installing Reticulum or programs that depend on Reticulum.
binaries. On such systems, you may need to install ``python3-dev`` (or similar) before
installing Reticulum or programs that depend on Reticulum.
.. code:: shell .. code:: shell
@@ -466,12 +355,8 @@ on your system locally.
Debian Bookworm Debian Bookworm
^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^
On versions of Debian released after April 2023, it is no longer possible by default On versions of Debian released after April 2023, it is no longer possible by default to use ``pip`` to install packages onto your system. Unfortunately, you will need to use the replacement ``pipx`` command instead, which places installed packages in an isolated environment. This should not negatively affect Reticulum, but will not work for including and using Reticulum in your own scripts and programs.
to use ``pip`` to install packages onto your system. Unfortunately, you will need to
use the replacement ``pipx`` command instead, which places installed packages in an
isolated environment. This should not negatively affect Reticulum, but will not work
for including and using Reticulum in your own scripts and programs.
.. code:: shell .. code:: shell
@@ -484,42 +369,30 @@ for including and using Reticulum in your own scripts and programs.
# Install Reticulum # Install Reticulum
pipx install rns pipx install rns
Alternatively, you can restore normal behaviour to ``pip`` by creating or editing Alternatively, you can restore normal behaviour to ``pip`` by creating or editing the configuration file located at ``~/.config/pip/pip.conf``, and adding the following section:
the configuration file located at ``~/.config/pip/pip.conf``, and adding the
following section:
.. code:: ini .. code:: ini
[global] [global]
break-system-packages = true break-system-packages = true
For a one-shot installation of Reticulum, without globally enabling the ``break-system-packages`` For a one-shot installation of Reticulum, without globally enabling the ``break-system-packages`` option, you can use the following command:
option, you can use the following command:
.. code:: shell .. code:: shell
pip install rns --break-system-packages pip install rns --break-system-packages
.. note:: .. note::
The ``--break-system-packages`` directive is a somewhat misleading choice The ``--break-system-packages`` directive is a somewhat misleading choice of words. Setting it will of course not break any system packages, but will simply allow installing ``pip`` packages user- and system-wide. While this *could* in rare cases lead to version conflicts, it does not generally pose any problems, especially not in the case of installing Reticulum.
of words. Setting it will of course not break any system packages, but will simply
allow installing ``pip`` packages user- and system-wide. While this *could* in rare
cases lead to version conflicts, it does not generally pose any problems, especially
not in the case of installing Reticulum.
MacOS MacOS
^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^
To install Reticulum on macOS, you will need to have Python and the ``pip`` package To install Reticulum on macOS, you will need to have Python and the ``pip`` package manager installed.
manager installed.
Systems running macOS can vary quite widely in whether or not Python is pre-installed, Systems running macOS can vary quite widely in whether or not Python is pre-installed, and if it is, which version is installed, and whether the ``pip`` package manager is also installed and set up. If in doubt, you can `download and install <https://www.python.org/downloads/>`_ Python manually.
and if it is, which version is installed, and whether the ``pip`` package manager is
also installed and set up. If in doubt, you can `download and install <https://www.python.org/downloads/>`_
Python manually.
When Python and ``pip`` is available on your system, simply open a terminal window When Python and ``pip`` is available on your system, simply open a terminal window and use one of the following commands:
and use one of the following commands:
.. code:: shell .. code:: shell
@@ -531,16 +404,9 @@ and use one of the following commands:
pip3 install rns --break-system-packages pip3 install rns --break-system-packages
.. note:: .. note::
The ``--break-system-packages`` directive is a somewhat misleading choice The ``--break-system-packages`` directive is a somewhat misleading choice of words. Setting it will of course not break any system packages, but will simply allow installing ``pip`` packages user- and system-wide. While this *could* in rare cases lead to version conflicts, it does not generally pose any problems, especially not in the case of installing Reticulum.
of words. Setting it will of course not break any system packages, but will simply
allow installing ``pip`` packages user- and system-wide. While this *could* in rare
cases lead to version conflicts, it does not generally pose any problems, especially
not in the case of installing Reticulum.
Additionally, some version combinations of macOS and Python require you to Additionally, some version combinations of macOS and Python require you to manually add your installed ``pip`` packages directory to your `PATH` environment variable, before you can use installed commands in your terminal. Usually, adding the following line to your shell init script (for example ``~/.zshrc``) will be enough:
manually add your installed ``pip`` packages directory to your `PATH` environment
variable, before you can use installed commands in your terminal. Usually, adding
the following line to your shell init script (for example ``~/.zshrc``) will be enough:
.. code:: shell .. code:: shell
@@ -550,20 +416,13 @@ Adjust Python version and shell init script location according to your system.
OpenWRT OpenWRT
^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^
On OpenWRT systems with sufficient storage and memory, you can install On OpenWRT systems with sufficient storage and memory, you can install Reticulum and related utilities using the `opkg` package manager and `pip`.
Reticulum and related utilities using the `opkg` package manager and `pip`.
.. note:: .. note::
At the time of releasing this manual, work is underway to create pre-built Reticulum packages for OpenWRT, with full configuration, service and ``uci`` integration. Please see the `feed-reticulum <https://github.com/gretel/feed-reticulum>`_ and `reticulum-openwrt <https://github.com/gretel/reticulum-openwrt>`_ repositories for more information.
At the time of releasing this manual, work is underway to create pre-built To install Reticulum on OpenWRT, first log into a command line session, and then use the following instructions:
Reticulum packages for OpenWRT, with full configuration, service
and ``uci`` integration. Please see the `feed-reticulum <https://github.com/gretel/feed-reticulum>`_
and `reticulum-openwrt <https://github.com/gretel/reticulum-openwrt>`_
repositories for more information.
To install Reticulum on OpenWRT, first log into a command line session, and
then use the following instructions:
.. code:: shell .. code:: shell
@@ -577,30 +436,15 @@ then use the following instructions:
rnsd -vvv rnsd -vvv
.. note:: .. note::
The above instructions have been verified and tested on OpenWRT 21.02 only. It is likely that other versions may require slightly altered installation commands or package names. You will also need enough free space in your overlay FS, and enough free RAM to actually run Reticulum and any related programs and utilities.
The above instructions have been verified and tested on OpenWRT 21.02 only.
It is likely that other versions may require slightly altered installation
commands or package names. You will also need enough free space in your
overlay FS, and enough free RAM to actually run Reticulum and any related
programs and utilities.
Depending on your device configuration, you may need to adjust firewall rules Depending on your device configuration, you may need to adjust firewall rules for Reticulum connectivity to and from your device to work. Until proper packaging is ready, you will also need to manually create a service or startup script to automatically laucnh Reticulum at boot time.
for Reticulum connectivity to and from your device to work. Until proper
packaging is ready, you will also need to manually create a service or startup
script to automatically laucnh Reticulum at boot time.
Please also note that the `AutoInterface` requires link-local IPv6 addresses Please also note that the `AutoInterface` requires link-local IPv6 addresses to be enabled for any Ethernet and WiFi devices you intend to use. If ``ip a`` shows an address starting with ``fe80::`` for the device in question, ``AutoInterface`` should work for that device.
to be enabled for any Ethernet and WiFi devices you intend to use. If ``ip a``
shows an address starting with ``fe80::`` for the device in question,
``AutoInterface`` should work for that device.
Raspberry Pi Raspberry Pi
^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^
It is currently recommended to use a 64-bit version of the Raspberry Pi OS It is currently recommended to use a 64-bit version of the Raspberry Pi OS if you want to run Reticulum on Raspberry Pi computers, since 32-bit versions don't always have packages available for some dependencies. If Python and the `pip` package manager is not already installed, do that first, and then install Reticulum using `pip`.
if you want to run Reticulum on Raspberry Pi computers, since 32-bit versions
don't always have packages available for some dependencies. If Python and the
`pip` package manager is not already installed, do that first, and then
install Reticulum using `pip`.
.. code:: shell .. code:: shell
@@ -611,22 +455,14 @@ install Reticulum using `pip`.
pip install rns --break-system-packages pip install rns --break-system-packages
.. note:: .. note::
The ``--break-system-packages`` directive is a somewhat misleading choice The ``--break-system-packages`` directive is a somewhat misleading choice of words. Setting it will of course not break any system packages, but will simply allow installing ``pip`` packages user- and system-wide. While this *could* in rare cases lead to version conflicts, it does not generally pose any problems, especially not in the case of installing Reticulum.
of words. Setting it will of course not break any system packages, but will simply
allow installing ``pip`` packages user- and system-wide. While this *could* in rare
cases lead to version conflicts, it does not generally pose any problems, especially
not in the case of installing Reticulum.
While it is possible to install and run Reticulum on 32-bit Rasperry Pi OSes, While it is possible to install and run Reticulum on 32-bit Rasperry Pi OSes, it will require manually configuring and installing required build dependencies, and is not detailed in this manual.
it will require manually configuring and installing required build dependencies,
and is not detailed in this manual.
RISC-V RISC-V
^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^
On some architectures, including RISC-V, not all dependencies have precompiled On some architectures, including RISC-V, not all dependencies have precompiled binaries. On such systems, you may need to install ``python3-dev`` (or similar) before installing Reticulum or programs that depend on Reticulum.
binaries. On such systems, you may need to install ``python3-dev`` (or similar) before
installing Reticulum or programs that depend on Reticulum.
.. code:: shell .. code:: shell
@@ -637,17 +473,12 @@ installing Reticulum or programs that depend on Reticulum.
# Install Reticulum # Install Reticulum
python3 -m pip install rns python3 -m pip install rns
With these packages installed, ``pip`` will be able to build any missing dependencies With these packages installed, ``pip`` will be able to build any missing dependencies on your system locally.
on your system locally.
Ubuntu Lunar Ubuntu Lunar
^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^
On versions of Ubuntu released after April 2023, it is no longer possible by default On versions of Ubuntu released after April 2023, it is no longer possible by default to use ``pip`` to install packages onto your system. Unfortunately, you will need to use the replacement ``pipx`` command instead, which places installed packages in an isolated environment. This should not negatively affect Reticulum, but will not work for including and using Reticulum in your own scripts and programs.
to use ``pip`` to install packages onto your system. Unfortunately, you will need to
use the replacement ``pipx`` command instead, which places installed packages in an
isolated environment. This should not negatively affect Reticulum, but will not work
for including and using Reticulum in your own scripts and programs.
.. code:: shell .. code:: shell
@@ -660,42 +491,29 @@ for including and using Reticulum in your own scripts and programs.
# Install Reticulum # Install Reticulum
pipx install rns pipx install rns
Alternatively, you can restore normal behaviour to ``pip`` by creating or editing Alternatively, you can restore normal behaviour to ``pip`` by creating or editing the configuration file located at ``~/.config/pip/pip.conf``, and adding the following section:
the configuration file located at ``~/.config/pip/pip.conf``, and adding the
following section:
.. code:: text .. code:: text
[global] [global]
break-system-packages = true break-system-packages = true
For a one-shot installation of Reticulum, without globally enabling the ``break-system-packages`` For a one-shot installation of Reticulum, without globally enabling the ``break-system-packages`` option, you can use the following command:
option, you can use the following command:
.. code:: text .. code:: text
pip install rns --break-system-packages pip install rns --break-system-packages
.. note:: .. note::
The ``--break-system-packages`` directive is a somewhat misleading choice The ``--break-system-packages`` directive is a somewhat misleading choice of words. Setting it will of course not break any system packages, but will simply allow installing ``pip`` packages user- and system-wide. While this *could* in rare cases lead to version conflicts, it does not generally pose any problems, especially not in the case of installing Reticulum.
of words. Setting it will of course not break any system packages, but will simply
allow installing ``pip`` packages user- and system-wide. While this *could* in rare
cases lead to version conflicts, it does not generally pose any problems, especially
not in the case of installing Reticulum.
Windows Windows
^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^
On Windows operating systems, the easiest way to install Reticulum is by using the On Windows operating systems, the easiest way to install Reticulum is by using the ``pip`` package manager from the command line (either the command prompt or Windows Powershell).
``pip`` package manager from the command line (either the command prompt or Windows
Powershell).
If you don't already have Python installed, `download and install Python <https://www.python.org/downloads/>`_. If you don't already have Python installed, `download and install Python <https://www.python.org/downloads/>`_. At the time of publication of this manual, the recommended version is `Python 3.12.7 <https://www.python.org/downloads/release/python-3127>`_.
At the time of publication of this manual, the recommended version is `Python 3.12.7 <https://www.python.org/downloads/release/python-3127>`_.
**Important!** When asked by the installer, make sure to add the Python program to **Important!** When asked by the installer, make sure to add the Python program to your PATH environment variables. If you don't do this, you will not be able to use the ``pip`` installer, or run the included Reticulum utility programs (such as ``rnsd`` and ``rnstatus``) from the command line.
your PATH environment variables. If you don't do this, you will not be able to
use the ``pip`` installer, or run the included Reticulum utility programs (such as
``rnsd`` and ``rnstatus``) from the command line.
After installing Python, open the command prompt or Windows Powershell, and type: After installing Python, open the command prompt or Windows Powershell, and type:
@@ -703,11 +521,10 @@ After installing Python, open the command prompt or Windows Powershell, and type
pip install rns pip install rns
You can now use Reticulum and all included utility programs directly from your You can now use Reticulum and all included utility programs directly from your preferred command line interface.
preferred command line interface.
Pure-Python Reticulum Pure-Python Reticulum
============================================== =====================
.. warning:: .. warning::
If you use the ``rnspure`` package to run Reticulum on systems that If you use the ``rnspure`` package to run Reticulum on systems that
@@ -715,17 +532,6 @@ Pure-Python Reticulum
important that you read and understand the :ref:`Cryptographic Primitives <understanding-primitives>` important that you read and understand the :ref:`Cryptographic Primitives <understanding-primitives>`
section of this manual. section of this manual.
In some rare cases, and on more obscure system types, it is not possible to In some rare cases, and on more obscure system types, it is not possible to install one or more dependencies. In such situations, you can use the ``rnspure`` package instead of the ``rns`` package, or use ``pip`` with the ``--no-dependencies`` command-line option. The ``rnspure`` package requires no external dependencies for installation. Please note that the actual contents of the ``rns`` and ``rnspure`` packages are *completely identical*. The only difference is that the ``rnspure`` package lists no dependencies required for installation.
install one or more dependencies. In such situations,
you can use the ``rnspure`` package instead of the ``rns`` package, or use ``pip``
with the ``--no-dependencies`` command-line option. The ``rnspure``
package requires no external dependencies for installation. Please note that the
actual contents of the ``rns`` and ``rnspure`` packages are *completely identical*.
The only difference is that the ``rnspure`` package lists no dependencies required
for installation.
No matter how Reticulum is installed and started, it will load external dependencies No matter how Reticulum is installed and started, it will load external dependencies only if they are *needed* and *available*. If for example you want to use Reticulum on a system that cannot support ``pyserial``, it is perfectly possible to do so using the `rnspure` package, but Reticulum will not be able to use serial-based interfaces. All other available modules will still be loaded when needed.
only if they are *needed* and *available*. If for example you want to use Reticulum
on a system that cannot support ``pyserial``, it is perfectly possible to do so using
the `rnspure` package, but Reticulum will not be able to use serial-based interfaces.
All other available modules will still be loaded when needed.
+150 -14
View File
@@ -853,10 +853,28 @@ Or to retrieve all source archives:
If your pattern contains no wildcard characters, it must match an artifact name exactly, which is useful for fetching single, specific artifacts. When a pattern matches multiple artifacts, all matched files are fetched and verified. If no artifacts match the pattern, the fetch aborts with an error indicating no matches were found. If your pattern contains no wildcard characters, it must match an artifact name exactly, which is useful for fetching single, specific artifacts. When a pattern matches multiple artifacts, all matched files are fetched and verified. If no artifacts match the pattern, the fetch aborts with an error indicating no matches were found.
**Offline Verification** Offline Verification
--------------------
Because the release manifest contains embedded signatures, you can verify the integrity of release artifacts offline, without connecting to the repository node. The ``rnid`` and ``rngit`` utilities can validate artifact signatures against ``.rsg`` and manifest files. Because the release manifest contains embedded signatures, you can verify the integrity of release artifacts offline, without connecting to the repository node. The ``rnid`` and ``rngit`` utilities can validate artifact signatures against ``.rsg`` and manifest files.
**Using a release manifest:**
Ensure the release manifest is located in the same directory as the release artifacts, then run:
.. code:: text
# Verify all artifacts in the manifest
$ rngit release myapp-1.2.0.rsm verify
# Or, verify only specific artifacts
$ rngit release myapp-1.2.0.rsm verify "latest:*.whl"
This will load the manifest, and verify all files currently on-disk, but will not attempt to fetch the latest release manifest from the origin, or update local files to match it.
.. note::
The ``verify`` operation is functionally equivalent to using the ``fetch`` operation with the ``--offline`` flag, and they can be used interchangably.
**For individual files:** **For individual files:**
Ensure the ``.rsg`` signature is located in the same directory as the release artifact, then run: Ensure the ``.rsg`` signature is located in the same directory as the release artifact, then run:
@@ -867,16 +885,6 @@ Ensure the ``.rsg`` signature is located in the same directory as the release ar
This validates that the artifact file matches the signature created during the release process. Combined with the manifest's own signature, this provides end-to-end verification from the original release creation to the final installation. This validates that the artifact file matches the signature created during the release process. Combined with the manifest's own signature, this provides end-to-end verification from the original release creation to the final installation.
**For a complete release:**
Ensure the release manifest is located in the same directory as the release artifacts, then run:
.. code:: text
$ rngit release myapp-1.2.0.rsm fetch --offline
This will load the manifest, and verify all files currently on-disk, but will not attempt to fetch the latest release manifest from the origin, or update local files to match it.
.. _git-release-create: .. _git-release-create:
Creating Signed Releases Creating Signed Releases
@@ -886,7 +894,7 @@ Reticulum and the ``rngit`` system makes it easy to create signed releases that
1. Generates an Ed25519 signature for each artifact file using your identity's signing key 1. Generates an Ed25519 signature for each artifact file using your identity's signing key
2. Creates ``.rsg`` signature files alongside each artifact in your distribution directory 2. Creates ``.rsg`` signature files alongside each artifact in your distribution directory
3. Constructs a signed release manifest (``manifest.rsm``) containing metadata, an artifact list, and embedded signatures 3. Constructs a signed ``manifest.rsm`` release manifest containing metadata, an artifact list, and embedded signatures
4. Transmits both artifacts, signatures and manifest to the remote node specified as release origin 4. Transmits both artifacts, signatures and manifest to the remote node specified as release origin
As an example, to create and publish a release from all files in the folder named ``dist``, simply run: As an example, to create and publish a release from all files in the folder named ``dist``, simply run:
@@ -1318,7 +1326,7 @@ Each document is a numbered directory containing:
**Nomad Network Interface** **Nomad Network Interface**
When the Nomad Network page node is enabled, work documents are viewable through the web interface. The work page lists all documents with their status, and clicking a document shows its full content and updates. When the Nomad Network page node is enabled, work documents are viewable through the nomadnet interface. The work page lists all documents with their status, and clicking a document shows its full content and updates.
Cryptographic Attribution Cryptographic Attribution
------------------------- -------------------------
@@ -1373,4 +1381,132 @@ This cryptographic provenance is particularly valuable for distributed teams ope
-d, --id ID document ID -d, --id ID document ID
-v, --verbose -v, --verbose
-q, --quiet -q, --quiet
--version show program's version number and exit --version show program's version number and exit
.. _git-commit-signing:
Commit Signing
==============
The ``rngit`` system includes ``rngcs``, a Git commit signing and validation shim that enables commit signing and validation using Reticulum identities. By hooking into Git's SSH-based signing format, commits can be signed and verified using Reticulum identity keys directly.
Unlike traditional GPG and SSH-based commit signing, which relies on centralized keyservers, cumbersome co-signing procedures or manual per-signer setup, Reticulum commit signing uses self-contained RSG signatures, that can be deterministically resolved to Reticulum identity hashes.
This enables offline verification with no external infrastructure. The signature itself contains everything needed to cryptographically verify the signer's Reticulum identity and that the commit was signed correctly by the claimed identity.
Prerequisites
-------------
Before you can sign commits, you need a Reticulum identity with a private key. If you don't already have one, you can generate it using ``rnid``:
.. code:: text
$ rnid -g ~/.rngit/client_identity
New identity <1a54d64db7e8beca6f2c6cd17b0cb479> written to /home/user/.rngit/client_identity
The identity file must contain the private key to be usable for signing. The corresponding Reticulum identity hash will be used as the commit author identity.
Configuration
-------------
Git must be configured to use SSH-format signatures with the ``rngcs`` signing shim, which is included in RNS. You can configure this either globally or per-repository.
**Global Configuration**
Enabling Reticulum commit signing for all repositories is as simple as:
.. code:: text
$ git config --global gpg.format ssh
$ git config --global gpg.ssh.program rngcs
$ git config --global gpg.ssh.allowedsignersfile none
$ git config --global user.signingKey ~/.rngit/client_identity
With this configuration, all commits you sign with ``git commit -S`` will use your Reticulum identity.
.. note::
The ``gpg.ssh.allowedsignersfile`` configuration key **must** be *set* for ``git`` to allow invoking the signing and verification shim. It is not actually used by ``rngcs``, and can be set to an arbitrary value. All validation operations happen exclusively based on the information in the embedded RSG data.
**Per-Repository Configuration**
To enable signing only for a specific repository:
.. code:: text
$ cd /path/to/repository
$ git config --local gpg.format ssh
$ git config --local gpg.ssh.program rngcs
$ git config --local gpg.ssh.allowedsignersfile none
$ git config --local user.signingKey ~/.rngit/client_identity
This is useful when you want to use different identities for different projects, or when only specific repositories require signed commits.
Author Identity Binding
-----------------------
For the signature to be valid, the Git author email **must** match the Reticulum identity hash of the signing key. You can configure this using a command like the following:
.. code:: text
$ git config --global user.email "1a54d64db7e8beca6f2c6cd17b0cb479"
When ``rngcs`` verifies a commit, it extracts both the Git author field of the signed commit message and the signer identity from the RSG signature, ensuring they match. This binding is necessary to prevent identity spoofing. If someone crafts a commit with your identity hash in the author field but signs with a different key, verification will fail.
Signing Commits
---------------
Once configured, sign commits using the standard Git ``-S`` flag:
.. code:: text
$ git commit -S -m "Refactored module"
[master 8f7e6d5] Refactored module
This will create a self-contained RSG-formatted signature, encode the RSG payload using base64, and wrap it in an ASCII-armored SSH-formatted signature block. The signature is then stored in the commit object's signature header and includes:
- The SHA256 hash of the commit content
- The signer's Reticulum identity hash
- The signer's public key
- The actual signature of the complete envelope
Validating Commit Signatures
----------------------------
Commits are automatically validated when using ``git log --show-signature`` or ``git show --show-signature``. The ``rngcs`` shim handles all verification operations. If any step fails, verification fails and Git displays an error.
To view signature information for commits, use Git's standard ``--show-signature`` option:
.. code:: text
$ git log --show-signature
commit 8f7e6d5c8f7e6d5c8f7e6d5c8f7e6d5c8f7e6d5
Good "git" signature for commit, signed with Reticulum Identity key <1a54d64db7e8beca6f2c6cd17b0cb479>
Author: Developer <1a54d64db7e8beca6f2c6cd17b0cb479>
Date: Mon Jan 15 09:30:00 2026 +0100
Refactored module
The output shows whether the commit signature is valid, and whether the author field matches the signing identity.
.. tip::
If you want to display both the identity hash and LXMF address for authors, you can generate a ``.mailmap`` file that resolves identities to LXMF addresses with the following script:
.. code::
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd $DIR
id_regex="<([0-9a-f]{32})( .*)*>"
extract_id="s/.*$id_regex/\1/g"
rm -f .mailmap
git shortlog -se | grep -Ee "$id_regex" | sed -r "$extract_id" | while read -r id ; do
if lxmf=$(rnid -i $id -H lxmf.delivery | grep -Ee "destination for this Identity is" | sed -r "$extract_id"); then
echo "<$id lxmf:$lxmf> <$id>" >> .mailmap
fi
done
Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.
+77 -1
View File
@@ -230,6 +230,51 @@ specify the target Yggdrasil IPv6 address and port, like so:
target_host = 201:5d78:af73:5caf:a4de:a79f:3278:71e5 target_host = 201:5d78:af73:5caf:a4de:a79f:3278:71e5
target_port = 4343 target_port = 4343
Automated Blocking
------------------
Listener instances of ``BackboneInterface`` will automatically block fast-flapping clients,
that repeatedly connect for a short amount of time, and then disconnect. Such behavior usually
occurs from clients trying to spam the network with announces or path requests, by connecting, dumping
a massive amount of requests, and then disconnecting in an attempt to bypass rate limits.
While such bypass attempts only have very limited effect on the amount of spam actually dumped (ingress limits
trigger immediately once a client exceeds rate limits), the behavior is often seen anyways, and
causes log noise and needless interface rotation. The fast-flapping block ensures such clients
are never allocated an interface on the transport instance.
Another common cause can simply be clients using implementations that are broken, or automated
scanning tools attempting to connect to the instance.
.. code:: ini
[[Backbone Listener]]
type = BackboneInterface
enabled = yes
listen_on = 0.0.0.0
port = 4242
# Whether to enable blocking
block_fast_flapping = yes
# How long an IP address stays
# blocked, in minutes. Set to
# 12 hours by default.
fast_flapping_block_time = 720
# The minimum time, in seconds,
# an interface must stay connected
# to be considered not fast-flapping.
fast_flapping_threshold = 20
# Amount of fast flaps a remote
# IP can perform before having
# blocking triggered.
fast_flapping_grace = 5
The configuration options listed in the example above are the *default values*, and you do
not need to add them for automated blocking to work, but you can use them to change the
behavior from the defaults, if necessary.
.. _interfaces-tcps: .. _interfaces-tcps:
TCP Server Interface TCP Server Interface
@@ -998,7 +1043,13 @@ On a real system, you should make the script robust enough to deal with intermit
**Physical Location** **Physical Location**
``latitude``, ``longitude``, ``height`` ``latitude``, ``longitude``, ``height``
Optional physical coordinates for the interface. These are useful for mapping discovered interfaces geographically or for clients to automatically select the nearest access point. Coordinates should be in decimal degrees, height in meters. Optional physical coordinates for the interface. These are useful for mapping discovered interfaces geographically or for clients to automatically select the nearest access point. Coordinates should be in decimal degrees, height in meters above mean sea level.
``location_cmd``
Optional path to executable or script that returns the physical coordinates for the interface. This can be used instead of manually setting ``latitude``, ``longitude`` and ``height``. Reticulum expects the script to output the location data to ``stdout`` on a single line, separated by commas, with values as floating point numbers in the format ``LAT, LON, HEIGHT``. Coordinates should be in decimal degrees, height in meters above mean sea level.
.. note::
The height value for interface discovery is specified in *height above mean sea level*! This is the geoid-corrected height value, and is distinct from GPS altitude. If you manually specify height, it will typically be set to what you find on a topographical map. If you are using a script to output the location data, make sure that you are using the geoid-corrected altitude, not height above the GPS ellipsoid. Most GPS systems will make both figures available.
**Radio Parameters** **Radio Parameters**
@@ -1207,6 +1258,22 @@ These can be used to control various aspects of interface behaviour.
link or a remote TCP tunnel) solely to discover better local link or a remote TCP tunnel) solely to discover better local
infrastructure, which then supersedes the bootstrap interface. infrastructure, which then supersedes the bootstrap interface.
* | The ``recursive_prs`` option allows you to enable recursive path
discovery on an interface regardless of its configured interface
mode. When this option is enabled, Reticulum will attempt to
recursively discover paths for path requests received on this
interface.
* | The ``announces_from_internal`` option controls whether any
announces *received on* an ``internal`` mode interface will
propagate *out* on the interface this option is set on. Note
that this controls *announce propagation*; even if announces
do not propagate out when received, paths to destinations on
``internal`` mode interfaces may still be resolvable by means
of path requests.
.. _interfaces-modes: .. _interfaces-modes:
Interface Modes Interface Modes
@@ -1284,6 +1351,15 @@ the default mode.
public Transport Node available on the Internet, the interface public Transport Node available on the Internet, the interface
connecting over the Internet should be set to ``boundary`` mode. connecting over the Internet should be set to ``boundary`` mode.
* | The ``internal`` mode designates interfaces that belong to a
network different from any marked as ``boundary``. Announces from
a ``boundary`` interface will not propagate to interfaces set as
``internal``, but announces *will* propagate from ``internal`` *to*
``boundary``. Devices on the ``internal`` side of the network will
still be able to resolve paths to destinations across the boundary
when needed, since recursive path requests are enabled for ``internal``
mode interfaces by default.
For a table describing the impact of all modes on announce propagation, For a table describing the impact of all modes on announce propagation,
please see the :ref:`Announce Propagation Rules<understanding-announcepropagation>` section. please see the :ref:`Announce Propagation Rules<understanding-announcepropagation>` section.
+119 -319
View File
@@ -3,64 +3,35 @@
*********************** ***********************
Understanding Reticulum Understanding Reticulum
*********************** ***********************
This chapter will briefly describe the overall purpose and operating principles of Reticulum. This chapter will briefly describe the overall purpose and operating principles of Reticulum. It should give you an overview of how the stack works, and an understanding of how to develop networked applications using Reticulum.
It should give you an overview of how the stack works, and an understanding of how to
develop networked applications using Reticulum.
This chapter is not an exhaustive source of information on Reticulum, at least not yet. Currently, This chapter is not an exhaustive source of information on Reticulum, at least not yet. Currently, the only complete repository, and final authority on how Reticulum actually functions, is the Python reference implementation and API reference. That being said, this chapter is an essential resource in understanding how Reticulum works from a high-level perspective, along with the general principles of Reticulum, and how to apply them when creating your own networks or software.
the only complete repository, and final authority on how Reticulum actually functions, is the Python
reference implementation and API reference. That being said, this chapter is an essential resource in
understanding how Reticulum works from a high-level perspective, along with the general principles of
Reticulum, and how to apply them when creating your own networks or software.
After reading this chapter, you should be well-equipped to understand how a Reticulum network After reading this chapter, you should be well-equipped to understand how a Reticulum network operates, what it can achieve, and how you can use it yourself. This chapter also seeks to provide an overview of the sentiments and the philosophy behind Reticulum, what problems it seeks to solve, and how it approaches those solutions.
operates, what it can achieve, and how you can use it yourself. This chapter also seeks to provide an overview of the
sentiments and the philosophy behind Reticulum, what problems it seeks to solve, and how it
approaches those solutions.
.. _understanding-motivation: .. _understanding-motivation:
Motivation Motivation
========== ==========
The primary motivation for designing and implementing Reticulum has been the current lack of The primary motivation for designing and implementing Reticulum has been the current lack of reliable, functional and secure minimal-infrastructure modes of digital communication. It is my belief that it is highly desirable to create a reliable and efficient way to set up long-range digital communication networks that can securely allow exchange of information between people and machines, with no central point of authority, control, censorship or barrier to entry.
reliable, functional and secure minimal-infrastructure modes of digital communication. It is my
belief that it is highly desirable to create a reliable and efficient way to set up long-range digital
communication networks that can securely allow exchange of information between people and
machines, with no central point of authority, control, censorship or barrier to entry.
Almost all of the various networking systems in use today share a common limitation: They Almost all of the various networking systems in use today share a common limitation: They require large amounts of coordination and centralised trust and power to function. To join such networks, you need approval of gatekeepers in control. This need for coordination and trust inevitably leads to an environment of central control, where it's very easy for infrastructure operators or governments to control or alter traffic, and censor or persecute unwanted actors. It also makes it completely impossible to freely deploy and use networks at will, like one would use other common tools that enhance individual agency and freedom.
require large amounts of coordination and centralised trust and power to function. To join such networks, you need approval
of gatekeepers in control. This need for coordination and trust inevitably leads to an environment of
central control, where it's very easy for infrastructure operators or governments to control or alter
traffic, and censor or persecute unwanted actors. It also makes it completely impossible to freely deploy
and use networks at will, like one would use other common tools that enhance individual agency and freedom.
Reticulum aims to require as little coordination and trust as possible. It aims to make secure, Reticulum aims to require as little coordination and trust as possible. It aims to make secure, anonymous and permissionless networking and information exchange a tool that anyone can just pick up and use.
anonymous and permissionless networking and information exchange a tool that anyone can just pick up and use.
Since Reticulum is completely medium agnostic, it can be used to build networks on whatever is best Since Reticulum is completely medium agnostic, it can be used to build networks on whatever is best suited to the situation, or whatever you have available. In some cases, this might be packet radio links over VHF frequencies, in other cases it might be a 2.4 GHz network using off-the-shelf radios, or it might be using common LoRa development boards.
suited to the situation, or whatever you have available. In some cases, this might be packet radio
links over VHF frequencies, in other cases it might be a 2.4 GHz
network using off-the-shelf radios, or it might be using common LoRa development boards.
At the time of release of this document, the fastest and easiest setup for development and testing is using At the time of release of this document, the fastest and easiest setup for development and testing is using LoRa radio modules with an open source firmware (see the section :ref:`Reference Setup<understanding-referencesystem>`), connected to any kind of computer or mobile device that Reticulum can run on.
LoRa radio modules with an open source firmware (see the section :ref:`Reference Setup<understanding-referencesystem>`),
connected to any kind of computer or mobile device that Reticulum can run on.
The ultimate aim of Reticulum is to allow anyone to be their own network operator, and to make it The ultimate aim of Reticulum is to allow anyone to be their own network operator, and to make it cheap and easy to cover vast areas with a myriad of independent, interconnectable and autonomous networks. Reticulum **is not** *one network*, it **is a tool** to build *thousands of networks*. Networks without kill-switches, surveillance, censorship and control. Networks that can freely interoperate, associate and disassociate with each other, and require no central oversight. Networks for human beings. *Networks for the people*.
cheap and easy to cover vast areas with a myriad of independent, interconnectable and autonomous networks.
Reticulum **is not** *one network*, it **is a tool** to build *thousands of networks*. Networks without
kill-switches, surveillance, censorship and control. Networks that can freely interoperate, associate and disassociate
with each other, and require no central oversight. Networks for human beings. *Networks for the people*.
.. _understanding-goals: .. _understanding-goals:
Goals Goals
===== =====
To be as widely usable and efficient to deploy as possible, the following goals have been used to To be as widely usable and efficient to deploy as possible, the following goals have been used to guide the design of Reticulum:
guide the design of Reticulum:
* **Fully useable as open source software stack** * **Fully useable as open source software stack**
@@ -83,18 +54,18 @@ guide the design of Reticulum:
* **Unlicensed use** * **Unlicensed use**
Reticulum shall be functional over physical communication mediums that do not require any Reticulum shall be functional over physical communication mediums that do not require any
form of license to use. Reticulum must be designed in a way, so it is usable over ISM radio form of license to use. Reticulum must be designed in a way, so it is usable over ISM radio
frequency bands, and can provide functional long distance links in such conditions, for example frequency bands, and can provide functional long distance links in such conditions, for
by connecting a modem to a PMR or CB radio, or by using LoRa or WiFi modules. example by connecting a modem to a PMR or CB radio, or by using LoRa or WiFi modules.
* **Supplied software** * **Supplied software**
In addition to the core networking stack and API, that allows a developer to build In addition to the core networking stack and API, that allows a developer to build
applications with Reticulum, a basic set of Reticulum-based communication tools must be applications with Reticulum, a basic set of Reticulum-based communication tools must be
implemented and released along with Reticulum itself. These shall serve both as a implemented and released along with Reticulum itself. These shall serve both as a
functional, basic communication suite, and as an example and learning resource to others wishing functional, basic communication suite, and as an example and learning resource to others
to build applications with Reticulum. wishing to build applications with Reticulum.
* **Ease of use** * **Ease of use**
The reference implementation of Reticulum is written in Python, to make it easy to use The reference implementation of Reticulum is written in Python, to make it easy to use and
and understand. A programmer with only basic experience should be able to use understand. A programmer with only basic experience should be able to use Reticulum to write
Reticulum to write networked applications. networked applications.
* **Low cost** * **Low cost**
It shall be as cheap as possible to deploy a communication system based on Reticulum. This It shall be as cheap as possible to deploy a communication system based on Reticulum. This
should be achieved by using cheap off-the-shelf hardware that potential users might already should be achieved by using cheap off-the-shelf hardware that potential users might already
@@ -106,53 +77,26 @@ guide the design of Reticulum:
Introduction & Basic Functionality Introduction & Basic Functionality
================================== ==================================
Reticulum is a networking stack suited for high-latency, low-bandwidth links. Reticulum is at its Reticulum is a networking stack suited for high-latency, low-bandwidth links. Reticulum is at its core a *message oriented* system. It is suited for both local point-to-point or point-to-multipoint scenarios where all nodes are within range of each other, as well as scenarios where packets need to be transported over multiple hops in a complex network to reach the recipient.
core a *message oriented* system. It is suited for both local point-to-point or point-to-multipoint
scenarios where all nodes are within range of each other, as well as scenarios where packets need
to be transported over multiple hops in a complex network to reach the recipient.
Reticulum does away with the idea of addresses and ports known from IP, TCP and UDP. Instead Reticulum does away with the idea of addresses and ports known from IP, TCP and UDP. Instead Reticulum uses the singular concept of *destinations*. Any application using Reticulum as its networking stack will need to create one or more destinations to receive data, and know the destinations it needs to send data to.
Reticulum uses the singular concept of *destinations*. Any application using Reticulum as its
networking stack will need to create one or more destinations to receive data, and know the
destinations it needs to send data to.
All destinations in Reticulum are *represented* as a 16 byte hash. This hash is derived from truncating a full All destinations in Reticulum are *represented* as a 16 byte hash. This hash is derived from truncating a full SHA-256 hash of identifying characteristics of the destination. To users, the destination addresses will be displayed as 16 hexadecimal bytes, like this example: ``<13425ec15b621c1d928589718000d814>``.
SHA-256 hash of identifying characteristics of the destination. To users, the destination addresses
will be displayed as 16 hexadecimal bytes, like this example: ``<13425ec15b621c1d928589718000d814>``.
The truncation size of 16 bytes (128 bits) for destinations has been chosen as a reasonable trade-off The truncation size of 16 bytes (128 bits) for destinations has been chosen as a reasonable trade-off between address space and packet overhead. The address space accommodated by this size can support many billions of simultaneously active devices on the same network, while keeping packet overhead low, which is essential on low-bandwidth networks. In the very unlikely case that this address space nears congestion, a one-line code change can upgrade the Reticulum address space all the way up to 256 bits, ensuring the Reticulum address space could potentially support galactic-scale networks. This is obviously complete and ridiculous over-allocation, and as such, the current 128 bits should be sufficient, even far into the future.
between address space
and packet overhead. The address space accommodated by this size can support many billions of
simultaneously active devices on the same network, while keeping packet overhead low, which is
essential on low-bandwidth networks. In the very unlikely case that this address space nears
congestion, a one-line code change can upgrade the Reticulum address space all the way up to 256
bits, ensuring the Reticulum address space could potentially support galactic-scale networks.
This is obviously complete and ridiculous over-allocation, and as such, the current 128 bits should
be sufficient, even far into the future.
By default Reticulum encrypts all data using elliptic curve cryptography and AES. Any packet sent to a By default Reticulum encrypts all data using elliptic curve cryptography and AES. Any packet sent to a destination is encrypted with a per-packet derived key. Reticulum can also set up an encrypted channel to a destination, called a *Link*. Both data sent over Links and single packets offer *Initiator Anonymity*. Links additionally offer *Forward Secrecy* by default, employing an Elliptic Curve Diffie Hellman key exchange on Curve25519 to derive per-link ephemeral keys. Asymmetric, link-less packet communication can also provide forward secrecy, with automatic key ratcheting, by enabling ratchets on a per-destination basis. The multi-hop transport, coordination, verification and reliability layers are fully autonomous and also based on elliptic curve cryptography.
destination is encrypted with a per-packet derived key. Reticulum can also set up an encrypted
channel to a destination, called a *Link*. Both data sent over Links and single packets offer
*Initiator Anonymity*. Links additionally offer *Forward Secrecy* by default, employing an Elliptic Curve
Diffie Hellman key exchange on Curve25519 to derive per-link ephemeral keys. Asymmetric, link-less
packet communication can also provide forward secrecy, with automatic key ratcheting, by enabling
ratchets on a per-destination basis. The multi-hop transport, coordination, verification and reliability
layers are fully autonomous and also based on elliptic curve cryptography.
Reticulum also offers symmetric key encryption for group-oriented communications, as well as Reticulum also offers symmetric key encryption for group-oriented communications, as well as unencrypted packets (for local broadcast purposes **only**).
unencrypted packets (for local broadcast purposes **only**).
Reticulum can connect to a variety of interfaces such as radio modems, data radios and serial ports, Reticulum can connect to a variety of interfaces such as radio modems, data radios and serial ports, and offers the possibility to easily tunnel Reticulum traffic over IP links such as the Internet or private IP networks.
and offers the possibility to easily tunnel Reticulum traffic over IP links such as the Internet or
private IP networks.
.. _understanding-destinations: .. _understanding-destinations:
Destinations Destinations
------------ ------------
To receive and send data with the Reticulum stack, an application needs to create one or more To receive and send data with the Reticulum stack, an application needs to create one or more destinations. Reticulum uses three different basic destination types, and one special:
destinations. Reticulum uses three different basic destination types, and one special:
* **Single** * **Single**
@@ -165,9 +109,9 @@ destinations. Reticulum uses three different basic destination types, and one sp
number of users, or should be readable by anyone. Traffic to a *plain* destination is not encrypted. number of users, or should be readable by anyone. Traffic to a *plain* destination is not encrypted.
Generally, *plain* destinations can be used for broadcast information intended to be public. Generally, *plain* destinations can be used for broadcast information intended to be public.
Plain destinations are only reachable directly, and packets addressed to plain destinations are Plain destinations are only reachable directly, and packets addressed to plain destinations are
never transported over multiple hops in the network. To be transportable over multiple hops in Reticulum, information never transported over multiple hops in the network. To be transportable over multiple hops in
*must* be encrypted, since Reticulum uses the per-packet encryption to verify routing paths and Reticulum, information *must* be encrypted, since Reticulum uses the per-packet encryption to verify
keep them alive. routing paths and keep them alive.
* **Group** * **Group**
The *group* special destination type, that defines a symmetrically encrypted virtual destination. The *group* special destination type, that defines a symmetrically encrypted virtual destination.
Data sent to this destination will be encrypted with a symmetric key, and will be readable by Data sent to this destination will be encrypted with a symmetric key, and will be readable by
@@ -186,16 +130,11 @@ destinations. Reticulum uses three different basic destination types, and one sp
Destination Naming Destination Naming
^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^
Destinations are created and named in an easy to understand dotted notation of *aspects*, and Destinations are created and named in an easy to understand dotted notation of *aspects*, and represented on the network as a hash of this value. The hash is a SHA-256 truncated to 128 bits. The top level aspect should always be a unique identifier for the application using the destination. The next levels of aspects can be defined in any way by the creator of the application.
represented on the network as a hash of this value. The hash is a SHA-256 truncated to 128 bits. The
top level aspect should always be a unique identifier for the application using the destination.
The next levels of aspects can be defined in any way by the creator of the application.
Aspects can be as long and as plentiful as required, and a resulting long destination name will not Aspects can be as long and as plentiful as required, and a resulting long destination name will not impact efficiency, as names are always represented as truncated SHA-256 hashes on the network.
impact efficiency, as names are always represented as truncated SHA-256 hashes on the network.
As an example, a destination for a environmental monitoring application could be made up of the As an example, a destination for a environmental monitoring application could be made up of the application name, a device type and measurement type, like this:
application name, a device type and measurement type, like this:
.. code-block:: text .. code-block:: text
@@ -205,11 +144,7 @@ application name, a device type and measurement type, like this:
full name : environmentlogger.remotesensor.temperature full name : environmentlogger.remotesensor.temperature
hash : 4faf1b2e0a077e6a9d92fa051f256038 hash : 4faf1b2e0a077e6a9d92fa051f256038
For the *single* destination, Reticulum will automatically append the associated public key as a For the *single* destination, Reticulum will automatically append the associated public key as a destination aspect before hashing. This is done to ensure only the correct destination is reached, since anyone can listen to any destination name. Appending the public key ensures that a given packet is only directed at the destination that holds the corresponding private key to decrypt the packet.
destination aspect before hashing. This is done to ensure only the correct destination is reached,
since anyone can listen to any destination name. Appending the public key ensures that a given
packet is only directed at the destination that holds the corresponding private key to decrypt the
packet.
**Take note!** There is a very important concept to understand here: **Take note!** There is a very important concept to understand here:
@@ -218,16 +153,9 @@ packet.
* Each destination that does so will still have a unique destination hash, and thus be uniquely * Each destination that does so will still have a unique destination hash, and thus be uniquely
addressable, because their public keys will differ. addressable, because their public keys will differ.
In actual use of *single* destination naming, it is advisable not to use any uniquely identifying In actual use of *single* destination naming, it is advisable not to use any uniquely identifying features in aspect naming. Aspect names should be general terms describing what kind of destination is represented. The uniquely identifying aspect is always achieved by appending the public key, which expands the destination into a uniquely identifiable one. Reticulum does this automatically.
features in aspect naming. Aspect names should be general terms describing what kind of destination
is represented. The uniquely identifying aspect is always achieved by appending the public key,
which expands the destination into a uniquely identifiable one. Reticulum does this automatically.
Any destination on a Reticulum network can be addressed and reached simply by knowing its Any destination on a Reticulum network can be addressed and reached simply by knowing its destination hash (and public key, but if the public key is not known, it can be requested from the network simply by knowing the destination hash). The use of app names and aspects makes it easy to structure Reticulum programs and makes it possible to filter what information and data your program receives.
destination hash (and public key, but if the public key is not known, it can be requested from the
network simply by knowing the destination hash). The use of app names and aspects makes it easy to
structure Reticulum programs and makes it possible to filter what information and data your program
receives.
To recap, the different destination types should be used in the following situations: To recap, the different destination types should be used in the following situations:
@@ -239,56 +167,30 @@ To recap, the different destination types should be used in the following situat
* **Plain** * **Plain**
When plain-text communication is desirable, for example when broadcasting information, or for local discovery purposes. When plain-text communication is desirable, for example when broadcasting information, or for local discovery purposes.
To communicate with a *single* destination, you need to know its public key. Any method for To communicate with a *single* destination, you need to know its public key. Any method for obtaining the public key is valid, but Reticulum includes a simple mechanism for making other nodes aware of your destinations public key, called the *announce*. It is also possible to request an unknown public key from the network, as all transport instances serve as a distributed ledger of public keys.
obtaining the public key is valid, but Reticulum includes a simple mechanism for making other
nodes aware of your destinations public key, called the *announce*. It is also possible to request
an unknown public key from the network, as all transport instances serve as a distributed ledger
of public keys.
Note that public key information can be shared and verified in other ways than using the Note that public key information can be shared and verified in other ways than using the built-in *announce* functionality, and that it is therefore not required to use the *announce* and *path request* functionality to obtain public keys. It is by far the easiest though, and should definitely be used if there is not a very good reason for doing it differently.
built-in *announce* functionality, and that it is therefore not required to use the *announce* and *path request*
functionality to obtain public keys. It is by far the easiest though, and should definitely be used
if there is not a very good reason for doing it differently.
.. _understanding-keyannouncements: .. _understanding-keyannouncements:
Public Key Announcements Public Key Announcements
------------------------ ------------------------
An *announce* will send a special packet over any relevant interfaces, containing all needed An *announce* will send a special packet over any relevant interfaces, containing all needed information about the destination hash and public key, and can also contain some additional, application specific data. The entire packet is signed by the sender to ensure authenticity. It is not required to use the announce functionality, but in many cases it will be the simplest way to share public keys on the network. The announce mechanism also serves to establish end-to-end connectivity to the announced destination, as the announce propagates through the network.
information about the destination hash and public key, and can also contain some additional,
application specific data. The entire packet is signed by the sender to ensure authenticity. It is not
required to use the announce functionality, but in many cases it will be the simplest way to share
public keys on the network. The announce mechanism also serves to establish end-to-end connectivity
to the announced destination, as the announce propagates through the network.
As an example, an announce in a simple messenger application might contain the following information: As an example, an announce in a simple messenger application might contain the following information:
* The announcers destination hash * The announcers destination hash
* The announcers public key * The announcers public key
* Application specific data, in this case the users nickname and availability status * Application specific data, in this case the users nickname and availability status
* A random blob, making each new announce unique * A random blob, making each new announce unique
* An Ed25519 signature of the above information, verifying authenticity * An Ed25519 signature of the above information, verifying authenticity
With this information, any Reticulum node that receives it will be able to reconstruct an outgoing With this information, any Reticulum node that receives it will be able to reconstruct an outgoing destination to securely communicate with that destination. You might have noticed that there is one piece of information lacking to reconstruct full knowledge of the announced destination, and that is the aspect names of the destination. These are intentionally left out to save bandwidth, since they will be implicit in almost all cases. The receiving application will already know them. If a destination name is not entirely implicit, information can be included in the application specific data part that will allow the receiver to infer the naming.
destination to securely communicate with that destination. You might have noticed that there is one
piece of information lacking to reconstruct full knowledge of the announced destination, and that is
the aspect names of the destination. These are intentionally left out to save bandwidth, since they
will be implicit in almost all cases. The receiving application will already know them. If a destination
name is not entirely implicit, information can be included in the application specific data part that
will allow the receiver to infer the naming.
It is important to note that announces will be forwarded throughout the network according to a It is important to note that announces will be forwarded throughout the network according to a certain pattern. This will be detailed in the section :ref:`The Announce Mechanism in Detail<understanding-announce>`.
certain pattern. This will be detailed in the section
:ref:`The Announce Mechanism in Detail<understanding-announce>`.
In Reticulum, destinations are allowed to move around the network at will. This is very different from In Reticulum, destinations are allowed to move around the network at will. This is very different from protocols such as IP, where an address is always expected to stay within the network segment it was assigned in. This limitation does not exist in Reticulum, and any destination is *completely portable* over the entire topography of the network, and *can even be moved to other Reticulum networks* than the one it was created in, and still become reachable. To update its reachability, a destination simply needs to send an announce on any networks it is part of. After a short while, it will be globally reachable in the network.
protocols such as IP, where an address is always expected to stay within the network segment it was assigned in.
This limitation does not exist in Reticulum, and any destination is *completely portable* over the entire topography
of the network, and *can even be moved to other Reticulum networks* than the one it was created in, and
still become reachable. To update its reachability, a destination simply needs to send an announce on any
networks it is part of. After a short while, it will be globally reachable in the network.
Seeing how *single* destinations are always tied to a private/public key pair leads us to the next topic. Seeing how *single* destinations are always tied to a private/public key pair leads us to the next topic.
@@ -297,33 +199,18 @@ Seeing how *single* destinations are always tied to a private/public key pair le
Identities Identities
---------- ----------
In Reticulum, an *identity* does not necessarily represent a personal identity, but is an abstraction that In Reticulum, an *identity* does not necessarily represent a personal identity, but is an abstraction that can represent any kind of *verifiable entity*. This could very well be a person, but it could also be the control interface of a machine, a program, robot, computer, sensor or something else entirely. In general, any kind of agent that can act, or be acted upon, or store or manipulate information, can be represented as an identity. An *identity* can be used to create any number of destinations.
can represent any kind of *verifiable entity*. This could very well be a person, but it could also be the
control interface of a machine, a program, robot, computer, sensor or something else entirely. In
general, any kind of agent that can act, or be acted upon, or store or manipulate information, can be
represented as an identity. An *identity* can be used to create any number of destinations.
A *single* destination will always have an *identity* tied to it, but not *plain* or *group* A *single* destination will always have an *identity* tied to it, but not *plain* or *group* destinations. Destinations and identities share a multilateral connection. You can create a destination, and if it is not connected to an identity upon creation, it will just create a new one to use automatically. This may be desirable in some situations, but often you will probably want to create the identity first, and then use it to create new destinations.
destinations. Destinations and identities share a multilateral connection. You can create a
destination, and if it is not connected to an identity upon creation, it will just create a new one to use
automatically. This may be desirable in some situations, but often you will probably want to create
the identity first, and then use it to create new destinations.
As an example, we could use an identity to represent the user of a messaging application. As an example, we could use an identity to represent the user of a messaging application. Destinations can then be created by this identity to allow communication to reach the user. In all cases it is of great importance to store the private keys associated with any Reticulum Identity securely and privately, since obtaining access to the identity keys equals obtaining access and controlling reachability to any destinations created by that identity.
Destinations can then be created by this identity to allow communication to reach the user.
In all cases it is of great importance to store the private keys associated with any
Reticulum Identity securely and privately, since obtaining access to the identity keys equals
obtaining access and controlling reachability to any destinations created by that identity.
.. _understanding-gettingfurther: .. _understanding-gettingfurther:
Getting Further Getting Further
--------------- ---------------
The above functions and principles form the core of Reticulum, and would suffice to create The above functions and principles form the core of Reticulum, and would suffice to create functional networked applications in local clusters, for example over radio links where all interested nodes can directly hear each other. But to be truly useful, we need a way to direct traffic over multiple hops in the network.
functional networked applications in local clusters, for example over radio links where all interested
nodes can directly hear each other. But to be truly useful, we need a way to direct traffic over multiple
hops in the network.
In the following sections, two concepts that allow this will be introduced, *paths* and *links*. In the following sections, two concepts that allow this will be introduced, *paths* and *links*.
@@ -332,16 +219,9 @@ In the following sections, two concepts that allow this will be introduced, *pat
Reticulum Transport Reticulum Transport
=================== ===================
The methods of routing used in traditional networks are fundamentally incompatible with the physical medium The methods of routing used in traditional networks are fundamentally incompatible with the physical medium types and circumstances that Reticulum was designed to handle. These mechanisms mostly assume trust at the physical layer, and often needs a lot more bandwidth than Reticulum can assume is available. Since Reticulum is designed to survive running over open radio spectrum, no such trust can be assumed, and bandwidth is often very limited.
types and circumstances that Reticulum was designed to handle. These mechanisms mostly assume trust at the physical layer,
and often needs a lot more bandwidth than Reticulum can assume is available. Since Reticulum is designed to
survive running over open radio spectrum, no such trust can be assumed, and bandwidth is often very limited.
To overcome such challenges, Reticulum’s *Transport* system uses asymmetric elliptic curve cryptography to To overcome such challenges, Reticulum’s *Transport* system uses asymmetric elliptic curve cryptography to implement the concept of *paths* that allow discovery of how to get information closer to a certain destination. It is important to note that no single node in a Reticulum network knows the complete path to a destination. Every Transport node participating in a Reticulum network will only know the most direct way to get a packet one hop closer to it's destination.
implement the concept of *paths* that allow discovery of how to get information closer to a certain
destination. It is important to note that no single node in a Reticulum network knows the complete
path to a destination. Every Transport node participating in a Reticulum network will only
know the most direct way to get a packet one hop closer to it's destination.
.. _understanding-nodetypes: .. _understanding-nodetypes:
@@ -349,16 +229,11 @@ know the most direct way to get a packet one hop closer to it's destination.
Node Types Node Types
---------- ----------
Currently, Reticulum distinguishes between two types of network nodes. All nodes on a Reticulum network Currently, Reticulum distinguishes between two types of network nodes. All nodes on a Reticulum network are *Reticulum Instances*, and some are also *Transport Nodes*. If a system running Reticulum is fixed in one place, and is intended to be kept available most of the time, it is a good contender to be a *Transport Node*.
are *Reticulum Instances*, and some are also *Transport Nodes*. If a system running Reticulum is fixed in
one place, and is intended to be kept available most of the time, it is a good contender to be a *Transport Node*.
Any Reticulum Instance can become a Transport Node by enabling it in the configuration. Any Reticulum Instance can become a Transport Node by enabling it in the configuration. This distinction is made by the user configuring the node, and is used to determine what nodes on the network will help forward traffic, and what nodes rely on other nodes for wider connectivity.
This distinction is made by the user configuring the node, and is used to determine what nodes on the
network will help forward traffic, and what nodes rely on other nodes for wider connectivity.
If a node is an *Instance* it should be given the configuration directive ``enable_transport = No``, which If a node is an *Instance* it should be given the configuration directive ``enable_transport = No``, which is the default setting.
is the default setting.
If it is a *Transport Node*, it should be given the configuration directive ``enable_transport = Yes``. If it is a *Transport Node*, it should be given the configuration directive ``enable_transport = Yes``.
@@ -368,8 +243,7 @@ If it is a *Transport Node*, it should be given the configuration directive ``en
The Announce Mechanism in Detail The Announce Mechanism in Detail
-------------------------------- --------------------------------
When an *announce* for a destination is transmitted by a Reticulum instance, it will be forwarded by When an *announce* for a destination is transmitted by a Reticulum instance, it will be forwarded by any transport node receiving it, but according to some specific rules:
any transport node receiving it, but according to some specific rules:
* | If this exact announce has already been received before, ignore it. * | If this exact announce has already been received before, ignore it.
@@ -400,42 +274,23 @@ any transport node receiving it, but according to some specific rules:
to be transmitted, the newest announce is discarded. If the newest announce contains different to be transmitted, the newest announce is discarded. If the newest announce contains different
application specific data, it will replace the old announce. application specific data, it will replace the old announce.
Once an announce has reached a transport node in the network, any other node in direct contact with that Once an announce has reached a transport node in the network, any other node in direct contact with that transport node will be able to reach the destination the announce originated from, simply by sending a packet addressed to that destination. Any transport node with knowledge of the announce will be able to direct the packet towards the destination by looking up the most efficient next node to the destination.
transport node will be able to reach the destination the announce originated from, simply by sending a packet
addressed to that destination. Any transport node with knowledge of the announce will be able to direct the
packet towards the destination by looking up the most efficient next node to the destination.
According to these rules, an announce will propagate throughout the network in a predictable way, According to these rules, an announce will propagate throughout the network in a predictable way, and make the announced destination reachable in a short amount of time. Fast networks that have the capacity to process many announces can reach full convergence very quickly, even when constantly adding new destinations. Slower segments of such networks might take a bit longer to gain full knowledge about the wide and fast networks they are connected to, but can still do so over time, while prioritising full and quickly converging end-to-end connectivity for their local, slower segments.
and make the announced destination reachable in a short amount of time. Fast networks that have the
capacity to process many announces can reach full convergence very quickly, even when constantly adding
new destinations. Slower segments of such networks might take a bit longer to gain full knowledge about
the wide and fast networks they are connected to, but can still do so over time, while prioritising full
and quickly converging end-to-end connectivity for their local, slower segments.
.. tip:: .. tip::
Even very slow networks, that simply don't have the capacity to ever reach *full* convergence will generally still be able to reach **any other destination on any connected segments**, since interconnecting transport nodes will prioritize announces into the slower segments that are actually requested by nodes on these.
Even very slow networks, that simply don't have the capacity to ever reach *full* convergence This means that slow, low-capacity or low-resource segments **don't** need to have full network knowledge, since paths can always be recursively resolved from other segments that do have knowledge about them.
will generally still be able to reach **any other destination on any connected segments**, since
interconnecting transport nodes will prioritize announces into the slower segments that are
actually requested by nodes on these.
This means that slow, low-capacity or low-resource segments **don't** need to have full network In general, even extremely complex networks, that utilize the maximum 128 hops will converge to full end-to-end connectivity in about one minute, given there is enough bandwidth available to process the required amount of announces.
knowledge, since paths can always be recursively resolved from other segments that do have
knowledge about them.
In general, even extremely complex networks, that utilize the maximum 128 hops will converge to full
end-to-end connectivity in about one minute, given there is enough bandwidth available to process
the required amount of announces.
.. _understanding-paths: .. _understanding-paths:
Reaching the Destination Reaching the Destination
------------------------ ------------------------
In networks with changing topology and trustless connectivity, nodes need a way to establish In networks with changing topology and trustless connectivity, nodes need a way to establish *verified connectivity* with each other. Since the underlying network mediums are assumed to be trustless, Reticulum must provide a way to guarantee that the peer you are communicating with is actually who you expect. Reticulum offers two ways to do this.
*verified connectivity* with each other. Since the underlying network mediums are assumed to be trustless, Reticulum
must provide a way to guarantee that the peer you are communicating with is actually who you
expect. Reticulum offers two ways to do this.
For exchanges of small amounts of information, Reticulum offers the *Packet* API, which works exactly like you would expect - on a per packet level. The following process is employed when sending a packet: For exchanges of small amounts of information, Reticulum offers the *Packet* API, which works exactly like you would expect - on a per packet level. The following process is employed when sending a packet:
@@ -495,35 +350,17 @@ For exchanges of larger amounts of data, or when longer sessions of bidirectiona
the destination using a Reticulum Identity. This authentication is happening inside the encrypted the destination using a Reticulum Identity. This authentication is happening inside the encrypted
link, and is only revealed to the verified destination, and no intermediaries. link, and is only revealed to the verified destination, and no intermediaries.
In a moment, we will discuss the details of how this methodology is In a moment, we will discuss the details of how this methodology is implemented, but let’s first recap what purposes this methodology serves. We first ensure that the node answering our request is actually the one we want to communicate with, and not a malicious actor pretending to be so. At the same time we establish an efficient encrypted channel. The setup of this is relatively cheap in terms of bandwidth, so it can be used just for a short exchange, and then recreated as needed, which will also rotate encryption keys. The link can also be kept alive for longer periods of time, if this is more suitable to the application. The procedure also inserts the *link id* , a hash calculated from the link request packet, into the memory of forwarding nodes, which means that the communicating nodes can thereafter reach each other simply by referring to this *link id*.
implemented, but let’s first recap what purposes this methodology serves. We
first ensure that the node answering our request is actually the one we want to
communicate with, and not a malicious actor pretending to be so. At the same
time we establish an efficient encrypted channel. The setup of this is
relatively cheap in terms of bandwidth, so it can be used just for a short
exchange, and then recreated as needed, which will also rotate encryption keys.
The link can also be kept alive for longer periods of time, if this is more
suitable to the application. The procedure also inserts the *link id* , a hash
calculated from the link request packet, into the memory of forwarding nodes,
which means that the communicating nodes can thereafter reach each other simply
by referring to this *link id*.
The combined bandwidth cost of setting up a link is 3 packets totalling 297 bytes (more info in the The combined bandwidth cost of setting up a link is 3 packets totalling 297 bytes (more info in the :ref:`Binary Packet Format<understanding-packetformat>` section). The amount of bandwidth used on keeping a link open is practically negligible, at 0.45 bits per second. Even on a slow 1200 bits per second packet radio channel, 100 concurrent links will still leave 96% channel capacity for actual data.
:ref:`Binary Packet Format<understanding-packetformat>` section). The amount of bandwidth used on keeping
a link open is practically negligible, at 0.45 bits per second. Even on a slow 1200 bits per second packet
radio channel, 100 concurrent links will still leave 96% channel capacity for actual data.
Link Establishment in Detail Link Establishment in Detail
^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
After exploring the basics of the announce mechanism, finding a path through the network, and an overview After exploring the basics of the announce mechanism, finding a path through the network, and an overview of the link establishment procedure, this section will go into greater detail about the Reticulum link establishment process.
of the link establishment procedure, this section will go into greater detail about the Reticulum link
establishment process.
The *link* in Reticulum terminology should not be viewed as a direct node-to-node link on the The *link* in Reticulum terminology should not be viewed as a direct node-to-node link on the physical layer, but as an abstract channel, that can be open for any amount of time, and can span an arbitrary number of hops, where information will be exchanged between two nodes.
physical layer, but as an abstract channel, that can be open for any amount of time, and can span
an arbitrary number of hops, where information will be exchanged between two nodes.
* | When a node in the network wants to establish verified connectivity with another node, it * | When a node in the network wants to establish verified connectivity with another node, it
@@ -570,30 +407,20 @@ an arbitrary number of hops, where information will be exchanged between two nod
that is used to encrypt the channel. Information can now be exchanged reliably and securely. that is used to encrypt the channel. Information can now be exchanged reliably and securely.
.. note:: .. note::
It’s important to note that this methodology ensures that the source of the request does not need to reveal any identifying information about itself. **The link initiator remains completely anonymous**.
It’s important to note that this methodology ensures that the source of the request does not need to When using *links*, Reticulum will automatically verify all data sent over the link, and can also automate retransmissions if *Resources* are used.
reveal any identifying information about itself. **The link initiator remains completely anonymous**.
When using *links*, Reticulum will automatically verify all data sent over the link, and can also
automate retransmissions if *Resources* are used.
.. _understanding-resources: .. _understanding-resources:
Resources Resources
--------- ---------
For exchanging small amounts of data over a Reticulum network, the :ref:`Packet<api-packet>` interface For exchanging small amounts of data over a Reticulum network, the :ref:`Packet<api-packet>` interface is sufficient, but for exchanging data that would require many packets, an efficient way to coordinate the transfer is needed.
is sufficient, but for exchanging data that would require many packets, an efficient way to coordinate
the transfer is needed.
This is the purpose of the Reticulum :ref:`Resource<api-resource>`. A *Resource* can automatically This is the purpose of the Reticulum :ref:`Resource<api-resource>`. A *Resource* can automatically handle the reliable transfer of an arbitrary amount of data over an established :ref:`Link<api-link>`. Resources can auto-compress data, will handle breaking the data into individual packets, sequencing the transfer, integrity verification and reassembling the data on the other end.
handle the reliable transfer of an arbitrary amount of data over an established :ref:`Link<api-link>`.
Resources can auto-compress data, will handle breaking the data into individual packets, sequencing
the transfer, integrity verification and reassembling the data on the other end.
:ref:`Resources<api-resource>` are programmatically very simple to use, and only requires a few lines :ref:`Resources<api-resource>` are programmatically very simple to use, and only requires a few lines of codes to reliably transfer any amount of data. They can be used to transfer data stored in memory, or stream data directly from files.
of codes to reliably transfer any amount of data. They can be used to transfer data stored in memory,
or stream data directly from files.
.. _understanding-network_identities: .. _understanding-network_identities:
@@ -676,19 +503,11 @@ Once configured, your instances will automatically utilize this identity for sig
Reference Setup Reference Setup
====================== ======================
This section will detail a recommended *Reference Setup* for Reticulum. It is important to This section will detail a recommended *Reference Setup* for Reticulum. It is important to note that Reticulum is designed to be usable on more or less any computing device, and over more or less any medium that allows you to send and receive data, which satisfies some very low minimum requirements.
note that Reticulum is designed to be usable on more or less any computing device, and over more
or less any medium that allows you to send and receive data, which satisfies some very low
minimum requirements.
The communication channel must support at least half-duplex operation, and provide an average The communication channel must support at least half-duplex operation, and provide an average throughput of 5 bits per second or greater, and supports a physical layer MTU of 500 bytes. The Reticulum stack should be able to run on more or less any hardware that can provide a Python 3.x runtime environment.
throughput of 5 bits per second or greater, and supports a physical layer MTU of 500 bytes. The
Reticulum stack should be able to run on more or less any hardware that can provide a Python 3.x
runtime environment.
That being said, this reference setup has been outlined to provide a common platform for anyone That being said, this reference setup has been outlined to provide a common platform for anyone who wants to help in the development of Reticulum, and for everyone who wants to know a recommended setup to get started experimenting. A reference system consists of three parts:
who wants to help in the development of Reticulum, and for everyone who wants to know a
recommended setup to get started experimenting. A reference system consists of three parts:
* **An Interface Device** * **An Interface Device**
Which provides access to the physical medium whereupon the communication Which provides access to the physical medium whereupon the communication
@@ -700,11 +519,7 @@ recommended setup to get started experimenting. A reference system consists of t
* **A Software Stack** * **A Software Stack**
The software implementing the Reticulum protocol and applications using it. The software implementing the Reticulum protocol and applications using it.
The reference setup can be considered a relatively stable platform to develop on, and also to start The reference setup can be considered a relatively stable platform to develop on, and also to start building networks or applications on. While details of the implementation might change at the current stage of development, it is the goal to maintain hardware compatibility for as long as entirely possible, and the current reference setup has been determined to provide a functional platform for many years into the future. The current Reference System Setup is as follows:
building networks or applications on. While details of the implementation might change at the current stage of
development, it is the goal to maintain hardware compatibility for as long as entirely possible, and
the current reference setup has been determined to provide a functional platform for many years
into the future. The current Reference System Setup is as follows:
* **Interface Device** * **Interface Device**
@@ -719,53 +534,34 @@ into the future. The current Reference System Setup is as follows:
operating system. operating system.
.. note:: .. note::
To avoid confusion, it is very important to note, that the reference interface device **does not** use the LoRaWAN standard, but uses a custom MAC layer on top of the plain LoRa modulation! As such, you will need a plain LoRa radio module connected to a controller with the correct firmware. Full details on how to get or make such a device is available on the `RNode Page <https://github.com/markqvist/rnode_firmware>`_.
To avoid confusion, it is very important to note, that the reference interface device **does not** With the current reference setup, it should be possible to get on a Reticulum network for around 100$ even if you have none of the hardware already, and need to purchase everything.
use the LoRaWAN standard, but uses a custom MAC layer on top of the plain LoRa modulation! As such, you will
need a plain LoRa radio module connected to a controller with the correct firmware. Full details on how to
get or make such a device is available on the `RNode Page <https://github.com/markqvist/rnode_firmware>`_.
With the current reference setup, it should be possible to get on a Reticulum network for around 100$ This reference setup is of course just a recommendation for getting started easily, and you should tailor it to your own specific needs, or whatever hardware you have available.
even if you have none of the hardware already, and need to purchase everything.
This reference setup is of course just a recommendation for getting started easily, and you should
tailor it to your own specific needs, or whatever hardware you have available.
.. _understanding-protocolspecifics: .. _understanding-protocolspecifics:
Protocol Specifics Protocol Specifics
================== ==================
This chapter will detail protocol specific information that is essential to the implementation of This chapter will detail protocol specific information that is essential to the implementation of Reticulum, but non-critical in understanding how the protocol works on a general level. It should be treated more as a reference than as essential reading.
Reticulum, but non-critical in understanding how the protocol works on a general level. It should be
treated more as a reference than as essential reading.
Packet Prioritisation Packet Prioritisation
--------------------- ---------------------
Currently, Reticulum is completely priority-agnostic regarding *general* traffic. All traffic is handled Currently, Reticulum is completely priority-agnostic regarding *general* traffic. All traffic is handled on a first-come, first-serve basis. Announce re-transmission and other maintenance traffic is handled according to the re-transmission times and priorities described earlier in this chapter.
on a first-come, first-serve basis. Announce re-transmission and other maintenance traffic is handled
according to the re-transmission times and priorities described earlier in this chapter.
Interface Access Codes Interface Access Codes
---------------------- ----------------------
Reticulum can create named virtual networks, and networks that are only accessible by knowing a preshared Reticulum can create named virtual networks, and networks that are only accessible by knowing a preshared passphrase. The configuration of this is detailed in the :ref:`Common Interface Options<interfaces-options>` section. To implement this feature, Reticulum uses the concept of Interface Access Codes, that are calculated and verified per-packet.
passphrase. The configuration of this is detailed in the :ref:`Common Interface Options<interfaces-options>`
section. To implement this feature, Reticulum uses the concept of Interface Access Codes, that are calculated
and verified per-packet.
An interface with a named virtual network or passphrase authentication enabled will derive a shared Ed25519 An interface with a named virtual network or passphrase authentication enabled will derive a shared Ed25519 signing identity, and for every outbound packet generate a signature of the entire packet. This signature is then inserted into the packet as an Interface Access Code before transmission. Depending on the speed and capabilities of the interface, the IFAC can be the full 512-bit Ed25519 signature, or a truncated version. Configured IFAC length can be inspected for all interfaces with the ``rnstatus`` utility.
signing identity, and for every outbound packet generate a signature of the entire packet. This signature is
then inserted into the packet as an Interface Access Code before transmission. Depending on the speed and
capabilities of the interface, the IFAC can be the full 512-bit Ed25519 signature, or a truncated version.
Configured IFAC length can be inspected for all interfaces with the ``rnstatus`` utility.
Upon receipt, the interface will check that the signature matches the expected value, and drop the packet if it Upon receipt, the interface will check that the signature matches the expected value, and drop the packet if it does not. This ensures that only packets sent with the correct naming and/or passphrase parameters are allowed to pass onto the network.
does not. This ensures that only packets sent with the correct naming and/or passphrase parameters are allowed to
pass onto the network.
.. _understanding-packetformat: .. _understanding-packetformat:
@@ -909,54 +705,71 @@ Wire Format
Announce Propagation Rules Announce Propagation Rules
-------------------------- --------------------------
The following table illustrates the rules for automatically propagating announces The following table illustrates the rules for automatically propagating announces from one interface type to another, for all possible combinations. For the purpose of announce propagation, the *Full* and *Gateway* modes are identical.
from one interface type to another, for all possible combinations. For the purpose
of announce propagation, the *Full* and *Gateway* modes are identical. See the :ref:`Interface Modes<interfaces-modes>` section for a conceptual overview of the different interface modes, and how they are configured.
.. image:: graphics/if_mode_graph_b.png .. image:: graphics/if_mode_graph_b.png
See the :ref:`Interface Modes<interfaces-modes>` section for a conceptual overview Or, represented in table form:
of the different interface modes, and how they are configured.
.. image:: graphics/if_mode_graph_c.png
.. ..
(.. code-block:: text) (.. code-block:: text)
Full ────── ✓ ──┐ ┌── ✓ ── Full Full ────── ✓ ──┐ ┌── ✓ ── Full
AP ──────── ✓ ──┼───> Full >───┼── ✕ ── AP AP ──────── ✓ ──┤ ├── ✕ ── AP
Boundary ── ✓ ──┤ ├── ✓ ── Boundary Boundary ── ✓ ──┼───> Full >───┼── ✓ ── Boundary
Internal ── ✓ ──┤ ├── ✓ ── Internal
Roaming ─── ✓ ──┘ └── ✓ ── Roaming Roaming ─── ✓ ──┘ └── ✓ ── Roaming
Full ────── ✕ ──┐ ┌── ✓ ── Full Full ────── ✕ ──┐ ┌── ✓ ── Full
AP ──────── ✕ ──┼────> AP >────┼── ✕ ── AP AP ──────── ✕ ──┤ ├── ✕ ── AP
Boundary ── ✕ ──┤ ├── ✓ ── Boundary Boundary ── ✕ ──┼────> AP >────┼── ✓ ── Boundary
Internal ── ✕ ──┤ ├── ✓ ── Internal
Roaming ─── ✕ ──┘ └── ✓ ── Roaming Roaming ─── ✕ ──┘ └── ✓ ── Roaming
Full ────── ✓ ──┐ ┌── ✓ ── Full Full ────── ✓ ──┐ ┌── ✓ ── Full
AP ──────── ✓ ──┼─> Roaming >──┼── ✕ ── AP AP ──────── ✓ ──┤ ├── ✕ ── AP
Boundary ── ✕ ──┤ ├── ✕ ── Boundary Boundary ── ✕ ──┼─> Roaming >──┼── ✕ ── Boundary
Internal ── ✕ ──┤ ├── ✓ ── Internal
Roaming ─── ✕ ──┘ └── ✕ ── Roaming Roaming ─── ✕ ──┘ └── ✕ ── Roaming
Full ────── ✓ ──┐ ┌── ✓ ── Full Full ────── ✓ ──┐ ┌── ✓ ── Full
AP ──────── ✓ ──┼─> Boundary >─┼── ✕ ── AP AP ──────── ✓ ──┤ ├── ✕ ── AP
Boundary ── ✓ ──┤ ├── ✓ ── Boundary Boundary ── ✓ ──┼─> Boundary >─┼── ✓ ── Boundary
Internal ── ✓ ──┤ ├── ✕ ── Internal
Roaming ─── ✕ ──┘ └── ✕ ── Roaming Roaming ─── ✕ ──┘ └── ✕ ── Roaming
Full ────── ✓ ──┐ ┌── ✓ ── Full
AP ──────── ✓ ──┤ ├── ✕ ── AP
Boundary ── ✕ ──┼─> Internal >─┼── ✓ ── Boundary
Internal ── ✓ ──┤ ├── ✓ ── Internal
Roaming ─── ✓ ──┘ └── ✕ ── Roaming
dest → Full AP Boundary Roaming Gateway Internal
source ↓
Full ✓ ✕ ✓ ✓ ✓ ✓
Gateway ✓ ✕ ✓ ✓ ✓ ✓
AP ✓ ✕ ✓ ✓ ✓ ✓
Boundary ✓ ✕ ✓ ✕ ✓ ✕
Internal ✓ ✕ ✓ ✕ ✓ ✓
Roaming ✓ ✕ ✕ ✕ ✓ ✓
✓ Will rebroadcast announce
✕ Will not rebroadcast announce
.. _understanding-primitives: .. _understanding-primitives:
Cryptographic Primitives Cryptographic Primitives
------------------------ ------------------------
Reticulum uses a simple suite of efficient, strong and well-tested cryptographic Reticulum uses a simple suite of efficient, strong and well-tested cryptographic primitives, with widely available implementations that can be used both on general-purpose CPUs and on microcontrollers.
primitives, with widely available implementations that can be used both on
general-purpose CPUs and on microcontrollers.
One of the primary considerations for choosing this particular set of primitives is One of the primary considerations for choosing this particular set of primitives is that they can be implemented *safely* with relatively few pitfalls, on practically all current computing platforms.
that they can be implemented *safely* with relatively few pitfalls, on practically
all current computing platforms.
The primitives listed here **are authoritative**. Anything claiming to be Reticulum, The primitives listed here **are authoritative**. Anything claiming to be Reticulum, but not using these exact primitives **is not** Reticulum, and possibly an intentionally compromised or weakened clone. The utilised primitives are:
but not using these exact primitives **is not** Reticulum, and possibly an
intentionally compromised or weakened clone. The utilised primitives are:
* Ed25519 for signatures * Ed25519 for signatures
@@ -980,12 +793,7 @@ intentionally compromised or weakened clone. The utilised primitives are:
* SHA-512 * SHA-512
In the default installation configuration, the ``X25519``, ``Ed25519`` and ``AES-256-CBC`` In the default installation configuration, the ``X25519``, ``Ed25519`` and ``AES-256-CBC`` primitives are provided by `OpenSSL <https://www.openssl.org/>`_ (via the `PyCA/cryptography <https://github.com/pyca/cryptography>`_ package). The hashing functions ``SHA-256`` and ``SHA-512`` are provided by the standard Python `hashlib <https://docs.python.org/3/library/hashlib.html>`_. The ``HKDF``, ``HMAC``, ``Token`` primitives, and the ``PKCS7`` padding function are always provided by the following internal implementations:
primitives are provided by `OpenSSL <https://www.openssl.org/>`_ (via the `PyCA/cryptography <https://github.com/pyca/cryptography>`_
package). The hashing functions ``SHA-256`` and ``SHA-512`` are provided by the standard
Python `hashlib <https://docs.python.org/3/library/hashlib.html>`_. The ``HKDF``, ``HMAC``,
``Token`` primitives, and the ``PKCS7`` padding function are always provided by the
following internal implementations:
- ``RNS/Cryptography/HKDF.py`` - ``RNS/Cryptography/HKDF.py``
- ``RNS/Cryptography/HMAC.py`` - ``RNS/Cryptography/HMAC.py``
@@ -993,17 +801,9 @@ following internal implementations:
- ``RNS/Cryptography/PKCS7.py`` - ``RNS/Cryptography/PKCS7.py``
Reticulum also includes a complete implementation of all necessary primitives in pure Python. Reticulum also includes a complete implementation of all necessary primitives in pure Python. If OpenSSL & PyCA are not available on the system when Reticulum is started, Reticulum will instead use the internal pure-python primitives. A trivial consequence of this is performance, with the OpenSSL backend being *much* faster. The most important consequence however, is the potential loss of security by using primitives that has not seen the same amount of scrutiny, testing and review as those from OpenSSL.
If OpenSSL & PyCA are not available on the system when Reticulum is started, Reticulum will
instead use the internal pure-python primitives. A trivial consequence of this is performance,
with the OpenSSL backend being *much* faster. The most important consequence however, is the
potential loss of security by using primitives that has not seen the same amount of scrutiny,
testing and review as those from OpenSSL.
Using the normal RNS installation procedures, it is not possible to install Reticulum on a Using the normal RNS installation procedures, it is not possible to install Reticulum on a system without the required OpenSSL primitives being available, and if they are not, they will be resolved and installed as a dependency. It is only possible to use the pure-python primitives by manually specifying this, for example by using the ``rnspure`` package.
system without the required OpenSSL primitives being available, and if they are not, they will
be resolved and installed as a dependency. It is only possible to use the pure-python primitives
by manually specifying this, for example by using the ``rnspure`` package.
.. warning:: .. warning::
If you want to use the internal pure-python primitives, it is **highly advisable** that you If you want to use the internal pure-python primitives, it is **highly advisable** that you
+32 -33
View File
@@ -1002,39 +1002,35 @@ available. These are only recognised immediately after a newline character:
destination hexadecimal hash of the destination to connect to destination hexadecimal hash of the destination to connect to
options: options:
-h, --help show this help message and exit -h, --help show this help message and exit
--config, -c CONFIG path to alternative Reticulum config directory --config, -c PATH path to config directory
--identity, -i IDENTITY --rnsconfig, -c PATH path to alternative Reticulum config directory
path to identity file to use --identity, -i IDENTITY path to identity file to use
-v, --verbose increase verbosity -v, --verbose increase verbosity
-q, --quiet decrease verbosity -q, --quiet decrease verbosity
-p, --print-identity print identity and destination info and exit -p, --print-identity print identity and destination info and exit
--version show program's version number and exit --version show program's version number and exit
-l, --listen listen (server) mode; any command specified after -- -l, --listen listen (server) mode; any command specified after --
will be used as the default command when the initiator will be used as the default command when the initiator
does not provide one or when remote command execution does not provide one or when remote command execution
is disabled; if no command is specified, the default is disabled; if no command is specified, the default
shell of the user running rnsh will be used shell of the user running rnsh will be used
-s, --service SERVICE -s, --service SERVICE service name for identity file if not the default
service name for identity file if not the default -b, --announce PERIOD announce on startup and every PERIOD seconds; specify
-b, --announce PERIOD 0 to announce on startup only
announce on startup and every PERIOD seconds; specify -a, --allowed HASH allow this identity to connect (may be specified
0 to announce on startup only multiple times); allowed identities can also be
-a, --allowed HASH allow this identity to connect (may be specified specified in ~/.rnsh/allowed_identities or
multiple times); allowed identities can also be ~/.config/rnsh/allowed_identities, one hash per line
specified in ~/.rnsh/allowed_identities or -n, --no-auth disable authentication (allow any identity to connect)
~/.config/rnsh/allowed_identities, one hash per line
-n, --no-auth disable authentication (allow any identity to connect)
-A, --remote-command-as-args -A, --remote-command-as-args
concatenate remote command to the argument list of the concatenate remote command to the argument list of the
default program or shell default program or shell
-C, --no-remote-command -C, --no-remote-command disable executing command lines received from the
disable executing command lines received from the remote initiator
remote initiator -N, --no-id disable identity announcement on connect
-N, --no-id disable identity announcement on connect -m, --mirror return with the exit code of the remote process
-m, --mirror return with the exit code of the remote process -w, --timeout SECONDS connect and request timeout in seconds
-w, --timeout SECONDS
connect and request timeout in seconds
When specifying a command to execute, separate rnsh options from the command When specifying a command to execute, separate rnsh options from the command
and its arguments with --. For example: and its arguments with --. For example:
@@ -1316,7 +1312,7 @@ To see all identities currently blackholed on your local instance, use the ``-b`
Automated List Sourcing Automated List Sourcing
======================= =======================
Manually blocking identities is effective for immediate threats, but maintaining an up-to-date blocklist for a large network is impractical. Reticulum supports **automated list sourcing**, allowing your node to subscribe to blackhole lists maintained by trusted peers, or a central authority you manage yourself. Manually blocking identities is effective for immediate threats and annoyances, but maintaining an up-to-date blocklist across many nodes on a large network is impractical. Reticulum supports **automated list sourcing**, allowing your node to subscribe to blackhole lists maintained by trusted peers, or a central authority you manage yourself.
.. warning:: .. warning::
**Verify Before Subscribing!** Subscribing to a blackhole source is a powerful action that grants that source the ability to dictate who you can communicate with. Before adding a source to your configuration, verify that the maintainer aligns with your usage policy and values. Blindly subscribing to untrusted lists could inadvertently block legitimate peers or essential services. **Verify Before Subscribing!** Subscribing to a blackhole source is a powerful action that grants that source the ability to dictate who you can communicate with. Before adding a source to your configuration, verify that the maintainer aligns with your usage policy and values. Blindly subscribing to untrusted lists could inadvertently block legitimate peers or essential services.
@@ -1333,6 +1329,9 @@ To enable automated sourcing, add the ``blackhole_sources`` option to the ``[ret
... ...
# Automatically fetch blackhole lists from these trusted sources # Automatically fetch blackhole lists from these trusted sources
blackhole_sources = 521c87a83afb8f29e4455e77930b973b, 68a4aa91ac350c4087564e8a69f84e86 blackhole_sources = 521c87a83afb8f29e4455e77930b973b, 68a4aa91ac350c4087564e8a69f84e86
# Optional update interval, defaults to one hour
blackhole_update_interval = 60
... ...
**How It Works** **How It Works**
BIN
View File
Binary file not shown.
+1
View File
@@ -58,6 +58,7 @@ setuptools.setup(
'rnpkg=RNS.Utilities.rnpkg:main', 'rnpkg=RNS.Utilities.rnpkg:main',
'rnsh=RNS.Utilities.rnsh.rnsh:main', 'rnsh=RNS.Utilities.rnsh.rnsh:main',
'rngit=RNS.Utilities.rngit.server:main', 'rngit=RNS.Utilities.rngit.server:main',
'rngcs=RNS.Utilities.rngit.commitsigs:main',
'git-remote-rns=RNS.Utilities.rngit.client:main', 'git-remote-rns=RNS.Utilities.rngit.client:main',
'rnodeconf=RNS.Utilities.rnodeconf:main', 'rnodeconf=RNS.Utilities.rnodeconf:main',
] ]