Distributed Systems : Home exercises

 

Home exercise 1

Deadline Sunday October 19 at 23:55. To be returned through Moodle. Return a PDF document. Please, remember to state your name and student number clearly.

Task description

Read the article The Many Faces of Publish/Subcribe by Eugster et al. The publish/subscribe architecture it describes is at least partially implemented by many social network services today. No doubt, Facebook's (FB's) engineers have also had somebody to read the paper for them.

In each of the following tasks, compare FB with previous paradigms/services: IRC, e-mail, newsgroups, and blogs. You may swap a service for one of your own if you wish.

  • Does Facebook implement stronger variants of the three decouplings than earlier services?  Give examples of each of the three, if any exist. You can use either the standard features implemented by FB or applications implemented by third parties.
  • Does FB implement all three subscription schemes? How? Do any of the earlier services have equivalent schemes?
  • In terms of functionality, what new properties has FB added, when compared with each of the earlier services? Could the properties have been implemented using combinations of the services?

In grading this exercise, points are based on the detail and wit of the analysis, not the amount of text produced. A well-written answer should show that the author has understood the concepts in the original article, and how they are reflected in real-world examples.

 

Home exercise 2

Deadline Sunday October 19 at 23:55. To be returned through Moodle. You need to include a document that gives the instructions on how to run your program and describes the execution process. The programming language is bash. Put all the files in an archive and name it yourlastname_DS14_HE2.zip or yourlastname_DS14_HE2.tar.gz.

Let's make this clear, returns that are:

  • late
  • or written using something other than bash
  • or do not have the above mentioned document
  • or are not original individual work

will fail.

Task description

In this exercise four cats are trying to catch a mouse. The characters of the story are: cheese-loving Mousie Mouse, driven Catty Cat, urban Jazzy Cat, attentive Listy Cat and overseeing Cordy Cat. 

Use the Ukko cluster and write the following bash scripts:
mouse.sh    The mouse
chase_cat.sh    For Catty and Jazzy
listy.sh    For Listy
cordy.sh     For Cordy

The mouse starts by going to one of the Ukko's nodes and listens a port through nc. Then it is up to Cordy to dispatch Catty and Jazzy so that they search the possible Ukko nodes one by one. Catty and Jazzy communicate to Cordy through Listy cat. Listy keeps an open socket through nc and writes the messages to a file called cmsg. Cordy reads the messages from the cmsg file. Cordy coordinates the search by sending Catty and Jazzy with ssh to the nodes to search the mouse. Cordy gives the commands as command line parameter as follows:

S catname   Search the node (e.g. ./chase_cat.sh S Jazzy)
A catname   Attack the mouse on the node

Catty and Jazzy can send the following messages to Listy using nc:

F ukkoXXX catname     Found the mouse on ukkoXXX (e.g. F ukko300 Catty),
N ukkoXXX catname    No mouse on ukkoXXX,
G ukkoXXX catname    Got the mouse

When a cat finds the mouse it will send the F message. Cordy will then make the other cat to search the same node. When Cordy knows that both cats have found the mouse it can give the Attack command to either of the cats. The cat attacks by sending the MEOW message to the mouse. When the mouse receives the MEOW message, it will send the SIGINT signal to the attacking cat (indicating it has been caught). The attacking cat will report back of a succesful attack with the G message.     

Here are some constraints that you must apply:

  • Select 10-20 nodes from Ukko to use and put their names on a file called ukkonodes. Start the mouse process on one of them. The program must work so that it does not matter which of the selected nodes is chosen for the mouse.
  • Cordy can handle one line from cmsg file per 3 seconds.
  • Jazzy and Catty need 10 seconds to search one node.
  • The attack can only happen after both Catty and Jazzy have found the mouse.
  • The attack takes 5 seconds.
  • The attacking cat will wait 10 seconds for the SIGINT signal.
  • The mouse does not move.
  • The port number used with the nc communication must specified in a file called nc_port_number, that is, the port number is read from that file when needed.
  • The node where Listy (listy.sh) resides must be defined in a file called listy_location.
  • Name all files as defined in this description.

You should be able to implement a working program. However, note that some parts are by nature fault-prone. Remember to comment your code. Have fun!

                                               _                
                                           .-*`/                
                                        .-`_  )                 
                                       . .` :  .                
               			      /  '   _ :                
      				 _.-*`   ._ `• ;                
       _   _   	 	      .-'          '-.-`                
      (o\_/o)   	    .'       `       ;                  
       \• •/               /        .       .:                  
       >\ /<    	  .   '-.   |   .  / .                  
   \    /o\     	  |      '  ;  ;.-`  '                  
    )  /   \  		.-;       ;    |  '  :                  
    (  U   U 	       ; *`._     :-`| :   ' ;     .-=-.        
     \(|   |)  		'*`  '_ -`*. ; '*.  \ '*. /=o=o=\       
       ω'-'ω   		       '*-*`  *-*`   *-*`~\=o=o=/
              			                   '-=-'        
 

 

Home exercise 3

Update: Nov 7, added links to the documentation and papers.

Deadline Sunday December 14 at 23:55. To be returned through Moodle. Put all the files in an archive and name it yourlastname_DS14_HE3.zip or yourlastname_DS14_HE3.tar.gz.

You have two main tasks in this assignment:

1. Take a look at the Coda distributed file system (http://www.coda.cs.cmu.edu/). Research the documentation and papers about Coda. You do not need to install Coda, but if you are interested, please feel free to experiment with it. You need to answer the following questions:

  • a. What consistency models does Coda support?
  • b. What algorithms are used to implement the consistency models?
  • c. What kind of data replication mechanisms does Coda use?

Note that it is not necessary to read all of the articles, just skim through some and locate the most relevant ones.

 2. Investigate one existing cloud-based storage service, for example, Google Docs/Drive, Dropbox, OneDrive, Box.net, Sugarsync, etc.

  • a. Can you find out what consistency model that service uses? Even if not, explain how you searched for this answer.
  • b. Experiment with storing data on that service and attempt to break the data consistency.

 

Home exercise 4

Deadline Sunday December 14 at 23:55. To be returned through Moodle. Put all the files in an archive and name it yourlastname_DS14_HE4.zip or yourlastname_DS14_HE4.tar.gz.

Background:

Read the article "Fault Tolerance by Design Diversity: Concepts and Experiments" by A. Avizienis & J. P. J. Kelly.

Task description:

Write an example program that consists of at least two objects. The first object A calls one or more methods of the second object B. B must
contain at least three faults: they will be intentionally introduced into the program code. A will be partially fault-tolerant.

One of the faults in B shall remain invisible to A. The second shall manifest as an error, but will be detected by A and handled (tolerated) by the method invocation. The third fault should be left unhandled by A and propagate as a failure to the user of A.
Requirements

In the program, each fault must be carefully documented, as well as the execution sequence that causes the faults to propagate as errors or failures.
The purpose of the exercise is to show that you have understood the threefold model of malfunctions presented in the article.

The program code must run on the Department's workstations. Please do NOT use the shell servers melkki, melkinkari, melkinpaasi, or alkokrunni for programming this task.

Write a document that describes what your program tries to achieve.