CSTC Banner

 CSTC home --> browse resources --> cover page

CSTC Resource Cover Page

Title

Moti's Distributed Alogrithms in Java

Summary

These Java applets are used for studying distributed algorithms. They presume familiarity with distributed algorithms. The applets are not simple animations where you passively watch the algorithm. Instead, they are interactive, visual, study aids for studying distributed algorithms.

I characterize them as (i) interactive because you must explicitly specify every step of the interleaved execution sequence, as (ii) visual because the state of the nodes is continuously displayed, and as (iii) study aids because they solve one of the most difficult problems encountered by students of these algorithms by automatically doing the necessary "book-keeping".

Byzantine Generals is used to demonstrate the implementation of a reliable system in the presence of faults. A loyal general will relay messages exactly as they are received, while a traitorous general may relay a message incorrectly. The goal of the algorithm is for the loyal generals to come to a consensus in the presence of traitors. Three loyal generals can come to a consensus even in the presence of a fourth general who is a traitor.

Ricart-Agrawala mutual exclusion is a generalized "bakery algorithm" for mutual exclusion. If you want
a process to enter its critical section, you must choose a ticket number and send a request message to the other nodes. The ticket number must be greater than the number of any request received so far.

Chandy-Lamport snapshots - The problem is to take a global snapshot of the state of a distributed system, in particular, to account for messages that may be within a channel.

Dijkstra-Scholten termination - A set of nodes is made to terminate by creating an implicit spanning tree. The source node that is the root of the spanning tree is compiled-in. When you send messages, the first one received by a node defines its parent in the tree.

Author

Mordechai (Moti) Ben-Ari
Weizmann Institute of Science
Rehovot 76100 Israel

ntbenari@wis.weizmann.ac.il
http://stwww.weizmann.ac.il/g-cs/benari

Platform requirements

Java Virtual Machine 1.1.6 or higher

Supplemental
materials

Suggestions for running the algorithms.

Suggestions for using the applets in the classroom.

If you experience any problems with the above applets on your browser then you may prefer to download source code and install on your machine daj.zip (44 K)

M. Ben-Ari, Principles of Concurrent and Distributed Programming, Prentice-Hall International, 1990, ISBN 0-13-711821-X.

M. Ben-Ari, "Distributed Algorithms in Java" SIGCSE Bulletin 29(3), 1997, 62-64.