Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Router internals (informative)

Everything in this section is informative. It documents how the reference router behaves so an implementation can match observable timing and limits where useful, but an implementation MAY diverge from any of it without breaking wire or semantic compatibility. The normative obligations are in the preceding sections.

Delivery scheduling (LXMRouter.py:30-83)

ConstantValueMeaning
MAX_DELIVERY_ATTEMPTS5retries before a message fails
PROCESSING_INTERVAL4 sjobloop tick
DELIVERY_RETRY_WAIT10 swait between delivery attempts
PATH_REQUEST_WAIT7 swait after a path request
MAX_PATHLESS_TRIES1sends attempted before forcing a path request
LINK_MAX_INACTIVITY600 sidle link teardown
P_LINK_MAX_INACTIVITY180 sidle propagation link teardown

Expiry and limits

ConstantValueMeaning
MESSAGE_EXPIRY30 dayspropagation store retention
STAMP_COST_EXPIRY45 dayscached outbound stamp cost retention
PROPAGATION_LIMIT256 KBper-transfer propagation limit
SYNC_LIMIT256*40 KBper-sync cumulative limit
DELIVERY_LIMIT1000 KBdirect delivery resource limit
PN_STAMP_THROTTLE180 spropagation stamp throttle window

Peering (LXMRouter.py:43-60)

MAX_PEERS = 20, AUTOPEER = true, AUTOPEER_MAXDEPTH = 4 hops, ROTATION_HEADROOM_PCT = 10, ROTATION_AR_MAX = 0.5, PEERING_COST = 18 (max 26), PROPAGATION_COST = 16 (min 13, flex 3). Peer selection and rotation policy are internal.

Jobloop cadence (LXMRouter.py:853-860)

A single jobloop dispatches staggered jobs: outbound processing (1 s), deferred stamp generation (1 s), link cleanup (1 s), transient-cache cleanup (60 s), message-store cleanup (120 s), peer sync (6 s), peer rotation (56 * peer-ingest interval). An implementation may use any scheduler.

Persistence

The reference persists to a writable storage path: the message store (one file per propagation message, named transient_id_timestamp_stampvalue), peers, available_tickets, outbound_stamp_costs, locally_delivered_transient_ids, locally_processed_transient_ids, and node_stats. The on-disk encoding (mostly msgpack) and file naming are implementation choices; only the messages and announces these structures drive onto the wire are normative. In libreticulum these map onto the Storage trait rather than a filesystem.

Sync state machine (LXMPeer.py:17-22)

A propagation peer progresses IDLE -> LINK_ESTABLISHING -> LINK_READY -> REQUEST_SENT -> RESPONSE_RECEIVED -> RESOURCE_TRANSFERRING -> IDLE, with STRATEGY_LAZY/STRATEGY_PERSISTENT (default persistent) controlling whether a peer keeps syncing while unhandled messages remain. The states are local; the wire payloads they produce (/offer, the sync Resource) are normative (Propagation).