This project has two purposes: first to make you familiarize with sockets/RPCS/RMIs, processes, threads; second to learn the design and internals of a peer-to-peer
This project has two purposes: first to make you familiarize with sockets/RPCS/RMIs, processes, threads; second to learn the design and internals of a peer-to-peer (P2P) file sharing system. You can be creative with this project. You are free to use any programming languages (e.g., C/ C++ or Java) and any abstractions such as sockets, RPCs, RMIs, threads, events, etc. that might be needed. Also, you are free to use any machines such as your laptops or PCs. In this project, you need to design a simple P2P system that has two components: 1. A central indexing server. This server indexes the contents of all of the peers that register with it. It also provides search facility to peers. In our simple version, you don't need to implement sophisticated searching algorithms; an exact match will be fine. Minimally, the server should provide the following interface to the peer clients: o registry(peer id, file name, ...) -- invoked by a peer to register all its files with the indexing server. The server then builds the index for the peer. Other sophisticated algorithms such as automatic indexing are not required, but feel free to do whatever is reasonable. You may provide optional information to the server to make it more 'real', such as the clients' bandwidth, etc. search(file name) -- this procedure should search the index and return all the matching peers to the requestor. deregister(peer id, file name) -- invoked by a peer to delete a file registry in the indexing server. After a peer registered all its files with the indexing server with registry function, the peer can use deregister function to let index server delete the corresponding index for this file. 2. A peer. A peer is both a client and a server. As a client, the user specifies a file name with the indexing server using "search". The indexing server returns a list of all other peers that hold the file. The user can pick one such peer and the client then connects to this peer and downloads the file. As a server, the peer waits for requests from other peers and sends the A requested file when receiving a request. Minimally, the peer server should provi following interface to the peer client: o retrieve(file name) -- invoked by a peer to download a file from another peer. 2/3 Other requirements: . Both the indexing server and a peer server should be able to accept multiple client requests at the same time. This could be easily done using threads. Be aware of the thread synchronizing issues to avoid inconsistency or deadlock in your system. No GUIs are required. Simple command line interfaces are fine. Each peer should have an automatic update mechanism. If a user modifies or deletes some files registered at a server, the effect should be reflected to the server in time. For example, if a user deletes a file on the disk, the server should be notified in time and also remove the corresponding item from the index server.
Step by Step Solution
3.37 Rating (153 Votes )
There are 3 Steps involved in it
Step: 1
P2P File Sharing System Design This project will implement a simple peertopeer file sharing system with a central indexing server and multiple peers Heres a breakdown of the design Components Central ...See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started