Queue-based adaptive chunk scheduling for peer-to-peer live streaming
10009396 ยท 2018-06-26
Assignee
Inventors
Cpc classification
H04L65/65
ELECTRICITY
International classification
G06F15/16
PHYSICS
Abstract
A method and apparatus are described for scheduling content delivery in a peer-to-peer network, including receiving a message from a peer, classifying the received message, storing the classified message in one of a plurality of queues based on the classification, generating responses to messages based on a priority of the queue in which the classified message is stored and transmitting content to all peers in the peer-to-peer network. Also described are a method and apparatus for scheduling content delivery in a peer-to-peer network, including receiving one of a message and content from one of a content source server and a peer, classifying the received message, storing the classified message in one of a plurality of queues based on the classification, storing the received content, generating responses to messages based on a priority of the queue in which the classified message is stored and transmitting content to all other peers in the peer-to-peer network.
Claims
1. A method for a content server for scheduling live streaming in a peer-to-peer network comprising: removing by a processor a message from a first message queue for storing messages from peers requesting forwarding-content; transmitting by a processor forwarding-content to a peer from whom said message is sent; and when said first message queue is empty, transmitting by a processor non-forwarding-content to all peers in said peer-to-peer network, wherein said forwarding-content is content to be forwarded by said peer to other peers as non-forwarding content, and non-forwarding-content is content not to be forwarded by said peer to other peers.
2. The method according to claim 1, further comprising: receiving by a processor a joining request from a joining peer, wherein said joining request is a request to join said peer-to-peer network; and storing by a processor said joining request in a second message queue.
3. The method according to claim 2, wherein said second message queue has a higher priority than said first message queue.
4. The method according to claim 2, further comprising responding by a processor to said joining request by transmitting to said joining peer a peer list and contact information for peers already in said peer-to-peer network.
5. The method according to claim 1, further comprising: receiving by a processor a request to recover missing content from a peer; and storing by a processor said joining request in a third message queue.
6. The method according to claim 5, further comprising responding by a processor to said request to recover missing content by transmitting said requested missing content to said peer.
7. The method according to claim 1, wherein said peer sends said message when a threshold set by said peer is reached.
8. An apparatus for a content server for scheduling live streaming in a peer-to-peer network comprising: memory including: a first message queue storing messages from peers requesting forwarding-content from said apparatus, and a content queue storing content to be transmitted to peers in said peer-to-peer network, said content queue including forwarding-content and non-forwarding-content; and a processor configured to transmit said content based on the status of said first message queue, and further wherein when said first message queue is non-empty, said processor transmits forwarding-content to a peer in response to a message sent by said peer in said first message queue, and when said first message queue is empty, said processor transmits non-forwarding-content to all peers in said peer-to-peer network, wherein said forwarding-content is content to be forwarded by said peer to other peers as non-forwarding content, and non-forwarding-content is content not to be forwarded by said peer to other peers.
9. The apparatus according to claim 8, wherein said memory further includes a second message queue and said processor is configured to store joining requests from joining peers in said second message queue, wherein said joining request is a request sent by a peer to join said peer-to-peer network.
10. The apparatus according to claim 9, wherein said second message queue has a higher priority than said first message queue.
11. The apparatus according to claim 9, wherein said memory further includes a management message queue for a peer and said processor is configured to store in said management message queue responses to joining requests in said second message queue sent by said peer.
12. The apparatus according to claim 8, wherein said memory further includes a third message queue and said processor is configured to store in said third message queue requests from peers to recover missing content.
13. The apparatus according to claim 12, wherein said memory further includes a recovery queue and said processor is configured to store in said recovery queue missing content requested by a peer in response to a request in said third message queue sent by said peer.
14. The apparatus according to claim 8, wherein said peer sends said message when a threshold set by said peer is reached.
15. A method for a peer for scheduling live streaming in a peer-to-peer network comprising: sending by a processor a message requesting for forwarding-content to a content server; receiving by a processor requested forwarding-content from said content server; and transmitting as non-forwarding content by a processor said received forwarding-content to other peers in said peer-to-peer network, wherein said forwarding-content is content to be forwarded by said peer to other peers and non-forwarding-content is content not to be forwarded by said peer to other peers.
16. The method according to claim 15, wherein said transmitting step comprises storing said received forwarding-content into at least one content forwarding queue; and transmitting content in said at least one content forwarding queue to other peers in said peer-to-peer network.
17. The method according to claim 16, wherein said message requesting for forwarding-content is sent to said content server when a size of said at least one content forwarding queue is below a given threshold.
18. The method according to claim 17, wherein there is one content forwarding queue for each of other peers and said size of said at least one content forwarding queue is determined as an average queue size of said at least one content forwarding queue.
19. The method according to claim 17, wherein said message requesting for forwarding-content is sent to said content server when said at least one content forwarding queue is empty.
20. The method according to claim 15, further comprising receiving by a processor non-forwarding-content from at least one of said content server and other peers in said peer-to-peer network.
21. The method according to claim 15, wherein said transmitted forwarding-content is received by said other peers as non-forwarding-content.
22. The method according to claim 15, further comprising: receiving by a processor a request to recover missing content from a requesting peer; and transmitting by a processor said requested missing content to said requesting peer.
23. An apparatus for a peer for scheduling live streaming in a peer-to-peer network comprising: memory, including a playback buffer storing received content from at least one of said content server and other peers; and a processor configured to: send a message requesting for forwarding-content to a content server in said peer-to-peer network, and filter content in said playback buffer to obtain forwarding-content for transmitting to other peers, wherein said forwarding-content is content to be forwarded by said peer to other peers as non-forwarding content, and non-forwarding-content is content not to be forwarded by said peer to other peers.
24. The apparatus according to claim 23, wherein said memory further includes at least one forwarding queue and said processor is further configured to store in said at least one forwarding queue forwarding-content to other peers in said peer-to-peer network.
25. The apparatus according to claim 24, wherein said processor is configured to send a message requesting for forwarding-content to said content server when a size of said at least one content forwarding queue is below a given threshold.
26. The apparatus according to claim 25, wherein said at least one forwarding queue comprises one content forwarding queue for each of other peers and said size of said at least one content forwarding queue is determined as an average queue size of said at least one content forwarding queue.
27. The apparatus according to claim 25, wherein said processor is configured to send said message requesting for forwarding-content to said content server when said at least one content forwarding queue is empty.
28. The apparatus according to claim 23, wherein said transmitted forwarding-content is received by said other peers as non-forwarding-content.
29. The apparatus according to claim 23, wherein said memory further includes a recovery message queue and said processor is further configured to store in said recovery message queue requests from peers to recover missing content, and said memory further includes a recovery content queue and said processor is further configured to store in said recovery content queue missing content requested by a peer in response to a request in said recovery message queue sent by said peer.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
(1) The present invention is best understood from the following detailed description when read in conjunction with the accompanying drawings. The drawings include the following figures briefly described below:
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10)
(11)
(12)
(13)
(14)
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
(15) It has been shown in the prior art that given a content source server and a set of peers with known upload capacities, the maximum streaming rate, r.sup.max is governed by the following formula:
(16)
where u.sub.s is content source server's upload capacity, u.sub.i is peer i's upload capacity, and there are n peers in the system. The prior art proposed a centralized scheduling method that could achieve the above streaming rate maximum/upper bound. The prior art scheduling method employs a centralized approach with a coordinator managing the system. The coordinator gathers information regarding each peer's upload capacity and the content source's upload capacity. The coordinator then computes the transmission rate from the content source to individual peers based on the centralized scheduling method. Each peer relays some of the received streaming content to all other peers.
(17) To put the present invention in context, how to calculate the streaming rate from the content source to the peers is discussed first. Then the queue-based scheduling method of the present invention is described. The queue-based scheduling method of the present invention does not require the central coordinator and is still able to achieve the maximum streaming rate.
(18) The maximum streaming rate in a P2P system is governed by Equation (1). The second term on the right-hand side of equation,
(19)
is the average upload capacity per peer. The centralized scheduling method behaves differently based on the relationship between the content source's upload capacity and the average upload capacity per peer.
(20) Taking two exemplary cases/scenarios: in the first case, the content source server's upload capacity is smaller than the average of the peers' upload capacity and in the second case, the content source server's upload capacity is far greater than the average of the peers' upload capacity. In the first scenario, the content source server is resource poor and in the second scenario the content source server is resource rich.
(21) Case 1:
(22)
(23) The maximum streaming rate is r.sup.max=u.sub.s. The content stream is divided into n sub-streams (one sub-stream for each peer), with the i-th sub-stream having a rate of
(24)
Note that the aggregate rate of the n sub-streams is equal to the maximum streaming rate, i.e.,
(25)
(26) The coordinator requests the server to send the i-th sub-stream to the i-th peer. Furthermore, because (n1)s.sub.iu.sub.i, the i-th peer transmits this sub-stream to each of the other n1 peers. Thus, each peer receives a sub-stream directly from the server and also receives n1 additional sub-streams from the other n1 peers. The total rate at which peer i receives the entire stream (all n sub-streams) is
(27)
Hence the maximum rate r.sup.max=u.sub.s can be supported.
Case 2:
(28)
(29) Here
(30)
The content stream is divided into n+1 sub-streams with the i-th sub-stream, where i=1, 2, . . . , n, having the rate s.sub.i=u.sub.i/(n1) and the (n+1)-st sub-stream having rate
(31)
(32) Clearly s.sub.i0 for all i=1, 2, . . . , n+1. Now the server sends two sub-streams to each peer i: the i-th sub-stream and the (n+1)-st substream. The server can do this because
(33)
Furthermore, peer i streams a copy of the i-th sub-stream to each of the n1 other peers. Each peer i can do this because (n1)s.sub.i=u.sub.i. The total rate at which peer i receives the entire stream (all n sub-streams) is
(34)
Hence, the maximum rate
(35)
can be supported.
(36)
(37) Next the queue-based scheduling method of the present invention is described. The maximum streaming rate can be achieved without using a centralized coordinator. The decentralized scheduling method of the present invention is a queue-based adaptive chunk scheduling method.
(38) Ideally, in a P2P system, peers only exchange information with other peers and make decisions locally. Thus, ideally, no central coordinator is required and no global information is collected. Furthermore, the actual available upload capacity varies over time. This requires the central coordinator to continuously monitor each peer's upload capacity and continuously re-compute the sub-stream rate to individual peers. Hence, a decentralized scheduling method is desirable. The difficulty is how to design a decentralized (local) scheduling method that is still able to achieve the global optimum, i.e., the maximum streaming rate of the system. The queue-based decentralized scheduling method of the present invention satisfies the above objectives.
(39)
(40)
(41)
(42) Next, the optimality of the queue-based data chunk scheduling method of the present invention is shown. That is, the queue-based scheduling method for both the peer-side and the server-side achieves the maximum P2P live streaming rate of the system as indicated by Equation (1).
(43) Theorem: Assume that the signal propagation delay between a peer and the server is negligible and the data content can be transmitted at an arbitrary small amount, then the queue-based decentralized scheduling algorithm as described above achieves the maximum streaming rate possible in the system.
(44) Proof: Suppose the content is divided into small chunks. The content source server sends out one chunk each time it services a pull signal. A peer issues a pull signal to the server whenever the peer's forwarding queue becomes empty. denotes the chunk size.
(45) For peer i, it takes (n1).Math./u.sub.i time to forward one data chunk to all peers. Let r.sub.i be the maximum rate at which the pull signal is issued by peer i. Hence, r.sub.i=u.sub.i/(n1).
(46) The maximum aggregate rate of pull signal received by the server, r, is
(47)
It takes the server /u.sub.s time to service a pull signal. Hence, the maximum pull signal rate the server can accommodate is u.sub.s/. Now consider the following two scenarios/cases:
Case 1:
(48)
(49) In this scenario, the server cannot handle the maximum pull signal rate. The signal queue at the server side is hence never empty and the entire server bandwidth is used to transmit F marked content to peers. In contrast, a peer's forwarding queue becomes idle while waiting for the new data content from the source server. Since each peer has sufficient upload bandwidth to relay the F marked content (received from the server) to all other peers, the peers receive content sent out by the server at the maximum rate.
(50) The supportable streaming rate is equal to the server's upload capacity. The condition
(51)
is equivalent to
(52)
i.e., the scenario in which the server is resource poor described above. Hence, the streaming rate is consistent with Equation (1) and the maximum streaming rate is reached.
Case 2:
(53)
(54) In this scenario, the server has the upload capacity to service the pull signals at the maximum rate. During the time period when the pull signal queue is empty, the server transmits duplicate NF marked content to all peers. The amount of upload capacity used to service F marked content is
(55)
(56) The server's upload bandwidth used to service NF marked content is, therefore
(57)
For each individual peer, the rate of receiving NF marked content from the server is
(58)
Since there are n peers in the system, the supportable streaming rate for the peers is:
(59)
The condition
(60)
is equivalent to
(61)
i.e. the scenario in which the server is resource rich described above. Again, the streaming rate reaches the upper bound as indicated in Equation (1).
(62) Note that in case 2 where the aggregate pull signal arrival rate is smaller than the server's service rate, it is assumed that the peers receive F marked content immediately after issuing the pull signal. The above assumption is true only if the pull signal does not encounter any queuing delay and can be serviced immediately by the content source server. This means that (i) no two pull signals arrive at the exact same time and (ii) a pull signal can be serviced before the arrival of next incoming pull signal. Assumption (i) is commonly used in queuing theory and is reasonable since a P2P system is a distributed system with respect to peers generating pull signals. The probability that two pull signals arrive at exactly the same time is low. Assumption (ii) means that the data can be transmitted in arbitrary small amounts, i.e., the size of data chunk, , can be arbitrarily small. In practice, the size of data chunks is limited in order to reduce the overhead associated with data transfers.
(63) Implementation considerations in realizing the above scheme in practice are now discussed. The architecture of content source server and peers using the queue-based data chunk scheduling method of the present invention are now described with an eye toward practical implementation considerations including the impact of chunk size, network congestion and peer chum.
(64) In the optimality proof, it was assumed that the chunk size could be arbitrarily small and the propagation delay was negligible. In practice, the chunk size is on the order of kilo-bytes to avoid excessive transmission overhead caused by protocol headers. The propagation delay is on the order of tens to hundreds of milliseconds. Hence, it is necessary to adjust the timing of issuing pull signals by the peers and increase the number of F marked chunks served at the content source server to allow the queue-based scheduling method of the present invention to achieve close to the maximum live streaming rate.
(65) At the server side, K F marked chunks are transmitted as a batch in response to a pull signal from a requesting peer (via the F marked content queue). A larger value of K would reduce the pull signal frequency and thus reduce the signaling overhead. This, however, increases peers' startup delay. When the pull signal queue is empty, the server's forwarding queue forwards one chunk at a time to all peers in the system. The arrival of a new pull signal preempts the forwarding queue activity and the F marked content queue services K chunks immediately.
(66) Referring now to
(67) How to set the value of T.sub.i properly is considered next. The time to empty the forwarding queue with T.sub.i chunks is t.sub.i.sup.empty=(n1)T.sub.i/u.sub.i. Meanwhile, it takes t.sub.i.sup.receive=2t.sub.si+K/u.sub.s+t.sub.q for peer i to receive K chunks after it issues a pull signal. Here t.sub.si is the propagation delay between the content source server and peer i, K/u.sub.s is the time required for server to transmit K chunks, and t.sub.q is queuing delay seen by the pull signal at the server pull signal queue. In order to receive the chunks before the forwarding queue becomes fully drained, t.sub.i.sup.emptyt.sub.i.sup.receive. This leads to
T.sub.i(2t.sub.si+K/u.sub.s+t.sub.q)u.sub.i/(n1)(2)
(68) All quantities are known except t.sub.q, the queuing delay incurred at the server side pull signal queue. In case 1, where the content source server is the bottleneck (the content source server is resource poor), the selection of T.sub.i will not affect the streaming rate as long as the server is always busy. In case 2, since the service rate of signal queue is faster than the pull signal rate, t.sub.q is very small. So t.sub.q can be set to zero, i.e.,
T.sub.i(2t.sub.si+K/u.sub.s)u.sub.i/(n1)(3)
(69) The peers' startup delay is computed next. denotes the startup delay. Given a peer has a full queue with T.sub.i number of marked chunks, it takes
T.sub.i(n1)/u.sub.i=2t.sub.si+K/u.sub.s(4)
(70) to send chunks to all other peers. Notice that the time required to clean up the queue is the same for all peers. During this time period, a peer is able to receive the cached chunks from other peers. Hence the startup delay is =2t.sub.si+K/u.sub.s.
(71) The content source server responds to the pull signals from peers and pushes NF marked content proactively to peers. The content source server is also the bootstrap node. As the bootstrap node, the content source server also manages peer information (such as peer id, IP address, port number, etc.) and replies to the request for peer list from incoming new peers.
(72)
(73) There is one out-unit for each destination peer to handle the data transmission process.
(74) Different queues are used for different types of traffic in order to prioritize the traffic types. Specifically, management messages have the highest priority, followed by F marked content and NF marked content. The priority of recovery chunks can be adjusted based on design requirements. Management messages have the highest priority because it is important for the system to run smoothly. For instance, by giving management messages the highest priority the delay for a new peer to join the system is shortened. When a new peer issues a request to the content source server to join the P2P system, the peer list can be sent to the new/joining peer quickly. Also, management messages are typically small in size compared to content messages. Giving higher priority to management message reduces overall average delay. The content source server replies to each pull signal with K F marked chunks. F marked chunks are further relayed to other peers by the receiving peer. The content source server sends out a NF marked chunk to all peers when the pull signal queue is empty. NF marked chunks are used by the destination peer only and will not be relayed further. Therefore, serving F marked chunk promptly improves the utilization of peers' upload capacity and increases the overall P2P system live streaming rate. Locating and serving recovery chunks should be a higher priority than NF marked chunk delivery since missing chunks affect the viewing quality significantly. If the priority of forwarding recovery chunks is set to be higher than that of F marked chunks, viewing quality gets preferential treatment over system efficiency. In contrast, if F marked chunks receive higher priority, the system efficiency is given higher priority. The priority scheme selected depends on the system design goal.
(75) Another reason for using separate queues is to deal with bandwidth fluctuation and congestion within the network. Many P2P researchers assume that server/peer's upload capacity is the bottleneck. In recent experiments over PlanetNet, it has been observed that some peers may slow down significantly due to congestion. If all the peers share the same queue, the uploading to the slowest peer will block the uploading to remaining peers. The server's upload bandwidth will be wasted. This is similar to the head-of-line blocking problem in input-queued switch design: an input queue will be blocked by a packet destined for a congested output port. The switching problem was solved by placing packets destined to different output ports in different virtual output queues. Here a similar solution is adopted by using separate queues for different peers. Separate queues avoid inefficient blocking caused by slow peers. Separate queues allow more accurate estimation of the amount of queued content, too. This is important for peers to determine when to issue pull signals.
(76) Referring now to
(77)
(78) Peer churn and network congestion may cause chunk losses. Sudden peer departure, such as node or connection failure, leaves the system no time to reschedule the chunks still buffered in the peer's out-unit. In case the network routes are congested to some destinations, the chunks waiting to be transmitted may overflow the queue in the out-unit, which leads to chunk losses at the receiving end. The missing chunk recovery scheme of the present invention enables the peers to recover the missing chunks to avoid viewing quality degradation.
(79) Referring to
(80)
where R is the streaming rate of the system as indicated in Equation (1), and is the startup delay. The first term in the above equation is the sum of all F marked chunks cached at all peers. The second term is the number of NF marked chunks sent out by the server. The download window size is a function of startup delay. Intuitively, it takes the startup delay time to receive all chunks in the download window. The chunks in the download window arrive out of order since the chunks are sent out in parallel from out-units in each peer. This accounts for the startup delay time being at least of . In practice, the startup delay has to be increased to accommodate the time period introduced by playback window and recovery windows.
(81) Heuristics are employed to recover the missing chunks. If peers leave gracefully, the server is notified and the F marked chunks waiting in the out-unit will be assigned to other peers. The missing chunks falling into the recovery window are recovered as follows. First, the recovery window is further divided into four sub-windows. Peers send the chunk recovery messages to the source server directly if the missing chunks are in the window closest in time to the playback window because these chunks are urgently needed or the content quality will be impacted if these chunks are not received in time. An attempt is made to recover the missing chunks in the other three sub-windows from other peers. A peer randomly selects three recovery peers from the peer list, and associates one with each sub-window. The peer need recovery chunks sends chunk recovery messages to the corresponding recovery peers. By randomly selecting a recovery peer, the recovery workload is evenly distributed among all peers.
(82)
(83)
(84)
(85) It is to be understood that the present invention may be implemented in various forms of hardware, software, firmware, special purpose processors, or a combination thereof. Preferably, the present invention is implemented as a combination of hardware and software. Moreover, the software is preferably implemented as an application program tangibly embodied on a program storage device. The application program may be uploaded to, and executed by, a machine comprising any suitable architecture. Preferably, the machine is implemented on a computer platform having hardware such as one or more central processing units (CPU), a random access memory (RAM), and input/output (I/O) interface(s). The computer platform also includes an operating system and microinstruction code. The various processes and functions described herein may either be part of the microinstruction code or part of the application program (or a combination thereof), which is executed via the operating system. In addition, various other peripheral devices may be connected to the computer platform such as an additional data storage device and a printing device.
(86) It is to be further understood that, because some of the constituent system components and method steps depicted in the accompanying figures are preferably implemented in software, the actual connections between the system components (or the process steps) may differ depending upon the manner in which the present invention is programmed. Given the teachings herein, one of ordinary skill in the related art will be able to contemplate these and similar implementations or configurations of the present invention.