[IEEE 2009 Pacific-Asia Conference on Circuits, Communications and Systems (PACCS) - Chengdu, China...

4
Layered Network Coding and Hierarchical Network Coding for Peer-to-Peer Streaming Jingjing Si *† Bojin Zhuang * Anni Cai * Yinbo Cheng * * School of Information Engineering, Beijing University of Posts and Telecommunications, Beijing, China School of Information Engineering, Yanshan University, Qinhuangdao, China [email protected], {bjzhuang, annicai}@bupt.edu.cn, [email protected] Abstract—This paper investigates Layered Network Coding (LNC) and Hierarchical Network Coding (HNC) for Peer-to- Peer live multimedia streaming. By combining the hierarchy of layered source coding with random network coding, we implement both LNC and HNC according to the importance order of encoded source layers. At the playback deadline, if currently received data are not enough to recover the original data completely, the most important layers can be recovered to maintain the smooth playback. A tuning scheme for the generating probabilities in HNC is also proposed, which takes into account both the priority and the length of each layer. Simulation results show that both LNC and HNC can recover the important layers earlier than the general network coding. Keywords-hierarchical network coding; layered network coding;network coding;Peer-to-Peer (P2P) I. INTRODUCTION Network coding has emerged as a promising approach to improve the performance of network transmissions. It is effective due to intermediate nodes’ additional abilities of encoding and decoding data at the packet level. The theory of network coding was first proposed and studied by Ahlswede et al. [1]. Since then, more and more research interests are paid on this area, from theoretical studies on achievable flow rates [2] and code assignment algorithms [3], to practical studies on applying network coding in a practical setting [4]. In recent years, some works have shown that network coding can also improve the performance of Peer-to-peer (P2P) networks. Avalanche proposed in [5] has demonstrated that network coding can be used in the large-scale content distribution and the throughput provided by network coding is 2--3 times larger than that of non-network coding. Moreover, network coding can improve the robustness of the system and solve the problem caused by ‘‘rare blocks’’. P2P live streaming applications, however, have marked a significant difference from the traditional applications of content distribution. Its most critical requirement is to maintain the smooth playback. Liu et al. has showed in [6] that network coding could decrease the peers’ average playback delay. Wang et al. [7] has implemented an experimental testbed and evaluated the benefits and tradeoffs involved when network coding is used in P2P live media streaming. One shortcoming of using network coding in P2P live multimedia streaming is that it incurs an additional delay before any original data can be recovered, especially when current available bandwidth is low. Though Nguyen et al. [8] has proposed a Hierarchical Network Coding (HNC) scheme based on the multi-sender streaming framework, real encoding and decoding processes were not discussed. In this paper, we investigate Layered Network Coding (LNC) and HNC for P2P live multimedia streaming. We implement network coding according to the importance order of encoded source layers. Then, the important layers will be recovered early. At the playback deadline, if currently received blocks are not enough to recover the original data completely, the most important layers can be recovered to maintain the smoothness of playback. We also propose a tuning scheme for the generating probabilities of different types of coded blocks in HNC. Simulation results show that both LNC and HNC can recover the important layers with fewer received blocks than the general network coding. Moreover, our tuning scheme for the generating probability is reasonable and conforms to the advantages of HNC. II. P2P STREAMING WITH NETWORK CODING We divide the original video data on the server into many segments based on the unit of group of pictures (GOP). Each segment is assigned a global Segment ID according to its playback sequence. Each segment is further divided into N data blocks with equal block size. In this paper, we implement network coding on each individual segment. Hence, the data blocks referred in the residual of this paper correspond to the same segment without specially declared. Let 1 B , 2 B ,…, N B denote the N original data blocks of a segment. Denote q F as a finite field of size q . Initially, we suppose that the buffers of all peer nodes are empty and that node A contracts the server to get a block. Then, the server will produce a N -dimensional random coefficient vector T 1 2 [ , ,..., ] N f f f = f over field q F , and generate a coded block E as 1 1 2 2 ... N N E fB fB fB = + + + . (1) The server transmits the coded block E and its meta- information to node A according to the format illustrated in Fig.1. Here, Segment ID and coefficient vector f are defined as the meta-information of coded block E . Suppose that node A contracts the server again to get another block. The server will randomly produce another coded block E, and then transmit it to node A . Now, there are two coded blocks cached in the buffer of node A . At this time, if a neighbor node such as B sends a request to node A to get a block, node A will perform a 2009 Pacific-Asia Conference on Circuits,Communications and System 978-0-7695-3614-9/09 $25.00 © 2009 IEEE DOI 10.1109/PACCS.2009.111 139

Transcript of [IEEE 2009 Pacific-Asia Conference on Circuits, Communications and Systems (PACCS) - Chengdu, China...

Page 1: [IEEE 2009 Pacific-Asia Conference on Circuits, Communications and Systems (PACCS) - Chengdu, China (2009.05.16-2009.05.17)] 2009 Pacific-Asia Conference on Circuits, Communications

Layered Network Coding and Hierarchical Network Coding for Peer-to-Peer Streaming

Jingjing Si*† Bojin Zhuang* Anni Cai* Yinbo Cheng* *School of Information Engineering, Beijing University of Posts and Telecommunications, Beijing, China

†School of Information Engineering, Yanshan University, Qinhuangdao, China [email protected], {bjzhuang, annicai}@bupt.edu.cn, [email protected]

Abstract—This paper investigates Layered Network Coding (LNC) and Hierarchical Network Coding (HNC) for Peer-to-Peer live multimedia streaming. By combining the hierarchy of layered source coding with random network coding, we implement both LNC and HNC according to the importance order of encoded source layers. At the playback deadline, if currently received data are not enough to recover the original data completely, the most important layers can be recovered to maintain the smooth playback. A tuning scheme for the generating probabilities in HNC is also proposed, which takes into account both the priority and the length of each layer. Simulation results show that both LNC and HNC can recover the important layers earlier than the general network coding.

Keywords-hierarchical network coding; layered network coding;network coding;Peer-to-Peer (P2P)

I. INTRODUCTION Network coding has emerged as a promising approach

to improve the performance of network transmissions. It is effective due to intermediate nodes’ additional abilities of encoding and decoding data at the packet level. The theory of network coding was first proposed and studied by Ahlswede et al. [1]. Since then, more and more research interests are paid on this area, from theoretical studies on achievable flow rates [2] and code assignment algorithms [3], to practical studies on applying network coding in a practical setting [4].

In recent years, some works have shown that network coding can also improve the performance of Peer-to-peer (P2P) networks. Avalanche proposed in [5] has demonstrated that network coding can be used in the large-scale content distribution and the throughput provided by network coding is 2---3 times larger than that of non-network coding. Moreover, network coding can improve the robustness of the system and solve the problem caused by ‘‘rare blocks’’.

P2P live streaming applications, however, have marked a significant difference from the traditional applications of content distribution. Its most critical requirement is to maintain the smooth playback. Liu et al. has showed in [6] that network coding could decrease the peers’ average playback delay. Wang et al. [7] has implemented an experimental testbed and evaluated the benefits and tradeoffs involved when network coding is used in P2P live media streaming.

One shortcoming of using network coding in P2P live multimedia streaming is that it incurs an additional delay before any original data can be recovered, especially when current available bandwidth is low. Though Nguyen et al.

[8] has proposed a Hierarchical Network Coding (HNC) scheme based on the multi-sender streaming framework, real encoding and decoding processes were not discussed.

In this paper, we investigate Layered Network Coding (LNC) and HNC for P2P live multimedia streaming. We implement network coding according to the importance order of encoded source layers. Then, the important layers will be recovered early. At the playback deadline, if currently received blocks are not enough to recover the original data completely, the most important layers can be recovered to maintain the smoothness of playback. We also propose a tuning scheme for the generating probabilities of different types of coded blocks in HNC. Simulation results show that both LNC and HNC can recover the important layers with fewer received blocks than the general network coding. Moreover, our tuning scheme for the generating probability is reasonable and conforms to the advantages of HNC.

II. P2P STREAMING WITH NETWORK CODING We divide the original video data on the server into

many segments based on the unit of group of pictures (GOP). Each segment is assigned a global Segment ID according to its playback sequence. Each segment is further divided into N data blocks with equal block size. In this paper, we implement network coding on each individual segment. Hence, the data blocks referred in the residual of this paper correspond to the same segment without specially declared.

Let 1B , 2B ,…, NB denote the N original data blocks of a segment. Denote qF as a finite field of size q . Initially, we suppose that the buffers of all peer nodes are empty and that node A contracts the server to get a block. Then, the server will produce a N -dimensional random coefficient vector T

1 2[ , ,..., ]Nf f f=f over field qF , and generate a coded block E as

1 1 2 2 ... N NE f B f B f B= + + + . (1) The server transmits the coded block E and its meta-

information to node A according to the format illustrated in Fig.1. Here, Segment ID and coefficient vector f are defined as the meta-information of coded block E .

Suppose that node A contracts the server again to get another block. The server will randomly produce another coded block E′ , and then transmit it to node A . Now, there are two coded blocks cached in the buffer of node A . At this time, if a neighbor node such as B sends a

request to node A to get a block, node A will perform a

2009 Pacific-Asia Conference on Circuits,Communications and System

978-0-7695-3614-9/09 $25.00 © 2009 IEEE

DOI 10.1109/PACCS.2009.111

139

Page 2: [IEEE 2009 Pacific-Asia Conference on Circuits, Communications and Systems (PACCS) - Chengdu, China (2009.05.16-2009.05.17)] 2009 Pacific-Asia Conference on Circuits, Communications

random linear combination of its two cached blocks E and E′ , and then transmit the coded block 1 2E r E r E′′ ′= + to node B . Here, 1r and 2r are randomly chosen over field qF . That is, whenever a node or the server is requested to transmit a block to another node, it produces a random linear combination of all blocks it currently caches, and transmits the generated block in the format shown in Fig.1.

Any node can recover the original segment after receiving N coded blocks, as long as their associated coefficient vectors are linearly independent. Suppose the received blocks are 1E , 2E ,…, NE , and the coefficient vector associated with iE is if . Thus, the original N blocks of the segment can be recovered as

11 2 1 2 1 2[ , ,..., ] [ , ,..., ] [ , ,..., ]N N NB B B E E E −= ⋅ f f f . (2)

Segment ID Coefficient Vector Data Block

Figure 1. Coded block’s format for network coding.

The advantages of using network coding in P2P streaming are: a) reducing the redundancy storage, b) eliminating the need for tight synchronization between peer nodes [8]. However, a node has to receive at least N coded blocks before it can recover any original block of the current segment. This potentially introduces unnecessary delay for multimedia streaming applications.

