Efficient data replication for the delivery of high-quality video content over P2P VoD advertising networks

Recent advances in modern television systems have had profound consequences for the scalability, stability, and quality of transmitted digital data signals. This is of particular significance for peer-to-peer (P2P) video-on-demand (VoD) related platforms, faced with an immediate and growing demand for reliable service delivery. In response to demands for high-quality video, the key objectives in the construction of the proposed framework were user satisfaction with perceived video quality and the effective utilization of available resources on P2P VoD networks. This study developed a peer-based promoter to support online advertising in P2P VoD networks based on an estimation of video distortion prior to the replication of data stream chunks. The proposed technology enables the recovery of lost video using replicated stream chunks in real time. Load balance is achieved by adjusting the replication level of each candidate group according to the degree-of-distortion, thereby enabling a significant reduction in server load and increased scalability in the P2P VoD system. This approach also promotes the use of advertising as an efficient tool for commercial promotion. Results indicate that the proposed system efficiently satisfies the given fault tolerances.


Introduction
Recent advances in online advertising and peer-to-peer (P2P) video-on-demand (VoD) networks, enabling peers to watch or download internet video clips on demand, have created considerable interest in the construction of integrated frameworks. Online advertising channels, such as online newspapers/magazines, keyword trigger tools, and e-mail, have gained wide public acceptance and considerable importance as advertising media [1,2]. However, an increasing number of internet content providers, such as Blinkx BBTV [3], Joost [4], and Livestation [5], are incorporating legal P2P technologies into their delivery platform to reduce operational expenses. In P2P VoD applications, user preferences can be automatically derived from media usage data without the need for direct user input, making them an excellent system for the collection of customer information. This enables advertisers to bid on video clips relevant to their target market. For instance, a toy or a snack advertisement might link to cartoon videos. Hence, a concomitant need has arisen for the delivery of marketing messages to attract customers to the P2P VoD environments [6]. A P2P VoD computing environment can be an ideal platform on which to display advertisements. Perceptions of high video quality and a robust environment are essential for the delivery of online advertising in P2P VoD networks; therefore, this study attempts to make a system that is tolerant of network errors in terms of video enhancement and online P2P advertising availability.
There are many ways to enable efficient and scalable on-demand video distribution over networks, including IP multicast, content distribution networks (CDN), and P2P networking. Although IP multicast is an efficient approach for a number of channels with high popularity rankings [7], it has several drawbacks. First, IP multicast has not been widely deployed on the internet [8]. Second, core network routers must process a considerable number of forwarding entries when many active multicast groups are used, resulting in increased memory requirements and slower forward processing. Third, IP multicast flow aggregation is not well suited to less popular video channels (e.g., if many disjoint paths are involved) [7]. In contrast, P2P VoD technologies have gained immense popularity throughout the world [9][10][11][12]. P2P VoD services are fundamentally more scalable than existing IP multicast methods when bandwidth availability exists at the ISP backbone. The advantages of using P2P VoD technologies for content distribution over CDN or IP multicast are listed below: • Exploitation of the underutilized resources of peers: Some resource owners (resourceful peers) can become providers by making their underutilized resources available. Peers can be frequently switched or reconnected to resourceful peers, and all shared data and services are accessible to other peers.
• System deployability: A set of incrementally deployable and extensible solutions bring existing P2P systems closer to commercial production, and many have been introduced in recent years.
• Hardware economics: Traditional CDNs combine the infrastructure for content-delivery, request-routing, distribution, and accounting to provide an intermediate layer of infrastructure to rapidly deliver content from providers to end users. The disadvantages include the need for a large number of CDN servers (Content Foundry), high costs, and a lack of scalability to accommodate a large audience. Infrastructure management is expensive, and according to Jupiter Research, 1-hour streamed to an audience of 1,000 costs content providers 0.5 cents per megabyte [13].
• High scalability of P2P services: The high scalability of P2P systems relies on an aggregate of resource contributions by individual peers with access to services from the P2P system. Peers do not need a global view of the overall system, which makes publishing, sending, or downloading shared media easy, quick, and scalable.
In existing P2P advertising systems, delivery services are accomplished through a combination of P2P file sharing and an advertising service, such as ZapShares [14], MediaDefender [15], P2Pads [16], or P2Pwords [17]. A P2P web search engine [18] (e.g., Mininova [19]) is defined as a P2P retrieval service, providing the Uniform Resource Locators of multiple trackers and integrity metadata in answer to a search request by a peer. As shown in Figure 1, when a keyword or comprehensive query is submitted to the P2P web portal server, a results page is returned by the P2P web portal server to enable the selection of content. The search results, including commercial-advertisement files, can be downloaded from other peers and shown to participants. The commercial-advertisement video may be an interactive commercial video that is viewed by the target audience, enabling them to interact and make immediate purchasing decisions. P2P advertising platforms enable advertisers to efficiently track through-clicks and historical data. Compared to non-P2P online advertising (e.g., contextual ads on search engine results, banners, advertising on social network, and e-mail advertising), P2P networks are more socially aware and service-oriented because they are self-organizing and decentralized forms of communication [20,21]. P2P advertising enables the utilization of all peer resources and the more effective promotion of advertisements.
The divergent behavior of peers influences the availability of resources in a P2P network; therefore, it is essential for system designers to determine an appropriate policy for sharing resources to deal with video distortion resulting from packet loss. The aim of this study was to develop a framework in which to integrate advertisements and manage the sharing of resources, according to content and network characteristics via video-distortion estimation in P2P VoD networks. P2P systems are commonly classified into three classes: unstructured, structured, and hybrid [22]. The empirical goals of this article are twofold: The first is to achieve a high degree of perceived video quality and effectively utilize the resources available on P2P VoD services. Video quality can be improved through the management of replication operations in video sessions involving the estimation of video distortion. The second is to develop a peer-based promoter for delivering online advertising in P2P VoD networks. Online advertising strategies for the proposed P2P VoD framework must consider the display function as well as the stability, efficiency, and robustness required for continuous operations in online marketing communication channels [23]. The proposed framework enables the distribution of advertisements via peer-sharing to make them publicly available in a way that is rarely possible in other media (e.g., banner advertisements on web sites). The proposed framework differs from prior methods (existing P2P advertising systems) in two respects. First, the video title and video description fields may provide useful information about the selfinterest of individual peers, making them a useful tool for the promotion of advertisements. Second, advertising can be obtained not only in the initial stages of searching, but also in the subsequent video sessions. In summary, the main contributions of the proposed system are as follows: (1) This method decomposes the network into separate sub-networks to enable the dynamic replication of data to enhance performance without global knowledge of all peers in the overlap network.
(2) The network characteristics of individual peers are integrated with the platform to maximize visual quality in the P2P VoD through the replication of video chunks subject to the video distortion errors encountered.
(3) The distribution of ads relies on peers and a centralized collection point (a web portal server), making the scalability and flexibility of the P2P ad service more effective. (4) The proposed framework is evaluated through the simulation of the proposed distortion-based video-chunk replication solution to reduce server load and significantly increase the scalability of P2P VoD systems.
This article proposes a P2P VoD advertising framework based on the estimation of video distortion prior to the replication data stream chunks, as shown in Figure 2. The major achievement of the proposed framework is the reduction of server load and the optimization of overall video quality under given network conditions. We also propose an online video advertising method based on on-demand videos.
The organization of the article is as follows. Section 2 introduces the problems associated with P2P VoD advertising services. Section 3 discusses the operational attributes of the proposed P2P VoD advertising application presented in Section 4. The simulation results are shown in Section 5. Finally, the conclusion and discussions are provided in Section 6.

