SlideShare ist ein Scribd-Unternehmen logo
1 von 38
BitTorrent

        CS514
Vivek Vishnumurthy, TA
Common Scenario
• Millions want to download the same
  popular huge files (for free)
  – ISO’s
  – Media (the real example!)
• Client-server model fails
  – Single server fails
  – Can’t afford to deploy enough servers
IP Multicast?
• Recall: IP Multicast not a real option in
  general settings
  – Not scalable
  – Only used in private settings
• Alternatives
  – End-host based Multicast
  – BitTorrent
  – Other P2P file-sharing schemes (later in
    lecture)
Source

   Router

“Interested”
  End-host
Client-Server




   Source

   Router

“Interested”
  End-host
Client-Server
                     Overloaded!




   Source

   Router

“Interested”
  End-host
IP multicast




   Source

   Router

“Interested”
  End-host
End-host based multicast




   Source

   Router

“Interested”
  End-host
End-host based multicast
• “Single-uploader”  “Multiple-uploaders”
  – Lots of nodes want to download
  – Make use of their uploading abilities as well
  – Node that has downloaded (part of) file will
    then upload it to other nodes.
  Uploading costs amortized across all nodes
End-host based multicast
• Also called “Application-level Multicast”
• Many protocols proposed early this
  decade
  – Yoid (2000), Narada (2000), Overcast (2000),
    ALMI (2001)
     • All use single trees
     • Problem with single trees?
End-host multicast using single tree
             Source
End-host multicast using single tree
             Source
End-host multicast using single tree
             Source

                            Slow data transfer
End-host multicast using single tree
• Tree is “push-based” – node receives data,
  pushes data to children
• Failure of “interior”-node affects downloads in
  entire subtree rooted at node
• Slow interior node similarly affects entire subtree
• Also, leaf-nodes don’t do any sending!
• Though later multi-tree / multi-path protocols
  (Chunkyspread (2006), Chainsaw (2005), Bullet
  (2003)) mitigate some of these issues
BitTorrent
• Written by Bram Cohen (in Python) in 2001
• “Pull-based” “swarming” approach
  – Each file split into smaller pieces
  – Nodes request desired pieces from neighbors
     • As opposed to parents pushing data that they receive
  – Pieces not downloaded in sequential order
  – Previous multicast schemes aimed to support
    “streaming”; BitTorrent does not
• Encourages contribution by all nodes
BitTorrent Swarm
• Swarm
  – Set of peers all downloading the same file
  – Organized as a random mesh
• Each node knows list of pieces
  downloaded by neighbors
• Node requests pieces it does not own
  from neighbors
  – Exact method explained later
How a node enters a swarm
   for file “popeye.mp4”

              • File popeye.mp4.torrent
                hosted at a (well-known)
                webserver
              • The .torrent has address
                of tracker for file
              • The tracker, which runs
                on a webserver as well,
                keeps track of all peers
                downloading file
How a node enters a swarm
              for file “popeye.mp4”
                                       www.bittorrent.com

                                                            • File popeye.mp4.torrent
                                                              hosted at a (well-known)
          1
                                                              webserver
                                  nt
                           orre                             • The .torrent has address
Peer                  p4.t
           e   ye.m
       pop
                                                              of tracker for file
                                                            • The tracker, which runs
                                                              on a webserver as well,
                                                              keeps track of all peers
                                                              downloading file
How a node enters a swarm
               for file “popeye.mp4”
                                      www.bittorrent.com

                                                           • File popeye.mp4.torrent
                                                             hosted at a (well-known)
                                                             webserver
Peer
                 2                                         • The .torrent has address
                                                             of tracker for file
       A ddr e
                 sses
                        of pee
                                 rs        Tracker         • The tracker, which runs
                                                             on a webserver as well,
                                                             keeps track of all peers
                                                             downloading file
How a node enters a swarm
                for file “popeye.mp4”
                  www.bittorrent.com

                                       • File popeye.mp4.torrent
                                         hosted at a (well-known)
                                         webserver
