Nepedia
Back to Discover
Advanced Reader
💻

Peer-to-peer

technology Maturity 9-11 war conflict Next article →

This article covers sensitive topics: war_conflict. Parents can manage visibility in Parental Controls.

Peer-to-peer (P2P) computing is a distributed architecture for networking and computing.

P2P network
P2P network

In this system, participants share their own resources directly with others. These resources can include processing power, storage space, or network capacity. Every participant in a P2P network acts as both a resource provider and a resource requester. This is the opposite of the traditional client-server model. In a client-server model, central servers act as the providers while clients act as the requesters. P2P allows for a decentralized way to manage data and tasks across many different machines.

To understand how P2P works, we must look at the overlay network. P2P networks usually implement a virtual overlay network on top of the physical network topology.

Unstructured peer-to-peer network diagram
Unstructured peer-to-peer network diagram

While data travels over the underlying TCP/IP network, the peers communicate through logical links in the overlay. This makes the P2P system independent from the physical way the computers are connected. These overlays are used for indexing and peer discovery. This allows the network to organize itself without a central administrative authority.

There are two main types of P2P networks: unstructured and structured. Unstructured networks do not impose a specific design on the overlay network. Instead, nodes form connections to each other randomly.

Unstructured peer-to-peer network diagram
Unstructured peer-to-peer network diagram

These networks are easy to build and very robust. They handle "churn," which is when many peers join or leave the network frequently. However, searching in an unstructured network can be difficult. A peer must flood the network with search queries to find data. This creates high signaling traffic and uses a lot of CPU and memory. It also means finding rare data is unlikely.

Structured networks solve the search problem by using a specific topology. These networks often implement a distributed hash table (DHT).

Structured (DHT) peer-to-peer network diagram
Structured (DHT) peer-to-peer network diagram

A DHT uses consistent hashing to assign ownership of files to specific peers. This allows any node to find a resource efficiently by using key-value pairs.

DHT en
DHT en

Even if a file is extremely rare, the DHT helps locate it quickly. However, structured networks are less robust during high rates of churn. Maintaining the specific lists of neighbors required for routing can be difficult when nodes constantly change.

Some systems use a hybrid model to get the best of both worlds. A hybrid model combines P2P and client-server elements. For example, a central server might help peers find each other. This provides the centralized functionality needed for efficient searching. At the same time, it benefits from the decentralized power of many nodes. Spotify was an example of a hybrid model until 2014. These models often offer better performance than pure unstructured or structured networks.

The history of P2P goes back to the earliest days of networking. The first Request for Comments, RFC 1, mentioned principles that align with these ideas. The ARPANET was a successful precursor where every node could request and serve content. In 1979, Usenet was established as a decentralized messaging system. However, the concept became famous in May 1999 with Shawn Fanning's Napster.

SETI@home Multi-Beam screensaver
SETI@home Multi-Beam screensaver

Napster allowed users to form virtual networks independent of administrative authorities. This popularized the idea of users collaborating to create virtual supercomputers and filesystems.

P2P technology is used in many modern protocols and devices. BitTorrent is a well-known protocol used for file sharing over the Internet.

Torrent peers
Torrent peers

You might also use P2P in personal networks, such as Bluetooth radio or Miracast. These technologies allow devices to display and share data directly. Because every peer also acts as a server, these systems face unique security challenges. Malicious users can perform routing attacks, such as incorrect lookup routing. This happens when a node sends false results or incorrect routing updates to others.

606 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ Images & Media (9)
File:P2P network.svg
P2P network.svg
File:Server-based-network.svg
Server-based-network.svg
File:SETI@home Multi-Beam screensaver.png
SETI@home Multi-Beam screensaver.png
File:Unstructured peer-to-peer network diagram.png
Unstructured peer-to-peer network diagram.png
File:Structured (DHT) peer-to-peer network diagram.png
Structured (DHT) peer-to-peer network diagram.png
File:DHT en.svg
DHT en.svg
File:Yacy-resultados.png
Yacy-resultados.png
File:Torrent peers.png
Torrent peers.png
File:Torrentcomp small.gif
Torrentcomp small.gif
More to explore

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.