A Context-Aware Adaptive Streaming Media Distribution System in a Heterogeneous Network with Multiple Terminals

We consider the problem of streamingmedia transmission in a heterogeneous network from amultisource server to homemultiple terminals. In wired network, the transmission performance is limited by network state (e.g., the bandwidth variation, jitter, and packet loss). In wireless network, the multiple user terminals can cause bandwidth competition. Thus, the streaming media distribution in a heterogeneous network becomes a severe challenge which is critical for QoS guarantee. In this paper, we propose a context-aware adaptive streaming media distribution system (CAASS), which implements the context-aware module to perceive the environment parameters and use the strategy analysis (SA) module to deduce the most suitable service level. This approach is able to improve the video quality for guarantying streaming QoS. We formulate the optimization problem of QoS relationship with the environment parameters based on the QoS testing algorithm for IPTV in ITU-T G.1070. We evaluate the performance of the proposed CAASS through 12 types of experimental environments using a prototype system. Experimental results show that CAASS can dynamically adjust the service level according to the environment variation (e.g., network state and terminal performances) and outperforms the existing streaming approaches in adaptive streaming media distribution according to peak signal-to-noise ratio (PSNR).


Introduction
Due to the rapid development of network technology and the popularization of various kinds of user terminals (e.g., table PC, smartphones, and laptops), streaming media service has been significantly increased among the home entertainment services.The streaming media requires high bandwidth, low delay, and low jitter on its transmission route; however, the Internet is best-effort network which the terminals compete for its bandwidth that result in congestions, delay, jitter, packet loss, and then consequently damaging user experience.
In addition, as user terminals become popular and diversified, the home wireless networks (HWN) develop toward the direction of heterogeneousness and complicatedness, bringing a big challenge to the traditional streaming media service.It is apparently unreasonable to provide all terminals with same service level, because the terminals have different environment (bandwidth, resolution, arithmetic capability, and memory).
In order to offer streaming media service with guaranteed QoS in the environments of heterogeneous network, network state should be first obtained.Olvera-Irigoyen et al. [1] claimed that in order to reduce the probing traffic's influence on the normal service traffic, Iperf in the lightweight mode and nondestructive TCP flow can be used to estimate the available bandwidth of the hybrid home networks; Louvel et al. [2] put forward a network resource management framework for streaming media distribution, which also uses Iperf in the UDP mode to probe available bandwidth from server to client.Delphinanto et al. [3] demonstrated a new method (a tool named ALLbest) to measure the available bandwidth from server to client based on the packet-pair dispersion technique.However, all of these methods have shortcomings: (a) the characteristics of 802.11 wireless network are not taken into account in the methods [1,3], and measuring wireless network by using the method for measuring wired network will result in inaccurate values of network state parameters; (b) methods [2,3] induce a lot of probing traffic 2 Mathematical Problems in Engineering in the measurement phase, especially in wireless network conditions, and thus the normal network traffic will be affected.
In addition to end-to-end network state parameters, terminal environment is also one of the factors that must be taken into account in streaming media service.Researches in this field mainly rely on pervasive computing [4] as the theoretical basis.The context-aware computing system put forward in pervasive computing can use the perceived information to infer the state of the surrounding environment, and it can proactively adapt to users' needs by changing its own behavior.Relevant research projects include the IST-CONTEXT project [5] in Europe and the Aura project in Carnegie Mellon University [6].But the scopes of these researches fail to extend beyond the computing field to include the communication field, and the environment researched is restricted to the terminal environment, without considering the dynamic changes in network environment.
The currently popular approach is the scalable video coding (SVC) [7] technology or the distributed transcoding technology [8].But low-delay, high-quality streaming media services are still hardly available to users due to problems in coding efficiency, transcoding duration, synchronization difficult between parallel computations, and so forth.Moreover, a unified standard is still lacking for the Qos evaluation model, thus another problem that is to present a reasonable evaluation model based on the consideration of multiple environment parameters.
In this paper, we present the context-aware adaptive streaming system (CAASS) by employing the pervasive computing concept as the theoretical basis, so as to provide streaming media distribution services through working in coordination with the multisource server in a heterogeneous network.The system considers not only the changes in the network state but also the parameters of terminal environment.To accurately perceive the network state on the heterogeneous network, a novel measure method is adopted by integrating the optimized PathChirp and the on-line available bandwidth estimate (OLABE) scheme.Also, the CAASS uses a strategy analysis (SA) module to perform streaming media adaptation according to the perception parameters.The experiment indicates that the CAASS can effectively improve the streaming QoS by media PSNR, thus consequently improving user experience.
This paper is structured as follows: the second section introduces the background regarding network measurement and 802.11n; the third section describes the system's overall framework and elaborates the method for CAASS implementation; in the fourth section, the prototype CAASS is implemented, and then simulation experiment is conducted, before the experimental results are analyzed and compared; the last section summarizes the research contents in this paper and introduces the direction of future research.