Peer                                   • The .torrent has address
                                         of tracker for file
         3             Tracker         • The tracker, which runs
                                         on a webserver as well,
                                         keeps track of all peers
                                         downloading file
 Swarm
Contents of .torrent file
• URL of tracker
• Piece length – Usually 256 KB
• SHA-1 hashes of each piece in file
  – For reliability
• “files” – allows download of multiple files
Terminology
• Seed: peer with the entire file
  – Original Seed: The first seed
• Leech: peer that’s downloading the file
  – Fairer term might have been “downloader”
• Sub-piece: Further subdivision of a piece
  – The “unit for requests” is a subpiece
  – But a peer uploads only after assembling
    complete piece
Peer-peer transactions:
     Choosing pieces to request
• Rarest-first: Look at all pieces at all peers,
  and request piece that’s owned by fewest
  peers
  – Increases diversity in the pieces downloaded
     • avoids case where a node and each of its peers
       have exactly the same pieces; increases
       throughput
  – Increases likelihood all pieces still available
    even if original seed leaves before any one
    node has downloaded entire file
Choosing pieces to request
• Random First Piece:
  – When peer starts to download, request
    random piece.
    • So as to assemble first complete piece quickly
    • Then participate in uploads
  – When first complete piece assembled, switch
    to rarest-first
Choosing pieces to request
• End-game mode:
  – When requests sent for all sub-pieces,
    (re)send requests to all peers.
  – To speed up completion of download
  – Cancel request for downloaded sub-pieces
Tit-for-tat as incentive to upload
• Want to encourage all peers to contribute
• Peer A said to choke peer B if it (A) decides not
  to upload to B
• Each peer (say A) unchokes at most 4 interested
  peers at any time
  – The three with the largest upload rates to A
     • Where the tit-for-tat comes in
  – Another randomly chosen (Optimistic Unchoke)
     • To periodically look for better choices
Anti-snubbing
• A peer is said to be snubbed if each of its
  peers chokes it
• To handle this, snubbed peer stops
  uploading to its peers
 Optimistic unchoking done more often
  – Hope is that will discover a new peer that will
    upload to us
Why BitTorrent took off
• Better performance through “pull-based”
  transfer
  – Slow nodes don’t bog down other nodes
• Allows uploading from hosts that have
  downloaded parts of a file
  – In common with other end-host based
    multicast schemes
Why BitTorrent took off
• Practical Reasons (perhaps more important!)
  – Working implementation (Bram Cohen) with simple
    well-defined interfaces for plugging in new content
  – Many recent competitors got sued / shut down
     • Napster, Kazaa
  – Doesn’t do “search” per se. Users use well-known,
    trusted sources to locate content
     • Avoids the pollution problem, where garbage is passed off as
       authentic content
Pros and cons of BitTorrent
• Pros
  – Proficient in utilizing partially downloaded files
  – Discourages “freeloading”
     • By rewarding fastest uploaders
  – Encourages diversity through “rarest-first”
     • Extends lifetime of swarm
• Works well for “hot content”
Pros and cons of BitTorrent
• Cons
  – Assumes all interested peers active at same
    time; performance deteriorates if swarm
    “cools off”
  – Even worse: no trackers for obscure content
Pros and cons of BitTorrent
• Dependence on centralized tracker:
  pro/con?
  n  Single point of failure: New nodes can’t
    enter swarm if tracker goes down
  – Lack of a search feature
     Prevents pollution attacks
     Users need to resort to out-of-band search: well
     known torrent-hosting sites / plain old web-search
“Trackerless” BitTorrent
• To be more precise, “BitTorrent without a
  centralized-tracker”
• E.g.: Azureus
• Uses a Distributed Hash Table (Kademlia DHT)
• Tracker run by a normal end-host (not a web-
  server anymore)
  – The original seeder could itself be the tracker
  – Or have a node in the DHT randomly picked to act as
    the tracker
Why is (studying) BitTorrent
        important?




   (From CacheLogic, 2004)
Why is (studying) BitTorrent
            important?
