Home
Softono
P2P-file-sharing

P2P-file-sharing

Open source C
18
Stars
5
Forks
0
Issues
0
Watchers
8 years
Last Commit

About P2P-file-sharing

P2P-file-sharing is a simplified Peer-to-Peer system modeled after Napster, designed for decentralized file search and retrieval. The architecture relies on a central server that manages peer registration and file indexing while peers operate as independent clients handling data transfer. Users join the network by connecting to the server using its IP address and port, then publish available files stored in a local p2p-files directory. When a user searches for a file, the central server identifies owning peers and facilitates the direct connection. Once located, the requesting peer retrieves the file directly from the source peer, bypassing the central server for data transfer. The system fully supports duplex operation, allowing simultaneous uploads and downloads across multiple peers and multiple concurrent transfers. It operates over any file format including PDFs, images like JPG and PNG, and text documents. Built for scalability, the server handles multiple peer connections concurrently, while each clien

Platforms

Web Self-hosted

Languages

C

Links

P2P-file-sharing

In this project,a simple 'Napster' like P2P system for file search and retrieval has been implemented. A user (peer) joins a P2P system by contacting a central server (server). The peer publishes the files she wishes to share by specifying the same to the central server. The peer searches for a file, again by contacting the central server. Based on input from the server, peer fetches the file from another peer (who has the file).

  1. There is a single central server (server.c) and at least 4 peers. Peers are different instances of the same code client.c. The server should be able to handle multiple peers simultaneously.

  2. All peers know the central server details. This can be accomplished via a command-line argument. Example: ./client server-ip server-port

  3. Each peer also has its own local folder named 'p2p-files' which is used to store files it wishes to publish as well as ones which it fetches from others.

  4. Each peer supports duplex operation i.e. it should be able to transmit (upload to another peer) as well as receive files (download from another peer) simultaneously. Multiple uploads and downloads are also be supported.

  5. Code works over any type of file: pdfs, jpg, png, txt etc