Peer-to-peer (P2P) network is a decentralized communications model in which each party has the same capabilities and either party can initiate a communication session. Unlike the client/server model, in which the client makes a service request and the server fulfills the request, the P2P network model allows each node to function as both a client and a server. The most popular application for P2P networks is file-sharing.
One of the main features of a P2P system is that each node contributes resources such as bandwidth, storage space, and CPU power. As a result, the system gains more capacity as more nodes become involved. This is opposite to a client-server architecture, where the addition of clients always degrades the overall performance. Since P2P systems do not rely on a centralized server, they are generally more robust.
P2P systems can be classified as centralized, decentralized structured and decentralized unstructured.
In the centralized model, index servers are used to maintain a directory of shared files stored across the network. Peers can quickly search the centralized directory to get the location of the desired content. This architecture is sensitive to potential attacks, and the central authority may introduce some legal issues.
Decentralized P2P systems do not have central servers, so the peers are free to exchange information and services directly between each other. There are two types of decentralized P2P networks: unstructured and structured.
In decentralized unstructured P2P systems, there is no strict control over the network topology or file placement. This makes it difficult to search for a desired file. Search queries must be broadcast to all peers within a specified distance. These methods are simple, and highly robust to alteration in the overlay network topology, but they become ineffective as more nodes participate in the network.
In decentralized structured P2P systems, the shared data placement and network topology are robustly controlled on the basis of distributed hash functions. The index is distributed across the overlay network topology in a precise way. As a result, search queries are directed towards the exact index location solving the scalability problem of unstructured networks. However, decentralized models still have a number of issues such as complexity, high maintenance overhead, and rigid structure that may lead to search failures. Because of these issues, the decentralized model is not widely used.
Another issue with P2P networks is that peers in the network may have non-uniform capabilities (such as disk size, CPU speed and bandwidth), but all participants must assume the same role and responsibility or the overall system performance may decrease. To resolve this heterogeneity issue, the super-peer approach can be used. Some nodes that have access to more resources are denoted as super-peers. A super-peer often plays the role of a server that manages the queries and responses for a subset of ordinary peers.