CS505 : Distributed Systems

Programming Assignment 1: Gossip Protocol

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 PA1 is to familiarize yourself with the Mace programming environment while implementing portions of the Demers et al. epidemic/gossip protocol. You should read the Demers paper for familiarity and understanding, but refer to this description for the details of what specifically to implement.

For this project, you may use cloud10.cs.purdue.edu through cloud15.cs.purdue.edu. The access control has not been setup properly yet, but will be setup shortly. The necessary tools for building and running Mace and the model checker should all be available on those machines. 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 HW1Epidemic.mac. Your first step should be to download Mace using subversion as described here: http://www.macesystems.org/release/. Then, you should open the Mace-HOWTO.pdf document in the docs directory, and work through building Mace and understanding the simple Ping example.

We will be implementing the GossipServiceClass in Mace. That interface is considerably more general than the interface necessary for this class. In particular, it supports channelIds (allowing different independent channels of gossip), and also allows multi-source gossip with the delivery mechanism for gossip supporting indicating the gossip data from each source. You do not need to worry about channel ids or gossip sources. You may assume that all gossiping is on channel 0, and every node should pretend it is the source of the gossip when delivering gossip to the simulated application. In actuality, only one peer will do the publishing. Also note, you need not implement the pull-based downcall to retrieve gossip. Instead, deliver all gossip to the simulated application using the upcall_deliverGossip method.

The protocol you should implement is as follows:

Environment/Development

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

You should now be able to build the repository with your new services. Create a build directory, then run:

cmake /path/to/mace/source
to create the build system. Henceforth, you should be able to build your system using 'make'.

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.

Model checking / Debugging

To run and debug this project, we will be using the Mace modelchecker. To familiarize yourself with MaceMC, you should next follow the HOWTO in mace/docs/modechecker/tex/MCHowTo.pdf. This will take you through a BrokenTree example, and finding some simple bugs using the model checker. To setup your environment for model checking:

Standalone Gossip application (for hand-testing)

For the purpose of easy hand-testing and debugging in the initial stages, you can use the following simple application.

Useful hints:

Submission and Grading:

Submit only the file HW1Epidemic.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).