This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

fybrrStream: A WebRTC based Efficient and Scalable P2P Live Streaming Platform

Debajyoti Halder, Prashant Kumar, Saksham Bhushan, and Anand M. Baswade Dept. of Electrical Engineering and Computer Science
Indian Institute of Technology Bhilai, India
Email: {debajyotih, prashantk, sakshamb, anand}@iitbhilai.ac.in
Abstract

The demand for streaming media and live video conferencing is at peak and expected to grow further, thereby the need for low-cost streaming services with better quality and lower latency is essential. Therefore, in this paper, we propose a novel peer-to-peer (P2P) live streaming platform, called fybrrStream, where a logical mesh and physical tree i.e., hybrid topology-based approach is leveraged for low latency streaming. fybrrStream distributes the load on participating peers in a hierarchical manner by considering their network bandwidth, network latency, and node stability. fybrrStream costs as low as the cost of just hosting a light-weight website and the performance is comparable to the existing state-of-the-art media streaming services. We evaluated and tested the proposed fybrrStream platform with real-field experiments using 50+ users spread across India and results obtained show significant improvements in the live streaming performance over other schemes.

Index Terms:
P2P, Live Streaming, WebRTC, Hybrid Topology, Overlay Network, Performance Evaluation

I Introduction

Live streaming is a powerful and direct way to get connected with thousands of concurrent viewers. No matter if you are using it for your product promotion, giving a motivating speech, or just want to stream the game. It is a tool to circulate information in the form of videos. Users can enjoy the audio and video without waiting for their file to download. According to the report of Business Fortune Insights, the global video streaming market size is expected to grow from USD 342.44 billion in 2019 to USD 842.93 billion by 2027 at a compound annual growth rate of 12%\% [1]. As live is on rise [2], the demand for high-quality and lower latency services is increasing. Thus, efficient, scalable, and economical solutions are required for live video streaming.

Today, for live streaming, media servers are being used for high quality services but at the cost of huge server deployment and maintenance expenditure. Moreover, a server is a single point of failure. Such client-server architecture is equipped to handle a lot of peers but during server failures the service might be affected if proper secondary infrastructure is not maintained. Therefore, Peer to Peer (P2P) architecture is a promising solution and has received a lot of attention. P2P technology converts the streaming consumers into the node, providing them an extra ability to forward the stream. P2P helps to remove the dependency on expensive video servers and also efficiently utilizes the upload bandwidths of the users. As the number of users increases, available resources such as bandwidth, computation power, and storage capacity also increases. So, scalability provided by P2P architecture is the one advantage with which large distributed video streaming applications can be developed in order to serve millions of concurrent users.

Web Real Time Communication (WebRTC) [3] is an evolving open-source framework developed by World Wide Web Consortium (W3C) and Internet Engineering Task Force (IETF) that can be used to build real-time communication applications without installing any plugins. It provides a set of standardized JavaScript APIs for media access (getUserMedia() to access microphone and camera), media transfer (RTCPeerConnection(), and RTCDataChannel() to exchange the audio, video, and data among peers) and enables peer to peer connectivity in browsers and mobile applications. It not only eliminates the dependency of real-time communication over some third-party servers but also provides the flexibility of choosing signaling protocol (e.g., WebSocket, REST, etc.) to the developer [4].

TABLE I: Comparison between Tree, Mesh and Hybrid topology based approach
Existing methods Pros Cons
Tree [5], [6], [7], [8] Low delay Less network overhead Easy implementation Low robustness and resilience during churn Need higher bandwidth for better performance Hard to maintain structure
Mesh [9], [10], [11] High robustness and resilience during churn Unstructured overlay Works well with heterogeneous bandwidth High delay High network overhead (request based streaming) Complicated implementation
Hybrid [12], [13] Churn resilience in mesh regions of topology Low delay and network overhead in the tree regions Works well with heterogeneous bandwidth High network overhead (in the mesh regions) More complicated implementation

Presently, P2P live streaming systems can be broadly divided into three categories, tree-based [5, 6, 7, 8], mesh-based [9, 10, 11], and hybrid-based [12, 13]. However, the mesh and hybrid approaches suffer from the long delay, high network overhead, and complicated implementation. So they are surely not a good choice for live streaming in high load scenarios i.e., with a huge audience. Whereas, state-of-the-art tree-based approaches cannot handle frequent joining and leaving of peers i.e., churn. Therefore, we are proposing a novel hybrid approach (logical mesh and physical tree) which achieves maximum resilience during the churn with low network complicacy, latency, and overhead.
Proposed Approach: This paper presents a hybrid approach with a logical mesh as the base network and a physical tree as the overlay network. All the user nodes are connected to each other to form the logical full mesh. This complete graph of the user nodes ensures maximum network resilience during churn or node failures which the tree-based approaches failed to cater to. The overlay network is a tree of peer-to-peer Real Time Communications (RTC) Media Channels for video and audio stream forwarding. RTC Channels are stream-push based channels for low delay and low latency streaming with low network overhead and easy implementation (this covers the issues in mesh-based approaches). Score based peer assignment enables full utilization of stream forwarding capacity of a node. This considerably decreases the height of the tree and improves end user experience.

