SlideShare a Scribd company logo
Spotify - Large Scale, Low
Latency, P2P Music-on-Demand
Streaming
Presenter: Y.S.Horawalavithana
Authors: Gunnar Kreitz (KTH, Sweden)
Fredrik Niemelä (KTH, Sweden)
Talk
• Spotify
• Taxonomy
• Protocol
• P2P Overlay
• Evaluation
• Discussion
IEEE 10th International Conference on P2P computing 2
What is Spotify?
• Peer assisted on-demand music
streaming
• Hybrid Platform
• Client/ Server
• P2P
• Pub/Sub
• Large catalog of music (Over 8
million tracks)
• 24 million user base
• Available as Web, Desktop &
Mobile clients
IEEE 10th International Conference on P2P computing 3
Talk
• Spotify
• Taxonomy
• Protocol
• P2P Overlay
• Evaluation
• Discussion
IEEE 10th International Conference on P2P computing 4
Taxonomy – Related Work
IEEE 10th International Conference on P2P computing 5
On-Demand
Music
Streaming
Client/
Server
P2P
Overlay
On-Demand
Video
Streaming
On-Demand
File
Sharing
Structured Unstructured
Problem Statement
How to implement & adopt a peer-
assisted custom network protocol for
on-demand streaming?
IEEE 10th International Conference on P2P computing 6
Talk
• Spotify
• Taxonomy
• Protocol
• P2P Overlay
• Evaluation
• Discussion
IEEE 10th International Conference on P2P computing 7
Spotify Protocol: Overview
• Network protocol
• Designed for streaming music
• Audio Stream
• Encoding
• Ogg Vorbis: quality q5 (160 kbps) or q9 (320 kbps)
• Bit-rate
• 96-320 kbps
• Simple Design!!!
IEEE 10th International Conference on P2P computing 8
Spotify Protocol: Design
• Design Goals • Simplicity
• Upload whole track unless DO NOT!!
• Reliability
• TCP instead UDP
• Why??
• TCP’s congestion control
• Re-sending of lost packets
IEEE 10th International Conference on P2P computing 9
Playback
-latency
Stutter
Disturb
Spotify Protocol: Caching
• Importance
• Individual benefit: User wise
• Group benefit: Peer wise in p2p overlay
• Default setting
• 10% of free disk space
• User can configure too, 1-100 GB
• Caches are large!!
• 56% are over 5GB
• Cache eviction: Least Recently Used
• But?
IEEE 10th International Conference on P2P computing 10
I Feel like
I’ve head all
of this
before…
Spotify Protocol: Streaming a Track
• Request first piece from Spotify
servers
• Already open TCP Connection
• Meanwhile, search for peers
with track
IEEE 10th International Conference on P2P computing 11
Spotify Protocol: Streaming a Track (Contd.)
• Server: Better reliable source
• Already initiated TCP connection between client & server
• No repeat 3-way handshake
• Long live, but bursty
• TCP congestion control, e.g. TCP New Reno, Cubic
• Cheated!!
• By a kernel configuration
• Against RFC 5681
• But achieved success - Reduced average playback latency
IEEE 10th International Conference on P2P computing 12
P2P: Ok, Why am I really here?
Client: Please, ask it from my
play-out buffer?
IEEE 10th International Conference on P2P computing 13
Spotify Protocol: Streaming a Track (Contd.)
• Where to stream? Server or P2P
• Local decision depends on
• the amount of data in client’s play-out buffers
• When buffers are sufficient, only download from P2P
• “Emergency mode”
• Buffers become critically low (less than 3 seconds of audio buffered during
playback)
• Stop uploading data to peers
IEEE 10th International Conference on P2P computing 14
Spotify Protocol: Streaming a Track (Contd.)
• Given track,
• Simultaneously request from both server & P2P network
• If a peer is slow: resend to another peer
• Which peer?
• Greedily select peer who has less download time
• 16KB chunks
• sequentially
• Within at most 2 second
• If urgent?
IEEE 10th International Conference on P2P computing 15
Spotify Protocol: Random vs. Regular Access
Random track selection
• Choses a new track to be played
• Jumps into the middle of a track
• 39% playbacks
Predictable track selection
• Next track as current finishes
• Press the Forward
• 61% playbacks
IEEE 10th International Conference on P2P computing 16
Spotify Protocol: Predictable track selection
• Prefetching
• Towards end of a track, start prefetching next one
• But when?
• Too late
• Too early
• Prefetch the next track, when (T-t); Duration of track (T)
• t=30; search P2P network
• t=10; server
IEEE 10th International Conference on P2P computing 17
Spotify Protocol: Play-out Delay
• Minimize latency while avoiding stutter
• TCP throughput varies
• Sensitive to packet loss
• Bandwidth over wireless mediums vary
• Model throughput as
• Markov chain and,
• Simulate the playback of the track
• Heuristics
• Packet delay variation,
• Packet loss, and
• TCP congestion control
IEEE 10th International Conference on P2P computing 18
Talk
• Spotify
• Taxonomy
• Protocol
• P2P Overlay
• Evaluation
• Discussion
IEEE 10th International Conference on P2P computing 19
P2P: Ok, Why am I really here?
Server: Scalability by Load
balancing & Bandwidth utilization
IEEE 10th International Conference on P2P computing 20
P2P Overlay
• Unstructured overlay (not a Distributed Hash Table)
• “No” super nodes
• Direct coupled equal peers
• Split overlay network
• Weakly clustered by interest
IEEE 10th International Conference on P2P computing 21
P2P Overlay: Split Overlay
IEEE 10th International Conference on P2P computing 22
P2P Overlay: Locating Peers
• How to locate peers who
has the specific track?
• Looks for and connects
new peers when
streaming new track
• No overlay routing
• Two mechanisms
1. Tracker based
2. Query the overlay
IEEE 10th International Conference on P2P computing 23
C
A
“Diamond”-
Rihanna
B
“Paradise”-
ColdPlay
D
“Summer”-
Calvin
“Summer”
-Calvin
E
“Mirror”-
JT
P2P Overlay: Tracker
• Similar to BitTorrent, but not Identical
• Server-side tracker
• Only remembers 20 peers per track
• Returns 10 (online) peers to client on query
IEEE 10th International Conference on P2P computing 24
Track Peer Online Flag
Diamond A Yes
Paradise B Yes
Summer D Yes
Diamond F No
Paradise C Yes
Summer E Yes
…. … …
Spotify
Server
P2P Overlay: Query the overlay
• Similar to Gnutella
• Broadcast query
• (2 hops) neighborhood in
overlay
• Priority of “Interest” queries
• L1: Currently streaming track
• L2: Prefetching next track
• L3: Offline synchronization
IEEE 10th International Conference on P2P computing 25
C
A
B
D
“Summer”
-Calvin
E
F
Cached Track:
“Summer”-
Calvin
P2P Overlay: Neighbor Eviction
• Neighbor eviction by heuristic evaluation of utility
1. Bytes sent in the last 10 minutes
2. Bytes sent in the last 60 minutes
3. Bytes received in the last 10 minutes
4. Bytes received in the last 60 minutes
5. The number of peers found through searches sent over the connection in
the last 60 minutes
6. The number of tracks the peer has that the client has been interested in in
the last 10 minutes
IEEE 10th International Conference on P2P computing 26
P2P Overlay: NAT Traversal
• NO NAT Traversal
• Is it about TCP?
• How to mitigate lack of NAT Traversal?
1. “Symmetric” establishment of the connection
2. Universal Plug n’ Play (UPnP) protocol
IEEE 10th International Conference on P2P computing 27
Talk
• Spotify
• Taxonomy
• Protocol
• P2P Overlay
• Evaluation
• Discussion
IEEE 10th International Conference on P2P computing 28
Evaluation: Sources of measurements
• Collected measurements 23–29 March 2010
• Connection statistics
• Clients sent report on every 30 minutes
• Raw log messages
• Log server + Hadoop cluster
• Open source “Munin” monitoring system
IEEE 10th International Conference on P2P computing 29
How well does Spotify work?
IEEE 10th International Conference on P2P computing 30
Evaluation: Data Sources
IEEE 10th International Conference on P2P computing 31
Evaluation: Tradeoff
• Tradeoff
• Server load vs. Playback latency vs. Stutter frequency
• Playback latency = Network latency + (Network latency) + Decoding
IEEE 10th International Conference on P2P computing 32
Digital Rights
Management
(DRM)
Request Track
over the
network
Evaluation: Playback latency
• Median latency: 265 ms
• 75th percentile: 515 ms
• 90th percentile: 1047 ms
• We saw, 56% data comes from
the cache
• Playback latency
• DRM + local processing
IEEE 10th International Conference on P2P computing 33
Evaluation: Stutter Frequency
• Below 1% of playbacks had
stutter occurrences
• Due to Local CPU effects
IEEE 10th International Conference on P2P computing 34
Evaluation: Popularity of track access
• 60% of catalog was accessed
• 88% of track playbacks were within the most popular 12%
• 79% of server requests were within the most popular 21%
IEEE 10th International Conference on P2P computing 35
Evaluation: Locating Peers
IEEE 10th International Conference on P2P computing 36
Evaluation: Protocol Overhead
IEEE 10th International Conference on P2P computing 37
Evaluation: Churn
IEEE 10th International Conference on P2P computing 38
• Comparing with data sources
graph earlier, data delivery
• not severely impacted by clients
logging out (Evening)
• daily dip (Morning)
Future Work
• Play-out strategy adapted to P2P streaming
• User satisfaction metrics
• Music-on-demand streaming
• Specialized overlays exploiting similarity in taste
IEEE 10th International Conference on P2P computing 39
Thank You!!
IEEE 10th International Conference on P2P computing 40

