Angelo Sapello University of Delaware

Slides:



Advertisements
Similar presentations
Peer-to-peer and agent-based computing BitTorrent.
Advertisements

Recitation 6 Midterm 1’s solution Project 2 IP Forwarding CIDR.
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.
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.
An Introduction to Secure Sockets Layer (SSL). Overview Types of encryption SSL History Design Goals Protocol Problems Competing Technologies.
Chapter 2 Application Layer Computer Networking: A Top Down Approach, 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April A note on the use.
Application Layer 2-1 Chapter 2 Application Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012.
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.
BitTorrent Join the swarm! BY: Joe Petruska. What is BitTorrent? a peer-to-peer file sharing protocol used for distributing large amounts of data.
BotTorrent: Misusing BitTorrent to Launch DDoS Attacks Karim El Defrawy, Minas Gjoka, Athina Markopoulou UC Irvine.
CompSci 356: Computer Network Architectures Lecture 21: Content Distribution Chapter 9.4 Xiaowei Yang
No Class on Friday There will be NO class on: FRIDAY 1/30/15.
A P2P file distribution system ——BitTorrent Fan Bin Sep,25,2004.
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.
Client-Server vs P2P or, HTTP vs Bittorrent. Client-Server Architecture SERVER client.
The Bittorrent Protocol
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.
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.
GPS: A General Peer-to-Peer Simulator and its Use for Modeling BitTorrent Weishuai Yang Nael Abu-Ghazaleh
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.
Chapter 2: Application layer
2: Application Layer1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail  SMTP,
David A. Bryan, PPSP Workshop, Beijing, China, June 17th and 18th 2010 PPSP Protocol Considerations.
Vishal Nehru Computer Science 428 Understanding Network Protocols: The BitTorrent Case.
Application Layer 2-1 Chapter 2 Application Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012.
2: Application Layer1 Chapter 2: Application layer r 2.1 Principles of network applications  app architectures  app requirements r 2.2 Web and HTTP r.
TCP Sockets Reliable Communication. TCP As mentioned before, TCP sits on top of other layers (IP, hardware) and implements Reliability In-order delivery.
P2P Streaming Protocol (PPSP) Requirements draft-zong-ppsp-reqs-03.
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.
2: Application Layer1 Chapter 2 Application Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012.
Socket Programming Introduction. Socket Definition A network socket is one endpoint in a two-way communication flow between two programs running over.
2: Application Layer 1 Chapter 2 Application Layer Computer Networking: A Top Down Approach, 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April.
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.
PEAR TO PEAR PROTOCOL. Pure P2P architecture no always-on server arbitrary end systems directly communicate peers are intermittently connected and change.
End-to-end Publishing Using Bittorrent. Bittorrent Bittorrent is a widely used peer-to- peer network used to distribute files, especially large ones It.
November 19, 2016 Guide:- Mrs. Kale J. S. Presented By:- Hamand Amol Sambhaji. Hamand Amol Sambhaji. Pardeshi Dhananjay Rajendra. Pardeshi Dhananjay Rajendra.
05 - P2P applications and Sockets
An example of peer-to-peer application
Introduction to BitTorrent
BitTorrent Vs Gnutella.
Venkatesh Kumar Auzumeedi
Chapter 2: outline 2.1 principles of network applications
CS 1652 Jack Lange University of Pittsburgh
nTorrent: Peer-to-Peer File Sharing in Named Data Networking
Designing a new BitTorrent Client
HTTP Hypertext Transfer Protocol
Economics and Computation Week 7: The economics of P2P file sharing
Part 4: Peer to Peer - P2P Applications
The BitTorrent Protocol
Content Distribution Networks + P2P File Sharing
HTTP Hypertext Transfer Protocol
Pure P2P architecture no always-on server
Chapter 3 Transport Layer
Chapter 2 Application Layer
Content Distribution Networks + P2P File Sharing
Presentation transcript:

Angelo Sapello University of Delaware sapello@udel.edu BitTorrent Angelo Sapello University of Delaware sapello@udel.edu

Server vs. P2P Standard client/server model – all clients connect to a single server Peer to peer (P2P) – clients get the data they need from one or more other clients P2P may still require a server, but with a greatly reduced load

BitTorrent Terminology Torrent file – the meta-data file indicating what tracker to connect to and what the file should look like Tracker – an HTTP server that keeps track of the swarm Swarm – the group of peers downloading/uploading the file Seeder – A peer that has all the pieces of the file Leecher – A peer that only downloads

BitTorrent model User downloads a meta-data “torrent” file Peer connects to tracker server to get peer information Peer connects to other peers in the swarm Peer downloads pieces in a rarest first fashion Peer simultaneously uploads pieces to other peers Model defined by Bram Cohen

BitTorrent Transport Layer BitTorrent is a three part application layer protocol TCP provides all transport layer services Reliable: No need for ACKs by client Connection oriented: Minimal client handshakes Down-side: Multiple connections cause “fairness” issues Multiple port usage causes NAT/firewall clogging

