The BitTorrent Protocol

Similar documents
Incentives Build Robustness in BitTorrent

Lecture 6 Content Distribution and BitTorrent

P2P File Sharing: BitTorrent in Detail

SE4C03: Computer Networks and Computer Security Last revised: April Name: Nicholas Lake Student Number: For: S.

Peer-to-Peer Networks. Chapter 2: Initial (real world) systems Thorsten Strufe

Seminar RVS MC-FTP (Multicast File Transfer Protocol): Simulation and Comparison with BitTorrent

P2P: centralized directory (Napster s Approach)

Peer-to-Peer Data Management

Java Bit Torrent Client

CS5412: TORRENTS AND TIT-FOR-TAT

The Role and uses of Peer-to-Peer in file-sharing. Computer Communication & Distributed Systems EDA 390

Attacking a Swarm with a Band of Liars evaluating the impact of attacks on BitTorrent

BitTorrent Peer To Peer File Sharing

Content Distribution Network (CDN)

CNT5106C Project Description

MC-FTP (Multicast File Transfer Protocol): Implementation and Comparison with

Peer-to-peer filetransfer protocols and IPv6. János Mohácsi NIIF/HUNGARNET TF-NGN meeting, 1/Oct/2004

The Algorithm of Sharing Incomplete Data in Decentralized P2P

Department of Computer Science Institute for System Architecture, Chair for Computer Networks. File Sharing

Lab 5: BitTorrent Client Implementation

Data Deduplication in BitTorrent. Thesis to obtain the Master of Science Degree in Information Systems and Computer Engineering

The Internet is Flat: A brief history of networking over the next ten years. Don Towsley UMass - Amherst

CSCI-1680 CDN & P2P Chen Avin

Middleware and Distributed Systems. Peer-to-Peer Systems. Martin v. Löwis. Montag, 30. Januar 12

DDoS Vulnerability Analysis of Bittorrent Protocol

Should Internet Service Providers Fear Peer-Assisted Content Distribution?

MODIFIED BITTORRENT PROTOCOL AND ITS APPLICATION IN CLOUD COMPUTING ENVIRONMENT

Peer-to-peer networking with BitTorrent

From Centralization to Distribution: A Comparison of File Sharing Protocols

A THESIS SUBMITTED TO THE FACULTY OF THE GRADUATE SCHOOL OF THE UNIVERSITY OF MINNESOTA BY. Ranga Reddy Pallelra

apt-p2p: A Peer-to-Peer Distribution System for Software Package Releases and Updates

Evaluating the Effectiveness of a BitTorrent-driven DDoS Attack

1. The subnet must prevent additional packets from entering the congested region until those already present can be processed.

Revisiting P2P content sharing in wireless ad hoc networks

Optimizing Congestion in Peer-to-Peer File Sharing Based on Network Coding

Modeling and Analysis of Bandwidth-Inhomogeneous Swarms in BitTorrent

Torrage: A Secure BitTorrent based Peer-to-Peer Distributed Storage System

q Admin and recap q Case studies: Content Distribution o Forward proxy (web cache) o Akamai o YouTube q P2P networks o Overview

A CASE STUDY IN MODELING LARGE-SCALE PEER-TO-PEER FILE-SHARING NETWORKS USING DISCRETE-EVENT SIMULATION

How To Predict Bittorrent Eta

Dynamic File Bundling for Large-scale Content Distribution

Sync Security and Privacy Brief

ABSTRACT. Performance Improvements to Peer-to-Peer File Transfers Using Network Coding. Aaron A. Kelley, M.S. Mentor: William B. Poucher, Ph.D.

The Impact of Background Network Traffic on Foreground Network Traffic

The Bittorrent P2P File-sharing System: Measurements And Analysis J.A. Pouwelse, P. Garbacki, D.H.J. Epema, H.J. Sips Department of Computer Science,

A Comparison of Mobile Peer-to-peer File-sharing Clients

HW2 Grade. CS585: Applications. Traditional Applications SMTP SMTP HTTP 11/10/2009

The Challenges of Stopping Illegal Peer-to-Peer File Sharing