More Related Content

PDF
Distributed "Web Scale" Systems
PDF
Spotify: behind the scenes
PDF
Spotify architecture - Pressing play
PDF
Spotify: P2P music streaming
PDF
Spotify: Horizontal Scalability for Great Success
PDF
Spotify: Data center & Backend buildout
PDF
The Evolution of Big Data at Spotify
PDF
The Evolution of Hadoop at Spotify - Through Failures and Pain
Distributed "Web Scale" Systems
Spotify: behind the scenes
Spotify architecture - Pressing play
Spotify: P2P music streaming
Spotify: Horizontal Scalability for Great Success
Spotify: Data center & Backend buildout
The Evolution of Big Data at Spotify
The Evolution of Hadoop at Spotify - Through Failures and Pain

What's hot (20)

PDF
Machine Learning and Big Data for Music Discovery at Spotify
PDF
Data at Spotify
PDF
Big data and machine learning @ Spotify
PDF
Hadoop Adventures At Spotify (Strata Conference + Hadoop World 2013)
PDF
Big Data At Spotify
PDF
From Idea to Execution: Spotify's Discover Weekly
PDF
Recommending and searching @ Spotify
PDF
Storm at Spotify
PDF
Personalizing the listening experience
PDF
Search @ Spotify
PDF
Etsy Activity Feeds Architecture
PDF
Building Data Pipelines for Music Recommendations at Spotify
PDF
Recommending and Searching (Research @ Spotify)
PDF
Playlist Recommendations @ Spotify
PDF
Music Recommendation 2018
PDF
Scala Data Pipelines @ Spotify
PDF
Approximate nearest neighbor methods and vector models – NYC ML meetup
PDF
DataEngConf: Building a Music Recommender System from Scratch with Spotify Da...
PPTX
Spotify Discover Weekly: The machine learning behind your music recommendations
PDF
How Apache Drives Music Recommendations At Spotify
Machine Learning and Big Data for Music Discovery at Spotify
Data at Spotify
Big data and machine learning @ Spotify
Hadoop Adventures At Spotify (Strata Conference + Hadoop World 2013)
Big Data At Spotify
From Idea to Execution: Spotify's Discover Weekly
Recommending and searching @ Spotify
Storm at Spotify
Personalizing the listening experience
Search @ Spotify
Etsy Activity Feeds Architecture
Building Data Pipelines for Music Recommendations at Spotify
Recommending and Searching (Research @ Spotify)
Playlist Recommendations @ Spotify
Music Recommendation 2018
Scala Data Pipelines @ Spotify
Approximate nearest neighbor methods and vector models – NYC ML meetup
DataEngConf: Building a Music Recommender System from Scratch with Spotify Da...
Spotify Discover Weekly: The machine learning behind your music recommendations
How Apache Drives Music Recommendations At Spotify
Ad

