What is P2P?

Three people with laptops around a table
(Image credit: Unsplash / Brooke Cagle)

In the context of networking, peer-to-peer (P2P) is a way in which devices can communicate with each other on equal terms.

It helps to understand this by comparing P2P to traditional downloads. When you visit a website on your computer to download train timetables, for example, your device (the client), is requesting information from the train operator’s computers (the server). This is known as the “client-server” model. The information is requested by the client, then sent by the server.

P2P works differently. Every device or ‘node’ can both send and receive data. Effectively, this means that each node is both a server and a client. This is usually done with special software and has many uses : for instance IRC (Internet Relay Chat) is an example of P2P in that anyone using the right software can send and receive messages from anyone else who’s connected to the network.

In a P2P network, devices connect to each other to share resources. This is very useful for operations like downloading files, as users can download fragments of the file from every other connected device in the network that already has the file rather than wait for it to be sent by a central server. And it’s usually much faster.

Some of the first early popular P2P file-sharing programs were Napster and GNUtella. Users could download the client from a website then connect to other “peers” to download files to their machine: unfortunately this gave the P2P protocol a bad name, as users often used the clients to upload and download copyrighted content like music.

Why use P2P? 

Given its association with illegal file-sharing, you may wonder why anyone would make use of P2P.

The main reason is that it’s far less costly and more reliable to share data via a P2P network than for everyone to download the same information from a central server, which must be online at all times and able to handle the connections.

Setting up a server to share information also requires considerable expertise and money, though for small scale projects you may be able to use a VPS provider.

In order to start sharing data via P2P, generally all you need to do is install the relevant software program on your device.

The fact that P2P doesn’t have to rely on a central server means there’s no single point of failure, so generally if one device fails, the network won’t shut down. One exception to this was Napster, which used a single server to manage connections between nodes. This meant that when Napster shut down its server in 2001 in compliance with a court order, the whole network went offline.

P2P pitfalls 

In the nature of things P2P networks involve every device being connected to every other. This can cause security concerns as other devices can see your IP address. As there’s no centralized network operating system or tech support team monitoring and organizing data it’s down to you to find what you need and check it for malware before downloading to your device. This also applies to P2P programs, as bad actors will sometimes conceal malware and adware inside them. 

As each node in a P2P network is usually a computer owned by an individual, people connect and disconnect all the time, meaning it's difficult to keep the network stable. As more nodes connect, it also takes more resources to search for the information you need. 

Some P2P protocols like Gnutella use various methods to get round this such as designating some more established nodes as ‘ultra peers’ to route search requests and responses. While this doesn’t technically follow the flat model of P2P, it does mean the protocol is decentralized and so clients using it can’t be shut down by taking a server offline as happened with Napster.

If your bandwidth is metred, you may need to think carefully before using P2P networks as some clients require you to both download and upload data at the same time. In the case of larger files, this can rack up some pretty hefty internet charges, so make sure that you check the client requirements before downloading.

Staying on the level 

If you’ve decided you want to access a P2P network, you can take some simple precautions to stay safe. 

In the first place, make sure that the torrent client you’re using is from a reputable source.

Make sure that you also have a reliable firewall installed, so that even if a hacker discovers your IP address your device is safe.

Another way to  stay safe is to consider using a virtual private network, known as a VPN when connected to a P2P network. VPNs - including free VPNs and the best VPNs for torrenting - create an encrypted tunnel through which data is sent. This not only hides your IP address but makes it almost impossible for anyone monitoring your connection to detect you’re using a P2P network.

There are VPN’s specifically designed for use with P2P but generally any provider can give you this level of protection, though some place limits on how much data you can download/upload. 

Whichever VPN provider you choose, make sure that they have an effective kill switch. This means that if your connection to the VPN fails for any reason, your device won’t switch back to its previous unsecure connection, but simply block all internet access instead. 

Peer-to-peer in review 

Properly used, a P2P network can help you access shared resources like files in a much faster and more efficient way than regular downloads. While you remain responsible for making sure you do so in a safe and legal way, the benefits clearly outweigh the downsides.

Take some time to research the right client for you and make sure to keep your device and connection safe from snoopers through using a firewall and VPN. 

Nate Drake is a tech journalist specializing in cybersecurity and retro tech. He broke out from his cubicle at Apple 6 years ago and now spends his days sipping Earl Grey tea & writing elegant copy.