REAL-TIME INTERACTIVE MECHANISM FOR LIVE STREAMING ON PEER-TO-PEER NETWORKS

: Quality of live video streaming technology is based on quality of Experiences parameters (QoE). Approaching the peer-to-peer (P2P) or peer-assisted networks as a sympathetic solution is highly required, especially in light of its authentic scalability and its extremely low initial cost requirements. However, the design of robust, efficient, and performing P2P streaming systems remains a high challenge when real-time constraints are part of the quality of service (QoS), as in TV distribution or conferencing applications. One of the P2P main issues that affect the quality of streaming is the neighbor selection methodology. The proposed work presents an effective mesh-based neighbor selection approaches for video streaming – Uniform Peer Distribution Algorithm (UPDA) – based on QoS and QoE Parameters. UPDA shortens the latency to be ranging from 10 ms to 50 ms servicing up to 4000 online peers under failure / recovery tests. Simulation results demonstrate that the proposed UPDA achieves good performance in End-to End delay with a percentage of 10.4 % and packet delay variation about 2% compared to random neighbor selection method.


INTRODUCTION
Statistically, the predicted percentages for the total aggregation of all forms of video (TV, video on demand [VoD], Internet video, and Peer-to-Peer [P2P]) will be in the range of 87 to 95 percent of global consumer traffic by 2022 [1]. However, the people who manage OTT (Over-The-Top) services, e.g., Netflix, Amazon, Hulu, YouTube, and Roku failed to adequately stream the World Cup 2018 matches [22].
In a P2P application, each peer receives its demanded content from other peers, and simultaneously shares owned content with others. For file sharing, peers contribute their storage space to allow others to download demanded file conveniently and efficiently, even when the main peer/server source of the file is not available. For streaming media delivery, each peer contributes its effective upload bandwidth to reduce the bandwidth requirement of streaming server, to satisfy the timing constraint of streaming media playback and to increase the system scalability [2,3].
The traditional topology for Multimedia Audio-Video streaming was the client-server networks due to their stability, but some challenges facing the client-server model such as the scalability problem need more CDNs and this increases the cost factor. P2P systems are the counterpart solution that provides more efficient communication due to their scalability, decentralization, and robustness. Every node in the system takes the same role in the network. Every peer can download and upload the downloaded data, so P2P comes to solve the scalability challenge facing client-server model. But, it has a reliability problem due to unexpected leave of any fledged peer from the network at any time. Therefore, not only the constructed topology very dynamic, but no assumptions should be made about the availability of resources or network routes. A P2P system needs to be able to recover from the unexpected and ungraceful leave of any of its members at any time [2,3]. In live streaming applications, the peer selection is one of the most important criteria used to avoid any expected and  [4,17]. Peer selection schemes are categorized into two categories: aware [4][5][6][7][8]20] and non-aware (random) QoS selection techniques [2,10,13,17,18].
The contribution of this paper is to present a new peer-to-peer selection algorithm (Uniform Peer Distribution Algorithm (UPDA)) for live video streaming. UPDA is implemented as a process model in OPNET simulator. The algorithm aims at enhancing the quality of live video streaming based on QoS and QoE parameters.
The paper is organized as follows: Section 2 briefly introduces P2P streaming architectures. Section 3 has a deep survey of neighbor selection algorithms. Section 4 describes a new, efficient peer selection algorithm; Uniform Peer Distribution Algorithm (UPDA) with experimental settings and implementation in Section 5. Section 6 shows the simulation results while section 7 concludes the whole work.

P2P STREAMING ARCHITECTURES
In P2P video streaming a user plays the video while it is downloading. Timing constraints are highly critical to the streaming service, since a packet arriving after its playback deadline is useless [3]. P2P streaming systems are usually classified into P2P live streaming applications and P2P VoD applications [3]. In a P2P live streaming application, a live video should be distributed to all peers in real time. The video playbacks on all peers are synchronized. In other words, all peers watch almost the same position of the same video with a very low latency. An example of P2P live streaming systems is P2P IPTV, which broadcasts the TV contents to all the joining peers. In a P2P VoD system, peers can select any video they want and start to watch it at any time. The playbacks of the same video on different peers are not synchronized. Putting it differently, each peer may watch a different position of the same video. The next section discusses the criteria used for peer selection to avoid any expected and unexpected delays.

