BitTorrent Made by Bram Cohen Wife, 3 kids Aspergers Purpose- Share Files Support flash crowds Self-scaling Dishonest clients (somewhat, riaa) Leechers Not anonymous MPAA (http://blog.newworldodor.net/2007/01/11/mpaa-uploads-fake-torrents-to-trap-you/) Peergardian Not secret content Not unblockable ???? (http://www.msnbc.msn.com/id/21376597/) Not streaming (only can view when download complete) (Cohen in Jan 2007 says will be possible) Not searching How Much Traffic http://www.businesswire.com/portal/site/google/index.jsp?ndmViewId=news_view&newsId=20070618005912&newsLang=en http://www.ipoque.com/resources/internet-studies/internet-study-2007 http://torrentfreak.com/shocking-61-of-all-upstream-internet-traffic-is-p2p-081021/ Torrent files Must get some other way (Meganova?) Contain URL of the tracker Block size Checksum of every block Suggested filename Tracker Keeps track of who is part of the swarm. Connect using HTTP Get command with parameters that describe statistics Does not know who has which pieces. There is a trackerless option Trackers can be private Normally one tracker per swarm, can have multitracker Swarm Anyone who is part of the same tracker for the same file What each client does Connect to peers Chocked -- send me no requests Interested -- He has something I want How many peers? When you get a block you announce, so more than 25 too high Downloading Which order First->Last Works for streaming Horrible for network Random Rarest First Best for network Best for you Queuing .. Keep a bunch in the queue to avoid a latency lag problem math : queue_size = block_size / bandwidth * latency + a bit more Uploading and leechers tit-for-tat Proven wonderful in game context Horrible for newbies standard choking algorithm Goals: Try new connections once in a while Reward good citizens Keep number of active peers to a reasonable minimum Don't fibrulate (switch states often) Choke Algorithm: Keep 4 peers unchocked by best download rate Add any peer with better download rate that is uninterested When he becomes interested, lowest of four is bumped Unchoke one other peer at random, prefering new connections 3x as much Snubbing If no download for 1 minute, then no uploads to that peer Recontact Tracker Helps keeps stats Peer Exchange Helps unload trackers Can cause partitioning of the swarm Once a peer exchange graph is partitioned, it is partitioned forever Updating peers HAVE messages Can suppress to peers known to already have 50% reduction What about rarest first? choke and unchoke interested and unintersted request (block#) Super Seed Mode Must have the whole file Goal: Distribute the pieces of the file Goal: Get the peers excanging with each other For each new peer, Only annouce one piece as available. When that piece is announced back to you via someone else, annouce to the original peer a second piece. Avoiding Blocking and Traffic Shaping Attack the cliet-tracker connection Based on IP number (Sandvine application does this) Defenses Encrypt Use UDP Filter RST packets Attack the peer-peer connection Cannot be based on IP number Look inside packet for torrent header Send rst packets throttle always when congested Encryption can hide torrent header Must not introduce a new recognizable header Even weak encryption is OK Sometimes this is broken Distributed Hash table http://bittorrent.org/beps/bep_0005.html Bittorrent Protocol http://wiki.theory.org/BitTorrentSpecification