Related work
Several studies have lent support to the claim that P2P advertising services can effectively facilitate the spread of advertisements and promotions. Research on the effect of P2P network on advertising services is still in its infancy, and even less has been conducted on the effect of P2P advertising services integrated with VoD systems.
Ad-Share [24] provides a P2P distributed advertising scheme to distribute advertisements among a group of participating peers. A large number of free riders (e.g., nearly 20-40% of Napster [25] and 85% of Gnutella [26] contribute nothing or few resources to other peers), may seriously influence system performance. The impact of free riding is one of the most commonly discussed problems in P2P networks. Hence, the approach of Ad-Share integrates reputation within an incentive-based model to cope with the problem of free riding to improve scalability and efficiency. Chen et al. [27] proposed a location-aware solution for the instantaneous dissemination of advertisements to a target audience within an area of interest over mobile P2P networks. An opportunistic propagation model was used to trade off time-and location-based advertisement distributions by considering important physical constraints of networks such as a high advertisement delivery rate, low advertisement delivery time, and a flood of advertisement messages. However, the instant advertising method is suitable for limited or specific spatial/locational groups rather than broad audiences.
Previous observations of peer behavior in the P2P overlay networks were the motivation for this study, which emphasizes if the users are located close to the advertising promoter, they will obtain the relevant advertising media with high delivery rate and short delay. The article differs from related work in two significant respects: (a) we attempt to reduce video degradation through the proposed distortion-based datareplication scheme; and (b) a framework is proposed to enhance the scalability of the propagation space in the P2P advertising network. Poor video quality and frequent interruption of internet services on the user side are typically caused by delivery failures, long packet delays, or packet losses in the P2P network. A pool of common resources can be effective when applied in resource poor sessions to maintain stable video quality. To prevent the overconsumption of common resources, it is necessary to create a promotion strategy in which available resources can be shared among peers. The advertising-supported video scheme is a strategy for agents to earn revenue [28] by delivering relevant advertisements and sharing resources.
The high degree of integration between advertisements and P2P VoD networks has brought new challenges to the design of systems. P2P advertising services should send promotional messages to their preferred audience by associating advertisements with a set of keywords and network characteristics. The proposed approach provides a distortion-based replication mechanism to support video on-demand services in a dynamic environment, and promotes the advertisement through resourceful peers. The high visibility of advertisements with a rapid delivery time is due to strong coupling between the advertisement service and P2P VoD systems. Using this, integrated design also provides flexibility in advertisement timing and placement.
Collaborative caching among peers in the P2P VoD network can be an effective way to accomplish resources sharing. For instance, in a group-management-based VoD system [29], the incorporation of optimized bandwidth utilization, including the upload bandwidth, cache content, and cache capacity of each peer is used to support the playback of the entire video. All peers are clustered into groups of various sizes according to the playback point of peers, and local information is collected by the head peers of the groups. Thus, the managed range of cached chunks can be determined in individual groups, and this collaborative caching mechanism compensates for a lack of chunks in nearby groups. However, a high number of free riders may generate considerable group dynamics, which severely degrades video quality.
In [30], we proposed a technique for the detection of peer-level bottlenecks and density-based clustering as a basis for regional replication and advertising in an unstructured P2P advertising VoD service. In this article, we propose a method of estimating video distortion for data stream-chunk replication in the P2P VoD advertising network. The algorithm is capable of balancing the supply and demand of video chunks under non-uniform segment popularity distribution. In addition, because the distribution of high-quality video chunks is based on the estimation of video distortion, it is more likely that a client will find resources required to continue the playback and receive video of better quality. The proposed framework provides a method for advertising using the principle of distributing advertisement videos to potential customers. In addition, this approach relies on a centralized web portal server (scalability and flexibility are limited by the server) for the delivery of advertisement messages to the target audience. It depends even more on dynamic sharing-peers delivering advertisements during video sessions. We evaluate the performance of the proposed algorithm through simulation.

