Termination Detection Topic 3, Distributed Algorithms Chapter 6
Termination Detection Topic 3, Distributed Algorithms Chapter 6
Detection
Chapter 6
Topic 3, Distributed Algorithms
What is
Terminated
Distributed
System?
What is Termination
Detection?
Why Termination
Detection is
important?
Termination Detection 4
Key Concepts
Process Active & Passive State Message & Acknowledge & Control &
Token
A process is an individual unit of A process is in an active state if it is A message is communication sent
computation. still working or has sent a message. from one process to another.
In embedded or IoT systems, a process
can be a sensor, or traffic light node A process is passive if it has finished An acknowledgment is a reply
connected via wireless ( BLE) or wired and is waiting, doing nothing. A confirming receipt of a message or
(SPI) communication. process can turn passive when its action.
instructions finishes.
A control message sent when a
process turns passive.
Termination Detection 5
Key Concepts
Initiator Parent-Child Termination & Announce
The process that starts first. Initiator is If a process activated the other one by Termination happens when all
usually parent of rest of the processes. sending a message, processes are passive and no
messages are in transit.
● Message sender is the parent
● Message receiver is the child After detecting termination, when
● A child can have children. initiator has no child, initiator
● A parent have multiple children Announces.
Termination Detection
Dijkstra-Scholten Algorithm
Rules (1)
Dijkstra-Scholten Algorithm
Example
Weight-throwing Algorithm
Rules (2)
● Every process has weight w>=0.
● An Active process has w>0
passive has w=0.
● Initiator can send its weight to
its children.
● Iıtıator understands termination
detection by the weight it
started.
● Every process can send a
message to reduce its weight.
● When a process turns passive, it
sends a control message and
its weight returns to its parent.
● When initiator returns to its
starting weight TERMİNATION
DETECTED and it announces .
Termination Detection 10
Weight-throwing Algorithm
Example
Simple method but, weight can be divided too much. To fix underflow a
process can give weight to itself or P can wait for its child to be passive
Termination Detection 11
Rana’s Algorithm
Example
Termination Detection 13
Result
References
● Fokkink, W. (2013). Distributed algorithms: an intuitive approach.
MIT Press.
● Rana’s algorithm:
https://www.youtube.com/watch?v=egX7JxDlri4
● Fokkink, W. (2021) Fault-Tolerant Termination Detection with
Safras Algorithm
16
Introduction to DNA Questions? 17
QR to Slide
Questions?
Questions?