SubverseIM / Subverse.NET

An example implementation of the Subverse Network written in C# .NET for Core v8.0+
https://subverse.network
The Unlicense
4 stars 1 forks source link

[feature/core] Implement TTL for Message Routing #2

Closed SubverseIM closed 7 months ago

SubverseIM commented 7 months ago

Messages sent over the Subverse Network should be tagged with a TTL value similar to the behavior observed in DNS.

The routing algorithm should be modified as follows:

  1. Upon receipt of a message, if its TTL value is zero, attempt to find a direct route*
  2. If no such route exists, discard the message, and do not place it back into the message queue
  3. Otherwise, construct a copy of the message with its TTL value decremented by 1
  4. Proceed to route the message as normal

*a message has a direct route if and only if the intended recipient of said message has an active connection to this server.

Practice minimalism and lean towards forward-compatibility when modifying the Subverse schema (contained within the Subverse.Models namespace)

Further discussion of this issue should focus on defining a default policy for maximum/starting TTL values in messages instantiated by clients.