Assignment #4 - Peer-to-Peer File Sharing Gnutella Style

Demo on Monday, November 14 or Tuesday, November 15.

Assignment overview:
In this assignment, you will implement the query flooding protocol used in Gnutella (a peer-to-peer file sharing technology). It is said that the two Gnutella inventors spent 14 days to design and implement a prototype system. It should take you much less time in simply following their ideas and implementing a small part of the complete protocol. You do not need to add a file retrieval mechanism into the search system, which would be needed for a complete file sharing system.

Requirements in detail:
A specification of the Gnutella query flooding protocol can be found here. For your relief, you are asked to implement a small part of the protocol, which will be explained below. You will not need to read the Gnutella specification to complete this assignment. The requirements we give below are not always specific. You can design your own packet format and so on as long as systems running your protocol behave as we specify. So your system may not work with Gnutella-compatible nodes, but nodes implementing your protocol should be able to inter-operate. Your protocol should run on top of a transport-layer protocol, e.g. TCP.

A key concept behind peer-to-peer technologies is that all the nodes are functionally equal to each other. In particular, all the nodes will run the same code.

Every node should start up with the following input:

Below are the desired behaviors for peer-to-peer file searching through query flooding:

Here is an illustration of what query flooding looks like (with an initial TTL=2).

You will need a user interface for your system. A text-based interface is sufficient. However, a GUI will certainly make the TA like your stuff a little better :). Your program should print out all activities including query propagations and query hits at the runtime.

Testing:
You will need multiple machines in your testing. And others may do the same at the same time. Make sure you all use different port numbers in order not to interfere with each other.

Turn-in:
This assignment will be primarily examined by a 20-minute demo with the TA. The TA will send out information on how to set up a demo slot. The earlier you sign up with the TA, the more available slots are there that you can choose from. Once your demo slot is set, we will not change it unless there is any emergency.

You are also asked to turn in your source files, a makefile if needed, and a README file before or right after the demo. Your README file should describe clearly how your program should be compiled and run. Yes, the TA may try to run your program after the demo. Your README should explain your design and what is and what is not realized in your implementation. In particular, it should describe the packet format for neighborhood establishment and query propagation.

Grading:

Late turn-in policy:
At the absence of any emergence, you must make your arranged demo time. Otherwise you will get no points for this assignment.