What is peer-to-peer architectural design?

In a peer-to-peer (P2P) network, two or more systems are connected together, and they share resources without the need for a central server. The connection between these systems can be physical or via the internet. Each system is a server as well as a client, and can request or share resources whenever needed.

Example of a P2P network

In order to be a part of a P2P network, P2P software is required, which allows users to share files with all other users who are a part of the network. Some P2P software examples are:

  • Kazaa
  • FrostWire
  • LimeWire
  • Acquisition

Once they’re a part of the network, a user can access the files of other users, and other users can access their files as well. The folder containing the resources to be shared is designated by the user.

Example: BitTorrent

BitTorrent is a very famous P2P protocol that allows users to share data in a distributed manner. It’s mostly used for the transfer of video and audio files, such as movies and songs. To use it, users have to download a BitTorrent client such as μTorrent on their system.

BitTorrent tracker

BitTorrent tracker is a server that helps peers communicate effectively and efficiently. It keeps a list of the peers and which files they have. When a client makes a request for a file, the tracker knows which peers are available and coordinates the transmission from server peer to client peer, as well as the reassembly of the requested file. Reassembly is required because pieces of the file may be downloaded from different peers.

Seeders and leechers

Seeders: These are peers that act as servers. They have the complete file downloaded and are sharing it with other users.

Leechers: These are the peers that act as clients. They’ve requested a file and are actively downloading it.

The download speed is directly proportional to the number of seeders of any file. If multiple peers have access to the complete file, each can share a piece of the file. Users can download these separate pieces simultaneously because the download speed is always greater than the upload speed.

However, if there are no seeders and only leechers, there won’t be anything to download because no peer will be sharing the file.

Advantages of P2P architecture

  • Highly scalable: There is no designated server system, so any number of peers can easily be added to the network without putting a strain on any resources.
  • Increased system capabilities: Each peer can act as a server, so the system has more capabilities than a client-server architecture. Each server peer adds its capabilities to the overall system.
  • Easy file sharing: File sharing is easier and speedier in P2P architecture than in any other architecture.
  • Less expensive: There is no need for designated servers, which increase in cost as the network grows.
  • Fault tolerant: In a client-server architecture, the whole system falls apart if there is a failure in the central server. In P2P, even if a peer faces failure, the rest of the network remains undisturbed.

Disadvantages

  • Difficult to track changes: Because many peers might have shared files, it is very difficult to follow all the changes. When one peer makes a change, it needs to be reflected in the entire network.
  • Less secure: Each peer needs to implement their own layer of network security, otherwise the entire network is vulnerable.
  • Performance problems: Any system in the network can be accessed by all other systems at any given time, which can reduce its performance.
  • No view option: Resources cannot be viewed before being downloaded.
  • Illegal content: Copyrighted information can easily be transferred through the network.

Free Resources