Client-Server and Peer-to-Peer

How does peer-to-peer networking work?

Learn how peer-to-peer networking works: computers connect directly, share files and printers without a central server, and take turns as client and server.

On this page
  1. How computers find each other
  2. What happens when one peer asks another
  3. Peer-to-peer on the internet
  4. Limits to know
  5. When it is a good fit

In peer-to-peer networking, each computer connects directly to the others and acts as both a client and a server. It can ask other computers for a file or a printer, and it can offer its own files and printers to them. No central server sits in the middle to hold the data or manage access.

How computers find each other

Devices on an IP network each have an address, and traffic is directed to that address. On a small home or office network, the computers usually sit on the same network segment and reach one another through a switch or a wireless router.

Windows computers also need a few settings in place before they can see one another. Network discovery and file sharing must be turned on, and computers are often placed in the same workgroup so they appear together in the network view. For how that address works, see the unique identification number of a computer on a network.

What happens when one peer asks another

Say a laptop wants a file that is stored on a desktop. The laptop sends a request to the desktop’s address. If the desktop has shared that folder and the request is allowed, it sends the file back. The data moves directly between the two machines, although it still travels over the same network equipment as everything else.

For that one request, the desktop is acting as the server and the laptop is the client. If the desktop later asks the laptop for a file, the roles reverse. Each computer can take either role at any time.

Peer-to-peer on the internet

The same idea is used on the internet. BitTorrent is a well-known example, in which many users share pieces of a file directly with one another. Systems like this need some way to help peers find each other, which is a different problem from sharing files on a home or office network. They also raise their own questions about what is shared and who receives it.

Limits to know

  • A peer is only available while its computer is on and connected. If the owner shuts it down, the files on it disappear from the network.
  • Each owner usually sets their own permissions, so access rules can be inconsistent.
  • Requests land on each person’s computer, so an older machine that serves many requests can slow down for its owner.
  • Backups depend on each owner, and files may end up in several places.

When it is a good fit

Peer-to-peer networking suits a small group of people who trust one another and want to share a printer or some files without setting up a server. As the group grows, central management usually works better. For a fuller comparison of the two designs, see the server based network and peer-to-peer network overview.

The complete guide to client-server and peer-to-peer

Server-Based Network vs Peer-to-Peer Network
Read the guide

Keep exploring

Guides from other topics

All topics →