P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify...
Transcript of P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify...
![Page 1: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/1.jpg)
P2P Content DistributionBitTorrent and Spotify
Amir H. [email protected]
Amirkabir University of Technology(Tehran Polytechnic)
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 1 / 62
![Page 2: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/2.jpg)
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 2 / 62
![Page 3: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/3.jpg)
Possible Solutions forContent Distribution
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 3 / 62
![Page 4: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/4.jpg)
Client-Server Model
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 4 / 62
![Page 5: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/5.jpg)
Client-Server Model
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 5 / 62
![Page 6: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/6.jpg)
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 6 / 62
![Page 7: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/7.jpg)
The Client-Server Model Problems
I Scalability?
I Single Point of failure?
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 7 / 62
![Page 8: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/8.jpg)
The Client-Server Model Problems
I Scalability?
I Single Point of failure?
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 7 / 62
![Page 9: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/9.jpg)
The Client-Server Model Problems
I Scalability?
I Single Point of failure?
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 7 / 62
![Page 10: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/10.jpg)
Client-Server Systems
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 8 / 62
![Page 11: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/11.jpg)
The Client-Server Model Problem
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 9 / 62
![Page 12: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/12.jpg)
Scalable and Fault-Tolerant Client-Server Model
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 10 / 62
![Page 13: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/13.jpg)
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 11 / 62
![Page 14: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/14.jpg)
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 12 / 62
![Page 15: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/15.jpg)
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 13 / 62
![Page 16: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/16.jpg)
Peer-to-Peer Model
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 14 / 62
![Page 17: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/17.jpg)
Peer-to-Peer (P2P) Model
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 15 / 62
![Page 18: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/18.jpg)
P2P Challenges
I Churn in the system
I Free-riding problem
I Bottleneck in the overlay network
I Connectivity problem, e.g., NAT
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 16 / 62
![Page 19: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/19.jpg)
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 17 / 62
![Page 20: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/20.jpg)
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 18 / 62
![Page 21: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/21.jpg)
How To Discover Data?
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 19 / 62
![Page 22: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/22.jpg)
Possible Solutions - First Generation
I Central directory
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 20 / 62
![Page 23: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/23.jpg)
Possible Solutions - Second Generation
I Flooding
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 21 / 62
![Page 24: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/24.jpg)
Possible Solutions - Third Generation
I Distributed Hash Table (DHT)
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 22 / 62
![Page 25: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/25.jpg)
P2P Content Distribution Applications - File Sharing
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 23 / 62
![Page 26: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/26.jpg)
P2P Content Distribution Applications - Media Streaming
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 24 / 62
![Page 27: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/27.jpg)
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 25 / 62
![Page 28: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/28.jpg)
BitTorrent
I BitTorrent is a system for efficient and scalable replication of largeamounts of static data.
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 26 / 62
![Page 29: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/29.jpg)
BitTorrent Players
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 27 / 62
![Page 30: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/30.jpg)
Files
I Files are broken into pieces of size between 64KB and 1MB.
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 28 / 62
![Page 31: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/31.jpg)
.torrent Files
I Metadata
I Contains:• URL of tracker• Information about the file,
e.g., filename, length, ...
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 29 / 62
![Page 32: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/32.jpg)
The Core Idea
I A peer obtains .torrent file.
I It, then, connects to the tracker.
I The tracker tells the peers fromwhich other peers to download thepieces of the file.
I Peers use this information to communicate with each other.
I The peers send information about the file and themselves to tracker.
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 30 / 62
![Page 33: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/33.jpg)
The Core Idea
I A peer obtains .torrent file.
I It, then, connects to the tracker.
I The tracker tells the peers fromwhich other peers to download thepieces of the file.
I Peers use this information to communicate with each other.
I The peers send information about the file and themselves to tracker.
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 30 / 62
![Page 34: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/34.jpg)
The Core Idea
I A peer obtains .torrent file.
I It, then, connects to the tracker.
I The tracker tells the peers fromwhich other peers to download thepieces of the file.
I Peers use this information to communicate with each other.
I The peers send information about the file and themselves to tracker.
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 30 / 62
![Page 35: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/35.jpg)
The Core Idea
I A peer obtains .torrent file.
I It, then, connects to the tracker.
I The tracker tells the peers fromwhich other peers to download thepieces of the file.
I Peers use this information to communicate with each other.
I The peers send information about the file and themselves to tracker.
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 30 / 62
![Page 36: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/36.jpg)
The Core Idea
I A peer obtains .torrent file.
I It, then, connects to the tracker.
I The tracker tells the peers fromwhich other peers to download thepieces of the file.
I Peers use this information to communicate with each other.
I The peers send information about the file and themselves to tracker.
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 30 / 62
![Page 37: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/37.jpg)
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 31 / 62
![Page 38: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/38.jpg)
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 32 / 62
![Page 39: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/39.jpg)
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 33 / 62
![Page 40: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/40.jpg)
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 34 / 62
![Page 41: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/41.jpg)
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 35 / 62
![Page 42: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/42.jpg)
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 36 / 62
![Page 43: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/43.jpg)
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 37 / 62
![Page 44: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/44.jpg)
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 38 / 62
![Page 45: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/45.jpg)
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 39 / 62
![Page 46: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/46.jpg)
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 40 / 62
![Page 47: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/47.jpg)
What About Free Riders?
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 41 / 62
![Page 48: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/48.jpg)
Tit-For-Tat
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 42 / 62
![Page 49: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/49.jpg)
Question
I From which peers download the pieces?
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 43 / 62
![Page 50: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/50.jpg)
Peer Selection
I Use choking algorithm to choose peer to download pieces.
I Decision to choke/unchoke based on tit-for-tat.
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 44 / 62
![Page 51: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/51.jpg)
Discover More Cooperating Peers
I Optimistic unchoking
I Allocate an upload slot to a randomly chosen uncooperative peer
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 45 / 62
![Page 52: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/52.jpg)
Snubbed Peers
I If all its peers choke it.
I Increase the number of optimistic unchokes.
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 46 / 62
![Page 53: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/53.jpg)
Question
I Which piece?
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 47 / 62
![Page 54: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/54.jpg)
Piece Selection
I Rarest first: common parts left for later
I Random first piece: start-up need to get a complete piece
I Endgame mode: broadcast for all remaining blocks
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 48 / 62
![Page 55: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/55.jpg)
Piece Selection
I Rarest first: common parts left for later
I Random first piece: start-up need to get a complete piece
I Endgame mode: broadcast for all remaining blocks
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 48 / 62
![Page 56: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/56.jpg)
Piece Selection
I Rarest first: common parts left for later
I Random first piece: start-up need to get a complete piece
I Endgame mode: broadcast for all remaining blocks
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 48 / 62
![Page 57: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/57.jpg)
BitTorrent Extension
I Distributed tracker
I Peer-exchange
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 49 / 62
![Page 58: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/58.jpg)
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 50 / 62
![Page 59: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/59.jpg)
Spotify
I Active users: over 50 million
I Number of songs: over 20 million
I Number of songs added per day: over 20000
I Number of playlists: over 1.5 billion created so far
I Available in 58 countries
I Legal
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 51 / 62
![Page 60: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/60.jpg)
The Core Idea
I Request first piece from Spotify servers.
I Meanwhile, search P2P network for remainder.
I Switch back and forth between Spotify servers and peers as needed.
I Towards end of a track, start prefetching the next one.
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 52 / 62
![Page 61: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/61.jpg)
The Core Idea
I Request first piece from Spotify servers.
I Meanwhile, search P2P network for remainder.
I Switch back and forth between Spotify servers and peers as needed.
I Towards end of a track, start prefetching the next one.
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 52 / 62
![Page 62: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/62.jpg)
The Core Idea
I Request first piece from Spotify servers.
I Meanwhile, search P2P network for remainder.
I Switch back and forth between Spotify servers and peers as needed.
I Towards end of a track, start prefetching the next one.
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 52 / 62
![Page 63: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/63.jpg)
The Core Idea
I Request first piece from Spotify servers.
I Meanwhile, search P2P network for remainder.
I Switch back and forth between Spotify servers and peers as needed.
I Towards end of a track, start prefetching the next one.
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 52 / 62
![Page 64: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/64.jpg)
Main Problem in Using Spotify P2P Network
Peer Discovery
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 53 / 62
![Page 65: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/65.jpg)
Peer Discovery
I Sever-side tracker (BitTorrent style)• Only remembers 20 peers per track.• Returns 10 (online) peers to client on query.
I Broadcast query in small (2 hops) neighborhood in overlay (Gnutellastyle)
I LAN peer discovery
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 54 / 62
![Page 66: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/66.jpg)
Peer Discovery
I Sever-side tracker (BitTorrent style)• Only remembers 20 peers per track.• Returns 10 (online) peers to client on query.
I Broadcast query in small (2 hops) neighborhood in overlay (Gnutellastyle)
I LAN peer discovery
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 54 / 62
![Page 67: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/67.jpg)
Peer Discovery
I Sever-side tracker (BitTorrent style)• Only remembers 20 peers per track.• Returns 10 (online) peers to client on query.
I Broadcast query in small (2 hops) neighborhood in overlay (Gnutellastyle)
I LAN peer discovery
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 54 / 62
![Page 68: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/68.jpg)
Downloading in P2P
I Ask for most urgent pieces first.
I If a peer is slow, re-request from new peers.
I When buffers are low, download from central server as well.
I If buffers are very low, stop uploading.
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 55 / 62
![Page 69: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/69.jpg)
Downloading in P2P
I Ask for most urgent pieces first.
I If a peer is slow, re-request from new peers.
I When buffers are low, download from central server as well.
I If buffers are very low, stop uploading.
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 55 / 62
![Page 70: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/70.jpg)
Downloading in P2P
I Ask for most urgent pieces first.
I If a peer is slow, re-request from new peers.
I When buffers are low, download from central server as well.
I If buffers are very low, stop uploading.
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 55 / 62
![Page 71: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/71.jpg)
Downloading in P2P
I Ask for most urgent pieces first.
I If a peer is slow, re-request from new peers.
I When buffers are low, download from central server as well.
I If buffers are very low, stop uploading.
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 55 / 62
![Page 72: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/72.jpg)
Spotify vs. BitTorrent
I One (well, three) P2P overlay for all tracks (not per-torrent).
I Does not inform peers about downloaded blocks.
I Downloads blocks in order.
I Does not enforce fairness (such as tit-for-tat).
I Informs peers about urgency of request.
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 56 / 62
![Page 73: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/73.jpg)
Spotify vs. BitTorrent
I One (well, three) P2P overlay for all tracks (not per-torrent).
I Does not inform peers about downloaded blocks.
I Downloads blocks in order.
I Does not enforce fairness (such as tit-for-tat).
I Informs peers about urgency of request.
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 56 / 62
![Page 74: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/74.jpg)
Spotify vs. BitTorrent
I One (well, three) P2P overlay for all tracks (not per-torrent).
I Does not inform peers about downloaded blocks.
I Downloads blocks in order.
I Does not enforce fairness (such as tit-for-tat).
I Informs peers about urgency of request.
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 56 / 62
![Page 75: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/75.jpg)
Spotify vs. BitTorrent
I One (well, three) P2P overlay for all tracks (not per-torrent).
I Does not inform peers about downloaded blocks.
I Downloads blocks in order.
I Does not enforce fairness (such as tit-for-tat).
I Informs peers about urgency of request.
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 56 / 62
![Page 76: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/76.jpg)
Spotify vs. BitTorrent
I One (well, three) P2P overlay for all tracks (not per-torrent).
I Does not inform peers about downloaded blocks.
I Downloads blocks in order.
I Does not enforce fairness (such as tit-for-tat).
I Informs peers about urgency of request.
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 56 / 62
![Page 77: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/77.jpg)
Caching
I Player caches tracks it has played.
I Use 10% of free space (capped at 10GB)
I Least Recently Used policy for cache eviction.
I Over 50% of data comes from local cache.
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 57 / 62
![Page 78: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/78.jpg)
Spotify Data Usage
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 58 / 62
![Page 79: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/79.jpg)
Spotify Says Goodbye to P2P
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 59 / 62
![Page 80: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/80.jpg)
Summary
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 60 / 62
![Page 81: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/81.jpg)
Summary
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 61 / 62
![Page 82: P2P Content Distribution BitTorrent and Spotify · P2P Content Distribution BitTorrent and Spotify Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic)](https://reader033.fdocuments.in/reader033/viewer/2022050520/5fa3c8b2b4c35656ed570ac2/html5/thumbnails/82.jpg)
Questions?
Amir H. Payberah (Tehran Polytechnic) P2P Content Distribution 1393/8/27 62 / 62