Contribution: The contributions of the paper can be summarized as follows:

  • Design and evaluation of fybrrStream, a novel hybrid topology-based P2P approach for live streaming that guarantees low latency streaming and optimal peer capacity utilization with better Quality of Service (QoS).

  • To handle the dynamics of the Internet, peer joining and peer leaving protocols are proposed in fybrrStream.

  • To confirm the advantages and effectiveness of fybrrStream, it is implemented and tested with real-field experiments where 50+ nodes were geographically distributed across India.

  • The code of fybrrStream is released as research resource at https://github.com/RotonEvan/fybrrstream.

We believe fybrrStream will bring down the server costs and will stream videos of high resolution in low latency. The rest of the paper is organised as follows. Related work is discussed in Section II. In Section III and Section IV, the proposed scheme and algorithms are discussed. In Section V, implementation of fybrrStream is presented and the results and key findings are discussed. Finally, Section VI concludes the work.

Refer to caption
Figure 1: WebRTC architecture.
Refer to caption
Figure 2: fybrrStream architecture with logical mesh connectivity for quick recovery and physical tree-based connectivity for streaming.

II Related Works

On the basis of P2P overlay topology, P2P streaming methods are broadly divided into tree and mesh based approaches. In a tree based approach such as in [5] and Spreadit [6], a node is connected to only one parent node and the stream is transmitted level by level. The disadvantage of tree-based approach is when a parent node gets disconnected, the whole subtree connected through that node gets disconnected and the data packets are lost until the subtree finds a new parent node. Also, in this level by level approach, the leaf nodes experience delay and QoS loss and the situation becomes more critical as the size of the tree increases. In the real world scenario, due to heterogeneity of the nodes, all the nodes will not have the same capacity in terms of catering streams to other peers. Some nodes may become bottleneck for better QoS and reduced delay whereas, some nodes may be underutilized. We overcome this by providing a dynamic approach in utilizing the capability of the nodes, with respect to its bandwidth, latency, and stability.

In [7], the nodes are arranged in a Red-Black tree architecture so that the topology remains balanced in case of node insertion and deletion. But, under dynamic peer churn rates, the overall QoS will be highly affected because tree balancing, parent recovery and peer placement algorithms will require more time for computation.

In [12], the nodes form a tree topology according to various schemes and when all the nodes have joined the session, the topology changes from tree to modified mesh as the nodes are rearranged according to their reputation level. But this approach is prone to the dynamicity of the system, as many nodes may leave the session in between voluntarily or involuntarily, some nodes may also join in between. Hence, this type of approach is not viable in case of a dynamic system where the nodes may enter or leave the session involuntarily, without informing the source/controller node.

Another WebRTC modified mesh based approach is given in [14] which proposes the concept of superpeer. In this approach, a superpeer receives stream from the server and forwards it to a cluster consisting of its child nodes. The disadvantage of this approach is that the superpeer node becomes the bottleneck for better QoS and lower delay, the superpeer has to cater to many child nodes which may be slightly less competent.

In other mesh based approaches, such as, [9], Prime [10], and CoolStreaming [11], the node asks for data packets from multiple parents and combines them to decode a stream. Also, a peer can work both as a client as well as a server, a node receives stream from its parents as a client and then forwards the stream to its children behaving as a server, this approach is called Swarming which is also used in BitTorrent [15].

Although tree and mesh topology are intended to minimise the server cost, they have their own pros and cons which would include low robustness and resilience during churn for tree topology and high network overhead for mesh topology. Hybrid approaches such as given in [12], [13] have also been implemented to blend the gaps created by the individual approaches, but the proposed hybrid approaches also have their own issues, such as, the high network overhead of the mesh regions and its complicated implementation. The comparison of Tree, Mesh, and Hybrid topology based approaches is given in Table I.

The few major issues in the previously proposed approaches are when a node is disconnected from its parent node then it also disconnects whole of its subtree from the source node, and the other, in case of mesh based approaches, a node becomes the bottleneck for receiving higher QoS for its child subtree. Therefore, we propose fybrrStream which overcomes the network bottleneck by using a scoring mechanism that places nodes with higher capacity closer to the source node and the capacity of nodes decreases as we move away from the source node along the topology tree. This reduces the probability of a node being the bottleneck for its subtree, drastically. Also, in fybrrStream, when a node is disconnected from its parent then an auxiliary connection is triggered immediately between the neighbouring parent nodes. This is discussed in more detail in the following section.

III Proposed Architecture

TABLE II: Definitions of Terms used
Term Definition
RTP Connection Real-time Transport Protocol Connection between two users for streaming video and audio over IP networks.
Peer/Node/Client A user who is connected to another user through an RTP Connection.
Room A private live streaming web-link on fybrrStream web application.
Score A numerical value calculated when a node joins a fybrrStream room which signifies stream forwarding capability of that node.
Slots/Capability Number of more peers a node can accommodate as a child, i.e., number of peers to forward the stream to.
Auxiliary Connection Temporary RTP Connection between an orphan node and a temporary parent until a new more capable parent is assigned.
Number of Hops The number of times a stream originating from the source node is forwarded through intermediate nodes to reach the destination node.