Viewers also liked (6)

PPTX
The California Community College’s Education Planning Initiative (EPI)
PDF
Präsentation über Spotify
PDF
DevOps at Spotify: There and Back Again
PPTX
Spotify
PDF
Algorithmic Music Recommendations at Spotify
PPTX
Collaborative Filtering at Spotify
The California Community College’s Education Planning Initiative (EPI)
Präsentation über Spotify
DevOps at Spotify: There and Back Again
Spotify
Algorithmic Music Recommendations at Spotify
Collaborative Filtering at Spotify
Ad

Similar to Talk on Spotify: Large Scale, Low Latency, P2P Music-on-Demand Streaming (20)

PDF
Spotify: P2P music-on-demand streaming
PDF
Spotify - Technical Solutions & Quality of Experience Review
KEY
Spotify – how it all started
PDF
Putting WebRTC Media in the Cloud
PPTX
Peer-to-Peer Networking Systems and Streaming
PPTX
Practical webRTC - from API to Solution - webRTC Summit 2014 @ NYC
PDF
A Brief Note On Peer And Peer ( P2P ) Applications Have No...
PDF
WebRTC Infrastructure the Hard Parts: Media
PPT
Peer-to-peer Systems.ppt
PDF
WebRTC DataChannels demystified
PPTX
02 - Topologies of Distributed Systems
PPTX
DeveloperWeek 2015 - WebRTC - Where to start and how to scale
PPTX
Web rtc infrastructure the hard parts v4
PPT
Sinnreich Henry Johnston Alan Pt 2
PPT
Peer-to-peer Internet telephony
PPTX
Server-side WebRTC Infrastructure
PPTX
Broadcasting music from the cloud
PDF
ITCamp 2013 - Andy Cross - Broadcasting Music from the Cloud
PDF
Spotify: Playing for millions, tuning for more
PDF
Audio Analysis with Spotify's Web API
Spotify: P2P music-on-demand streaming
Spotify - Technical Solutions & Quality of Experience Review
Spotify – how it all started
Putting WebRTC Media in the Cloud
Peer-to-Peer Networking Systems and Streaming
Practical webRTC - from API to Solution - webRTC Summit 2014 @ NYC
A Brief Note On Peer And Peer ( P2P ) Applications Have No...
WebRTC Infrastructure the Hard Parts: Media
Peer-to-peer Systems.ppt
WebRTC DataChannels demystified
02 - Topologies of Distributed Systems
DeveloperWeek 2015 - WebRTC - Where to start and how to scale
Web rtc infrastructure the hard parts v4
Sinnreich Henry Johnston Alan Pt 2
Peer-to-peer Internet telephony
Server-side WebRTC Infrastructure
Broadcasting music from the cloud
ITCamp 2013 - Andy Cross - Broadcasting Music from the Cloud
Spotify: Playing for millions, tuning for more
Audio Analysis with Spotify's Web API