NEIGHBOR SELECTION ALGORITHMS
Peer selection schemes are categorized into two types: aware and non-aware QoS selection techniques [4]. This section surveys these categories with their associated selection criteria and with high dynamic applications such as video streaming. Recently developed neighbor selection methods could be classified into two categories: random selection method and QoS aware neighbor selection method as the following [4,17].

THE RANDOM NEIGHBOR SELECTION METHODS (NON-AWARE QOS SELECTION METHODS)
The random neighbor selection methods are also called gossip-based methods that have high flexibility and robustness to peers' churn and load sharing. But on the other hand, such methods ignore the QoS parameters, plagued by bandwidth capacities of the peers as they are inefficiently used and consequently do not suit for constructing the overlay of QoS-sensitive applications (real time applications) in the heterogeneous P2P steaming system. The multimedia quality cannot be guaranteed, since a group of randomly selected peers may not have enough resources to provide the desired multimedia quality [2,10] .
Zhentan Feng [10] proposed a peer selection algorithm based on delay and relative capacity using gossip method, the algorithm is totally in a distributed manner. It partially enhanced the delay issue, but not scalability. Xiaosong Wu [13] enhanced the random selection algorithm using Service Ability of the peer, but peers with low service ability affect badly on the overall system performance, also missing video playback rate used for streaming. J. Ghosha [18] analyzed the peer upload bandwidth factor, but the end to end delay or relative capacity between the peers was not analyzed.

QOS AWARE NEIGHBOR SELECTION METHODS
Some methods consider QoS parameters such as end-to-end delay, playback continuity, utilization and throughput during the streaming process. P2P systems based on this peer selection type are discussed in brief as follows; S. Banerjee [4] adopted the hierarchical clustering heuristic method that minimized the transmission delay. However, tree-based structure is challenging in the face of frequent peer churns. W. Miao [5] presented an altruism model by measuring the packet lost ratio between sent and received packets. The high lost ratio indicates the peer with a low altruism value called by "selfish peer". According to altruism value, the data request message is sent to peers with high altruism, but the analysis of delay is missed . Dongni Ren Y [6] pointed out that aggregating the bandwidth of multiple parents guarantees a certain streaming rate. Mesh-based systems come with the cost of delay, Dongni proposes to use the ratio of potential parent's residual uplink capacity divided by the path delay from source to the new peer. By choosing the parents with large power in a greedy manner, the newcomer acquires an aggregate incoming streaming equal to the streaming rate, whereas achieving very low source-to-peer delay. However, the assumption considered the total uplink bandwidth is larger than the total downstream bandwidth. Also, they assumed that each peer's download capacity is higher than the streaming rate, which means that each peer can receive the full service from their selected parents. It is not suited for high-definition (HD) video, and P2P applications, requiring large download bandwidth (1-5Mbit/s) [7]. N.A. Tuan [8] proposed a quality and contextaware method. Through allowing a peer with higher uplink capacity to replace the one with lower capacity to be a neighbor of another peer with a certain probability, high capacity peers gear to better locations in the overlay, such as closer to the server than low capacity peers so as to maximize the use of high bandwidth capacity and available layers. However, the system's uplink bandwidth resource is higher than the requirements of different peers, which is not fit for a resource constraint scenario. Laura Natali [20] proposed a p2p system in which each peer must represent its local and global indicators reflecting its health status in the overlay. To do this, heavy comparisons made on each peer and maximum number of peers per session is 2000 peers ensued. Tran [21] proposed a hybrid push-pull live P2P video streaming protocol to provide a good quality of service though the dynamic behavior of the network. Kim E. [22] proposed P2P mesh-pull system in which neighbor peers are selected to reduce the average playback lag in a P2P live streaming system. Even peers whose numbers of connectable neighbor peers have already reached the maximum can be selected as neighbor peers of a new peer through connection switching.