In this section, we have described the fybrrStream system architecture and all the different components of the architecture.

System architecture: fybrrStream uses WebRTC architecture for peer-to-peer streaming. The WebRTC architecture (see Fig. 2) consists of the following components:

  1. 1.

    Signalling server sets up Real-time Transport Protocol between two nodes (a parent-child relation).

  2. 2.

    Session Traversal Utilities for NAT (STUN) servers retrieve public IP of a node.

  3. 3.

    Traversal Using Relay around NAT (TURN) servers are backups for RTP Connections.

fybrrStream has in background a logical full mesh network and a physical tree network of nodes for communication. The full mesh network is a network of user nodes connected to each other. In case of a node failure, auxiliary connections are created between the affected nodes to ensure uninterrupted streaming. The physical overlay tree network is a tree of nodes connected with RTC Media Channel links. These links are used for peer-to-peer stream forwarding. A score based peer assignment algorithm is followed to ensure full utilization of stream forwarding capability of a node. The peer joining protocol at the signalling server ensures quick joining of nodes, peer leaving and restructuring protocol ensures swift fault detection and network restructuring. Fig. 2 shows the fybrrStream architecture. All the components of the architecture have been explained below in detail. Table II defines all the terms that are used multiple times further in this paper.

III-A Signalling Server

A signalling server is used to establish RTC Connection between peers. Connection establishment includes exchange of SDP (Session Description Protocol) and ICE (Interactive Connectivity Establishment) candidate. If the ICE candidate connects successfully then RTC Connection is setup for stream delivery. The SDP contains the session description of the two peers, with configuration of the media to be sent by the source peer and the response description of the receiver peer.

III-B STUN/TURN servers

To setup RTC Connection, STUN servers are used to retrieve public IP of a device for initialising RTP over User Datagram Protocol (UDP) . WebRTC uses UDP for stream delivery. If the ICE candidate fails to connect due to any possible reason (if a device is behind symmetric Network Address Translation (NAT), or is protected by a firewall which discards UDP data packets), then Traversal Using Relays Around NAT (TURN) servers are used to relay the stream around NAT.

III-C Overlay Network of RTP Connections

When a new RTC Connection is established between an old and a new peer, the new link extends the overlay network which actually is a tree. The predefined rules of peer selection (request-based protocol for parent assignment) protocol says that every node in a level must have at-least 2 children until the level is complete. This makes the worst case complexity for a packet to reach any node from the source 𝒪(logn)\mathcal{O}(\log{}n) for a total of nn nodes in the network.

III-D Fault-proof Architecture

Our proposed architecture is using WebRTC to make connections and transfer stream between the peers. Internet Connectivity Establishment (ICE) service will find the possible candidates to connect to a peer. Although we are proposing a distributed model for live streaming but maintenance of overlay topology is taken care of by a centralised entity i.e., signalling server. New peers will be added to the topology according to their score and available slots as we know that nodes can be heterogeneous in terms of internet connectivity and thus have varying capacity.

Video stream will be pushed from the parent node to their children in this tree overlay topology. In case, children fail to receive the stream (e.g., parent node failure), they utilise auxiliary connections to continue the stream.

III-E Auxiliary Connections

The base full mesh topology is utilised to the fullest to provide seamless stream delivery. When a peer-to-peer RTC Connection in the overlay network is broken, then an auxiliary peer starts sending stream to the orphaned nodes temporarily until the normal overlay is established. The server finds that a node has failed. It then informs every orphaned child so that they can create an auxiliary RTC Connection with an auxiliary peer to minimise the interruption in service.

The auxiliary links are established with the peer that can provide the stream with the least number of hops possible. WebRTC enables the quickest transition between stream sources. The auxiliary peers will be stored for every node such that there is no lag in the transition. Siblings of parent and grandparent will be the preferred for auxiliary nodes. The list of auxiliary nodes will be sorted to get the best auxiliary node. The list is required to be kept prepared with the best node identified.

III-F Summary of proposed architecture

The hybrid approach constitutes of a full mesh based topology and an overlay tree network of RTC Connections. The reason for going with this approach is predominantly to lower the reconnection delay after a network abruption. RTC Media Channels are very fast to establish in WebRTC. During network churns, the links in the full mesh become auxiliary RTC Connections to deliver the stream in case of multiple node failures. WebRTC implementation has optimal bandwidth requirements and has been tested to work under low bandwidth network conditions as well. Our approach has mobility of an unstructured mesh during a churn and also the low latency stream delivery of a push-based stream in a tree topology. The overlay network is created with the best parent-child RTC connections with a global outlook on the current network conditions. No peer is over-populated with children nodes if there already exists another peer with unused capability.

IV fybrrStream Protocols

In this section, we describe the protocols followed during peer assignment, peer joining and peer leaving. Also, special scenarios for peer joining and peer leaving have been given as examples to describe the protocols followed during those circumstances.

IV-A Score based Peer Assignment