III. LNC AND HNC FOR P2P STREAMING Layered source coding has the ability to combat the

fluctuating and limited available bandwidth. Taking use of the hierarchy of layered source coding, we investigate LNC and HNC for P2P live multimedia streaming in this section.

Suppose that on the server each segment of the original source data is separately encoded into L layers. Layer 1 is the base layer, which is most important for reasonable reconstruction of the original source data. Layer 2 to layer L are enhancement layers and are organized in a hierarchical fashion, such that layer l is more important than layer 1l + , where 2 1l L≤ ≤ − . Each layer l is further divided into ln blocks with equal block size, where 1 l L≤ ≤ . For the convenience of comparison, we assume that the block sizes of all layers are equal.

A. P2P Streaming with LNC By layered network coding, we refer to performing

network coding on each layer separately. For each segment, denote ,1lB , ,2lB ,…, , ll nB as the ln original blocks of layer l , where 1 l L≤ ≤ . We now demonstrate our realization of LNC.

Initially, we suppose that the buffers of all nodes are empty and that node A contracts the server to get a block. The server will first produce a 1n -dimensional random coefficient vector

1

T1 1,1 1,2 1,[ , ,..., ]nf f f=f over field qF ,

and then generate a coded block 1E of layer 1 as

1 11 1,1 1,1 1,2 1,2 1, 1,... n nE f B f B f B= + + + . (3)