The operational attributes of the proposed P2P VoD advertising application
The main attributes of P2P video applications can be classified into two categories: video-chunk attributes and peer attributes. Video-chunk attributes include the importance of the video and aspects of video compression (e.g., motion bytes and header information in video streams). Each peer in P2P video systems has several peer attributes, including location, uplink bandwidth, and communication latency, which indicate whether the video chunks can (1) be replicated to compensate for video loss and (2) support interactive VoD. In addition, peer attributes have demonstrated value in assessing the distribution of video content in P2P television systems [31,32].

Peer-attributes related to data-sharing
This article focuses mainly on maintaining smooth playback in a P2P VoD advertising network, configured as an unstructured streaming-based sharing system. Networks have highly unpredictable behavior because peers join and leave at any point in time. When a connected data-sharing peer fails or leaves, all connected peers become temporarily disconnected until they can redirect their connection to a new data-sharing peer or VoD server. Compared to traditional client-server unicast services, in which media files are stored on a centralized media server, the media files on P2P channels are stored across P2P networks in a uniquely decentralized manner. On the other hand, departure misses are major cause of performance degradation (e.g., video quality) in a P2P system [9]. To ensure smooth video playback, the proposed mechanism is based on distributing important replicas in areas in which video-distortion is expected. All peers are encouraged to contribute resources to a global pool as data-sharing peers (supporting peers). The main peer-level attributes of the proposed system are (1) the possibility of hiding communication latencies and the extent of distortion among peers and (2) service capacity of supporting-peers (uplink bandwidth).

Channel model of peers
The proposed framework employs a packet erasure network, in which the probability of packet erasure is estimated according to the estimated communication latency between each receiver-peer and the source-peer.
A large communication latency between peers implies longer network round-trip time (RTT) and a higher probability of dropping packets. The average RTT between peers in a P2P network can be used to indicate the probability of packet loss and end-to-end throughput. In addition, video-chunk delivery in P2P networks typically employs transmission control protocol (TCP) or user datagram protocol (UDP) as the underlying transport control protocol. The proposed system is based on the best-effort delivery service in the form of UDP (the size of the UDP datagram is limited to 1,500 bytes), which does not guarantee reliability or the delivery order of network packets [33]. Nevertheless, noise (e.g., blocking, blurring, frame freezing, packet loss) due to transmission loss or switching peers in the P2P network can sometimes be an important factor influencing overall performance [34]. Hence, we assume that packet loss or corrupt files are random occurrences, meaning that peers may need to reconnect to other peers to locate required content stored on the overlay network. Video sessions with lower RTTs imply that both the server load and service time will be reduced. Figure 3 shows an example set of peers during video playback of the same movie clip x 1 , where we assume that the time-to-live (TTL) value, which is decreased each time P2P-related commands are forwarded (to limit the maximum number of intermediate peers) until the command is accepted or the TTL value is zero. In the above case, peer A 1 uses a ping-pong mechanism (solid line is the PING command; dotted line is the PONG command) to compute the RTT between a pair of peers. Peer A 1 sends a PING command to all of its neighbor-peers {B 1 , B 2 , B 3 , B 4 } with a pooling method. When a neighbor-peer receives a ping command, it immediately replies with a PONG message containing information about the neighbor-peer. Thus, we can derive a good approximation of the RTT as the measure of end-to-end latency, and the forward and backward path using an independent time-invariant packet erasure channel with random delay. The RTT between a pair of peers is used to compute the average characteristics of RTT. In the P2P VoD environment, a long average RTT implies that data sharing ability is limited, and video quality varies greatly. There exists at least one forward path and a backward path for each peer in the channel. The RTT is, by definition, the sum of the forward trip times (FTT) and backward trip times (BTT). Let FTT k 2 , FTT k T ,...,FTT k T be the communication latency experienced on path k within the TTL T scope of that packet, as shown in Figure 3. Therefore, the RTT can be computed as: The probabilities of packet loss on the forward and backward channel are denoted by μ f and μ b , respectively. If peer A 1 sends a PING packet on the forward channel at time t, μ f is the probability of packet loss. Conversely, if the packet is received at its neighbor-peer B 1 at sender time t', where FTT k 1 = t 't is distributed according to the probability density function d f . Likewise, d b is the probability density of the transmission delay in the back channel. According to Mukherjee [35], when the network status is stable or changes slowly, the delay over a path satisfies a shifted gamma distribution. The distribution shape depends mainly on the non-network delay (e. g., schedule and interrupt processing). The distribution center mainly depends on the network delay (transmission delay, propagation delay, processing delay, and queuing delay). In addition, the distribution center is shifted to the network traffic and queuing delay changing. Hence, we assume that the probability distribution of the packet loss and the packet delay are combined into a single probability space, and "∞" means the packet is lost or damaged. The packet delays d f and d b are approximated by a shifted gamma distribution. The probability of a peer with a PING packet (time t) not receiving a PONG packet by time t + τ is