Once a source peer has joined the network and it is willing to stream the media, parents will be assigned to new peers on their respective joining as per the suggested Joining Protocol (See Section IV-B for details). The score of a node is calculated after taking uploading bandwidth, video streaming rate, latency, and stability of that node into consideration. Eqn. (1) has been proposed for the calculation of score.

Score(peer)=k1(upload_bandwidthstreaming_rate)+k2(1latency)+k3(active_durationnum_of_failure)Score(peer)\;=\;k_{1}*\Bigg{(}\frac{upload\_bandwidth}{streaming\_rate}\Bigg{)}\\ +k_{2}*\Bigg{(}\frac{1}{latency}\Bigg{)}+k_{3}*\Bigg{(}\frac{active\_duration}{num\_of\_failure}\Bigg{)} (1)

First term in Eqn. (1) represents the serving capacity of a peer or the number of children a particular peer can forward stream to without much impact on its own performance. upload_bandwidthupload\_bandwidth is the upload bandwidth of the node and streaming_ratestreaming\_rate is the rate at which the data packets are being generated, both given in Mbps. Next term depends on the time taken for the stream to reach from source to the peer. latencylatency is the latency observed on the node when establishing the connection and for further data packet transmission. Last term signifies the stability of the peer i.e., the measure of node failures. active_durationactive\_duration is the time duration for which the node has been active and num_of_failurenum\_of\_failure is the number of times the node has failed or lost connection. The second and third term is used to update the score of a peer during the stream. Where, k1k_{1}, k2k_{2}, and k3k_{3} signifies the weights of the terms and values of these constants varies according to applications. The weights sum up to one, i.e., k1+k2+k3=1k_{1}+k_{2}+k_{3}=1.

Also, the peer is assigned slots i.e., the number of children nodes it can handle. The slots are assigned according to the upload bandwidth of the peer. Slots of a peer PP can be calculated using Eqn. (2).

slotsP=upload_bandwidthPstreaming_rateslots_{P}\;=\;\frac{upload\_bandwidth_{P}}{streaming\_rate} (2)
Algorithm 1 Peer Joining Algorithm
1:procedure Peer Joining - Server Side(room,score,slots,peerroom,score,slots,peer)
2:     if room exists then
3:         Add new node into room
4:         if slots(source) >>then
5:              Parent[peer] \leftarrow source
6:         else
7:              minSlotPeer = findMinSlotChildOfSource() \triangleright Find child with lowest number of available slots from the children of source
8:              if slots(minSlotPeer) >> slots(peer) then
9:                  Parent[peer] \leftarrow source
10:                  Parent[minLimitPeer] \leftarrow peer
11:              else
12:                  bestParent \leftarrow findBestParent() \triangleright Find peer with highest score and non-zero available slots
13:                  Parent[peer] \leftarrow bestParent
14:              end if
15:         end if
16:     else
17:         Create a new room
18:         source \leftarrow peer
19:     end if
20:end procedure

IV-B Peer joining protocol

Whenever a new peer wants to join the streaming, score and available slots will be calculated on the client side with the help of the Eqn. (1). It will then send a “JOIN” request to the signalling server. Score and number of available slots will be embedded in this joining request only. Server finds the most suitable peer to be the parent of the new peer based on the score and available slots of the peers that are already present in the network. Newly joined peer can even replace a direct child of source if it has a better score than that node in terms of forwarding capabilities and serving power. Algorithm 1 is the pseudo-code for the Peer Joining Algorithm. The algorithm is explained further with few possible joining scenarios as examples.  
Scenario 1 : New peer joins. Room contains none except Source.

New Peer A has joined the network and has initiated Stream receiving protocol by sending “JOIN” request to signalling server. Server recognises Peer A being the only node in the room except Source and connects Peer A with Source directly. An RTC Peer Connection Channel is setup between Source and Peer A.

Refer to caption
Figure 3: New client node addition to network after Source


Scenario 2 : New peer joins. Source has children with lesser capacity.

Source with two children A and B with capacity 3 and 4, respectively, are present in the room along with respective sub-trees. New Peer C joins the network. C has a capacity of 6. Server finds the child of Source with the minimum capacity lesser than that of Peer C using the function findMinSlotChildOfSource(). In this case server finds Peer A. It makes Peer C the direct child of Source and Peer A child of Peer C. This is done to keep high capacity nodes in the front line of the overlay such that stream delivery has the least latency possible.

Refer to caption
Figure 4: New node replaces old child of source

Scenario 3 (General scenario): New peer joins. Source has children, all with higher capacity than new peer.

Joining request is sent to the signalling server from a peer X with score and slots values. Server checks that the source peer is working at its full capacity and none of its children capacity is less than the new peer. As per our proposed algorithm, signalling server finds the peer with highest score S using the function findBestParent() which is available to server new peers i.e., currently not working at its full capacity and assigns it to new node. Peer X can start receiving streams from the assigned parent.

Refer to caption
Figure 5: New client node addition to network

IV-C Peer leaving protocol