More from Sameera Horawalavithana (17)

PDF
Data-driven Studies on Social Networks: Privacy and Simulation
PDF
Drivers of Polarized Discussions on Twitter during Venezuela Political Crisis
PDF
Twitter Is the Megaphone of Cross-platform Messaging on the White Helmets
PPTX
Behind the Mask: Understanding the Structural Forces That Make Social Graphs ...
PDF
Mentions of Security Vulnerabilities on Reddit, Twitter and GitHub
PDF
[MLNS | NetSci] A Generative/ Discriminative Approach to De-construct Cascadi...
PPTX
[Compex Network 18] Diversity, Homophily, and the Risk of Node Re-identificat...
PDF
Duplicate Detection on Hoaxy Dataset
PDF
Dancing with Stream Processing
PPTX
[ARM 15 | ACM/IFIP/USENIX Middleware 2015] Research Paper Presentation
PDF
Be Elastic: Leapset Innovation session 06-08-2015
PPTX
[Undergraduate Thesis] Final Defense presentation on Cloud Publish/Subscribe ...
PPTX
[Undergraduate Thesis] Interim presentation on A Publish/Subscribe Model for ...
PPTX
Locality sensitive hashing
PPTX
Zipf distribution
PPTX
Query personalization
PPTX
Dancing with publish/subscribe
Data-driven Studies on Social Networks: Privacy and Simulation
Drivers of Polarized Discussions on Twitter during Venezuela Political Crisis
Twitter Is the Megaphone of Cross-platform Messaging on the White Helmets
Behind the Mask: Understanding the Structural Forces That Make Social Graphs ...
Mentions of Security Vulnerabilities on Reddit, Twitter and GitHub
[MLNS | NetSci] A Generative/ Discriminative Approach to De-construct Cascadi...
[Compex Network 18] Diversity, Homophily, and the Risk of Node Re-identificat...
Duplicate Detection on Hoaxy Dataset
Dancing with Stream Processing
[ARM 15 | ACM/IFIP/USENIX Middleware 2015] Research Paper Presentation
Be Elastic: Leapset Innovation session 06-08-2015
[Undergraduate Thesis] Final Defense presentation on Cloud Publish/Subscribe ...
[Undergraduate Thesis] Interim presentation on A Publish/Subscribe Model for ...
Locality sensitive hashing
Zipf distribution
Query personalization
Dancing with publish/subscribe

