CS505 : Distributed Systems

Programming Assignment 2: A Chord-Like Ring

Note: Questions are fully expected on this programming assignment. Do not hesitate to post and ask both the professor and TA. Some instruction is below, but it will doubtlessly be insufficient as a comprehensive guide. (complete, but may be updated)

Background/Protocol

The purpose of PA2 is to understand some of the complexities of building a simple ring protocol such as Chord. You should gain a better appreciation for the challenges in distributed consistency, and at the same time increase your familiarity with Mace. As with PA1, we are not implementing all of Chord. Reading the Chord paper is important for understanding and background, but discrepancies in the protocols should be settled here, or with instructor questions. Generally, we are implementing the Chord Join protocol and stabilization protocol, and ignoring the finger tables completely.

For this project, you may use cloud11.cs.purdue.edu through cloud15.cs.purdue.edu. The necessary tools for building and running Mace and the model checker should all be available on those machines.

You should be able to build on your earlier Mace checkout. However, in general: you should use cmake to build Mace out-of-source, and within your scratch directory on these machines. (Mace, when compiled, is quite large, and so keeping the build on /scratch will keep your directory from causing you grief from the sysadmins)

You are welcome to do this project on any machine on which you can build Mace, which should be generally true of Linux and OSX systems. We will use a departmental gentoo build for testing them.

For this project, you only need to submit your final HW2Ring.mac. However, there will be a question which you should answer as a text comment in the file. (Standard C++ commenting syntax applies)

We will be implementing the OverlayRouterServiceClass and OverlayServiceClass in Mace. The former provides a getNextHop method, on which routing or DHTs can be implemented. The latter provides a joinOverlay method, which provides the node a bootstrap set. Though there are upcall notifications you should make for a complete implementation, no upcalls are required for this assignment.

I have heavily commented the skeleton file, so you should be able to gain a lot of information there. As before, there are elipses (...) where I have removed code from my working implementation. However, in this case, you will be responsible for defining some whole messages and transitions.

The protocol you should implement is as follows:

Environment/Development

To get started on the homework, you should setup your environment as follows:

When editing Mace files (.mac), it is helpful in most editors to use the syntax highlighting for C++. If you are a Vim user, there is a vim syntax file you can use. If you wish to contribute syntax files for other editors, I am happy to share them with others.

Model checking / Debugging

To run and debug this project, we will be using the Mace modelchecker. To setup your environment for model checking:

Useful hints:

Submission and Grading:

Submit only the file HW2Ring.mac, using BlackBoard. You can find the submission section in the "Assignments" section of BlackBoard for the class. Submissions will be graded according to this grading rubric (TXT).