SlideShare a Scribd company logo
1 of 38
BITTORRENT
By-Aditya Pathak
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)
Router
“Interested”
End-host
Source
Router
“Interested”
End-host
Source
CLIENT-SERVER
Router
“Interested”
End-host
Source
CLIENT-SERVER
Overloaded!
Router
“Interested”
End-host
Source
IP MULTICAST
Router
“Interested”
End-host
Source
END-HOST BASED
MULTICAST
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”
 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
www.bittorrent.com
Peer
1
popeye.mp4.torrent
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
Peer
Tracker
Addresses of peers
2
www.bittorrent.com
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
Peer
Tracker3
www.bittorrent.com
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?
  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”

More Related Content

What's hot

Hosting Open Source Projects at the OSUOSL
Hosting Open Source Projects at the OSUOSLHosting Open Source Projects at the OSUOSL
Hosting Open Source Projects at the OSUOSLOSU Open Source Lab
 
OpenStack: running manually installed components on VirtualBox
OpenStack: running manually installed components on VirtualBoxOpenStack: running manually installed components on VirtualBox
OpenStack: running manually installed components on VirtualBoxIan Choi
 
Linux power management: are you doing it right?
Linux power management: are you doing it right?Linux power management: are you doing it right?
Linux power management: are you doing it right?Chris Simmonds
 
Linux field-update-2015
Linux field-update-2015Linux field-update-2015
Linux field-update-2015Chris Simmonds
 
Course 101: Lecture 6: Installing Ubuntu
Course 101: Lecture 6: Installing Ubuntu Course 101: Lecture 6: Installing Ubuntu
Course 101: Lecture 6: Installing Ubuntu Ahmed El-Arabawy
 
The linux kernel hidden inside windows 10
The linux kernel hidden inside windows 10The linux kernel hidden inside windows 10
The linux kernel hidden inside windows 10mark-smith
 
"Puppet at SpaceX" - Jok Thuau of SpaceX - PuppetCamp LA '12
"Puppet at SpaceX" - Jok Thuau of SpaceX - PuppetCamp LA '12"Puppet at SpaceX" - Jok Thuau of SpaceX - PuppetCamp LA '12
"Puppet at SpaceX" - Jok Thuau of SpaceX - PuppetCamp LA '12Puppet
 
Microservices: How loose is loosely coupled?
Microservices: How loose is loosely coupled?Microservices: How loose is loosely coupled?
Microservices: How loose is loosely coupled?John Rofrano
 
Intro to word press
Intro to word pressIntro to word press
Intro to word pressDan Phiffer
 
Android rpi-csimmonds-fosdem-2019
Android rpi-csimmonds-fosdem-2019Android rpi-csimmonds-fosdem-2019
Android rpi-csimmonds-fosdem-2019Chris Simmonds
 
Making Developers Productive with Vagrant, VirtualBox, and Docker
Making Developers Productive with Vagrant, VirtualBox, and DockerMaking Developers Productive with Vagrant, VirtualBox, and Docker
Making Developers Productive with Vagrant, VirtualBox, and DockerJohn Rofrano
 
CoreOS introduction - Johann Romefort
CoreOS introduction - Johann RomefortCoreOS introduction - Johann Romefort
CoreOS introduction - Johann RomefortStylight
 

What's hot (20)

Hosting Open Source Projects at the OSUOSL
Hosting Open Source Projects at the OSUOSLHosting Open Source Projects at the OSUOSL
Hosting Open Source Projects at the OSUOSL
 
OpenStack: running manually installed components on VirtualBox
OpenStack: running manually installed components on VirtualBoxOpenStack: running manually installed components on VirtualBox
OpenStack: running manually installed components on VirtualBox
 
Git 101 for Beginners
Git 101 for Beginners Git 101 for Beginners
Git 101 for Beginners
 
Docker architecture-04-1
Docker architecture-04-1Docker architecture-04-1
Docker architecture-04-1
 
Linux power management: are you doing it right?
Linux power management: are you doing it right?Linux power management: are you doing it right?
Linux power management: are you doing it right?
 
Embedded Systems
Embedded SystemsEmbedded Systems
Embedded Systems
 
Linux field-update-2015
Linux field-update-2015Linux field-update-2015
Linux field-update-2015
 
OpenEmbedded
OpenEmbeddedOpenEmbedded
OpenEmbedded
 
Introduction to DSpace
Introduction to DSpaceIntroduction to DSpace
Introduction to DSpace
 
Course 101: Lecture 6: Installing Ubuntu
Course 101: Lecture 6: Installing Ubuntu Course 101: Lecture 6: Installing Ubuntu
Course 101: Lecture 6: Installing Ubuntu
 
Introduction to linux
Introduction to linuxIntroduction to linux
Introduction to linux
 
The linux kernel hidden inside windows 10
The linux kernel hidden inside windows 10The linux kernel hidden inside windows 10
The linux kernel hidden inside windows 10
 
"Puppet at SpaceX" - Jok Thuau of SpaceX - PuppetCamp LA '12
"Puppet at SpaceX" - Jok Thuau of SpaceX - PuppetCamp LA '12"Puppet at SpaceX" - Jok Thuau of SpaceX - PuppetCamp LA '12
"Puppet at SpaceX" - Jok Thuau of SpaceX - PuppetCamp LA '12
 
