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

Info icon This 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
Image of page 1

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

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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern