TorrentFreak

The place where breaking news, BitTorrent and copyright collide

How and Why BitTorrent Works, a Visualization

Millions of people use BitTorrent to share files every day, but only a small percentage actually understand how BitTorrent works and appreciate why it is such an efficient way to share large files. A simplified but insightful visualization helps to shed some light on the inner workings of the BitTorrent client.

As with most technology, viewing a simple simulator depicting the inner working of BitTorrent is much easier than having to plow through pages of technicalities and insider lingo. So, for those who never got to read up on what’s under the hood of a BitTorrent client, this visualization comes in handy.

The nifty BitTorrent swarm visualization uses processing.js to represent how a BitTorrent swarm works. In particular it may help novices get a grasp on how BitTorrent functions and why it’s capable of sending a gigabyte of data to millions of people in only a few minutes.

As most tech-savvy users know, BitTorrent starts with chopping a file into small pieces. The person who starts sharing the file sends those small pieces to available peers in the swarm. The BitTorrent protocol makes sure that the seed sends pieces to everyone, so they can immediately exchange these pieces with each other.

What follows is a sharing fest of bits and bytes. Your BitTorrent client tries to find the rarest piece that’s available among the peers in the swarm to avoid getting stuck at 99% and sharing relies on fair trading principles (tit-for-tat).

In general BitTorrent transfers go faster if the number of seeders in the entire swarm is higher. This means that a torrent with 20 seeders and 50 leechers should result in a better download speed compared to a torrent with 50 seeders and 250 leechers.

The BitTorrent simulation is a simplified visualizations of this process. It works in all up-to-date browsers except Internet Explorer. Seeds can be added to the swarm with the “s” key and peers with the “p” key. The “r” key allows you to delete seeds or peers from the swarm at random.

In 2006 we wrote about an earlier version of this “BitTorrent simulator,” but because the original is no longer online and since many more people use BitTorrent nowadays, the update is appreciated.

Related Posts

