How Does Peer-to-Peer (P2P) File Sharing Work?
How peer-to-peer networks let computers share files directly, with BitTorrent as an example, plus legal uses and risks.
TL;DR
- In a peer-to-peer (P2P) network, ordinary computers called peers share resources such as files directly with each other, and each peer both asks for and provides data.
- With BitTorrent, a file is cut into pieces and downloaded from many peers at once, so no single server has to supply everyone.
- P2P has many legal uses, such as distributing open-source software, but sharing copyrighted material without permission can be infringement.
- Peers can be exposed to bad files and attacks, so treat downloads with caution.
What peer-to-peer is #
P2P is a way of building a network where participants contribute resources such as storage, processing power or network capacity. Peers are both providers and requesters, and they share resources directly without a middle layer [1]. Compare this with the usual web, where a server provides and your browser only asks [4].
A neighbourhood book swap is a fair analogy. Instead of everyone borrowing from one library, each person lends out books from their own shelf and borrows from others. The more people take part, the more books and the more ways to get one.
Many P2P systems build a virtual layer, an overlay, on top of the normal internet that handles finding other peers. Some are unstructured, where peers connect more or less randomly. Others are structured, using a lookup scheme such as a distributed hash table so even rare items can be found efficiently. Hybrids add a central helper that only introduces peers to each other [1].
How BitTorrent works #
BitTorrent is the best-known P2P file sharing protocol. Its specification describes the idea simply: downloaders upload pieces to one another, so the original source does not have to serve every copy [2].
- **A small
.torrentfile describes the download.** It holds the file name, the size of each piece, a fingerprint (hash) for every piece, and the address of a tracker [2]. - A tracker introduces peers. Your client tells the tracker what it wants and gets back a list of other peers on the same download [2].
- Pieces arrive from many peers at once. The file is split into fixed-size pieces, which clients usually fetch in random order [2].
- Each piece is checked. A piece that does not match its fingerprint is thrown away and downloaded again, so corrupted data does not slip through [2].
- You share while you download. Peers tell each other which pieces they have, and a peer that holds every piece is effectively a seed [2].
To keep things fair, clients limit uploads and favour peers who give them good speeds in return [2]. Without a reward like this, "freeloaders" who only take can harm a network [1].
Legal uses, and a note on copyright #
P2P is a technology, and it has many lawful uses: distributing Linux distributions and games, sharing between universities, software updates, and file synchronisation [1]. A US Supreme Court opinion on file-sharing software also acknowledged lawful uses, such as sharing public-domain works [3].
Copyright is a different question. In that same case, the Court held that someone who distributes a tool with the aim of promoting infringement can be held liable for the resulting infringement, while mere knowledge that a tool might be misused was not enough [3]. This page is general information, not legal advice. If you are unsure whether you may share or download something, check the rights holder's terms and your local law.
Risks to know #
- Malicious or corrupted files. Peers can be exposed to attacks, and some networks have been reported to carry a lot of malware [1].
- Your address is visible. Peers you connect to can see your IP address, because peers connect to one another directly [2].
- Unpopular files fade. If few peers keep sharing a file, it can become hard to get [1].
- Heavy bandwidth use. Some internet providers slow down P2P traffic [1].
FAQ #
Is peer-to-peer legal? #
The technology is legal, and many projects use it for legitimate distribution [1][3]. Whether a particular download or upload is legal depends on the content and your local law.
What is a seed and a peer? #
A peer is any computer taking part. A seed is a peer that already has the whole file and keeps sharing it [2].
What is a tracker? #
It is a server that keeps track of who is taking part in a download and gives peers each other's contact details. It does not hold the file [2].
Is P2P faster than a normal download? #
It can be, because pieces come from several sources at once, and capacity can grow as more users join [1]. Speed still depends on how many peers are sharing and how fast they are.
Sources #
All sources accessed 2026-10-27.
- Peer-to-peer. Wikipedia. https://en.wikipedia.org/wiki/Peer-to-peer
- BEP 3: The BitTorrent Protocol Specification. BitTorrent.org. https://www.bittorrent.org/beps/bep_0003.html
- MGM Studios, Inc. v. Grokster, Ltd. (04-480). US Supreme Court, Legal Information Institute, Cornell Law School. https://www.law.cornell.edu/supct/html/04-480.ZO.html
- Client-server model. Wikipedia. https://en.wikipedia.org/wiki/Client%E2%80%93server_model