• BitTorrent consumes significant amount of
  internet traffic today
  – In 2004, BitTorrent accounted for 30% of all
    internet traffic (Total P2P was 60%),
    according to CacheLogic
  – Slightly lower share in 2005 (possibly
    because of legal action), but still significant
  – BT always used for legal software (linux iso)
    distribution too
  – Recently: legal media downloads (Fox)
Other file-sharing systems
• Prominent earlier: Napster, Kazaa,
  Gnutella
• Current popular file-sharing client: eMule
  – Connects to the ed2k and Kad networks
  – ed2k has a supernode-ish architecture
    (distinction between servers and normal
    clients)
  – Kad based on the Kademlia DHT
File-sharing systems…
• (Anecdotally) Better than BitTorrent in
  finding obscure items
• Vulnerable to:
  – Pollution attacks: Garbage data inserted with
    the same file name; hard to distinguish
  – Index-poisoning attacks (sneakier): Insert
    bogus entries pointing to non-existant files
  – Kazaa reportedly has more than 50% pollution
    + poisoning
References
• BitTorrent
  – “Incentives build robustness in BitTorrent”,
    Bram Cohen
  – BitTorrent Protocol Specification:
    http://www.bittorrent.org/protocol.html
• Poisoning/Pollution in DHT’s:
  – “Index Poisoning Attack in P2P file sharing
    systems”
  – “Pollution in P2P File Sharing Systems”

Weitere ähnliche Inhalte

Was ist angesagt?

Embedded Systems: Lecture 8: The Raspberry Pi as a Linux Box
Embedded Systems: Lecture 8: The Raspberry Pi as a Linux BoxEmbedded Systems: Lecture 8: The Raspberry Pi as a Linux Box
Embedded Systems: Lecture 8: The Raspberry Pi as a Linux BoxAhmed El-Arabawy
 
Large Files without the Trials
Large Files without the TrialsLarge Files without the Trials
Large Files without the TrialsSally Kleinfeldt
 
UNRAVEILING BIT-TORRENT
UNRAVEILING BIT-TORRENTUNRAVEILING BIT-TORRENT
UNRAVEILING BIT-TORRENTSudhansu Dash
 
Bit torrent protocol by milan varia
Bit torrent protocol by milan variaBit torrent protocol by milan varia
Bit torrent protocol by milan variaMilan Varia
 
Spacebrew: The Overview
Spacebrew: The OverviewSpacebrew: The Overview
Spacebrew: The OverviewBrett Renfer
 
Bit Torrent Technology
Bit Torrent TechnologyBit Torrent Technology
Bit Torrent Technologyguestc67adeb
 
Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1) Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1) Ahmed El-Arabawy
 
Dist::Zilla - A very brief introduction
Dist::Zilla - A very brief introductionDist::Zilla - A very brief introduction
Dist::Zilla - A very brief introductionDean Hamstead
 
WHIP WebRTC Broadcasting @ FOSDEM 2022
WHIP WebRTC Broadcasting @ FOSDEM 2022WHIP WebRTC Broadcasting @ FOSDEM 2022
WHIP WebRTC Broadcasting @ FOSDEM 2022Lorenzo Miniero
 
The Gory Details of Debian packages
The Gory Details of Debian packagesThe Gory Details of Debian packages
The Gory Details of Debian packagesJeremiah Foster
 
Packaging for the Maemo Platform
Packaging for the Maemo PlatformPackaging for the Maemo Platform
Packaging for the Maemo PlatformJeremiah Foster
 
Unix _linux_fundamentals_for_hpc-_b
Unix  _linux_fundamentals_for_hpc-_bUnix  _linux_fundamentals_for_hpc-_b
Unix _linux_fundamentals_for_hpc-_bMohammad Reza Beygi
 
In Search of the Perfect Global Interpreter Lock
In Search of the Perfect Global Interpreter LockIn Search of the Perfect Global Interpreter Lock
In Search of the Perfect Global Interpreter LockDavid Beazley (Dabeaz LLC)
 