Channel sharing ability of peers
The ability of peers to share channels is implemented on the basis of available uplink bandwidth using time- dependent coefficients. Constraints are taken into account in the VoD service framework in which P2P VoD streaming could saturate the available uplink bandwidth of each peer. Audio and video encoded bitstreams consume significant network resources (primarily bandwidth); the most commonly encountered issues related to multimedia transmission and streaming applications are an unreliable internet connection and heterogeneous bandwidth among various end users [36]. When the network bandwidth fluctuates, the coded bitrate does not necessarily match the real bandwidth. Hence, scalable video coding (SVC) techniques are often used to provide real-time quality adaptation for streaming systems. Hence, we assume that the number of peers and the quality of video delivered to the audiencepeers is constrained by the outgoing channel (uplink bandwidth) capacity of sharing peers. The problem of free-riding, in which peers cannot or will not contribute their resources, is an important issue when designing a P2P VoD system. The existence of a large fraction of free riders has been demonstrated to degrade overall performance and cooperative behavior in P2P systems. Nonetheless, incentive schemes [26] or the proposed active distortion-based replication strategy can substantially enhance performance when free-riders are present in video sessions. This study incorporates the factor of free-riders into our design. Let N(t) be the set of present connections at peer q in the P2P network. Consider a communication channel with an uplink bandwidth of U q bps; let Ψ be the maximum uplink bandwidth in the network. When a request for video x arrives at time t, the requested peer may send a response and accept the connection j request to the requesting peer at time t ja . The disconnect time from the requested peer at time t jd . The connection time of the complete video stream of video x on the channel is t jc = t jd -t ja where t jd >t ja . The bandwidth allocated to the connection j of peer q at time t, is defined as That is, we can define the channel-sharing ability function as follows: The channel-sharing ability of free-riding peers is zero. The establishment of all connections arriving and departing depends on the available uplink bandwidth. The remaining uplink bandwidth is equal to the total uplink bandwidth minus the mean allocated bandwidth, while some connections reside with peer q.