The server transmits the coded block 1E and its meta-information to node A according to the format illustrated in Fig.2. Here, we define the Layer ID in the block’s meta-information as well.

Segment ID Layer ID Coefficient

Vector Data Block

Figure 2. Coded block’s format for LNC.

By this way, node A can continue getting coded blocks of layer 1. Once node A has received 1n coded blocks of layer 1 such that their associated 1n -dimensional coefficient vectors are linearly independent, A can recover layer 1. After that, if node A contracts the

server again to get another block, the server will generate and transmit a coded block of layer 2. Following above process, node A receives coded blocks in the increasing order of Layer ID.

Now assume that node A have received kc ( 0≠ ) coded blocks of layer k . At this time, if a neighbor node such as B sends a request to node A to get a block of layer k , node A will generate a random linear combination of all kc coded blocks of layer k cached in its buffer, and transmit the generated block to node B .

When LNC is used, each node requests coded blocks from the server or its neighbor nodes according to the increasing order of Layer ID. After receiving enough blocks to recover layer l , it signals the server or its neighbor nodes to transmit the coded block of layer 1l + , where 1 1l L≤ ≤ − . Hence, each node receives the coded blocks for important layers early. At the playback deadline of the current segment, if received blocks are not enough to recover the original segment completely, at least the most important layers can be recovered. Thus, smooth playback could be maintained.