Was ist angesagt? (20)

Bit torrent ppt
Bit torrent pptBit torrent ppt
Bit torrent ppt
 
Embedded Systems: Lecture 8: The Raspberry Pi as a Linux Box
Embedded Systems: Lecture 8: The Raspberry Pi as a Linux BoxEmbedded Systems: Lecture 8: The Raspberry Pi as a Linux Box
Embedded Systems: Lecture 8: The Raspberry Pi as a Linux Box
 
BitTorrent
BitTorrent BitTorrent
BitTorrent
 
Large Files without the Trials
Large Files without the TrialsLarge Files without the Trials
Large Files without the Trials
 
Internet TV
Internet TVInternet TV
Internet TV
 
UNRAVEILING BIT-TORRENT
UNRAVEILING BIT-TORRENTUNRAVEILING BIT-TORRENT
UNRAVEILING BIT-TORRENT
 
Spotify: behind the scenes
Spotify: behind the scenesSpotify: behind the scenes
Spotify: behind the scenes
 
Bit torrent protocol by milan varia
Bit torrent protocol by milan variaBit torrent protocol by milan varia
Bit torrent protocol by milan varia
 
Spacebrew: The Overview
Spacebrew: The OverviewSpacebrew: The Overview
Spacebrew: The Overview
 
BitTorrent Seminar Report
BitTorrent Seminar ReportBitTorrent Seminar Report
BitTorrent Seminar Report
 
Bit Torrent Technology
Bit Torrent TechnologyBit Torrent Technology
Bit Torrent Technology
 
Mastering Python 3 I/O (Version 2)
Mastering Python 3 I/O (Version 2)Mastering Python 3 I/O (Version 2)
Mastering Python 3 I/O (Version 2)
 
Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1) Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1)
 
Dist::Zilla - A very brief introduction
Dist::Zilla - A very brief introductionDist::Zilla - A very brief introduction
Dist::Zilla - A very brief introduction
 
WHIP WebRTC Broadcasting @ FOSDEM 2022
WHIP WebRTC Broadcasting @ FOSDEM 2022WHIP WebRTC Broadcasting @ FOSDEM 2022
WHIP WebRTC Broadcasting @ FOSDEM 2022
 
The Gory Details of Debian packages
The Gory Details of Debian packagesThe Gory Details of Debian packages
The Gory Details of Debian packages
 
Debian packaging
Debian packagingDebian packaging
Debian packaging
 
Packaging for the Maemo Platform
Packaging for the Maemo PlatformPackaging for the Maemo Platform
Packaging for the Maemo Platform
 
Unix _linux_fundamentals_for_hpc-_b
Unix  _linux_fundamentals_for_hpc-_bUnix  _linux_fundamentals_for_hpc-_b
Unix _linux_fundamentals_for_hpc-_b
 
In Search of the Perfect Global Interpreter Lock
In Search of the Perfect Global Interpreter LockIn Search of the Perfect Global Interpreter Lock
In Search of the Perfect Global Interpreter Lock
 

Ähnlich wie Bittorrent

Bit torrent protocol seminar by Sanjay R
Bit torrent protocol seminar by Sanjay RBit torrent protocol seminar by Sanjay R
Bit torrent protocol seminar by Sanjay RSanjay Ravishankar
 
Bittorrent final seminar
Bittorrent final seminarBittorrent final seminar
Bittorrent final seminarChirodeep Das
 
Bit torrent explained
Bit torrent explainedBit torrent explained
Bit torrent explainedDan Miller
 
Spotify: P2P music-on-demand streaming
Spotify: P2P music-on-demand streamingSpotify: P2P music-on-demand streaming
Spotify: P2P music-on-demand streamingRicardo Vice Santos
 
Bittorrent Seminar by dhananjay pardeshi
Bittorrent Seminar by dhananjay pardeshiBittorrent Seminar by dhananjay pardeshi
Bittorrent Seminar by dhananjay pardeshidhananjaypardeshi13
 
Bit torrent protocol
Bit torrent protocolBit torrent protocol
Bit torrent protocolKarwan Jacksi
 
