This strategy assumes that the files of interest are already stored on the peers and that there is a directory system to which each peer registers. Each peer provides the list of files it makes available for sharing, while any peer interested in downloading a file sends a request asking which peers own that file, obtaining a list of the IP addresses of the peers from which the file can be downloaded.
The download is performed by the interested peer, which acts as a client towards a single selected peer containing the file, which acts as a server. The directory system maintains information about all the files available in the distributed system.
Considering that P2P networks can be used to exchange copyrighted content, this approach historically faced several legal issues because it clearly identified both who was making content available, through their IP address, and what type of content was being made available, through its corresponding description.
In the _config.py_ file, set your own IPv4 and IPv6 addresses and the directory to connect to.
Run the following commands from the terminal:
cd P2P/Napster
python3 main.py
In this system, there is no centralized directory keeping track of the files made available by individual peers. Each peer initially knows a limited number of neighboring peers and has the ability to discover additional peers later. When a peer decides to search for a file, it sends a QUERY message to its neighbors. Depending on the value of the TTL (Time To Live), they decide whether to forward the message to their respective neighbors, and so on, until the message reaches a peer that owns the requested file. This peer then contacts the initial peer, notifying it that the requested file is available.
In the config.py file, set your own IPv4 and IPv6 addresses. For the program to work, MongoDB must be installed and running on the system. The Python pymongo library is also required, as it allows the program to interface with the database.
Run the following commands from the terminal:
sudo service mongd start
cd P2P/GNutella
python3 main2.py
- ArtPes - (https://github.com/ArtPes)
- lovalova91 - (https://github.com/lovalova1991)
- padovanl - (https://github.com/padovanl)
See also the list of contributors who participated in this project.