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

Due Friday, December 4, 11:59 PM.

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. You can simply consult it for inspiration. 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, implementing the following:

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).

Turn-in:
Use the turn-in script to submit your source files, a makefile if needed, and a README file describing:

Grading:

Late turn-in policy:
You may turn it in up to 3 days late; you lose 10% for each day late.