Optimizing and Balancing Load in Fully Distributed P2P File Sharing Systems

Computation and Economics - Spring 2012 Assignment #3: File Sharing

TIME EFFICIENT DISTRIBUTED FILE STORAGE AND SHARING USING P2P NETWORK IN CLOUD

CGHub Client Security Guide Documentation

1. The Web: HTTP; file transfer: FTP; remote login: Telnet; Network News: NNTP; SMTP.

Distributed File System. MCSN N. Tonellotto Complements of Distributed Enabling Platforms

A Reliable and Fast Data Transfer for Grid Systems Using a Dynamic Firewall Configuration

Three short case studies

Case 1:15-cv WYD-MEH Document 1 Filed 12/17/15 USDC Colorado Page 1 of 11 THE UNITED STATES DISTRICT COURT FOR THE DISTRICT OF COLORADO

An apparatus for P2P classification in Netflow traces

Privacy- Preserving P2P Data Sharing with OneSwarm. Presented by. Adnan Malik

Load Re-Balancing for Distributed File. System with Replication Strategies in Cloud

Bit Chat: A Peer-to-Peer Instant Messenger

CS 360 Internet Programming

Peer-to-Peer Networks. Chapter 6: P2P Content Distribution

Transcription:

The BitTorrent Protocol Taken from http://www.cs.uiowa.edu/~ghosh/bittorrent.ppt

What is BitTorrent? Efficient content distribution system using file swarming. Usually does not perform all the functions of a typical p2p system, like searching.

BitTorrent traffic CacheLogic estimated that BitTorrent traffic accounts for roughly 35% of all traffic on the Internet.

File sharing To share a file or group of files, a peer first creates a.torrent file, a small file that contains (1)metadata about the files to be shared, and (2)Information about the tracker, the computer that coordinates the file distribution. Peers first obtain a.torrent file, and then connect to the specified tracker, which tells them from which other peers to download the pieces of the file.

BT Components On a public domain site, obtain.torrent file. for example: http://bt.lor.net http://bt.harrypotter.com/ Web Server The Lord of Ring.torrent Transformer.torrent Harry Potter.torrent

File sharing Large files are broken into pieces of size between 64 KB and 1 MB 1 2 3 4 5 6 7 8

BT: publishing a file Bob Web Server

BT: publishing a file Bob Web Server

BT: publishing a file Bob Web Server

BT: publishing a file Bob Harry Potter.torrent Web Server

BT: publishing a file Bob Harry Potter.torrent Tracker

BT: publishing a file Bob Harry Potter.torrent Tracker

BT: publishing a file Bob Harry Potter.torrent Tracker

BT: publishing a file Bob Harry Potter.torrent Tracker

BT: publishing a file Bob Harry Potter.torrent Tracker

BT: publishing a file Bob Harry Potter.torrent Tracker Downloader: A Seeder: B Downloader: C

BT: publishing a file Bob Harry Potter.torrent Tracker Downloader: A Seeder: B Downloader: C

The.torrent file The URL of the tracker Pieces <hash1,hash 2,.hash n> Piece length Name Length of the file

The Tracker IP address, port, peer id State information (Completed or Downloading) Returns a random list of peers

BitTorrent Lingo Seeder = a peer that provides the complete file. Initial seeder = a peer that provides the initial copy. Leecher Initial seeder One who is downloading (not a derogatory term) Leecher Seeder

Simple example {1,2,3,4,5,6,7,8,9,10} Seeder: A

Simple example {1,2,3,4,5,6,7,8,9,10} Seeder: A {} Downloader B

Simple example {1,2,3,4,5,6,7,8,9,10} Seeder: A {} Downloader B

Simple example {1,2,3,4,5,6,7,8,9,10} Seeder: A {1,2,3} Downloader B

Simple example {1,2,3,4,5,6,7,8,9,10} Seeder: A {} {1,2,3} Downloader B Downloader C

Simple example {1,2,3,4,5,6,7,8,9,10} Seeder: A {} {1,2,3} Downloader B Downloader C

