Skip to main content

Module fair_loss_link

Module fair_loss_link 

Source
Expand description

Fair-loss point-to-point links — the bottom of the stack, and the weakest link there is.

Status: implementation. Space: none. It keeps nothing at all, which is what makes it trivially bounded and what makes everything above it responsible for its own redundancy.

Cachin, Guerraoui & Rodrigues, Module 2.1 (“FairLossPointToPointLinks”):

FLL1  Fair-loss: If a correct process p infinitely often sends a message m to a correct
      process q, then q delivers m an infinite number of times.
FLL2  Finite duplication: If a correct process p sends a message m a finite number of times
      to q, then m cannot be delivered an infinite number of times by q.
FLL3  No creation: If some process q delivers a message m with sender p, then m was
      previously sent to q by process p.

§Why this module is nearly empty

recon-sim is the fair-loss network — that is CLAUDE.md’s description of it and the whole of constraint 3. Loss, duplication and reordering are its knobs. So a fair-loss link in this codebase has nothing to add: it hands a send to the network and reports what arrives. FLL1 through FLL3 are the simulator’s properties, and this module’s job is to be the port through which a layer above reaches them without naming the simulator.

That is not a degenerate case, it is the point. Every other link here is defined by what it adds on top of this: the stubborn link adds retransmission, the perfect link adds deduplication over that, the session link adds ordering within a scope and honesty across one.

§What it is for

Algorithm 3.9 — eager probabilistic broadcast — says Uses: FairLossPointToPointLinks, and it means it. Gossip exists to tolerate loss; running it over a perfect link, which retransmits until delivery, masks the behaviour it is built to provide and leaves its probabilistic guarantee unobservable. It also never falls silent, because the stubborn link beneath the perfect one re-sends everything it has ever sent on every tick, so “a broadcast generates finitely many transmissions” cannot be measured there either.

Before this module existed, the only thing in the tree with this shape was a link written for a test — the stand-in for an application’s own transport in tests/foreign_link.rs. That it was needed twice, once as a demonstration and once as the bottom of the book’s own stack, is what made it a module.

Structs§

FairLossLink
The link the book’s stack starts from: send it, and hope.

Enums§

Cmd
Requests from the layer above.
Ind
Indications to the layer above.