B. P2P Streaming with HNC By hierarchical network coding, we refer to

performing network coding on different numbers of layers. If the original segment is encoded into L layers, L types of network coding can be performed on each segment. For type k , 1 k L≤ ≤ , all original blocks that belong to the first k layers are linearly combined to generate a coded block.

For each data segment, denote ,1lB , ,2lB ,…, , ll nB as the

ln original blocks of layer l , where 1 l L≤ ≤ . Now, we demonstrate our realization of HNC for P2P streaming.

1) Encoding Initially, we suppose that the buffers of all nodes are

empty and that node A contracts the server to get a block. The server will first determine the type of the coded block to be generated. If the determined type is k , 1 k L≤ ≤ , the server will produce a kN -dimensional random

coefficient vector kf over field qF , where 1

kk ll

N n=

=∑ ,

and generate a coded block kE of type k as:

1 1 2 21,1 1,1 1, 1, 2,1 2,1 2, 2,( ... ) ( ... )kn n n nE f B f B f B f B= + + + + +

,1 ,1 , ,... ( ... )k kk k k n k nf B f B+ + + + , (4)

140

Page 3: [IEEE 2009 Pacific-Asia Conference on Circuits, Communications and Systems (PACCS) - Chengdu, China (2009.05.16-2009.05.17)] 2009 Pacific-Asia Conference on Circuits, Communications

where 1 2

T1,1 1, 2,1 2, ,1 ,[ ,..., , ,..., ,..., ,..., ]

k

kn n k k nf f f f f f=f .

The server will transmit the coded block kE and its meta-information to node A according to the format illustrated in Fig.3. Here, we define the Type ID in the block’s meta-information as well.

Following the above process, node A can continue contracting the server to get more coded blocks. Now assume that node A have received kc blocks of type k , where 1 k L≤ ≤ . At this time, if a neighbor node such as B sends a request to node A to get a block, node A will first randomly determine the type of the coded block to be generated. If the determined type is k , node A will produce a random linear combination of all kc blocks of type k cached in its buffer, and transmit the generated block to node B according to the format illustrated in Fig.3.

Segment ID Type ID Coefficient

Vector Data Block

Figure 3. Coded block’s format for HNC.

2) Decoding At the playback deadline of current segment, if a node

has received kN coded blocks of the first k types such that their associated kN -dimensional coefficient vectors are linear independent, this node can recover the first k layers of the current source segment. (To determine the independency, the rN -dimensional coefficient vectors associated with the received coded blocks of type r , 1 r k≤ < , should be padded by zeros to length kN .) Hence, by applying our HNC in P2P streaming, the most important layers can be recovered early with high probability.