UNIFORM PEER DISTRIBUTION ALGORITHM (UPDA)
Usually, students in a class organically fall into a bell curve distribution, with most students achieving an average mark, with a few at either end achieving a very poor or a very good grade. Balancing between different grades dynamically in a uniform distribution of supporting students to lower graded students achieves heterogeneity and co-operability between all the classmates, UPDA categorizes the peers into super peers (astute students) and slow peers (poor students) [9] . Mina N. Abadeer et. al. [9] presented the new developed overlay model on OPNET that utilizes the idea of the peer selection algorithm based on categorization of super peers and slow peers. This paper presents a new algorithm for effective mesh-based neighbor selection for live video streaming to consider the real scalability, stability, and the QoS parameters.
Super peers are those peers with uploading bandwidth higher than the video playback rate. Every peer joins the system compares its uploading bandwidth with the video playback rate; if the uploading bandwidth is larger than the video playback rate then the peer is elected as a super peer . Super peers have an additional uploading bandwidth that can be used to stream the video to slow peers (push video chunks). The relationship between super peers with each other is pushing and pulling video chunks [20].
Slow peers; if the uploading bandwidth is less than the video playback rate, then the peer is a slow peer. Slow peers start searching on available super peers through a tracker to download the video (slow peers can't upload to other peers), pull video chunks only. The number of peers assigned to the super peer is dynamically calculated proportionally to the availability of uploading bandwidth of the super peer. The number of slow peers assigned to any super peer should not exceed four slow peers -relatively calculated-to grantee fast and optimal diffusion of the video streams. From this distribution peers, a uniform graph is constructed to interact with each other. Fig. 1 represents the two overlays when the evaluation process is finished and super peers supporting slow peers.
As it is shown in the Fig.1 super peers have twoway communications, each peer can upload and download for each other. Slow peers can only download from the super peers, each slow peer sends its request message and contact info. (e.g., IP and Port No.) to the tracker then the tracker assigns the slow peer to the most available super peer. Tracker arranges a super peer list based on their available upload bandwidth. The list of super peers is refreshed to discover new super peers to serve the requesting slow peers. There are no interconnections between slow peers with each other because they have no sufficient bandwidth to upload video streams to other peers. The overlay interconnections between super peers and slow peers are unidirectional because of slow peers download only from super peers.
UPDA describes the role of any peer able to join the streaming system. This system assumes the existence of the source peer, any peer wants to obtain the video streams from the source, should start to evaluate itself. The evaluation is to compare the upload bandwidth with the video playback rate. If its upload bandwidth is larger than the video playback rate, then the peer is considered a super peer (can download and upload) and it joins the super peer overlay. In the slow peer's overlay, the peer connects to the most available super peer to obtain video streams then a self-capacity calculation occurred and done by the super peer.

UPDA IMPLEMENTATION
Peers are distributed as a mesh based architecture to emulate the real distribution of peers everywhere in the world. Every peer has the logic process model of UPDA developed in OPNET [9]. UPDA classifies each peer as a slow peer or a super peer. A uniform mesh-based overlay network is constructed. The number of peers with a specific bandwidth in each scenario has the same percentage of different peers according to their bandwidths. The ratios of different peer capacities are listed in Table 1. We conduct a series of scenarios with many parameter variations to validate our proposed UPDA. For example, the number of nodes is ranging from 20 to 4000 nodes to study the scalability (The maximum number of nodes is 4000 nodes due to hardware limitation). The nodes are distributed into scenarios as illustrated in Table 2. Scenarios from 1 to 8 are set to 450 kbps video rate for live streaming using the random selection algorithm and UPDA. The video rate is increased in scenarios from 9 to 19 up to 3500 kbps (HD) with two assumptions: a) codec overhead is 3%; b) chunk duration is about 100 ms resulting in 0.25 bits/pixel. QoS measurements are collected to check how streaming becomes more smooth.

SIMULATION RESULTS
The paper concern is the overlaying network as a real implementation for peer to peer video streaming network and its QoS measurements which are directly related to the quality parameters for the customer are as follows.

END-TO-END DELAY
It is starting from the time in which the packet created at the source node till it arrives at the destination node [11]. The lower the playback delay is the more real-time is the viewing experience of the users. End-to-End delay reduces with the increasing number of peers in the P2P networks [6]. As shown in Fig. 2 Uniform Distribution and Random Selection Algorithms reduce the delay with increasing the number of peers. The end-to-end delay should be below human perceptionabout 100 ms [12]. Random selection delays are ranging from 300 ms to 550 ms and UPDA delays are ranging from 30 ms to 120 ms, this difference comes from the overload imposed from random selection messages, which depend on the Time-to-live (TTL) value causing large delays [10].