A peer has left the streaming network can be concluded from two ways. Firstly, if the server has received a “LEAVE” request from the peer. Secondly, a heartbeat ping-pong protocol runs on the server at regular intervals. If a server misses a pong message of a peer that would signify a node failure. In both the cases, leaving peer will be replaced by its best child and will then be removed from the network. If leaving peer was a free rider and its parent was the source node, then replace it with the most suitable peer (any node from the grandchildren sub-trees of Source) in the overlay network for efficient utilisation of uploading bandwidth of source and to maintain maximum width tree topology.

Algorithm 2 Peer Leaving Algorithm
1:procedure Peer Leaving-Server Side(peerpeer)
2:     parent \leftarrow Parent[peer]
3:     if length(children[peer]) is 0 then \triangleright Leaving peer was a free rider
4:         if parent is source then
5:              bestPeer \leftarrow findNextBestNode() \triangleright Find a peer with maximum score which is not a current child of source.
6:              Parent[bestPeer] \leftarrow source
7:         end if
8:     else
9:         bestChild \leftarrow getBestChild(peer) \triangleright Find most suitable child of leaving node to replace it
10:         Parent[bestChild] \leftarrow parent
11:     end if
12:end procedure

Till the new parent is assigned to the orphaned children (if any), these children will continue to receive the stream from the auxiliary connections (as explained earlier in Section III-E) to avoid any glitches that might occur because of peer leaving. Algorithm 2 is the pseudo-code for the Peer Leaving Algorithm and has been explained with possible scenarios as examples.  
Scenario 1 : Node with non-zero children fails and leaves. Node A was an intermediate node in the overlay network.

Server will find the child with the maximum score from the set of direct children of the leaving node. Maximum score child will now receive the stream from the parent of leaving node and the rest of the children of leaving node will join the network as per the joining protocol.
Scenario 2 : A leaf node fails or leaves the network. Node was also a direct child of Source.

Leaving node will create a vacancy of a direct child of source. Signalling server will find a peer with the maximum score which is not a current child of source and will put it (keeping subtree of this node intact) directly under the source to fill that vacancy.

Refer to caption
Figure 6: A direct child of Source leaves the network.

IV-D Peer Failure

Signalling server will detect peer failure with the unacknowledged heartbeat pings. Once any failure is detected, node leaving protocol will be executed with only one difference of incriminating node failure count by one every time it fails. Node failure count will have an impact over the stability value of node and so score also changes in the similar fashion. New score will be recalculated and used only when this node again joins the streaming network.

V Performance Evaluation

We tested fybrrStream in a country-wide live streaming session. Total 56 students of Indian Institute of Technology Bhilai, India joined the field test. These students were at their homes and their geographical locations are spread across India as shown in Fig. 7. The farthest geographic distance of a peer from source node was around 1700 km. We live streamed a YouTube video [16] in high-definition 1080p resolution.

Refer to caption
Figure 7: Geographical distribution of peers during fybrrStream field test.
Refer to caption
Figure 8: Upload network bandwidth distribution for users obtained using Ookla or Google Speedtest.
Refer to caption
Figure 9: Plot for number of nodes with respect to the number of slots.
Refer to caption
Figure 10: An instance of topology in case of fybrrStream during the live field test.

V-A Performance Metrics

We designed fybrrStream with main focus on reduced latency, packet loss, and startup delay. Therefore, to evaluate our approach and to assess the impact of our approach on the mentioned parameters, we define performance evaluation metrics as

  • -

    Packet delivery ratio (PDR): It is the ratio of the number of packets received by a node to the maximum number of packets that could have been received.

  • -

    Latency: It is the time difference in receiving the packet by a node after it was uploaded by the source node. Calculated as defined in Section 6.4.1. of RFC 3550 [17].

  • -

    Jitter: It is the variation in inter-arrival time between consecutive data packets. Calculated as defined in Section 6.4.1. of RFC 3550 [17].

  • -

    Startup delay: It is the time taken by a node, after joining the session, to start receiving the stream.

V-B Experimental Setup

Implementation of fybrrStream is hosted on Heroku [18] servers and the same was used for the experiments performed. Performance of proposed approach and algorithms are analysed in a real-life scenario with a field-test. In this field test, around 56 students from our institute participated in the performance evaluation as an individual peer from their home, thus we were able to get such diverse geo-location (as shown in Fig. 7) of the peers. The nodes were heterogeneous in nature with respect to Internet speed and computation power. This was helpful in showcasing a more realistic scenario where the nodes are on different networks, experience different Internet bandwidths and are using different mediums for communication (Ethernet, WiFi, 3G, 4G) with different signal strengths. Both mobile and desktop users were allowed to participate. Institute TURN servers were utilised to relay stream in case direct peer connection was not possible because of firewall or symmetric NAT. Our participants were distributed across the map of India as shown in Fig. 7, out of which few peers shared the same city/town/village. The source node is responsible for creating a room and sharing the stream to other participants in the room. The users joined the room through a web-link which was provided to them prior to the experiment. The source node started the stream after all the users joined the room to maintain consistency in the collected data. As the users were joining the room, fybrrStream was simultaneously constructing the peer topology and measuring the startup delay for each joining node. WebRTC statistics was accessed with the help of getStats() API [19] which returns a WebIDL dictionary [20] containing the values of several monitored metrics at a specific moment in time. During the live stream, we collected data for packet loss, packet received at each node, along with it, jitter and latency is calculated for each leaf node of the constructed overlay tree topology.