Available Bandwidth Measurement.
The available bandwidth is the most important parameter among the network state parameters.In [9], Jain gave the definition of end-to-end available bandwidth within ( 0 ,  0 − ): represents the capacity of link  and    ( 0 ) represents the bandwidth utilization rate on link  within ( 0 ,  0 − ).
The well-known methods for available bandwidth measurement in recent years are based on the self-congestion theory [10].Self-congestion is intended for finding the minimum transmission rate that can cause congestion in the path by comparing the delay of the probing packets.The specific method of self-congestion is introduced in [10].Thus, we learn that the tendency of one-way delay (OWD) [11] can be used to infer network utilization.
The OWD consists of queuing delay, processing delay, propagation delay, and transmission delay.Among these four, processing delay and propagation delay can be regarded as constant on same link, and if the packet size is fixed, transmission delay is also fixed.So the change in OWD is mainly determined by queuing delay.OWD is calculated as in The sender sent  packets with a size of  to the receiver.The OWD (  ) of the th packet is equal to the sum of transmission delay (/  ), propagation delay (  ), processing delay (  ), and queuing delay (   ) on all the links ( = 1 ⋅ ⋅ ⋅ ) along the route.The OWD deviation in contiguous packets can be expressed by (3), and according to the self-congestion theory, the available bandwidth of the route can be estimated with (4) as follows: represents the probing rate of the probing packet, and  represents the available bandwidth of the given path.Formula (4) can be interpreted in this way: the probing rate is approximately   at the time when the delay increases suddenly.Many measure tools, such as Pathload [12] and PathChirp [13], estimate available bandwidth through tracking for the turning point of delay in the observation of OWD trend.

IEEE802.11n
Block-ACK Mechanism.For multimedia enhancement, the IEEE802.11nintroduces a block-ACK (BA) mechanism [14].Different from ordinary ACK mechanism of MAC layer, BA messages acknowledged the successful reception of a frame that contains multiple packets.The BA mechanism is intended for enhancing the rate of bandwidth utilization by reducing ACK consumption.This feature is very suitable for applications such as streaming media, which generate bursty traffic.The BA mechanism is shown in Figure 1.
The BA mechanism allows the transmission of a certain number of MAC Protocol Data Units (MPDUs), with Short Interframe Spacing (SIFS) as the boundary, in the dedicated transmitted opportunities (TXOPs).When MPDUs are sent, the sender will forward a Block-ACK Request (BAR) frame to the receiver to request a reply from the receiver.After receiving the BAR, the receiver will send BA to confirm the reception of MPDUs, and then the MAC layer of the receiver will forward all the ordered packets to the upper layer.Although the BA mechanism enhances transmission speed, the trend of delay cannot indicate the bandwidth variability.The methods [12,13] that are currently applicable to the measurements of available bandwidth of wired network can result in adverse effect on the normal traffic, instead of accurate measurement values.

