Live video streaming is one of the newly emerged services over the Internet that has attracted immense interest of the service providers. Since Internet was not designed for such services during its inception, such a service poses some serious challenges including cost and scalability. Peer-to-Peer (P2P) Internet Protocol Television (IPTV) is an application-level distributed paradigm to offer live video contents. In terms of ease of deployment, it has emerged as a serious alternative to client server, Content Delivery Network (CDN) and IP multicast solutions. Nevertheless, P2P approach has struggled to provide the desired streaming quality due to a number of issues. Stability of peers in a network is one of the major issues among these. Most of the existing approaches address this issue through older-stable principle. This paper first extensively investigates the older-stable principle to observe its validity in different scenarios. It is observed that the older-stable principle does not hold in several of them. Then, it utilizes machine learning approach to predict the stability of peers. This work evaluates the accuracy of several machine learning algorithms over the prediction of stability, where the Gradient Boosting Regressor (GBR) out-performs other algorithms. Finally, this work presents a proof-of-concept simulation to compare the effectiveness of older-stable rule and machine learning-based predictions for the stabilization of the overlay. The results indicate that machine learning-based stability estimation significantly improves the system.

Live video streaming is a challenging service because it has stringent playback deadlines. Centralized client/server, IP multicast and peer-to-peer (P2P) are major architectures that enable video streaming service. Client/server is a classical approach which allows clients to generate video requests to servers and servers are able to respond to these requests. One major issue of these systems is scalability which requires to enhance the resources at server side to accommodate a surge in user requests, resulting in increased cost. A similar model named as CDN [

P2P approach for live streaming has its own issues. One of the major issues of these systems is their reliance on intermittently available nodes which turn the whole system unstable. Numerous approaches have been proposed to overcome this issue, resulting into several systems which can be classified into multiple categories. Such approaches either focus on resilient designs or consider the peer's stability for improvements. The former approach focuses on the overlay network structure and content dissemination strategies which too without stability are not enough as the management overhead is increased as well as the delay.

Concerning stability of peers in existing approaches, it is mostly determined through statistical observation which considers a node to be stable if it is present in the network since long [

Stability of peers can also be predicted through machine learning approach; however, we find very few such efforts in the literature. Therefore, this study also considers machine learning approach for the prediction of stability. To extensively evaluate the accuracy of machine learning algorithms, this work trains and tests several machine learning models. The results show that Gradient Boosting Regressor performs better than other algorithms. Furthermore, to get a comparison of older-stable principle and machine learning based predictions, this work presents a proof-of-concept simulation, and the results indicate that incorporating machine learning-based predictions can significantly improve the performance.

Since P2P networks are networks of users, stability of peers plays a crucial role in the performance of these system. Knowing about stable peers, enables to construct a stream delivery structure in order to improve quality of streaming and provide better user experience. Several types of P2P IPTV overlays exist which can greatly benefit from an accurate estimation of stability. Therefore, this work provides a base line for machine learning based intelligent P2P IPTV overlays.

The contribution highlights of this work are:

Analysis of older-stable principle through finding correlation between elapsed time and remaining time of a session in different scenarios,

Assessment of several machine learning algorithms for the prediction of stability and

Simulation to analyze the effectiveness of machine learning-based stability estimation in a tree-based system.

In the rest of the article, we discuss related work in Section 2. Discussion on analysis of older-stable principle through estimation of correlation and obtained results are presented in Section 3. Section 4 evaluates the efficiency of machine learning algorithms for the prediction of stability. Simulations to compare integration of older-stable principle and machine learning based predictions into a tree-based overlay are given in Section 5. Finally, Sections 6 and 7 present conclusion and future work.

Tang et al. [

Tian et al. [

On the other hand, prediction of user's current session is proposed in [

Most of the existing works utilize older-stable principle which considers a peer's age as stability indicator. Furthermore, very few approaches use machine learning to determine the stability which too, do not explore potentially efficient and accurate algorithms. Therefore, this work first extensively evaluates the older-stable principle and then assesses several machine learning algorithms for their accuracy which have not been studied before for this problem.

To analyze the older stable mechanism, real traces of user activities are required. This study utilizes IPTV traces from Lancaster University [

Data contain start and stop time of a channel by a user which represent join and departure time. This information can be used to prepare the dataset based on elapsed and remaining time of user where the whole session time is split in one-minute intervals. This provides the data to analyze the correlation between elapsed and remaining time of a user over each minute. An initial analysis of the traces revealed that these traces either contained a large portion of very short sessions or very long sessions spreading over multiple days. Therefore, it is crucial to also analyze the impact of these extreme sessions on overall correlation. To do so, this work calculates the correlation on the whole dataset as well as it separates such sessions from others and analyze them separately. Next, a discussion of different groups of sub-datasets is presented which are separated for analysis.

Users exhibit different behaviors while watching programs. A user is considered to be in surfing mode when he/she is browsing channels and switches channels quickly. In this mode, user checks the current programs of different channels to choose one for watching. Usually, in this mode, a user may hold a channel till to two minutes [

A user in viewing mode actually watches the channel and is interested in the content being transmitted. Sessions whose durations remain between the limits of surfing users and idle users are considered in the viewing mode [

The presence of very long sessions (days) in dataset demonstrates a very strange phenomenon from which we conclude that these sessions might have resulted from the fact that the television set remained on while the user was not actually watching the channel. Therefore, this study analyzes these sessions separately to understand their correlation. In this work, sessions longer than 4 h are considered to be of an idle user.

This study calculates the Pearson coefficient of correlation as given in

This sub-section presents the analysis of older-stable principle through finding correlation between elapsed time and remaining time for different behavior groups, as discussed earlier. In addition to existing works, this work studies the impact of daytime on the correlation as well as the impact of each group on the rest of the traces. The Pearson coefficient of correlation, r = 0.71, at p = 0.05 that is statistically significant positive correlation between elapsed time and remaining time for all the traces, ascertaining previous results as presented in [

Here, the correlation remains strong for most part of the day however, it remains quite low during early hours of the day. This shows a little deviation from the existing work when sessions are split in different times. Concerning the analysis of traces from different user groups, traces belonging to surfing behavior show a correlation coefficient of r = 0.07 at p = 0.05 which means that elapsed time has no significant correlation with remaining time. Furthermore, concerning the hourly values, the figure shows again that no significant correlation is found at any hour of the day for surfing behavior.

The value of correlation for viewing users is r = 0.08 at p = 0.05 which is similar to the surfing group. Furthermore, hourly results do not show any strong correlation. On the other hand, the correlation of traces for idle users is r = 0.5 at p = 0.05 which shows that a correlation between elapsed time and remaining time exists. However, it is evident from the hourly result given in the figure, that there is positive as well as negative correlation at different hours of the day. This indeed is an interesting observation which contradicts the older-stable principle. To dig it further, this work combines different behavior groups and presents the results in

To understand variations in correlation coefficient during different times of the day, this work analyzes the sessions generated at different times.

Since the older-stable principle is applied to individual users while it is deduced from combined behaviors in existing works, this work also considers the individual case. To perform an analysis of individual behaviors this study extracts traces of two users with most appearances in the system.

To conclude the analysis of older-stable principle, this study observes through extensive investigation that this principle does not always hold. Furthermore, it is dependent on time of the day and overall population of users. The older-stable rule remains intact under the analysis of all the traces of all users together which was established in similar analyses. This study observed that the strong correlation is mainly the result of idle sessions which may be present in a dataset under investigation.

In contrast to older-stable principle, the contextual approach estimates the length of current session of a user from previous sessions as well as contextual information. This section presents an extensive study of the contextual approach to evaluate the efficiency of several machine learning models over the estimation of stability. First, it discusses the machine learning models used in this work and then it presents the methodology adapted in this approach as well as the results.

Our goal is to estimate the current session of a user which is a continuous variable therefore it becomes a regression type problem. In the literature, only a Bayesian Network (BN) and Support Vector Regressor (SVR) have been used for the prediction of current session from contextual information [

K Nearest Neighbors Regression is an adapted form of K-Nearest Neighbor (KNN) for continuous variables. KNN is a supervised learning mechanism for the prediction of discrete variables. The core of this technique is the use of nearest neighbors for the estimation of unknown or missing variable. To determine the nearest neighbors, it uses the distance metric such as Euclidean distance from missing point. KNNR estimates the output label by taking an average of the labels of its k-nearest neighbors.

This work uses the Python machine learning library to build the KNNR model. This library provides KNNR that can be configured with different settings according to the nature of the problem. Different parameters are set for this model to get best settings for this problem. A few major parameters and their settings as chosen for this model are described below.

n neighbors (

algorithm: There are different algorithms available that include brute, ball tree, kd tree and auto values. One can set either of these algorithms or otherwise the auto option let the system choose the best one for the problem. This work chooses the latter option.

P: P specifies the method of computing distance between points. A value of 1 invokes manhattan distance, 2 provides a method equivalent to Euclidean distance and any other random value sets the distance metric as minkowski distance.

Random Forest Regressor combines multiple decision tree classifiers by fitting them on sub-samples of the dataset selected randomly. Further, it averages the results of these classifiers to control over-fitting and enhance accuracy. This work utilizes the model provided by the Python machine learning library [

n estimators: This parameter specifies the number of trees to be used by RFR. This work evaluates the performance of the model with different values and chooses a value of 50 for this parameter as it provides better results.

criterion: RFR uses this parameter for the measurement of quality of a split. This study selects Mean Squared Error (MSE) as a value of this parameter.

max depth: This parameter specifies the maximum size of the tree. This work does not impose any such limitation and uses the default value of

bootstrap: This parameter is a boolean type which if false, the model uses the entire dataset to construct each tree. This study uses the value

max samples: In case the bootstrap value is true, this parameter can be used to limit the size of the sub-samples. This study uses the default value which is

Gradient Boosting is based on AdaBoosting which starts to train a weak learner such as a decision tree through assigning an equal weight to each observation. Once the first tree is evaluated, it changes the weights of observations in such a way that difficult to classify observations get increased weights and easy to classify observations get reduced weights. In the next iteration another tree is grown with new weighted observations. The goal is to improve the predictions of the first tree. At the end of the second iteration, the model is an ensemble of the two trees. This process is continued until a specified number of iterations is achieved.

Gradient Boosting works in similar way by training several models gradually, additively, and sequentially. Gradient Boosting differs from AdaBoost in the identification of limitations of weak learners. In contrast to AdaBoost model, gradient boosting identifies the limitations by using gradients in the loss function such as squared error. This is actually a measure of goodness of fitting model's coefficients to the data. Since this work attempts to predict the session of a user, the loss function would base on the error of the prediction between actual and predicted session.

Support Vector Regressor (SVR) is a generalization of Support Vector Machine (SVM) for regression problems. SVM models the binary classification problem as convex optimization problem through finding the maximum margins that separate the hyperplane. Support vectors represent the hyperplane. To generalize SVM to SVR, an

This study utilizes the SVR model provided by the Python machine learning library. This model provides several parameters that can be set to fine-tune the model for customized solutions. To describe the configuration of the model used in this work, its parameters are given below.

Kernel: The Python machine learning library provides several kernel functions such as Linear, Polynomial, Sigmoid, and Radial Basis. Since the Kernel function performs the optimization, its selection is not straightforward. Therefore, this work analyzed the performance of each kernel empirically on the dataset and chose the Radial Basis Function (RBF) kernel provided by [

Gamma: The gamma parameter determines the influence of the spread of training sample. This influence is far for small values while close for large values. This work experiments with different values of this parameter and chooses 0.1 as its value in the developed model.

Epsilon (

The joint distribution of a set of variables having possible mutual causal relationships is represented by a Bayesian network through a directed acyclic graph and conditional probability distributions. The acyclic graph consists of nodes and edges. Nodes represent variables that contain conditional probability distributions while edges represent their causal relationships. The goal of a Beyesian network is to estimate a posterior conditional probability distribution of a target variable after observing the evidence. Each variable in a Bayesian network is conditionally independent from all its child nodes given the states of its parents. This property sometimes significantly reduces the number of parameters that are required to characterize the Joint Probability Distribution (JPD) of variables. For a given Bayesian network, the joint probability distribution over

Building a Bayesian network model has two parts, namely structure and parameters. The structure of the model places variables in relationships while parameters are set as prior probabilities of each node. Both of them can be built manually or learned from data [

The methodology this work adapts for contextual approach is depicted in

The dataset used earlier in correlation analysis is limited in size therefore, this work uses a synthetic dataset. This dataset is generated through a semi-Morkovian model presented in [

Join Time T_{j}

Departure Time T_{d}

Session Duration: The time duration in minutes between the join time and departure time is session duration in our dataset. This variable shows the stability of a user and models are tested for accuracy over the estimation of this variable.

Arrival Rate: Arrival rate or joining rate represents the number of users joining during a particular minute of the day. This field contains value of arrival rates for each minute of the day.

Departure Rate: Departure rate represents the number of users leaving/quitting a channel during a specific minute of a day. Departure rates for each minute is recorded in this field.

Population: Just like arrival and departure rates, population is also a collective variable that contains the count of online users at a specific minute of the day.

Content Type: The model contains three generic kinds of contents which are fiction, sports and real. The dataset records the type of the content being broadcast at each minute.

In feature extraction phase, this work selects variables of interest in light of the work presented in [

The dataset is split into training set and test set (validation set) using holdout method through the train test split function of Python library [

This work configures each machine learning model according to the specifications given in the description of models above. Then, it builds every model using the training subset. To test (validate) the model, this work uses the testing set instances. Here, session duration (target variable) is dropped and is let to be predicted by the model for its accuracy assessment during the validation step.

As discussed above each of these models is assessed over the prediction of the session duration. To evaluate the accuracy of each model, this work uses three error calculation techniques namely, Mean Absolute Error (MAE), Mean Squared Error (MSE) and Root Mean Squared Error (RMSE).

● MAE: It is an average of absolute differences between the actual session and the predicted session. The MAE is a linear score which means that all the individual differences are weighted equally in the average. It can be computed through

● MSE: It calculates the square difference between the model predicted session and the actual session for each point, and then averages these values. MSE can be computed through

● RMSE: RMSE is calculated in two stages. First, normal mean error is taken. Then, the square root is added to allow the errors ratio to be the same as the targets number. The RMSE can be computed as in

To compare the results of newly tested models (GBR, KNNR and RFR) to previously used models (BN and SVR), the MAE, MSE and RMSE of all these models are depicted in

Concerning the MAE, the RFR model produces the lowest error which is 0.83. It means that RFR performs better for outliers. However, being an absolute error, this metric is not considered as a good choice to compare models. Furthermore, the MAE does not assign weights to errors such as, a higher weight to larger errors. Therefore, to compare the accuracy of the models, this study focusses on MSE and RMSE. It can be noted that GBR produces the least MSE and RMSE among all the tested models. Therefore, based on these two metrics, GBR emerges as the best model for this problem.

To have a look at individual predictions, a scatter plot of actual

Comparing these plots, affirms the overall performance of each model discussed earlier. Here, all the three newly proposed models show better accuracy then the previous models. Among the three, GBR produces the least spread of points from the slope and therefore shows better accuracy than all the compared models.

Predictions of machine learning models discussed above can be used to stabilize the P2P overlay. Since there are several stream distribution strategies in P2P IPTV networks, which drives the overlay structure therefore stabilization strategies can be in multiple ways. For instance, a tree can be constructed in such a way that the stable peers are placed near the root while the unstable ones are joined at the leaves. Furthermore, algorithms to maintain a stable tree during the frequent arrivals and departures shall be required. Similarly, in hybrid system, a stable peer may be chosen for the push operation in order to minimize the pull operations.

This work presents a proof-of-concept simulation which considers a single tree system. The data are taken from the logs of one day of the same 10,000 users, used as a dataset in evaluation of machine learning models in three cases of tree construction. In the first case, a tree is built randomly in which peers arrive and leave the system according to their actual join time and departure time. It does not involve any stabilization mechanism. This is termed

The simulation starts at minute 1 and simulates the on and off time of each user as given in the dataset. On each minute it checks the join time of each user and if it matches with the current time, it lets the user join an existing peer as a child. Each peer has an outdegree between 1 and 5 which is randomly assigned. Similarly, the departure time of each user is checked on each minute and if it matches the current time, the peer exits. At the same time the number of descendant peers of the departing peer is recorded which shows the impact of departure. The tree is periodically stabilized after every 3 min time according to applied stabilization strategy.

As discussed earlier that intermittent presence of peers is a major issue in P2P IPTV systems, this experiment analyzes the impact of an abrupt departure. The sudden departure of an upstream peer discontinues the stream to all its descendant peers. Therefore, on each departure, this number is counted to show the resilience of a particular tree against such departures.

The simulation is run for each case and the number of impacted peers at every minute is record.

This work focusses on the stability of peers in a P2P IPTV architecture. It first extensively analyzed the older-stable principle, the widely used approach for determination of stable nodes. For this purpose, traces of IPTV systems were analyzed for the correlations of elapsed time and remaining time in several scenarios. This analysis revealed that the older stable principle stands true for user sessions when correlation is calculated together. However, in case different behavior groups are separated, this principle does not remain true as very weak, or no correlation is observed. Moreover, in case of individual users, again no correlation was found.

Secondly, machine learning algorithms were evaluated for their accuracy to predict the stability. This study considered GBR, KNNR and RFR and compared their performance with previously used models namely, SVR and Bayesian network. Over the same training and testing data, all these algorithms performed better than SVR and Bayesian network. Furthermore, GBR produced better accuracy among the newly tested models.

Finally, a proof-of-concept simulation was conducted which considered the construction of a tree structure based on three methods. In one method, the tree was randomly constructed without any stability mechanism while in other two methods tree was built and stabilized based on older stable principle and machine learning based predictions. Simulation results revealed that machine learning based stabilization can bring significant improvement to the system.

This work presents a small-scale simulation which only considers a single tree. Therefore, future work needs to consider machine learning-based hybrid topology. Furthermore, concrete experiments on real network are needed to validate the system for implementation in deployed systems. Machine learning can be utilized to include other parameters such as available bandwidth and delay. The same approach can be extended to other user-oriented networks.