430 likes | 541 Views
LYU0502. P2P Digital TV Recorder. Supervisor: Professor Michael R. Lyu Prepared by: Ho Tsz Wing, Andy Lau Wai Shun, Jack. Outline. Motivation Objective Development Platform Approach Performance Enhancement Erasure Code Analysis Future Work Conclusion Q&A. Motivation.
E N D
LYU0502 P2P Digital TV Recorder Supervisor: Professor Michael R. Lyu Prepared by: Ho Tsz Wing, Andy Lau Wai Shun, Jack
Outline • Motivation • Objective • Development Platform • Approach • Performance Enhancement • Erasure Code Analysis • Future Work • Conclusion • Q&A
Motivation • Watching TV is a major entertainment activity for people • People often miss their favorite program because they have to work overtime or go out to travel • People need to schedule the recording of the programs
Objective • Allow people view to back previous TV program without doing scheduling themselves • Let the user view the program on demand • Increase the availability of the TV program • Achieve load balancing among the participating peers
Develop Platform • Windows XP Media Center Edition • First released in Aug. 2003 • Capable of watching DVD, recording TV, listening to music and sharing digital photos • Media Center Edition 2005 SDK – Click-To-Record Feature • Enables applications to programmatically schedule the recording of TV programs • Supported in Visual C#.Net
Windows XP Media Center Edition • Need an Electronic Program Guide (EPG) in order to schedule the recording • Use TVxb to convert the schedule obtained from webpage to an XML format • Use Quickguide to convert the XML schema to the EPG
Approach • Interface of the application
Approach • There are different types of peer-to-peer file sharing architectures according to their “degree of centralization” • Hybrid decentralized architectures (Napster) • Purely decentralized P2P architectures (Gnutella) • Partially centralized systems (KaZaA)
Approach • In this term, we choose to implement our system using the hybrid decentralized architectures • There is a centralized server maintaining the list of online peers and the directories of the shared files • The server is also responsible to schedule the recording to the online peers in a fair and efficient way
Approach • On the other hand, the peers are responsible to handle the scheduling request made by the server • Also, they need to serve the downloading request from other peers
Approach • Reasons to choose the hybrid decentralized architectures • It is simpler to implement • It serves as a model for us to investigate the feasibility of the project and measure the performance of the system under different peers behavior • After implementing our system using the hybrid decentralized architectures, it is relatively easier for us to deploy it to the purely decentralized P2P architectures
Approach • Component of the server • p2p.mdb – database which maintains the peer table and share table • Login.asp – make entries in the peer table and share table when a user login • Search.asp – search the file requested by the user and generate suitable response • Userlist.asp – return the list which contains the information of the currently logged-in peers • Updateshare.asp – update the share table after a user recorded or downloaded a program • Xml.asp – return the schedule of all the channels in a particular date • Logout.asp - delete entries in the peer table and share table when the user logout
Approach • The client side application Start Login to the system through login.asp Listen to incoming connection Download request No Recording request Upload request Search peers using search.asp Yes Yes Schedule the recording Using click-to-record feature Upload the requested file to the peers Connect to the peers and start downloading Logout the system through logout.asp Stop
The Apprentice (III) Approach Suppose Alice wants to see the program “The Apprentice (III) “ She will send a query to the server She will then make a direct connection to Bob to get the file The server will reply to Alice with the list of peers (Bob) that have a copy of “The Apprentice (III) “ Alice Bob
Performance enhancement • How to schedule the recording tasks to the peers effectively? • How to increase the availability of the video files? • How to improve the performance of retrieving the video files from peers?
Scheduling policies • Policies: • Do scheduling 15 minutes before the program start • Select the peers randomly • N peers will be scheduled • In this project, N is assigned to be 2 • Assumptions: • The selected peers will not leave manually • The peer who gets the whole video file has the responsibility to do the encoding process
Scheduling policies • The server side application Start Send the xml recording request to the selected peers Obtain the schedule of all channel at 5:40 am everyday Get 2 randomly selected peers from userlist.asp Schedule the recording of all program 15 minutes before the start of a program
Scheduling policies 15 minutes before the program starts, the server will randomly send it’s schedule to any two of the online peers Alice Bob
Availability enhancement • Whole file replication (WFR) Advantages: 1) Multiple access of the video files 2) No decoding needed Disadvantages: 1) Storage overhead is large 2) Replication time is long • Erasure Code replication (ECR) Advantages: 1) Multiple access of the video files 2) Storage overhead is small Disadvantages: 1) Encoding and decoding time 2) Difficult to implement
Whole File Replication TVBNews.dvr-ms • Do replication on the whole file • Redistribute the file to other peers
Whole File Replication • Replication factor r • Peers availability P • Total Number of Peers N • Availability • Independent of N • When P 1, A(w) 1 • When r , A(w) 1
Erasure Code - Background Message n blocks Encoding (to m blocks, where m > n) Decoding (Requiresany nblocks) Message n blocks
Erasure Code - Implementation • Divide the video file into n fragments • Code these n fragments in m (m>n) • Any n (unique) fragments are able to reconstruct the video files • Send the fragments to random peers
Erasure Code TVBNews.dvr-ms • Do encoding on the whole file • Redistribute part of file to other peers
Erasure Code - Analysis • Replication factor r • Divide the video file into n fragments • Code these n fragments in m (m>n) • Stretch factor s = m/n • Any n (unique) fragments are able to reconstruct the video files
Comparison – WFR Vs. ECR • Whole File Replciation - Availability • Erasure Code Replciation - Availability
Availability Analysis - Conclusion • If the storage is not limited, ECRperforms better than WFR in most cases. • When peer availability large than 0.5, the performance of WFR tends to ECR if the replication factor increases. • However, the storage is limited in real world
Storage Analysis - Conclusion • If the peers availability is high, ECR is more storage-effective than WFR. Adopted from : Replication Strategies for Highly Available Peer to Peer Networks, Ranjita Bhagwan et. al,
Block Size Analysis – r = 2 • If the storage is limited, the performance of erasure code replication will highly depends on the peer availability Adopted from : Erasure Code Replication Revisited, W.K. Lin, D.M. Chiu, Y.B. Lee
Future Work • Implement the system in Server-less way • Design a algorithm for placing the encoded check blocks • Investigate the relationships between popularity and download frequency of a TV program (Dynamic replication factor) • Implement choking algorithm to encourage users to share their own contents.
Conclusion • We have implemented the P2P system in the Server-Client model. • The availability of the TV Programs are enhanced by using Erasure Code Replication.
Q&A Session Thank you very much