Fig. 10 shows the upload network bandwidth distribution of participated users in the field test. The values are in megabits per second obtained through Ookla Speedtest or Google Speedtest. Fig. 10 shows the number of slots assigned to the number of nodes present in the session and from the plot it can be seen that the maximum number of nodes have 2 slots whereas some nodes have 3 and 4 slots. For this experiment, we have restricted the number of slots to 4 due to network and computational limits on the user-end. Fig. 10 shows the overlay network topology formed by the nodes in the fybrrStream scheme. As can be clearly seen in the figure that the source node is connected to 2 nodes, which means the source node has 2 slots which is then followed by the 2 children nodes of the source node, with 4 slots each. It can also be observed that the nodes with higher value of slots are placed nearer to the source node compared to the nodes with lower number of slots. This figure represents one instance of the whole session, as the topology varies slightly with each node joining and leaving mid-session.

V-C Experimental Results

Table III defines the parameters and values considered for the experiment.

TABLE III: Experimental Parameters
Parameter Values
Bandwidth range 5 - 100 Mbps
Slots range [2, 3, 4] slots for [5-15, 15-50, 50-100] Mbps
Number of nodes 57 (including source node)
Stream quality 1080p
Frames per second 20 fps
Browser support Chrome, Firefox
Compression algorithm VP8, VP9 (Chrome)
H.264 (Firefox)
Stream video ”The story of an idea” - Google IO 2017 — Google Developers
Video platform YouTube

The proposed scheme is compared with two other tree-based schemes - ’binary tree’ (2 children nodes per peer) and ’quaternary (quad) tree’ (4 children nodes per peer). The reason behind choosing these schemes to compare with fybrrStream was the similarities between the schemes (binary and quad are tree based, and fybrrStream has a tree overlay network) but the heuristics causing massive differences in the results. Binary tree has been suggested in multiple papers [7], [8]. We also wanted to reduce the height of the tree to decrease latency in the leaf nodes. So we considered a quad tree, in which every peer would have 4 children nodes (regardless of bandwidth constraints), and that would decrease the height of the tree.

Refer to caption
Figure 11: Height of topology tree as the nodes enter in the room.
Refer to caption
Figure 12: Startup delay (s) vs number of nodes in the session.

The height of the topology tree with increasing number of nodes for different schemes is shown in Fig. 12 and can be related through Eqn. (3):

heightquadheightfybrrStreamheightbinaryheight_{quad}\leq height_{fybrrStream}\leq height_{binary} (3)

where heightquadheight_{quad}, heightfybrrStreamheight_{fybrrStream} and heightbinaryheight_{binary} is the height of the topology tree in case of quad tree, fybrrStream and binary tree, respectively. In fybrrStream, peers are assigned the maximum number of children nodes they can support based on their upload bandwidth. For this experiment, we considered to keep a minimum of two slots for every peer as all had an upload bandwidth of around 5 Mbps, so a peer could afford forwarding the stream to atleast 2 peers. Therefore in the worst case an overlay network created will have been the same as that created in the binary tree scheme.

Now, if n1n_{1} nodes have 22 children nodes assigned to them, n2n_{2} nodes have 33, and so on till nin_{i} nodes have i+1i+1 children nodes assigned to them, and

n1+n2+n3++ni=nn_{1}+n_{2}+n_{3}+...+n_{i}=n (4)
heightfybrrStream=log2n1+log3n2+log4n3++logi+1niheight_{fybrrStream}=\log_{2}n_{1}+log_{3}n_{2}+log_{4}n_{3}+...+log_{i+1}n_{i} (5)

Therefore we can say,

log2n1+log3n2+log4n3++logi+1nilog2n\log_{2}n_{1}+\log_{3}n_{2}+\log_{4}n_{3}+...+\log_{i+1}n_{i}\leq\log_{2}n (6)

Hence, height of tree in fybrrStream would always be less than or equal to height of tree in binary. Due to full utilization of stream forwarding capacity of a peer, even for a high number of live stream viewers, the height of the tree in case of fybrrStream will be quite low.

fybrrStream follows the scoring function for each new node and assigns children to the nodes accordingly. This ensures that maximum utilization of node capacity is done. For this experiment, compared to fybrrStream, binary tree topology under-utilizes the capacity by 23.6%23.6\%, whereas quad tree topology over-utilizes the capacity by 52.8%52.8\%. These values can be clearly justified by the fact that node capacity is not fully utilized in case of binary, whereas nodes are over-utilized by forcing 4 children to each node in case of quad tree.

Refer to caption
Refer to caption
Refer to caption
Figure 13: Screenshot during the field testing of the schemes (a) Quad tree (b) Binary tree and (c) fybrrStream.