PACKET DELAY VARIATION (PDV)
For interactive real-time applications, PDV is a serious issue and hence any transmissions need Quality of Service-enabled networks to provide a high-quality channel. Fig. 3 shows how many peers have a PDV value, for example, about 10 peers have 140 ms of packet delay variation in UPDA and about 60 peers have the same value 140 ms in a random selection. Due to hardware memory limitation only 110 peers are collected for a random selection algorithm and 200 peers for UPDA.  Fig.4 shows CDF of the end-to-end delay decreasing with increasing the number of peers. E2E for 200 peers ranging from 25 ms to 120 ms, for 800 peers ranging from 14 ms to 70 ms, for 2000 peers ranging from14 ms to 80 and for 4000 peers ranging from 10 ms to 50 ms. Based on the previous results of scalability, UPDA covers the gap of delays in IPTV applications which needs a range of concurrent online peers from 3000 to 5000 peers [14,15].

UPLOAD BANDWIDTH UTILIZATION
Utilization is defined as the ratio between the amount of data carried on the link and the link's capacity [11]. Efficient network utilization is essential towards the deployment of peer-to-peer video live streaming services on the Internet. Achieving high bandwidth utilization in peer resources reduces the possibility of bandwidth and content bottleneck. Fig.5 represents the utilization under a different number of peers to determine the scalability effect of UPDA and random distribution algorithm.

THROUGHPUT
Throughput is defined as the number of bits or packets successfully received or transmitted over the link per second [11], High-throughput P2P streaming relies on peer selection. [16]. This work aims at finding practical peer selection solutions for maximum-throughput P2P streaming, any peer goes down, the downloading peer can continue its download from the next one dynamically through the tracker. UPDA achieves High Throughput with high scalability. The throughput goes down in a small percentage compared to a high percentage of increasing downloading peers (in case of slow peers are in the majority comparing with super peers) as shown in Fig.6. With increasing number of super peers, the total upload capacity also increased; which led to increasing throughput. Increasing throughput means the ability of supporting more peers and this is the required target for any P2P system as shown in Fig.7. The failure of some peers during streaming is a critical issue; no one can prevent a peer's user from turning off his computer at any time. Also, many cases may be occurred, such as link failure, or node crash in the network. Whatever the reason of failure, the following results show the effect of failure and recover of some super peers in proposed algorithm and random selection algorithm. Failure and recovery of some super peers do not affect greatly in UPDA compared to its counterpart's random selection algorithms. A drop-in throughput is observed after 2 minutes due to the failure of certain nodes. The throughput dropped to 187 Kbyte for 25 seconds in case of random selection while, throughput losses about 62 Byte for only 1 second in case of UPDA as shown in Fig.8.

NUMBER OF HOPS
The number of hops is better when using UPDA rather than the random selection algorithm. Fig.9 shows the number of hops in UPDA is ranging from 2 to 8 hop counts, but in Random selection algorithm it is ranging from 3 to 10 hop counts. Therefore, the streaming performance of UPDA is better than the performance of the random selection algorithm.

TRAFFIC SENT
These statistics record the amount of control traffic sent on this overlay network [11]. Fig.10 shows the total traffic sent in bytes / seconds in the P2P network consisting of 1000 nodes if there are no any failures of nodes in this streaming session.  Table 3 presents a comparison between UPDA and a recent proposed system (DASH) from different perspectives

CONCLUSION AND FUTURE WORKS
Peer-to-peer communication paradigm has changed the content distributed way over the Internet. Starting from P2P file sharing all the way to P2P telephony systems are fully accredited players of the Internet panorama. Streaming systems, and realtime ones in particular, have been the applications posing the hardest challenges to the P2P paradigm. P2P's inherent scaling properties seem especially well suited to streaming on a large scale. On the other hand, strict timing constraints on smooth streaming and limited latency are required for realtime applications.
We propose a new Uniform Peer Distribution Algorithm "UPDA" to improve the quality of live video streaming in P2P networks. The algorithm is modeled in OPNET simulation tool as a process model that can be used for unstructured mesh-based data-driven scenarios. We compare our UPDA against to the random neighbor selection algorithm. The results show that our UPDA promising efficiency in peer selection compared to random peer distribution in different applications in terms of QoS parameters is as follows: End-to-End Delay enhanced with a percentage of 10.4%, Packet delay varies by about 2%, Upload response time by about 15.8 %, download response time by about 19.6 %, and Hop counts by about 14.5%.
The vision and future focus for this paper is to work on enlarging the system to scale for millions of peers without badly affecting QoS parameters, to get a dynamic relation among super peers for allowing more than four connected slow peers if possible. UPDA should consider many technologies and issues such as security techniques, coexisting of IPv4 and IPv6, and wireless networks.