Courtesy: Philip Levis/David Mazieres, Stanford More application layer BitTorrent (Quick Overview) Tahir Azim
Courtesy: Philip Levis/David Mazieres, Stanford BitTorrent Torrent file (.torrent) describes file to download –Created by the originating “seeder” of the file –Specifies the URL of the tracker The tracker describes peers who are participating –Specifies file length, piece length, SHA1 hashes of pieces –Additional metadata (who created torrent, etc) Client contacts tracker, starts communicating with peers d8:announce45: listll45: downloads.to:2710/announceel42: motracker.com/announceel26: announceee7:comment9:XXXXXX XX10:created by13:uTorrent/170013:creation datei e8:encoding5:UTF-84:infod5:filesld6:lengthi e4:pathl13:XXXXXX XX.avieed6:lengthi47e4:pathl42:Torrent downloaded from Demonoid%2ecom.txteee4:name9:XXXXXX XX12:piece lengthi e6:pieces13820:Xtˆ„#T …
Courtesy: Philip Levis/David Mazieres, Stanford Pieces and sub-pieces BitTorrent breaks a file into N pieces –For throughput, pieces are large: 256KB-1MB Pieces are the unit of replication –For latency, broken into subpieces Subpieces are the unit of transmission Hashes of pieces in torrent provide end-to-end integrity –Hashes compute a short summary of a piece of data –Cryptographically strong hashes: hard to find collisions or data that produces a hash
Courtesy: Philip Levis/David Mazieres, Stanford Whom to talk to? Uses a tit-for-tat (TFT) policy: upload only to those who give you data –Implemented slightly differently by different clients Most peers are “choked” and get no data –Determine download rate from all peers –Order unchoked peers by download rate, choke all but P best (by default, 4) Occasionally unchoke a random peer (might find its way into P best)
Courtesy: Philip Levis/David Mazieres, Stanford What to Say? Peers exchange metadata on what pieces they have Download “rarest” pieces first –Pieces held by the fewest peers –Improves reliability When down to the last few pieces, ask for them from multiple peers –Why?
Courtesy: Philip Levis/David Mazieres, Stanford BitTorrent Communication