Compare commits

...
88 Commits
Author SHA1 Message Date
Mark Qvist f55c0c6ea6 Added security notice 2026-11-20 13:50:26 +01:00
Mark Qvist 840eb3699b Added rngit media conversion max input size cap, improved logging and error handling 2026-11-19 17:50:22 +01:00
Mark Qvist cff4d03fdb Updated changelog 2026-11-18 18:41:56 +01:00
Mark Qvist 528986836b Raised listener backlogs 2026-11-18 18:39:22 +01:00
Mark Qvist 01ffb98ee5 Local link traffic counting 2026-11-18 17:26:30 +01:00
Mark Qvist eb00622fef Cleanup 2026-11-18 17:10:30 +01:00
Mark Qvist e8b3b14b73 Classic 2026-11-18 17:06:49 +01:00
Mark Qvist ef3e80868e Added link traffic stats 2026-11-18 16:51:41 +01:00
Mark Qvist 48ba76df9c Catch announce unpack failure 2026-11-18 15:20:41 +01:00
Mark Qvist 41260ea163 Added path state info to path table getters 2026-11-18 15:10:12 +01:00
Mark Qvist 1f7cd14513 Cleanup and fixes 2026-11-18 14:37:52 +01:00
Mark Qvist b9903c53a8 Analysis mode capture argument 2026-11-18 14:30:54 +01:00
Mark Qvist 1a71073cc0 Initial rnpath analysis stub 2026-11-18 14:16:32 +01:00
Mark Qvist f7b54ccc11 Added prettynamehash convenience function 2026-11-18 14:07:56 +01:00
Mark Qvist 3f55e9ebeb Added flagged destination type map, added per-link traffic counter, added link distribution stats getter 2026-11-18 14:07:16 +01:00
Mark Qvist c90a5d5887 Added destination type loading 2026-11-18 14:05:09 +01:00
Mark Qvist 9568b70458 Improved rnpath display and filtering options 2026-11-18 12:18:33 +01:00
Mark Qvist 8e7dc8b776 Added medium reliability flag to interfaces 2026-11-18 11:25:28 +01:00
Mark Qvist 4a058544a5 Well, yeah 2026-11-18 01:00:18 +01:00
Mark Qvist 8c73e203b1 Don't rebroadcast on unresponsive path lenient table insertions 2026-11-18 00:17:46 +01:00
Mark Qvist 70eb417d90 Fixed non path table resident shared local instance destination path response announces broadcasting on all interfaces instead of requestor only 2026-11-17 23:10:52 +01:00
Mark Qvist 5bd93ad979 Ensure link-based rediscovery does not occur for instance-local paths 2026-11-17 22:21:27 +01:00
Mark Qvist d72cfdd7f0 Mark local client paths responsive on PR responses 2026-11-17 21:26:37 +01:00
Mark Qvist 833f6cf2aa Fixed path table culling being able to remove an instance's own local destination paths. Doh. 2026-11-17 20:28:16 +01:00
Mark Qvist 05ac4bba8e Added ability to configure destination value and link cost to rngit 2026-11-17 17:00:03 +01:00
Mark Qvist 0123133e71 Fixed CPython process fork stdin close deadlock 2026-11-17 14:05:35 +01:00
Mark Qvist f876ed8dd9 Show remote transport status on tunnels 2026-11-17 03:53:38 +01:00
Mark Qvist 48c7706188 Load known destinations over RPC in split mode 2026-11-17 03:37:01 +01:00
Mark Qvist 4916017aee Abort early on non-enabled link mode 2026-11-17 03:01:36 +01:00
Mark Qvist 12b2b8c013 Updated link tests 2026-11-17 03:00:06 +01:00
Mark Qvist cc5d6dd065 Logging 2026-11-17 01:58:01 +01:00
Mark Qvist 25cce0a847 Ensure transport identity availability before early tunnel synthesis 2026-11-17 01:16:53 +01:00
Mark Qvist 2b1a984c91 Fixed IFAC identity not being available at early tunnel synthesis 2026-11-17 01:16:16 +01:00
Mark Qvist 338df09607 Updated docs 2026-11-16 17:55:46 +01:00
Mark Qvist aecc1547da Set sane autoconnect caps 2026-11-16 17:24:54 +01:00
Mark Qvist da368e05e7 Deduplicate in-flight announce rebroadcasts 2026-11-16 15:30:18 +01:00
Mark Qvist 884f109b2b Fixed missing wanted destination type for interface discovery 2026-11-15 16:53:08 +01:00
Mark Qvist fd36a97220 Updated version 2026-11-15 14:57:56 +01:00
Mark Qvist 51fa841327 Enabled stamp generation 2026-11-15 14:57:39 +01:00
Mark Qvist b7a93b9b6b Bidirectional tunnel synthesis and stamp cost exchange on non shared-medium interfaces 2026-11-15 14:55:49 +01:00
Mark Qvist 13b98a6bc2 Cleaned up tunnel synthesis handler 2026-11-15 12:25:53 +01:00
Mark Qvist e35bd08f18 Only run instance teardown at exit from main process 2026-11-15 12:00:35 +01:00
Mark Qvist 715707b1bf Excessive non transport-inserted announce payload protocol violation 2026-11-15 11:16:58 +01:00
Mark Qvist d077d1ab00 Ensure announce conforms to downstream transport insertion MTU at pack time 2026-11-15 10:39:01 +01:00
Mark Qvist bb63dd4406 Added per-interface hop_limiter option 2026-11-15 00:25:18 +01:00
Mark Qvist e96c81c3f2 Added ability to filter destination types by hash 2026-11-15 00:10:54 +01:00
Mark Qvist 29ce7ca568 Fixed exit handler deadlock if signal arrives in the middle of an RPC call 2026-11-14 23:33:55 +01:00
Mark Qvist ad6c709e80 Ensure early tunnel synthesis on TCP and I2P interfaces 2026-11-14 19:01:18 +01:00
Mark Qvist f361a354ba Ensure early tunnel synthesis on BackboneInterface 2026-11-14 18:35:10 +01:00
Mark Qvist 096e6726b4 Added announce ingress prefiltering in inbound preprocessing 2026-11-14 17:35:55 +01:00
Mark Qvist a450be5d7e Raised announce validation caches to 384 2026-11-14 15:19:11 +01:00
Mark Qvist 85d3697938 Pre-emptively cull held announce queue for useless announces 2026-11-14 15:18:53 +01:00
Mark Qvist 29dc449af8 Traffic counting 2026-11-14 13:27:01 +01:00
Mark Qvist c850cdac6c Traffic counting 2026-11-14 02:14:38 +01:00
Mark Qvist 350b7e2614 Added ability to blackhole remote transport nodes 2026-11-14 01:06:46 +01:00
Mark Qvist 56b23c4810 Typo 2026-11-14 00:37:07 +01:00
Mark Qvist 464e75986e Added remote transport ID info to rnstatus 2026-11-13 23:26:46 +01:00
Mark Qvist 3281e28315 Added tunnel info to rnstatus 2026-11-13 23:02:08 +01:00
Mark Qvist daec67a116 Cleanup 2026-11-13 21:56:01 +01:00
Mark Qvist 819076c378 Track filtered announce count per interface 2026-11-13 21:51:00 +01:00
Mark Qvist d183791956 Refactored traffic accounting 2026-11-13 20:37:52 +01:00
Mark Qvist 01e7ed8443 Refactored traffic accounting 2026-11-13 20:18:51 +01:00
Mark Qvist d5f1e014db Persist and load announce rate table 2026-11-13 16:50:24 +01:00
Mark Qvist 6852971d3c Logging cleanup 2026-11-13 13:21:14 +01:00
Mark Qvist 04585ff2a8 Cleanup 2026-11-13 10:54:53 +01:00
Mark Qvist 54159d1d93 Cleanup 2026-11-13 10:40:11 +01:00
Mark Qvist 134dc6777c Added filtered traffic stats and display in rnstatus 2026-11-13 01:07:12 +01:00
Mark Qvist 20e25a9f0c Filter destinations at path table load time 2026-11-13 00:05:34 +01:00
Mark Qvist 9b6b724b08 Diagnostics 2026-11-12 20:17:34 +01:00
Mark Qvist f96cef7ed9 Drop announces early when held announces is full 2026-11-12 20:17:24 +01:00
Mark Qvist db67adea0a Fixed path usage display 2026-11-12 20:16:22 +01:00
Mark Qvist 3c4b271f41 Added client_limit option to BackboneInterface 2026-11-12 11:25:01 +01:00
Mark Qvist 5f2dbc169d Added ability to load a blocked_ips file from the current config dir 2026-11-12 11:24:45 +01:00
Mark Qvist 9ef6c90ea6 Use RLock in logging 2026-11-12 11:13:17 +01:00
Mark Qvist 0bc5c37c39 Reset DPEC on reconnect 2026-11-11 22:25:05 +01:00
Mark Qvist 1855f9927f Cleanup 2026-11-11 20:04:05 +01:00
Mark Qvist 70b9d58f15 Cleaned up announce cap properties 2026-11-11 19:48:29 +01:00
Mark Qvist 7852f53a4c Always init announce_queue 2026-11-11 15:42:14 +01:00
Mark Qvist 3ac3236b2f Updated stale doc defaults 2026-11-11 14:11:11 +01:00
Mark Qvist 023849ed29 Improved path pool and tunnel culling 2026-11-11 13:27:03 +01:00
Mark Qvist 50b6733a1c Cleanup 2026-11-11 11:41:07 +01:00
Mark Qvist 16621a78e3 Made max stamp workers and worker niceness configurable 2026-11-10 10:49:44 +01:00
Mark Qvist 132ec70f75 Cleanup 2026-11-10 10:27:01 +01:00
Mark Qvist aaf08e6107 Transitionally accept both non-expanded and expanded workblock discovery stamps 2026-11-10 00:51:02 +01:00
Mark Qvist 2c7cf8272b Future workblock generation 2026-11-09 23:36:59 +01:00
Mark Qvist c5d205ffea Updated docs 2026-11-08 14:17:30 +01:00
Mark Qvist e0da9c381e Updated docs 2026-11-08 13:03:52 +01:00
Mark Qvist d4af18fd6f Fixed typos 2026-11-08 01:12:08 +01:00
76 changed files with 2207 additions and 515 deletions

No files matched your search