3) Tuning generating probabilities In our HNC, when a node contacts the server to get a

block, the server will first determine the type of the coded block to be generated. For a node, when one of its neighbor nodes contacts it to get a block, it just generates and transmits a new coded block of a random type. Hence, the generating probabilities for different types of coded blocks at the server would affect the relative numbers of different types of coded blocks that any node receives.

If the probabilities for generating blocks of lower types are very high, a node can receive enough blocks to recover the most important layers easily. However, too many redundant blocks of lower types might waste the limited available bandwidth that could be used to transmit the blocks of higher types. Thus, higher layers may be difficult to recover. On the other hand, if the probabilities for generating blocks of higher types are very high, the advantages of HNC will be obliterated.

Here, we propose a special scheme to determine the generating probabilities for different types of coded blocks. Our goal is to consider the tradeoff between a) guaranteeing the early recovery of the most important layers and b) decreasing the redundant blocks received by a node to recover the original segment completely.

We define parameter lp as the probability of the server to generate the coded blocks of type l , where

1

l ll L

i ii

np

α=

=∑

. (5)

We use a L -dimensional priority vector 1 2[ , ,..., ]Lα α α=α to describe the priorities of the original

layers, where any priority value iα for layer i , 1 i L≤ ≤ , is a number between 0 and 1. This priority vector can be determined in the layered encoder by evaluating each layer’s relative contribution to the reconstruction of the original segment. The layer with higher contribution will correspond to a larger priority value.

On the other hand, we involve the L -dimensional length vector 1 2[ , ,..., ]Ln n n=n in (5), where in is the number of original blocks that belong to layer i , 1 i L≤ ≤ . Our goal is to take into account the practically needed numbers of coded blocks for a specific layer. For example, if there are only a small number of original blocks with high priorities, there is no need to generate too many coded blocks of those types.

IV. SIMULATION RESULTS The objective of our simulation is to demonstrate the

performance of our LNC and HNC, compared with the general network coding. We assume that node X is a newly joined node, which has 4 neighbor nodes: A , B , C , and D . In each round, node X contacts every neighbor node to get a new coded block. We compare the numbers of rounds that node X needs to recover the original data segment, when using the general network coding, LNC, and HNC, respectively.

Assume that each data segment is encoded into 3 layers, and layer 1, 2, 3 contains 6, 8, 11 original blocks of equal size, respectively.

1) General network coding Assume that neighbor node A , B , C , D have all

received some random coded blocks, and D can recover the original segment. In each round, every neighbor node produces a random combination of all blocks it has, and sends the generated block to node X . We evaluate the number of rounds that node X needs to recover the original segment.

2) Layered network coding Assume that node A has some coded blocks of layer

1. Node B can recover layer 1 and has some coded blocks of layer 2. Node C can recover layer 1, 2 and has some coded blocks of layer 3. Node D can recover the original data segment completely. Node X contacts each neighbor node to request a coded block in the increase order of Layer ID. We evaluate the number of rounds that node X needs to recover layer 1, 2, and 3, respectively.

3) Hierarchical network coding To tune the server’s generating probabilities for

different types of coded blocks, we take the priority vector as [0.5,0.3,0.2]=α . Since the length vector is

[6,8,11]=n , resulting probability vector is [0.395,0.316,0.289]=p .

Assume that node A has coded blocks of type 1. Node B has coded blocks of type 1 and 2. Node C has coded blocks of type 1, 2, and 3. Node D can recover the original data segment completely. In each round, node A , B , C , and D send a new coded block of a random type

141

Page 4: [IEEE 2009 Pacific-Asia Conference on Circuits, Communications and Systems (PACCS) - Chengdu, China (2009.05.16-2009.05.17)] 2009 Pacific-Asia Conference on Circuits, Communications

to node X , respectively. We evaluate the number of rounds that node X needs to recover layer 1, 2, and 3, respectively.

In Fig.4, we illustrate the number of rounds that each scheme needs to recover the original blocks of layer 1, 2, and 3, respectively. For each scheme, we perform 100 trials under the same conditions, and calculate the average results.

