The Bittorrent Protocol

Slides:



Advertisements
Similar presentations
Transport Layer3-1 Transport Overview and UDP. Transport Layer3-2 Goals r Understand transport services m Multiplexing and Demultiplexing m Reliable data.
Advertisements

Umut Girit  One of the core members of the Internet Protocol Suite, the set of network protocols used for the Internet. With UDP, computer.
The BitTorrent Protocol
The BitTorrent Protocol. What is BitTorrent?  Efficient content distribution system using file swarming. Does not perform all the functions of a typical.
The BitTorrent protocol A peer-to-peer file sharing protocol.
Incentives Build Robustness in BitTorrent Bram Cohen.
Bit Torrent (Nick Feamster) February 25, BitTorrent Steps for publishing – Peer creates.torrent file and uploads to a web server: contains metadata.
End-to-end Publishing Using Bittorrent. Bittorrent Bittorrent is a widely used peer-to- peer network used to distribute files, especially large ones It.
Ln -s /usr/timtimmah /usr/kevinstanonik. TORRENT BASICS  You want to get a file to other people.  BUT you don’t have the bandwidth to have everyone.
Clayton Sullivan PEER-TO-PEER NETWORKS. INTRODUCTION What is a Peer-To-Peer Network A Peer Application Overlay Network Network Architecture and System.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public ITE PC v4.0 Chapter 1 1 OSI Transport Layer Network Fundamentals – Chapter 4.
The BitTorrent content distribution system CS217 Advanced Topics in Internet Research Guest Lecture Nikitas Liogkas, 5/11/2006.
CompSci 356: Computer Network Architectures Lecture 21: Content Distribution Chapter 9.4 Xiaowei Yang
Peer to Peer (P2P) Networks and File sharing. By: Ryan Farrell.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 1 Version 4.0 OSI Transport Layer Network Fundamentals – Chapter 4.
Chapter 3: Transport Layer
Presented by Stephen Kozy. Presentation Outline Definition and explanation Comparison and Examples Advantages and Disadvantages Illegal and Legal uses.
Peer-to-Peer (or P2P) From user to user. Peer-to-peer implies that either side can initiate a session and has equal responsibility. Corey Chan Andrew Merfeld.
Some slides are in courtesy of J. Kurose and K. Ross Review of Previous Lecture Electronic Mail: SMTP, POP3, IMAP DNS Socket programming with TCP.
8-1 Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing/demultipl exing m reliable data transfer m flow.
COMPUTER TERMS PART 1. COOKIE A cookie is a small amount of data generated by a website and saved by your web browser. Its purpose is to remember information.
Gursharan Singh Tatla Transport Layer 16-May
Client-Server vs P2P or, HTTP vs Bittorrent. Client-Server Architecture SERVER client.
Process-to-Process Delivery:
BitTorrent Presentation by: NANO Surmi Chatterjee Nagakalyani Padakanti Sajitha Iqbal Reetu Sinha Fatemeh Marashi.
BitTorrent Internet Technologies and Applications.
BitTorrent How it applies to networking. What is BitTorrent P2P file sharing protocol Allows users to distribute large amounts of data without placing.
1 BitTorrent System Efrat Oune Bar-Ilan What is BitTorrent? BitTorrent is a peer-to-peer file distribution system (built for intensive daily use.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public ITE PC v4.0 Chapter 1 1 Network Services Networking for Home and Small Businesses – Chapter.
Securing Data Authentication with Cryptographic Signatures in BitTorrent Du Wei cc.hut.fi / Supervisor : Professor Jukka Manner Instructor.
ITIS 1210 Introduction to Web-Based Information Systems Chapter 38 How Music Sharing and File Sharing Work.
BitTorrent Dr. Yingwu Zhu. Bittorrent A popular P2P application for file exchange!
A P2P file distribution system ——BitTorrent Pegasus Team CMPE 208.
Bit Torrent A good or a bad?. Common methods of transferring files in the internet: Client-Server Model Peer-to-Peer Network.

Bittorrent Protocol Implementation. Bittorrent Bittorrent is a widely used peer-to- peer network used to distribute files, especially large ones It has.
Transport Layer 3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 Part.
1 Slides from Richard Yang with minor modification Peer-to-Peer Systems: DHT and Swarming.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 12 Transmission Control Protocol (TCP)
1 Security Protocols in the Internet Source: Chapter 31 Data Communications & Networking Forouzan Third Edition.
ECEN “Internet Protocols and Modeling”, Spring 2012 Course Materials: Papers, Reference Texts: Bertsekas/Gallager, Stuber, Stallings, etc Class.
B IT T ORRENT T ECHNOLOGY Anthony Pervetich. H ISTORY Bram Cohen Designed the BitTorrent protocol in April 2001 Released July 2, 2001 Concept Late 90’s.
Transport Layer 3-1 Chapter 3 Outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP.
Flashback: A Peer-to-Peer Web Server for Flash Crowds Presented by Tom Batkiewicz CS 587x Fall ‘07.
Experience Sharing in Mobile Peer Communities EPI Planete, INRIA International Consortium Meeting (Oulou) 10 June, 2009.
1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Dynamic Host Configuration Protocol (DHCP)
ADVANCED COMPUTER NETWORKS Peer-Peer (P2P) Networks 1.
MULTIPLEXING/DEMULTIPLEXING, CONNECTIONLESS TRANSPORT.
Bit Torrent Nirav A. Vasa. Topics What is BitTorrent? Related Terms How BitTorrent works Steps involved in the working Advantages and Disadvantages.
INTERNET TECHNOLOGIES Week 10 Peer to Peer Paradigm 1.
End-to-end Publishing Using Bittorrent. Bittorrent Bittorrent is a widely used peer-to- peer network used to distribute files, especially large ones It.
McGraw-Hill Chapter 23 Process-to-Process Delivery: UDP, TCP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
COMP2322 Lab 4 Socket Programming Toby Lam March 2, 2016.
November 19, 2016 Guide:- Mrs. Kale J. S. Presented By:- Hamand Amol Sambhaji. Hamand Amol Sambhaji. Pardeshi Dhananjay Rajendra. Pardeshi Dhananjay Rajendra.
Chapter 3 outline 3.1 Transport-layer services
An example of peer-to-peer application
Introduction to BitTorrent
BitTorrent Vs Gnutella.
Networking for Home and Small Businesses – Chapter 6
Networking for Home and Small Businesses – Chapter 6
Transport Layer Our goals:
Application layer Lecture 7.
Process-to-Process Delivery:
Angelo Sapello University of Delaware
The BitTorrent Protocol
Computer Networks Topic :User datagram protocol Transmission Control Protocol -Hemashree S( )
Networking for Home and Small Businesses – Chapter 6
Process-to-Process Delivery: UDP, TCP
Chapter 3 Transport Layer
Transport Layer 9/22/2019.
Presentation transcript:

The Bittorrent Protocol A Technical Look Presented by Cody Sand

What is Bittorrent? Peer-to-Peer (P2P) File Transfer Protocol Centralized Discovery, Decentralized Distribution Currently uses TCP transfer. Designed to “facilitate file transfers among multiple peers across unreliable networks. “ Tit-for-Tat protocol Any downloaders MUST upload, discourages “leeching”. Uses Content Distribution (Downloading) Music, Movies, Software Valve/Blizzard Downloads Streaming video (beta)

History Designed by Bram Cohen in 2001. Assisted in Development of Valve’s Steam platform, before focusing on Bittorrent fulltime. First implementation released in July 2001. Accounted for roughly 33% of all internet traffic today. Nearly 100,000,000 users worldwide.

How it works Peer distributing the file breaks it into small pieces, typically 64k – 1MB in size. Pieces over 512k tend to decrease protocol efficiency Peer creates a checksum for each piece and records it in a file (a .torrent file) When another peer receives a piece, it is checked against this file for integrity purposes. This model allows uploading/downloading of one or more files by many peers.

Why Bittorrent? For large, popular files, more customers require more bandwidth. Bandwidth costs go up. Bittorrent’s solution: Unload some distribution to users Allows for savings in bandwidth and costs.

Structure Ordinary Web Server A static metainfo file (.torrent). A bittorrent tracker An original “downloader” or the “seed” Original content provider Web Browser Consumer (Downloader) with client software.

Web Server / Bittorrent Tracker Hosts the tracker, which is the most essential piece. Trackers implemented to run with all major servers. Tracker Assists communication between peers. Responds to HTTP Get Requests. Used to track peers, download statistics.

Tracker GET Requests Standard HTTP Get Request Parameters info_hash – 20byte SHA-1 hash code to ID torrent file peer_id – 20 character string, identifies user/client. ip – IP address of peer. port – the port the client is listening on. uploaded – total amount uploaded so far. downloaded – total amount downloaded so far left – number of bytes left to download event – state of torrent (ie. started, completed, stopped) numwant – Optional key stating the number of desired peers. default is 50. Info_hash – calculated using ‘info’ dictionary of .torrent Peer_id – unique id that identifies user and bittorrent client.

Example GET Request http://some.tracker.com:999/announce ?info_hash=12345678901234567890 &peer_id=UTABCXYZ &ip=174.250.2.22 &port=6888 &downloaded=1234 &left=98765 &event=stopped

Tracker Response Error Message (Failure) List of peers (Success) 3-digit error code human-readable error message List of peers (Success) Dictionary format interval – time client should wait before rerequesting peers – list of dictionaries coresponding to peers id – the peer_id of remote peer ip – IP address of remote peer port – port number 3-digit error – think 404.

Torrent file (.torrent) Static metainfo in BEncoded format. Provide client with information Tracker Location (URL) File(s) Information Storage information

BEncoding Format for loosely structured data 4 types Byte strings Integers Lists Dictionaries

BEncoded Byte String A sequence of bytes, not necessarily characters Format <length>:<contents> Example 5:hello 7:seminar

BEncoded Integer Format i<number>e Example i42e

BEncoded List Format Example l<contents>e l5:helloi42e7:seminare

BEncoded Dictionary Associative array Format Example d<contents>e <contents> alternating key/value Example d5:hello5:class4:falli2009ee hello => class fall =>2009

.torrent Files Structure BEncoded Dictionary announce – string value containing tracker URL. info – points to dictionary contain info about files Optional fields announce-list – a list of alternate trackers comment – any comment the author wants to include createdby – author of the .torrent file creationdate – the date the .torrent was created. Others Can put ANY field into .torrent. Ignored if not supported.

Single File Torrents info dictionary fields length – size of the file, in bytes name – a string containing the filename piece length – number of bytes in each piece pieces – string value containing concatenated 20-byte SHA-1 hashes for each piece of file.

Multiple File Torrents info dictionary fields files – dictionary containing length – size of the file, in bytes path – path to the file, including filename name – name of top-most directory piece length – number of bytes in each piece pieces – string value containing concatenated 20-byte SHA-1 hashes for each piece of file. For verification.

Peer Messaging Handshaking Peer states Peer-Wire Messages Peer connects to remote peer, citing specific file Peer states (Un)Choked – Is the remote peer allowed to send data? (Un)Interested – Is the peer interested in receiving data? Data Transfer takes place when one side is interested, and the other is not choking. Peer-Wire Messages Used to communicate between peers

Peer Wire Messaging Choke Unchoke Interested Uninterested Inform the other peer they are being choked Unchoke Inform the other peer they are no longer being choked Interested Inform remote peer that data is desired Uninterested Inform remote peer that data transfer is not desired

Peer Wire Messaging Have Bitfield Request Piece Cancel Announce that peer has a piece of the torrent Remote peer may then request that piece Bitfield Send a bitfield representing pieces peer needs/has. Request Official request for a specific piece(s). Piece Transfer of a piece(s) Cancel Sent if peer requested data, but is no longer interested.

Process Tracker goes online

Process Content Provider creates .torrent file using bittorrent client software

Client uploads the .torrent file to the server. Process Client uploads the .torrent file to the server.

Process Index Client re-downloads the .torrent file from the server 029317AHBS: first.torrent Tracker indexes the torrent Client re-downloads the .torrent file from the server and opens it using a bittorrent client.

Process Index 029317AHBS: first.torrent Client software sends HTTP Get request, sending information to server; PeerID, and lets tracker know we have full file

Process Index 029317AHBS: first.torrent Peers 123.234.12.34 Adds seed to peer list Client software sends HTTP Get request, sending information to server; PeerID, and lets tracker know we have full file

Process Index 029317AHBS: first.torrent Peers 123.234.12.34 More peers download the .torrent file

Process Index 029317AHBS: first.torrent Peers 123.234.12.34 Peers open the .torrent file, and each send an HTTP Get request identifying that the want to start downloading the file.

Process Index 029317AHBS: first.torrent Peers 123.234.12.34 111.222.33.44 222.124.232.1 125.55.66.42 122.45.77.99 Tracker adds peers to list

Process Index 029317AHBS: first.torrent Peers 123.234.12.34 111.222.33.44 222.124.232.1 125.55.66.42 122.45.77.99 Tracker returns the list of peers to the new peers.

Process Index 029317AHBS: first.torrent Peers 123.234.12.34 111.222.33.44 222.124.232.1 125.55.66.42 122.45.77.99 Peers begin forming direct connections with other peers, forming a “swarm”.

Process Index 029317AHBS: first.torrent Peers 123.234.12.34 111.222.33.44 222.124.232.1 125.55.66.42 122.45.77.99 Peers begin exchanging messages ((choked)) ((unchoked)) ((Uninterested)) ((Interested))

Process Index 029317AHBS: first.torrent Peers 123.234.12.34 111.222.33.44 222.124.232.1 125.55.66.42 122.45.77.99 Peers begin exchanging messages ((have)) ((bitfield)) ((Request)) ((Piece))

Peer to Peer Process Optional Data Transfer Begins State: Choked/Uninterested Handshake State: Choked/Interested ((interested)) State: Unchoked/Uninterested ((Unchoked)) Optional ((Bitfield)) / ((Have)) ((Request)) Data Transfer Begins ((Piece))

Process Index 029317AHBS: first.torrent Peers 123.234.12.34 111.222.33.44 222.124.232.1 125.55.66.42 122.45.77.99 55.121.33.65 75.45.65.95 111.85.243.11 As peers continue to connect to tracker, more peers are added to the peer list.

New peers receive up-to-date peer lists. Process Index 029317AHBS: first.torrent Peers 123.234.12.34 111.222.33.44 222.124.232.1 125.55.66.42 122.45.77.99 55.121.33.65 75.45.65.95 111.85.243.11 New peers receive up-to-date peer lists. Existing peers periodically report to tracker, also receiving new peer list.

Process Index 029317AHBS: first.torrent Peers 123.234.12.34 111.222.33.44 222.124.232.1 125.55.66.42 122.45.77.99 55.121.33.65 75.45.65.95 111.85.243.11 Peers continue exchanging messages and data until all peers receive the entire file. As pieces are received, the program calculates the SHA-1 hash for each piece and checks it against .torrent file. Any piece with incorrect checksum must be discarded and redownloaded.

Process Index 029317AHBS: first.torrent Peers 123.234.12.34 111.222.33.44 222.124.232.1 125.55.66.42 122.45.77.99 55.121.33.65 75.45.65.95 111.85.243.11 As peers disconnect, they send another HTTP request, stating that they’re no longer sending.

Process Index 029317AHBS: first.torrent Peers 123.234.12.34 111.222.33.44 222.124.232.1 125.55.66.42 122.45.77.99 55.121.33.65 75.45.65.95 Tracker removes peer As peers disconnect, they send another HTTP request, stating that they’re no longer sending.

Process Index 029317AHBS: first.torrent Peers 123.234.12.34 111.222.33.44 222.124.232.1 125.55.66.42 As peers disconnect, they send another HTTP request, stating that they’re no longer sending.

Future of Bittorrent Bittorrent continues to increase its presence online. Bram Cohen’s company, Bittorrent, Inc. is now in control of the protocol. UDP implementation Increased speeds without TCP’s congestion control Streaming Video Piece selection algorithms to increase speed and ensure sequential delivery.

The End. Thank You.