Multisource Service Mechanism.
Multisource service mechanism provides the same streaming media file with different formats in resolution and bit rate, so that users can choose a suitable file according to specific environments.This approach can be simply applied and barely involves the processing delay of streaming media.In order to provide lowdelay, high-quality streaming media services with controllable QoS, this multisource service mechanism is employed in this paper to verify the performance of the proposed CAASS scheme.

Context-Aware Adaptive Streaming Scheme
The CAASS is shown in Figure 2. The system operation mechanism can be illustrated as follows: when the user terminal connects to the home wireless gateway (HWG) and requests content from multisource server, the system starts to run.Firstly, the terminal perception module deployed in the HWG perceives the terminal parameters and sends these parameters to front-end via the Internet.The front-end stores the terminal parameters locally.Then, the context-aware module estimates the available bandwidth by the optimized PathChirp from front-end to HWG and extracts environment parameters (terminal parameters, available bandwidth parameter of wireless network) from front-end.In order to provide user with acceptable streaming media, the SA module adaptively controls the service level according to the environment parameters acquired by the context-aware module.Subsequently, the HWG will estimate the available bandwidth of wireless network by the OLABE method from HWG to user terminal and feedback it periodically to the front-end when the streaming media is delivered to HWG.At this time, the SA module adjusts the service level by considering the current status of wireless network and ultimately implements the multisource server to user terminal, wired to wireless adaptive transmission of streaming media.

The Context-Aware Module.
The context-aware module consists of three parts: wired network perception, terminal perception, and wireless network perception.

Wired Network Perception. Wired network perception
for the link between front-end and HWG is useful for streaming media transmission in order to avoid network congestion.After some performance testing, PathChirp is chosen for implementing wired network perception.PathChirp is, respectively, deployed in the context-aware module acting as the control end, the front-end as the sender, and the HWG as the receiver.
PathChirp has many advantages compared with other active probing tools, but it still needs optimization before being deployed in CAASS scheme.First of all, the streaming media service is a one-to-many service, and the wired network perception includes all path to users, so the PathChirp, which consumes much less overhead than Pathload, Iperf [15], and so forth, still needs to reduce its consumption to avoid unnecessary network overload.secondly, PathChirp cannot measure other network states, such as packet loss and jitter.
In order to solve the problem of PathChirp, we optimized PathChirp.Firstly, a packet train adaptive (PTA) probe scheme is proposed to lessen the overhead during network estimation.Secondly, part of the program of PathChirp is changed to enable the measurement of jitter and packet loss.
The PTA scheme is shown in Figure 3.The number of probing packets can be changed within the range of 2 to  ( is determined by the max transmission rate of the route).OWD differences between adjacent packets are successively calculated by (3).If Δ  > 0 and the excursions occurred after  packets are sent, another set of  packet sequences will be sent to finish the estimation.If Δ  = 0 during the time of  packets probing, the number of probing packets will be exponentially increased to 2.If Δ  > 0 but the excursions does not occur, the number of probing packets is linearly increased to ( + 1).In order to obtain information about jitter and packet loss on the links, we change part of the program of PathChirp.Firstly, we record the sending and receiving timestamps of adjacent packets' to calculate jitter by (3).The average jitter during estimation equals the sum of Δ  s divided by the total number of the probing packets.Secondly, a counter is attached to each of the sender and the receiver to record the numbers of packets sent and packets received during estimation.The packet loss rate equals the number of received packets divided by the number of sent packets.