Microservices: How loose is loosely coupled?
Microservices: How loose is loosely coupled?Microservices: How loose is loosely coupled?
Microservices: How loose is loosely coupled?
 
[OpenStack Days Korea 2016] 개회사
[OpenStack Days Korea 2016] 개회사[OpenStack Days Korea 2016] 개회사
[OpenStack Days Korea 2016] 개회사
 
Intro to word press
Intro to word pressIntro to word press
Intro to word press
 
Android rpi-csimmonds-fosdem-2019
Android rpi-csimmonds-fosdem-2019Android rpi-csimmonds-fosdem-2019
Android rpi-csimmonds-fosdem-2019
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
Making Developers Productive with Vagrant, VirtualBox, and Docker
Making Developers Productive with Vagrant, VirtualBox, and DockerMaking Developers Productive with Vagrant, VirtualBox, and Docker
Making Developers Productive with Vagrant, VirtualBox, and Docker
 
CoreOS introduction - Johann Romefort
CoreOS introduction - Johann RomefortCoreOS introduction - Johann Romefort
CoreOS introduction - Johann Romefort
 

Similar to Aditya Pathak

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
 
P2P Seminar
P2P SeminarP2P Seminar
P2P SeminarCoRehab
 
P2P: Grid-oriented Distribution Systems
P2P: Grid-oriented Distribution SystemsP2P: Grid-oriented Distribution Systems
P2P: Grid-oriented Distribution SystemsLorin Olsen
 
Bittorrent final seminar
Bittorrent final seminarBittorrent final seminar
Bittorrent final seminarChirodeep Das
 
Bit torrent-technology
Bit torrent-technologyBit torrent-technology
Bit torrent-technologyabhipesit
 
Torrent Protocol
Torrent ProtocolTorrent Protocol
Torrent ProtocolHarsht2888
 
Introduction to the Bittorrent Protocol
Introduction to the Bittorrent ProtocolIntroduction to the Bittorrent Protocol
Introduction to the Bittorrent Protocoltmont
 
Torrent Seminar inc.- working, terms, details
Torrent Seminar inc.- working, terms, detailsTorrent Seminar inc.- working, terms, details
Torrent Seminar inc.- working, terms, detailsMayur Kathale
 
Bit torrent protocol by milan varia
Bit torrent protocol by milan variaBit torrent protocol by milan varia
Bit torrent protocol by milan variaMilan Varia
 
Bit Torrent technology
Bit Torrent technology Bit Torrent technology
Bit Torrent technology Parth Akbari
 
Bit torrent protocol
Bit torrent protocolBit torrent protocol
Bit torrent protocolD bipul lomga
 
BitTorrent-like P2P Networks
BitTorrent-like P2P NetworksBitTorrent-like P2P Networks
BitTorrent-like P2P NetworksKshitij Agarwal
 

Similar to Aditya Pathak (20)

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
 
P2P Seminar
P2P SeminarP2P Seminar
P2P Seminar
 
P2P: Grid-oriented Distribution Systems
P2P: Grid-oriented Distribution SystemsP2P: Grid-oriented Distribution Systems
P2P: Grid-oriented Distribution Systems
 
Bittorrent final seminar
Bittorrent final seminarBittorrent final seminar
Bittorrent final seminar
 
Bittorrent
BittorrentBittorrent
Bittorrent
 
Bit torrent-technology
Bit torrent-technologyBit torrent-technology
Bit torrent-technology
 
Torrent Protocol
Torrent ProtocolTorrent Protocol
Torrent Protocol
 
Introduction to the Bittorrent Protocol
Introduction to the Bittorrent ProtocolIntroduction to the Bittorrent Protocol
Introduction to the Bittorrent Protocol
 
Torrent Seminar inc.- working, terms, details
Torrent Seminar inc.- working, terms, detailsTorrent Seminar inc.- working, terms, details
Torrent Seminar inc.- working, terms, details
 
Bit torrent protocol by milan varia
Bit torrent protocol by milan variaBit torrent protocol by milan varia
Bit torrent protocol by milan varia
 
Bit Torrent technology
Bit Torrent technology Bit Torrent technology
Bit Torrent technology
 
BitTorrent.pdf
BitTorrent.pdfBitTorrent.pdf
BitTorrent.pdf
 
Bit torrent protocol
Bit torrent protocolBit torrent protocol
Bit torrent protocol
 
Bittorrent
BittorrentBittorrent
Bittorrent
 
Bittorrent
BittorrentBittorrent
Bittorrent
 
Bit Torrent
Bit Torrent Bit Torrent
Bit Torrent
 
Bittorrent
BittorrentBittorrent
Bittorrent
 
Bit torrent a revolution in p2p
Bit torrent a revolution in p2pBit torrent a revolution in p2p
Bit torrent a revolution in p2p
 
BitTorrent-like P2P Networks
BitTorrent-like P2P NetworksBitTorrent-like P2P Networks
BitTorrent-like P2P Networks
 
Bittorrent
BittorrentBittorrent
Bittorrent
 

Recently uploaded

Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....ShaimaaMohamedGalal
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 

Recently uploaded (20)

Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 

Aditya Pathak

  • 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)
  • 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?
  • 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”  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 www.bittorrent.com Peer 1 popeye.mp4.torrent
  • 19. 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 Peer Tracker Addresses of peers 2 www.bittorrent.com
  • 20. 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 Peer Tracker3 www.bittorrent.com 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?   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”