The distortion estimation in the packet bit-stream
The distortion estimation presented in this section is based on a 3D wavelet-coding technique. The SVC extension of the H.264/MPEG-4 (Part 10) Advanced Video Coding (AVC) is the latest video codec based on the discrete cosine transform (DCT) of ITU-T and ISO/ IEC [37]. Although H.264 has many technical advantages, it also has some shortcomings [38,39], e.g., full scalability is not well supported due to the usage of hierarchical B-pictures. An alternative technique for video coding is wavelet-based coding, which has some advantages over current H.264 [40,41]. In addition, the method of interframe wavelet coding overcomes this drawback through the use of motion compensation temporal filtering (MCTF) to achieve scalability without additional system-related overhead. In addition, the structure of open-loop prediction in interframe wavelet coding provides greater flexibility in bitstream extraction and robustness against transmission impairment when no feedback is available. In addition, wavelet-based coding has less variability in video distortion distribution and better robustness in cases of transmission error, compared with DCT-based coding. Hence, we adopted wavelet-based coding to make our system more robust and widely applicable.
A general rate-distortion (R-D) model for an embedded wavelet coder with a square-error distortion measure was used for video texture coding R(D) = ln (ω/D). and ω are source-dependent parameters of the logarithmic R-D model. Note that ω is related to the signal variance of the source. Although this model fits the R-D characteristics of a single coding block, it requires additional computation for source dependent parameters [42]. However, the R-D slope provides an explicit way to quantify the distortion of texture videos. To obtain accurate distortion information, we coded all of the R-D slope-values from code blocks. As shown in Figure 4, multi-level MCTF is used to decompose the video frames into several temporal subbands, including highpass and lowpass subbands. A two-dimensional discrete wavelet transform (2D-DWT) is then performed in each temporal subband to decompose the frames spatially. The solid line shows the data paths of the texture data, and the dashed line indicates motion information. Through the entropy coding stage (3D embedded subband coding with optimized truncation (3D-ESCOT)), an embedded compressed bit-stream s can be generated for each subband of the 3D wavelet transform. In addition, candidate truncation points of each subband are related to R-D slopes, such that all points on the convex hull can be obtained. For instance, a coding block contains 3L-2 coding passes (the first bit plane is processed with one of the three passes only) with R-D slopes l 0 , l 1 ,...,l 3L-2 with |l 0 |>|l 1 |>...>|l 3L-2 | to generate a bitstream based on a profile script (defining a set of coding tools), such as video resolution or bit rate r. Finally, a bit-stream construction algorithm optimizes the tradeoff between rate and distortion to further truncate each coding pass in the embedded bit-stream to form an output bit-stream. For instance, the distribution of R-D slopes and block data rates of the LLLL subband of MOBILE sequence is shown in Figures 5 and Figure 6, a major video distortion as well as video quality impact can be discriminated on the basis of the R-D slope values.
Based on the above observations, we assume that the amount of video distortion from packet loss is related to R-D slope information of each coding unit. In addition, a packet comprises a header or trailer and a payload which may include one or more coding units, as shown in Figure 7. Thus, the expected amount of distortion reduction in group of pictures (GOP) due to channel conditions can be estimated by the quantity of the received video chunks in a set of resource-sharing peers. We further assume that the maximum value of R-D slopes for any given packet is therefore an approximation for the importance of that packet to the reconstruction of the video. The coding units in the GOP are divided into Y packets, and then there exists a set of coding units c = {c 1 ,c 2 ,...,c c } in a packet. In case no The scalable bit-stream is composed of header and texture data. The header contains sensitive data such as GOP size, temporal band index, and motion information, which is variably length coded. One coding block can be coded in one or several network adaptation layer units (NALUs), and each NALU can be packed into one or several transport packets. In addition, each NALU varies in importance regarding the reconstruction of video frames. Loss or damage to important NALU would lead to severe degradation of video quality. The header data of the video bit-stream is particularly important to the quality of the decoded video, and we set a limit to the distortion variable for header information loss resulting from corrupting influences in the video content.
The formation of the bit-stream using the wavelet codec is explained in Figure 7. Using four-level temporal and three-level spatial subband decompositions, a group of frames is decomposed into LLLL, LLLH, LLH, LH, and H subbands, and each subband is divided into a collection of coding-blocks. In addition, each subband consists of luminance (Y; gray-scale) blocks and  chrominance (U and V; color) blocks. The luminance signal is the equivalent of a black and white TV signal, and has a significant effect on visual quality. The proposed replication strategy in this work focuses on the luminance signal.
The proposed replication strategy depends on the factor of distortion to select an appropriate mechanism for replication and the degree of replication required. Estimated distortion values are used as indicators related to the severity of video degradation in a particular GOP instance. Our method generalizes the ideas of [43,44], by exploiting time-varying P2P channel conditions and maximizing the video quality of the received sequence under the constraint of varying bandwidth resource allocation. For each GOP length of on-demand video x, we can estimate the distortion values of the GOP for active peers active on the channel over a particular period of time. Let G w x (t) be the set of peers present within a GOP w of video x at time t in the P2P network, and each peer registers its own stored video-chunks on set R (t). The number of participating peers within the partition is r. The video chunk g' and video chunk g have a corresponding relation to the decoder. To construct video chunk g, the encoder requires that video chunk g ' also be decoded. The expected amount of distortion reduction of peer a based on fully resource sharing at time t is defined as follows: where ΔD g is the expected reduction in reconstruction error if video chunk g is decoded on time, and μ is the probability that video chunk g is not received on time. After the estimated distortion reduction is obtained, and then we adopt the bandwidth sharing properties of each peer. The expect distortion reduction in the GOP w of video x at time t can be computed as:

Advertising strategies on the P2P VoD network
The current findings highlight important factors influencing the promotion of advertising. The concepts of textual relevance matching are useful for targeted advertising, typical examples of which include keywordtargeted (e.g., AdWords of Google) and content-targeted advertising (e.g., AdSense of Google). Hence, a customized advertisement can be associated with one or more keywords, which can be manually selected by advertisers. Language is a medium of communication, and the target audience often relies on the presentation of their native language in advertisements. Language is a useful criterion for segmenting advertising markets, and advertisers should be able to include this in schemes to customize their own advertising plans without wasting network or processing resources. Such schemes can include launch date, advertising language, and keywords for different audience-peers.
There are a multitude of advertisement payment models (e.g., cost-per-action, cost-per-click, cost-per-impression, cost-per-download, and cost-per-visitor) that can be implemented according to advertisement performance and used to motivate peers to provide resources as a supporting peer, such that advertising-service delivery is assisted by supporting peers. Two major categories of internet video advertisements are in-page and in-stream. In-page advertisements are video advertisements embedded in a search-engine results page, containing search results and the retrieval of advertisement tracking. In-stream advertisements can be within streaming video content or played in the advertisement window. In the proposed framework, an internet video advertisement can be placed before, during, and/or after the demanded video content and played within the advertisement window of the application.
Advertisement publishing rules can be created to match advertisements with similar keywords in the VoD clips to describe which advertisements should be associated with each clip. The delivery of advertisements is based on the movie clip keywords found on the time line of the audience-peer group that is attracting advertisements, and sharing peers sending them to audience peers in the P2P online marketing communication channel. In this manner, commercial advertisements can be delivered through P2P VoD advertising platforms, and the targeted messages can be delivered to the correct online audience. P2P VoD advertising services have expanded the horizons of advertising by quickly distinguishing the audience using a video catalog, tightly integrating the video-content and advertisements, and increasing the visibility of advertisements in a scalable manner.