As shown in Fig.4, the general network coding (NC) needs the least number of rounds to recover the original data segment completely, but it cannot recover important layers early. On the contrary, LNC and HNC can recover the important layers early, but they need more rounds to recover the original segment completely.

Since in LNC the blocks are strictly generated and transmitted in the increasing order of Layer ID, to recover the important layers, LNC needs less number of rounds than HNC. On the other hand, since some neighbor nodes may have not the blocks that belong to the requested layer, a node may be not able to receive a block of needed layer from each neighbor node in each round. Hence, the number of rounds needed by LNC to recover the higher layers is slightly larger than that of the general network coding and HNC.

Compared with LNC, HNC needs slightly more rounds to recover the important layers. That is because HNC generates blocks of different types in random. Even though a node can receive the blocks of lower types with higher probability, it will also receive some blocks of higher types in the early rounds.

0

2

4

6

8

10

12

Layer 1 Layer 2 Layer 3

Rou

nds NC

LNC

HNC

Figure 4. The numbers of rounds that different schemes need to recover layer 1, 2, and 3, respectively.

To evaluate the performance of our tuning scheme for types’ generating probabilities, we perform our HNC by using tuned probabilities and equal probabilities, respectively. The results are compared in Fig.5.

As shown in Fig.5, when our tuning scheme is used, fewer rounds are needed to recover the first layer, but more rounds are needed to recover the original data segment completely. That is because our tuning scheme assigns the highest generating probability to the blocks of type 1 and the lowest probability to the blocks of type 3 by considering the priority and the number of original blocks of each layer.

0

2

4

6

8

10

12

Layer 1 Layer 2 Layer 3

Rou

nds tuned

equal

Figure 5. Results for tuned probabilities and equal probabilities.

V. CONCLUSTION In this paper, we investigate layered network coding

and hierarchical network coding for P2P streaming. A tuning scheme for generating probabilities in HNC is also proposed. Simulation results show that compared with the general network coding, our LNC and HNC can recover the important layers of the original data earlier.

To evaluate the performance of our LNC and HNC in real P2P streaming systems is our future work.

ACKNOWLEDGMENT This work is supported by the National Natural

Science Foundation of China (60832001), the Science and Technology Research Plan of Hebei Province of China (072135169) and the Postgraduate Innovation Fund of BUPT of China.

REFERENCES

[1] R. Ahlswede, N. Cai, S. Li, and R. Yeung, “Network information flow,” IEEE Trans. Inf. Theory, vol. 46, no. 4, pp. 1204–1216, 2000.

[2] S. Li, R. W. Yeung, and N. Cai, “Linear network coding,” IEEE Trans. Inf. Theory, vol. 49, no. 2, pp. 371–381, Feb. 2003.

[3] P. Sanders, S. Egner, and L. Tolhuizen, “Polynomial time algorithms for network information flow,” In Proc. 5th Annual ACM Symposium on Parallel Algorithms and Architectures, San Diego, California, pp. 286-294, Jun. 2003.

[4] P. Chou, Y. Wu, and K. Jain, “Practical network coding,” in Proc. 41st Annu. Allerton Conf. Communication, Control, and Computing, Monticello, IL, Oct. 2003.

[5] C. Gkantsidis and P. Rodriguez, “Network coding for large scale content distribution,” in Proc. IEEE INFOCOM 2005, pp. 2235-2245, Mar. 2005.

[6] Y. Liu, Y. Peng, W. Dou, and B. Guo, “Network coding for peer-to-peer live media streaming”, in Proc. 5th Int. Conf. Grid and Cooperative Computing (GCC’06), Hunan, China, pp.149-155, 2006.

[7] M. Wang and B. Li, “Lava: A reality check of network coding in peer-to-peer live streaming,” in Proc. IEEE INFOCOM 2007, Anchorage, AK, pp.1082-1090, May 2007.

[8] Nguyen, T. Nguyen, and S. Cheung, “Peer-to-peer streaming with hierarchical network coding”, in Proc. IEEE International Conference on Multimedia and Expo, Beijing, China, 2007, pp.396-399.

142