+70 -28
View File
@@ -1,3 +1,73 @@
### RNS 1.6.1
This release brings yet another round of major efficiency, performance and filtering improvements to RNS, and continues the transition towards full network stamp functionality.
All network stamp types will now be generated and emitted by default. Expect some CPU load once your applications start up for the first time on `1.6.1`, as destination stamps are generated.
**Changes**
- Enabled network stamp generation by default
- Added ability to filter destination types by hash
- Added hop limiter options both globally and per-interface
- Added super fast announce ingress pre-filtering
- Added filtered traffic stats to `rnstatus`
- Added link traffic stats to `rnstatus`
- Added display of remote transport IDs per client interface in `rnstatus`.
- Ability to inspect filtered traffic, announces, et cetera in `rnstatus` per interface
- Ability to inspect tunnel properties, stamp costs, remote implementation info and more in `rnstatus`
- Added ability to set `client_limit` on `BackboneInterface`, defaults to 500
- Added ability to configure the maximum amount of stamp workers and worker niceness
- Added ability to place a `blocked_ips` file in your config directory to permanently block IPs
- Added ability to directly blackhole remote transport nodes
- Added ability to configure stamp values and costs for `rngit`
- Added asynchronous, interleaved held announce queue cleaning across all interfaces based on potential announce usability
- Added bidirectional tunnel synthesis on non shared-medium interfaces, with stamp cost and version signalling
- Added announce rate table persistence between instance restarts
- Added default caps for configured auto-connect interface counts
- Added path state info to API path table getters
- Significantly optimized and improved inbound announce filtering and deduplication
- Significantly optimized and reworked the filtering subsystem for scalability across hundreds of interfaces
- Improved `rnpath` display and filtering options
- Improved traffic counting
- Improved path responsiveness tracking
- Improved protocol violation tracking and logging
- Improved path pool and tunnel table culling
- Tuned announce validation caches and other parameters
- Fixed a regression introduced in `1.6.0`, that could cause path table culling to temporarily remove an instance's own local destination paths
- Fixed dataplane egress control state not resetting on `BackboneInterface` client connection recovery
- Fixed a potential logging deadlock
- Fixed a potential exit handler deadlock if a signal arrives mid RPC call
- Fixed missing wanted destination type for interface discovery when local announce filtering was enabled
- Fixed split-instance initial known-destinations load not being available on Android
- Added mitigation for a CPython process fork deadlock dug in stdin handling
**Verified Retrieval**
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
rngit release rns://7649a50d84610232d1416b41d2896aff/reticulum/reticulum fetch latest:all --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 `rngit` or `rnid`. To perform an offline verification of all release artifacts using a manifest:
```sh
rngit release rns_*.rsm verify --signer bc7291552be7a58f361522990465165c
```
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
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.
### RNS 1.6.0
This major release of Reticulum brings significant improvements to resource consumption, performance, stability and resilience, especially for constrained devices and nodes.
@@ -74,34 +144,6 @@ The `1.6.0` and `1.6.1` releases will be an important time for observing the on-
- Fixed various minor bugs and inconsistencies
- Updated documentation
**Verified Retrieval**
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
rngit release rns://7649a50d84610232d1416b41d2896aff/reticulum/reticulum fetch latest:all --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 `rngit` or `rnid`. To perform an offline verification of all release artifacts using a manifest:
```sh
rngit release rns_*.rsm verify --signer bc7291552be7a58f361522990465165c
```
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
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.
### 2026-10-05: RNS 1.5.7
This maintenance release fixes a bug in the dataplane egress control handling.
+14 -3
View File
@@ -323,9 +323,19 @@ class InterfaceAnnounceHandler:
stamp = app_data[-self.stamper.STAMP_SIZE:]
packed = app_data[:-self.stamper.STAMP_SIZE]
infohash = RNS.Identity.full_hash(packed)
workblock = self.stamper.stamp_workblock(infohash, expand_rounds=InterfaceAnnouncer.WORKBLOCK_EXPAND_ROUNDS)
value = self.stamper.stamp_value(workblock, stamp)
valid = self.stamper.stamp_valid(stamp, self.required_value, workblock)
# Transitory mechanism, check non-expanded workblock validity first.
workblock_ne = self.stamper.stamp_workblock(infohash, expand_rounds=0)
valid_ne = self.stamper.stamp_valid(stamp, self.required_value, workblock_ne)
if valid_ne:
value = self.stamper.stamp_value(workblock_ne, stamp)
valid = valid_ne
else:
workblock = self.stamper.stamp_workblock(infohash, expand_rounds=InterfaceAnnouncer.WORKBLOCK_EXPAND_ROUNDS)
value = self.stamper.stamp_value(workblock, stamp)
valid = self.stamper.stamp_valid(stamp, self.required_value, workblock)
self.valid_cache[fullhash] = {"valid": valid, "value": value, "packed": packed, "stamp": stamp}
while len(self.valid_cache) > self.valid_cache_max: self.valid_cache.pop(next(iter(self.valid_cache)))
@@ -510,6 +520,7 @@ class InterfaceDiscovery():
if not os.path.isdir(self.storagepath): os.makedirs(self.storagepath)
if discover_interfaces:
RNS.Reticulum.get_instance().wants_destination_type("rnstransport.discovery.interface")
self.handler = InterfaceAnnounceHandler(callback=self.interface_discovered, required_value=self.required_value)
RNS.Transport.register_announce_handler(self.handler)
threading.Thread(target=self.connect_discovered, daemon=True).start()
+27 -19
View File
@@ -266,11 +266,19 @@ class Identity:
count += 1
store.close()
RNS.log(f"Loaded {count} known destinations from shared instance database", RNS.LOG_VERBOSE)
RNS.log(f"Loaded {count} known destinations from shared instance", RNS.LOG_VERBOSE)
except Exception as e:
with Identity.known_destinations_lock: Identity.known_destinations = {}
RNS.log("Could not load known destinations from shared instance database, continuing with an empty table. The contained exception was: "+str(e), RNS.LOG_ERROR)
try:
RNS.log(f"Could not load known destinations from shared instance database: {e}", RNS.LOG_DEBUG)
RNS.log(f"Potentially running in split mode, attempting to load known destinations over RPC...", RNS.LOG_DEBUG)
known_destinations = RNS.Reticulum.get_instance().get_known_destinations() or {}
with Identity.known_destinations_lock: Identity.known_destinations = known_destinations
RNS.log(f"Loaded {len(Identity.known_destinations)} known destinations from shared instance", RNS.LOG_VERBOSE)
except Exception as e:
with Identity.known_destinations_lock: Identity.known_destinations = {}
RNS.log(f"Could not load known destinations from shared instance: {e}", RNS.LOG_ERROR)
return
@@ -680,7 +688,7 @@ class Identity:
Identity.announce_invalid_cache = {}
__valid_cache_count = 0
__valid_cache_max = 128
__valid_cache_max = 384
@staticmethod
def __cache_valid_announce(result):
Identity.__valid_cache_count += 1
@@ -699,7 +707,7 @@ class Identity:
return True
__invalid_cache_count = 0
__invalid_cache_max = 128
__invalid_cache_max = 384
@staticmethod
def __cache_invalid_announce(packet, signal=None, stamp_value=None):
Identity.__invalid_cache_count += 1
@@ -725,20 +733,20 @@ class Identity:
if r["ratchet"]: Identity._remember_ratchet(r["destination_hash"], r["ratchet"])
valid_announce_loglevel = RNS.LOG_EXTREME # TODO: Reset to LOG_EXTREME
if RNS.sl(valid_announce_loglevel):
if r["rssi"] != None or r["snr"] != None:
signal_str = " ["
if r["rssi"] != None:
signal_str += "RSSI "+str(r["rssi"])+"dBm"
if r["snr"] != None: signal_str += ", "
if r["snr"] != None: signal_str += "SNR "+str(r["snr"])+"dB"
signal_str += "]"
else: signal_str = ""
valid_announce_loglevel = RNS.LOG_EXTREME
if RNS.sl(valid_announce_loglevel):
if r["rssi"] != None or r["snr"] != None:
signal_str = " ["
if r["rssi"] != None:
signal_str += "RSSI "+str(r["rssi"])+"dBm"
if r["snr"] != None: signal_str += ", "
if r["snr"] != None: signal_str += "SNR "+str(r["snr"])+"dB"
signal_str += "]"
else: signal_str = ""
via_str = f" via {RNS.prettyhexrep(r['transport_id'])}" if r["transport_id"] else ""
val_str = f" (v:{RNS.prettycost(r['stamp_value'])})"
RNS.log(f"Valid announce for {RNS.prettyhexrep(r['destination_hash'])}{val_str} {r['hops']} hops away, received{via_str} on {r['receiving_interface']}{signal_str}", valid_announce_loglevel)
via_str = f" via {RNS.prettyhexrep(r['transport_id'])}" if r["transport_id"] else ""
val_str = f" (v:{RNS.prettycost(r['stamp_value'])})"
RNS.log(f"Valid announce for {RNS.prettyhexrep(r['destination_hash'])}{val_str} {r['hops']} hops away, received{via_str} on {r['receiving_interface']}{signal_str}", valid_announce_loglevel)
return True
@@ -943,7 +951,7 @@ class Identity:
@staticmethod
def persist_data(background=False):
if not RNS.Transport.owner.is_connected_to_shared_instance:
if hasattr(RNS.Transport, "owner") and not RNS.Transport.owner.is_connected_to_shared_instance:
if Identity.known_destinations_store != None: Identity.flush_known_destinations()
else: Identity.save_known_destinations_legacy(background=background)
+1 -3
View File
@@ -266,9 +266,7 @@ class AX25KISSInterface(Interface):
def process_incoming(self, data):
if (len(data) > AX25.HEADER_SIZE):
self.rxb += len(data)
self.owner.inbound(data[AX25.HEADER_SIZE:], self)
if (len(data) > AX25.HEADER_SIZE): self.owner.inbound(data[AX25.HEADER_SIZE:], self)
def process_outgoing(self,data):
-2
View File
@@ -663,8 +663,6 @@ class AutoInterfacePeer(Interface):
self.owner.refresh_peer(self.addr)
self.owner.mif_deque.append(data_hash)
self.owner.mif_deque_times.append([data_hash, time.time()])
self.rxb += len(data)
self.owner.rxb += len(data)
self.owner.owner.inbound(data, self)
def process_outgoing(self, data):
+38 -20
View File
@@ -52,6 +52,8 @@ class BackboneInterface(Interface):
fast_flapping_lock = threading.Lock()
fast_flapping = {}
CLIENT_LIMIT = 500
DP_IC_HIGH_WM_PCT = 90
DP_IC_MID_WM_PCT = 68
DP_IC_LOW_WM_PCT = 10
@@ -135,6 +137,7 @@ class BackboneInterface(Interface):
port = int(c["port"]) if "port" 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
client_limit = int(c["client_limit"]) if "client_limit" in c else None
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
@@ -152,6 +155,9 @@ class BackboneInterface(Interface):
self.mode = RNS.Interfaces.Interface.Interface.MODE_FULL
self.spawned_interfaces = []
self.supports_discovery = True
self.tunnels_allowed = True
self.lossless_medium = True
self.client_limit = client_limit or self.CLIENT_LIMIT
self.block_fast_flapping = flap_block
self.fast_flap_threshold = flap_threshold
self.fast_flap_grace = flap_grace
@@ -284,7 +290,7 @@ class BackboneInterface(Interface):
server_socket.bind(bind_address)
else: raise TypeError(f"Invalid socket type {socket_type} for {interface}")
server_socket.listen(1)
server_socket.listen(16)
server_socket.setblocking(0)
BackboneInterface.listener_filenos[server_socket.fileno()] = (interface, server_socket)
BackboneInterface.epoll.register(server_socket.fileno(), select.EPOLLIN)
@@ -687,6 +693,8 @@ class BackboneInterface(Interface):
def incoming_connection(self, socket):
try:
if len(self.spawned_interfaces) >= self.client_limit: return False
remote_ip = socket.getpeername()[0]
remote_port = str(socket.getpeername()[1])
if self.blocked_ip_count > 0:
@@ -750,6 +758,7 @@ class BackboneInterface(Interface):
spawned_interface.announce_rate_penalty = self.announce_rate_penalty
spawned_interface.mode = self.mode
spawned_interface.gravity = self.gravity
spawned_interface.hop_limiter = self.hop_limiter
spawned_interface.recursive_prs = self.recursive_prs
spawned_interface.announces_from_internal = self.announces_from_internal
spawned_interface.announces_to_internal = self.announces_to_internal
@@ -877,6 +886,7 @@ class BackboneClientInterface(Interface):
self.OUT = False
self.socket = None
self.parent_interface = None
self.tunnels_allowed = True
self.name = name
self.initiator = False
self.reconnecting = False
@@ -884,6 +894,7 @@ class BackboneClientInterface(Interface):
self.owner = owner
self.online = False
self.detached = False
self.lossless_medium = True
self.prefer_ipv6 = prefer_ipv6
self.i2p_tunneled = i2p_tunneled
self.mode = RNS.Interfaces.Interface.Interface.MODE_FULL
@@ -913,25 +924,21 @@ class BackboneClientInterface(Interface):
self.target_port = target_port
self.initiator = True
if connect_timeout != None:
self.connect_timeout = connect_timeout
else:
self.connect_timeout = BackboneClientInterface.INITIAL_CONNECT_TIMEOUT
if BackboneClientInterface.SYNCHRONOUS_START:
self.initial_connect()
else:
thread = threading.Thread(target=self.initial_connect)
thread.daemon = True
thread.start()
if connect_timeout != None: self.connect_timeout = connect_timeout
else: self.connect_timeout = BackboneClientInterface.INITIAL_CONNECT_TIMEOUT
def final_init(self):
if BackboneClientInterface.SYNCHRONOUS_START: self.initial_connect()
else:
thread = threading.Thread(target=self.initial_connect)
thread.daemon = True
thread.start()
def initial_connect(self):
if not self.connect(initial=True):
thread = threading.Thread(target=self.reconnect)
thread.daemon = True
thread.start()
else:
self.wants_tunnel = True
def set_timeouts_linux(self):
self.socket.setsockopt(socket.IPPROTO_TCP, socket.TCP_USER_TIMEOUT, int(BackboneClientInterface.TCP_USER_TIMEOUT * 1000))
@@ -959,6 +966,17 @@ class BackboneClientInterface(Interface):
self.socket = None
def early_synthesis(self, packet):
if not self.detached:
if not packet.packed: packet.pack()
if self.ifac_identity: raw = RNS.Transport.handle_outgoing_ifac(self, packet.raw);
else: raw = packet.raw
frame = HDLC.frame(raw)
if not self.transmit_buffer.append(frame, self.tx_hwm):
raise IOError("Transmit buffer overflow at early tunnel synthesis")
BackboneInterface.tx_ready(self)
def connect(self, initial=False):
try:
if initial:
@@ -982,7 +1000,11 @@ class BackboneClientInterface(Interface):
# TODO: Check missing setblocking(0)
self.socket.settimeout(None)
self.wants_tunnel = True
self.remote_transport = None
self.synthesis_received = False
BackboneInterface.add_client_socket(self.socket, self)
RNS.Transport.synthesize_tunnel(self)
self.online = True
if initial:
@@ -1007,6 +1029,7 @@ class BackboneClientInterface(Interface):
def reconnect(self):
if self.initiator:
if not self.reconnecting:
BackboneInterface._dp_ec_reset(self)
self.reconnecting = True
attempts = 0
while not self.online and not self.detached:
@@ -1028,7 +1051,6 @@ class BackboneClientInterface(Interface):
RNS.log("Reconnected socket for "+str(self)+".", RNS.LOG_INFO)
self.reconnecting = False
RNS.Transport.synthesize_tunnel(self)
else:
RNS.log("Attempt to reconnect on a non-initiator TCP interface. This should not happen.", RNS.LOG_ERROR)
@@ -1036,10 +1058,6 @@ class BackboneClientInterface(Interface):
def process_incoming(self, data):
if self.online and not self.detached:
self.rxb += len(data)
if hasattr(self, "parent_interface") and self.parent_interface != None:
self.parent_interface.rxb += len(data)
self.dp_ingress_packets += 1
self.owner.inbound(data, self)
+27 -8
View File
@@ -353,9 +353,11 @@ class I2PInterfacePeer(Interface):
self.online = False
self.detached = False
self.kiss_framing = False
self.tunnels_allowed = True
self.i2p_tunneled = True
self.i2p_dest = None
self.i2p_tunnel_ready = False
self.lossless_medium = True
self.mode = RNS.Interfaces.Interface.Interface.MODE_FULL
self.bitrate = I2PInterface.BITRATE_GUESS
self.last_read = 0
@@ -425,8 +427,6 @@ class I2PInterfacePeer(Interface):
while self.awaiting_i2p_tunnel: time.sleep(0.25)
time.sleep(2)
if not self.kiss_framing: self.wants_tunnel = True
if not self.connect(initial=True):
thread = threading.Thread(target=self.reconnect)
thread.daemon = True
@@ -479,10 +479,31 @@ class I2PInterfacePeer(Interface):
self.socket = None
def early_synthesis(self, packet):
if not self.detached:
if not packet.packed: packet.pack()
if self.ifac_identity: raw = RNS.Transport.handle_outgoing_ifac(self, packet.raw);
else: raw = packet.raw
if self.kiss_framing: frame = bytes([KISS.FEND])+bytes([KISS.CMD_DATA])+KISS.escape(raw)+bytes([KISS.FEND])
else: frame = bytes([HDLC.FLAG])+HDLC.escape(raw)+bytes([HDLC.FLAG])
self.socket.sendall(frame)
self.txb += len(frame)
self.last_write = time.time()
if hasattr(self, "parent_interface") and self.parent_interface != None and self.parent_count: self.parent_interface.txb += len(frame)
def connect(self, initial=False):
try:
self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.socket.connect((self.target_ip, self.target_port))
if not self.kiss_framing:
self.wants_tunnel = True
self.remote_transport = None
self.synthesis_received = False
RNS.Transport.synthesize_tunnel(self)
self.online = True
except Exception as e:
@@ -500,8 +521,6 @@ class I2PInterfacePeer(Interface):
self.writing = False
self.never_connected = False
if not self.kiss_framing and self.wants_tunnel: RNS.Transport.synthesize_tunnel(self)
return True
def reconnect(self):
@@ -530,7 +549,6 @@ class I2PInterfacePeer(Interface):
thread = threading.Thread(target=self.read_loop)
thread.daemon = True
thread.start()
if not self.kiss_framing: RNS.Transport.synthesize_tunnel(self)
else:
RNS.log("Attempt to reconnect on a non-initiator I2P interface. This should not happen.", RNS.LOG_ERROR)
@@ -538,9 +556,6 @@ class I2PInterfacePeer(Interface):
def process_incoming(self, data):
if not data: return
self.rxb += len(data)
if hasattr(self, "parent_interface") and self.parent_interface != None and self.parent_count:
self.parent_interface.rxb += len(data)
self.owner.inbound(data, self)
def process_outgoing(self, data):
@@ -741,6 +756,7 @@ class I2PInterface(Interface):
self.owner = owner
self.connectable = connectable
self.i2p_tunneled = True
self.tunnels_allowed = True
self.peers = peers
self.mode = RNS.Interfaces.Interface.Interface.MODE_FULL
@@ -760,6 +776,7 @@ class I2PInterface(Interface):
self.ifac_netname = ifac_netname
self.ifac_netkey = ifac_netkey
self.supports_discovery = True
self.lossless_medium = True
self.online = False
@@ -790,6 +807,7 @@ class I2PInterface(Interface):
thread.daemon = True
thread.start()
def final_init(self):
if self.connectable:
def tunnel_job():
while True:
@@ -909,6 +927,7 @@ class I2PInterface(Interface):
spawned_interface.mode = self.mode
spawned_interface.recursive_prs = self.recursive_prs
spawned_interface.gravity = self.gravity
spawned_interface.hop_limiter = self.hop_limiter
spawned_interface.HW_MTU = self.HW_MTU
RNS.log("Spawned new I2PInterface Peer: "+str(spawned_interface), RNS.LOG_VERBOSE)
RNS.Transport.add_interface(spawned_interface)
+61 -13
View File
@@ -39,7 +39,6 @@ class Interface:
OUT = False
FWD = False
RPT = False
name = None
# Interface mode definitions
MODE_FULL = 0x01
@@ -69,7 +68,7 @@ class Interface:
# Maximum amount of ingress limited announces
# to hold at any given time.
MAX_HELD_ANNOUNCES = 256
MAX_HELD_ANNOUNCES = 64
# Control parameters
DEFAULT_GRAVITY = 0
@@ -96,12 +95,16 @@ class Interface:
DEFAULT_IFAC_SIZE = 16
def __init__(self):
self.name = None
self.rxb = 0
self.txb = 0
self.frxb = 0
self.ftxb = 0
self.arxb = 0
self.atxb = 0
self.arxc = 0
self.atxc = 0
self.afrxc = 0
self.prxb = 0
self.ptxb = 0
self.prxc = 0
@@ -115,6 +118,7 @@ class Interface:
self.__hash = None
self.announce_cap = RNS.Reticulum.ANNOUNCE_CAP/100.0
self.announce_allowed_at = 0
self.supports_discovery = False
self.discoverable = False
self.last_discovery_announce = 0
@@ -122,12 +126,27 @@ class Interface:
self.recursive_prs = False
self.announces_from_internal = True
self.announces_to_internal = None
self.is_local_shared_instance = False
self.parent_interface = None
self.spawned_interfaces = None
self.tunnel_id = None
self.local_tunnel_id = None
self.tunnels_allowed = False
self.synthesis_received = False
self.synthesis_emitted = False
self.wants_tunnel = False
self.remote_transport = None
self.ingress_control = True
self.hop_limiter = None
self.phy_keepalive = False
self.shared_medium = False
self.lossless_medium = False
self.remote_impl = None
self.remote_vers = None
self.remote_dst_cost = None
self.remote_pr_cost = None
self.remote_is_tn = None
self.ic_burst_active = False
self.ic_burst_activated = 0
@@ -148,7 +167,9 @@ class Interface:
self.ic_held_release_interval = RNS.Reticulum.get_instance()._default_ic_held_release_interval()
self.ec_pr_freq = RNS.Reticulum.get_instance()._default_ec_pr_freq()
self.egress_control = RNS.Reticulum.get_instance()._default_egress_control()
self.announce_queue = []
self.held_announces = {}
self.ifac_identity = None
self.transmit_buffer = None
self.ia_freq_deque = deque(maxlen=Interface.IA_FREQ_SAMPLES)
@@ -182,6 +203,8 @@ class Interface:
self.r_stat_snr = None
self.r_stat_q = None
self.is_connected_to_shared_instance = False
def get_hash(self):
if not self.__hash: self.__hash = RNS.Identity.full_hash(str(self).encode("utf-8"))
return self.__hash
@@ -273,11 +296,14 @@ class Interface:
def hold_announce(self, announce_packet):
if announce_packet.hops >= RNS.Transport.PATHFINDER_M-1:
return
return self.filtered_announce()
elif announce_packet.destination_hash in self.held_announces:
self.held_announces[announce_packet.destination_hash] = announce_packet
return self.filtered_announce()
elif not len(self.held_announces) >= self.ic_max_held_announces:
self.held_announces[announce_packet.destination_hash] = announce_packet
return True
else: return self.filtered_announce()
def process_held_announces(self):
try:
@@ -287,18 +313,32 @@ class Interface:
if ia_freq < freq_threshold:
selected_announce_packet = None
min_hops = RNS.Transport.PATHFINDER_M
for destination_hash in self.held_announces:
announce_packet = self.held_announces[destination_hash]
cull_entries = []
for destination_hash in self.held_announces.copy():
announce_packet = self.held_announces.get(destination_hash)
if not announce_packet: continue
# If we can determine that a held announce has become
# useless for any potential path table updates, we'll
# remove it immediately instead of waiting for it to
# eventually get released, freeing up other held queue
# slots for potentially useful new announces.
path_entry = RNS.Transport.path_table.get(destination_hash)
if path_entry and not RNS.Transport.announce_prefilter(announce_packet, path_entry):
cull_entries.append(destination_hash)
continue
if announce_packet.hops < min_hops:
min_hops = announce_packet.hops
selected_announce_packet = announce_packet
for destination_hash in cull_entries: self.held_announces.pop(destination_hash, None)
if selected_announce_packet != None:
RNS.log("Releasing held announce packet "+str(selected_announce_packet)+" from "+str(self), RNS.LOG_EXTREME)
self.ic_held_release = time.time() + self.ic_held_release_interval
self.held_announces.pop(selected_announce_packet.destination_hash)
def release(): RNS.Transport.inbound(selected_announce_packet.raw, selected_announce_packet.receiving_interface, tc=RNS.Transport.TC_INGRESS_LIMITED, ifac_handled=True)
threading.Thread(target=release, daemon=True).start()
self.held_announces.pop(selected_announce_packet.destination_hash, None)
RNS.Transport.inbound(selected_announce_packet.raw, selected_announce_packet.receiving_interface, tc=RNS.Transport.TC_INGRESS_LIMITED, ifac_handled=True)
except Exception as e:
RNS.log("An error occurred while processing held announces for "+str(self), RNS.LOG_ERROR)
@@ -307,25 +347,31 @@ class Interface:
def received_announce(self, size=0, from_spawned=False):
self.arxc += 1; self.arxb += size
self.ia_freq_deque.append(time.time())
if hasattr(self, "parent_interface") and self.parent_interface != None:
if self.parent_interface != None:
self.parent_interface.received_announce(size=size, from_spawned=True)
def sent_announce(self, size=0, from_spawned=False):
self.atxc += 1; self.atxb += size
self.oa_freq_deque.append(time.time())
if hasattr(self, "parent_interface") and self.parent_interface != None:
if self.parent_interface != None:
self.parent_interface.sent_announce(size=size, from_spawned=True)
def filtered_announce(self, size=0, from_spawned=False):
self.afrxc += 1
RNS.Transport.filtered_arxc += 1
if self.parent_interface != None: self.parent_interface.afrxc += 1
return None
def received_path_request(self, size=0, from_spawned=False):
self.prxc += 1; self.prxb += size
self.ip_freq_deque.append(time.time())
if hasattr(self, "parent_interface") and self.parent_interface != None:
if self.parent_interface != None:
self.parent_interface.received_path_request(size=size, from_spawned=True)
def sent_path_request(self, size=0, from_spawned=False):
self.ptxc += 1; self.ptxb += size
self.op_freq_deque.append(time.time())
if hasattr(self, "parent_interface") and self.parent_interface != None:
if self.parent_interface != None:
self.parent_interface.sent_path_request(size=size, from_spawned=True)
def protocol_violation(self, description=None, level=None):
@@ -408,10 +454,12 @@ class Interface:
return hz
def process_announce_queue(self):
if not self.announce_queue: return
if not hasattr(self, "announce_cap"):
self.announce_cap = RNS.Reticulum.ANNOUNCE_CAP/100.0
if hasattr(self, "announce_queue"):
if self.announce_queue:
try:
now = time.time()
stale = []
-1
View File
@@ -255,7 +255,6 @@ class KISSInterface(Interface):
def process_incoming(self, data):
if not data: return
self.rxb += len(data)
self.owner.inbound(data, self)
-3
View File
@@ -202,9 +202,6 @@ class LocalClientInterface(Interface):
except Exception as e: RNS.log(f"Exception occurred while sending keepalive on {self}: {e}", RNS.LOG_ERROR)
def process_incoming(self, data):
self.rxb += len(data)
if self.parent_interface != None: self.parent_interface.rxb += len(data)
try: self.owner.inbound(data, self)
except Exception as e:
RNS.log(f"An error occurred in the processing of an incoming frame for {self}: {e}", RNS.LOG_ERROR)
-1
View File
@@ -121,7 +121,6 @@ class PipeInterface(Interface):
def process_incoming(self, data):
if not data: return
self.rxb += len(data)
self.owner.inbound(data, self)
-1
View File
@@ -706,7 +706,6 @@ class RNodeInterface(Interface):
def process_incoming(self, data):
if not data: return
self.rxb += len(data)
self.owner.inbound(data, self)
def process_outgoing(self,data):
-1
View File
@@ -1130,7 +1130,6 @@ class RNodeSubInterface(Interface):
def process_incoming(self, data):
if not data: return
self.rxb += len(data)
self.owner.inbound(data, self)
def process_outgoing(self,data):
-1
View File
@@ -151,7 +151,6 @@ class SerialInterface(Interface):
def process_incoming(self, data):
if not data: return
self.rxb += len(data)
self.owner.inbound(data, self)
def process_outgoing(self,data):
+34 -18
View File
@@ -126,6 +126,8 @@ class TCPClientInterface(Interface):
self.writing = False
self.online = False
self.detached = False
self.tunnels_allowed = True
self.lossless_medium = True
self.kiss_framing = kiss_framing
self.i2p_tunneled = i2p_tunneled
self.mode = RNS.Interfaces.Interface.Interface.MODE_FULL
@@ -158,13 +160,13 @@ class TCPClientInterface(Interface):
self.connect_timeout = connect_timeout
else:
self.connect_timeout = TCPClientInterface.INITIAL_CONNECT_TIMEOUT
if TCPClientInterface.SYNCHRONOUS_START:
self.initial_connect()
else:
thread = threading.Thread(target=self.initial_connect)
thread.daemon = True
thread.start()
def final_init(self):
if TCPClientInterface.SYNCHRONOUS_START: self.initial_connect()
else:
thread = threading.Thread(target=self.initial_connect)
thread.daemon = True
thread.start()
def initial_connect(self):
if not self.connect(initial=True):
@@ -175,8 +177,6 @@ class TCPClientInterface(Interface):
thread = threading.Thread(target=self.read_loop)
thread.daemon = True
thread.start()
if not self.kiss_framing:
self.wants_tunnel = True
def set_timeouts_linux(self):
if not self.i2p_tunneled:
@@ -228,6 +228,20 @@ class TCPClientInterface(Interface):
self.socket = None
def early_synthesis(self, packet):
if not self.detached:
if not packet.packed: packet.pack()
if self.ifac_identity: raw = RNS.Transport.handle_outgoing_ifac(self, packet.raw);
else: raw = packet.raw
if self.kiss_framing: frame = bytes([KISS.FEND])+bytes([KISS.CMD_DATA])+KISS.escape(raw)+bytes([KISS.FEND])
else: frame = bytes([HDLC.FLAG])+HDLC.escape(raw)+bytes([HDLC.FLAG])
self.socket.sendall(frame)
self.txb += len(frame)
if hasattr(self, "parent_interface") and self.parent_interface != None:
self.parent_interface.txb += len(frame)
def connect(self, initial=False):
try:
if initial:
@@ -242,6 +256,13 @@ class TCPClientInterface(Interface):
self.socket.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
self.socket.connect(target_address)
self.socket.settimeout(None)
if not self.kiss_framing:
self.wants_tunnel = True
self.remote_transport = None
self.synthesis_received = False
RNS.Transport.synthesize_tunnel(self)
self.online = True
if initial:
@@ -282,9 +303,7 @@ class TCPClientInterface(Interface):
self.teardown()
break
try:
self.connect()
try: self.connect()
except Exception as e:
RNS.log("Connection attempt for "+str(self)+" failed: "+str(e), RNS.LOG_DEBUG)
@@ -295,8 +314,6 @@ class TCPClientInterface(Interface):
thread = threading.Thread(target=self.read_loop)
thread.daemon = True
thread.start()
if not self.kiss_framing:
RNS.Transport.synthesize_tunnel(self)
else:
RNS.log("Attempt to reconnect on a non-initiator TCP interface. This should not happen.", RNS.LOG_ERROR)
@@ -305,10 +322,6 @@ class TCPClientInterface(Interface):
def process_incoming(self, data):
if not data: return
if self.online and not self.detached:
self.rxb += len(data)
if hasattr(self, "parent_interface") and self.parent_interface != None:
self.parent_interface.rxb += len(data)
self.owner.inbound(data, self)
def process_outgoing(self, data):
@@ -533,6 +546,8 @@ class TCPServerInterface(Interface):
self.OUT = False
self.name = name
self.detached = False
self.tunnels_allowed = True
self.lossless_medium = True
self.i2p_tunneled = i2p_tunneled
self.mode = RNS.Interfaces.Interface.Interface.MODE_FULL
@@ -639,6 +654,7 @@ class TCPServerInterface(Interface):
spawned_interface.announce_rate_penalty = self.announce_rate_penalty
spawned_interface.mode = self.mode
spawned_interface.gravity = self.gravity
spawned_interface.hop_limiter = self.hop_limiter
spawned_interface.recursive_prs = self.recursive_prs
spawned_interface.announces_from_internal = self.announces_from_internal
spawned_interface.announces_to_internal = self.announces_to_internal
-1
View File
@@ -124,7 +124,6 @@ class UDPInterface(Interface):
def process_incoming(self, data):
if not data: return
self.rxb += len(data)
self.owner.inbound(data, self)
def process_outgoing(self,data):
+1 -3
View File
@@ -249,7 +249,6 @@ class WDCL():
self.online = True
def process_incoming(self, data):
self.rxb += len(data)
if self.device:
while len(self.frame_queue): self.device.incoming_frame(self.frame_queue.pop())
self.device.incoming_frame(data)
@@ -976,6 +975,7 @@ class WeaveInterface(Interface):
spawned_interface.mode = self.mode
spawned_interface.gravity = self.gravity
spawned_interface.hop_limiter = self.hop_limiter
spawned_interface.HW_MTU = self.HW_MTU
spawned_interface._online = True
@@ -1060,8 +1060,6 @@ class WeaveInterfacePeer(Interface):
self.owner.refresh_peer(self.endpoint_addr)
self.owner.mif_deque.append(data_hash)
self.owner.mif_deque_times.append([data_hash, time.time()])
self.rxb += len(data)
self.owner.rxb += len(data)
self.owner.owner.inbound(data, self)
def process_outgoing(self, data):
+2
View File
@@ -239,6 +239,7 @@ class Link:
def __init__(self, destination=None, established_callback=None, closed_callback=None, owner=None, peer_pub_bytes=None, peer_sig_pub_bytes=None, mode=MODE_DEFAULT):
if destination != None and destination.type != RNS.Destination.SINGLE: raise TypeError("Links can only be established to the \"single\" destination type")
if not mode in Link.ENABLED_MODES: raise TypeError(f"Requested link mode {Link.MODE_DESCRIPTIONS[mode]} not enabled")
self.mode = mode
self.link_id = None
self.rtt = None
@@ -1030,6 +1031,7 @@ class Link:
if packet.context != RNS.Packet.KEEPALIVE: self.last_data = self.last_inbound
self.rx += 1
self.rxbytes += len(packet.data)
RNS.Transport.link_rxb += len(packet.raw)
if self.status == Link.STALE: self.status = Link.ACTIVE
if packet.packet_type == RNS.Packet.DATA:
+15 -7
View File
@@ -116,12 +116,13 @@ class Packet:
__slots__ = "hops", "header", "header_type", "packet_type", "transport_type", "context", "context_flag", "destination"
__slots__ += "transport_id", "data", "flags", "raw", "packed", "sent", "create_receipt", "receipt", "fromPacked", "MTU"
__slots__ += "sent_at", "packet_hash", "ratchet_id", "attached_interface", "receiving_interface", "rssi", "snr", "q"
__slots__ += "ciphertext", "plaintext", "destination_hash", "destination_type", "link", "map_hash", "is_outbound_pr"
__slots__ += "traffic_class", "announce_signature_validated"
__slots__ += "sent_at", "packet_hash", "ratchet_id", "receiving_interface", "attached_interface", "blocked_interfaces"
__slots__ += "rssi", "snr", "q", "ciphertext", "plaintext", "destination_hash", "destination_type", "link", "map_hash"
__slots__ += "is_outbound_pr", "traffic_class", "announce_signature_validated"
def __init__(self, destination, data, packet_type = DATA, context = NONE, transport_type = RNS.Transport.BROADCAST,
header_type = HEADER_1, transport_id = None, attached_interface = None, create_receipt = True, context_flag=FLAG_UNSET):
def __init__(self, destination, data, packet_type=DATA, context=NONE, transport_type=RNS.Transport.BROADCAST,
header_type=HEADER_1, transport_id=None, attached_interface=None, blocked_interfaces=None,
create_receipt=True, context_flag=FLAG_UNSET):
if destination != None:
if transport_type == None:
@@ -163,6 +164,7 @@ class Packet:
self.traffic_class = None
self.announce_signature_validated = None
self.attached_interface = attached_interface
self.blocked_interfaces = blocked_interfaces
self.receiving_interface = None
self.is_outbound_pr = False
self.rssi = None
@@ -235,8 +237,13 @@ class Packet:
self.header += bytes([self.context])
self.raw = self.header + self.ciphertext
if self.packet_type == Packet.ANNOUNCE and self.header_type == Packet.HEADER_1:
transport_id_length = RNS.Reticulum.TRUNCATED_HASHLENGTH//8
if len(self.raw)+transport_id_length > self.MTU:
raise IOError(f"Transport-inserted announce packet size of {len(self.raw)+transport_id_length} exceeds MTU of {self.MTU} bytes")
if len(self.raw) > self.MTU:
raise IOError("Packet size of "+str(len(self.raw))+" exceeds MTU of "+str(self.MTU)+" bytes")
raise IOError(f"Packet size of {len(self.raw)} exceeds MTU of {self.MTU} bytes")
self.packed = True
self.update_hash()
@@ -279,7 +286,7 @@ class Packet:
return True
except Exception as e:
RNS.log(f"Received malformed packet, dropping it. The contained exception was: {e}", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None
RNS.log(f"Dropping malformed packet. The contained exception was: {e}", RNS.LOG_EXTREME) if RNS.sl(RNS.LOG_EXTREME) else None
return False
def send(self):
@@ -302,6 +309,7 @@ class Packet:
self.destination.last_outbound = time.time()
self.destination.tx += 1
self.destination.txbytes += len(self.ciphertext)
RNS.Transport.link_txb += len(self.raw)
if RNS.Transport.outbound(self): return self.receipt
else:
+200 -21
View File
@@ -53,6 +53,7 @@ import configparser
import multiprocessing.connection
import importlib.util
import threading
import weakref
import signal
import atexit
import struct
@@ -175,18 +176,35 @@ class Reticulum:
gracious_persist_lock = Lock()
__instance = None
__pid = os.getpid()
__interface_detach_ran = False
__exit_handler_ran = False
RPC_EXIT_TIMEOUT = 0.5
@staticmethod
def exit_handler():
# This exit handler is called whenever Reticulum is asked to
# shut down, and will in turn call exit handlers in other
# classes, saving necessary information to disk and carrying
# out cleanup operations.
if not os.getpid() == Reticulum.__pid:
Reticulum.__exit_handler_ran = True
if not Reticulum.__exit_handler_ran:
Reticulum.__exit_handler_ran = True
Reticulum.__instance.unwants_all_destination_types()
for conn in list(Reticulum.__open_rpc_conns):
try: conn.close()
except Exception: pass
try:
if Reticulum.__instance.is_connected_to_shared_instance:
deregister_job = threading.Thread(target=Reticulum.__instance.unwants_all_destination_types, daemon=True)
deregister_job.start()
deregister_job.join(timeout=Reticulum.RPC_EXIT_TIMEOUT)
if deregister_job.is_alive(): RNS.log("Shared instance RPC timed out during exit", RNS.LOG_DEBUG)
except Exception as e: RNS.log(f"Could not deregister destination types at exit: {e}", RNS.LOG_DEBUG)
if not Reticulum.__interface_detach_ran: RNS.Transport.detach_interfaces()
RNS.Transport.exit_handler()
RNS.Identity.exit_handler()
@@ -196,13 +214,13 @@ class Reticulum:
@staticmethod
def sigint_handler(signal, frame):
RNS.Transport.detach_interfaces()
if os.getpid() == Reticulum.__pid: RNS.Transport.detach_interfaces()
Reticulum.__interface_detach_ran = True
RNS.exit()
@staticmethod
def sigterm_handler(signal, frame):
RNS.Transport.detach_interfaces()
if os.getpid() == Reticulum.__pid: RNS.Transport.detach_interfaces()
Reticulum.__interface_detach_ran = True
RNS.exit()
@@ -213,6 +231,13 @@ class Reticulum:
"""
return Reticulum.__instance
@staticmethod
def get_instance_pid():
"""
Returns the main process ID of the currently running Reticulum instance.
"""
return Reticulum.__pid
def __init__(self,configdir=None, loglevel=None, logdest=None, verbosity=None,
require_shared_instance=False, shared_instance_type=None,
enable_stamping=False, enforce_stamps=False):
@@ -266,6 +291,9 @@ class Reticulum:
Reticulum.__discover_interfaces = False
Reticulum.__autoconnect_discovered_interfaces = False
Reticulum.__autoconnect_unverified = False
Reticulum.__autoconnect_warn = 6
Reticulum.__autoconnect_cap = 12
Reticulum.__autoconnect_caps_disabled = False
Reticulum.__autoconnect_interface_mode = None
Reticulum.__autoconnect_interface_gravity = None
Reticulum.__autoconnect_announces_to_internal = None
@@ -361,10 +389,6 @@ class Reticulum:
RNS.Transport.STAMPS_ENFORCED = True
RNS.Transport.LR_STAMPS_ENFORCED = True
RNS.Identity.load_known_destinations()
if not self.is_connected_to_shared_instance: RNS.Identity._clean_ratchets()
RNS.Transport.start(self)
if self.use_af_unix:
self.rpc_addr = f"\0rns/{self.local_socket_path}/rpc"
self.rpc_type = "AF_UNIX"
@@ -375,8 +399,12 @@ class Reticulum:
if self.rpc_key == None:
self.rpc_key = RNS.Identity.full_hash(RNS.Transport.internal_identity().get_private_key())
RNS.Identity.load_known_destinations()
if not self.is_connected_to_shared_instance: RNS.Identity._clean_ratchets()
RNS.Transport.start(self)
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, backlog=128, authkey=self.rpc_key)
thread = threading.Thread(target=self.rpc_loop)
thread.daemon = True
thread.start()
@@ -550,6 +578,14 @@ class Reticulum:
v = self.config["stamps"].as_float(option)
RNS.Transport.PR_STAMP_TIMEOUT = max(0.020, v)
if option == "max_workers":
v = self.config["stamps"].as_int(option)
RNS.Stamps.MAX_WORKERS = max(1, v)
if option == "worker_niceness":
v = self.config["stamps"].as_int(option)
RNS.Stamps.NICENESS = min(20, max(0, v))
if "reticulum" in self.config:
for option in self.config["reticulum"]:
value = self.config["reticulum"][option]
@@ -704,9 +740,32 @@ class Reticulum:
except Exception as e: raise ValueError(f"Invalid identity hash for interface discovery source: {hexhash}")
if not source_identity_hash in Reticulum.__interface_sources: Reticulum.__interface_sources.append(source_identity_hash)
if option == "autoconnect_discovered_interfaces_disable_caps":
v = self.config["reticulum"].as_bool(option)
if v: Reticulum.__autoconnect_caps_disabled = True
if option == "autoconnect_discovered_interfaces":
v = self.config["reticulum"].as_int(option)
if v > 0: Reticulum.__autoconnect_discovered_interfaces = v
if not Reticulum.__autoconnect_caps_disabled:
if Reticulum.__autoconnect_discovered_interfaces > Reticulum.__autoconnect_cap:
Reticulum.__autoconnect_discovered_interfaces = Reticulum.__autoconnect_cap
RNS.log(f"", RNS.LOG_WARNING)
RNS.log(f"Auto-connect interface target was capped to {Reticulum.__autoconnect_discovered_interfaces}", RNS.LOG_WARNING)
RNS.log(f"Using large numbers of auto-connected interfaces will not lead to better", RNS.LOG_WARNING)
RNS.log(f"connectivity or redundancy. If you really know what you're doing, and are", RNS.LOG_WARNING)
RNS.log(f"certain that you need this, you will also know how to get around this check.", RNS.LOG_WARNING)
if Reticulum.__autoconnect_discovered_interfaces > Reticulum.__autoconnect_warn:
RNS.log(f"", RNS.LOG_WARNING)
RNS.log(f"You have configured more than {Reticulum.__autoconnect_warn} auto-connect interfaces.", RNS.LOG_WARNING)
RNS.log(f"In almost all situations, this is excessive, and should be avoided.", RNS.LOG_WARNING)
RNS.log(f"For a normal home or office node, 2-3 autoconnects will be sufficient.", RNS.LOG_WARNING)
RNS.log(f"", RNS.LOG_WARNING)
RNS.log(f"If you're running a fast, well-connected transport node that can actually", RNS.LOG_WARNING)
RNS.log(f"provide additional capacity and transport to the network, you can consider", RNS.LOG_WARNING)
RNS.log(f"raising this number to {Reticulum.__autoconnect_warn}-{Reticulum.__autoconnect_warn+3}. Only in the rarest of cases will going beyond", RNS.LOG_WARNING)
RNS.log(f"this actually provide any benefit.", RNS.LOG_WARNING)
RNS.log(f"", RNS.LOG_WARNING)
if option == "autoconnect_unverified_implementations":
v = self.config["reticulum"].as_bool(option)
@@ -825,11 +884,50 @@ class Reticulum:
if self.local_socket_path == None and self.use_af_unix:
self.local_socket_path = "default"
if os.path.isfile(Reticulum.configdir+"/blocked_ips"):
try:
with open(Reticulum.configdir+"/blocked_ips", "r") as f:
expire = time.time()+(60*60*24*365.25*1000)
blocked_ips = f.read().strip().splitlines()
blocked_count = 0
for line in blocked_ips:
blocked_ip = line.strip()
if blocked_ip.startswith("#"): continue
if RNS.Discovery.is_ip_address(blocked_ip):
BackboneInterface.BackboneInterface.fast_flapping[blocked_ip] = [expire, expire, 0xFFFF]
blocked_count += 1
RNS.log(f"Loaded {blocked_count} blocked IPs", RNS.LOG_VERBOSE)
except Exception as e: RNS.log(f"Error while loading blocked IP list: {e}", RNS.LOG_ERROR)
if os.path.isfile(Reticulum.configdir+"/known_destination_types"):
try:
with open(Reticulum.configdir+"/known_destination_types", "r") as f:
dst_types = f.read().strip().splitlines()
for line in dst_types:
dst_type = line.strip()
if dst_type.startswith("#"): continue
RNS.Transport.destination_type_map[RNS.Destination.name_hash(dst_type)] = dst_type
except Exception as e: RNS.log(f"Error while loading known destination types list: {e}", RNS.LOG_ERROR)
if os.path.isfile(Reticulum.configdir+"/flagged_destination_types"):
try:
with open(Reticulum.configdir+"/flagged_destination_types", "r") as f:
dst_types = f.read().strip().splitlines()
for line in dst_types:
dst_type = line.strip()
if dst_type.startswith("#"): continue
RNS.Transport.flagged_type_map[RNS.Destination.name_hash(dst_type)] = dst_type
except Exception as e: RNS.log(f"Error while loading flagged destination types list: {e}", RNS.LOG_ERROR)
dql = RNS.Reticulum.default_data_queue_length() or RNS.Transport.INBOUND_DA_QUEUE_LENGTH
BackboneInterface.BackboneInterface.DP_IC_HIGH_WM = max(4, int((BackboneInterface.BackboneInterface.DP_IC_HIGH_WM_PCT/100.0) * dql))
BackboneInterface.BackboneInterface.DP_IC_MID_WM = max(2, int((BackboneInterface.BackboneInterface.DP_IC_MID_WM_PCT/100.0) * dql))
BackboneInterface.BackboneInterface.DP_IC_LOW_WM = max(0, int((BackboneInterface.BackboneInterface.DP_IC_LOW_WM_PCT/100.0) * dql))
RNS.Transport.ensure_identity()
self.__start_local_interface()
if self.is_shared_instance or self.is_standalone_instance:
@@ -875,16 +973,25 @@ class Reticulum:
except Exception as e: RNS.log(f"Error while detaching interface \"{name}\": {e}", RNS.LOG_ERROR)
return False
def _detach_interface(self, name, internal_forced=False):
def _detach_interface(self, name, internal_forced=False, interface_instance=None):
if not internal_forced and not Reticulum.__interface_management_enabled: return False
try:
interfaces = { iface.name: iface for iface in RNS.Transport.interfaces }
if not name in interfaces:
RNS.log(f"Attempt to detach non-existing interface \"{name}\"", RNS.LOG_WARNING)
if interface_instance: interface = interface_instance
else:
interfaces = { iface.name: iface for iface in RNS.Transport.interfaces }
interface = interfaces.get(name, None)
if not interface:
try: tunnel_id = bytes.fromhex(name)
except: return None
tunnel_ids = { iface.tunnel_id: iface for iface in RNS.Transport.interfaces if iface.tunnel_id }
local_tunnel_ids = { iface.local_tunnel_id: iface for iface in RNS.Transport.interfaces if iface.local_tunnel_id }
interface = tunnel_ids.get(tunnel_id, None) or local_tunnel_ids.get(tunnel_id, None)
if not interface:
RNS.log(f"Attempt to detach non-existing interface \"{name or interface}\"", RNS.LOG_WARNING)
return None
else:
interface = interfaces[name]
if isinstance(interface, I2PInterface.I2PInterface): return False
if isinstance(interface, LocalInterface.LocalClientInterface): return False
if isinstance(interface, LocalInterface.LocalServerInterface): return False
@@ -897,8 +1004,12 @@ class Reticulum:
RNS.Transport.remove_interface(s)
interface.detach()
if interface.parent_interface and interface.parent_interface.spawned_interfaces:
if interface in interface.parent_interface.spawned_interfaces:
interface.teardown()
RNS.Transport.remove_interface(interface)
RNS.log(f"Interface \"{name}\" was detached", RNS.LOG_NOTICE)
RNS.log(f"Interface {interface} was detached", RNS.LOG_NOTICE)
return True
except Exception as e: RNS.log(f"Error while detaching interface \"{name}\": {e}", RNS.LOG_ERROR); RNS.trace_exception(e)
@@ -960,6 +1071,11 @@ class Reticulum:
gravity = self._default_gravity()
if "gravity" in c: gravity = c.as_int("gravity")
hop_limiter = None
if "hop_limiter" in c:
v = c.as_int("hop_limiter")
hop_limiter = max(0, min(v, RNS.Transport.PATHFINDER_M))
destination_cost = None
if "destination_cost" in c:
v = c.as_float("destination_cost")
@@ -1120,11 +1236,12 @@ class Reticulum:
if "outgoing" in c and c.as_bool("outgoing") == False: interface.OUT = False
else: interface.OUT = True
interface.mode = interface_mode
interface.gravity = gravity
interface.announce_cap = announce_cap
interface.bootstrap_only = bootstrap_only
if configured_bitrate: interface.bitrate = configured_bitrate
interface.mode = interface_mode
interface.gravity = gravity
interface.hop_limiter = hop_limiter
interface.announce_cap = announce_cap
interface.bootstrap_only = bootstrap_only
if configured_bitrate: interface.bitrate = configured_bitrate
interface.optimise_mtu()
if ifac_size != None: interface.ifac_size = ifac_size
@@ -1474,6 +1591,7 @@ class Reticulum:
if path == "interface_stats": self.rpc_return(conn, self.get_interface_stats())
if path == "rate_table": self.rpc_return(conn, self.get_rate_table())
if path == "known_destinations": self.rpc_return(conn, self.get_known_destinations())
if path == "next_hop_if_name": self.rpc_return(conn, self.get_next_hop_if_name(call["destination_hash"]))
if path == "next_hop": self.rpc_return(conn, self.get_next_hop(call["destination_hash"]))
if path == "first_hop_timeout": self.rpc_return(conn, self.get_first_hop_timeout(call["destination_hash"]))
@@ -1543,7 +1661,11 @@ class Reticulum:
except Exception as e: RNS.log("An error ocurred while handling RPC call from local client: "+str(e), RNS.LOG_ERROR)
finally: conn.close() if conn else None
def get_rpc_client(self): return multiprocessing.connection.Client(self.rpc_addr, family=self.rpc_type, authkey=self.rpc_key)
__open_rpc_conns = weakref.WeakSet()
def get_rpc_client(self):
conn = multiprocessing.connection.Client(self.rpc_addr, family=self.rpc_type, authkey=self.rpc_key)
Reticulum.__open_rpc_conns.add(conn)
return conn
def _used_destination_data(self, destination_hash):
if self.is_connected_to_shared_instance:
@@ -1703,6 +1825,16 @@ class Reticulum:
else: ifstats["txs"] = 0
else: ifstats["txs"] = 0
if hasattr(interface, "current_frx_speed"):
if interface.current_frx_speed != None: ifstats["frxs"] = interface.current_frx_speed
else: ifstats["frxs"] = 0
else: ifstats["frxs"] = 0
if hasattr(interface, "current_ftx_speed"):
if interface.current_ftx_speed != None: ifstats["ftxs"] = interface.current_ftx_speed
else: ifstats["ftxs"] = 0
else: ifstats["ftxs"] = 0
if hasattr(interface, "current_arx_speed"):
if interface.current_arx_speed != None: ifstats["arxs"] = interface.current_arx_speed
else: ifstats["arxs"] = 0
@@ -1756,10 +1888,13 @@ class Reticulum:
ifstats["mtu"] = interface.HW_MTU
ifstats["rxb"] = interface.rxb
ifstats["txb"] = interface.txb
ifstats["frxb"] = interface.frxb
ifstats["ftxb"] = interface.ftxb
ifstats["arxb"] = interface.arxb
ifstats["atxb"] = interface.atxb
ifstats["arxc"] = interface.arxc
ifstats["atxc"] = interface.atxc
ifstats["afrxc"] = interface.afrxc
ifstats["prxb"] = interface.prxb
ifstats["ptxb"] = interface.ptxb
ifstats["prxc"] = interface.prxc
@@ -1789,6 +1924,21 @@ class Reticulum:
ifstats["protocol_violations"] = interface.protocol_violations
ifstats["ifac_violations"] = interface.ifac_violations
ifstats["packet_filter_hits"] = interface.packet_filter_hits
ifstats["tunnel_id"] = interface.tunnel_id or interface.local_tunnel_id
ifstats["remote_transport_id"] = interface.remote_transport.hash if interface.remote_transport else None
if interface.shared_medium:
ifstats["rem_impl"] = None
ifstats["rem_vers"] = None
ifstats["rem_is_tn"] = None
ifstats["rem_dst_cost"] = None
ifstats["rem_pr_cost"] = None
else:
ifstats["rem_impl"] = interface.remote_impl
ifstats["rem_vers"] = interface.remote_vers
ifstats["rem_is_tn"] = interface.remote_is_tn
ifstats["rem_dst_cost"] = interface.remote_dst_cost
ifstats["rem_pr_cost"] = interface.remote_pr_cost
interfaces.append(ifstats)
@@ -1806,6 +1956,14 @@ class Reticulum:
stats["txb"] = RNS.Transport.traffic_txb
stats["rxs"] = RNS.Transport.speed_rx
stats["txs"] = RNS.Transport.speed_tx
stats["lrxb"] = RNS.Transport.link_rxb
stats["ltxb"] = RNS.Transport.link_txb
stats["lrxs"] = RNS.Transport.link_speed_rx
stats["ltxs"] = RNS.Transport.link_speed_tx
stats["frxb"] = RNS.Transport.filtered_rxb
stats["ftxb"] = RNS.Transport.filtered_txb
stats["frxs"] = RNS.Transport.filtered_speed_rx
stats["ftxs"] = RNS.Transport.filtered_speed_tx
stats["arxb"] = RNS.Transport.announce_rxb
stats["atxb"] = RNS.Transport.announce_txb
stats["arxs"] = RNS.Transport.announce_speed_rx
@@ -1888,7 +2046,9 @@ class Reticulum:
"via": RNS.Transport.path_table[dst_hash][1], "hops": path_hops,
"expires": RNS.Transport.path_table[dst_hash][3], "value": dst_value,
"used": RNS.Transport.path_table[dst_hash][7], "lr_cost": lr_cost,
"interface": str(RNS.Transport.path_table[dst_hash][5]) }
"interface": str(RNS.Transport.path_table[dst_hash][5]),
"interface_hash": RNS.Transport.path_table[dst_hash][5].get_hash(),
"state": RNS.Transport.get_path_state(dst_hash) }
path_table.append(entry)
return path_table
@@ -1913,6 +2073,25 @@ class Reticulum:
return rate_table
def get_known_destinations(self):
if self.is_connected_to_shared_instance:
try:
rpc_connection = self.get_rpc_client()
rpc_connection.send_bytes(mp.packb({"get": "known_destinations"}))
response = mp.unpackb(rpc_connection.recv_bytes())
return response
except Exception as e:
RNS.log(f"Shared instance RPC failed while getting known destinations: {e}", RNS.LOG_ERROR)
return {}
else:
known_destinations = {}
with RNS.Identity.known_destinations_lock:
for dst_hash in RNS.Identity.known_destinations:
known_destinations[dst_hash] = RNS.Identity.known_destinations[dst_hash]
return known_destinations
def drop_path(self, destination):
if self.is_connected_to_shared_instance:
rpc_connection = self.get_rpc_client()
+160 -6
View File
@@ -44,9 +44,13 @@ from bisect import bisect_right
WORKBLOCK_EXPAND_CHUNK = 256
WORKBLOCK_EXPAND_ROUNDS = 3000
EXPAND_PROBE_COUNT = 8
RSTATE_MULTIPLIER = 2
STAMP_SIZE = 32
PN_VALIDATION_POOL_MIN_SIZE = 256
USE_WORKER_MANAGER = False
MAX_WORKERS = None
NICENESS = 16
POOLING_THRESHOLD_COST = 14
KEYSTAMP_POOLING_THRESHOLD = 10
STOP_CHECK_INTERVAL = 64
@@ -85,16 +89,89 @@ def worker_context(ctx, stamp_cost, workblock, message_id):
stop_event.clear()
def stamp_workblock(material, expand_rounds=WORKBLOCK_EXPAND_ROUNDS, no_expand=False):
return _stamp_workblock(material, expand_rounds=expand_rounds, no_expand=no_expand)
def _stamp_workblock(material, expand_rounds=WORKBLOCK_EXPAND_ROUNDS, no_expand=False):
if no_expand or not expand_rounds: return material
wb_st = time.time()
workblock = b""
workblock = bytearray()
for n in range(expand_rounds):
workblock += RNS.Cryptography.hkdf(length=WORKBLOCK_EXPAND_CHUNK, derive_from=material,
salt=RNS.Identity.full_hash(material+msgpack.packb(n)),
context=None)
wb_time = time.time() - wb_st
return workblock
return bytes(workblock)
def _stamp_workblock_future(material, expand_rounds=WORKBLOCK_EXPAND_ROUNDS, no_expand=False):
if no_expand or not expand_rounds: return material
# Method aliases
hkdf = RNS.Cryptography.hkdf
full_hash = RNS.Identity.full_hash
# Generation parameters
probe_len = 64 # SHA-256 block size
chunk_len = WORKBLOCK_EXPAND_CHUNK # Must be a multiple of probe_len
assert chunk_len % probe_len == 0
# State initialization
workblock = bytearray()
rstate = hkdf(length=chunk_len*RSTATE_MULTIPLIER, derive_from=full_hash(material), salt=None, context=None)
# Expansion loop
for n in range(expand_rounds):
# Pack round number to bytes
pn = msgpack.packb(n)
#############################################################
# For every round (after we have enough existing material),
# we perform a pseudo-random extraction from the already
# expanded part of the workblock.
if len(workblock) < probe_len: pgmat = b""
else:
pgmat = bytearray()
for k in range(EXPAND_PROBE_COUNT):
# Pseudo-randomly determine an extraction index over the
# entire surface of the expanded workblock so far. Since
# each index is derived from the rolling chain state at
# its round, the material required at later rounds is
# unknowable while the workblock is being built, and no
# part of it can therefore be safely(*) discarded before
# the entire expansion is complete. Any dropped part would
# have to be regenerated whenever a subsequent extraction
# happens to require it, binding the extraction to memory.
pk = msgpack.packb(k)
index = (int.from_bytes(full_hash(rstate+pn+pk), byteorder="big") % (len(workblock)//probe_len)) * probe_len
# (*) Yes, in theory, you could keep a LRU cache of WB
# chunks and rstate entries. For the configuration used
# here, you can save ~12% memory before the required
# compute cost for those savings explode into absurdity.
# The set of parameters used here were chosen to minimize
# verifier cost while ensuring a very steep (practically
# infeasible) compute saturation point at around 15%.
# Extract probe_len bytes at the determined index as the
# previously generated material component for the genera-
# tion of the next chunk.
pgmat.extend(workblock[index:index+probe_len])
pgmat = bytes(pgmat)
# Compute the salt for this round as the SHA-256 hash of the
# concatenation of the rolling state value, the extracted
# previously generated material and the round number.
salt = full_hash(rstate+pgmat+pn)
# Derive the current workblock chunk from the rolling state
# value and the previously generated material component,
# using the salt we just computed.
chunk = hkdf(length=chunk_len, derive_from=rstate+pgmat, salt=salt, context=None)
workblock.extend(chunk)
rstate = hkdf(length=chunk_len*RSTATE_MULTIPLIER, derive_from=rstate+chunk, salt=None, context=None)
return bytes(workblock)
def stamp_value_legacy(workblock, stamp):
if not workblock: workblock = b""
@@ -312,7 +389,7 @@ def generate_stamp(message_id, stamp_cost, expand_rounds=WORKBLOCK_EXPAND_ROUNDS
# - stamp_value(material, public_key_bytes)
#
# WARNING: Never attempt to use this for Ed25519 *signature* key
# creation, is NOT a valid approach. The keypairs emitted by
# creation, it is NOT a valid approach. The keypairs emitted by
# this function must ONLY be used as X25519 keys.
def generate_stamped_key(material, stamp_cost):
if material == None: material = b""
@@ -345,6 +422,11 @@ def generate_stamped_key(material, stamp_cost):
return keypair, value
def cancel_all_work():
RNS.log(f"Stopping all stamp workers", RNS.LOG_DEBUG)
active_ids = list(active_jobs.keys())
for active_id in active_ids: cancel_work(active_id)
def cancel_work(message_id):
if RNS.vendor.platformutils.is_windows() or RNS.vendor.platformutils.is_darwin():
try:
@@ -406,8 +488,8 @@ def job_simple(stamp_cost, workblock, message_id, size, mode=MODE_STAMP):
speed = r / max(time.time()-st, 1E-6)
RNS.log(f"Stamp generation running. {r} rounds completed so far, {RNS.prettysize(speed, suffix='')} rounds per second", RNS.LOG_DEBUG) if RNS.sl(RNS.LOG_DEBUG) else None
if mode == MODE_STAMP: result, rounds, _ = _loop_hash(workblock, target, size, stop_check, progress)
else: result, rounds, _ = _loop_key(workblock, target, stop_check)
if mode == MODE_STAMP: result, rounds, _ = _loop_hash(workblock, target, size, stop_check, progress)
else: result, rounds, _ = _loop_key(workblock, target, stop_check)
cancelled = (active_jobs[message_id] == True)
active_jobs.pop(message_id)
@@ -417,6 +499,7 @@ def job_linux_managed(stamp_cost, workblock, message_id, size, mode=MODE_STAMP):
ctx = multiprocessing.get_context("fork")
cores = multiprocessing.cpu_count()
jobs = cores if cores <= 12 else int(cores/2)
if MAX_WORKERS and jobs > MAX_WORKERS: jobs = MAX_WORKERS
allow_kill = True
stamp = None
@@ -426,6 +509,9 @@ def job_linux_managed(stamp_cost, workblock, message_id, size, mode=MODE_STAMP):
RNS.log(f"Starting {jobs} stamp generation workers", RNS.LOG_DEBUG)
def job(stop_event, sc, wb, pn, mode):
try: os.nice(NICENESS)
except: pass
target = target_from_fp(sc)
if mode == MODE_STAMP: result, rounds, _ = _loop_hash(wb, target, size, stop_event.is_set)
@@ -497,8 +583,12 @@ def job_linux(stamp_cost, workblock, message_id, size, mode=MODE_STAMP):
stop_event = multiprocessing.Event()
result_queue = multiprocessing.Queue(1)
rounds_queue = multiprocessing.Queue()
if MAX_WORKERS and jobs > MAX_WORKERS: jobs = MAX_WORKERS
def job(stop_event, pn, sc, wb, mode):
try: os.nice(NICENESS)
except: pass
target = target_from_fp(sc)
if mode == MODE_STAMP: result, rounds, _ = _loop_hash(wb, target, size, stop_event.is_set)
@@ -674,6 +764,8 @@ def job_android_persistent(stamp_cost, workblock, message_id, size, mode=MODE_ST
try: jobs = len(os.sched_getaffinity(0))
except Exception: jobs = multiprocessing.cpu_count()
if MAX_WORKERS and jobs > MAX_WORKERS: jobs = MAX_WORKERS
no_pool = False
if len(workblock) <= WORKBLOCK_EXPAND_CHUNK*ANDROID_NO_POOL_WB_EXPAND_MAX:
if mode == MODE_STAMP and stamp_cost < ANDROID_POOLING_THRESHOLD_COST_FP: no_pool = True
@@ -936,4 +1028,66 @@ def load_destination_stamp(destination_hash, material, required_value):
POOLING_THRESHOLD_COST_FP = POOLING_THRESHOLD_COST*COST_FP
KEYSTAMP_POOLING_THRESHOLD_FP = KEYSTAMP_POOLING_THRESHOLD*COST_FP
ANDROID_POOLING_THRESHOLD_COST_FP = ANDROID_POOLING_THRESHOLD_COST*COST_FP
ANDROID_KEYSTAMP_POOLING_THRESHOLD_FP = ANDROID_KEYSTAMP_POOLING_THRESHOLD*COST_FP
ANDROID_KEYSTAMP_POOLING_THRESHOLD_FP = ANDROID_KEYSTAMP_POOLING_THRESHOLD*COST_FP
#########################
# Multiprocessing Patch #
#########################
# CPython has a bug in multiprocessing's bootstrap code,
# where the initial stdin close() will deadlock if any
# part of the forking process is already holding the
# buffered I/O lock for the stdin fd. Since the locking
# state is inherited by the child process, this lock can
# never be released, and all children deadlock immediately
# before any application code is reached.
#
# This code run-time patches multiprocessing to detach
# stdin via a lock-free fd duplication instead, and parks
# the hazardous file descriptor to avoid potential later,
# GC-initiated deadlocking.
#
# All downstream forks from this process are affected by
# this, yes, and it might seem a tad aggressive, but I'd
# argue that this is what CPython should have done in the
# first place, and that it is strictly a better approach.
_stale_stdin = None
def _patched_close_stdin():
if sys.stdin is None: return
try:
fd = os.open(os.devnull, os.O_RDONLY)
try: os.dup2(fd, 0)
finally: os.close(fd)
except OSError: pass
# We ensure a global anchor to the old
# stdin, so GC cannot inadvertly hit a
# deadlocking close() via __del__
global _stale_stdin
_stale_stdin = sys.stdin
try: sys.stdin = open(0, encoding="utf-8", closefd=False)
except Exception: sys.stdin = None
_patched_close_stdin._rns_safe = True
def _patch_mp_stdin():
try:
import multiprocessing.util as mputil
except ImportError: return
current = getattr(mputil, "_close_stdin", None)
# If future CPython removes _close_stdin,
# we'll abort the patch here.
if current is None: return
# Only patch if we haven't already done so,
# or, in a potential future fixed CPython,
# detected that the method is now safe.
if getattr(current, "_rns_safe", False): return
mputil._close_stdin = _patched_close_stdin
# Only attempt patching on POSIX
if not RNS.vendor.platformutils.is_windows(): _patch_mp_stdin()
+185
View File
@@ -30,6 +30,8 @@
import RNS
import hashlib
import struct
import sys
import threading
import os
import time
@@ -162,6 +164,189 @@ class AnnounceRateTable:
yield key, { "last": self._last[slot], "rate_violations": self._viol[slot],
"blocked_until": self._blocked[slot], "timestamps": ts }
# Persists the announce rate table to a file, in
# compacted, little-endian binary format:
#
# Header (16 bytes)
# 0x00 6 Magic bytes
# 0x06 1 Format version
# 0x07 1 Flags, reserved, must be zero
# 0x08 1 Timestamp ring size (max_ts)
# 0x09 1 Destination hash length in bytes (keylen)
# 0x0A 2 Reserved, zero
# 0x0C 4 Entry count, uint32, little-endian
#
# Entries (columnar, in native slot order)
# Destination hash keys, followed by the _last, _blocked,
# _viol, _ts_len, _ts_head and _ts columns, all encoded as
# little-endian fixed-width values.
#
# Caller must hold the announce rate table lock
PERSIST_MAGIC = b"RNSART"
PERSIST_VERSION = 0x01
def persist(self, path, retain=None):
try:
count = len(self._keys)
if count > 0:
keylen = len(self._keys[0])
for key in self._keys:
if len(key) != keylen: raise ValueError("Inconsistent destination hash lengths in table")
else:
keylen = RNS.Identity.TRUNCATED_HASHLENGTH//8
if retain != None and count > 0:
now = time.time()
horizon = now - retain
keep = [slot for slot in range(count) if not (self._last[slot] < horizon and self._blocked[slot] <= now)]
else:
keep = None
if keep != None and len(keep) != count:
count = len(keep)
keys = [self._keys[slot] for slot in keep]
last = array("d", [self._last[slot] for slot in keep])
blocked = array("d", [self._blocked[slot] for slot in keep])
viol = array("i", [self._viol[slot] for slot in keep])
ts_len = array("B", [self._ts_len[slot] for slot in keep])
ts_head = array("B", [self._ts_head[slot] for slot in keep])
ts = array("d")
for slot in keep: ts.extend(self._ts[slot*self.max_ts:(slot+1)*self.max_ts])
else:
keys = self._keys
last = self._last
blocked = self._blocked
viol = self._viol
ts_len = self._ts_len
ts_head = self._ts_head
ts = self._ts
if last.itemsize != 8 or viol.itemsize != 4:
raise ValueError(f"Unsupported array itemsize at persist: d={last.itemsize}, i={viol.itemsize}")
header = self.PERSIST_MAGIC
header += bytes([self.PERSIST_VERSION, 0x00, self.max_ts & 0xFF, keylen & 0xFF])
header += struct.pack("<H", 0)
header += struct.pack("<I", count)
blob = header
blob += b"".join(keys)
blob += self._column_le(last)
blob += self._column_le(blocked)
blob += self._column_le(viol)
blob += ts_len.tobytes()
blob += ts_head.tobytes()
blob += self._column_le(ts)
tmp_path = path+".tmp"
with open(tmp_path, "wb") as file: file.write(blob)
os.replace(tmp_path, path)
return True
except Exception as e:
RNS.log(f"Could not persist announce rate table to {path}: {e}", RNS.LOG_ERROR)
return False
# Caller must hold the announce rate table lock
def load(self, path):
try:
with open(path, "rb") as file: blob = file.read()
except Exception: return False
try:
if len(blob) < 16: return False
if blob[0:6] != self.PERSIST_MAGIC: return False
if blob[6] != self.PERSIST_VERSION: return False
if blob[7] != 0x00: return False
file_max_ts = blob[8]
keylen = blob[9]
count = struct.unpack_from("<I", blob, 12)[0]
if file_max_ts < 1 or file_max_ts > 255: return False
if keylen < 1: return False
entry_size = keylen+22+file_max_ts*8
if len(blob) != 16+count*entry_size: return False
if file_max_ts == self.max_ts:
# Ring size matches, load directly
keys = [blob[16+slot*keylen : 16+(slot+1)*keylen] for slot in range(count)]
index = {}
for slot in range(count):
if keys[slot] in index: return False
index[keys[slot]] = slot
offset = 16+count*keylen
last = self._column_from_le("d", blob[offset:offset+count*8]); offset += count*8
blocked = self._column_from_le("d", blob[offset:offset+count*8]); offset += count*8
viol = self._column_from_le("i", blob[offset:offset+count*4]); offset += count*4
ts_len = array("B", blob[offset:offset+count]); offset += count
ts_head = array("B", blob[offset:offset+count]); offset += count
ts = self._column_from_le("d", blob[offset:offset+count*self.max_ts*8]); offset += count*self.max_ts*8
for slot in range(count):
if ts_len[slot] > self.max_ts or ts_head[slot] >= self.max_ts: return False
else:
# Different ring sizes from current running config,
# rebuild entries best effort.
keys = [blob[16+slot*keylen : 16+(slot+1)*keylen] for slot in range(count)]
index = {}
for slot in range(count):
if keys[slot] in index: return False
index[keys[slot]] = slot
offset = 16+count*keylen
last = self._column_from_le("d", blob[offset:offset+count*8]); offset += count*8
blocked = self._column_from_le("d", blob[offset:offset+count*8]); offset += count*8
viol = self._column_from_le("i", blob[offset:offset+count*4]); offset += count*4
f_ts_len = array("B", blob[offset:offset+count]); offset += count
f_ts_head = array("B", blob[offset:offset+count]); offset += count
f_ts = self._column_from_le("d", blob[offset:offset+count*file_max_ts*8]); offset += count*file_max_ts*8
for slot in range(count):
if f_ts_len[slot] > file_max_ts or f_ts_head[slot] >= file_max_ts: return False
ts_len = array("B"); ts_head = array("B"); ts = array("d")
for slot in range(count):
base = slot*file_max_ts
if f_ts_len[slot] < file_max_ts: chronological = list(f_ts[base:base+f_ts_len[slot]])
else: chronological = list(f_ts[base+f_ts_head[slot]:base+file_max_ts])+list(f_ts[base:base+f_ts_head[slot]])
chronological = chronological[-self.max_ts:]
ts_count = len(chronological)
ts_len.append(ts_count)
ts.extend(chronological)
if ts_count < self.max_ts: ts.extend([0.0]*(self.max_ts-ts_count))
ts_head.append(ts_count % self.max_ts)
self._index = index
self._keys = keys
self._last = last
self._blocked = blocked
self._viol = viol
self._ts = ts
self._ts_len = ts_len
self._ts_head = ts_head
self._cursor = 0
return True
except Exception as e:
RNS.log(f"Could not load announce rate table from {path}: {e}", RNS.LOG_ERROR)
return False
def _column_le(self, column):
if sys.byteorder == "big": swapped = array(column.typecode, column); swapped.byteswap(); return swapped.tobytes()
else: return column.tobytes()
def _column_from_le(self, typecode, data):
column = array(typecode); column.frombytes(data)
if sys.byteorder == "big": column.byteswap()
return column
class PacketHashlist:
# Bucketed byte-blob packet filter hashlist, with the primary
# design goal of memory coherence and density. All operations
+427 -154
View File
File diff suppressed because it is too large. Load diff
+150 -12
View File
@@ -31,6 +31,7 @@
import os
import time
import shutil
import selectors
import subprocess
import tempfile
import RNS
@@ -50,6 +51,11 @@ BACKENDS = ( ("magick", ["magick", "-", "webp:-"]),
("ffmpeg", ["ffmpeg", "-y", "-loglevel", "error", "-i", "-", "-f", "webp", "pipe:1"]),
("avconv", ["avconv", "-y", "-loglevel", "error", "-i", "-", "-f", "webp", "pipe:1"]) )
SUPPORTED_IMAGE_EXTS = [".webp", ".png", ".jpg", ".jpeg", ".gif", ".tiff", ".tif", ".bmp"]
CONV_SIZE_MAX = 32*1024*1024
SNIFF_BYTES = 64
RELAY_CHUNK = 256*1024
_ENV_BACKEND = os.environ.get("RNGIT_MEDIA_BACKEND")
_winner = None
_no_backend_logged = False
@@ -106,6 +112,24 @@ def _webp_info(data):
if width > 0 and height > 0: return (width, height)
return None
def _is_bmp_header(data):
if len(data) < 18 or data[:2] != b"BM": return False
try: dib_size = int.from_bytes(data[14:18], "little")
except Exception: return False
return dib_size in (12, 40, 52, 56, 64, 108, 124)
_IMAGE_SIGNATURES = ( ("png", lambda data: len(data) >= 8 and data[:8] == b"\x89PNG\r\n\x1a\n"),
("jpeg", lambda data: len(data) >= 3 and data[:3] == b"\xff\xd8\xff"),
("gif", lambda data: len(data) >= 6 and data[:6] in (b"GIF87a", b"GIF89a")),
("tiff", lambda data: len(data) >= 4 and data[:4] in (b"II*\x00", b"MM\x00*")),
("webp", lambda data: _webp_info(data) is not None),
("bmp", lambda data: _is_bmp_header(data)) )
def _classify_image(data):
for format_name, signature_matches in _IMAGE_SIGNATURES:
if signature_matches(data): return format_name
return None
def _valid_webp(path):
try:
with open(path, "rb") as fh: return _webp_info(fh.read(30)) is not None
@@ -115,7 +139,7 @@ def _unlink_output(path):
try: os.unlink(path)
except Exception: pass
def _configured_backend(quality=None, max_dimension=None):
def _configured_backend(quality=None, max_dimension=None, input_spec=None):
global _no_backend_logged
backend = _selected_backend()
if backend is None:
@@ -139,10 +163,15 @@ def _configured_backend(quality=None, max_dimension=None):
encoder_argv = list(encoder_argv)
if backend_name in ("magick", "convert", "gm"):
if input_spec is not None:
try: input_index = encoder_argv.index("-")
except ValueError: input_index = None
if input_index is not None: encoder_argv[input_index] = input_spec
options = []
if quality_arg is not None: options += ["-quality", str(quality_arg)]
if dimension_arg is not None: options += ["-resize", f"{dimension_arg}x{dimension_arg}>"]
encoder_argv = encoder_argv[:-1] + options + encoder_argv[-1:]
elif backend_name in ("ffmpeg", "avconv"):
options = []
if quality_arg is not None: options += ["-quality", str(quality_arg)]
@@ -163,13 +192,13 @@ def _await(backend_name, encoder_proc, input_proc=None, timeout=None):
except subprocess.TimeoutExpired:
_terminate(input_proc)
_terminate(encoder_proc)
RNS.log(f"Media conversion via {backend_name} timed out after {timeout} seconds", RNS.LOG_WARNING)
RNS.log(f"Media conversion via {backend_name} timed out after {RNS.prettytime(timeout)}", RNS.LOG_WARNING)
return False
if encoder_proc.returncode != 0:
detail = ""
encoder_tail = _stderr_tail(encoder_proc)
input_tail = _stderr_tail(input_proc) if input_proc is not None else ""
input_tail = _stderr_tail(input_proc) if input_proc is not None else ""
if encoder_tail: detail += f" Encoder: {encoder_tail}"
if input_tail: detail += f" Input: {input_tail}"
RNS.log(f"Media conversion via {backend_name} failed.{detail}", RNS.LOG_WARNING)
@@ -177,21 +206,107 @@ def _await(backend_name, encoder_proc, input_proc=None, timeout=None):
return True
def _await_readable(fd, timeout, selector):
try: return bool(selector.select(max(0.0, timeout)))
except Exception: return False
def _read_prefix(fd, amount, deadline):
data = bytearray()
selector = selectors.DefaultSelector()
try:
selector.register(fd, selectors.EVENT_READ)
while len(data) < amount:
if not _await_readable(fd, deadline - time.time(), selector): return None
chunk = os.read(fd, amount - len(data))
if not chunk: break
data += chunk
return bytes(data)
finally: selector.close()
def _pump(fd, encoder_stdin, prefix, deadline):
written = len(prefix)
if written > CONV_SIZE_MAX: return None
encoder_stdin.write(prefix)
selector = selectors.DefaultSelector()
try:
selector.register(fd, selectors.EVENT_READ)
while True:
if not _await_readable(fd, deadline - time.time(), selector):
raise subprocess.TimeoutExpired("input relay", max(0.0, deadline - time.time()))
chunk = os.read(fd, RELAY_CHUNK)
if not chunk: break
written += len(chunk)
if written > CONV_SIZE_MAX: return None
encoder_stdin.write(chunk)
return written
finally: selector.close()
def detect_image_format(data):
return _classify_image(data)
def convert_to_webp(input_argv, output_path, cwd=None, timeout=None, quality=None, max_dimension=None):
configured = _configured_backend(quality=quality, max_dimension=max_dimension)
if configured is None: return False
backend_name = configured[0]
backend_name, encoder_argv = configured
if timeout is None: timeout = CONVERSION_TIMEOUT
deadline = time.time() + timeout
try:
with open(output_path, "wb") as output_fh:
input_proc = subprocess.Popen(input_argv, cwd=cwd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
encoder_proc = subprocess.Popen(encoder_argv, stdin=input_proc.stdout, stdout=output_fh, stderr=subprocess.PIPE)
input_fd = input_proc.stdout.fileno()
# The parent must not retain a copy of the input pipe's write
# end, or the input process would never see EOF.
input_proc.stdout.close()
if not _await(backend_name, encoder_proc, input_proc=input_proc, timeout=timeout): return False
prefix = _read_prefix(input_fd, SNIFF_BYTES, deadline)
if prefix is None:
RNS.log(f"Media conversion via {backend_name} timed out after {RNS.prettytime(timeout)}", RNS.LOG_WARNING)
_terminate(input_proc)
return False
detected = _classify_image(prefix)
if detected is None:
RNS.log("Media conversion failed: Input format is not supported", RNS.LOG_DEBUG)
_terminate(input_proc)
return False
configured = _configured_backend(quality=quality, max_dimension=max_dimension, input_spec=detected+":-")
if configured is None:
_terminate(input_proc)
return False
backend_name, encoder_argv = configured
encoder_proc = subprocess.Popen(encoder_argv, stdin=subprocess.PIPE, stdout=output_fh, stderr=subprocess.PIPE)
aborted = False
try:
if _pump(input_fd, encoder_proc.stdin, prefix, deadline) is None:
RNS.log(f"Media conversion failed: Streaming input exceeded maximum size of {RNS.prettysize(CONV_SIZE_MAX)}", RNS.LOG_DEBUG)
aborted = True
except subprocess.TimeoutExpired:
RNS.log(f"Media conversion via {backend_name} timed out after {RNS.prettytime(timeout)}", RNS.LOG_WARNING)
aborted = True
except (BrokenPipeError, OSError):
RNS.log(f"Media conversion via {backend_name} failed: Encoder exited before input was consumed", RNS.LOG_DEBUG)
aborted = True
if aborted:
_terminate(input_proc)
_terminate(encoder_proc)
return False
try: encoder_proc.stdin.close()
except (BrokenPipeError, OSError): pass
try: input_proc.stdout.close()
except Exception: pass
if not _await(backend_name, encoder_proc, input_proc=input_proc, timeout=max(0.0, deadline - time.time())): return False
if not _valid_webp(output_path):
RNS.log(f"Media conversion via {backend_name} produced invalid WebP output", RNS.LOG_WARNING)
@@ -207,19 +322,42 @@ def convert_to_webp(input_argv, output_path, cwd=None, timeout=None, quality=Non
def convert_file_to_webp(source_path, quality=85, max_dimension=None, timeout=None):
configured = _configured_backend(quality=quality, max_dimension=max_dimension)
if configured is None: return False
backend_name, encoder_argv = configured
backend_name = configured[0]
tmp_path = None
success = False
try:
if not os.path.isfile(source_path):
RNS.log(f"Cannot convert media: source file does not exist: {source_path}", RNS.LOG_WARNING)
RNS.log(f"Cannot convert media: Source file does not exist: {source_path}", RNS.LOG_WARNING)
return False
try: source_size = os.path.getsize(source_path)
except Exception: source_size = None
if source_size is not None and source_size > CONV_SIZE_MAX:
RNS.log(f"Cannot convert media: Source file exceeds maximum size of {RNS.prettysize(CONV_SIZE_MAX)}", RNS.LOG_DEBUG)
return False
fd, tmp_path = tempfile.mkstemp(prefix="rns_media_", suffix=".webp")
os.close(fd)
with open(source_path, "rb") as input_fh, open(tmp_path, "wb") as output_fh:
with open(source_path, "rb", buffering=0) as input_fh, open(tmp_path, "wb") as output_fh:
prefix = b""
while len(prefix) < SNIFF_BYTES:
chunk = input_fh.read(SNIFF_BYTES - len(prefix))
if not chunk: break
prefix += chunk
detected = _classify_image(prefix)
if detected is None:
RNS.log("Cannot convert media: Source file is not a supported media format", RNS.LOG_DEBUG)
return False
configured = _configured_backend(quality=quality, max_dimension=max_dimension, input_spec=detected+":-")
if configured is None: return False
backend_name, encoder_argv = configured
input_fh.seek(0)
encoder_proc = subprocess.Popen(encoder_argv, stdin=input_fh, stdout=output_fh, stderr=subprocess.PIPE)
if not _await(backend_name, encoder_proc, timeout=timeout): return False
+11 -1
View File
@@ -46,6 +46,7 @@ from RNS.vendor.configobj import ConfigObj
from RNS.vendor import umsgpack as mp
from RNS._version import __version__
from RNS.Utilities.rnid import validate_rsg, extract_signed_rsg_data
from RNS.Utilities.rngit.media import SUPPORTED_IMAGE_EXTS
from RNS.Utilities.rngit.commitsigs import unarmor_ssh_signature, parse_ssh_signature, extract_commit_author
class NomadNetworkNode():
@@ -71,6 +72,7 @@ class NomadNetworkNode():
FILE_DOWNLOAD = "/file/download"
FILE_WORKDOC = "/file/workdoc"
DEFAULT_LINK_COST = 18.0
BLOB_SIZE_LIMIT = 256 * 1024
TREE_ENTRIES_PER_PAGE = 1000
COMMITS_PER_PAGE = 100
@@ -126,7 +128,7 @@ class NomadNetworkNode():
CONVERTABLE_EXTS = [".md"]
RENDERABLE_EXTS = [".md", ".mu"]
RENDER_DEFAULT = [".md", ".mu"]
IMAGE_EXTS = [".webp", ".png", ".jpg", ".jpeg", ".gif", ".tiff", ".tif", ".bmp"]
IMAGE_EXTS = SUPPORTED_IMAGE_EXTS
def __init__(self, owner=None):
if not owner: raise TypeError(f"Invalid owner {owner} for {self}")
@@ -138,6 +140,8 @@ class NomadNetworkNode():
self.node_name = owner.node_name
self.announce_interval = owner.announce_interval
self.last_announce = 0
self.stamp_value = None
self.link_cost = self.DEFAULT_LINK_COST
self.null_ident = RNS.Identity.from_bytes(bytes(64))
self.templates = {}
@@ -175,8 +179,14 @@ class NomadNetworkNode():
if self.owner.config["pages"].as_bool("unicode_icons"): self.use_nerdfonts = False
if "media_conversion" in self.owner.config["pages"]:
self.media_conversion = self.owner.config["pages"].as_bool("media_conversion")
if "link_cost" in self.owner.config["pages"]:
self.link_cost = RNS.Stamps.quantize_cost(self.owner.config["pages"].as_float("link_cost"))
if "stamp_value" in self.owner.config["pages"]:
self.stamp_value = RNS.Stamps.quantize_cost(self.owner.config["pages"].as_float("stamp_value"))
self.destination = RNS.Destination(self.identity, RNS.Destination.IN, RNS.Destination.SINGLE, self.APP_NAME, "node")
if self.stamp_value: self.destination.set_value(self.stamp_value)
self.destination.set_link_cost(self.link_cost)
self.destination.set_link_established_callback(self.remote_connected)
self.destination.set_default_app_data(self.get_announce_app_data)
self.register_request_handlers()
+28
View File
@@ -1977,6 +1977,8 @@ class ReticulumGitNode():
CLONE_PROTOS = ["rns", "http", "https", "ssh"]
DEFAULT_LINK_COST = 18.0
def __init__(self, configdir=None, verbosity=None, print_identity=False):
self.identity = None
self.userdir = os.path.expanduser("~")
@@ -1989,6 +1991,8 @@ class ReticulumGitNode():
self.blocked_identities = {}
self.last_announce = 0
self.announce_interval = 0
self.stamp_value = None
self.link_cost = self.DEFAULT_LINK_COST
self.stats_enabled = False
self.stats_job_interval = 180
self.last_stats_job = time.time()
@@ -2059,6 +2063,8 @@ class ReticulumGitNode():
exit(0)
self.destination = RNS.Destination(self.identity, RNS.Destination.IN, RNS.Destination.SINGLE, APP_NAME, "repositories")
if self.stamp_value: self.destination.set_value(self.stamp_value)
self.destination.set_link_cost(self.link_cost)
self.destination.set_link_established_callback(self.remote_connected)
self.register_request_handlers()
RNS.log(f"Reticulum Git Node listening on {RNS.prettyhexrep(self.destination.hash)}", RNS.LOG_NOTICE)
@@ -2205,6 +2211,8 @@ class ReticulumGitNode():
section = self.config["rngit"]
if "node_name" in section: self.node_name = section["node_name"]
if "announce_interval" in section: self.announce_interval = section.as_int("announce_interval")*60
if "stamp_value" in section: self.stamp_value = RNS.Stamps.quantize_cost(section.as_float("stamp_value"))
if "link_cost" in section: self.link_cost = RNS.Stamps.quantize_cost(section.as_float("link_cost"))
if "mirror_interval" in section: self.mirror_interval = max(section.as_int("mirror_interval")*60*60, 0)
if "record_stats" in section: self.stats_enabled = section.as_bool("record_stats")
if "stats_ignore_identities" in section:
@@ -4926,6 +4934,16 @@ announce_interval = 360
# node_name = Anonymous Git Node
# You can configure the required link stamp cost for
# connecting to the repository node.
# link_cost = 18.0
# The target stamp value for the repositories destination
# can also be configured.
# stamp_value = 25.0
# You can enable collecting view, fetch and push statistics
# which can be displayed on the stats pages of repositories.
# Remember to set the "s" (stats) permission appropriately
@@ -5044,6 +5062,16 @@ internal = rw:9710b86ba12c42d1d8f30f74fe509286
# serve_nomadnet = no
# You can configure the required link stamp cost for
# connecting to the page node.
# link_cost = 18.0
# The target stamp value for the node destination can
# also be configured.
# stamp_value = 25.0
# It is possible to disable Nerd Font icons and instead
# use simpler (but more compatible) unicode icons.
+120 -9
View File
@@ -101,8 +101,8 @@ def parse_hash(input_str):
def program_setup(configdir, table, rates, drop, destination_hexhash, verbosity, timeout, drop_queues,
drop_via, max_hops, remote=None, management_identity=None, remote_timeout=RNS.Transport.PATH_REQUEST_TIMEOUT,
blackholed=False, blackhole=False, unblackhole=False, blackhole_duration=None, blackhole_reason=None,
remote_blackhole_list=False, remote_blackhole_list_filter=None, usage=False, no_output=False, json=False):
blackholed=False, blackhole=False, unblackhole=False, blackhole_duration=None, blackhole_reason=None, remote_blackhole_list=False, remote_blackhole_list_filter=None,
active=False, usage=False, vias=False, expinfo=False, min_value=None, no_output=False, analyze=False, capture=None, json=False):
global remote_link, reticulum
reticulum = RNS.Reticulum(configdir = configdir, loglevel = 3+verbosity)
@@ -242,6 +242,10 @@ def program_setup(configdir, table, rates, drop, destination_hexhash, verbosity,
print(f"Could not unblackhole identity: {e}")
exit(20)
elif analyze:
analyze_tables(path_table=reticulum.get_path_table(), rate_table=reticulum.get_rate_table(),
link_distribution=reticulum.get_link_distribution(), capture=capture)
elif table:
destination_hash = None
if destination_hexhash != None:
@@ -292,14 +296,26 @@ def program_setup(configdir, table, rates, drop, destination_hexhash, verbosity,
for path in table:
if destination_hash == None or destination_hash == path["hash"]:
displayed += 1
if min_value:
if not path["value"]: continue
if path["value"] < min_value: continue
if path["state"] == RNS.Transport.STATE_RESPONSIVE: state_str = " (R)"
elif path["state"] == RNS.Transport.STATE_UNRESPONSIVE: state_str = " (u)"
elif path["state"] == RNS.Transport.STATE_UNKNOWN: state_str = " (?)"
else: state_str = " (?)"
exp_str = RNS.timestamp_str(path["expires"])
if path["hops"] == 1: m_str = " "
else: m_str = "s"
if not "used" in path: u_str = ", no usage info"
else:
if active and not path["used"]: continue
if usage: u_str = f", last used {RNS.prettytime(now-path['used'])} ago" if path["used"] else ", never used"
else: u_str = ""
print(f"{RNS.prettyhexrep(path['hash'])} {path['hops']:>3}h via {RNS.prettyhexrep(path['via'])} on {path['interface']} expires in {RNS.prettytime(path['expires']-now, compact=True)} (dv:{RNS.prettycost(path['value'])}/lc:{RNS.prettycost(path['lr_cost'])})")
via_str = f" via {RNS.prettyhexrep(path['via'])}" if vias else ""
exp_str = f" expires in {RNS.prettytime(path['expires']-now, compact=True)}" if expinfo else ""
print(f"{RNS.prettyhexrep(path['hash'])} {path['hops']:>3}h{state_str}{via_str} on {path['interface']}{exp_str} (dv:{RNS.prettycost(path['value'])}/lc:{RNS.prettycost(path['lr_cost'])}){u_str}")
if destination_hash != None and displayed == 0:
print("No path known")
@@ -496,8 +512,12 @@ def main():
parser.add_argument("--config", action="store", default=None, help="path to alternative Reticulum config directory", type=str)
parser.add_argument("--version", action="version", version="rnpath {version}".format(version=__version__))
parser.add_argument("-t", "--table", action="store_true", help="show all known paths", default=False)
parser.add_argument("-a", "--active", action="store_true", help="show in-use paths only", default=False)
parser.add_argument("-u", "--usage", action="store_true", help="show path usage time", default=False)
parser.add_argument("-V", "--vias", action="store_true", help="show via transport IDs", default=False)
parser.add_argument("-E", "--expiry", action="store_true", help="show path expiry times", default=False)
parser.add_argument("-m", "--max", action="store", metavar="hops", type=int, help="maximum hops to filter path table by", default=None)
parser.add_argument("-M", "--min-value", action="store", metavar="value", type=float, help="minimum value to filter path table by", default=None)
parser.add_argument("-r", "--rates", action="store_true", help="show announce rate info", default=False)
parser.add_argument("-d", "--drop", action="store_true", help="remove the path to a destination", default=False)
parser.add_argument("-D", "--drop-announces", action="store_true", help="drop all queued announces", default=False)
@@ -509,10 +529,12 @@ def main():
parser.add_argument("-b", "--blackholed", action="store_true", help="list blackholed identities", default=False)
parser.add_argument("-B", "--blackhole", action="store_true", help="blackhole identity", default=False)
parser.add_argument("-U", "--unblackhole", action="store_true", help="unblackhole identity", default=False)
parser.add_argument( "--duration", action="store", type=float, help="duration of blackhole enforcement in hours", default=None)
parser.add_argument( "--reason", action="store", type=str, help="reason for blackholing identity", default=None)
parser.add_argument( "--duration", action="store", metavar="hours", type=float, help="duration of blackhole enforcement in hours", default=None)
parser.add_argument( "--reason", action="store", metavar="reason", type=str, help="reason for blackholing identity", default=None)
parser.add_argument("-p", "--blackholed-list", action="store_true", help="view published blackhole list for remote transport instance", default=False)
parser.add_argument("-j", "--json", action="store_true", help="output in JSON format", default=False)
parser.add_argument("-A", "--analyze", action="store_true", help="Analyze tables", default=False)
parser.add_argument("--capture", action="store", metavar="path", type=str, help="path to capture file for analyze mode", default=None)
parser.add_argument("destination", nargs="?", default=None, help="hexadecimal hash of the destination", type=str)
parser.add_argument("list_filter", nargs="?", default=None, help="filter for remote blackhole list view", type=str)
parser.add_argument('-v', '--verbose', action='count', default=0)
@@ -522,16 +544,17 @@ def main():
if args.config: configarg = args.config
else: configarg = None
if not args.drop_announces and not args.table and not args.rates and not args.destination and not args.drop_via and not args.blackholed:
if not args.drop_announces and not args.table and not args.rates and not args.destination and not args.drop_via and not args.blackholed and not args.analyze:
print("")
parser.print_help()
print("")
else:
program_setup(configdir = configarg, table = args.table, rates = args.rates, drop = args.drop, destination_hexhash = args.destination,
verbosity = args.verbose, timeout = args.w, drop_queues = args.drop_announces, drop_via = args.drop_via, max_hops = args.max,
program_setup(configdir=configarg, table=args.table, rates=args.rates, drop=args.drop, destination_hexhash=args.destination,
verbosity=args.verbose, timeout=args.w, drop_queues=args.drop_announces, drop_via=args.drop_via, max_hops=args.max, min_value=args.min_value,
remote=args.R, management_identity=args.i, remote_timeout=args.W, blackholed=args.blackholed, blackhole=args.blackhole,
unblackhole=args.unblackhole, blackhole_duration=args.duration, blackhole_reason=args.reason, remote_blackhole_list=args.blackholed_list,
remote_blackhole_list_filter=args.list_filter, usage=args.usage, json=args.json)
remote_blackhole_list_filter=args.list_filter, usage=args.usage, vias=args.vias, active=args.active, expinfo=args.expiry,
analyze=args.analyze, capture=args.capture, json=args.json)
sys.exit(0)
@@ -539,6 +562,94 @@ def main():
print("")
exit()
def analyze_tables(path_table=None, rate_table=None, link_distribution=None, capture=None):
print("Not yet implemented")
exit()
# if not path_table:
# print("No path table to analyze")
# exit()
# else:
# print(f"Analyzing tables...")
# # TODO: If a `capture` path is specified, we save and (if existing) load from
# # this file, so that `rnpath --analyze` can be run at intervals, and continuously
# # collect data, instead of only providing an at-the-moment snapshot view.
# # Locally initialize announce cache to be able to
# # fetch full announce packet data
# if RNS.Transport.owner.is_connected_to_shared_instance: RNS.Transport.init_announce_cache()
# tm = RNS.Transport.destination_type_map
# total = len(path_table)
# destinations = {}
# unresolvable = 0
# unknown_types = set()
# known_types = set()
# unknown_type_dsts = 0
# known_type_dsts = 0
# for path in path_table:
# dst_hash = path["hash"]
# dst_hops = path["hops"]
# last_used = path["used"]
# name_hash = None
# kd_entry = RNS.Identity.known_destinations.get(dst_hash, None)
# # New destinations may have arrived after our initial known
# # destinations snapshot, which is fine, we just count the few
# # that miss here for now.
# if not kd_entry: unresolvable += 1
# # Enrich data with information from cached announces
# else:
# dst_value = kd_entry[6]
# dst_lr_cost = kd_entry[7]
# announce_hash = kd_entry[1]
# announce_packet = RNS.Transport.get_cached_packet(announce_hash, packet_type="announce")
# if not announce_packet: unresolvable += 1; continue
# try: announce_packet.unpack()
# except: unresolvable +=1; continue
# keysize = RNS.Identity.KEYSIZE//8
# name_hash_len = RNS.Identity.NAME_HASH_LENGTH//8
# name_hash = announce_packet.data[keysize:keysize+name_hash_len]
# app_data = kd_entry[3] or RNS.Identity.recall_app_data(dst_hash, _no_use=True)
# app_data_len = len(app_data) if app_data else None # No len counting if no app data
# if name_hash in tm: known_type_dsts += 1; known_types.add(name_hash)
# else: unknown_type_dsts += 1; unknown_types.add(name_hash)
# # TODO: Create actual data structure for use in analysis
# entry = {}
# destinations[dst_hash] = entry
# if rate_table:
# # TODO: Incorporate and enrich with data from rate table
# pass
# if link_distribution:
# # TODO: Incorporate and enrich with link distribution data
# pass
# # TODO: Actually analyze tables
# pass
# # TODO: Actually print a comprehensive, beautifully formatted
# # overview, charts and data. This is a stub.
# print(f"Known types : {len(known_types)}")
# print(f"Unknown types : {len(unknown_types)}")
# print(f"Total types : {len(known_types)+len(unknown_types)}")
# print(f"Known type dests : {known_type_dsts}")
# print(f"Unknown type dests : {unknown_type_dsts}")
# print(f"Total type dests : {known_type_dsts+unknown_type_dsts}")
# # TODO: Ensure we get the terminal width if possible, and fall back to
# # a sensible default if not, so everything is rendered beautifully.
# exit()
def pretty_date(time=False):
from datetime import datetime
now = datetime.now()
+1 -2
View File
@@ -169,14 +169,13 @@ async def _initiate_link(configdir, rnsconfigdir, identitypath=None, logfile=Non
listener_identity = RNS.Identity.recall(destination_hash)
_destination = RNS.Destination(listener_identity, RNS.Destination.OUT, RNS.Destination.SINGLE, rnsh.APP_NAME)
RNS.log(f"Establishing link with {RNS.prettyhexrep(destination_hash)}", RNS.LOG_INFO)
if _link is None or _link.status == RNS.Link.PENDING:
RNS.log("No link", RNS.LOG_DEBUG)
_link = RNS.Link(_destination)
_link.did_identify = False
_link.set_link_closed_callback(_client_link_closed)
RNS.log(f"Establishing link with {RNS.prettyhexrep(destination_hash)}", RNS.LOG_INFO)
if not await _spin(until=lambda: _link.status == RNS.Link.ACTIVE, msg=f"Establishing link with {RNS.prettyhexrep(destination_hash)}",
timeout=timeout, quiet=quietness > 0):
raise RemoteExecutionError("Could not establish link with " + RNS.prettyhexrep(destination_hash))
+72 -5
View File
@@ -160,7 +160,7 @@ def program_setup(configdir, dispall=False, verbosity=0, name_filter=None, json=
sorting=None, sort_reverse=False, remote=None, management_identity=None, must_exit=True, rns_instance=None,
traffic_totals=False, discovered_interfaces=False, config_entries=False, burst_filter=False, blocked_ips=False,
queue_stats=False, pps=False, profiling=False, remote_timeout=RNS.Transport.PATH_REQUEST_TIMEOUT,
attach=None, detach=None, reload=None, show_stale=False, show_unknown=False):
attach=None, detach=None, reload=None, show_stale=False, show_unknown=False, fstats=False, tstats=False):
if remote: require_shared = False
else: require_shared = True
@@ -432,14 +432,19 @@ def program_setup(configdir, dispall=False, verbosity=0, name_filter=None, json=
if sorting == "rate" or sorting == "bitrate": interfaces.sort(key=lambda i: i["bitrate"], reverse=not sort_reverse)
if sorting == "rx": interfaces.sort(key=lambda i: i["rxb"], reverse=not sort_reverse)
if sorting == "tx": interfaces.sort(key=lambda i: i["txb"], reverse=not sort_reverse)
if sorting == "frx": interfaces.sort(key=lambda i: i["frxb"], reverse=not sort_reverse)
if sorting == "ftx": interfaces.sort(key=lambda i: i["ftxb"], reverse=not sort_reverse)
if sorting == "rxs": interfaces.sort(key=lambda i: i["rxs"], reverse=not sort_reverse)
if sorting == "txs": interfaces.sort(key=lambda i: i["txs"], reverse=not sort_reverse)
if sorting == "frxs": interfaces.sort(key=lambda i: i["frxs"], reverse=not sort_reverse)
if sorting == "ftxs": interfaces.sort(key=lambda i: i["ftxs"], reverse=not sort_reverse)
if sorting == "traffic": interfaces.sort(key=lambda i: i["rxb"]+i["txb"], reverse=not sort_reverse)
if sorting == "anns" or sorting == "announces": interfaces.sort(key=lambda i: i["incoming_announce_frequency"]+i["outgoing_announce_frequency"], reverse=not sort_reverse)
if sorting == "arx": interfaces.sort(key=lambda i: i["incoming_announce_frequency"], reverse=not sort_reverse)
if sorting == "atx": interfaces.sort(key=lambda i: i["outgoing_announce_frequency"], reverse=not sort_reverse)
if sorting == "arxc": interfaces.sort(key=lambda i: i["arxc"], reverse=not sort_reverse)
if sorting == "atxc": interfaces.sort(key=lambda i: i["atxc"], reverse=not sort_reverse)
if sorting == "afrxc": interfaces.sort(key=lambda i: i["afrxc"], reverse=not sort_reverse)
if sorting == "prx": interfaces.sort(key=lambda i: i["incoming_pr_frequency"], reverse=not sort_reverse)
if sorting == "ptx": interfaces.sort(key=lambda i: i["outgoing_pr_frequency"], reverse=not sort_reverse)
if sorting == "prxc": interfaces.sort(key=lambda i: i["prxc"], reverse=not sort_reverse)
@@ -551,6 +556,21 @@ def program_setup(configdir, dispall=False, verbosity=0, name_filter=None, json=
if "bitrate" in ifstat and ifstat["bitrate"] != None:
print(f" Rate : {speed_str(ifstat['bitrate'])}, MTU {ifstat['mtu']}")
if tstats and not clients:
print(f" Tunnel ID : {RNS.hexrep(ifstat['tunnel_id'], delimit=False) if ifstat['tunnel_id'] else 'None'}")
if tstats and ifstat["tunnel_id"]:
print(f" Rem.Tr.ID : {RNS.prettyhexrep(ifstat['remote_transport_id']) if ifstat['remote_transport_id'] else 'Unknown'}")
trns_str = ", transport enabled" if ifstat['rem_is_tn'] else ", no transport"
impl_str = f"{ifstat['rem_impl']}" if ifstat['rem_impl'] else "Unknown implementation"
vers_str = f" {'.'.join([str(v) for v in ifstat['rem_vers']])}{trns_str}" if ifstat['rem_vers'] else ", unknown version"
print(f" Rem.Vers. : {impl_str}{vers_str}")
dst_cost_str = f"Dst {RNS.prettycost(ifstat['rem_dst_cost'])}" if ifstat["rem_dst_cost"] != None else "Dst ?"
pr_cost_str = f"PR {RNS.prettycost(ifstat['rem_pr_cost'])}" if ifstat["rem_pr_cost"] != None else "PR ?"
print(f" Rem.Csts. : {dst_cost_str}, {pr_cost_str}")
if "noise_floor" in ifstat:
if not "interference" in ifstat: nstr = ""
else:
@@ -738,7 +758,8 @@ def program_setup(configdir, dispall=False, verbosity=0, name_filter=None, json=
if asr:
if ifstat["arxc"] and ifstat["atxc"]:
print(f" Announces : {ifstat['arxc']}↓ {ifstat['atxc']}↑ total")
f_str = f", {ifstat['afrxc']} filtered" if ifstat["afrxc"] else ""
print(f" Announces : {ifstat['arxc']}↓ {ifstat['atxc']}↑ total{f_str}")
print(f" {oaf} {pc_str}")
else:
print(f" Announces : {oaf} {pc_str}")
@@ -757,6 +778,14 @@ def program_setup(configdir, dispall=False, verbosity=0, name_filter=None, json=
print(f" Traffic : {txstat}\n {rxstat}")
if fstats:
frxstat = "↓"+RNS.prettysize(ifstat["frxb"])
ftxstat = "↑"+RNS.prettysize(ifstat["ftxb"])
if "frxs" in ifstat and "ftxs" in ifstat:
frxstat += " "+RNS.prettyspeed(ifstat["frxs"])
ftxstat += " "+RNS.prettyspeed(ifstat["ftxs"])
print(f" Filtered : {ftxstat}\n {frxstat}")
lstr = ""
if link_count != None and lstats:
ms = "y" if link_count == 1 else "ies"
@@ -797,6 +826,41 @@ def program_setup(configdir, dispall=False, verbosity=0, name_filter=None, json=
print(f"\n Totals : {txstat}\n {rxstat}")
if fstats:
frxstat = "↓"+RNS.prettysize(stats["frxb"])
ftxstat = "↑"+RNS.prettysize(stats["ftxb"])
strdiff = len(frxstat)-len(ftxstat)
if strdiff > 0: ftxstat += " "*strdiff
elif strdiff < 0: frxstat += " "*-strdiff
if "frxs" in stats and "ftxs" in stats:
frxstat += " "+RNS.prettyspeed(stats["frxs"])
ftxstat += " "+RNS.prettyspeed(stats["ftxs"])
print(f"\n Filtered : {ftxstat}\n {frxstat}")
if lstats:
if "lrxb" in stats and "ltxb" in stats and "lrxs" in stats and "ltxs" in stats:
lrxb_str = "↓"+RNS.prettysize(stats["lrxb"])
ltxb_str = "↑"+RNS.prettysize(stats["ltxb"])
strdiff = len(lrxb_str)-len(ltxb_str)
if strdiff > 0: ltxb_str += " "*strdiff
elif strdiff < 0: lrxb_str += " "*-strdiff
parxs = stats["prxs"]+stats["arxs"]
patxs = stats["ptxs"]+stats["atxs"]
drxpct = 100.0-min(100.0, (parxs / stats["rxs"])*100.0) if stats["rxs"] else 100.0
dtxpct = 100.0-min(100.0, (patxs / stats["txs"])*100.0) if stats["txs"] else 100.0
drxs = stats["rxs"]*(drxpct/100.0)
dtxs = stats["txs"]*(dtxpct/100.0)
lrxspct = min(100.0, (stats["lrxs"] / drxs)*100.0) if drxs and stats["lrxs"] else 0.0
ltxspct = min(100.0, (stats["ltxs"] / dtxs)*100.0) if dtxs and stats["ltxs"] else 0.0
lrxstat = lrxb_str+" "+RNS.prettyspeed(stats["lrxs"])+f", {int(lrxspct)}% of data flow"
ltxstat = ltxb_str+" "+RNS.prettyspeed(stats["ltxs"])+f", {int(ltxspct)}% of data flow"
print(f"\n Links : {ltxstat}\n {lrxstat}")
if pstats:
if "prxb" in stats and "ptxb" in stats and "prxs" in stats and "ptxs" in stats:
prxb_str = "↓"+RNS.prettysize(stats["prxb"])
@@ -892,14 +956,16 @@ def main(must_exit=True, rns_instance=None):
parser.add_argument("-a", "--all", action="store_true", help="show all interfaces", default=False)
parser.add_argument("-A", "--announce-stats", action="store_true", help="show announce stats", default=False)
parser.add_argument("-P", "--pr-stats", action="store_true", help="show path request stats", default=False)
parser.add_argument("-F", "--filter-stats", action="store_true", help="show filtered traffic stats", default=False)
parser.add_argument("-l", "--link-stats", action="store_true", help="show link stats", default=False)
parser.add_argument("-B", "--burst", action="store_true", help="only show interfaces with active bursts", default=False)
parser.add_argument("-b", "--blocked-ips", action="store_true", help="show blocked IPs per interface", default=False)
parser.add_argument("-t", "--totals", action="store_true", help="display traffic totals", default=False)
parser.add_argument("-T", "--tunnels", action="store_true", help="display tunnel information", default=False)
parser.add_argument("-p", "--pps", action="store_true", help="display packets per second in totals", default=False)
parser.add_argument("-q", "--queues", action="store_true", help="display queue stats", default=False)
parser.add_argument("-z", "--profiling", action="store_true", help="display live profiling results", default=False)
parser.add_argument("-s", "--sort", action="store", help="sort interfaces by [rate, traffic, rx, tx, rxs, txs, anns, arx, atx, arxc, atxc, held, prx, ptx, prxc, ptxc, pvs, ivs, flt, txdrp, txdrb, txbuf]", default=None, type=str)
parser.add_argument("-s", "--sort", action="store", help="sort interfaces by [rate, traffic, rx, tx, rxs, txs, frx, ftx, anns, arx, atx, arxc, atxc, afrxc, held, prx, ptx, prxc, ptxc, pvs, ivs, flt, txdrp, txdrb, txbuf]", default=None, type=str)
parser.add_argument("-r", "--reverse", action="store_true", help="reverse sorting", default=False)
parser.add_argument("-j", "--json", action="store_true", help="output in JSON format", default=False)
parser.add_argument("-R", action="store", metavar="hash", help="transport identity hash of remote instance to get status from", default=None, type=str)
@@ -942,7 +1008,7 @@ def main(must_exit=True, rns_instance=None):
remote=args.R, management_identity=args.i, remote_timeout=args.w, must_exit=False, rns_instance=reticulum,
traffic_totals=args.totals, discovered_interfaces=args.discovered, config_entries=args.D, burst_filter=args.burst,
blocked_ips=args.blocked_ips, queue_stats=args.queues, pps=args.pps, profiling=args.profiling,
show_stale=args.show_stale, show_unknown=args.show_unknown)
show_stale=args.show_stale, show_unknown=args.show_unknown, fstats=args.filter_stats, tstats=args.tunnels)
finally:
sys.stdout = old_stdout
@@ -961,7 +1027,8 @@ def main(must_exit=True, rns_instance=None):
remote=args.R, management_identity=args.i, remote_timeout=args.w, must_exit=must_exit, rns_instance=rns_instance,
traffic_totals=args.totals, discovered_interfaces=args.discovered, config_entries=args.D, burst_filter=args.burst,
blocked_ips=args.blocked_ips, queue_stats=args.queues, pps=args.pps, profiling=args.profiling,
attach=args.attach, detach=args.detach, reload=args.reload, show_stale=args.show_stale, show_unknown=args.show_unknown)
attach=args.attach, detach=args.detach, reload=args.reload, show_stale=args.show_stale, tstats=args.tunnels,
show_unknown=args.show_unknown, fstats=args.filter_stats)
except KeyboardInterrupt:
print("")
+9 -1
View File
@@ -87,7 +87,7 @@ instance_random.seed(os.urandom(10))
_always_override_destination = False
logging_lock = threading.Lock()
logging_lock = threading.RLock()
def loglevelname(level):
if (level == LOG_CRITICAL): return "[Critical]"
@@ -180,6 +180,14 @@ def prettyhexrep(data):
hexrep = "<"+delimiter.join("{:02x}".format(c) for c in data)+">"
return hexrep
__namehash_resolver = None
def prettynamehash(name_hash):
global __namehash_resolver
if not __namehash_resolver:
import RNS.Transport
__namehash_resolver = RNS.Transport.destination_type_name
return f"<{__namehash_resolver(name_hash)}>"
def prettycost(value):
if value == None: return "n"
elif not type(value) in (float, int): return "n"
+1 -1
View File
@@ -1 +1 @@
__version__ = "1.6.0"
__version__ = "1.6.1"
+2
View File
@@ -1,5 +1,7 @@
# Reporting Security Issues
Security notices that affect Reticulum are published [in-repository in the docs/security directory](./docs/security).
It goes without saying: If you have discovered a security issue in Reticulum or any related project, please report it responsibly to the maintainer over LXMF at `<8dd57a738226809646089335a6b03695>`. If you wish to remain anonymous, please create a disposable identity to send from, and notify us of any such wishes.
If you are not able to use LXMF, you can send an email to the address currently posted on the maintainer's profile on this site.
@@ -204,6 +204,8 @@ Those people, are in their own words, "Killing Reticulum" (quote, Lew Palm, "aut
And all of those are [void and null](https://reticulum.network/manual/brandolinis.html#void-grants-legal-foundations-of-machine-generated-code), because what they *really* chose is **copyright violation**, and complete disrespect ([as is now becoming tradition](https://reticulum.network/manual/brandolinis.html#licensing-analysis)) for open source development practices, attribution and basic decency.
*(**Important Note From The Future, added November 2026**: When the maintainer of Ratspeak discovered he had made made a mistake in the licensing, he promptly contacted me, and corrected everything within a few hours. As of this update, all the Ratspeak implementations and derivatives are correctly distributed under the Reticulum License.)*
> Underneath the licence choice sits a harder problem, and it is the one this site keeps coming back to: a system can be decentralised in its architecture and completely centralised in who decides things.
Oooooh... Tension. Drama. Tell me more, let's have the juicy details, huh? Outrage incoming, I can feel it! Ramp up your audience like a good boy, Leo!
+1 -1
View File
@@ -1,4 +1,4 @@
# 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.
config: 9b6eb4356bc445a42224e1983b6dd8e9
config: 6795d8fd07f6250f1b0bffe6d5069dbb
tags: 645f666f9bcd5a90fca523b33c5a78b7
@@ -163,7 +163,11 @@ A global, distributed backbone of Reticulum Transport Nodes is being run by volu
As a good starting point, you can find interface definitions for connecting your own networks to this backbone on websites such as `directory.rns.recipes <https://directory.rns.recipes/>`_ and `rmap.world <https://rmap.world/>`_.
.. tip::
Don't rely on just a single connection to the distributed backbone for everyday use. It is much better to have several redundant connections configured, and enable the interface discovery options, so your nodes can continously discover peering opportunities as the network evolves. Refer to the :ref:`Bootstrapping Connectivity<bootstrapping-connectivity>` section to understand the options.
Don't rely on just a single connection to the distributed backbone for everyday use. It is much better to have several redundant connections configured, and enable the interface discovery options, so your nodes can continously discover peering opportunities as the network evolves.
But don't overdo it either! Auto-connecting to a hundred different nodes will waste capacity for node operators and not provide any benefit for yourself either.
Refer to the :ref:`Discovering Interfaces<using-interface_discovery>` section to understand the options.
+16 -3
View File
@@ -621,7 +621,7 @@ To enable the page node, add the following to your ``~/.rngit/config`` file:
.. code:: text
[pages]
serve_nomadnet = yes
serve_nomadnet = yes
When the page node is enabled, ``rngit`` will listen on a Nomad Network node destination in addition to the Git repository destination. You can view the destination hash by running:
@@ -634,6 +634,15 @@ When the page node is enabled, ``rngit`` will listen on a Nomad Network node des
Repositories Destination : <0d7334d411d00120cbad24edf355fdd2>
Nomad Network Destination : <50824b711717f97c2fb1166ceddd5ea9>
You can configure the destination stamp value and required link establishment cost with the following options:
.. code:: text
[pages]
serve_nomadnet = yes
stamp_value = 25.0
link_cost = 18.0
Accessing Repository Pages
--------------------------
@@ -717,8 +726,8 @@ By default, the page node uses Nerd Font icons. If you prefer simpler icons or y
.. code:: text
[pages]
serve_nomadnet = yes
unicode_icons = yes
serve_nomadnet = yes
unicode_icons = yes
Repository Statistics
---------------------
@@ -746,6 +755,8 @@ A complete node configuration might look like this:
node_name = My Git Node
announce_interval = 360
record_stats = yes
stamp_value = 27.5
link_cost = 18.5
[repositories]
public = /var/git/public
@@ -758,6 +769,8 @@ A complete node configuration might look like this:
[pages]
serve_nomadnet = yes
unicode_icons = no
stamp_value = 27.5
link_cost = 18.7
Verified Releases
+6 -6
View File
@@ -1481,11 +1481,11 @@ but all the parameters are exposed for configuration if needed.
sub-interfaces when a new client connects.
* | 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.0``
announces per second.
* | The ``ic_burst_freq`` option sets the maximum announce ingress
frequency for other interfaces. Defaults to ``12`` announces
frequency for other interfaces. Defaults to ``10.0`` announces
per second.
*If an interface exceeds its burst frequency, incoming announces
@@ -1494,21 +1494,21 @@ but all the parameters are exposed for configuration if needed.
* | The ``ic_max_held_announces`` option sets the maximum amount of
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 ``64`` announces.
* | The ``ic_burst_hold`` option sets how much time (in seconds) must
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 ``15``
seconds.
* | The ``ic_burst_penalty`` option sets how much time (in seconds) must
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 ``15``
seconds.
* | The ``ic_held_release_interval`` option sets how much time (in seconds)
must pass between releasing each held announce from the queue. Defaults
to ``30`` seconds.
to ``5`` seconds.
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-
+50 -8
View File
@@ -71,7 +71,7 @@ The base primitives are used to implement scenario-specific network-level primit
The stamp is generated against the individually unique *emission*, so that unstamped or low-value path requests for a destination cannot disrupt the resolution of legitimate ones toward that same destination.
* **Link Request Stamps** embedded stamps, carried in the ephemeral link request keyset. They are therefore completely transparent to the network, but can still be verified extremely quickly by any node along the link request path, who can then make a decision on whether or not to transport it.
* **Link Request Stamps** are embedded stamps, carried in the ephemeral link request keyset. They are therefore completely transparent to the network, but can still be verified extremely quickly by any node along the link request path, who can then make a decision on whether or not to transport it.
Link request cost targets are set by the *endpoint destinations individually*. Every destination that includes a stamp in its announces will also include link request cost signalling. This means that any node that hears an announce from the destination will also know what link request stamp value to target, when establishing links to that destination.
@@ -254,15 +254,20 @@ The filtering subsystem can operate in two modes:
| In addition, any application using the shared instance can temporarily request required destination types for its use. Applications that request required destination types will automatically have them granted, unless they are included in the ``ignored_types`` list.
The filtering defaults and base settings are configured in the ``[filter]`` section of the configuration file. For example, it is possible to explicitly ignore a series of destination types, while also limiting hop reach to a more local topology:
The filtering defaults and base settings are configured in the ``[filter]`` section of the configuration file. For example, it is possible to explicitly ignore a series of destination types, while also limiting hop reach to a more local topology.
.. tip::
The ``hop_limiter`` in the filter section is an instance-wide setting. You can also use the ``hop_limiter`` option *per-interface* if you want to limit hops on some interfaces only.
If you do not know the human readable destination type aspects for a destination type you want to ignore, you can also add entries as 10-byte (20 hexadecimal character) hashes using the ``<c4ace368262d845c9dd3>`` format.
.. code:: ini
[filter]
hop_limiter = 14
ignored_types = application.that.spams, traffic.heavy.service
ignored_types = application.that.spams, traffic.heavy.service, <c4ace368262d845c9dd3>
In some situations, you may want to allow *only* certain destination types. If, for example, you are creating a high-performance transport node intended to handle thousands of simultaneous voice calls at minimal latency, you
In some situations, you may want to allow *only* certain destination types. If, for example, you are creating a high-performance transport node intended to handle thousands of simultaneous voice calls at minimal latency, a configuration might look something like:
.. code:: ini
@@ -270,7 +275,7 @@ In some situations, you may want to allow *only* certain destination types. If,
required_only = yes
allowed_types = lxst.telephony
The filtering subsystem provided in RNS `1.6.0` is functional and useful, but at an early stage, and relatively basic. In the upcoming releases, it will be expanded into a much more comprehensive and flexible system, that will include custom QoS and traffic class tagging, advanced rule definitions and more.
The filtering subsystem provided in RNS ``1.6.0`` is functional and useful, but at an early stage, and relatively basic. In the upcoming releases, it will be expanded into a much more comprehensive and flexible system, that will include custom QoS and traffic class tagging, advanced rule definitions and more.
.. important::
As the filtering and QoS system is developed and matures, the ``required_only`` mode will become the default operating mode for non-transport instances, since applications can already now dynamically request what destination types they are interested in.
@@ -279,12 +284,48 @@ The filtering subsystem provided in RNS `1.6.0` is functional and useful, but at
If you are a developer, see the following section.
Blocking Transport Nodes
------------------------
Misbehaving, spamming and broken transport nodes can be completely blocked using the :ref:`Blackhole system<protecting-blackhole>`. First, obtain the Transport Identity hash of a misbehaving transport node, using ``rnstatus``:
.. code:: txt
$ rnstatus -FATa "71.29.190.5"
BackboneInterface[Client on Bern IPv4/71.29.190.5:37062]
Status : Up
Mode : Gateway
Rate : 250.00 Mbps, MTU 65536
Running : Unknown implementation
Rem.Tr.ID : <a0c289d131c7bfa8d5ddc8b652c0f40d>
Held : 64 announces
Violatns. : 382 protocol
Flt. Hits : 92
Announces : 147174↓ 11193↑ total, 140554 filtered
1.2 Hz↑ (↓0% / ↑0% of flow)
7.8 Hz↓ (t:6h/p:0s/g:1) burst for 4h, 54m and 42.69s
Traffic : ↑4.75 MB 0 bps
↓1.50 MB 0 bps
Filtered : ↑0 B 0 bps
↓55.43 MB 380.14 Kbps
You can then block it by its Transport ID:
.. code:: txt
$ rnpath -B a0c289d131c7bfa8d5ddc8b652c0f40d --reason "Broken node"
Blackholed identity a0c289d131c7bfa8d5ddc8b652c0f40d
Its connection will be immediately torn down, and further reconnection attempts will be ignored.
For Developers
--------------
At some point during the ``1.6.x`` release cycle, RNS will move to using the ``required_only`` mode for *non-transport* instances by default. This means that applications will, in most cases, have to request what types of destinations they are interested in receiving announces from.
If your application is using only using the utility primitives included in RNS, or established protocols such as LXMF or LXST, **there is nothing you have to do**. The protocol primitives *themselves* request their required destination types, and this is the general pattern to follow here:
If your application is only using the utility primitives included in RNS, or established protocols such as LXMF or LXST, **there is nothing you have to do**. The protocol primitives *themselves* request their required destination types, and this is the general pattern to follow here:
- If an application uses a common protocol or primitive, it is the importable primitive, protocol module, or relevant internal functionality that should request destination type requirements, at the point where they are actually needed.
- Higher level application layers should not have to guess at or request destination types, unless it explicitly creates outbound destinations that are not covered by any already-used protocols or primitives.
@@ -301,7 +342,7 @@ You do not *have to* explicitly deregister destination type requirements. Reticu
RNS.Reticulum.get_instance().unwants_destination_type("my_app.service")
That's really all there is to it. If you already now want to make you application more CPU, memory and battery efficient, you can tell Reticulum to start serving only required destinations to it with only one line of additional code. A full setup of this functionality might look something like:
That's really all there is to it. If you already now want to make you application more CPU, memory and battery efficient, you can tell Reticulum to start serving only required destinations to it with only a few lines of additional code. A full setup of this functionality might look something like:
.. code:: python
@@ -320,7 +361,7 @@ In addition to the economic incentives created by stamps, Reticulum enforces a s
At the most basic level, the ``announce_cap`` mechanism limits the bandwidth any interface will allocate to propagating announces and other network upkeep traffic, and prioritises the local topology. Destinations that rapidly re-announce are down-prioritised in the transmission queue, so attempting to gain reach through announce spam has the exact *opposite* effect.
On top of this, per-destination announce rate control can be configured on any interface, or as instance-wide defaults. Once configured, announces *received* for any one destination will only be re-broadcast to other interfaces at the configured target rate, no matter how often they are received. A grace period allows occasional rate violations, and a configurable penalty extends the interval between propagated announces for destinations that repeatedly exceed their target.
On top of this, per-destination announce rate control can be configured on any interface, or as instance-wide defaults. Once configured, announces *received* for any one destination will only be re-broadcast to other interfaces at the configured target rate, no matter how often they are received. The grace option allows occasional rate violations, and a configurable penalty extends the interval between propagated announces for destinations that repeatedly exceed their target.
The final layer protects against bursts of announces for *newly created* destinations. If an interface receives a large influx of announces for previously unknown destinations in a short amount of time, these are held in a bounded queue, while announces for known and established destinations continue to be processed without interruption. After the burst subsides, and an additional waiting period has passed, held announces are released slowly until the queue is cleared.
@@ -332,6 +373,7 @@ Rate limiting bounds the *rate* at which abuse can occur, for everyone, while st
Full configuration details are available in the :ref:`Announce Rate Control<interfaces-announcerates>` and :ref:`New Destination Rate Limiting<interfaces-ingress-control>` sections.
.. _protecting-blachole:
Blackhole Management
====================
+13
View File
@@ -1147,6 +1147,19 @@ Reticulum includes built-in functionality for discovering connectable interfaces
Discovered interfaces can be **auto-connected** by Reticulum, which makes it possible to create setups where an arbitrary interface can act simply as a bootstrap connection, that can be torn down again once more suitable interfaces have been discovered and connected.
.. important::
While it might be tempting to configure Reticulum to auto-connect dozens of interfaces, this will not provide you with any benefit. It will also waste the limited resources of transport node operators. In almost all situations, using 2-3 auto-connected interfaces will be sufficient.
**Remember**: A deeper, more branched topology is *much* more efficient than a completely flat fan-out, where everyone connects to everyone!
For **devices that connect directly** to the distributed backbone, such as phones and other mobile devices, use one or two auto-connects - or a fixed node you that you like, and an auto-connect as redundant backup.
For a transport **node in your home**, serving all devices within it, 2 or 3 autoconnects will be reasonable.
For a **fast boundary node** that sits between a large, internal network with hundreds of active destinations, you can consider using five to six auto-connects. The same is a sensible number for general-purpose transport-providing backbone nodes on the public internet.
In extreme cases, you *can* consider using up to 12 auto-connected interfaces. Almost nobody will need this, but there are edge cases where it could potentially be useful. Do not auto-connect that wide unless you are prepared and capable of processing some serious traffic.
The interface discovery mechanism uses announces sent over Reticulum itself, and supports both publicly readable interfaces and private, encrypted discovery, that can only be decoded by specified *network identities*. It is also possible to specify which network identities should be considered valid sources for discovered interfaces, so that interfaces published by unknown entities are ignored.
.. note::
+1 -1
View File
@@ -1,5 +1,5 @@
const DOCUMENTATION_OPTIONS = {
VERSION: '1.6.0',
VERSION: '1.6.1',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
BUILDER: 'html',
+4 -4
View File
@@ -7,7 +7,7 @@
<link rel="prefetch" href="_static/rns_logo_512.png" as="image">
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 -->
<title>Brandolini’s Reference - Reticulum Network Stack 1.6.0 documentation</title>
<title>Brandolini’s Reference - Reticulum Network Stack 1.6.1 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/copybutton.css?v=76b2166b" />
@@ -180,7 +180,7 @@
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.0 documentation</div></a>
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.1 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
@@ -204,7 +204,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.0 documentation</span>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.1 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -1602,7 +1602,7 @@ is where this project invested.</p></li>
</aside>
</div>
</div><script src="_static/documentation_options.js?v=72d88caf"></script>
</div><script src="_static/documentation_options.js?v=d6a008b6"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script>
+4 -4
View File
@@ -7,7 +7,7 @@
<link rel="prefetch" href="_static/rns_logo_512.png" as="image">
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 -->
<title>Distributed Development - Reticulum Network Stack 1.6.0 documentation</title>
<title>Distributed Development - Reticulum Network Stack 1.6.1 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/copybutton.css?v=76b2166b" />
@@ -180,7 +180,7 @@
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.0 documentation</div></a>
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.1 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
@@ -204,7 +204,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.0 documentation</span>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.1 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -433,7 +433,7 @@
</aside>
</div>
</div><script src="_static/documentation_options.js?v=72d88caf"></script>
</div><script src="_static/documentation_options.js?v=d6a008b6"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script>
+4 -4
View File
@@ -7,7 +7,7 @@
<link rel="prefetch" href="_static/rns_logo_512.png" as="image">
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 -->
<title>Code Examples - Reticulum Network Stack 1.6.0 documentation</title>
<title>Code Examples - Reticulum Network Stack 1.6.1 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/copybutton.css?v=76b2166b" />
@@ -180,7 +180,7 @@
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.0 documentation</div></a>
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.1 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
@@ -204,7 +204,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.0 documentation</span>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.1 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -3653,7 +3653,7 @@
</aside>
</div>
</div><script src="_static/documentation_options.js?v=72d88caf"></script>
</div><script src="_static/documentation_options.js?v=d6a008b6"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script>
+4 -4
View File
@@ -7,7 +7,7 @@
<link rel="prefetch" href="_static/rns_logo_512.png" as="image">
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 -->
<title>An Explanation of Reticulum for Human Beings - Reticulum Network Stack 1.6.0 documentation</title>
<title>An Explanation of Reticulum for Human Beings - Reticulum Network Stack 1.6.1 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/copybutton.css?v=76b2166b" />
@@ -180,7 +180,7 @@
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.0 documentation</div></a>
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.1 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
@@ -204,7 +204,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.0 documentation</span>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.1 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -298,7 +298,7 @@
</aside>
</div>
</div><script src="_static/documentation_options.js?v=72d88caf"></script>
</div><script src="_static/documentation_options.js?v=d6a008b6"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script>
+6 -4
View File
@@ -5,7 +5,7 @@
<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">
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 --><title>Index - Reticulum Network Stack 1.6.0 documentation</title>
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 --><title>Index - Reticulum Network Stack 1.6.1 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/copybutton.css?v=76b2166b" />
@@ -178,7 +178,7 @@
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.0 documentation</div></a>
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.1 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
@@ -202,7 +202,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.0 documentation</span>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.1 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -444,6 +444,8 @@
<li><a href="reference.html#RNS.Resource.get_hash">get_hash() (RNS.Resource method)</a>
</li>
<li><a href="reference.html#RNS.Reticulum.get_instance">get_instance() (RNS.Reticulum static method)</a>
</li>
<li><a href="reference.html#RNS.Reticulum.get_instance_pid">get_instance_pid() (RNS.Reticulum static method)</a>
</li>
<li><a href="reference.html#RNS.Destination.get_link_cost">get_link_cost() (RNS.Destination method)</a>
</li>
@@ -870,7 +872,7 @@
</aside>
</div>
</div><script src="_static/documentation_options.js?v=72d88caf"></script>
</div><script src="_static/documentation_options.js?v=d6a008b6"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script>
+7 -5
View File
@@ -7,7 +7,7 @@
<link rel="prefetch" href="_static/rns_logo_512.png" as="image">
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 -->
<title>Getting Started Fast - Reticulum Network Stack 1.6.0 documentation</title>
<title>Getting Started Fast - Reticulum Network Stack 1.6.1 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/copybutton.css?v=76b2166b" />
@@ -180,7 +180,7 @@
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.0 documentation</div></a>
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.1 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
@@ -204,7 +204,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.0 documentation</span>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.1 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -378,7 +378,9 @@ sudo<span class="w"> </span>dnf<span class="w"> </span>groupinstall<span class="
<p>As a good starting point, you can find interface definitions for connecting your own networks to this backbone on websites such as <a class="reference external" href="https://directory.rns.recipes/">directory.rns.recipes</a> and <a class="reference external" href="https://rmap.world/">rmap.world</a>.</p>
<div class="admonition tip">
<p class="admonition-title">Tip</p>
<p>Don’t rely on just a single connection to the distributed backbone for everyday use. It is much better to have several redundant connections configured, and enable the interface discovery options, so your nodes can continously discover peering opportunities as the network evolves. Refer to the <a class="reference internal" href="#bootstrapping-connectivity"><span class="std std-ref">Bootstrapping Connectivity</span></a> section to understand the options.</p>
<p>Don’t rely on just a single connection to the distributed backbone for everyday use. It is much better to have several redundant connections configured, and enable the interface discovery options, so your nodes can continously discover peering opportunities as the network evolves.</p>
<p>But don’t overdo it either! Auto-connecting to a hundred different nodes will waste capacity for node operators and not provide any benefit for yourself either.</p>
<p>Refer to the <a class="reference internal" href="using.html#using-interface-discovery"><span class="std std-ref">Discovering Interfaces</span></a> section to understand the options.</p>
</div>
</section>
<section id="hosting-public-entrypoints">
@@ -778,7 +780,7 @@ section of this manual.</p>
</aside>
</div>
</div><script src="_static/documentation_options.js?v=72d88caf"></script>
</div><script src="_static/documentation_options.js?v=d6a008b6"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script>
+18 -7
View File
@@ -7,7 +7,7 @@
<link rel="prefetch" href="_static/rns_logo_512.png" as="image">
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 -->
<title>Git Over Reticulum - Reticulum Network Stack 1.6.0 documentation</title>
<title>Git Over Reticulum - Reticulum Network Stack 1.6.1 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/copybutton.css?v=76b2166b" />
@@ -180,7 +180,7 @@
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.0 documentation</div></a>
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.1 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
@@ -204,7 +204,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.0 documentation</span>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.1 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -759,7 +759,7 @@ options:
<h3>Enabling the Git Page Node<a class="headerlink" href="#enabling-the-git-page-node" title="Link to this heading"></a></h3>
<p>To enable the page node, add the following to your <code class="docutils literal notranslate"><span class="pre">~/.rngit/config</span></code> file:</p>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>[pages]
serve_nomadnet = yes
serve_nomadnet = yes
</pre></div>
</div>
<p>When the page node is enabled, <code class="docutils literal notranslate"><span class="pre">rngit</span></code> will listen on a Nomad Network node destination in addition to the Git repository destination. You can view the destination hash by running:</p>
@@ -771,6 +771,13 @@ Repositories Destination : &lt;0d7334d411d00120cbad24edf355fdd2&gt;
Nomad Network Destination : &lt;50824b711717f97c2fb1166ceddd5ea9&gt;
</pre></div>
</div>
<p>You can configure the destination stamp value and required link establishment cost with the following options:</p>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>[pages]
serve_nomadnet = yes
stamp_value = 25.0
link_cost = 18.0
</pre></div>
</div>
</section>
<section id="accessing-repository-pages">
<h3>Accessing Repository Pages<a class="headerlink" href="#accessing-repository-pages" title="Link to this heading"></a></h3>
@@ -838,8 +845,8 @@ def hello_world():
<p><strong>Icon Sets</strong></p>
<p>By default, the page node uses Nerd Font icons. If you prefer simpler icons or your terminal does not support Nerd Fonts, you can enable Unicode icons instead:</p>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>[pages]
serve_nomadnet = yes
unicode_icons = yes
serve_nomadnet = yes
unicode_icons = yes
</pre></div>
</div>
</section>
@@ -862,6 +869,8 @@ unicode_icons = yes
node_name = My Git Node
announce_interval = 360
record_stats = yes
stamp_value = 27.5
link_cost = 18.5
[repositories]
public = /var/git/public
@@ -874,6 +883,8 @@ unicode_icons = yes
[pages]
serve_nomadnet = yes
unicode_icons = no
stamp_value = 27.5
link_cost = 18.7
</pre></div>
</div>
</section>
@@ -1602,7 +1613,7 @@ done
</aside>
</div>
</div><script src="_static/documentation_options.js?v=72d88caf"></script>
</div><script src="_static/documentation_options.js?v=d6a008b6"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script>
+4 -4
View File
@@ -7,7 +7,7 @@
<link rel="prefetch" href="_static/rns_logo_512.png" as="image">
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 -->
<title>Communications Hardware - Reticulum Network Stack 1.6.0 documentation</title>
<title>Communications Hardware - Reticulum Network Stack 1.6.1 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/copybutton.css?v=76b2166b" />
@@ -180,7 +180,7 @@
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.0 documentation</div></a>
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.1 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
@@ -204,7 +204,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.0 documentation</span>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.1 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -678,7 +678,7 @@ can be used with Reticulum. This includes virtual software modems such as
</aside>
</div>
</div><script src="_static/documentation_options.js?v=72d88caf"></script>
</div><script src="_static/documentation_options.js?v=d6a008b6"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script>
+5 -4
View File
@@ -7,7 +7,7 @@
<link rel="prefetch" href="_static/rns_logo_512.png" as="image">
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 -->
<title>Reticulum Network Stack 1.6.0 documentation</title>
<title>Reticulum Network Stack 1.6.1 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/copybutton.css?v=76b2166b" />
@@ -180,7 +180,7 @@
</label>
</div>
<div class="header-center">
<a href="#"><div class="brand">Reticulum Network Stack 1.6.0 documentation</div></a>
<a href="#"><div class="brand">Reticulum Network Stack 1.6.1 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
@@ -204,7 +204,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.0 documentation</span>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.1 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -462,6 +462,7 @@ to participate in the development of Reticulum itself.</p>
</li>
<li class="toctree-l2"><a class="reference internal" href="protecting.html#filtering-qos">Filtering &amp; QoS</a><ul>
<li class="toctree-l3"><a class="reference internal" href="protecting.html#id1">Instance Configuration</a></li>
<li class="toctree-l3"><a class="reference internal" href="protecting.html#blocking-transport-nodes">Blocking Transport Nodes</a></li>
<li class="toctree-l3"><a class="reference internal" href="protecting.html#id2">For Developers</a></li>
</ul>
</li>
@@ -848,7 +849,7 @@ to participate in the development of Reticulum itself.</p>
</aside>
</div>
</div><script src="_static/documentation_options.js?v=72d88caf"></script>
</div><script src="_static/documentation_options.js?v=d6a008b6"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script>
+10 -10
View File
@@ -7,7 +7,7 @@
<link rel="prefetch" href="_static/rns_logo_512.png" as="image">
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 -->
<title>Configuring Interfaces - Reticulum Network Stack 1.6.0 documentation</title>
<title>Configuring Interfaces - Reticulum Network Stack 1.6.1 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/copybutton.css?v=76b2166b" />
@@ -180,7 +180,7 @@
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.0 documentation</div></a>
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.1 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
@@ -204,7 +204,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.0 documentation</span>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.1 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -1651,13 +1651,13 @@ sub-interfaces when a new client connects.</div>
</li>
<li><div class="line-block">
<div class="line">The <code class="docutils literal notranslate"><span class="pre">ic_burst_freq_new</span></code> option sets the maximum announce ingress
frequency for newly spawned interfaces. Defaults to <code class="docutils literal notranslate"><span class="pre">3.5</span></code>
frequency for newly spawned interfaces. Defaults to <code class="docutils literal notranslate"><span class="pre">3.0</span></code>
announces per second.</div>
</div>
</li>
<li><div class="line-block">
<div class="line">The <code class="docutils literal notranslate"><span class="pre">ic_burst_freq</span></code> option sets the maximum announce ingress
frequency for other interfaces. Defaults to <code class="docutils literal notranslate"><span class="pre">12</span></code> announces
frequency for other interfaces. Defaults to <code class="docutils literal notranslate"><span class="pre">10.0</span></code> announces
per second.</div>
</div>
<blockquote>
@@ -1669,27 +1669,27 @@ not processed until later.</em></p>
<li><div class="line-block">
<div class="line">The <code class="docutils literal notranslate"><span class="pre">ic_max_held_announces</span></code> option sets the maximum amount of
unique announces that will be held in the queue. Any additional
unique announces will be dropped. Defaults to <code class="docutils literal notranslate"><span class="pre">256</span></code> announces.</div>
unique announces will be dropped. Defaults to <code class="docutils literal notranslate"><span class="pre">64</span></code> announces.</div>
</div>
</li>
<li><div class="line-block">
<div class="line">The <code class="docutils literal notranslate"><span class="pre">ic_burst_hold</span></code> option sets how much time (in seconds) must
pass after the burst frequency drops below its threshold, for the
announce burst to be considered cleared. Defaults to <code class="docutils literal notranslate"><span class="pre">60</span></code>
announce burst to be considered cleared. Defaults to <code class="docutils literal notranslate"><span class="pre">15</span></code>
seconds.</div>
</div>
</li>
<li><div class="line-block">
<div class="line">The <code class="docutils literal notranslate"><span class="pre">ic_burst_penalty</span></code> option sets how much time (in seconds) must
pass after the burst is considered cleared, before held announces can
start being released from the queue. Defaults to <code class="docutils literal notranslate"><span class="pre">5*60</span></code>
start being released from the queue. Defaults to <code class="docutils literal notranslate"><span class="pre">15</span></code>
seconds.</div>
</div>
</li>
<li><div class="line-block">
<div class="line">The <code class="docutils literal notranslate"><span class="pre">ic_held_release_interval</span></code> option sets how much time (in seconds)
must pass between releasing each held announce from the queue. Defaults
to <code class="docutils literal notranslate"><span class="pre">30</span></code> seconds.</div>
to <code class="docutils literal notranslate"><span class="pre">5</span></code> seconds.</div>
</div>
</li>
</ul>
@@ -1903,7 +1903,7 @@ queue. Defaults to <code class="docutils literal notranslate"><span class="pre">
</aside>
</div>
</div><script src="_static/documentation_options.js?v=72d88caf"></script>
</div><script src="_static/documentation_options.js?v=d6a008b6"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script>
+4 -4
View File
@@ -7,7 +7,7 @@
<link rel="prefetch" href="_static/rns_logo_512.png" as="image">
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 -->
<title>Reticulum License - Reticulum Network Stack 1.6.0 documentation</title>
<title>Reticulum License - Reticulum Network Stack 1.6.1 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/copybutton.css?v=76b2166b" />
@@ -180,7 +180,7 @@
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.0 documentation</div></a>
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.1 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
@@ -204,7 +204,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.0 documentation</span>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.1 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -347,7 +347,7 @@ SOFTWARE.
</aside>
</div>
</div><script src="_static/documentation_options.js?v=72d88caf"></script>
</div><script src="_static/documentation_options.js?v=d6a008b6"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script>
+4 -4
View File
@@ -7,7 +7,7 @@
<link rel="prefetch" href="_static/rns_logo_512.png" as="image">
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 -->
<title>Building Networks - Reticulum Network Stack 1.6.0 documentation</title>
<title>Building Networks - Reticulum Network Stack 1.6.1 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/copybutton.css?v=76b2166b" />
@@ -180,7 +180,7 @@
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.0 documentation</div></a>
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.1 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
@@ -204,7 +204,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.0 documentation</span>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.1 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -666,7 +666,7 @@ differently than a mobile device roaming between radio cells.</p>
</aside>
</div>
</div><script src="_static/documentation_options.js?v=72d88caf"></script>
</div><script src="_static/documentation_options.js?v=d6a008b6"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script>
Binary file not shown.
+50 -13
View File
@@ -7,7 +7,7 @@
<link rel="prefetch" href="_static/rns_logo_512.png" as="image">
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 -->
<title>Protecting Open Networks - Reticulum Network Stack 1.6.0 documentation</title>
<title>Protecting Open Networks - Reticulum Network Stack 1.6.1 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/copybutton.css?v=76b2166b" />
@@ -180,7 +180,7 @@
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.0 documentation</div></a>
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.1 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
@@ -204,7 +204,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.0 documentation</span>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.1 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -319,7 +319,7 @@
<li><p><strong>Path Request Stamps</strong> are also detached stamps, but generated <em>individually</em> for every path request emitted on the network. These will typically have a much lower cost requirement than destination stamps, but if a node is overwhelmed by path requests, it can be tuned higher.</p>
<p>The stamp is generated against the individually unique <em>emission</em>, so that unstamped or low-value path requests for a destination cannot disrupt the resolution of legitimate ones toward that same destination.</p>
</li>
<li><p><strong>Link Request Stamps</strong> embedded stamps, carried in the ephemeral link request keyset. They are therefore completely transparent to the network, but can still be verified extremely quickly by any node along the link request path, who can then make a decision on whether or not to transport it.</p>
<li><p><strong>Link Request Stamps</strong> are embedded stamps, carried in the ephemeral link request keyset. They are therefore completely transparent to the network, but can still be verified extremely quickly by any node along the link request path, who can then make a decision on whether or not to transport it.</p>
<p>Link request cost targets are set by the <em>endpoint destinations individually</em>. Every destination that includes a stamp in its announces will also include link request cost signalling. This means that any node that hears an announce from the destination will also know what link request stamp value to target, when establishing links to that destination.</p>
<p>Furthermore, spam and link request abuse can be filtered before even reaching the destination, if at least one node along the path validates the link request stamp value and cost requirement.</p>
</li>
@@ -513,19 +513,24 @@ option. It will become mandatory and enabled by default in RNS
</li>
</ul>
</div></blockquote>
<p>The filtering defaults and base settings are configured in the <code class="docutils literal notranslate"><span class="pre">[filter]</span></code> section of the configuration file. For example, it is possible to explicitly ignore a series of destination types, while also limiting hop reach to a more local topology:</p>
<p>The filtering defaults and base settings are configured in the <code class="docutils literal notranslate"><span class="pre">[filter]</span></code> section of the configuration file. For example, it is possible to explicitly ignore a series of destination types, while also limiting hop reach to a more local topology.</p>
<div class="admonition tip">
<p class="admonition-title">Tip</p>
<p>The <code class="docutils literal notranslate"><span class="pre">hop_limiter</span></code> in the filter section is an instance-wide setting. You can also use the <code class="docutils literal notranslate"><span class="pre">hop_limiter</span></code> option <em>per-interface</em> if you want to limit hops on some interfaces only.</p>
</div>
<p>If you do not know the human readable destination type aspects for a destination type you want to ignore, you can also add entries as 10-byte (20 hexadecimal character) hashes using the <code class="docutils literal notranslate"><span class="pre">&lt;c4ace368262d845c9dd3&gt;</span></code> format.</p>
<div class="highlight-ini notranslate"><div class="highlight"><pre><span></span><span class="k">[filter]</span>
<span class="w"> </span><span class="na">hop_limiter</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">14</span>
<span class="w"> </span><span class="na">ignored_types</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">application.that.spams, traffic.heavy.service</span>
<span class="w"> </span><span class="na">ignored_types</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">application.that.spams, traffic.heavy.service, &lt;c4ace368262d845c9dd3&gt;</span>
</pre></div>
</div>
<p>In some situations, you may want to allow <em>only</em> certain destination types. If, for example, you are creating a high-performance transport node intended to handle thousands of simultaneous voice calls at minimal latency, you</p>
<p>In some situations, you may want to allow <em>only</em> certain destination types. If, for example, you are creating a high-performance transport node intended to handle thousands of simultaneous voice calls at minimal latency, a configuration might look something like:</p>
<div class="highlight-ini notranslate"><div class="highlight"><pre><span></span><span class="k">[filter]</span>
<span class="w"> </span><span class="na">required_only</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">allowed_types</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">lxst.telephony</span>
</pre></div>
</div>
<p>The filtering subsystem provided in RNS <cite>1.6.0</cite> is functional and useful, but at an early stage, and relatively basic. In the upcoming releases, it will be expanded into a much more comprehensive and flexible system, that will include custom QoS and traffic class tagging, advanced rule definitions and more.</p>
<p>The filtering subsystem provided in RNS <code class="docutils literal notranslate"><span class="pre">1.6.0</span></code> is functional and useful, but at an early stage, and relatively basic. In the upcoming releases, it will be expanded into a much more comprehensive and flexible system, that will include custom QoS and traffic class tagging, advanced rule definitions and more.</p>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>As the filtering and QoS system is developed and matures, the <code class="docutils literal notranslate"><span class="pre">required_only</span></code> mode will become the default operating mode for non-transport instances, since applications can already now dynamically request what destination types they are interested in.</p>
@@ -533,10 +538,41 @@ option. It will become mandatory and enabled by default in RNS
<p>If you are a developer, see the following section.</p>
</div>
</section>
<section id="blocking-transport-nodes">
<h3>Blocking Transport Nodes<a class="headerlink" href="#blocking-transport-nodes" title="Link to this heading"></a></h3>
<p>Misbehaving, spamming and broken transport nodes can be completely blocked using the <span class="xref std std-ref">Blackhole system</span>. First, obtain the Transport Identity hash of a misbehaving transport node, using <code class="docutils literal notranslate"><span class="pre">rnstatus</span></code>:</p>
<div class="highlight-txt notranslate"><div class="highlight"><pre><span></span>$ rnstatus -FATa &quot;71.29.190.5&quot;
BackboneInterface[Client on Bern IPv4/71.29.190.5:37062]
Status : Up
Mode : Gateway
Rate : 250.00 Mbps, MTU 65536
Running : Unknown implementation
Rem.Tr.ID : &lt;a0c289d131c7bfa8d5ddc8b652c0f40d&gt;
Held : 64 announces
Violatns. : 382 protocol
Flt. Hits : 92
Announces : 147174↓ 11193↑ total, 140554 filtered
1.2 Hz↑ (↓0% / ↑0% of flow)
7.8 Hz↓ (t:6h/p:0s/g:1) burst for 4h, 54m and 42.69s
Traffic : ↑4.75 MB 0 bps
↓1.50 MB 0 bps
Filtered : ↑0 B 0 bps
↓55.43 MB 380.14 Kbps
</pre></div>
</div>
<p>You can then block it by its Transport ID:</p>
<div class="highlight-txt notranslate"><div class="highlight"><pre><span></span>$ rnpath -B a0c289d131c7bfa8d5ddc8b652c0f40d --reason &quot;Broken node&quot;
Blackholed identity a0c289d131c7bfa8d5ddc8b652c0f40d
</pre></div>
</div>
<p>Its connection will be immediately torn down, and further reconnection attempts will be ignored.</p>
</section>
<section id="id2">
<h3>For Developers<a class="headerlink" href="#id2" title="Link to this heading"></a></h3>
<p>At some point during the <code class="docutils literal notranslate"><span class="pre">1.6.x</span></code> release cycle, RNS will move to using the <code class="docutils literal notranslate"><span class="pre">required_only</span></code> mode for <em>non-transport</em> instances by default. This means that applications will, in most cases, have to request what types of destinations they are interested in receiving announces from.</p>
<p>If your application is using only using the utility primitives included in RNS, or established protocols such as LXMF or LXST, <strong>there is nothing you have to do</strong>. The protocol primitives <em>themselves</em> request their required destination types, and this is the general pattern to follow here:</p>
<p>If your application is only using the utility primitives included in RNS, or established protocols such as LXMF or LXST, <strong>there is nothing you have to do</strong>. The protocol primitives <em>themselves</em> request their required destination types, and this is the general pattern to follow here:</p>
<ul class="simple">
<li><p>If an application uses a common protocol or primitive, it is the importable primitive, protocol module, or relevant internal functionality that should request destination type requirements, at the point where they are actually needed.</p></li>
<li><p>Higher level application layers should not have to guess at or request destination types, unless it explicitly creates outbound destinations that are not covered by any already-used protocols or primitives.</p></li>
@@ -549,7 +585,7 @@ option. It will become mandatory and enabled by default in RNS
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">RNS</span><span class="o">.</span><span class="n">Reticulum</span><span class="o">.</span><span class="n">get_instance</span><span class="p">()</span><span class="o">.</span><span class="n">unwants_destination_type</span><span class="p">(</span><span class="s2">&quot;my_app.service&quot;</span><span class="p">)</span>
</pre></div>
</div>
<p>That’s really all there is to it. If you already now want to make you application more CPU, memory and battery efficient, you can tell Reticulum to start serving only required destinations to it with only one line of additional code. A full setup of this functionality might look something like:</p>
<p>That’s really all there is to it. If you already now want to make you application more CPU, memory and battery efficient, you can tell Reticulum to start serving only required destinations to it with only a few lines of additional code. A full setup of this functionality might look something like:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="k">for</span> <span class="n">destination_type</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">REQUIRED_DESTINATION_TYPES</span><span class="p">:</span>
<span class="n">RNS</span><span class="o">.</span><span class="n">Reticulum</span><span class="o">.</span><span class="n">get_instance</span><span class="p">()</span><span class="o">.</span><span class="n">wants_destination_type</span><span class="p">(</span><span class="n">destination_type</span><span class="p">)</span>
@@ -563,7 +599,7 @@ option. It will become mandatory and enabled by default in RNS
<h2>Ingress &amp; Burst Control<a class="headerlink" href="#ingress-burst-control" title="Link to this heading"></a></h2>
<p>In addition to the economic incentives created by stamps, Reticulum enforces a set of hydraulic limits on how much announce traffic any peer or destination can inject into the network. These mechanisms work automatically, require no operator configuration (but can be tuned, if required), and apply equally to all peers.</p>
<p>At the most basic level, the <code class="docutils literal notranslate"><span class="pre">announce_cap</span></code> mechanism limits the bandwidth any interface will allocate to propagating announces and other network upkeep traffic, and prioritises the local topology. Destinations that rapidly re-announce are down-prioritised in the transmission queue, so attempting to gain reach through announce spam has the exact <em>opposite</em> effect.</p>
<p>On top of this, per-destination announce rate control can be configured on any interface, or as instance-wide defaults. Once configured, announces <em>received</em> for any one destination will only be re-broadcast to other interfaces at the configured target rate, no matter how often they are received. A grace period allows occasional rate violations, and a configurable penalty extends the interval between propagated announces for destinations that repeatedly exceed their target.</p>
<p>On top of this, per-destination announce rate control can be configured on any interface, or as instance-wide defaults. Once configured, announces <em>received</em> for any one destination will only be re-broadcast to other interfaces at the configured target rate, no matter how often they are received. The grace option allows occasional rate violations, and a configurable penalty extends the interval between propagated announces for destinations that repeatedly exceed their target.</p>
<p>The final layer protects against bursts of announces for <em>newly created</em> destinations. If an interface receives a large influx of announces for previously unknown destinations in a short amount of time, these are held in a bounded queue, while announces for known and established destinations continue to be processed without interruption. After the burst subsides, and an additional waiting period has passed, held announces are released slowly until the queue is cleared.</p>
<p>A node that connects to a public interface, announces a large number of bogus destinations, and then disconnects, will therefore never get those destinations into path tables at all. When the interface they arrived on disappears, the held announces are simply dropped and forgotten.</p>
<p>Ingress control operates at the level of individual sub-interfaces, so one misbehaving client cannot disrupt announce processing for other clients connected to the same listener. Combined with stamps, these mechanisms are complementary:</p>
@@ -571,7 +607,7 @@ option. It will become mandatory and enabled by default in RNS
<p>Full configuration details are available in the <a class="reference internal" href="interfaces.html#interfaces-announcerates"><span class="std std-ref">Announce Rate Control</span></a> and <a class="reference internal" href="interfaces.html#interfaces-ingress-control"><span class="std std-ref">New Destination Rate Limiting</span></a> sections.</p>
</section>
<section id="blackhole-management">
<h2>Blackhole Management<a class="headerlink" href="#blackhole-management" title="Link to this heading"></a></h2>
<span id="protecting-blachole"></span><h2>Blackhole Management<a class="headerlink" href="#blackhole-management" title="Link to this heading"></a></h2>
<p>The <em>blackhole</em> system allows any node operator or individual user to block specific identities at the transport layer.</p>
<p>Once an identity has been blackholed on a node, announces originating from <em>any</em> destination associated with that identity are dropped, and the node will refuse to transport traffic, or establish and maintain links, to the blackholed identity’s destinations.</p>
<p>It is important to understand the scope of this mechanism corrrectly. There is fundamentally <strong>no way</strong> to <em>globally</em> block or censor any identity or destination in Reticulum networks. A blackhole entry only applies on the network segments that enforce it, which is the exact intention. Operators retain full control over what is allowed on their own segments, while no one can impose restrictions on segments they do not operate.</p>
@@ -656,6 +692,7 @@ option. It will become mandatory and enabled by default in RNS
</li>
<li><a class="reference internal" href="#filtering-qos">Filtering &amp; QoS</a><ul>
<li><a class="reference internal" href="#id1">Instance Configuration</a></li>
<li><a class="reference internal" href="#blocking-transport-nodes">Blocking Transport Nodes</a></li>
<li><a class="reference internal" href="#id2">For Developers</a></li>
</ul>
</li>
@@ -673,7 +710,7 @@ option. It will become mandatory and enabled by default in RNS
</aside>
</div>
</div><script src="_static/documentation_options.js?v=72d88caf"></script>
</div><script src="_static/documentation_options.js?v=d6a008b6"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script>
+11 -4
View File
@@ -7,7 +7,7 @@
<link rel="prefetch" href="_static/rns_logo_512.png" as="image">
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 -->
<title>API Reference - Reticulum Network Stack 1.6.0 documentation</title>
<title>API Reference - Reticulum Network Stack 1.6.1 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/copybutton.css?v=76b2166b" />
@@ -180,7 +180,7 @@
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.0 documentation</div></a>
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.1 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
@@ -204,7 +204,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.0 documentation</span>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.1 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -349,6 +349,12 @@ to successfully establish links. Currently 5 bits per second.</p>
<dd><p>Returns the currently running Reticulum instance.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="RNS.Reticulum.get_instance_pid">
<em class="property"><span class="k"><span class="pre">static</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">get_instance_pid</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#RNS.Reticulum.get_instance_pid" title="Link to this definition"></a></dt>
<dd><p>Returns the main process ID of the currently running Reticulum instance.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="RNS.Reticulum.get_first_hop_timeout">
<span class="sig-name descname"><span class="pre">get_first_hop_timeout</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">destination</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#RNS.Reticulum.get_first_hop_timeout" title="Link to this definition"></a></dt>
@@ -2464,6 +2470,7 @@ will announce it.</p>
<li><a class="reference internal" href="#RNS.Reticulum.MINIMUM_BITRATE"><code class="docutils literal notranslate"><span class="pre">MINIMUM_BITRATE</span></code></a></li>
<li><a class="reference internal" href="#RNS.Reticulum.DEFAULT_PER_HOP_TIMEOUT"><code class="docutils literal notranslate"><span class="pre">DEFAULT_PER_HOP_TIMEOUT</span></code></a></li>
<li><a class="reference internal" href="#RNS.Reticulum.get_instance"><code class="docutils literal notranslate"><span class="pre">get_instance()</span></code></a></li>
<li><a class="reference internal" href="#RNS.Reticulum.get_instance_pid"><code class="docutils literal notranslate"><span class="pre">get_instance_pid()</span></code></a></li>
<li><a class="reference internal" href="#RNS.Reticulum.get_first_hop_timeout"><code class="docutils literal notranslate"><span class="pre">get_first_hop_timeout()</span></code></a></li>
<li><a class="reference internal" href="#RNS.Reticulum.get_lowest_interface_bitrate"><code class="docutils literal notranslate"><span class="pre">get_lowest_interface_bitrate()</span></code></a></li>
<li><a class="reference internal" href="#RNS.Reticulum.get_medium_path_timeout"><code class="docutils literal notranslate"><span class="pre">get_medium_path_timeout()</span></code></a></li>
@@ -2670,7 +2677,7 @@ will announce it.</p>
</aside>
</div>
</div><script src="_static/documentation_options.js?v=72d88caf"></script>
</div><script src="_static/documentation_options.js?v=d6a008b6"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script>
+4 -4
View File
@@ -8,7 +8,7 @@
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 -->
<meta name="robots" content="noindex" />
<title>Search - Reticulum Network Stack 1.6.0 documentation</title><link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" />
<title>Search - Reticulum Network Stack 1.6.1 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/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" />
@@ -180,7 +180,7 @@
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.0 documentation</div></a>
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.1 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
@@ -204,7 +204,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.0 documentation</span>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.1 documentation</span>
</a><form class="sidebar-search-container" method="get" action="#" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -306,7 +306,7 @@
</aside>
</div>
</div><script src="_static/documentation_options.js?v=72d88caf"></script>
</div><script src="_static/documentation_options.js?v=d6a008b6"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script>
+1 -1
View File
@@ -1 +1 @@
Search.setIndex({"alltitles":{"A Carrier-Grade Fallacy":[[18,"a-carrier-grade-fallacy"]],"A History Of What Works":[[0,"a-history-of-what-works"]],"A Persistent, But Fragile Triad":[[0,"a-persistent-but-fragile-triad"]],"API Reference":[[12,null]],"ARM64":[[4,"arm64"]],"AX.25 KISS Interface":[[8,"ax-25-kiss-interface"]],"Accessing Repository Pages":[[5,"accessing-repository-pages"]],"Addendum A: The Prns Case":[[0,"addendum-a-the-prns-case"]],"Adding Radio Interfaces":[[4,"adding-radio-interfaces"]],"Agency and answerability":[[0,"agency-and-answerability"]],"An Explanation of Reticulum for Human Beings":[[3,null]],"Anchor In The Flow":[[18,"anchor-in-the-flow"]],"Android":[[4,"android"]],"Announce":[[2,"announce"]],"Announce Propagation Rules":[[15,"announce-propagation-rules"]],"Announce Rate Control":[[8,"announce-rate-control"]],"Announcing Presence":[[18,"announcing-presence"]],"Artifact-Centered Workflows":[[1,"artifact-centered-workflows"]],"Assistance Versus Machine-Substitution":[[0,"assistance-versus-machine-substitution"]],"Author Identity Binding":[[5,"author-identity-binding"]],"Auto Interface":[[8,"auto-interface"]],"Automated Blocking":[[8,"automated-blocking"]],"Automated List Sourcing":[[16,"automated-list-sourcing"]],"Automatic Mirror Synchronization":[[5,"automatic-mirror-synchronization"]],"Backbone Interface":[[8,"backbone-interface"]],"Base Primitives":[[11,"base-primitives"]],"Blackhole Management":[[11,"blackhole-management"],[16,"blackhole-management"]],"Bootstrapping Connectivity":[[4,"bootstrapping-connectivity"]],"Brandolini\u2019s Reference":[[0,null]],"Broadcast":[[2,"broadcast"]],"Browsing & Publishing":[[13,"browsing-publishing"]],"Buffer":[[2,"buffer"]],"Build Personal Infrastructure":[[4,"build-personal-infrastructure"]],"Building Networks":[[10,null]],"Channel":[[2,"channel"]],"Chat":[[13,"chat"]],"Code Examples":[[2,null]],"Columba":[[13,"id8"]],"Combining Hardware Types":[[6,"combining-hardware-types"]],"Command-Line Interaction":[[5,"command-line-interaction"]],"Commit Signing":[[5,"commit-signing"]],"Common Interface Options":[[8,"common-interface-options"]],"Communications Hardware":[[6,null]],"Composable Primitives":[[1,"composable-primitives"]],"Concepts & Overview":[[10,"concepts-overview"]],"Conceptual Overview":[[15,"conceptual-overview"]],"Conclusion":[[0,"conclusion"]],"Configuration":[[5,"configuration"],[5,"id1"]],"Configuration & Data":[[16,"configuration-data"]],"Configuration Example":[[5,"configuration-example"]],"Configuration Methods":[[5,"configuration-methods"]],"Configuring Interfaces":[[8,null]],"Configuring Stamps":[[11,"configuring-stamps"]],"Connect to the Distributed Backbone":[[4,"connect-to-the-distributed-backbone"]],"Connecting Remotes":[[8,"connecting-remotes"]],"Connecting Reticulum Instances Over the Internet":[[4,"connecting-reticulum-instances-over-the-internet"]],"Consequences":[[0,"consequences"]],"Contributing to the Global Ret":[[4,"contributing-to-the-global-ret"]],"Copyright & The Two Legal Layers":[[0,"copyright-the-two-legal-layers"]],"Cost Of A Byte":[[18,"cost-of-a-byte"]],"Creating Empty Repositories":[[5,"creating-empty-repositories"]],"Creating RNodes":[[6,"creating-rnodes"]],"Creating Signed Releases":[[5,"creating-signed-releases"]],"Creating a Network With Reticulum":[[4,"creating-a-network-with-reticulum"]],"Creating and Using Custom Interfaces":[[4,"creating-and-using-custom-interfaces"]],"Creating and Using a Network Identity":[[15,"creating-and-using-a-network-identity"]],"Creator Permissions":[[5,"creator-permissions"]],"Cryptographic Attribution":[[5,"cryptographic-attribution"]],"Cryptographic Primitives":[[15,"cryptographic-primitives"]],"Cryptographic Stamps":[[11,"cryptographic-stamps"]],"Current Status":[[17,"current-status"]],"Current Usage":[[15,"current-usage"]],"Custom Interfaces":[[2,"custom-interfaces"],[8,"custom-interfaces"]],"Customizing Templates":[[5,"customizing-templates"]],"Dating":[[0,"dating"]],"Death To The Address":[[18,"death-to-the-address"]],"Debian Bookworm":[[4,"debian-bookworm"]],"Decentralization Or Uncentralizability?":[[18,"decentralization-or-uncentralizability"]],"Defence Of The Commons":[[0,"defence-of-the-commons"]],"Design Patterns For Post-IP Systems":[[18,"design-patterns-for-post-ip-systems"]],"Destination Naming":[[15,"destination-naming"]],"Destinations":[[15,"destinations"]],"Destinations, Not Addresses":[[10,"destinations-not-addresses"]],"Develop a Program with Reticulum":[[4,"develop-a-program-with-reticulum"]],"Device Flashers":[[13,"device-flashers"]],"Disclosed Assistance Or Laundered Generation":[[0,"disclosed-assistance-or-laundered-generation"]],"Discoverable Interfaces":[[8,"discoverable-interfaces"]],"Discovering Interfaces":[[16,"discovering-interfaces"]],"Discovery Parameters":[[8,"discovery-parameters"]],"Distributed Development":[[1,null]],"Distribution Without Intermediaries":[[1,"distribution-without-intermediaries"]],"Donations":[[14,"donations"]],"Echo"Line truncated
Search.setIndex({"alltitles":{"A Carrier-Grade Fallacy":[[18,"a-carrier-grade-fallacy"]],"A History Of What Works":[[0,"a-history-of-what-works"]],"A Persistent, But Fragile Triad":[[0,"a-persistent-but-fragile-triad"]],"API Reference":[[12,null]],"ARM64":[[4,"arm64"]],"AX.25 KISS Interface":[[8,"ax-25-kiss-interface"]],"Accessing Repository Pages":[[5,"accessing-repository-pages"]],"Addendum A: The Prns Case":[[0,"addendum-a-the-prns-case"]],"Adding Radio Interfaces":[[4,"adding-radio-interfaces"]],"Agency and answerability":[[0,"agency-and-answerability"]],"An Explanation of Reticulum for Human Beings":[[3,null]],"Anchor In The Flow":[[18,"anchor-in-the-flow"]],"Android":[[4,"android"]],"Announce":[[2,"announce"]],"Announce Propagation Rules":[[15,"announce-propagation-rules"]],"Announce Rate Control":[[8,"announce-rate-control"]],"Announcing Presence":[[18,"announcing-presence"]],"Artifact-Centered Workflows":[[1,"artifact-centered-workflows"]],"Assistance Versus Machine-Substitution":[[0,"assistance-versus-machine-substitution"]],"Author Identity Binding":[[5,"author-identity-binding"]],"Auto Interface":[[8,"auto-interface"]],"Automated Blocking":[[8,"automated-blocking"]],"Automated List Sourcing":[[16,"automated-list-sourcing"]],"Automatic Mirror Synchronization":[[5,"automatic-mirror-synchronization"]],"Backbone Interface":[[8,"backbone-interface"]],"Base Primitives":[[11,"base-primitives"]],"Blackhole Management":[[11,"blackhole-management"],[16,"blackhole-management"]],"Blocking Transport Nodes":[[11,"blocking-transport-nodes"]],"Bootstrapping Connectivity":[[4,"bootstrapping-connectivity"]],"Brandolini\u2019s Reference":[[0,null]],"Broadcast":[[2,"broadcast"]],"Browsing & Publishing":[[13,"browsing-publishing"]],"Buffer":[[2,"buffer"]],"Build Personal Infrastructure":[[4,"build-personal-infrastructure"]],"Building Networks":[[10,null]],"Channel":[[2,"channel"]],"Chat":[[13,"chat"]],"Code Examples":[[2,null]],"Columba":[[13,"id8"]],"Combining Hardware Types":[[6,"combining-hardware-types"]],"Command-Line Interaction":[[5,"command-line-interaction"]],"Commit Signing":[[5,"commit-signing"]],"Common Interface Options":[[8,"common-interface-options"]],"Communications Hardware":[[6,null]],"Composable Primitives":[[1,"composable-primitives"]],"Concepts & Overview":[[10,"concepts-overview"]],"Conceptual Overview":[[15,"conceptual-overview"]],"Conclusion":[[0,"conclusion"]],"Configuration":[[5,"configuration"],[5,"id1"]],"Configuration & Data":[[16,"configuration-data"]],"Configuration Example":[[5,"configuration-example"]],"Configuration Methods":[[5,"configuration-methods"]],"Configuring Interfaces":[[8,null]],"Configuring Stamps":[[11,"configuring-stamps"]],"Connect to the Distributed Backbone":[[4,"connect-to-the-distributed-backbone"]],"Connecting Remotes":[[8,"connecting-remotes"]],"Connecting Reticulum Instances Over the Internet":[[4,"connecting-reticulum-instances-over-the-internet"]],"Consequences":[[0,"consequences"]],"Contributing to the Global Ret":[[4,"contributing-to-the-global-ret"]],"Copyright & The Two Legal Layers":[[0,"copyright-the-two-legal-layers"]],"Cost Of A Byte":[[18,"cost-of-a-byte"]],"Creating Empty Repositories":[[5,"creating-empty-repositories"]],"Creating RNodes":[[6,"creating-rnodes"]],"Creating Signed Releases":[[5,"creating-signed-releases"]],"Creating a Network With Reticulum":[[4,"creating-a-network-with-reticulum"]],"Creating and Using Custom Interfaces":[[4,"creating-and-using-custom-interfaces"]],"Creating and Using a Network Identity":[[15,"creating-and-using-a-network-identity"]],"Creator Permissions":[[5,"creator-permissions"]],"Cryptographic Attribution":[[5,"cryptographic-attribution"]],"Cryptographic Primitives":[[15,"cryptographic-primitives"]],"Cryptographic Stamps":[[11,"cryptographic-stamps"]],"Current Status":[[17,"current-status"]],"Current Usage":[[15,"current-usage"]],"Custom Interfaces":[[2,"custom-interfaces"],[8,"custom-interfaces"]],"Customizing Templates":[[5,"customizing-templates"]],"Dating":[[0,"dating"]],"Death To The Address":[[18,"death-to-the-address"]],"Debian Bookworm":[[4,"debian-bookworm"]],"Decentralization Or Uncentralizability?":[[18,"decentralization-or-uncentralizability"]],"Defence Of The Commons":[[0,"defence-of-the-commons"]],"Design Patterns For Post-IP Systems":[[18,"design-patterns-for-post-ip-systems"]],"Destination Naming":[[15,"destination-naming"]],"Destinations":[[15,"destinations"]],"Destinations, Not Addresses":[[10,"destinations-not-addresses"]],"Develop a Program with Reticulum":[[4,"develop-a-program-with-reticulum"]],"Device Flashers":[[13,"device-flashers"]],"Disclosed Assistance Or Laundered Generation":[[0,"disclosed-assistance-or-laundered-generation"]],"Discoverable Interfaces":[[8,"discoverable-interfaces"]],"Discovering Interfaces":[[16,"discovering-interfaces"]],"Discovery Parameters":[[8,"discovery-parameters"]],"Distributed Development":[[1,null]],"Distribution Without Intermediaries":[[1,"distribution-wiLine truncated
+4 -4
View File
@@ -7,7 +7,7 @@
<link rel="prefetch" href="_static/rns_logo_512.png" as="image">
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 -->
<title>Programs Using Reticulum - Reticulum Network Stack 1.6.0 documentation</title>
<title>Programs Using Reticulum - Reticulum Network Stack 1.6.1 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/copybutton.css?v=76b2166b" />
@@ -180,7 +180,7 @@
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.0 documentation</div></a>
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.1 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
@@ -204,7 +204,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.0 documentation</span>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.1 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -595,7 +595,7 @@ when link throughput is counted in a few hundreds of bits per second.</p>
</aside>
</div>
</div><script src="_static/documentation_options.js?v=72d88caf"></script>
</div><script src="_static/documentation_options.js?v=d6a008b6"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script>
+4 -4
View File
@@ -7,7 +7,7 @@
<link rel="prefetch" href="_static/rns_logo_512.png" as="image">
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 -->
<title>Support Reticulum - Reticulum Network Stack 1.6.0 documentation</title>
<title>Support Reticulum - Reticulum Network Stack 1.6.1 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/copybutton.css?v=76b2166b" />
@@ -180,7 +180,7 @@
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.0 documentation</div></a>
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.1 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
@@ -204,7 +204,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.0 documentation</span>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.1 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="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>
</div>
</div><script src="_static/documentation_options.js?v=72d88caf"></script>
</div><script src="_static/documentation_options.js?v=d6a008b6"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script>
+4 -4
View File
@@ -7,7 +7,7 @@
<link rel="prefetch" href="_static/rns_logo_512.png" as="image">
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 -->
<title>Understanding Reticulum - Reticulum Network Stack 1.6.0 documentation</title>
<title>Understanding Reticulum - Reticulum Network Stack 1.6.1 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/copybutton.css?v=76b2166b" />
@@ -180,7 +180,7 @@
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.0 documentation</div></a>
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.1 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
@@ -204,7 +204,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.0 documentation</span>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.1 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -1121,7 +1121,7 @@ those risks are acceptable to you.</p>
</aside>
</div>
</div><script src="_static/documentation_options.js?v=72d88caf"></script>
</div><script src="_static/documentation_options.js?v=d6a008b6"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script>
+13 -4
View File
@@ -7,7 +7,7 @@
<link rel="prefetch" href="_static/rns_logo_512.png" as="image">
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 -->
<title>Using Reticulum on Your System - Reticulum Network Stack 1.6.0 documentation</title>
<title>Using Reticulum on Your System - Reticulum Network Stack 1.6.1 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/copybutton.css?v=76b2166b" />
@@ -180,7 +180,7 @@
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.0 documentation</div></a>
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.1 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
@@ -204,7 +204,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.0 documentation</span>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.1 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -1245,6 +1245,15 @@ section of this manual.</p>
<li><p>Maintain connectivity to RNS instances with unknown or changing IP addresses</p></li>
</ul>
<p>Discovered interfaces can be <strong>auto-connected</strong> by Reticulum, which makes it possible to create setups where an arbitrary interface can act simply as a bootstrap connection, that can be torn down again once more suitable interfaces have been discovered and connected.</p>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>While it might be tempting to configure Reticulum to auto-connect dozens of interfaces, this will not provide you with any benefit. It will also waste the limited resources of transport node operators. In almost all situations, using 2-3 auto-connected interfaces will be sufficient.</p>
<p><strong>Remember</strong>: A deeper, more branched topology is <em>much</em> more efficient than a completely flat fan-out, where everyone connects to everyone!</p>
<p>For <strong>devices that connect directly</strong> to the distributed backbone, such as phones and other mobile devices, use one or two auto-connects - or a fixed node you that you like, and an auto-connect as redundant backup.</p>
<p>For a transport <strong>node in your home</strong>, serving all devices within it, 2 or 3 autoconnects will be reasonable.</p>
<p>For a <strong>fast boundary node</strong> that sits between a large, internal network with hundreds of active destinations, you can consider using five to six auto-connects. The same is a sensible number for general-purpose transport-providing backbone nodes on the public internet.</p>
<p>In extreme cases, you <em>can</em> consider using up to 12 auto-connected interfaces. Almost nobody will need this, but there are edge cases where it could potentially be useful. Do not auto-connect that wide unless you are prepared and capable of processing some serious traffic.</p>
</div>
<p>The interface discovery mechanism uses announces sent over Reticulum itself, and supports both publicly readable interfaces and private, encrypted discovery, that can only be decoded by specified <em>network identities</em>. It is also possible to specify which network identities should be considered valid sources for discovered interfaces, so that interfaces published by unknown entities are ignored.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
@@ -1656,7 +1665,7 @@ systemctl --user enable rnsd.service
</aside>
</div>
</div><script src="_static/documentation_options.js?v=72d88caf"></script>
</div><script src="_static/documentation_options.js?v=d6a008b6"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script>
+4 -4
View File
@@ -7,7 +7,7 @@
<link rel="prefetch" href="_static/rns_logo_512.png" as="image">
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 -->
<title>What is Reticulum? - Reticulum Network Stack 1.6.0 documentation</title>
<title>What is Reticulum? - Reticulum Network Stack 1.6.1 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/copybutton.css?v=76b2166b" />
@@ -180,7 +180,7 @@
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.0 documentation</div></a>
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.1 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
@@ -204,7 +204,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.0 documentation</span>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.1 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -507,7 +507,7 @@ network, and vice versa.</p>
</aside>
</div>
</div><script src="_static/documentation_options.js?v=72d88caf"></script>
</div><script src="_static/documentation_options.js?v=d6a008b6"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script>
+4 -4
View File
@@ -7,7 +7,7 @@
<link rel="prefetch" href="_static/rns_logo_512.png" as="image">
<!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25.dev1 -->
<title>Zen of Reticulum - Reticulum Network Stack 1.6.0 documentation</title>
<title>Zen of Reticulum - Reticulum Network Stack 1.6.1 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/copybutton.css?v=76b2166b" />
@@ -180,7 +180,7 @@
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.0 documentation</div></a>
<a href="index.html"><div class="brand">Reticulum Network Stack 1.6.1 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
@@ -204,7 +204,7 @@
<img class="sidebar-logo" src="_static/rns_logo_512.png" alt="Logo"/>
</div>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.0 documentation</span>
<span class="sidebar-brand-text">Reticulum Network Stack 1.6.1 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -679,7 +679,7 @@ Imagine a messaging app. You write it once. It works on a laptop connected to fi
</aside>
</div>
</div><script src="_static/documentation_options.js?v=72d88caf"></script>
</div><script src="_static/documentation_options.js?v=d6a008b6"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=46bd48cc"></script>
+16 -3
View File
@@ -566,7 +566,7 @@ To enable the page node, add the following to your `~/.rngit/config` file:
```text
[pages]
serve_nomadnet = yes
serve_nomadnet = yes
```
When the page node is enabled, `rngit` will listen on a Nomad Network node destination in addition to the Git repository destination. You can view the destination hash by running:
@@ -580,6 +580,15 @@ Repositories Destination : <0d7334d411d00120cbad24edf355fdd2>
Nomad Network Destination : <50824b711717f97c2fb1166ceddd5ea9>
```
You can configure the destination stamp value and required link establishment cost with the following options:
```text
[pages]
serve_nomadnet = yes
stamp_value = 25.0
link_cost = 18.0
```
### Accessing Repository Pages
Once the page node is running, you can access it from any Nomad Network client by connecting to the Nomad Network destination. The page node provides the following views:
@@ -659,8 +668,8 @@ By default, the page node uses Nerd Font icons. If you prefer simpler icons or y
```text
[pages]
serve_nomadnet = yes
unicode_icons = yes
serve_nomadnet = yes
unicode_icons = yes
```
### Repository Statistics
@@ -686,6 +695,8 @@ A complete node configuration might look like this:
node_name = My Git Node
announce_interval = 360
record_stats = yes
stamp_value = 27.5
link_cost = 18.5
[repositories]
public = /var/git/public
@@ -698,6 +709,8 @@ A complete node configuration might look like this:
[pages]
serve_nomadnet = yes
unicode_icons = no
stamp_value = 27.5
link_cost = 18.7
```
## Verified Releases
+1
View File
@@ -137,6 +137,7 @@ to participate in the development of Reticulum itself.
* [Configuring Stamps](protecting.md#configuring-stamps)
* [Filtering & QoS](protecting.md#filtering-qos)
* [Instance Configuration](protecting.md#id1)
* [Blocking Transport Nodes](protecting.md#blocking-transport-nodes)
* [For Developers](protecting.md#id2)
* [Ingress & Burst Control](protecting.md#ingress-burst-control)
* [Blackhole Management](protecting.md#blackhole-management)
+6 -6
View File
@@ -1398,11 +1398,11 @@ but all the parameters are exposed for configuration if needed.
> sub-interfaces when a new client connects.
>
> * 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.0`
> announces per second.
>
> * The `ic_burst_freq` option sets the maximum announce ingress
> frequency for other interfaces. Defaults to `12` announces
> frequency for other interfaces. Defaults to `10.0` announces
> per second.
>
> > *If an interface exceeds its burst frequency, incoming announces
@@ -1410,21 +1410,21 @@ but all the parameters are exposed for configuration if needed.
> > not processed until later.*
> * The `ic_max_held_announces` option sets the maximum amount of
> 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 `64` announces.
>
> * The `ic_burst_hold` option sets how much time (in seconds) must
> 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 `15`
> seconds.
>
> * The `ic_burst_penalty` option sets how much time (in seconds) must
> 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 `15`
> seconds.
>
> * The `ic_held_release_interval` option sets how much time (in seconds)
> must pass between releasing each held announce from the queue. Defaults
> to `30` seconds.
> to `5` seconds.
>
All of the above settings can be configured both as instance-wide defaults
+45 -8
View File
@@ -60,7 +60,7 @@ The base primitives are used to implement scenario-specific network-level primit
> * **Path Request Stamps** are also detached stamps, but generated *individually* for every path request emitted on the network. These will typically have a much lower cost requirement than destination stamps, but if a node is overwhelmed by path requests, it can be tuned higher.
> The stamp is generated against the individually unique *emission*, so that unstamped or low-value path requests for a destination cannot disrupt the resolution of legitimate ones toward that same destination.
> * **Link Request Stamps** embedded stamps, carried in the ephemeral link request keyset. They are therefore completely transparent to the network, but can still be verified extremely quickly by any node along the link request path, who can then make a decision on whether or not to transport it.
> * **Link Request Stamps** are embedded stamps, carried in the ephemeral link request keyset. They are therefore completely transparent to the network, but can still be verified extremely quickly by any node along the link request path, who can then make a decision on whether or not to transport it.
> Link request cost targets are set by the *endpoint destinations individually*. Every destination that includes a stamp in its announces will also include link request cost signalling. This means that any node that hears an announce from the destination will also know what link request stamp value to target, when establishing links to that destination.
@@ -232,15 +232,17 @@ The filtering subsystem can operate in two modes:
> In addition, any application using the shared instance can temporarily request required destination types for its use. Applications that request required destination types will automatically have them granted, unless they are included in the `ignored_types` list.
>
The filtering defaults and base settings are configured in the `[filter]` section of the configuration file. For example, it is possible to explicitly ignore a series of destination types, while also limiting hop reach to a more local topology:
The filtering defaults and base settings are configured in the `[filter]` section of the configuration file. For example, it is possible to explicitly ignore a series of destination types, while also limiting hop reach to a more local topology.
If you do not know the human readable destination type aspects for a destination type you want to ignore, you can also add entries as 10-byte (20 hexadecimal character) hashes using the `<c4ace368262d845c9dd3>` format.
```ini
[filter]
hop_limiter = 14
ignored_types = application.that.spams, traffic.heavy.service
ignored_types = application.that.spams, traffic.heavy.service, <c4ace368262d845c9dd3>
```
In some situations, you may want to allow *only* certain destination types. If, for example, you are creating a high-performance transport node intended to handle thousands of simultaneous voice calls at minimal latency, you
In some situations, you may want to allow *only* certain destination types. If, for example, you are creating a high-performance transport node intended to handle thousands of simultaneous voice calls at minimal latency, a configuration might look something like:
```ini
[filter]
@@ -248,7 +250,7 @@ In some situations, you may want to allow *only* certain destination types. If,
allowed_types = lxst.telephony
```
The filtering subsystem provided in RNS 1.6.0 is functional and useful, but at an early stage, and relatively basic. In the upcoming releases, it will be expanded into a much more comprehensive and flexible system, that will include custom QoS and traffic class tagging, advanced rule definitions and more.
The filtering subsystem provided in RNS `1.6.0` is functional and useful, but at an early stage, and relatively basic. In the upcoming releases, it will be expanded into a much more comprehensive and flexible system, that will include custom QoS and traffic class tagging, advanced rule definitions and more.
#### IMPORTANT
As the filtering and QoS system is developed and matures, the `required_only` mode will become the default operating mode for non-transport instances, since applications can already now dynamically request what destination types they are interested in.
@@ -257,11 +259,46 @@ This ensures that a local, non-transport node (running on resource-limited hardw
If you are a developer, see the following section.
### Blocking Transport Nodes
Misbehaving, spamming and broken transport nodes can be completely blocked using the Blackhole system. First, obtain the Transport Identity hash of a misbehaving transport node, using `rnstatus`:
```txt
$ rnstatus -FATa "71.29.190.5"
BackboneInterface[Client on Bern IPv4/71.29.190.5:37062]
Status : Up
Mode : Gateway
Rate : 250.00 Mbps, MTU 65536
Running : Unknown implementation
Rem.Tr.ID : <a0c289d131c7bfa8d5ddc8b652c0f40d>
Held : 64 announces
Violatns. : 382 protocol
Flt. Hits : 92
Announces : 147174↓ 11193↑ total, 140554 filtered
1.2 Hz↑ (↓0% / ↑0% of flow)
7.8 Hz↓ (t:6h/p:0s/g:1) burst for 4h, 54m and 42.69s
Traffic : ↑4.75 MB 0 bps
↓1.50 MB 0 bps
Filtered : ↑0 B 0 bps
↓55.43 MB 380.14 Kbps
```
You can then block it by its Transport ID:
```txt
$ rnpath -B a0c289d131c7bfa8d5ddc8b652c0f40d --reason "Broken node"
Blackholed identity a0c289d131c7bfa8d5ddc8b652c0f40d
```
Its connection will be immediately torn down, and further reconnection attempts will be ignored.
### For Developers
At some point during the `1.6.x` release cycle, RNS will move to using the `required_only` mode for *non-transport* instances by default. This means that applications will, in most cases, have to request what types of destinations they are interested in receiving announces from.
If your application is using only using the utility primitives included in RNS, or established protocols such as LXMF or LXST, **there is nothing you have to do**. The protocol primitives *themselves* request their required destination types, and this is the general pattern to follow here:
If your application is only using the utility primitives included in RNS, or established protocols such as LXMF or LXST, **there is nothing you have to do**. The protocol primitives *themselves* request their required destination types, and this is the general pattern to follow here:
- If an application uses a common protocol or primitive, it is the importable primitive, protocol module, or relevant internal functionality that should request destination type requirements, at the point where they are actually needed.
- Higher level application layers should not have to guess at or request destination types, unless it explicitly creates outbound destinations that are not covered by any already-used protocols or primitives.
@@ -278,7 +315,7 @@ You do not *have to* explicitly deregister destination type requirements. Reticu
RNS.Reticulum.get_instance().unwants_destination_type("my_app.service")
```
That’s really all there is to it. If you already now want to make you application more CPU, memory and battery efficient, you can tell Reticulum to start serving only required destinations to it with only one line of additional code. A full setup of this functionality might look something like:
That’s really all there is to it. If you already now want to make you application more CPU, memory and battery efficient, you can tell Reticulum to start serving only required destinations to it with only a few lines of additional code. A full setup of this functionality might look something like:
```python
for destination_type in self.REQUIRED_DESTINATION_TYPES:
@@ -295,7 +332,7 @@ In addition to the economic incentives created by stamps, Reticulum enforces a s
At the most basic level, the `announce_cap` mechanism limits the bandwidth any interface will allocate to propagating announces and other network upkeep traffic, and prioritises the local topology. Destinations that rapidly re-announce are down-prioritised in the transmission queue, so attempting to gain reach through announce spam has the exact *opposite* effect.
On top of this, per-destination announce rate control can be configured on any interface, or as instance-wide defaults. Once configured, announces *received* for any one destination will only be re-broadcast to other interfaces at the configured target rate, no matter how often they are received. A grace period allows occasional rate violations, and a configurable penalty extends the interval between propagated announces for destinations that repeatedly exceed their target.
On top of this, per-destination announce rate control can be configured on any interface, or as instance-wide defaults. Once configured, announces *received* for any one destination will only be re-broadcast to other interfaces at the configured target rate, no matter how often they are received. The grace option allows occasional rate violations, and a configurable penalty extends the interval between propagated announces for destinations that repeatedly exceed their target.
The final layer protects against bursts of announces for *newly created* destinations. If an interface receives a large influx of announces for previously unknown destinations in a short amount of time, these are held in a bounded queue, while announces for known and established destinations continue to be processed without interruption. After the burst subsides, and an additional waiting period has passed, held announces are released slowly until the queue is cleared.
+4
View File
@@ -77,6 +77,10 @@ The default per-hop timeout value used in various timeout calculations.
Returns the currently running Reticulum instance.
#### `static get_instance_pid()`
Returns the main process ID of the currently running Reticulum instance.
#### `get_first_hop_timeout(destination)`
Returns a best-effort estimate of a reasonable minimum
+13
View File
@@ -1104,6 +1104,19 @@ Reticulum includes built-in functionality for discovering connectable interfaces
Discovered interfaces can be **auto-connected** by Reticulum, which makes it possible to create setups where an arbitrary interface can act simply as a bootstrap connection, that can be torn down again once more suitable interfaces have been discovered and connected.
#### IMPORTANT
While it might be tempting to configure Reticulum to auto-connect dozens of interfaces, this will not provide you with any benefit. It will also waste the limited resources of transport node operators. In almost all situations, using 2-3 auto-connected interfaces will be sufficient.
**Remember**: A deeper, more branched topology is *much* more efficient than a completely flat fan-out, where everyone connects to everyone!
For **devices that connect directly** to the distributed backbone, such as phones and other mobile devices, use one or two auto-connects - or a fixed node you that you like, and an auto-connect as redundant backup.
For a transport **node in your home**, serving all devices within it, 2 or 3 autoconnects will be reasonable.
For a **fast boundary node** that sits between a large, internal network with hundreds of active destinations, you can consider using five to six auto-connects. The same is a sensible number for general-purpose transport-providing backbone nodes on the public internet.
In extreme cases, you *can* consider using up to 12 auto-connected interfaces. Almost nobody will need this, but there are edge cases where it could potentially be useful. Do not auto-connect that wide unless you are prepared and capable of processing some serious traffic.
The interface discovery mechanism uses announces sent over Reticulum itself, and supports both publicly readable interfaces and private, encrypted discovery, that can only be decoded by specified *network identities*. It is also possible to specify which network identities should be considered valid sources for discovered interfaces, so that interfaces published by unknown entities are ignored.
#### NOTE
@@ -0,0 +1,91 @@
# Media Conversion in rngit and nomadnet
## Short Overview
A security vulnerability has been discovered in operating-system provided or user-installed libraries that RNS *could* potentially use as external backends for media conversion.
Anyone hosting nodes with `rngit`, `nomadnet` and potentially other programs that *serve* or *convert* untrusted media files using the RNS API-provided `convert_to_webp` and `convert_file_to_webp` media conversion functionality, should upgrade to the latest release update of RNS 1.6.1, **right now**.
The initial discovery information and general shape of the potential exploit was provided to me by Hunter from [Ratspeak](https://ratspeak.org), at `2026-11-19 01:30 CEST`, and when I saw the mail around `02:00`, I started investigating the issue.
The release files were updated on `2026-11-19 18:55 CEST`, and replaced the files uploaded yesterday.
## Where is the vulnerability located?
**This is not a vulnerability in RNS itself**, but in external libraries that RNS can *potentially* invoke while converting media files for serving to `nomadnet` clients. The vulnerabilities therefore become exploitable through services such as `rngit` and `nomadnet`. Whether RNS invokes the specific, vulnerable libraries depends on what is installed on your system.
Even if your system uses the affected software, not all version are equally vulnerable, **but do not count on your system being unaffected**. The attack surface is complex here, and there is not one single set of versions you can check to ensure your system is patched. The only way currently to protect against this, is to update RNS to a version that actively mitigates the vulnerability. See below for more details.
Additionally, I'd recommend updating your packages and OS fully if you run any kind of software that serves or converts media files that could come from external sources. This affects libraries that are used in a very large amount of packages that serve media files in web-applications, for example.
However, updating the affected packages is **not universally sufficient**. As of this writing, the latest versions are still vulnerable in several distros, which is why I have decided to hot-patch the RNS 1.6.1 release with a full mitigation, that blocks any potential invocation of the vulnerable paths.
## What is exploitable?
On affected systems, it is possible to obtain arbitrary read access to any file that the process-owning user can read, and potentially exfiltrate that data from the system.
## Who is affected?
Anyone running a service with public read access to media files, *if those media files can be supplied from external sources*. That could, for example, be via a `git push` or file uploads.
If an attacker can upload a malicious file to your system, and later display that file, it can lead to arbitrary data exfiltration.
No networking or core functionality, including the standard utilities and command line tools, are affected, and this vulnerability has no interaction with the networking, transport or cryptography parts of RNS.
If you do not run some kind of service that serves media files while also accepting untrusted uploads, you are not affected. **But**, I would still recommend updating anyway, in case you forget about this, and later decide to host exactly such a service.
## How is it mitigated?
Update RNS to the *latest* upload of RNS 1.6.1:
```sh
# Using pip
pip uninstall rns -y
pip install rns -U --no-cache-dir
```
If updating using `pip`, ensure that the downloaded file is exactly `rns-1.6.1-0-py3-none-any.whl` (note the `-0` in the filename).
```sh
# Using rngit
rngit release rns://7649a50d84610232d1416b41d2896aff/reticulum/reticulum fetch "latest:rns-*.whl"
pip uninstall rns -y
pip install ./rns-1.6.1-py3-none-any.whl
```
Once this update has been installed, the exploitable code paths will be unreachable from RNS applications. Remember to restart any applications that use RNS.
**Very important!** This *only* fixes the exploit path for RNS-based applications. Any other program on your system that uses the vulnerable libraries will still be exploitable.
## How can I determine if my system was exploitable?
It can be relatively easy to determine that your system was *not* affected, but unfortunately, it can also be relatively difficult to determine if it potentially *was*. Please see the following section.
## Some more technical information
Due to the severity of the vulnerability, and how relatively easy it is to exploit it if the system is vulnerable, I will not provide a full description of the exploit path, or any proof-of-concept code. First of all, this is a relatively complex issue, and it has several different exploitable paths, that can lead to different levels of information disclosure from the system.
I was initially made aware of this around 2AM this night, and spent until about 4.15AM investigating the extent to which Reticulum users could potentially be affected. At that point, I had to actually get some sleep, and then spent the entire day today on it as well. It has taken me approximately 10 hours to map the surface of the issue, and unfortunately, the conclusion here is, that there is no clear-cut version number or similar where the package could be considered patched.
The affected software library is the popular `ImageMagick` module, used in basically everything that handles image conversions or processing, for all kinds of applications.
The easy version: **If you do not have `ImageMagick` installed on your system, it has not been vulnerable**
If you do have `ImageMagick` installed, and it was used as the media conversion backend for anything, here is the complicated version:
Whether or not a particular installation of the software is exploitable will be a result of interactions between:
- The installed version of the software itself
- The exact build configuration that was used to compile the distributed binaries
- The particular rendering libraries that the binary was linked and compiled against, and the versions of these
- The configuration and policies shipped as default in the package the software was installed from
- Any potential system or user-side modifications to the above
- Potential other software that was installed on the system, which `ImageMagick` can dynamically call at run-time
As you can see, the amount of combinations here have now exploded, and it is impossible to say whether or not your particular installation is vulnerable. The short version here is, that in many different combinations, `ImageMagick` can be exploited to read arbitrary data and incorporate it into output images. The extent of this, what can be done, what can be read, et cetera, varies wildly with exact situation on a given system.
Several distributions already have patched and updated packages, that block the most severe forms. For example, Debian and Arch provide patched binaries, Ubuntu does not. **But** even on the patched versions, in many cases, I was able to find new exploit paths **that are not yet patched**. I could not find any combination of latest versions and operating systems, where there was not *some* form of exploitable path available in the default, as-installed configuration. Additionally, there are some paths that no amount of settings or policy tweaking can protect against.
Therefore, it is **not** safe to assume that your distribution has been patched and is secure. As I investigated this, it turned out to be a real Pandora's box of hornet nests, and that it is not likely to be reliably patched in any reasonably soonish OS/package update.
The only reasonable way I could find to reliably deal with this, was to ensure that all potential media conversions handled by this particular software can never reach the problematic code paths.
+5 -1
View File
@@ -163,7 +163,11 @@ A global, distributed backbone of Reticulum Transport Nodes is being run by volu
As a good starting point, you can find interface definitions for connecting your own networks to this backbone on websites such as `directory.rns.recipes <https://directory.rns.recipes/>`_ and `rmap.world <https://rmap.world/>`_.
.. tip::
Don't rely on just a single connection to the distributed backbone for everyday use. It is much better to have several redundant connections configured, and enable the interface discovery options, so your nodes can continously discover peering opportunities as the network evolves. Refer to the :ref:`Bootstrapping Connectivity<bootstrapping-connectivity>` section to understand the options.
Don't rely on just a single connection to the distributed backbone for everyday use. It is much better to have several redundant connections configured, and enable the interface discovery options, so your nodes can continously discover peering opportunities as the network evolves.
But don't overdo it either! Auto-connecting to a hundred different nodes will waste capacity for node operators and not provide any benefit for yourself either.
Refer to the :ref:`Discovering Interfaces<using-interface_discovery>` section to understand the options.
+16 -3
View File
@@ -621,7 +621,7 @@ To enable the page node, add the following to your ``~/.rngit/config`` file:
.. code:: text
[pages]
serve_nomadnet = yes
serve_nomadnet = yes
When the page node is enabled, ``rngit`` will listen on a Nomad Network node destination in addition to the Git repository destination. You can view the destination hash by running:
@@ -634,6 +634,15 @@ When the page node is enabled, ``rngit`` will listen on a Nomad Network node des
Repositories Destination : <0d7334d411d00120cbad24edf355fdd2>
Nomad Network Destination : <50824b711717f97c2fb1166ceddd5ea9>
You can configure the destination stamp value and required link establishment cost with the following options:
.. code:: text
[pages]
serve_nomadnet = yes
stamp_value = 25.0
link_cost = 18.0
Accessing Repository Pages
--------------------------
@@ -717,8 +726,8 @@ By default, the page node uses Nerd Font icons. If you prefer simpler icons or y
.. code:: text
[pages]
serve_nomadnet = yes
unicode_icons = yes
serve_nomadnet = yes
unicode_icons = yes
Repository Statistics
---------------------
@@ -746,6 +755,8 @@ A complete node configuration might look like this:
node_name = My Git Node
announce_interval = 360
record_stats = yes
stamp_value = 27.5
link_cost = 18.5
[repositories]
public = /var/git/public
@@ -758,6 +769,8 @@ A complete node configuration might look like this:
[pages]
serve_nomadnet = yes
unicode_icons = no
stamp_value = 27.5
link_cost = 18.7
Verified Releases
+6 -6
View File
@@ -1481,11 +1481,11 @@ but all the parameters are exposed for configuration if needed.
sub-interfaces when a new client connects.
* | 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.0``
announces per second.
* | The ``ic_burst_freq`` option sets the maximum announce ingress
frequency for other interfaces. Defaults to ``12`` announces
frequency for other interfaces. Defaults to ``10.0`` announces
per second.
*If an interface exceeds its burst frequency, incoming announces
@@ -1494,21 +1494,21 @@ but all the parameters are exposed for configuration if needed.
* | The ``ic_max_held_announces`` option sets the maximum amount of
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 ``64`` announces.
* | The ``ic_burst_hold`` option sets how much time (in seconds) must
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 ``15``
seconds.
* | The ``ic_burst_penalty`` option sets how much time (in seconds) must
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 ``15``
seconds.
* | The ``ic_held_release_interval`` option sets how much time (in seconds)
must pass between releasing each held announce from the queue. Defaults
to ``30`` seconds.
to ``5`` seconds.
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-
+50 -8
View File
@@ -71,7 +71,7 @@ The base primitives are used to implement scenario-specific network-level primit
The stamp is generated against the individually unique *emission*, so that unstamped or low-value path requests for a destination cannot disrupt the resolution of legitimate ones toward that same destination.
* **Link Request Stamps** embedded stamps, carried in the ephemeral link request keyset. They are therefore completely transparent to the network, but can still be verified extremely quickly by any node along the link request path, who can then make a decision on whether or not to transport it.
* **Link Request Stamps** are embedded stamps, carried in the ephemeral link request keyset. They are therefore completely transparent to the network, but can still be verified extremely quickly by any node along the link request path, who can then make a decision on whether or not to transport it.
Link request cost targets are set by the *endpoint destinations individually*. Every destination that includes a stamp in its announces will also include link request cost signalling. This means that any node that hears an announce from the destination will also know what link request stamp value to target, when establishing links to that destination.
@@ -254,15 +254,20 @@ The filtering subsystem can operate in two modes:
| In addition, any application using the shared instance can temporarily request required destination types for its use. Applications that request required destination types will automatically have them granted, unless they are included in the ``ignored_types`` list.
The filtering defaults and base settings are configured in the ``[filter]`` section of the configuration file. For example, it is possible to explicitly ignore a series of destination types, while also limiting hop reach to a more local topology:
The filtering defaults and base settings are configured in the ``[filter]`` section of the configuration file. For example, it is possible to explicitly ignore a series of destination types, while also limiting hop reach to a more local topology.
.. tip::
The ``hop_limiter`` in the filter section is an instance-wide setting. You can also use the ``hop_limiter`` option *per-interface* if you want to limit hops on some interfaces only.
If you do not know the human readable destination type aspects for a destination type you want to ignore, you can also add entries as 10-byte (20 hexadecimal character) hashes using the ``<c4ace368262d845c9dd3>`` format.
.. code:: ini
[filter]
hop_limiter = 14
ignored_types = application.that.spams, traffic.heavy.service
ignored_types = application.that.spams, traffic.heavy.service, <c4ace368262d845c9dd3>
In some situations, you may want to allow *only* certain destination types. If, for example, you are creating a high-performance transport node intended to handle thousands of simultaneous voice calls at minimal latency, you
In some situations, you may want to allow *only* certain destination types. If, for example, you are creating a high-performance transport node intended to handle thousands of simultaneous voice calls at minimal latency, a configuration might look something like:
.. code:: ini
@@ -270,7 +275,7 @@ In some situations, you may want to allow *only* certain destination types. If,
required_only = yes
allowed_types = lxst.telephony
The filtering subsystem provided in RNS `1.6.0` is functional and useful, but at an early stage, and relatively basic. In the upcoming releases, it will be expanded into a much more comprehensive and flexible system, that will include custom QoS and traffic class tagging, advanced rule definitions and more.
The filtering subsystem provided in RNS ``1.6.0`` is functional and useful, but at an early stage, and relatively basic. In the upcoming releases, it will be expanded into a much more comprehensive and flexible system, that will include custom QoS and traffic class tagging, advanced rule definitions and more.
.. important::
As the filtering and QoS system is developed and matures, the ``required_only`` mode will become the default operating mode for non-transport instances, since applications can already now dynamically request what destination types they are interested in.
@@ -279,12 +284,48 @@ The filtering subsystem provided in RNS `1.6.0` is functional and useful, but at
If you are a developer, see the following section.
Blocking Transport Nodes
------------------------
Misbehaving, spamming and broken transport nodes can be completely blocked using the :ref:`Blackhole system<protecting-blackhole>`. First, obtain the Transport Identity hash of a misbehaving transport node, using ``rnstatus``:
.. code:: txt
$ rnstatus -FATa "71.29.190.5"
BackboneInterface[Client on Bern IPv4/71.29.190.5:37062]
Status : Up
Mode : Gateway
Rate : 250.00 Mbps, MTU 65536
Running : Unknown implementation
Rem.Tr.ID : <a0c289d131c7bfa8d5ddc8b652c0f40d>
Held : 64 announces
Violatns. : 382 protocol
Flt. Hits : 92
Announces : 147174↓ 11193↑ total, 140554 filtered
1.2 Hz↑ (↓0% / ↑0% of flow)
7.8 Hz↓ (t:6h/p:0s/g:1) burst for 4h, 54m and 42.69s
Traffic : ↑4.75 MB 0 bps
↓1.50 MB 0 bps
Filtered : ↑0 B 0 bps
↓55.43 MB 380.14 Kbps
You can then block it by its Transport ID:
.. code:: txt
$ rnpath -B a0c289d131c7bfa8d5ddc8b652c0f40d --reason "Broken node"
Blackholed identity a0c289d131c7bfa8d5ddc8b652c0f40d
Its connection will be immediately torn down, and further reconnection attempts will be ignored.
For Developers
--------------
At some point during the ``1.6.x`` release cycle, RNS will move to using the ``required_only`` mode for *non-transport* instances by default. This means that applications will, in most cases, have to request what types of destinations they are interested in receiving announces from.
If your application is using only using the utility primitives included in RNS, or established protocols such as LXMF or LXST, **there is nothing you have to do**. The protocol primitives *themselves* request their required destination types, and this is the general pattern to follow here:
If your application is only using the utility primitives included in RNS, or established protocols such as LXMF or LXST, **there is nothing you have to do**. The protocol primitives *themselves* request their required destination types, and this is the general pattern to follow here:
- If an application uses a common protocol or primitive, it is the importable primitive, protocol module, or relevant internal functionality that should request destination type requirements, at the point where they are actually needed.
- Higher level application layers should not have to guess at or request destination types, unless it explicitly creates outbound destinations that are not covered by any already-used protocols or primitives.
@@ -301,7 +342,7 @@ You do not *have to* explicitly deregister destination type requirements. Reticu
RNS.Reticulum.get_instance().unwants_destination_type("my_app.service")
That's really all there is to it. If you already now want to make you application more CPU, memory and battery efficient, you can tell Reticulum to start serving only required destinations to it with only one line of additional code. A full setup of this functionality might look something like:
That's really all there is to it. If you already now want to make you application more CPU, memory and battery efficient, you can tell Reticulum to start serving only required destinations to it with only a few lines of additional code. A full setup of this functionality might look something like:
.. code:: python
@@ -320,7 +361,7 @@ In addition to the economic incentives created by stamps, Reticulum enforces a s
At the most basic level, the ``announce_cap`` mechanism limits the bandwidth any interface will allocate to propagating announces and other network upkeep traffic, and prioritises the local topology. Destinations that rapidly re-announce are down-prioritised in the transmission queue, so attempting to gain reach through announce spam has the exact *opposite* effect.
On top of this, per-destination announce rate control can be configured on any interface, or as instance-wide defaults. Once configured, announces *received* for any one destination will only be re-broadcast to other interfaces at the configured target rate, no matter how often they are received. A grace period allows occasional rate violations, and a configurable penalty extends the interval between propagated announces for destinations that repeatedly exceed their target.
On top of this, per-destination announce rate control can be configured on any interface, or as instance-wide defaults. Once configured, announces *received* for any one destination will only be re-broadcast to other interfaces at the configured target rate, no matter how often they are received. The grace option allows occasional rate violations, and a configurable penalty extends the interval between propagated announces for destinations that repeatedly exceed their target.
The final layer protects against bursts of announces for *newly created* destinations. If an interface receives a large influx of announces for previously unknown destinations in a short amount of time, these are held in a bounded queue, while announces for known and established destinations continue to be processed without interruption. After the burst subsides, and an additional waiting period has passed, held announces are released slowly until the queue is cleared.
@@ -332,6 +373,7 @@ Rate limiting bounds the *rate* at which abuse can occur, for everyone, while st
Full configuration details are available in the :ref:`Announce Rate Control<interfaces-announcerates>` and :ref:`New Destination Rate Limiting<interfaces-ingress-control>` sections.
.. _protecting-blachole:
Blackhole Management
====================
+13
View File
@@ -1147,6 +1147,19 @@ Reticulum includes built-in functionality for discovering connectable interfaces
Discovered interfaces can be **auto-connected** by Reticulum, which makes it possible to create setups where an arbitrary interface can act simply as a bootstrap connection, that can be torn down again once more suitable interfaces have been discovered and connected.
.. important::
While it might be tempting to configure Reticulum to auto-connect dozens of interfaces, this will not provide you with any benefit. It will also waste the limited resources of transport node operators. In almost all situations, using 2-3 auto-connected interfaces will be sufficient.
**Remember**: A deeper, more branched topology is *much* more efficient than a completely flat fan-out, where everyone connects to everyone!
For **devices that connect directly** to the distributed backbone, such as phones and other mobile devices, use one or two auto-connects - or a fixed node you that you like, and an auto-connect as redundant backup.
For a transport **node in your home**, serving all devices within it, 2 or 3 autoconnects will be reasonable.
For a **fast boundary node** that sits between a large, internal network with hundreds of active destinations, you can consider using five to six auto-connects. The same is a sensible number for general-purpose transport-providing backbone nodes on the public internet.
In extreme cases, you *can* consider using up to 12 auto-connected interfaces. Almost nobody will need this, but there are edge cases where it could potentially be useful. Do not auto-connect that wide unless you are prepared and capable of processing some serious traffic.
The interface discovery mechanism uses announces sent over Reticulum itself, and supports both publicly readable interfaces and private, encrypted discovery, that can only be decoded by specified *network identities*. It is also possible to specify which network identities should be considered valid sources for discovered interfaces, so that interfaces published by unknown entities are ignored.
.. note::
+18 -11
View File
@@ -30,6 +30,7 @@ BUFFER_TEST_TARGET = 256000
BUFFER_TEST_TARGET_SLOW = 1800
SLOW_TEST_MARKER = b"@SLOW_TEST_MARKER"
LINK_UP_WAIT = 0.050
LINK_TIMEOUT = 1.000
def targets_job(caller):
cmd = "python -c \"from tests.link import targets; targets()\""
@@ -61,6 +62,12 @@ def close_rns():
if c_rns != None:
c_rns.m_proc.kill()
def await_link(link, timeout):
deadline = time.time()+timeout
time.sleep(LINK_UP_WAIT)
while link.status < RNS.Link.ACTIVE and time.time() < deadline:
time.sleep(LINK_UP_WAIT)
class TestLink(unittest.TestCase):
def setUp(self):
pass
@@ -115,7 +122,7 @@ class TestLink(unittest.TestCase):
print("Testing default mode link establishment...")
l1 = RNS.Link(dest)
time.sleep(LINK_UP_WAIT)
await_link(l1, LINK_TIMEOUT)
self.assertEqual(l1.status, RNS.Link.ACTIVE)
l1.teardown()
@@ -130,7 +137,7 @@ class TestLink(unittest.TestCase):
print("Testing AES_256_CBC mode link establishment...")
l3 = RNS.Link(dest, mode=RNS.Link.MODE_AES256_CBC)
time.sleep(LINK_UP_WAIT)
await_link(l3, LINK_TIMEOUT)
self.assertEqual(l3.status, RNS.Link.ACTIVE)
self.assertEqual(l3.mode, RNS.Link.MODE_AES256_CBC)
self.assertEqual(len(l3.derived_key), 64)
@@ -157,7 +164,7 @@ class TestLink(unittest.TestCase):
self.assertEqual(dest.hash, bytes.fromhex("fb48da0e82e6e01ba0c014513f74540d"))
l1 = RNS.Link(dest)
time.sleep(LINK_UP_WAIT)
await_link(l1, LINK_TIMEOUT)
self.assertEqual(l1.status, RNS.Link.ACTIVE)
b = 0
@@ -230,7 +237,7 @@ class TestLink(unittest.TestCase):
self.assertEqual(dest.hash, bytes.fromhex("fb48da0e82e6e01ba0c014513f74540d"))
l1 = RNS.Link(dest, mode=RNS.Link.MODE_AES256_CBC)
time.sleep(LINK_UP_WAIT)
await_link(l1, LINK_TIMEOUT)
self.assertEqual(l1.status, RNS.Link.ACTIVE)
b = 0
@@ -303,7 +310,7 @@ class TestLink(unittest.TestCase):
self.assertEqual(dest.hash, bytes.fromhex("fb48da0e82e6e01ba0c014513f74540d"))
l1 = RNS.Link(dest)
time.sleep(LINK_UP_WAIT)
await_link(l1, LINK_TIMEOUT)
self.assertEqual(l1.status, RNS.Link.ACTIVE)
resource_timeout = 120
@@ -367,7 +374,7 @@ class TestLink(unittest.TestCase):
self.assertEqual(dest.hash, bytes.fromhex("fb48da0e82e6e01ba0c014513f74540d"))
l1 = RNS.Link(dest)
time.sleep(LINK_UP_WAIT)
await_link(l1, LINK_TIMEOUT)
self.assertEqual(l1.status, RNS.Link.ACTIVE)
resource_timeout = 120
@@ -423,7 +430,7 @@ class TestLink(unittest.TestCase):
self.assertEqual(dest.hash, bytes.fromhex("fb48da0e82e6e01ba0c014513f74540d"))
l1 = RNS.Link(dest)
time.sleep(LINK_UP_WAIT)
await_link(l1, LINK_TIMEOUT)
self.assertEqual(l1.status, RNS.Link.ACTIVE)
resource_timeout = 120
@@ -482,7 +489,7 @@ class TestLink(unittest.TestCase):
self.assertEqual(dest.hash, bytes.fromhex("fb48da0e82e6e01ba0c014513f74540d"))
l1 = RNS.Link(dest)
time.sleep(LINK_UP_WAIT)
await_link(l1, LINK_TIMEOUT)
self.assertEqual(l1.status, RNS.Link.ACTIVE)
resource_timeout = 120
@@ -544,7 +551,7 @@ class TestLink(unittest.TestCase):
self.assertEqual(dest.hash, bytes.fromhex("fb48da0e82e6e01ba0c014513f74540d"))
l1 = RNS.Link(dest)
time.sleep(LINK_UP_WAIT)
await_link(l1, LINK_TIMEOUT)
self.assertEqual(l1.status, RNS.Link.ACTIVE)
resource_timeout = 120
@@ -599,7 +606,7 @@ class TestLink(unittest.TestCase):
self.assertEqual(dest.hash, bytes.fromhex("fb48da0e82e6e01ba0c014513f74540d"))
l1 = RNS.Link(dest)
time.sleep(1)
await_link(l1, LINK_TIMEOUT)
self.assertEqual(l1.status, RNS.Link.ACTIVE)
received = []
@@ -651,7 +658,7 @@ class TestLink(unittest.TestCase):
self.assertEqual(dest.hash, bytes.fromhex("fb48da0e82e6e01ba0c014513f74540d"))
l1 = RNS.Link(dest)
time.sleep(LINK_UP_WAIT)
await_link(l1, LINK_TIMEOUT)
self.assertEqual(l1.status, RNS.Link.ACTIVE)
buffer = None