Slides - Hongyang Li

Download Report

Transcript Slides - Hongyang Li

Effective Utilization of User-Contributed Resources
in Peer-Assisted Video-on-Demand Systems
HONGYANG LI, Research Intern
at University of Victoria, Victoria, BC, Canada
2012. 8 – 2012.9
Under the Supervision of Dr. Pan and Le
From Dalian University of Technology, Liaoning, China
Project Background
Computer Networks – Peer to Peer(P2P) Network
•
•
•
•
Each peer(computer) acts as a client/server for others;
Allows shared access to various resources;
No need for a central server;
Requires every peer to use the same or a compatible program;
FOR RESOURCE SHARING !
Peer-assisted video-on-demand (PA-VoD) systems
• VoD System vs. Live Streaming ?
• VoD Enables you to create a library of your own videos
- watch it anytime, any content CACHE MANAGEMENT
• Two options of VoD:
streaming video on demand; downloadable VOD
Effective Utilization of User-Contributed Resources in PA-VoD Systems
Descriptions and Assumptions
Model and Algorithms
• Two categories in the system: HD or SD users. rS=500MKbps; rH=1000
• Each peer holds a different uploadLimit, 400, 500, 800. While
downloadLimit is infinite.
• Peer has a fixed cache size of 1GB, which can store 1 HD movie or 2 SD
movies(512M). Movie-(Group Segment, 512)-Segment(64Kb)-Block(1Kb)
Local Cache
Time
Old
One
block
(pack)
……
1Kb
1Kb
Seg Seg
6: 5: 6: 5:
38 39
……
Window (size = 15segs)
Seg Seg
1: 3: 1: 3:
402 403
Seg
1: 3:
404
……
Seg
1: 3:
418
1Kb
Principals for being a Helper:
a. Must watch a SD segment now; why?
b. Must have HD contents.
Playback
point
lastPointer
For a SD movie,
16*512*64Kb = 512M
HD, 32*512*64Kb = 1G
a. A HD viewer will never be a helper;
b. A SD viewer who has NO HD contents can’t neither.
Effective Utilization of User-Contributed Resources in PA-VoD Systems
Assume a typical SD chain:
Peer 4
800
500
Model and Algorithms
P2
400
400
100
After peers on the chain are satisfied, a
inter-chain help is launched.
P13
400
400
P67
Inner-chain Help
500
100
Two things must keep in mind:
Cache Management; Bandwidth Allocation
Effective Utilization of User-Contributed Resources in PA-VoD Systems
Assume a typical SD chain:
Peer 4
500
800
Model and Algorithms
P2
400
400
P13
400
After peers on the chain are satisfied, a
inter-chain help is launched.
100
(first inner
help also)
P25
800
800
P67
Inner-chain Help
500
100
100
HD chain:
400
Two things must keep in mind:
Cache Management; Bandwidth Allocation
100
P1
800
800
P50
500
500
Inter-chain Help
400
200
Any questions now? 
P4
500
From the SERVER, a peer who has infinite
uploadLimit and any contents.
In this case, SBC = 200+500 = 700MKps
Effective Utilization of User-Contributed Resources in PA-VoD Systems
Model and Algorithms
Two fatal shortcomings of the previous model :
a. HD viewers can only ask CERTAIN helpers, because of content bottleneck.
b. Global info of the system is unknown(This is a distributed network, in real world),
so getting the full chain list is not feasible.
Solutions:
a. Use Substream1. b. Each peer only gets 5-10 neighbor peers’ information. (code design)
• Divide every HD seg
into 8 parts, each
Substream size=
8Kb* numOfSeg
Local Cache
Time
Old
S1 …
Ss1
HD SEGS
S2 … S3 … S4 …
Ss2
……
Ss8
S5 …
SD SEGS
• Each helper can
help any HD viewer
if it has abundant
bandwidth within a
movie channel!
1 “View-Upload Decoupling: A Redesign of Multi-Channel P2P Video Systems”, Di Wu,
Chao Liang, Yong Liu and Keith Ross. INFOCOM, 2009
Effective Utilization of User-Contributed Resources in PA-VoD Systems
Peer 1:
Tools: Python, Matlab and PlanetLab
1.
RR
Peer 2:
3.
SC
Recv Msg
And
Update PL
•
•
•
•
•
Leaky
Bucket
DATA
2.
CP
Send seg
P1 makes a ‘RR’ package and P2 receives the msg.
Through receiveManager, call self.replyToAskRate(ip, port, rate) function.
P2 sends ‘CP’ package back to P1, and P1 calls replyToRateOffered fun.
If the offered-rate is over 64(Kb), start connection; else, stop connection.
Once connected, send segment, data management and update peerlist.
Socket, Multi-Thread, Network programming, classes, Object-oriented
programming!
Effective Utilization of User-Contributed Resources in PA-VoD Systems
Codes Block Diagram
Tools: Python, Matlab and PlanetLab
Playback:
Plays movie if
segment is available
Connection:
Connects two peers
according to
recvMan order.
+ The above chart is made by Tushar, modified by Francis
Effective Utilization of User-Contributed Resources in PA-VoD Systems
Tools: Python, Matlab and PlanetLab
• peer.py – the main thread and beginning of all files.
Effective Utilization of User-Contributed Resources in PA-VoD Systems
Tools: Python, Matlab and PlanetLab
• receiveManager.py –
Receive request packets from other peers and execute
corresponding functions based on msgtype.
Effective Utilization of User-Contributed Resources in PA-VoD Systems
Tools: Python, Matlab and PlanetLab
• packetMaker.py - Make packets for different requests.
type
‘ECS404’ ‘HB’
msglen
8
msgdata
watching
Movie
watching help
Seg
Movie
help
Seg
def makeHearBeatMessage(self):
……
pack = struct.pack('!6s2sHHHHH', 'ECS404', 'HB', 8, watchingMovie, …, helpSeg)
return pack
How to unpack them? In the receiveManager.py!
checkpack, addr = self.peer.s.recvfrom(1024)
msgdata = checkpack[10:10+msglen]
watchingMovie = struct.unpack('!H',msgdata[0:2])[0]
watchingSeg = struct.unpack('!H',msgdata[2:4])[0]
Effective Utilization of User-Contributed Resources in PA-VoD Systems
Related and Future Work
To do list:
• Modify the codes and deploy the files on PlanetLab;
• Simulation results(bandwidth efficiency, SBC, etc.)
• Try different models.
And a few more thanks…
HOMEPAGE (FOR FUN):
http://francislee2020.weebly.com
E-MAIL: [email protected]
AND I stick to the webb!!haha :D
Effective Utilization of User-Contributed Resources in PA-VoD Systems