Saral Shiksha Yojna
Courses/Distributed Systems

Distributed Systems

CS3.401
Prof. Kishore KothapalliMonsoon 2025-264 credits

BSS Algorithm + Causal vs FIFO vs Total Order

NotesStory
Unit 4 — Causal Order Message Delivery

Why FIFO Isn't Enough

In a group chat, Bob asks "what time?" and Alice replies "noon". Charlie joins the conversation. If Charlie's network delivers Alice's "noon" before Bob's question, Charlie sees a non-sequitur — an answer to a question he hasn't seen yet.

FIFO doesn't help here because Bob and Alice are different senders. FIFO orders only same-sender messages.

What we need is causal delivery: whenever and both target the same destination, must be delivered before . The arrow is Lamport's happened-before — covering all cause-and-effect chains, including those going through intermediaries.

BSS — The Algorithm

Birman, Schiper, Stephenson (1991). Each process maintains a vector clock . On send to , increment and piggyback as on the message.

On receive of from at , deliver only when BOTH:

(a) — this is the next expected message from (FIFO from ).

(b) — all causally preceding messages from other senders have arrived.

If either fails, buffer the message. Re-check when other messages arrive.

After delivery, .

Why The Two Conditions

Condition (a) is FIFO — don't skip messages from the same sender.

Condition (b) is the causal part. The sender's vector reflects which other senders' messages the sender knew about. If , the sender saw a more recent message from than has — meaning sent something to that hasn't yet arrived. Deliver this message and you'd be delivering effect before cause.

Order Strengths In One Picture

| Property | Orders | Concurrent messages | Cost | |---|---|---|---| | FIFO | same-sender pairs | unordered | very cheap (just sequence numbers) | | Causal | causally-related pairs | unordered | moderate (vector clock per message) | | Total | ALL pairs | also ordered (consistent) | heavy (needs consensus) |

State-machine replication (Raft, Paxos) needs total order. Group chat usually wants causal. TCP gives FIFO.

What You Walk In Carrying

Definition of causal order. Why FIFO is strictly weaker. BSS two conditions and their meaning. Strength order: Total ≻ Causal ≻ FIFO. Use cases: replicated DBs, group communication, distributed debugging.