mp2-sp11 - ECE428/CS425/CSE424: Distributed Systems...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Distributed Hash Table In this programming assignment, you will be implementing a variant of the Chord system [1]. To simplify your job, you are provided with a hash function code that generates node identifiers and keys for file lookups. Your main task in this assignment will be to implement (i) node joins, (ii) adding a file, (iii) deleting a file, and (iv) searching for a file. Constraints and Assumptions 1) There are no node failures; 2) The keys and the node ids are m bits in size (5 <= m <=10); 3) Use sockets for communication between nodes; 4) Each node in the system should be simulated by a separate process. Specification You are to use the UIUC College of Engineering EWS workstations, named linux.ews.illinois.edu. Information about the workstations is available on the homepage http://www.ews.uiuc.edu Make a directory called MP2 somewhere inside your main directory and store all your files in this directory. Use only C or C++ for developing the system. Hash Function In this programming assignment you will be using a SHA-1 hash function for generating the keys corresponding to a filename. We have provided a library that implements the hash function. You may copy the library from the ~ece428 directory to your EWS home directory using the following command: > cp ~ece428/ece428_sha_library.tar ~ When you untar the archive file (use tar -xf ece428_sha_library.tar to untar), you will see a directory called mp2_sha1-c , which will contain three files, namely sha1.c, sha1.h, key_gen_test.c . The hash function is implemented in sha1.h and sha1.c . To understand how to use the library files, please refer to key_gen_test.c. In particular, refer to the statement SHA1Input(&sha, argv[1], strlen(argv[1])); to understand how to call the hash function in your code and the statement key_id = sha.Message_Digest[4]% ((int)pow(2,m)); to understand how a key is generated from a file name. The keys generated by this library will be a 160 bit SHA-1 key modulo 2 m , where m (in bits) denotes the size of the node IDs and the keys. Your code should read m from the command line, as described later. We will test your code with values of m between 5 and 10 (5<= m <= 10). (Please make sure that when you compile your code with this library, you need include <math.h> and when you link your codes with this library, you need an option like ‘-lm’ to use math library) Design Details The Chord system that you will design should be capable of supporting node joins, adding a file, deleting a file, and looking up for a file. In this assignment, you will be not be storing actual files, but you will instead store an attribute of the file in the form of an IP address. The IP address is intended to denote the actual device where the file is located. The IP address will be passed on as a parameter while adding a file to the Chord system and should be in a
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/08/2012 for the course ECE 428 taught by Professor Hu during the Spring '08 term at University of Illinois, Urbana Champaign.

Page1 / 4

mp2-sp11 - ECE428/CS425/CSE424: Distributed Systems...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online