conducted by:cheng wen chi chiu kwok shing choi kwok yam advised by prof. danny tsang

43
Conducted by: Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang TD1a-09, BEng of Computer Engineering, HKUST

Upload: manon

Post on 12-Jan-2016

56 views

Category:

Documents


0 download

DESCRIPTION

Peer To Peer Internet Protocol Television (P2P IPTV). Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang. Introduction. What is P2P IPTV? What is IPTV IPTV is a system that deliver digital television content through Internet Protocol What is P2P - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

Conducted by: Cheng Wen ChiChiu Kwok ShingChoi Kwok Yam

Advised by Prof. Danny Tsang

TD1a-09, BEng of Computer Engineering, HKUST

Page 2: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

Introduction

What is P2P IPTV? What is IPTV

IPTV is a system that deliver digital television content through Internet Protocol

What is P2P P2P is any distributed network architecture composed of

participants that make a portion of their resources directly available to other network participants, without the need for central coordination instances.

2TD1a-09, BEng of Computer Engineering, HKUST

Page 3: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

Background• Motivation to start the project.

Rapidly development of network technology in Hong Kong

• (77% household broadband penetration - by OFTA)

HDTV become part of our life.Advantage of P2P model on HDTV

broadcasting.

3TD1a-09, BEng of Computer Engineering, HKUST

Page 4: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

Purpose and Aim

This project examines streaming IPTV over P2P networks with high quality(up to 1000kb/s) video in the different approaches, in order to create a low delay, high quality IPTV application, thus different P2P algorithms may be applied, such as pure push, hybrid, etc.

4TD1a-09, BEng of Computer Engineering, HKUST

Page 5: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

What our system look like?

Tracker

Video Server

Client-side application

5TD1a-09, BEng of Computer Engineering, HKUST

Page 6: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

What our system look like?

TD1a-09, BEng of Computer Engineering, HKUST 6

Page 7: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

Presentation Flow

P2P network management• Presented by Cheng Wen Chi

Data format and hybrid algorithm• Presented by Choi Kwok Yam

Libraries and Statistic Tools• Presented by Chiu Kwok Shing

Results and Findings

7TD1a-09, BEng of Computer Engineering, HKUST

Page 8: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

P2P network management

• Tracker Server

• Channels

• Peers Connection

• Registration & Deregistration

• Reconnection & Loop Handling– Presented by Cheng Wen Chi

8TD1a-09, BEng of Computer Engineering, HKUST

Page 9: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

TrackerTracker server• Centralized database which maintain info of P2P network

– P2PTV client– Channel info. of streaming server

• Maintain the P2P network topology and connection

4 main services:• Channel registration• Peer list request• Peer registration• Peer deregistration

Child Peer

Channel Selection

Peer Selection

Peer List Information

TC

P H

andl

erTracker Server

Peer Information

TCP Handler

Channel Registration

Peer Request

Peer Deregistration

Peer Registration

Video Server

0. Channel Registration

1. Channel Request

2. Reply Channel List

4. Peer List Request

5. Reply Peer List

3.

6.

Parent Peer

7. Peer ConnectRequest 8. Reply Port

9. Connect To Server10. Register the Child

to Tracker

11. DeRegister the Child Peerif connection fail

9TD1a-09, BEng of Computer Engineering, HKUST

Page 10: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

Channels• Multiple broadcast channels• Each channel is registered by a streaming

server• Channel information include

– channel name– streaming server IP– sub stream size– video size

• Channel information is downloaded by peer when client terminal start up

10TD1a-09, BEng of Computer Engineering, HKUST

Page 11: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

Connection• Sub streaming algorithm• Individual TCP connection for each sub stream• Different thread handle each sub stream connection• For upload stream, select TCP ports which available for

remote connection• Provide TCP ports information to child peers for new

connection process– Data port– Control port

11TD1a-09, BEng of Computer Engineering, HKUST

Page 12: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

Connection Establishment

Flow of connection establishment• Download peer list of selected

channel• Select a peer from peer list

based on selection algorithm• Request a new connection with

selected peer• Peer provide a pair of TCP ports

for data and control connection

12TD1a-09, BEng of Computer Engineering, HKUST

Page 13: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

Registration

• Parent peer registers its child peers• Register to tracker individually in each tree• Information of registration

– Child peer id– Parent peer id– Sub stream id– Channel id

• connection map between peers is maintained in tracker

• Used for loop detection and optimization of P2P network

13TD1a-09, BEng of Computer Engineering, HKUST

Page 14: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

Disconnection

Causes of disconnection1. TCP connection timeout2. Continuous miss chunk3. Chunk sequence no. out of range

• Disconnection log store in local peer list• Use for peer selection of reconnection

14TD1a-09, BEng of Computer Engineering, HKUST

