ArticleslgStudy

computer science

Peer-to-peer

Peer-to-peer is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Peer-to-peer rather than just read about it. In short: Peer-to-peer (P2P) computing or networking is a distributed computing or networking architecture in which participants share part of their own resources, such as processing power, storage, or network capacity. These resources are made directly available to other peers without reliance on intermediary entities, and participants act as both resource provider and resource requesters.

Peer-to-peer — main illustration
Peer-to-peer — illustration

Key takeaways

  • Peer-to-peer belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Peer-to-peer to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Peer-to-peer from memory before moving on to harder problems.

Reference excerpt

Peer-to-peer (P2P) computing or networking is a distributed computing or networking architecture in which participants share part of their own resources, such as processing power, storage, or network capacity. These resources are made directly available to other peers without reliance on intermediary entities, and participants act as both resource provider and resource requesters.

In contrast, the traditional client–server model assigns resource provider and requester roles to different participants, with centralized servers acting as providers and clients acting as requesters. While P2P systems had previously been used in many application domains, the architecture was popularized by the Internet file sharing system Napster, originally released in 1999. P2P is used in many protocols such as BitTorrent file sharing over the Internet and in smartphone ad hoc networks and personal networks like Miracast displaying and Bluetooth radio. The concept has inspired new structures and philosophies in many areas of human interaction. In such social contexts, peer-to-peer as a meme refers to the egalitarian social networking that has emerged throughout society, enabled by Internet technologies in general.

Development

While P2P systems had previously been used in many application domains, the concept was popularized by file sharing systems such as the music-sharing application Napster. The peer-to-peer movement allowed millions of Internet users to connect "directly, forming groups and collaborating to become user-created search engines, virtual supercomputers, and filesystems". The basic concept of peer-to-peer computing was envisioned in earlier software systems and networking discussions, reaching back to principles stated in the first Request for Comments, RFC 1. Tim Berners-Lee's vision for the World Wide Web was close to a P2P network in that it assumed each user of the web would be an active editor and contributor, creating and linking content to form an interlinked "web" of links. The early Internet was more open than the present day, where two machines connected to the Internet could send packets to each other without firewalls and other security measures. This contrasts with the broadcasting-like structure of the web as it has developed over the years. As a precursor to the Internet, ARPANET was a successful peer-to-peer network where "every participating node could request and serve content". However, ARPANET was not self-organized, and it could not "provide any means for context or content-based routing beyond 'simple' address-based routing." Therefore, Usenet, a distributed messaging system that is often described as an early peer-to-peer architecture, was established. It was developed in 1979 as a system that enforces a decentralized model of control. The basic model is a client–server model from the user or client perspective that offers a self-organizing approach to newsgroup servers. However, news servers communicate with one another as peers to propagate Usenet news articles over the entire group of network servers. The same consideration applies to SMTP email in the sense that the core email-relaying network of mail transfer agents has a peer-to-peer character, while the periphery of Email clients and their direct connections is strictly a client-server relationship. In May 1999, with millions more people on the Internet, Shawn Fanning introduced the music and file-sharing application called Napster. Napster was the beginning of peer-to-peer networks, as we know them today, where "participating users establish a virtual network, entirely independent from the physical network, without having to obey any administrative authorities or restrictions".

Architecture

Routing and resource discovery Peer-to-peer networks generally implement some form of virtual overlay network on top of the physical network topology, where the nodes in the overlay form a subset of the nodes in the physical network. Data is still exchanged directly over the underlying TCP/IP network, but at the application layer peers can communicate with each other directly, via the logical overlay links (each of which corresponds to a path through the underlying physical network). Overlays are used for indexing and peer discovery, and make the P2P system independent from the physical network topology. Based on how the nodes are linked to each other within the overlay network, and how resources are indexed and located, we can classify networks as unstructured or structured (or as a hybrid between the two).

Unstructured networks

Unstructured peer-to-peer networks do not impose a particular structure on the overlay network by design, but rather are formed by nodes that randomly form connections to each other. (Gnutella, Gossip, and Kazaa are examples of unstructured P2P protocols). Because there is no structure globally imposed upon them, unstructured networks are easy to build and allow for localized optimizations to different regions of the overlay. Also, because the role of all peers in the network is the same, unstructured networks are highly robust in the face of high rates of "churn"—that is, when large numbers of peers are frequently joining and leaving the network. However, the primary limitations of unstructured networks also arise from this lack of structure. In particular, when a peer wants to find a desired piece of data in the network, the search query must be flooded through the network to find as many peers as possible that share the data. Flooding causes a very high amount of signaling traffic in the network, uses more CPU/memory (by requiring every peer to process all search queries), and does not ensure that search queries will always be resolved. Furthermore, since there is no correlation between a peer and the content managed by it, there is no guarantee that flooding will find a peer that has the desired data. Popular content is likely to be available at several peers and any peer searching for it is likely to find the same thing. But if a peer is looking for rare data shared by only a few other peers, then it is highly unlikely that the search will be successful.

Structured networks

… excerpt ends here. Continue reading the full article.

Illustrations

Peer-to-peer: A peer-to-peer (P2P) network in which interconnected nodes ("peers") share resources amongst each other without the use of a centralized administrative system
A peer-to-peer (P2P) network in which interconnected nodes ("peers") share resources amongst each other without the use of a centralized administrative system
Peer-to-peer: The opposite of a peer-to-peer network: based on the client–server model
The opposite of a peer-to-peer network: based on the client–server model
Peer-to-peer: SETI@home was established in 1999.
SETI@home was established in 1999.
Peer-to-peer: Overlay network diagram for an unstructured P2P network, illustrating the ad hoc nature of the connections between nodes
Overlay network diagram for an unstructured P2P network, illustrating the ad hoc nature of the connections between nodes
Peer-to-peer: Overlay network diagram for a structured P2P network, using a distributed hash table (DHT) to identify and locate nodes/resources
Overlay network diagram for a structured P2P network, using a distributed hash table (DHT) to identify and locate nodes/resources

Worked examples

Example 1 — a first encounter with Peer-to-peer

Start with the simplest possible case. Write down what Peer-to-peer claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Peer-to-peer before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Peer-to-peer ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Peer-to-peer

In research
Peer-to-peer appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Peer-to-peer in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Peer-to-peer is common in secondary-school and first-year university syllabi. It links to neighbouring topics File sharing, File sharing networks, Peer-to-peer, so understanding it makes those chapters shorter.
In everyday life
Look for Peer-to-peer outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Peer-to-peer” →

How to study Peer-to-peer in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Peer-to-peer means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Peer-to-peer out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Peer-to-peer in simple terms?

Peer-to-peer (P2P) computing or networking is a distributed computing or networking architecture in which participants share part of their own resources, such as processing power, storage, or network capacity. These resources are made directly available to other peers without reliance on intermedia…

Why does Peer-to-peer matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Peer-to-peer?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Peer-to-peer.

Tags

  • File sharing
  • File sharing networks
  • Peer-to-peer
  • Peer-to-peer computing
  • Software engineering terminology

Keep exploring