Wireless Network Perception.
In order to avoid wireless network congestion, we proposed a novel algorithm named OLABE for estimating the bandwidth of IEEE802.11n.This algorithm is deployed in the HWG when using the BA mechanism.Available bandwidth of wireless network is estimated through calculating the number of packets successfully sent out in the application layer within a transmit-receive slot (TRS).Because there is no more probing traffic in the OLABE method, it will not increase network overload on the route.
The major part of OLABE method is to determine TRS start point and end point, and a suitable TRS will reduce the delay caused by the MAC layer mechanism, thus resulting in accurate estimation of the available bandwidth of wireless network.The example of OLABE method is shown in Figure 4.In Figure 4,   is the time of the burst packets transmission at the sender,   is the time of burst packets arrival at the receiver, and ACK  represents the acknowledgement from the receiver, including the sequence number of the packet last received.Here we assume that the maximum number of a burst packets is three.After the last acknowledgement arrives at the sender, the packets which have been buffered in MAC layer will be batch-forwarding to the upper layer, and we define the time of the new burst as the TRS start point.The receiving time of the acknowledgement (ACK  ) is used as the TRS end point.When ACK  is received by the sender, the realtime bandwidth will be calculated.Different TRS may share the same start point but have their own end points.Therefore, the TRS can be calculate as ST  is the start point of TRS  .For example, for  = 0, 1, or 2, ST  =  0 and, for  = 3 or 4, ST  =  2 .The transmitted packets during TRS  are calculated with ACK seq (acknowledgement of the last packet's sequence number) and STP seq (the sequence number of the packet at the start point of TRS).The packets size during TRS  is For  = 0, 1, or 2, STP seq = seq 0 and, for  = 3 or 4, STP seqi = seq 2 , seq 0 , and seq 2 , respectively, representing the packet sequences for transmission at  0 and  2 .PLN  represents the number of packets lost during the TRS  , and PS represents the size of one packet.Therefore, the real-time bandwidth during TRS  is In order to smooth the available bandwidth, BW  can be obtained by applying the exponentially weighted moving average (EWMA) algorithm: Weight  will determine the proportion of the measured real-time available bandwidth BW TRTS  in BW  .If  = 8, then  1 ,  2 ,  3 ,  4 = 1;  5 = 0.8;  6 = 0.6;  7 = 0.4;  8 = 0.2.

The Terminal Perception Module.
The terminal perception (TP) module is used to perceive user terminal environment parameters and create a terminal profile.When a terminal is connected to the system for the first time, it will generate a XML file (as shown in Table 1) about its hardware specification and transmit it to the TP module.The XML files have two generation methods: one is using scripting languages to access operating system, and the other is to develop different versions of application for different terminals.Considering that the script might bring risks to the security of operating system, we choose second method to perceive user terminal environment parameters.The accurate perception of user terminal environment will improve the system performance and enable the optimal match between the media rate and user terminal.

The Strategy Analysis Module.
The SA module is used to analyze environment parameters and delivers the distribution strategy to multisource server.The major of the SA module is QoS strategy algorithm design, because we should consider not only the network state but also user terminal environment.To simplify algorithm design, the network state parameters and terminal environment parameters will be discussed separately.
Among network state parameters, the available should be firstly considered.Compared with jitter and packet loss, available bandwidth is a more direct and reliable reference index for streaming media distribution.Between wired and wireless network, we choose the smaller available bandwidth to determine the distribution strategy.Then, we discusses the rest of network state parameters influencing the QoS represents media quality,  coding represents the encoding influence on the quality of streaming media (different encoding algorithms will result in different values),  V is the packet loss rate, and   V represents the robustness to video damage, and this parameter is related to video encoding and automatic repair.It can be seen that this model only includes packet loss rate as the factor influencing media quality.For a more comprehensive reflecting network state, we optimize the model as represents the influence of network jitter on media quality.Irrelevant to the packet loss rate, it can be expressed with AV BW represents available bandwidth, jitter is the measured jitter value, and Buf MAC is the size of buffer in the MAC layer.
When network state parameters are perceived by contextaware module, we can calculate   value by (10).According to [17], when   ≥ 0.85, the influence of network performance on media quality does not cause users' experience decline.
Among terminal environment parameters, the resolution and CPU should be firstly considered.The streaming media rate can be classified into service level according to the values of these two parameters, shown in Table 2.
According to the popular user terminals (iPhone, Android pad, iPad, and PC), The service levels   are classified into four levels in Table 2.That means that there are four types (  ,  = 1, 2, 3, 4) of streaming media files stored in the multisource server.
For clearly introducing the SA module, we demonstrate its workflow in pseudocode, among which,   represents the Under the guidance of the SA module, multisource server will send streaming media at the rate which is most suitable for the terminal environment, so as to realize adaptive streaming media distribution based on context-aware.

Prototype Implementation and Experimental Analysis
In order to validate the feasibility of the proposed scheme, this paper realized a prototype of the overall system and carried out a series of simulation experiments to test its performances in different environments.

Prototype Implementation.
The realized prototype is shown in Figure 5; this paper uses a tower server and VMware vSphere Hypervisor software to simulate two computers.One computer was used as multisource server where four types of streaming media files have been stored, and the other one was in charge of perceiving and managing service; it integrated the context-aware module, the SA module, and the front-end.The multisource server was connected to HWG via a 10-Mbps private line.The HWG has not only 802.11n Wi-Fi that can meet 150 Mbps standard, but also integrated functions such as FTP server and video on demand (VOD).We used an iPhone 5, an iPad mini, and a 14-inch laptop as user terminal to connect HWG via 802.11nWi-Fi.Meanwhile, in order to test the network perception function in the wired network environment, a PC is connected to the prototype near the HWG via 100 M LAN, and the software network emulator for Windows toolkit (NEWT) is transplanted to the HWG.NEWT can simulate packet loss, delay, and other conditions on reliable physical links to provide network environments with variable performances for prototype testing.

Network Perception Experiment
4.2.1.Wired Network Perception Experiment.We designed three experimental environments for testing the wired network perception performance.The experimental environments are shown in Table 3.
During the experiment in 1, the HWG sends request for FTP file transmission to multisource server at 8 Mbps.Thus, the network load on the link between the HWG and the multisource server is suddenly increased, and the experimental if (AV BW wireless ≤ AV BW wire ) for environment switches from 1 to 2. The comparison of streaming media services in 1 and 2 are shown in Figure 6.
The upper part of Figure 6 is the screenshot of playing streaming media on PC, and the lower part shows the corresponding video attribute, with some important parameters being marked with red boxes.When experimental environment switch from 1 to 2, the service level also declines from  4 to  3 .That means that the wired network perception module has perceived the change on the link, and the SA module adjusts the service to suit current network state.
For further testing the performance of the wired network perception module in 3, we used NEWT to simulate packet loss and jitter in 2. According to (10), the condition of 1/100 packet loss and 50 ms jitter,   = 0.6859, that will cause users' experience declined.
Figure 7 shows the comparison of screenshots and video attribute of playing streaming media on PC in 2 and 3. When experimental environment switches from 2 to 3, the service level declines from  3 to  1 .
According to Figures 6 and 7 and analysis, the wired network perception module can perceive the change of network state in time and reflect the changes to the alteration of the service level, thereby providing users with streaming media services that suit the current network state.

Wireless Network Perception Experiment.
Considering the architectures of existing home heterogeneous network, the experiment in wireless network will be limited to the last hop of the path.In this experiment, the main attention is paid to testing performance of OLABE method.
Before experiment, we firstly measure the maximum transmission rate in our wireless environment.Through concurrently transmitting files between user terminal and HWG, we found that the HWG can provide the maximum transmission rate at about 60 Mbps.
The experimental environments for wireless network perception module are shown in Table 4.
In order to evaluate the OLABE method proposed in this paper, we used three methods to measure the available bandwidth of wireless network.In 4, a specialized software   CHARIOT [18] is applied in the wireless available bandwidth estimation and result will serve as the practical bandwidth; in 5 and 6, PathChirp and OLABE are, respectively, used for wireless available bandwidth estimation.We used a scenario that the laptop requests VOD service on HWG.While the video on the laptop is playing at 2 Mbps for 5 seconds, iPad requests another 30 Mbps FTP service on HWG.The entire test lasts for 10 seconds.Figure 8 shows the bandwidth variety during the test.
Through comparing the results with the CHARIOT software, we know that, due to the BA mechanism, the tools like PathChirp which use the interpacket probing method will obtain erroneous and fluctuant values.With our OLABE method, we can get the more realistic and smoother results.  5.
In order to avoid the influencing of network state on the quality of streaming media, the network traffic is not introduced in experiments 7 and 8.We used an iPhone 5 and an iPad to request the same streaming media service.The experiment results are shown in Figure 9.It was observed that the two types of terminals have been serviced with different resolutions, because the TP module has correctly perceived the terminal environment parameters.

System Integration Experiment.
The experimental results of system integration are evaluated according on the peak signal-to-noise ratio (PSNR) [19].PSNR is an engineering term referring to the ratio of the greatest possible signal powers to background noise, and its definition is as follows:   peak = 2  − 1, where  represents the number of bits for color depth; and MSE(  ,   ) represents the mean square error between the original image and the target image.
In order to validate the CAASS scheme, we design the following experimental environments which are shown in Table 6.
From 9 to 12, we used iPad to request 8 Mbps downloading of FTP file from the HWG to multisource server.At the same time 1/100 packet loss and 50 ms jitter are created by using NWET on the link.In 9, the streaming media services are provided when the CAASS scheme is shut  down; the default service level is  4 .In 10, PathChirp is used for measuring the available network bandwidth between user terminal and multisource server, and the SA module is used for adjusting the distribution strategy according to the measured bandwidth.In 11, we add the TP module in 10, so the SA module adjusts the distribution strategy according to the measured bandwidth and the terminal environment parameters.In 12, we validate the integrated CAASS scheme.
Figure 10 shows the trend of PSNR in the four environments.We made Table 7 to perform a more objective and clear comparison.Table 7 includes the average PSNR values and PSNR standard deviations within the time span of 100-frame video in four experimental environments.From 9 to 12, it can be seen that the PSNR standard deviations continuously decline, which is less likely to cause viewers' subjective discomfort.Meanwhile, the average PSNR values also continuously enlarge from 9 to 12.As average PSNR may not map well to the visual impression during streaming media service, we use frame PSNR to infer mean opinion score (MOS).Reference [20] provide effective mapping of PSNR to MOS.The specific mapping pattern is shown in Table 8.Combining Figure 10 with Table 8, it can be seen that most of the video frames are subjectively unacceptable in experiment 9.In 10 and 11, most of the video frames are subjectively acceptable.In the environment with the whole CAASS scheme, most of the video frames are subjectively good or excellent, meaning that the streaming media service offers good viewing experience.

Conclusion
In heterogeneous network, how to provide various terminals with adaptive streaming media distribution services under different environments is a critical problem.To solve this problem, we propose a CAASS scheme.This CAASS scheme consists of a context-aware module and an SA module.To avoid network overload and perceive more network state parameters, we optimized the PathChirp by using a PTA scheme and changing part of the program of PathChirp.To avoid wireless network congestion, OLABE method is employed to accurately measure the available bandwidth of wireless network.To perceive various terminals environment parameters, the TP module uses a XML format to create a terminal profile.To improve the media QoS, the SA module optimizes the existing QoS model and realizes adaptive streaming media distribution.Our experimental results indicate that our scheme can offer QoS guaranteed streaming media services in heterogeneous network based on context-aware.The future study will search a method to provide users with low-delay, high-reliability, and all-bit-rate transcoding services, combining it with the proposed CAASS scheme.

Figure 5 :
Figure 5: Prototype of context-aware streaming media distribution.

4. 3 .
Terminal Perception Experiment.The experimental environments of TP are shown in Table

Figure 8 :
Figure 8: Comparison of the available bandwidth estimation among the CHARIOT, PathChirp, and OLABE.

Figure 10 :
Figure 10: PSNR values in different experimental environments.

Table 1 :
Parameters of TP.

Table 2 :
Terminal service level.

Table 3 :
Experimental environments of wired network perception.Eating steamed buns.flv(four types of resolutions) 2 PC Streaming media on demand + FTP file transmission Eating steamed buns.flv(four types of resolutions)

Table 4 :
Experimental environment of wireless network perception.

Table 6 :
Experimental environments of system integration.

Table 7 :
Comparison among video qualities.