Bit torrent seminar
Bit torrent seminarBit torrent seminar
Bit torrent seminarbalu0503
 
Bit torrent protocol
Bit torrent protocolBit torrent protocol
Bit torrent protocolD bipul lomga
 
Introduction to the Bittorrent Protocol
Introduction to the Bittorrent ProtocolIntroduction to the Bittorrent Protocol
Introduction to the Bittorrent Protocoltmont
 
Bittorrent Seminar by dhananjay pardeshi
Bittorrent Seminar by dhananjay pardeshiBittorrent Seminar by dhananjay pardeshi
Bittorrent Seminar by dhananjay pardeshidhananjaypardeshi13
 
P2P: Grid-oriented Distribution Systems
P2P: Grid-oriented Distribution SystemsP2P: Grid-oriented Distribution Systems
P2P: Grid-oriented Distribution SystemsLorin Olsen
 

Ähnlich wie Bittorrent (20)

Bittorrent
BittorrentBittorrent
Bittorrent
 
P2P Lecture.ppt
P2P Lecture.pptP2P Lecture.ppt
P2P Lecture.ppt
 
Bittorrent
BittorrentBittorrent
Bittorrent
 
Bit torrent protocol seminar by Sanjay R
Bit torrent protocol seminar by Sanjay RBit torrent protocol seminar by Sanjay R
Bit torrent protocol seminar by Sanjay R
 
Bittorrent final seminar
Bittorrent final seminarBittorrent final seminar
Bittorrent final seminar
 
Bit torrent explained
Bit torrent explainedBit torrent explained
Bit torrent explained
 
Spotify: P2P music-on-demand streaming
Spotify: P2P music-on-demand streamingSpotify: P2P music-on-demand streaming
Spotify: P2P music-on-demand streaming
 
Bit torrent
Bit torrentBit torrent
Bit torrent
 
Bittorrent Seminar by dhananjay pardeshi
Bittorrent Seminar by dhananjay pardeshiBittorrent Seminar by dhananjay pardeshi
Bittorrent Seminar by dhananjay pardeshi
 
BitTorrent
BitTorrentBitTorrent
BitTorrent
 
Bit torrent protocol
Bit torrent protocolBit torrent protocol
Bit torrent protocol
 
Bit torrent seminar
Bit torrent seminarBit torrent seminar
Bit torrent seminar
 
Torrent technology
Torrent technologyTorrent technology
Torrent technology
 
P2P Forensics
P2P ForensicsP2P Forensics
P2P Forensics
 
Bit torrent protocol
Bit torrent protocolBit torrent protocol
Bit torrent protocol
 
Peer to peer(p2 p)
Peer to peer(p2 p)Peer to peer(p2 p)
Peer to peer(p2 p)
 
Introduction to the Bittorrent Protocol
Introduction to the Bittorrent ProtocolIntroduction to the Bittorrent Protocol
Introduction to the Bittorrent Protocol
 
Abeer Elshahat
Abeer ElshahatAbeer Elshahat
Abeer Elshahat
 
Bittorrent Seminar by dhananjay pardeshi
Bittorrent Seminar by dhananjay pardeshiBittorrent Seminar by dhananjay pardeshi
Bittorrent Seminar by dhananjay pardeshi
 
P2P: Grid-oriented Distribution Systems
P2P: Grid-oriented Distribution SystemsP2P: Grid-oriented Distribution Systems
P2P: Grid-oriented Distribution Systems
 

Kürzlich hochgeladen

A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 

Kürzlich hochgeladen (20)

A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 