Simple example {1,2,3,4,5,6,7,8,9,10} Seeder: A {1,2,3} {1,2,3,4} Downloader B Downloader C

Simple example {1,2,3,4,5,6,7,8,9,10} Seeder: A {1,2,3} {1,2,3,4} Downloader B Downloader C

Simple example {1,2,3,4,5,6,7,8,9,10} Seeder: A {1,2,3,4} Downloader B {1,2,3,5} Downloader C

Simple example {1,2,3,4,5,6,7,8,9,10} Seeder: A {1,2,3,4} Downloader B {1,2,3,5} Downloader C

Simple example {1,2,3,4,5,6,7,8,9,10} Seeder: A {1,2,3,5} Downloader B {1,2,3,4,5} Downloader C

Basic Idea Initial seeder chops file into many pieces. Leecher first locates the.torrent file that directs it to a tracker, which tells which other peers are downloading that file. As a leecher downloads pieces of the file, replicas of the pieces are created. More downloads mean more replicas available As soon as a leecher has a complete piece, it can potentially share it with other downloaders. Eventually each leecher becomes a seeder by obtaining all the pieces, and assembles the file. Verifies the checksum.

Operation

Pieces and Sub-Pieces A piece is broken into sub-pieces... typically 16KB in size Until a piece is assembled, only download the sub-pieces of that piece only This policy lets pieces assemble quickly

Pipelining When transferring data over TCP, always have several requests pending at once, to avoid a delay between pieces being sent. At any point in time, some number, typically 5, are requested simultaneously. Every time a piece or a sub-piece arrives, a new request is sent out.

Piece Selection The order in which pieces are selected by different peers is critical for good performance If an inefficient policy is used, then peers may end up in a situation where each has all identical set of easily available pieces, and none of the missing ones. If the original seed is prematurely taken down, then the file cannot be completely downloaded! What are good policies?

BT: internal Chunk Selection mechanisms Strict Priority First Priority Rarest First General rule Random First Piece Special case, at the beginning Endgame Mode Special case

Random First Piece Initially, a peer has nothing to trade Important to get a complete piece ASAP Select a random piece of the file and download it

Rarest Piece First Determine the pieces that are most rare among your peers, and download those first. This ensures that the most commonly available pieces are left till the end to download.

Endgame Mode Near the end, missing pieces are requested from every peer containing them. When the piece arrives, the pending requests for that piece are cancelled. This ensures that a download is not prevented from completion due to a single peer with a slow transfer rate. Some bandwidth is wasted, but in practice, this is not too much.

BT: internal mechanism Built-in incentive mechanism (where all the magic happens): Choking Algorithm Optimistic Unchoking

Choking Choking is a temporary refusal to upload. It is one of BitTorrent s most powerful idea to deal with free riders (those who only download but never upload). Tit-for-tat strategy is based on game-theoretic concepts.

Choking Reasons for choking: Avoid free riders Network congestion A good choking algorithm caps the number of simultaneous uploads for good TCP performance. Avoids choking and unchoking too quickly, (known as fibrillation)..

Choking Reasons for choking: Avoid free riders Network congestion A good choking algorithm caps the number of simultaneous uploads for good TCP performance. Avoids choking and unchoking too quickly, (known as fibrillation)..

Choking Reasons for choking: Avoid free riders Network congestion Alice A good choking algorithm caps the number of simultaneous uploads for good TCP performance. Avoids choking and unchoking too quickly, (known as fibrillation)..

Choking Reasons for choking: Avoid free riders Network congestion Alice A good choking algorithm caps the number of simultaneous uploads for good TCP performance. Avoids choking and unchoking too quickly, (known as fibrillation)..

Choking Reasons for choking: Avoid free riders Network congestion Alice A good choking algorithm caps the number of simultaneous uploads for good TCP performance. Avoids choking and unchoking too quickly, (known as fibrillation).. Bob

Choking Reasons for choking: Avoid free riders Network congestion Alice A good choking algorithm caps the number of simultaneous uploads for good TCP performance. Avoids choking and unchoking too quickly, (known as fibrillation).. Bob