Previous Post | Next Post

  • anan

    tit for tat, love it, and I love how the visualization is done in javascript.

  • chisophugis

    still not as good as:

    http://en.wikipedia.org/wiki/File:Torrentcomp_small.gif

    and that has been there since 2005 :/

  • syd

    one question i still haven´t found an answer for:
    if i download a torrent using a proxy and open it up in my client,will my ip-address,visible in other clients who download the same torrent,be the one that came with the proxy,or will it change into the ip-address that leads to my isp,if i stop using the proxy that i used to download the torrent?

  • WilhelmR

    Saw it for 5 minutes already.. still waiting for the RIAA and MPAA circles to come in and sue the others.

  • theo

    This is way too GEE WHIZ for me guys.

  • Mehz

    cool vizulization, almost crashed my pc lulz

  • Anon

    syd, the .torrent file doesn’t hold information about peers. When you connect to the swarm, your IP number will be distributed by the trackers so other peers can connect to you.

    Therefore, to conceal your IP number you need to use a VPN for the BT client. How you download the .torrent file doesn’t matter.

  • Borderliner

    @ 3 / syd
    By “torrent” you mean the actual .torrent file? It doesn´t matter how you got the .torrent file, other peers see the IP that you´r computer has when downloading using this .torrent.
    If you mean “torrent” as in “files at which the .torrent points” then, if you run through a proxy, other´s will see the proxy´s IP. Depending on what BT client you are using you might have to activate additional settings to ensure that all traffic goes through the proxy (including name resolution and communication with peers, as opposed to just communicating with trackers). uTorrents documentation states that uT doesn´t support proxying for UDP traffic, hence others might still get your real IP when such type is used (DHT uses it I think, and some trackers also support UDP based announces).

  • Unauthorized Content Consumer

    I’ll share the video with my n00b friends. Thanks. ;)

  • BottomLiner

    beats the pants off the one featured on 60 minutes.

  • BottomLiner

    Well, this one would have crashed anything the dinosaurs could get their hands on at 60 minutes, so I understand.

  • Court

    “In general BitTorrent transfers go faster if the number of seeders in the entire swarm is higher. This means that a torrent with 20 seeders and 50 leechers should result in a better download speed compared to a torrent with 50 seeders and 250 leechers.”

    Shouldn’t that read “…if the ratio of seeders…is higher…”? Strictly speaking, there number is higher in the latter example, but the download speed is worse. The difference is the ratio of seeds:leechers is better in the former (1:2.5 vs. 1:5).

  • syd

    7 & 8

    thank you.the whole vpn stuff gets on my nerves.
    slows things down,and ipredator (which i bought for three months) disconnects about once every hour on my macs.
    it´s probably the best thing to do to only download older torrent-files anyway.
    if rats find a fresh source of food,they always send the young and greedy ones ahead to try the food.if they survive,the old ones start eating the food too.

  • Dan

    Ah man, that picture looks just like a pr0n image to me. I mean, look at the beauty. All those little dots are actually love! The rich shares with the poor, and then the poor shares with the people he cares about.

    Weird, but that’s how I see BitTorrent.

    Torrents, sharing, caring, love! <3

    antiantipiracy.blogspot.com

  • A. Nonny

    In Canada we spell Teksavvy with a K

  • Pico

    In Soviet Russia, torrents download you!

  • MD3

    @14 Dan & @16 Pico
    LOL

  • More Noobs LOL

    “Depending on what BT client you are using you might have to activate additional settings to ensure that all traffic goes through the proxy (including name resolution and communication with peers, as opposed to just communicating with trackers). uTorrents documentation states that uT doesn´t support proxying for UDP traffic, hence others might still get your real IP when such type is used (DHT uses it I think, and some trackers also support UDP based announces).”

    For someone claiming to have read the documentation this is hilarious. No peer to peer traffic is proxied, only traffic to and from the tracker uses a proxy set in uTor or any other BT client for that matter. Other peers will always see your home IP address whether it’s DHT traffic or not.

    “if rats find a fresh source of food,they always send the young and greedy ones ahead to try the food.if they survive,the old ones start eating the food too.”

    Several things wrong with your analogy: you are not “sending” anyone, you’re just not doing anything yourself. So mkaing an analogy that claims your “controlling” whether something happens is silly. Also, you have no idea whatsoever if people “survived” meaning all your doing is waiting for a torrent to get old – not controlling some process using other people to make things safer for yourself. How did you manage to delude yourself like this – are you always in this sort of fantasy world so far removed from reality?

    Fail.

  • Pingback: Pirate Home Page » How and Why BitTorrent Works, a Visualization

  • Obedient

    The fact is that a large number of downloaders (I would say over 50%) don’t seed up to 1.1 once their download is finished. I have seen this happen. For example, there is a particular torrent that’s very popular with 20 seeds and over 200 leechers. I have seen the number of seeds remain at or around 20, even after leechers complete their download. They don’t seed, they just disconnect!
    Seems like the whole bittorrent works only because of the minority of very generous peers.

  • ?

    @More Noobs LOL

    you may do well to investigate the “use proxy server for peer-to-peer connections” option in µtorrent

    @syd

    useful site to get you started: http://www.checkmytorrentip.com/

  • Pingback: Simulatore di BitTorrent per capire meglio come funziona

  • redbaron

    Nice visualization. Quite good for benchmarking actually. :)

  • syd

    18

    whenever there is any issue discussed anywhere about torrenting there seem to be different opinions about how things are,not always based on fact-knowledge,i assume,and if you have no personal exchange in real life with people who are interested in the same things you are,file-sharing, it might get hard to deepen your understanding.
    if the ip address is visible to other up- and downloaders anyway,i wonder why anybody anonymizes anything at all.
    it´s asperger,´using other people´is definitely something i can not do.

    20

    thank you.i´ll go there.

  • NubCakes

    “The fact is that a large number of downloaders (I would say over 50%) don’t seed up to 1.1 once their download is finished. I have seen this happen. For example, there is a particular torrent that’s very popular with 20 seeds and over 200 leechers. I have seen the number of seeds remain at or around 20, even after leechers complete their download. They don’t seed, they just disconnect!
    Seems like the whole bittorrent works only because of the minority of very generous peers.”

    No joke and actually I think 50% is being far too generous, more like 80% seems reasonable to me.

    But this is why private trackers are better than public and partly why SLR (meaning speed) ratios are usually so bad on public and the reverse is true for private trackers. It doesn’t matter what a user wants to do, they must seed back (to the rule regime defined which often isn’t 1:1 before any idiots start calling private users elitists because “people can’t seed back” lol).

    But nonetheless you’ll still have many people complaining about private trackers being “elitist” (false), saying how they’re “against p2p principles” (whatever that means) and also extolling the virtues of sharing at the same time. When in the real world a large majority of users on public trackers don’t actually do this.

    I know, I know, it’s pretty petty to not allow use of your unmetered upload stream but nonetheless a majority of public tracker users do act in this way.

    I don’t see anyhting wrong with private trackers enforcing ratios – if you’re going to share anyway what does it matter?

  • John

    the madness of enforcing ratios if you require a 1:1 ratio is that people behind fibre links easily obtain killer ratios thereby making it impossible for all users to be at 1:1. What usually happens is you get pay to leech so consiencious users get build ratios on the back of the people who pay there money and hit and run, or the site sets up golden torrents etc etc which allow users to boost their ratios. Or, users with low upload speeds have to rip files and post them.
    Private trackers do work but so do public. I have had a 100mb/s upload link and a crappy 100kb/s and have managed both pretty well so it is possible.

  • Pingback: Simulador gráfico muestra cómo funciona BitTorrent « bitaminados

  • Daffy Duck

    That’s a pretty cool visualisation.
    After you get up to 15-20 seeds and add half a dozen or so peers the data bits flying about start making spiral patterns, rotating circles, waves etc.

  • duane

    Awesome stuff.

    It totally murdered by Firefox, though it worked great in Chrome.

  • Just an FYI

    @ 23

    Private trackers are not for everybody…you need to have the speed. I do not live in the US and the typical upload speed in this country is 256k; the slow speeds lead to eventually being banned from private torrent sites…elitist…who knows.

  • Shailendra

    Datz very cool

  • Rikita

    The problem is that internet connections are not simetrical or not most. My internet connection can do 42KB/sec down & 10KB up max. If I had to wait to seed, it would take me almost 3 extra days to seed equally while having download not touched when done. On my 150KB/60 KB up I do up @ 20-22KB and upload on emule 22KB. If it was symmetrical, I could max both always without compromising my download when upload is done more or it would work better

  • LOPPSI2

    Read this
    http://arstechnica.com/tech-policy/news/2010/02/move-over-australia-france-taking-net-censorship-lead.ars

    TF: a story here

    LOPPSI2: Get VPN or Get a Fine/criminal record …..
    Big crackdown on its way.
    You aint seen nothing yet

  • LOPPSI2

    VPN
    hit and run

    Or go on the run

  • TerribleTony

    @5 I’m with you on this one.

  • Pingback: Simulador visual del protocolo BitTorrent para entender mejor su funcionamiento | Bitelia

  • mioptr

    This needs to be turned into a screensaver.

  • Tor Entor

    That is supercool. Love the way the pieces are represented by spectrum colours, and visual completion status, and watching all the peers finish up then adding another peer in. Great stuff (if you’re into that kinda thing ;p) !!

  • Pingback: Remains of the Day: Why Piracy Works Edition [For What It's Worth] · TechBlogger

  • Pingback: Remains of the Day: Why Piracy Works Edition [For What It's Worth] | Superstars Of Gaming

  • Pingback: Remains of the Day: Why Piracy Works Edition [For What It's Worth] | CHARGED's Digital Lifestyle at Work or Play

  • Pingback: Simulatore di come lavora BitTorrent - Totumweb

  • Pingback: Remains of the Day: Why Piracy Works Edition [For What It's Worth] | World Wide Web

  • Sid

    Gud Summary!!!!

  • Pingback: Remains of the Day: Why Piracy Works Edition [For What It's Worth] | Bestel uit china

  • divemaster

    3D visualization doesn’t work yet with Mac, does it? :-(

  • BTGuard - BitTorrent Anonymously

NewsBits

Even more news...

  • Blu-ray Anti-Piracy Tech Stops Discs and Promotes Purchases

    An anti-piracy system present in all official Blu-ray players since 2012 has received a fresh update...

  • Foxtel Breeds Pirates by Locking Up Game of Thrones

    One of the main reasons why people turn to piracy is the lack of legal alternatives....

  • UK Student Admits Breaching Sony Copyrights With Leak of PS3 SDK

    Last year an Internet user known as El Nomeo leaked version 3.70 of Sony’s Playstation3 SDK...

  • Pirates Can Be Identified Despite Sharing IP Addresses, ISP Claims

    Carrier-Grade Network Address Translation is a network mechanism through which many Internet subscribers can share the...

  • Feds Seize Cash from Major Bitcoin Exchange’s Dwolla Account

    The U.S. Government has taken a significant action against the web’s top Bitcoin exchange by seizing...

MostDiscussed

Below are TorrentFreak's most discussed articles of the past month. Join the discussion if you like.

CopyQuote

Left Quote

“The Pirate Bay has been one of the most important movements in Sweden for freedom of speech, working against corruption and censorship.

Peter Sunde Left Quote

PopularArticles

A selection of some TorrentFreak's classics dug up from our archives.