Page 15: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

Deregistration

Parent Monitor the Child Connection

Connection Exist

Check Child’ s Parent ID

Disconnected

Identical

Different

Deregister the child to Tracker

End

Start• Deregistered by parent peer• Deregistration message which include

– Parent peer id– Child peer id– Tree id, channel id

• Tracker verify the deregistration request by matching the parent id and child id in registration records

15TD1a-09, BEng of Computer Engineering, HKUST

Page 16: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

Recursive Deregistration

• Deregistration problem of inter peer of sub tree

• Take place when a sub tree is connected from P2P network

• Tracker recursively detect the connection status of its offspring in the sub tree

• If peer (offspring) is offline, tracker will deregister it from the sub tree

16TD1a-09, BEng of Computer Engineering, HKUST

Page 17: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

Reconnection• Root peer operate on reconnection process • Child peers within the sub tree will keep its

connection with its parent peers• New peer from local copy of peer list• Peer selection algorithm select peer based on

– Miss rate– Timeout rate

17TD1a-09, BEng of Computer Engineering, HKUST

Page 18: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

Loop Detection• Loop connection may formed after reconnection

of sub stream• Detected by periodic WAIT message• When root peer is disconnected, it generates

WAIT message with its peer ID to its child peers• Child peers forward the WAIT

message to its grandchild• Streaming loop detected

by the WAIT message ID

18TD1a-09, BEng of Computer Engineering, HKUST

Page 19: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

Loop Detection

2)Receive Wait 51)Reconnected3)Loop detected

4)Disconnected

19TD1a-09, BEng of Computer Engineering, HKUST

Page 20: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

Data format & hybrid algorithm

• Data format & encryption

• Sub-Streaming

• Push algorithm

• Pull algorithm– Presented by Choi Kwok Yam

20TD1a-09, BEng of Computer Engineering, HKUST

Page 21: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

Data format• Four containers of VLC streaming server

21TD1a-09, BEng of Computer Engineering, HKUST

Page 22: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

Data EncryptionTransport Stream (TS)

Header Video Payload

4 Bytes 184 Bytes

Streaming chunk

TSPLSN TS TS …

<Header> <Payload> 182 Bytes (Number of TS packets* 188) Bytes

SN: Sequence Number

TSPL: Total TS packet length

TS: Transport Stream packet

Page 23: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

TCP packet Data Encryption

TCP Header Data Payload

TS…

Header Video Payload

Header

40 Bytes

<Streaming chunk>

<TS Packet>

Each streaming chunk include 20 TS packetsData Payload size: 3942 bytesOverhead of each streaming chunk: 6%

23TD1a-09, BEng of Computer Engineering, HKUST

Page 24: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

Sub-streaming

… 10965432

Single stream of chunk with Sequence number {1, 2, 3…10}

Combine & Decompose

S1

Three sub-streams {S1, S2, and S3}

S2

S3

1 4

2 5

3 6

7

8

9

10 ………

1

Sequence number represent its playback sequence in the stream

P sub-stream :q-th sub-stream contains chunks with sequence numbers = (nP + q)where n is a positive integer from zero to infinity, and q is a positive integer from 1 to P.

24TD1a-09, BEng of Computer Engineering, HKUST

Peer A

Peer B

S1

S2

S3

S1

S2

S3

Peer C

S1

S2

S3

Page 25: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

Push algorithm

• Do not exchange the sequence number of chunks• The parent node will send the latest chunk to the child node continuously.

Time Time

Parent node Child node

.

.

.

1. Connection request2. Connection success3. Send latest chunk (n)4. Send chunk (n+1)

1

2

3

4

25TD1a-09, BEng of Computer Engineering, HKUST

Page 26: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

Pull algorithm

• Implemented in the state of pushing video chunk.

• The missing chunks will not be recovered during sub-streams reconnection

• The expected sequence number = last received sequence number + total

sub-stream number. • Example (3 sub-streams)

S1

S2

S3

1 4

2 5

3 12

10

8

15

……

… Miss chunksS1: 7S3: 6,9

1. Detection

26TD1a-09, BEng of Computer Engineering, HKUST

Page 27: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

Pull algorithm

Peer A

Peer selection process

Filter

Chunk request

Response

Missing Chunk List

1. Peer selection process(e.g. peer B)2. Sequence number of missing chunk3. Compare missing sequence number and video playing sequence number4. Copy missing chunk to playback or upload buffer

PlaybackUpload

Request side:

2. Recovery

27TD1a-09, BEng of Computer Engineering, HKUST

Page 28: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

Pull algorithm

Peer A Peer B

Sequence map

Chunk request

Response

Buffer

1. Search sequence map2. Copy the chunk from upload buffer

