The BitTorrent Protocol

Slides:



Advertisements
Similar presentations
Project3 - Congestion Control. Outline Overview Project Specification and Tasks Tools and Time Table.
Advertisements

The BitTorrent Protocol. What is BitTorrent?  Efficient content distribution system using file swarming. Does not perform all the functions of a typical.
Incentives Build Robustness in BitTorrent Author: Bram Cohen Presenter: Brian Liao.
Incentives Build Robustness in BitTorrent- Bram Cohen Presented by Venkatesh Samprati.
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.
Socket Layer Security. In this Presentation: need for web security SSL/TLS transport layer security protocols HTTPS secure shell (SSH)
An Introduction to Secure Sockets Layer (SSL). Overview Types of encryption SSL History Design Goals Protocol Problems Competing Technologies.
Stochastic Analysis of File Swarming Systems The Chinese University of Hong Kong John C.S. Lui Collaborators: D.M. Chiu, M.H. Lin, B. Fan.
The BitTorrent content distribution system CS217 Advanced Topics in Internet Research Guest Lecture Nikitas Liogkas, 5/11/2006.
Project in Computer Security Integrating TOR’s attacks into the I2P darknet Chen Avnery Amihay Vinter.
CompSci 356: Computer Network Architectures Lecture 21: Content Distribution Chapter 9.4 Xiaowei Yang
A CHAT CLIENT-SERVER MODULE IN JAVA BY MAHTAB M HUSSAIN MAYANK MOHAN ISE 582 FALL 2003 PROJECT.
The Internet Useful Definitions and Concepts About the Internet.
VoD BitTorrent Framework. Background BT is a very popular peer to peer protocol with many implementations: –
1 Incentives Build Robustness in BitTorrent? Analysis on Bit Torrent Client performance By Jimmy Wong.
A P2P file distribution system ——BitTorrent Fan Bin Sep,25,2004.
Design and Implementation of a Server Director Project for the LCCN Lab at the Technion.
Incentives Build Robustness in BitTorrent 1st Workshop on Economics of Peer-to-Peer Systems 2003 Bram Cohen
BitTorrent Background. Common Scenario Millions want to download the same popular huge files (for free) –ISO’s –Media (the real example!) Client-server.
Application Layer  We will learn about protocols by examining popular application-level protocols  HTTP  FTP  SMTP / POP3 / IMAP  Focus on client-server.
Client-Server vs P2P or, HTTP vs Bittorrent. Client-Server Architecture SERVER client.
The Bittorrent Protocol
Content Overlays (Nick Feamster) February 25, 2008.
Bit Torrent (Nick Feamster) February 25, BitTorrent Steps for publishing – Peer creates.torrent file and uploads to a web server: contains metadata.
BitTorrent Presentation by: NANO Surmi Chatterjee Nagakalyani Padakanti Sajitha Iqbal Reetu Sinha Fatemeh Marashi.
University of Bologna, Italy How to cheat BitTorrent and why nobody does Simon Patarin and David Hales University of Bologna ECCS 2006,
Peer to Peer Network Anas Hardan. What is a Network? What is a Network? A network is a group of computers and other devices (such as printers) that are.
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.
Web application architecture
Securing Data Authentication with Cryptographic Signatures in BitTorrent Du Wei cc.hut.fi / Supervisor : Professor Jukka Manner Instructor.
BitTorrent Dr. Yingwu Zhu. Bittorrent A popular P2P application for file exchange!
A P2P file distribution system ——BitTorrent Pegasus Team CMPE 208.
TCP/IP Essentials A Lab-Based Approach Shivendra Panwar, Shiwen Mao Jeong-dong Ryoo, and Yihan Li Chapter 5 UDP and Its Applications.
Bit Torrent A good or a bad?. Common methods of transferring files in the internet: Client-Server Model Peer-to-Peer Network.
Shepard’s Valley Cowboy Church Web Server File Download Problem Analysis Last Update Copyright 2013 Kenneth M. Chipps Ph.D.
Follow the Data Data (and information) move from place to place in computer systems and networks. As it moves it changes form frequently. This story describes.
David A. Bryan, PPSP Workshop, Beijing, China, June 17th and 18th 2010 PPSP Protocol Considerations.
CS332, Ch. 26: TCP Victor Norman Calvin College 1.

