Question

I am learning the p2p architecture through a simulation within a single machine. For that I was told that I can use named pipes. I am in the design phase of the simulation. Here is how I plan to move forward:

  1. Create a peer program that is able to join the p2p 'network'. The network is a collection of such peers. The peer is identified via the process id in the machine.

  2. When a peer is created i.e., joins the network, it announces it's arrival through bootstrapping itself to a 'master-node' or tracker. When the peer announces its arrival, the master-node updates its list of peers (process ids), and returns the list of peers available in the network to the new peer.

  3. Once in the network, the peer can now download a file from the network or upload a file to an incoming request for a file that s/he has. The files that the peer receives through the network automatically becomes available for upload.

  4. To download a file, the peer calls a location algorithm that locates the peer with the file that the current peer is seeking to download.

As you can see, there is a gap in my understanding of the design. From my naive approach, I see #2 and #3 as different steps. However, I have a feeling that they must somehow be related. I guess my understanding lacks in knowing how a distributed hash table and algorithm like Chord or CAN works. I need help in rounding up these scattered ideas that will help me actually implement the simulation.

To begin, my first question is: where and how do I initiate the location algorithm? Or where is the distributed hash table created in the steps listed above?

Was it helpful?

Solution

You have a choice of either implementing a tracker server a la Napster. Or you can implement DHT-capable nodes - Bit torrent style.

In the former case, the tracker keeps track of all the nodes and the files they are hosting.

And in the latter, each node keeps track of the information (at least one peer in the network assumed in this case). A new peer will then contact one of the DHT - capable peer and get information about the node that is hosting the file that it requires.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top