A Beginners Guide to P2P CDNs

A P2P CDN, contrary to a regular CDN does not use traditional servers and datacentres to distribute content. They instead leverage users on their platform for the distribution of content. P2P CDNs use WebRTC to connect the users without the need for a plugin to be installed on the user’s device. This makes things easier to use, to manage for the P2P CDNs, and ensures the most number of peers are connected at any given time.

How Does a P2P CDN work, and what are the differences with a normal CDN?

A P2P CDN, contrary to a regular CDN does not use traditional servers and datacentres to distribute content. They instead leverage users on their platform for the distribution of content. P2P CDNs use WebRTC to connect the users without the need for a plugin to be installed on the user’s device. This makes things easier to use, to manage for the P2P CDNs, and ensures the most number of peers are connected at any given time.

User data is collected by the CDNs which they use to optimize their peer network, making sure that there is as little latency as possible. The peers are sorted in groups called a “mesh”, based on the content they consume. This way they can connect the right peers to deliver the content.

How the data itself is transferred from peer to peer is basically as follows. Video content is generally split up into smaller chunks. Once the first user requests a piece of content, that user retrieves the content from the original server. However, when another user tries to request the same piece of content it will instead check if there is a peer available to deliver the content instead. If so, it will source the content from the peer instead without connecting to the original server.

So, the major differences between a regular CDN and a P2P CDN is the source they distribute the content from. As well as P2P CDNs barely needing traditional infrastructure to function, since the resources they use are the PCs of the users.

What Is P2P

P2P or Peer-to-Peer systems are networks of PCs that directly communicate with each other, without requiring a centrally coordinated server or host. The peers within the network contribute processing power and/or bandwidth to help the rest of the network to function. Peers can send data back and forth without the need for it to be uploaded, or downloaded over a server.

P2P networks have been around since the beginning of the internet, and are used for easy sharing of files and data. This is also how the creator of the World Wide Web envisioned it working, a network of computers all sharing information with each other.

For the use in CDNs the P2P consist out of a structured network. This way, peers are grouped based on multiple aspects like the content they consume, the geographic location of the peers, or the ISPs that are being used.

What is WEbRTC?

WebRTC is a protocol used for real-time communications between web browsers. The current supported browsers for this are: Chrome, Firefox and Opera. Additionally, both Android and iOS support WebRTC.

WebRTC can be used to set up a peer-to-peer connection using the browsers, without needing additional plug-ins or programs. This is because WebRTC is a standard application embedded in the browsers that have chosen to adopt it. This makes it easy to implement for P2P CDNs and other software companies. Also, it can be trusted to be installed on the user’s device if they use one of the major browsers.

When to use which?

A CDN network is useful for fast, long-distance distribution of content, and large amounts of traffic. However, spikes in user traffic can still lead latency issues and affect the user experience. This might especially be the case for large livestreaming events with huge audiences.

Compared to a regular CDN, a P2P CDN has some more specific use cases, and specializes in other areas. One of the weaknesses of a P2P system is that they only redirect traffic, and don’t distribute from the source. Another weakness/strength being, a peer-to-peer system starts working better the more users are connected at the same time. If there are not enough peers, the traffic that is redirected through a peer and its usefulness is minimal. While if there are a lot of peers, it can distribute almost all the content from peers.

Additionally, if there are enough peers connected, a disruption at the server will not affect the users as much. Thanks to the gaps being filled by other peers, the risk of server failure causing stream issues is limited. A P2P CDN thrives in live content with larger audiences, or heavily localized content. This ensures the quality and availability of peers

However, due to this reliance on peers, and the standard fall-back to the server, a P2P CDN should not be used as the only method of content distribution. Both types of CDN should complement each other. The CDN can be used for regular content distribution while a P2P CDN can ease the load on the servers by connecting peers and redirecting traffic between them. This way users get the best experience, with the least amount of latency, and a more stable stream.

Listed P2P CDNs

If you are interested in P2P CDNs, you can find them listed together with the regular CDNs. Below we have listed a couple of them to get you started:

Peer5

Viblast

StreamRoot

Teleport