Choking Reasons for choking: Avoid free riders Network congestion Alice A good choking algorithm caps the number of simultaneous uploads for good TCP performance. Avoids choking and unchoking too quickly, (known as fibrillation).. Bob

Choking Reasons for choking: Avoid free riders Network congestion Alice A good choking algorithm caps the number of simultaneous uploads for good TCP performance. Avoids choking and unchoking too quickly, (known as fibrillation).. Bob

Choking Reasons for choking: Avoid free riders Network congestion Alice A good choking algorithm caps the number of simultaneous uploads for good TCP performance. Avoids choking and unchoking too quickly, (known as fibrillation).. Bob Choked

Choking Reasons for choking: Avoid free riders Network congestion Alice A good choking algorithm caps the number of simultaneous uploads for good TCP performance. Avoids choking and unchoking too quickly, (known as fibrillation).. Bob Choked

Choking Reasons for choking: Avoid free riders Network congestion Alice A good choking algorithm caps the number of simultaneous uploads for good TCP performance. Avoids choking and unchoking too quickly, (known as fibrillation).. Choked Bob Choked

More on Choking Peers try out unused connections once in a while to find out if they might be better than the current ones (optimistic unchoking).

Optimistic unchoking

Optimistic unchoking A BitTorrent peer has a single optimistic unchoke to which it uploads regardless of the current download rate from it. This peer rotates every 30s

Optimistic unchoking A BitTorrent peer has a single optimistic unchoke to which it uploads regardless of the current download rate from it. This peer rotates every 30s

Optimistic unchoking A BitTorrent peer has a single optimistic unchoke to which it uploads regardless of the current download rate from it. This peer rotates every 30s Reasons:

Optimistic unchoking A BitTorrent peer has a single optimistic unchoke to which it uploads regardless of the current download rate from it. This peer rotates every 30s Reasons: To discover currently unused connections are better than the ones being used

Optimistic unchoking A BitTorrent peer has a single optimistic unchoke to which it uploads regardless of the current download rate from it. This peer rotates every 30s Reasons: To discover currently unused connections are better than the ones being used To provide minimal service to new peers

Upload-Only mode Once download is complete, a peer has no download rates to use for comparison nor has any need to use them. The question is, which nodes to upload to? Policy: Upload to those with the best upload rate. This ensures that pieces get replicated faster, and new seeders are created fast

Questions about BT

Questions about BT Which features contribute to the efficiency of BitTorrent?

Questions about BT Which features contribute to the efficiency of BitTorrent? What is the effect of bandwidth constraints?

Questions about BT Which features contribute to the efficiency of BitTorrent? What is the effect of bandwidth constraints? Is the Rarest First policy really necessary?

Questions about BT Which features contribute to the efficiency of BitTorrent? What is the effect of bandwidth constraints? Is the Rarest First policy really necessary? Must nodes perform seeding after downloading is complete?

Questions about BT Which features contribute to the efficiency of BitTorrent? What is the effect of bandwidth constraints? Is the Rarest First policy really necessary? Must nodes perform seeding after downloading is complete? How serious is the Last Piece Problem?

Questions about BT Which features contribute to the efficiency of BitTorrent? What is the effect of bandwidth constraints? Is the Rarest First policy really necessary? Must nodes perform seeding after downloading is complete? How serious is the Last Piece Problem? Does the incentive mechanism affect the performance much?

One more example peer C peer A peer D peer B peer E

One more example peer A HELLO HELLO peer C peer B HELLO peer D HELLO peer E

One more example peer C peer A Bitmap Bitmap peer D peer B Bitmap Bitmap peer E

One more example peer C peer A Request C5 peer B Request C1 peer D peer E

Request C5 One more example Without upload constraint peer C peer A peer B Request C1 peer D peer E

One more example Without upload constraint peer C peer A peer B C5 C1 peer D peer E

One more example Without upload constraint With upload constraint peer C peer A peer B C5 C1 peer D peer E

Trackerless torrents BitTorrent also supports "trackerless" torrents, featuring a DHT implementation that allows the client to download torrents that have been created without using a BitTorrent tracker.