Fig. 12 shows the plot for startup delay for each node joining the session. The startup delay is defined as the time taken for a node to start receiving the stream data packets from the moment when it joined the room. An average of 1.56 sec startup delay was observed for fybrrStream, which is excellent for such a system. We can also see in the graph that the startup time does not increase with increase in the number of nodes, which shows that the proposed Peer joining algorithm works well and gives stable results for any number of nodes in the system. This startup delay can be considered as a loading time for streaming services and thus we can say that a loading time of 1.5 sec is comparable or even lesser than some of the state-of-the-art streaming services which use dedicated CDN servers. Moreover, fybrrStream performs better than the proposed model in [21] as well as Fast-mesh [22] in terms of the startup delay.

Fig. 13 shows the same frame of streamed video received by one of the leaf nodes in the quad, binary, and fybrrStream overlay topology. It can be seen from the images that fybrrStream provides a better quality stream than the other two schemes.

Refer to caption
Figure 14: Average latency of leaf nodes during the stream.
Refer to caption
Figure 15: Average latency of leaf nodes in boxplot during the stream.
Refer to caption
Figure 16: Average jitter of leaf nodes during the stream.
Refer to caption
Figure 17: Average jitter of leaf nodes in boxplot during the stream.
Refer to caption
Figure 18: Average PDR achieved by the nodes vs time duration from start of the session in seconds.
Refer to caption
Figure 19: Boxplot for average PDR achieved by the nodes for the three schemes.

Fig. 16 shows the plot for average latency at leaf nodes of the overlay network during the stream. As we see, fybrrStream gives a much lower latency than binary as it minimizes the number of hops from source node. However, at some moments, quad tree has lower latency readings than fybrrStream as it has a much lower number of hops in the network which helps to reduce the latency at leaf nodes. In Fig. 16, we can see that the median value of latency for all the nodes in quad tree is lowest followed by fybrrStream which is followed by binary tree. It is also evident that the median value of latency in fybrrStream is lower than minimum value obtained in the case of binary tree which suggests that fybrrStream performs much better than binary tree with respect to latency and quad performs better than fybrrStream. However, quad suffers in average PDR of the nodes (see Fig. 19) which implies if we increase number of children nodes more than what a node can support then there would be more packet loss although the latency might go down due to decrease in number of hops in the overlay tree.

Fig. 16 shows the plot for average jitter at the leaf nodes with respect to the time duration of the session. As can be seen in the plot that the jitter at leaf nodes in case of quad tree is high and also has huge variation through the session whereas for binary tree case the average value is slightly higher than that of fybrrStream, which showcases that fybrrStream has a more stable network topology. Fig. 19 provides a more comprehensive study of the jitter. The median and the range of values for jitter in case of fybrrStream is lower than both of the other two schemes.

Fig. 19 shows the plot for an average PDR at any node in the session. The PDR is defined as the ratio of packets received by a node and the total number of packets transmitted for the node. The total number of packets is equal to the sum of packets received by the node and packet lost by the node. We can see in Fig. 19 that the PDR for binary tree approach is highest, followed closely by the PDR of fybrrStream and then lastly by quad tree approach which is more evident in Fig. 19. It supports the fact that binary tree and fybrrStream are closely related with respect to PDR, whereas quad tree lacks behind by a significant margin, thus it is safe to conclude that fybrrStream provides sufficient PDR for better QoS. The PDR is higher in the case of a binary tree as each node only needs to forward the data packets to two other nodes. However, the height of the binary tree will be larger than fybrrStream and we would receive a higher latency, which can be seen in Fig. 16.

For fybrrStream, we assign the number of slots to a node according to its bandwidth and by this we achieve an equilibrium between latency and PDR. For the quad tree approach, the PDR is much lower, which can be explained by the fact that each node is required to forward the stream to four child nodes. Here, the quad tree approach requires a lot of uplink network bandwidth therefore the parent node is unable to match the PDR of fybrrStream and binary tree approaches.

TABLE IV: Mean values of various performance metrics for each scheme.
Scheme Latency (ms) Jitter (ms) PDR
fybrrStream 11 15 0.99986
Binary tree 18 24 0.99999
Quad tree 4 46 0.99923

Table IV lists the mean values of latency, jitter and PDR for all the three schemes. As can be seen in terms of latency, the binary tree has 64% higher latency and the quad tree has 64% lower latency than fybrrStream. Binary tree shows 60% higher jitter than fybrrStream whereas quad tree shows 207% higher jitter. In terms of PDR, binary performs 0.013% better than fybrrStream and quad performs 0.063% worse than fybrrStream.

By this real-time field test experimentation, we tried to cover all the major factors which affect the quality of service for a user streaming through a peer-to-peer streaming service. fybrrStream worked efficiently to utilize the maximum capacity of each user node. PDR and latency plots show how the subtle choices made by the algorithm for assigning parents affect the final results whereas the comparison with the other two schemes suggests the importance of utilizing the capacity of a node efficiently.

VI Conclusions