Proposed advertising P2P VoD framework for wavelet bit-streams
In this section, we present the proposed distortion-based replication scheme and advertising approach introduced in Section 3 for P2P VoD applications using a wavelet codec. The main operating characteristics of the proposed P2P VoD advertising framework includes: (a) an on-demand video repository server, (b) a web portal service, (c) trackers, (d) audience-peers (a set of free-riding peers), and (e) supporting-peers. The on-demand video repository server stores a complete copy of encoded video clips, and serves a number of requests that arrive in the queue of the server. The web portal service provides audience-peers with online video information and delivers advertisements to each audience-peer who has sent QUERY messages. Trackers help newly joined peers to bootstrap nodes and coordinate the replication of significant chunks through the proposed distortionbased strategy. Finally, supporting-peers (idle or resourceful peers) fetch chunks from the server or other peers, and deliver advertisements to each supported audiencepeer. The supporting peer can also be an audience peer.
One common difficulty encountered in P2P VoD systems is a severe lack of resources allocated to individual peers, which have been downloaded from sharing neighbor peers. An appropriate fault-tolerance design for P2P VoD system can help moderate performance degradation in the presence of peer failure and bandwidth degradation. This is particularly important for continuous operation and features such as video playback are essential in P2P VoD systems. Another challenging aspect of P2P VoD systems is the use of fault-tolerant design in replicating multimedia files in appropriate quantities. Replication enables the holding of a greater share of media repositories during high service demand; thus, numerous P2P replication schemes have developed for various performance objectives (such as improved startup time, media-file availability, response time). P2P replication schemes can be classified into two major types: active and passive. Passive replication systems are commonly designed for file sharing through download, with a focus on maximizing data-holder value to improve overall file availability or hit rate. However, the video quality of P2P multimedia applications is greatly affected by variations in bandwidth, delay jitter, and packet loss. Proper active replication in the P2P VoD system is necessary to continuously stream video playback of acceptable quality. Constructing P2P VoD advertising mechanisms involves four key issues associated with packet loss during video transmission over P2P networks. The first is the requirement of timely and continuous streaming to meet the playout deadline at the audience site. The second issue is that bandwidth requirements for all aspects of the P2P VoD networks are increasing at a rapid rate (from 200-300 kbit/s to 1-5 Mbit/s [31]). Hence, improving access time and efficient bandwidth utilization over P2P channels is a challenge. The third issue is that the perceived degradation of video quality is often negligible when packet dropping is within acceptable limits. An appropriate data replication scheme should be used to protect video content from network errors (higher priority packets have to be received on time). The last issue is what we call flash crowd: a sudden or prolonged increase in peer arrivals on the P2P overlay networks.
Our proposed method indicates replication locations, according to the proposed distortion estimation method of GOP. Supporting peers are designated by the tracker to compensate for loss or damage arising from unexpected neighbor-peer or network failures. Moreover, the popularity index of clips changes dynamically with time. We organize peers in an unstructured P2P network into an undirected graph topology. G(t) = (Q, E) is defined as the undirected graph comprising a set of participating peers and a set of overlay links at time t. Then, Q is a finite set of peers and E is a set of unordered pair {u, v} of distinct peers in the P2P streaming overlay network, where the population size |Q| is larger than 2. In the P2P overlay network, each peer may download or upload streaming content from multiple peers. The number of replica is proportional to the number of supporting-peers and the level of replication. In addition, the level of replication is chosen depending on the desired video quality required. We assume that the error probabilities are independent of each other. The proposed algorithm is summarized as follows (note that replication process is constantly adjusted to maximize the recovery of video quality and operational efficiency): 1. Input: Graph G(t), the set of on-demand videos V (t), with sort by video popularity distributions, supporting-peers ζ, the desired level of video quality s.

2.
Let v get one video from the set of candidates V (t).

For each candidate peers in v from graph G(t).
Obtain the RTT values within the connections of the candidate peers through pingpong mechanism and TTL constraint. Obtain the channel-sharing ability using expression (4). End for 4. Calculate the error probabilities of the video chunks using expression (2). 5. Estimate the expected video distortion at each GOP in the v: (a) Calculate the expected reconstruction error is denoted D 0 using expression (5).
(b) For each peer within the GOP i of v, find the estimated distortion reduction using expression (7). 6. Remove v from the set of V(t). Repeat the step 2 for the next on-demand video from V(t) until the set is empty or there are no available supporting peers. 7. The dynamic policy of video-chunk replication: In step (1), video popularity is dynamic and changes over time. On-demand videos can be divided into equivalence classes by means of periodic partitioning at several levels according to video popularity distributions. For each level, important video chunks are replicated (based on the step 5 and the desired level of video quality s) by supporting peers ζ with the aim of providing fault tolerance to the system. The number of replicas for each supporting peer is based on a scale constructed from the number of peers within the GOP.
The proposed algorithm constructs a fault tolerance approach to the P2P VoD advertising service, providing groups of participants in a video session with video loss recovery using replicated chunks of importance.

Performance evaluation
This section presents the results of simulation experiments conducted to evaluate the performance of the proposed P2P VoD advertising framework. The experiments compare the performance of the proposed scheme with a random replication strategy (distributing the replicas in a random order) (RR), the bottleneckbased replication method (BR) [30], the collaborative caching method (CC) [29] (described in Section 2), and the proposed method according to four metrics: analysis of server load, analysis of advertisement-delivery rate, testing for departure misses, and the impact of free-riding peers. The collaborative caching method is a method that competes well with the proposed approach because caching is a traditional scheme for managing replicas of data in P2P systems. To ensure a fair comparison, the collaborative caching method was modified to introduce advertisements broadcast to group head peers, using the same number of advertisements. Nonetheless, we assumed that the replica files in the four strategies occupy the same amount of storage space. A simulator was developed for analyzing the behavior of a P2P VoD advertising network under multiple design factors, and a simulation was conducted to compare the performance of the proposed approach under various operating conditions.

