OSP2P is an operating system interface for a distributed computing peer-to-peer network.
OSP2P network consists of two kinds of nodes: trackers and peers. Trackers keep track of which peers are connected to the network; peers actually download files from each other. Peer-to-peer communication in the OSP2P system is built from a series of remote procedure calls (RPCs). These RPCs are formatted as normal text, formatted somewhat like other Internet protocols (HTTP, FTP, SMTP, and so forth).
A peer logs in to a tracker as follows.
- The peer connects to the tracker machine.
- The tracker responds with a greeting message.
- The peer registers its IP address and port with an "ADDR" RPC.
- The tracker responds with a message indicating success or failure. Now the tracker will report this peer to other peers who wan to download files.
The peer then informs the tracker of the files it is willing to upload to others.
- The peer registers each file with a "HAVE filename" RPC.
- The tracker responds with a message indicating success or failure.
When a peer wants to download a file from the network, it communicates with both the tracker and other peers.
- The downloading peer asks the tracker which peers have the file with a "WANT filename" RPC.
- The tracker responds with a message listing the available peers willing to serve that file.
- The downloading peer picks an available peer from this set, and connects to that peer, sending it a "GET filename OSP2P" RPC.
- The uploading peer responds to this RPC by sending the entire file.
Once the downloading peer has downloaded the entire file, it informs the tracker that it, too, has the file.
- The downloading peer registers its newly downloaded file with a "HAVE filename" RPC.
- The tracker responds with a message indicating success or failure.
- Implements parallel upload/download between peers
- Robust communication using defensive programming
- Configurable option for evil peer that aims to crash any peers that attempt to download files from it
Extract into ubuntu distribution and run in QEMU emulator with ./run-good
.