Initial Seeder/Web Server: 142.178.26.3:62189 Sally: 135.116.234.110:53182 Bobbi (Leecher): 128.175.75.65:52516 Allen: 123.35.92.56:53182 Angelo: 128.122.35.116:55103 Linda (Seeder): 128.175.75.13:57812 Tracker: /mytorrent: Linda:128.175.75.13:57812 Bobbi: 128.175.75.65:52516 Mandriva: 142.178.26.3:62189 Sally: 135.116.234.110:53182 Allen: 123.35.92.56:49552 Initial Seeder/Web Server: 142.178.26.3:62189

Initial Seeder/Web Server: 142.178.26.3:62189 Uninterested Choked Sally: 135.116.234.110:53182 Uninterested Choked Bobbi (Leecher): 128.175.75.65:52516 Uninterested Choked Allen: 123.35.92.56:53182 Uninterested Choked Angelo: 128.122.35.116:55103 Uninterested Choked Linda (Seeder): 128.175.75.13:57812 Uninterested Choked Tracker: /mytorrent: Linda:128.175.75.13:57812 Bobbi: 128.175.75.65:52516 Mandriva: 142.178.26.3:62189 Sally: 135.116.234.110:53182 Allen: 123.35.92.56:49552 Angelo: 128.122.35.116:55103 Initial Seeder/Web Server: 142.178.26.3:62189 Uninterested Choked

Initial Seeder/Web Server: 142.178.26.3:62189 Uninterested Choked Sally: 135.116.234.110:53182 Uninterested Unchoked Bobbi (Leecher): 128.175.75.65:52516 Uninterested Choked Allen: 123.35.92.56:53182 Uninterested Unchoked Angelo: 128.122.35.116:55103 Interested Choked Linda (Seeder): 128.175.75.13:57812 Uninterested Unchoked Tracker: /mytorrent: Linda:128.175.75.13:57812 Bobbi: 128.175.75.65:52516 Mandriva: 142.178.26.3:62189 Sally: 135.116.234.110:53182 Allen: 123.35.92.56:49552 Angelo: 128.122.35.116:55103 Initial Seeder/Web Server: 142.178.26.3:62189 Uninterested Choked

Initial Seeder/Web Server: 142.178.26.3:62189 Uninterested Choked Sally: 135.116.234.110:53182 Interested Unchoked Bobbi (Leecher): 128.175.75.65:52516 Uninterested Choked Allen: 123.35.92.56:53182 Uninterested Unchoked Angelo: 128.122.35.116:55103 Interested Unchoked Linda (Seeder): 128.175.75.13:57812 Uninterested Unchoked Tracker: /mytorrent: Linda:128.175.75.13:57812 Bobbi: 128.175.75.65:52516 Mandriva: 142.178.26.3:62189 Sally: 135.116.234.110:53182 Allen: 123.35.92.56:49552 Angelo: 128.122.35.116:55103 Initial Seeder/Web Server: 142.178.26.3:62189 Uninterested Choked

Initial Seeder/Web Server: 142.178.26.3:62189 Uninterested Choked Sally: 135.116.234.110:53182 Interested Unchoked Bobbi (Leecher): 128.175.75.65:52516 Uninterested Choked Allen: 123.35.92.56:53182 Uninterested Unchoked Angelo: 128.122.35.116:55103 Interested Unchoked Linda (Seeder): 128.175.75.13:57812 Uninterested Unchoked Tracker: /mytorrent: Linda:128.175.75.13:57812 Bobbi: 128.175.75.65:52516 Mandriva: 142.178.26.3:62189 Sally: 135.116.234.110:53182 Allen: 123.35.92.56:49552 Angelo: 128.122.35.116:55103 Initial Seeder/Web Server: 142.178.26.3:62189 Uninterested Choked

Initial Seeder/Web Server: 142.178.26.3:62189 Uninterested Choked Sally: 135.116.234.110:53182 Interested Unchoked Bobbi (Leecher): 128.175.75.65:52516 Uninterested Choked Allen: 123.35.92.56:53182 Uninterested Unchoked Angelo: 128.122.35.116:55103 Uninterested Unchoked Linda (Seeder): 128.175.75.13:57812 Uninterested Unchoked Tracker: /mytorrent: Linda:128.175.75.13:57812 Bobbi: 128.175.75.65:52516 Mandriva: 142.178.26.3:62189 Sally: 135.116.234.110:53182 Allen: 123.35.92.56:49552 Angelo: 128.122.35.116:55103 Initial Seeder/Web Server: 142.178.26.3:62189 Uninterested Choked

Initial Seeder/Web Server: 142.178.26.3:62189 Sally: 135.116.234.110:53182 Bobbi (Leecher): 128.175.75.65:52516 Allen: 123.35.92.56:53182 Angelo: 128.122.35.116:55103 Linda (Seeder): 128.175.75.13:57812 Tracker: /mytorrent: Linda:128.175.75.13:57812 Bobbi: 128.175.75.65:52516 Mandriva: 142.178.26.3:62189 Sally: 135.116.234.110:53182 Allen: 123.35.92.56:49552 Angelo: 128.122.35.116:55103 Initial Seeder/Web Server: 142.178.26.3:62189

