Timeout default structure updated

This commit is contained in:
Mark Qvist 2021-12-05 11:45:13 +01:00
parent a692d29c90
commit ba39a69175
3 changed files with 10 additions and 8 deletions

View File

@ -45,11 +45,7 @@ class Link:
MDU = math.floor((RNS.Reticulum.MTU-RNS.Reticulum.HEADER_MINSIZE-RNS.Identity.FERNET_OVERHEAD)/RNS.Identity.AES128_BLOCKSIZE)*RNS.Identity.AES128_BLOCKSIZE - 1
# This value is set at a reasonable level for a 1 Kb/s channel.
#
# TODO: Find a way to automatically raise or lower this according to
# channel bandwidth and utilisation.
ESTABLISHMENT_TIMEOUT_PER_HOP = 5
ESTABLISHMENT_TIMEOUT_PER_HOP = RNS.Reticulum.DEFAULT_PER_HOP_TIMEOUT
"""
Default timeout for link establishment in seconds per hop to destination.
"""

View File

@ -75,9 +75,7 @@ class Packet:
The maximum size of the payload data in a single unencrypted packet
"""
# This value is set at a reasonable
# level for a 1 Kb/s channel.
TIMEOUT_PER_HOP = 5
TIMEOUT_PER_HOP = RNS.Reticulum.DEFAULT_PER_HOP_TIMEOUT
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):
if destination != None:

View File

@ -59,6 +59,14 @@ class Reticulum:
the default value.
"""
# TODO: To reach the 300bps level without unreasonably impacting
# performance on faster links, we need a mechanism for setting
# this value more intelligently. One option could be inferring it
# from interface speed, but a better general approach would most
# probably be to let Reticulum somehow continously build a map of
# per-hop latencies and use this map for the timeout calculation.
DEFAULT_PER_HOP_TIMEOUT = 5
# Length of truncated hashes in bits.
TRUNCATED_HASHLENGTH = 80