Response side:

28TD1a-09, BEng of Computer Engineering, HKUST

Page 29: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

Libraries and Statistic Tools

• Video library and Implementation

• XML Database Library

• Statistic Tools Plug-in– Presented by Chiu Kwok Shing

29TD1a-09, BEng of Computer Engineering, HKUST

Page 30: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

Video Library

• DLL library Creation to access VLC library

• Video broadcast function

• Virtual Server broadcast and Video buffer

30TD1a-09, BEng of Computer Engineering, HKUST

Page 31: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

Video Library

• What is VLC?– a free and open source media player and

multimedia framework written by the VideoLAN project

• Advantage of VLC?– Support large number of encode/decode

format– build up network stream through TCP– Flexible

• Reason to build up DLL library.TD1a-09, BEng of Computer Engineering, HKUST 31

Page 32: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

Video Broadcast

Layer BLayer AVLC

PlayerVLC

PlayerInternet

Server

GUI

Client

GUI

Tracker

32TD1a-09, BEng of Computer Engineering, HKUST

Page 33: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

Virtual Server & Video buffer

Virtual Server Video Buffer

Start

Waiting core player connection

Connection Success?

Load data buffer

Broadcast to player

Stop Playing?

Close Connection

Yes

No

No

Yes

Send to Virtual Server

Accumulated enough buffer ?

Yes

No

Start

Receive Data and Store in Buffer

End

Connection Closed?

Yes

No

33TD1a-09, BEng of Computer Engineering, HKUST

Page 34: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

XML Database Library

• What is XML– a file type that included a set of rules for

encoding document

• Advantage of XML database– Cross platform– Low operation cost

• Role of XML database within the system– Database to store system information

34TD1a-09, BEng of Computer Engineering, HKUST

Page 35: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

Statistic Tools Plug-in

• Why we develop the Statistic Tools?

35TD1a-09, BEng of Computer Engineering, HKUST

Page 36: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

What the tool can do?

• Upload Speed graph

• Download Speed graph

• Upload Log

• Download Log

36TD1a-09, BEng of Computer Engineering, HKUST

Page 37: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

How the tool work?

P2PTV statistic application model

Flow chart of the model

Statistic Application

Client Speed

Statistic

Graphical User Interface

Decode

TC

P H

andl

er

Client-side Application

TC

P H

andl

er

Statistic Handler

Download Stream

Upload Stream

Send Start andEnd Time Stamp

Send Start andEnd Time Stamp

DataStream

Graph Created?

Create New Graph and XML

Append data to XML file

Yes Yes

No

StartReceived

Data?Listen for

Client

No

Display data in GUI

37TD1a-09, BEng of Computer Engineering, HKUST

Page 38: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

Result & Findings

Playback Hit RateRecover RatePlayback Overhead percentage

TD1a-09, BEng of Computer Engineering, HKUST 38

Page 39: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

Results & Findings

TD1a-09, BEng of Computer Engineering, HKUST 39

Playback Hit RateSub-stream

Number Push Pull2 45% 45%4 97.56% 96.86%8 98.45% 98.77%

Test Result with1500kbps Mp4 video

Playback hit rate = number of chuck played by VLC/ number of chunk received

PlayBack Hit Rate

95.00%

96.00%

97.00%

98.00%

99.00%

100.00%

101.00%

2 4 8

Sub-streams

Per

cen

tag

e

Push

Pull

Playback Hit RateSub-stream

Number Push Pull2 99.90% 99.96%4 99.73% 99.93%8 99.78% 99.84%

Test Result with 360kbps Mp4 video

Page 40: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

Results & Findings

40

Test Result with 1500kbps Mp4 video

Recover rate

Sub-stream Number Pull

2 15.24%

4 71%

8 87.43%

Recover Rate = number of chunk pulled / number of chunk missed

Recover Rate

TD1a-09, BEng of Computer Engineering, HKUST

Page 41: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

Results & Findings

TD1a-09, BEng of Computer Engineering, HKUST 41

Playback Overhead PercentageTest Result with1500kbps Mp4 video

Playback overhead= (1-chunk overhead)*overhead of each chunk + chunk overheadChunk overhead= 1- hybrid receive chunk/hybrid upload chunkOverhead of each chunk = (total size of streaming chunk - total size of video payload)/(total size of streaming chunk + size of TCP header)

Playback OverheadSub-stream Number Push Pull

2 6.92% 6.93%4 6.60% 6.76%8 6.59% 6.59%

Page 42: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang
Page 43: Conducted by:Cheng Wen Chi Chiu Kwok Shing Choi Kwok Yam Advised by Prof. Danny Tsang

Thanks for your attention!

Thanks for your attention!

43TD1a-09, BEng of Computer Engineering, HKUST