Initial Seeder/Web Server: 142.178.26.3:62189 Sally: 135.116.234.110:53182 Bobbi (Leecher): 128.175.75.65:52516 Allen: 123.35.92.56:53182 Angelo: 128.122.35.116:55103 Linda (Seeder): 128.175.75.13:57812 Tracker: /mytorrent: Linda:128.175.75.13:57812 Bobbi: 128.175.75.65:52516 Mandriva: 142.178.26.3:62189 Sally: 135.116.234.110:53182 Allen: 123.35.92.56:49552 Initial Seeder/Web Server: 142.178.26.3:62189

Meta-data format Information bencoded String “#:” ; any array of characters Integer “i” - “e” ; a signed integer Dictionary “d” - “e” ; key-value pairs List “l” - “e” ; an array of the above types Announce section – tracker information Info section – file and pieces information Pieces – a list of SHA-1 hash values of data chunks in the files

Meta-data file (cont'd) Multiple files are ordered and concatenated to download like a single file Example: d8:announce96:http://torrent.mandriva.com:6969/announce/Mandrivalinux/282cb77c390627c4 4133c0cb8a59ca4bb2d203be13:creation datei1257201206e4:infod5:filesld6:lengthi341985e4:pathl35:mandriva-linux-free- 2010.0-i586.idxeed6:lengthi4575985664e4:pathl35:mandriva-linux-free-2010.0- i586.isoeed6:lengthi70e4:pathl39:mandriva-linux-free-2010.0- i586.iso.md5eed6:lengthi78e4:pathl40:mandriva-linux-free-2010.0- i586.iso.sha1eee4:name31:mandriva-linux-free-2010.0-i58612:piece lengthi262144e6:pieces349160: To {“announce”:”http://torrent.mandriva.com:6969/announce/Mandrivalinux/282cb77c390627c44 133c0cb8a59ca4bb2d203be”,”creation date”:1257201206, “info”:{“files”:[{“length”:341985,”path”:[“mandriva-linux-free-2010.0-i586.idx”]}, {“length”:4575985664,”path”:[“mandriva-linux-free-2010.0-i586.iso”]}, {“length”:70,”path”:[“mandriva-linux-free-2010.0-i586.iso.md5”]}, {“length”:78,”path”:[“mandriva-linux-free-2010.0-i586.iso.sha1”]}], “name”:”mandriva-linux-free-2010.0-i586”,”piece length”:262144,”pieces”: Binary array of 20 byte SHA-1 hash codes of each 256KB data chunk }}

Peace of mind How do you ensure that a peer has not tainted the piece? SHA-1 hash algorithm proposed by NSA requires 2^80 hash operations to find a match pair by brute force. Mathematically broken in 2^63 operations. Poisoned pieces are rejected and peer is no longer recognized as part of the swarm

Tracker protocol Standard HTTP GET request/response Example: GET /announce/Mandrivalinux/282cb77c390627c44133c0cb8a59ca4bb2d203be?info_hash=%06g%e0g%98%a f%beN%f2%f6%40E%ad%0a%23U%dd%5d%d4%ba&peer_id=M6-4-0-- %afF%3bE%b8%c9%2b%94%f1%ac%bf%93&port=57917&uploaded=0&downloaded=0&left=4576327797&corr upt=0&key=66D4D19D&event=started&numwant=200&compact=1&no_peer_id=1&ipv6=2002%3a80af%3ae e1e%3a%3a80af%3aee1e HTTP/1.1 Host: torrent.mandriva.com:6969 User-Agent: BitTorrent/6400(18095) Accept-Encoding: gzip HTTP/1.0 200 OK Content-Length: 1230 Content-Type: text/plain Pragma: no-cache d8:intervali1800e5:peers1200: Binary encoded IP address, port number pairs for the entire (or subset of the) swarm or beconded dictionary or Peer ID, IP address, port triplets

BitTorrent protocol BitTorrent Handshake All other messages Protocol Name Length (1-byte = 19) Protocol Name (“BitTorrent protocol”) 64-bit reserved word Info dictionary hash (SHA1 20-bytes) Peer ID (20 bytes) All other messages Message length (32-bits/4-bytes) Message ID (8-bits/1-byte) Payload (Message length – 1 bytes)

BitTorrent Message IDs None (len = 0): Keep Alive 0: Choke = Not willing to send data 1: Unchoke = Willing to send data 2: Interested = Would like data 3: Not interested = Would not like data 4: Have = I have just downloaded this piece 5: Bitfield = I have these pieces 6: Request = I would like this block – index (piece), begin(offset) and length 7: Piece = Here is a block – index (piece), begin(offset) and block (actual data) 8: Cancel = I no longer want this block – index, begin, length

Wireshark Example

Other issues Leeching Firewall/NAT crashing Connection throttling (Comcast) Copyright protection

Questions? Additional resources BitTorrent Specification: http://www.bittorrent.org/beps/bep_0003.html BitTorrent Unofficial Explanation: http://wiki.theory.org/BitTorrentSpecification