The current P2P streaming platforms have shortcomings such as network complicacy in mesh, reconstruction in tree-based approaches, poor load sharing due to the heterogeneity of devices, etc., that need to be resolved for a better streaming experience. Therefore, in this paper, we proposed fybrrStream, a novel hybrid approach in which stream is pushed in tree topology and logical mesh structure is utilized for auxiliary stream forwarding. It is a WebRTC based live streaming technology that optimally distributes the load of the whole network on the participating peers using a scoring function. The score decides the hierarchy of that peer in the overlay tree network. A quick-reconstruction algorithm is also suggested in case any parent node fails. The performance of proposed algorithms were evaluated in real-time with a field test consisting of 50+ users spread across India and results obtained showed significant improvements in the live streaming performance over binary and quad tree schemes.

Acknowledgement

The authors thank students of 2020 batch and Infrastructure Services (ITIS) department of Indian Institute of Technology Bhilai for their contribution in the field test.

References

  • [1] “Video streaming market size, share & industry analysis,” 06 2020, [Online].
  • [2] W. Richmond, “The future of live streaming,” 01 2019, [Online].
  • [3] J.-I. B. Cullen Jennings, Henrik Boström, “Webrtc 1.0: Real-time communication between browsers,” 01 2021, [Online].
  • [4] F. G. Boni García, Micael Gallego and A. Bertolino, “Understanding and estimating quality of experience in webrtc applications,” 10 2018.
  • [5] H. Deshpande, M. Bawa, and H. Garcia-molina, “Streaming live media over a peer-to-peer network,” 01 2002.
  • [6] T. T. T. Ha, Y. Won, and J. Kim, “Topology and architecture design for peer to peer video live streaming system on mobile broadcasting social media,” in International Conference on Information Science Applications (ICISA), 2014, pp. 1–4.
  • [7] P. K. Hoong, O. Y. Shyang, and I. K. T. Tan, “Red-black tree architecture for p2p media streaming,” in 2013 IEEE International Conference of IEEE Region 10 (TENCON 2013), 2013, pp. 1–4.
  • [8] R. Sodhi, G. Kumar, and C. Kumar, “Peer-to-peer distributed video streaming system using binary tree topology,” International Journal of Electronics Engineering, vol. 11, no. 1, pp. 565–570, 2019.
  • [9] N. Bhagatkar, K. Dolas, and R. K. Ghosh, “An integrated p2p framework for e-learning,” 2019.
  • [10] T. Moscibroda, R. Rejaie, and N. Magharei, “Prime: Peer-to-peer receiver-driven mesh-based streaming,” in IEEE International Conference on Computer Communications (INFOCOM), 2007, pp. 1415–1423.
  • [11] Xinyan Zhang, Jiangchuan Liu, Bo Li, and Y. . P. Yum, “Coolstreaming/donet: a data-driven overlay network for peer-to-peer live media streaming,” in Annual Joint Conference of the IEEE Computer and Communications Societies., vol. 3, 2005, pp. 2102–2111 vol. 3.
  • [12] B. U. Maheswari and T. K. Ramesh, “An improved delay-resistant and reliable hybrid overlay for peer-to-peer video streaming in wired and wireless networks,” IEEE Access, vol. 6, pp. 56 539–56 550, 2018.
  • [13] H. Deng and J. Xu, “Corepeer: A p2p mechanism for hybrid cdn-p2p architecture,” in Web-Age Information Management, Y. Gao, K. Shim, Z. Ding, P. Jin, Z. Ren, Y. Xiao, A. Liu, and S. Qiao, Eds.   Berlin, Heidelberg: Springer Berlin Heidelberg, 2013, pp. 278–286.
  • [14] A. El Hamzaoui, H. Bensaid, and A. En-Nouaary, “A new signaling topology for multiparty web real-time video conference networks,” in Proceedings of the 12th International Conference on Intelligent Systems: Theories and Applications, ser. SITA’18.   New York, NY, USA: Association for Computing Machinery, 2018. [Online]. Available: https://doi.org/10.1145/3289402.3289517
  • [15] B. Cohen, “Incentives build robustness in bittorrent,” Workshop on Economics of PeertoPeer systems, vol. 6, 06 2003.
  • [16] G. Developers. The story of an idea - google i/o 2017. Youtube.
  • [17] H. Schulzrinne, S. Casner, R. Frederick, and V. Jacobson, “Rtp: A transport protocol for real-time applications,” Internet Requests for Comments, RFC Editor, RFC 3550, 07 2003. [Online]. Available: https://www.rfc-editor.org/rfc/rfc3550.txt
  • [18] “Heroku,” https://www.heroku.com/, [Online].
  • [19] H. B. Harald Alvestrand, Varun Singh, “Identifiers for webrtc’s statistics api,” 01 2021, [Online].
  • [20] T. G. Edgar Chen, “Identifiers for webrtc’s statistics api,” 02 2021, [Online].
  • [21] S. Budhkar and V. Tamarapalli, “Two-tier peer selection strategy to minimize delay in p2p live streaming systems,” in Twenty Second National Conference on Communication (NCC), 2016, pp. 1–6.
  • [22] D. Ren, Y. H. Li, and S. . G. Chan, “Fast-mesh: A low-delay high-bandwidth mesh for peer-to-peer live streaming,” IEEE Transactions on Multimedia, vol. 11, no. 8, pp. 1446–1456, 2009.