Recently uploaded (20)

PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Big Data Technologies - Introduction.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
KodekX | Application Modernization Development
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Empathic Computing: Creating Shared Understanding
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Big Data Technologies - Introduction.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
KodekX | Application Modernization Development
Chapter 3 Spatial Domain Image Processing.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Unlocking AI with Model Context Protocol (MCP)
Empathic Computing: Creating Shared Understanding
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Spectral efficient network and resource selection model in 5G networks
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
CIFDAQ's Market Insight: SEC Turns Pro Crypto

Talk on Spotify: Large Scale, Low Latency, P2P Music-on-Demand Streaming

  • 1. Spotify - Large Scale, Low Latency, P2P Music-on-Demand Streaming Presenter: Y.S.Horawalavithana Authors: Gunnar Kreitz (KTH, Sweden) Fredrik Niemelä (KTH, Sweden)
  • 2. Talk • Spotify • Taxonomy • Protocol • P2P Overlay • Evaluation • Discussion IEEE 10th International Conference on P2P computing 2
  • 3. What is Spotify? • Peer assisted on-demand music streaming • Hybrid Platform • Client/ Server • P2P • Pub/Sub • Large catalog of music (Over 8 million tracks) • 24 million user base • Available as Web, Desktop & Mobile clients IEEE 10th International Conference on P2P computing 3
  • 4. Talk • Spotify • Taxonomy • Protocol • P2P Overlay • Evaluation • Discussion IEEE 10th International Conference on P2P computing 4
  • 5. Taxonomy – Related Work IEEE 10th International Conference on P2P computing 5 On-Demand Music Streaming Client/ Server P2P Overlay On-Demand Video Streaming On-Demand File Sharing Structured Unstructured
  • 6. Problem Statement How to implement & adopt a peer- assisted custom network protocol for on-demand streaming? IEEE 10th International Conference on P2P computing 6
  • 7. Talk • Spotify • Taxonomy • Protocol • P2P Overlay • Evaluation • Discussion IEEE 10th International Conference on P2P computing 7
  • 8. Spotify Protocol: Overview • Network protocol • Designed for streaming music • Audio Stream • Encoding • Ogg Vorbis: quality q5 (160 kbps) or q9 (320 kbps) • Bit-rate • 96-320 kbps • Simple Design!!! IEEE 10th International Conference on P2P computing 8
  • 9. Spotify Protocol: Design • Design Goals • Simplicity • Upload whole track unless DO NOT!! • Reliability • TCP instead UDP • Why?? • TCP’s congestion control • Re-sending of lost packets IEEE 10th International Conference on P2P computing 9 Playback -latency Stutter Disturb
  • 10. Spotify Protocol: Caching • Importance • Individual benefit: User wise • Group benefit: Peer wise in p2p overlay • Default setting • 10% of free disk space • User can configure too, 1-100 GB • Caches are large!! • 56% are over 5GB • Cache eviction: Least Recently Used • But? IEEE 10th International Conference on P2P computing 10 I Feel like I’ve head all of this before…
  • 11. Spotify Protocol: Streaming a Track • Request first piece from Spotify servers • Already open TCP Connection • Meanwhile, search for peers with track IEEE 10th International Conference on P2P computing 11
  • 12. Spotify Protocol: Streaming a Track (Contd.) • Server: Better reliable source • Already initiated TCP connection between client & server • No repeat 3-way handshake • Long live, but bursty • TCP congestion control, e.g. TCP New Reno, Cubic • Cheated!! • By a kernel configuration • Against RFC 5681 • But achieved success - Reduced average playback latency IEEE 10th International Conference on P2P computing 12
  • 13. P2P: Ok, Why am I really here? Client: Please, ask it from my play-out buffer? IEEE 10th International Conference on P2P computing 13
  • 14. Spotify Protocol: Streaming a Track (Contd.) • Where to stream? Server or P2P • Local decision depends on • the amount of data in client’s play-out buffers • When buffers are sufficient, only download from P2P • “Emergency mode” • Buffers become critically low (less than 3 seconds of audio buffered during playback) • Stop uploading data to peers IEEE 10th International Conference on P2P computing 14
  • 15. Spotify Protocol: Streaming a Track (Contd.) • Given track, • Simultaneously request from both server & P2P network • If a peer is slow: resend to another peer • Which peer? • Greedily select peer who has less download time • 16KB chunks • sequentially • Within at most 2 second • If urgent? IEEE 10th International Conference on P2P computing 15
  • 16. Spotify Protocol: Random vs. Regular Access Random track selection • Choses a new track to be played • Jumps into the middle of a track • 39% playbacks Predictable track selection • Next track as current finishes • Press the Forward • 61% playbacks IEEE 10th International Conference on P2P computing 16
  • 17. Spotify Protocol: Predictable track selection • Prefetching • Towards end of a track, start prefetching next one • But when? • Too late • Too early • Prefetch the next track, when (T-t); Duration of track (T) • t=30; search P2P network • t=10; server IEEE 10th International Conference on P2P computing 17
  • 18. Spotify Protocol: Play-out Delay • Minimize latency while avoiding stutter • TCP throughput varies • Sensitive to packet loss • Bandwidth over wireless mediums vary • Model throughput as • Markov chain and, • Simulate the playback of the track • Heuristics • Packet delay variation, • Packet loss, and • TCP congestion control IEEE 10th International Conference on P2P computing 18
  • 19. Talk • Spotify • Taxonomy • Protocol • P2P Overlay • Evaluation • Discussion IEEE 10th International Conference on P2P computing 19
  • 20. P2P: Ok, Why am I really here? Server: Scalability by Load balancing & Bandwidth utilization IEEE 10th International Conference on P2P computing 20
  • 21. P2P Overlay • Unstructured overlay (not a Distributed Hash Table) • “No” super nodes • Direct coupled equal peers • Split overlay network • Weakly clustered by interest IEEE 10th International Conference on P2P computing 21
  • 22. P2P Overlay: Split Overlay IEEE 10th International Conference on P2P computing 22
  • 23. P2P Overlay: Locating Peers • How to locate peers who has the specific track? • Looks for and connects new peers when streaming new track • No overlay routing • Two mechanisms 1. Tracker based 2. Query the overlay IEEE 10th International Conference on P2P computing 23 C A “Diamond”- Rihanna B “Paradise”- ColdPlay D “Summer”- Calvin “Summer” -Calvin E “Mirror”- JT
  • 24. P2P Overlay: Tracker • Similar to BitTorrent, but not Identical • Server-side tracker • Only remembers 20 peers per track • Returns 10 (online) peers to client on query IEEE 10th International Conference on P2P computing 24 Track Peer Online Flag Diamond A Yes Paradise B Yes Summer D Yes Diamond F No Paradise C Yes Summer E Yes …. … … Spotify Server
  • 25. P2P Overlay: Query the overlay • Similar to Gnutella • Broadcast query • (2 hops) neighborhood in overlay • Priority of “Interest” queries • L1: Currently streaming track • L2: Prefetching next track • L3: Offline synchronization IEEE 10th International Conference on P2P computing 25 C A B D “Summer” -Calvin E F Cached Track: “Summer”- Calvin
  • 26. P2P Overlay: Neighbor Eviction • Neighbor eviction by heuristic evaluation of utility 1. Bytes sent in the last 10 minutes 2. Bytes sent in the last 60 minutes 3. Bytes received in the last 10 minutes 4. Bytes received in the last 60 minutes 5. The number of peers found through searches sent over the connection in the last 60 minutes 6. The number of tracks the peer has that the client has been interested in in the last 10 minutes IEEE 10th International Conference on P2P computing 26
  • 27. P2P Overlay: NAT Traversal • NO NAT Traversal • Is it about TCP? • How to mitigate lack of NAT Traversal? 1. “Symmetric” establishment of the connection 2. Universal Plug n’ Play (UPnP) protocol IEEE 10th International Conference on P2P computing 27
  • 28. Talk • Spotify • Taxonomy • Protocol • P2P Overlay • Evaluation • Discussion IEEE 10th International Conference on P2P computing 28
  • 29. Evaluation: Sources of measurements • Collected measurements 23–29 March 2010 • Connection statistics • Clients sent report on every 30 minutes • Raw log messages • Log server + Hadoop cluster • Open source “Munin” monitoring system IEEE 10th International Conference on P2P computing 29
  • 30. How well does Spotify work? IEEE 10th International Conference on P2P computing 30
  • 31. Evaluation: Data Sources IEEE 10th International Conference on P2P computing 31
  • 32. Evaluation: Tradeoff • Tradeoff • Server load vs. Playback latency vs. Stutter frequency • Playback latency = Network latency + (Network latency) + Decoding IEEE 10th International Conference on P2P computing 32 Digital Rights Management (DRM) Request Track over the network
  • 33. Evaluation: Playback latency • Median latency: 265 ms • 75th percentile: 515 ms • 90th percentile: 1047 ms • We saw, 56% data comes from the cache • Playback latency • DRM + local processing IEEE 10th International Conference on P2P computing 33
  • 34. Evaluation: Stutter Frequency • Below 1% of playbacks had stutter occurrences • Due to Local CPU effects IEEE 10th International Conference on P2P computing 34
  • 35. Evaluation: Popularity of track access • 60% of catalog was accessed • 88% of track playbacks were within the most popular 12% • 79% of server requests were within the most popular 21% IEEE 10th International Conference on P2P computing 35
  • 36. Evaluation: Locating Peers IEEE 10th International Conference on P2P computing 36
  • 37. Evaluation: Protocol Overhead IEEE 10th International Conference on P2P computing 37
  • 38. Evaluation: Churn IEEE 10th International Conference on P2P computing 38 • Comparing with data sources graph earlier, data delivery • not severely impacted by clients logging out (Evening) • daily dip (Morning)
  • 39. Future Work • Play-out strategy adapted to P2P streaming • User satisfaction metrics • Music-on-demand streaming • Specialized overlays exploiting similarity in taste IEEE 10th International Conference on P2P computing 39
  • 40. Thank You!! IEEE 10th International Conference on P2P computing 40