Bittorrent

  • 1. BitTorrent CS514 Vivek Vishnumurthy, TA
  • 2. Common Scenario • Millions want to download the same popular huge files (for free) – ISO’s – Media (the real example!) • Client-server model fails – Single server fails – Can’t afford to deploy enough servers
  • 3. IP Multicast? • Recall: IP Multicast not a real option in general settings – Not scalable – Only used in private settings • Alternatives – End-host based Multicast – BitTorrent – Other P2P file-sharing schemes (later in lecture)
  • 4. Source Router “Interested” End-host
  • 5. Client-Server Source Router “Interested” End-host
  • 6. Client-Server Overloaded! Source Router “Interested” End-host
  • 7. IP multicast Source Router “Interested” End-host
  • 8. End-host based multicast Source Router “Interested” End-host
  • 9. End-host based multicast • “Single-uploader”  “Multiple-uploaders” – Lots of nodes want to download – Make use of their uploading abilities as well – Node that has downloaded (part of) file will then upload it to other nodes. Uploading costs amortized across all nodes
  • 10. End-host based multicast • Also called “Application-level Multicast” • Many protocols proposed early this decade – Yoid (2000), Narada (2000), Overcast (2000), ALMI (2001) • All use single trees • Problem with single trees?
  • 11. End-host multicast using single tree Source
  • 12. End-host multicast using single tree Source
  • 13. End-host multicast using single tree Source Slow data transfer
  • 14. End-host multicast using single tree • Tree is “push-based” – node receives data, pushes data to children • Failure of “interior”-node affects downloads in entire subtree rooted at node • Slow interior node similarly affects entire subtree • Also, leaf-nodes don’t do any sending! • Though later multi-tree / multi-path protocols (Chunkyspread (2006), Chainsaw (2005), Bullet (2003)) mitigate some of these issues
  • 15. BitTorrent • Written by Bram Cohen (in Python) in 2001 • “Pull-based” “swarming” approach – Each file split into smaller pieces – Nodes request desired pieces from neighbors • As opposed to parents pushing data that they receive – Pieces not downloaded in sequential order – Previous multicast schemes aimed to support “streaming”; BitTorrent does not • Encourages contribution by all nodes
  • 16. BitTorrent Swarm • Swarm – Set of peers all downloading the same file – Organized as a random mesh • Each node knows list of pieces downloaded by neighbors • Node requests pieces it does not own from neighbors – Exact method explained later
  • 17. How a node enters a swarm for file “popeye.mp4” • File popeye.mp4.torrent hosted at a (well-known) webserver • The .torrent has address of tracker for file • The tracker, which runs on a webserver as well, keeps track of all peers downloading file
  • 18. How a node enters a swarm for file “popeye.mp4” www.bittorrent.com • File popeye.mp4.torrent hosted at a (well-known) 1 webserver nt orre • The .torrent has address Peer p4.t e ye.m pop of tracker for file • The tracker, which runs on a webserver as well, keeps track of all peers downloading file
  • 19. How a node enters a swarm for file “popeye.mp4” www.bittorrent.com • File popeye.mp4.torrent hosted at a (well-known) webserver Peer 2 • The .torrent has address of tracker for file A ddr e sses of pee rs Tracker • The tracker, which runs on a webserver as well, keeps track of all peers downloading file
  • 20. How a node enters a swarm for file “popeye.mp4” www.bittorrent.com • File popeye.mp4.torrent hosted at a (well-known) webserver Peer • The .torrent has address of tracker for file 3 Tracker • The tracker, which runs on a webserver as well, keeps track of all peers downloading file Swarm
  • 21. Contents of .torrent file • URL of tracker • Piece length – Usually 256 KB • SHA-1 hashes of each piece in file – For reliability • “files” – allows download of multiple files
  • 22. Terminology • Seed: peer with the entire file – Original Seed: The first seed • Leech: peer that’s downloading the file – Fairer term might have been “downloader” • Sub-piece: Further subdivision of a piece – The “unit for requests” is a subpiece – But a peer uploads only after assembling complete piece
  • 23. Peer-peer transactions: Choosing pieces to request • Rarest-first: Look at all pieces at all peers, and request piece that’s owned by fewest peers – Increases diversity in the pieces downloaded • avoids case where a node and each of its peers have exactly the same pieces; increases throughput – Increases likelihood all pieces still available even if original seed leaves before any one node has downloaded entire file
  • 24. Choosing pieces to request • Random First Piece: – When peer starts to download, request random piece. • So as to assemble first complete piece quickly • Then participate in uploads – When first complete piece assembled, switch to rarest-first
  • 25. Choosing pieces to request • End-game mode: – When requests sent for all sub-pieces, (re)send requests to all peers. – To speed up completion of download – Cancel request for downloaded sub-pieces
  • 26. Tit-for-tat as incentive to upload • Want to encourage all peers to contribute • Peer A said to choke peer B if it (A) decides not to upload to B • Each peer (say A) unchokes at most 4 interested peers at any time – The three with the largest upload rates to A • Where the tit-for-tat comes in – Another randomly chosen (Optimistic Unchoke) • To periodically look for better choices
  • 27. Anti-snubbing • A peer is said to be snubbed if each of its peers chokes it • To handle this, snubbed peer stops uploading to its peers  Optimistic unchoking done more often – Hope is that will discover a new peer that will upload to us
  • 28. Why BitTorrent took off • Better performance through “pull-based” transfer – Slow nodes don’t bog down other nodes • Allows uploading from hosts that have downloaded parts of a file – In common with other end-host based multicast schemes
  • 29. Why BitTorrent took off • Practical Reasons (perhaps more important!) – Working implementation (Bram Cohen) with simple well-defined interfaces for plugging in new content – Many recent competitors got sued / shut down • Napster, Kazaa – Doesn’t do “search” per se. Users use well-known, trusted sources to locate content • Avoids the pollution problem, where garbage is passed off as authentic content
  • 30. Pros and cons of BitTorrent • Pros – Proficient in utilizing partially downloaded files – Discourages “freeloading” • By rewarding fastest uploaders – Encourages diversity through “rarest-first” • Extends lifetime of swarm • Works well for “hot content”
  • 31. Pros and cons of BitTorrent • Cons – Assumes all interested peers active at same time; performance deteriorates if swarm “cools off” – Even worse: no trackers for obscure content
  • 32. Pros and cons of BitTorrent • Dependence on centralized tracker: pro/con? n  Single point of failure: New nodes can’t enter swarm if tracker goes down – Lack of a search feature  Prevents pollution attacks  Users need to resort to out-of-band search: well known torrent-hosting sites / plain old web-search
  • 33. “Trackerless” BitTorrent • To be more precise, “BitTorrent without a centralized-tracker” • E.g.: Azureus • Uses a Distributed Hash Table (Kademlia DHT) • Tracker run by a normal end-host (not a web- server anymore) – The original seeder could itself be the tracker – Or have a node in the DHT randomly picked to act as the tracker
  • 34. Why is (studying) BitTorrent important? (From CacheLogic, 2004)
  • 35. Why is (studying) BitTorrent important? • BitTorrent consumes significant amount of internet traffic today – In 2004, BitTorrent accounted for 30% of all internet traffic (Total P2P was 60%), according to CacheLogic – Slightly lower share in 2005 (possibly because of legal action), but still significant – BT always used for legal software (linux iso) distribution too – Recently: legal media downloads (Fox)
  • 36. Other file-sharing systems • Prominent earlier: Napster, Kazaa, Gnutella • Current popular file-sharing client: eMule – Connects to the ed2k and Kad networks – ed2k has a supernode-ish architecture (distinction between servers and normal clients) – Kad based on the Kademlia DHT
  • 37. File-sharing systems… • (Anecdotally) Better than BitTorrent in finding obscure items • Vulnerable to: – Pollution attacks: Garbage data inserted with the same file name; hard to distinguish – Index-poisoning attacks (sneakier): Insert bogus entries pointing to non-existant files – Kazaa reportedly has more than 50% pollution + poisoning
  • 38. References • BitTorrent – “Incentives build robustness in BitTorrent”, Bram Cohen – BitTorrent Protocol Specification: http://www.bittorrent.org/protocol.html • Poisoning/Pollution in DHT’s: – “Index Poisoning Attack in P2P file sharing systems” – “Pollution in P2P File Sharing Systems”