How Peerplug accelerates

February 12, 2020


This document explains how Peerplug achieves acceleration and offloads traffic from the origin servers using peer-to-peer channels.

For gurus: Peerplug is a branch predictor for http requests. Instead of speculatively executing it peer-to-peer downloads.


It is recommended to first read How Peerplug works document to understand how Peerplug manipulates HTTP requests of the host app.

It is recommended for the reader to be familiar with the following concepts:

let’s tal

Traffic patterns

Peerplug AI uses “traffic patterns” to define traffic usage and predict what the host application is going to download in the future. Predicting a correct pattern is a key to successfully accelerating host application networking.

Let’s first explain what traffic patterns is by tanking a browser and a simple website with 2 pages and some images on each page. We will only focus on the images and not on the text itself as images take much more network traffic than text. We will assume that Peerplug “host” application is a browser.


The first page contains 3 pictures, “Logo”, “Enter button” and “Leave button”. We will assume that 99% of people, click “Enter” and enter the second page:

The second page has 3 pictures, “Picture 1”, “Picture 2” and “Picture 3”.

Here is our traffic pattern.

if (downloaded(logo, enter, leave))
    WillDownload(Picture1, Picture2, Picture3, Probability = 99%)

As more and more people with Peerplug enabled browser enter the website, Peerplug AI builds and updates this traffic pattern.

Once a new person with Peerplug enabled browser enters the website, Peerplug will identify the traffic pattern when the first page loads.

As the probability of a person clicking “enter” is 99%. Peerplug will use peer-to-peer to predownload pictures 1, 2 and 3 as it is highly likely that this is what Person is going to be downloading soon. Like a CPU branch predictor, instead of speculatively executing it speculatively peer-to-peer downloads.

When the person clicks “enter” the page loads instantly as the pictures are already in Peerplug cache and there is no need to do the actual network heavy-lifting – it was done ahead-of-time by Peerplug.

More over, as the peer-to-peer connection is established early, there are high chances that other resources can be peer-to-peer downloaded even faster as both users (peers) are actually visiting the same web site and are likely to see similar content.


Peerplug for Video Streaming Acceleration

Video streaming acceleration is a major part of Peerplug. According to Cisco, video is responsible for 82% of all Internet traffic in 2020.

As explained earlier, Peerplug requires identifying a traffic pattern in order to accelerate but with common video formats, it’s right there in the manifest!

For example, let’s see how Apple HLS video pattern looks like.

At the beginning, player downloads the “manifest.m3u8” containing the video segment list:


Peerplug has special handling for this, it will parse the segments list and identify the video resource urls.
After parsing the manifest, player starts downloading the segments sequentially to display the video. Therefore, Peerplug will detect requests for:


Peerplug can even predict the exact interval when the requests arrive (from the segment length). The traffic pattern is simple:

if (downloaded_segment(i))

Therefore, Peerplug can peer-to-peer download segments ahead-of-time similar to speculative execution technique. Instead of speculatively executing it speculatively peer-to-peer downloads.

As explained in the How Peerplug works document, host application player will not notice that the segments are peer-to-peer downloaded instead of being downloaded from the server.


Using “traffic patterns” allows Peerplug to peer-to-peer accelerate any http static content requests. Special handling for video streaming formats improves the acceleration for video oriented usage even more.

Peerplug acceleration reaches 95%(95% goes p2p, 5% comes from the real service) when there are many “peers” watching the same video. This ensures stability and sustainability required for any OTT service.