Simulation setting
To evaluate the performance of the proposed system, the wavelet coder was used to produce packetized nonlayered bit-streams, and all video sequences (STEFAN,  MOBILE, FOREMAN, COASTGUARD, and TABLE) were stored as CIF versions (352 × 288) of the standard MPEG format. There were two kinds of video on the P2P VoD advertising network: on-demand videos and advertisement videos. The length of the advertisement videos was generally between 17 s and 4 min. For inpage advertisements (video advertisements embedded in a search-engine results page), the most common lengths of play were 30 and 15 s [43,45]; those sequences were modified to expand the length of advertisement-clips to approximately 40 s (15-20 kb, 100 advertisement-clips). The length of the on-demand video followed a normal distribution, ranged from 10 to 60 min, and was encoded using VidWav reference software (developed by Microsoft [46]) at 15 frames per second, with a GOP comprising 64 frames. The number of on-demand videos was 200. We focused on a t + 2D decomposition scheme (first temporal decomposition followed by spatial decomposition) and a four-level 5/3 temporal transform employing three 9/7 spatial decomposition operations. To achieve acceptable peak peak-signal signal-to to-noise ratio (PSNR) value (>40 dB), the desired video quality (PSNR) is set to 40 dB. The length of most on-demand videos was assumed to be between 5 and 15 min [47], and followed a normal distribution.
In the P2P VoD system, each peer was equipped with asymmetric uplink and downlink bandwidths in the overlay network, such as through an asymmetric digital subscriber line. The performance of the system was particularly influenced by the limited uplink bandwidth of participating peers. Based on a study in the literature [48], Table 1 provides the uplink bandwidth distribution of peers, all of whom were collected from the internet, and the residential distribution of peers. In many current operating systems, users are permitted to execute multiple applications simultaneously on a single device. Many internet applications, such as e-mail, internet telephony, and web browsing consume substantial amounts of network bandwidth. Hence, after subtracting non-P2P traffic from the total bandwidth, peers can provide shareable bandwidth in the range from several kbps to around 1000 kbps for shared resources in overlay networks. We assumed that the distribution of bandwidth could be determined by following Table 1, and these properties of bandwidth were employed in the simulation.
The query operation is based on the flooding search algorithm with a TTL constraint. We set TTL = 6 and the network size was 100,000 peers with a default setting of 40% free riding peers with peers randomly assigned to view movie-clips to provide uniform probability. The path length of 90% of the internet maps was under 20 hops, and 99% were no more than 25 hops in length [49]. The communication latency between peers was in the range of 20-300 ms [50]. In this simulation, the distribution of the communication latency values closely approximated a normal distribution. As recommended in [51], a Poisson-like distribution was adopted for user arrival rates. The distribution of video popularity followed a Zipf-like distribution with an α = 0.7 skew as recommended in [47,51], and all copies of the compressed video-clips were stored on the server. Average PSNR was used as a quantitative video quality metric for evaluating the algorithms.

Server load analysis
We conducted two simulations to determine whether the influence of server variability could be reduced using the proposed method. The server load imposed by a large numbers of peers, particularly free riders with simultaneous requests, can result in problems related to performance. Thus, the server load imposed under dynamic network conditions with the proportion of peer number was investigated using 50% free-riding peers. Figure 8 shows that our proposed method outperforms RR, BR, and CC schemes in terms of reduced server bandwidth usage and peer waiting time. There are two reasons for the poor performance of the CC scheme. The first reason is that the limited cache capacity of peers has a remarkable impact on resource-sharing performance. The second is that the influence of free riders on the groups makes it difficult to cache many timevarying data. There were no available resources for collaboration, which increased server stress. On the other hand, supporting-peers with important video chunks were able to satisfy the request of peers, and compensate for the possibility of failure in zones with low resources. The average estimated video distortion proved a good indicator of potential long-term significant improvements in server throughput. Trackers can allocate a large fraction of the important video chunks (carried by supporting-peers) to locations suffering high distortion. Enhancing the averaged resource rate can help to avoid burst traffic and reduce server load in the overall system. The reliance of overhead on the centralized on-demand VoD server limits the scalability of the system in the presence of large and dynamic peers.
Hence, the proposed approach enhances the scalability of the network, and achieves significant cooperative gains in obtaining high performance in large P2P VoD systems. Flash crowd traffic is generated with a small set of popular videos from a large number of peer requests over the internet and server load or end-to-end network bandwidth may suffer large fluctuations due to the flash crowd traffic. Media-segment delivery rate is defined as the percentage of audience-peers that successfully receive requested video chunks. The simulation was conducted by performing simultaneous requests for access to a particular resource (the same group of video-chunks) within a short time interval (300 ms) with 60% free-riding peers. All peers communicate in an unstructured way at a network connection speed of 1.536 Mbps (DS1/T1). As shown in Figure 9, the proposed scheme has the potential to reduce server load and a large number of requests between peers can be properly matched by supporting peers. Therefore, the proposed approach is capable of significantly reducing peak demand at the media server.