The Internet The internet is simply a worldwide computer network that uses standardised communication protocols to transmit and exchange data.
1 Slides from Richard Yang with minor modification Peer-to-Peer Systems: DHT and Swarming.
1 Security Protocols in the Internet Source: Chapter 31 Data Communications & Networking Forouzan Third Edition.
TCP Sockets Reliable Communication. TCP As mentioned before, TCP sits on top of other layers (IP, hardware) and implements Reliability In-order delivery.
Advanced Packet Analysis and Troubleshooting Using Wireshark 23AF
VoD BitTorrent Framework. Background BT is a very popular peer to peer protocol with many implementations: –
Bit Torrent Nirav A. Vasa. Topics What is BitTorrent? Related Terms How BitTorrent works Steps involved in the working Advantages and Disadvantages.
Project 3 Overview Spring 2010 Recitation #9.
4343 X2 – The Transport Layer Tanenbaum Ch.6.
End-to-end Publishing Using Bittorrent. Bittorrent Bittorrent is a widely used peer-to- peer network used to distribute files, especially large ones It.
TCP/IP1 Address Resolution Protocol Internet uses IP address to recognize a computer. But IP address needs to be translated to physical address (NIC).
Communication Networks NETW 501 Tutorial 2
Chapter 29 Peer-to-Peer Paradigm Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
An example of peer-to-peer application
Introduction to BitTorrent
BitTorrent Vs Gnutella.
Venkatesh Kumar Auzumeedi
Topic 5: Communication and the Internet
Designing a new BitTorrent Client
Process-to-Process Delivery:
Angelo Sapello University of Delaware
Small Is Not Always Beautiful
The BitTorrent Protocol
Follow the Data Data (and information) move from place to place in computer systems and networks. As it moves it changes form frequently. This story.
Internet Applications & Programming
Chapter 2 Application Layer
Presentation transcript:

The BitTorrent Protocol www.bittorrent.org http://wiki.theory.org/BitTorrentSpecification

What is BitTorrent? Efficient content distribution system using file swarming.

A BitTorrent file distribution consists of these entities: A static 'metainfo' file A BitTorrent tracker An 'original' downloader The end user downloaders

To start serving, a host goes through the following steps: Start running a tracker Start running an ordinary web server. Generate a metainfo (.torrent) file using the complete file to be served and the URL of the tracker. Put the metainfo file on the web server. Link to the metainfo (.torrent) file from some other web page. Start a downloader which already has the complete file (the 'origin').

To start downloading: Get a BitTorrent client Find a .torrent file. Select where to save the file locally. Wait for download to complete. Tell downloader to exit (it keeps uploading until this happens).

Bencode All data passed in BT is bencoded (BEE –Encoded). This is a representation convention used to avoid interoperability problems.

Data in .torrent files The URL of the tracker. Suggested name to save the file. piece length maps to the number of bytes in each piece the file is split into. pieces maps to a string whose length is a multiple of 20. It is to be subdivided into strings of length 20, each of which is the SHA1 hash of the piece at the corresponding index.

Tracker <> Peer communication Actual packet structure

Peer > Tracker: GET requests has following keys info_hash – hash of the .torrent. peer_id – My unique ID. My IP / Port uploaded / Downloaded left – Can not be calculated from Downloaded, because of errors / restart. event - Why I do the GET.

GET events Reasons for calling the GET: Started Completed Stopped Empty - done at regular intervals

Tracker > Peer : tracker GET responses failure  interval – next time to GET List of peers

Peer <> Peer communication Actual packet structure

Peers protocol operates over TCP Peer connections are symmetrical Refers to pieces by index from .torrent Connections contain : choked and interested

Peer messages Handshake Keep alive (0 size, every 2 minutes) 0 - choke 1 - unchoke 2 - interested 3 - not interested 4 - have 5 - bitfield 6 - request 7 - piece 8 - cancel

Change connection state 'choke', 'unchoke', 'interested', and 'not interested' have no payload. Data transfer takes place: one side is interested, other side is not choking state must be kept up to date at all times This is a precondition for upload / download – REQUEST / PIECE

BITFIELD Only ever sent as the first message.  bitfield - a bit for each piece – 1 – Have 0 – Don’t have May skip if has 0 pieces.

HAVE Single number, the index which that downloader just completed and checked the hash of.

REQUEST Contain - index, begin, and length  Length is generally a power of two unless it gets truncated by the end of the file.

PIECE Getting the actual data from a peer Correlates to a REQUEST.

CANCEL same payload as request messages. generally only sent  during what's called 'endgame mode'.  Try to download whole piece from multiple sources.

Choking reasons TCP congestion control is poorly with many connections choking lets each peer use a tit-for-tat-ish algorithm

Choking Algorithm Criteria (Recommended) Cap the number of simultaneous uploads for good TCP performance. It should avoid choking and unchoking quickly, known as 'fibrillation'. Reciprocate to peers who let it download. try out unused connections once in a while known as optimistic un choking.