Editor's Notes

  • #6: Video on-demand vs. Music on-demand: Differences #user behavior, #the size of streaming objects, and #the number of objects offered for streaming File sharing vs. music on-demand: similarities locating peers e.g. BitTorrent, Gnutella On Demand vs. Live streaming Client/ Server: Napster, Rhapsody, and We7 P2P: Joost, PPLive, and PPStream Structured: tree-based, and mesh-based PPLive: overlay structure, low latency tech
  • #9: Simple Design: Reasons: Stutters Upload all or nothing
  • #10: TCP instead UDP 1) Simplifies protocol design and implementation 2) TCP is nice to the network in that TCP’s congestion control is friendly to itself (and thus other applications using TCP), and the explicit connection signaling helps stateful firewalls 3) As streamed material is shared in the peer-to-peer network, the re-sending of lost packets is useful to the application
  • #11: Simulations using data on cache sizes and playback logs indicate that, as caches are large, the choice of cache eviction policy does not have a large effect on cache efficiency
  • #13: RFC 5681 [11] states that an implementation should reduce its congestion window if it has not sent data in an interval exceeding the retransmission timeout. Linux kernels can be configured to disable that reduction, and when Spotify did so the average playback latency decreased by approximately 50 ms. We remark that this was purely a server-side configuration change
  • #18: Prefetching: If clients begin prefetching too late the prefetching may not be sufficient to allow the next track to immediately start playing. If they prefetch too early the bandwidth may be wasted if the user then makes a random request The clients begin searching the peer-to-peer network and start downloading the next track when 30 seconds or less remain of the current track. When 10 seconds or less remain of the current track, the client prefetches the beginning of the next track from the server if needed
  • #19: Streaming applications need to employ some mechanism to combat the effects of packet packet loss and packet delay variation. trade-off between initial playback latency, receiver buffer size, and the stutter free probability The client performs 100 simulations and if more than one of them fails, it waits longer before beginning playback. During these simulations the client makes the simplifying assumption that data is consumed at a constant rate despite the fact that the codec used has a variable bitrate encoding
  • #23: Peers remember the 50 most recent searches Priority of interests: currently streaming track, prefetching next track, and offline synchronization
  • #26: Peers remember the 50 most recent searches Priority of interests: currently streaming track, prefetching next track, and offline synchronization
  • #27: the peers with the least total scores are disconnected The client simultaneously uploads to at most 4 peers.
  • #28: one would expect that this would constitute a problem as users are likely to be situated behind various NAT devices
  • #32: Mostly minor variations over time 1) Better P2P performance on weekends 2) P2P most effective at peak hours large caches and peer-to-peer network together significantly decrease the load on Spotify’s servers
  • #33: We are not aware of any studies discussing in detail how user’s satisfaction with a streaming service depends on these two factors, but we believe them to be very important
  • #34: We observe that the latency is significantly lower during the night, when the number of tracks played is also low. This is mainly due to two reasons. Firstly, more data is played from the cache during the night. Secondly, users are less interactive during the night, allowing the prefetching