Advertising-delivery rate analysis
The advertising service is carried by the supporting peers, with commercial advertisements delivered to the appropriate online audience based on partial matching of the advertising plans of advertisements and the keywords associated with the clips. The proposed scheme significantly increases the chance that an advertisement will be promoted on the online marketing communication channel. The advertisement delivery rate is defined as the percentage of audience peers who receive the advertisement within a fixed time period (1 min). Each advertising video is inserted into a packet buffer of the peer's advertising window, from which it is played. As shown in Figure 10, our advertisement delivery rate is higher than the RR, BR, and CC methods with the network size varying from 500 to 100,000 peers. This set of curves indicates that as the managed group range of the CC method increases in size, it becomes inefficient for a head peer to maintain close bonds with all group members. The advertising can be effectively pushed into the P2P environment due to the ease of adding additional advertising messages.

Analysis of departure misses
In the P2P network, each peer can decide whether and when it wishes to join or leave the VoD session. This simulation examines the behavior of departure misses, with the unexpected failure of peer departure misses following a random Poisson process. During simulation sessions, a default value of 40% free-riding peers was used. Figure 11 shows that in the BR case, the maximum was approximately 20% higher in a limited resource setting. The proposed distortion-based replication method can decrease departure misses and thereby further reduce server load. Some bits in compressed data contain a large amount of information that is very sensitive to error, and channel-induced distortion leads to a perceived degradation in quality related to the reconstructed frames at the decoder. With the proposed method, the multimedia video chunks are protected from a potential loss of quality in the data traffic well.
In the RR scheme, the allocation of replicas is often less than the number of peer requests for a resource; therefore, the performance is much worse in comparison to the BR or proposed methods. In the case of the CC method, it has been shown that a decrease in the cooperative share rate has a dynamic impact on the delivery rate of media chunks, particularly with high departure rate for head peers.

Impact of free-riding peers
As specified in Section 2, free riders make up the majority of peers in P2P overlay networks. In this subsection, we examine the impact of various percentages of free riders. Figure 12 illustrates that the workload of the VoD server can be decreased by more than 20% compared to that of the BR under the maximum number of participating peers. The reason is that the range of video-chunk replicas in BR only considers the network conditions according to the number of playbacks. When the free-riding peers aggregate within continuous groups, the failure rate increased in the presence of resource leaks. Although the performance of the proposed method is slightly worse than in the CC scheme when the number of free riders is less than 20%, an increase in the number of free riders results in a considerable improvement in performance. This is mainly due Figure 11 Comparison of unexpected failure.
to the fact that resource sharing depends on a willingness to cooperate and contribute to the cached data. A lack of sufficient network cooperation for the same video session leads to a competitive disadvantage and a lack of resource sharing. The simulation illustrates that the proposed scheme adapts to the requirements of the P2P VoD system, enabling the supporting peers to share P2P multimedia stream-sharing workloads from the VoD server. The replication algorithm avoids sub-clip misses and reduces the risk of request implosion caused by free-riding peers. Figure 13 shows the comparison of averaged PSNR for the first 256 frames of the video sequences Mobile and Stefan, using different approaches. The results demonstrate that the proposed method is more robust against free riding. When free-riders are a majority in the groups, the proposed scheme has a stronger preference for resource aggregation, particularly when the playing session includes video clips of high popularity and video chunks with a strong impact on distortion. Thus, a given bit budget for supporting peers can be distributed by trackers to improve video quality. By contrast, the RR and BR methods enable downloading of video chunks in the packet buffer by online peers, but those replication strategies do not accurately represent current resource conditions in the P2P VoD network. In the CC method, the lack of priority given to cached video-content for cooperation can reduce video quality. In addition, it is expected that packets (caused by the limited sharing resources that must be accessed serially) would have a longer RTT, implying high packet loss rates, causing the decoded video quality to degrade rapidly.

Conclusions and future work
The importance of video quality enhancement has become increasingly obvious in recent research on P2P technologies and modern television applications. Internet users, who watch online P2P on-demand programs, require an easy-to-use integrated platform to share resources. In a P2P VoD service, the video program needs to be divided into chunks and packetized by source peers, whereupon the original video program is decoded by the receiving peers from chunks within a playback deadline. However the video program is not necessarily reconstructed perfectly due to packet loss, delays, heavy server load, or lack of shared content. Hence, we demonstrate that the proposed distortionbased video-chunk replication is necessary to ensure the continuous delivery of video streaming in high-quality video coding applications. The effects of P2P advertising on society are relevant in an online marketing environment. We conclude that an effective online marketing communication channel is the key to success in terms of both advertising effectiveness and VoD service satisfaction using P2P networks. Simulation results support the hypothesis that video distortion estimation prior to data stream-chunk replication is an efficient tool for balancing load among peers, reducing latency to audience-peers, and improving the overall visual quality for the end-user. Our future study will extend the present results by creating an integrated interactive advertising platform with increased audience-peers interaction, customer retention, and P2P communitydriven advertising. protocol; TTL: time-to-live; UDP: user datagram protocol; VoD: video ondemand.