How does bit torrent work?
So, you were probably watching porn last night, sitting in front of the same screen on which you are reading this article. While streaming the video clip, something devastating happened. Halfway down the video, your WIFI stopped working precipitously.
You were all tensed and devastated. But something flashes in your mind and your eyes brighten up. You rush towards your closet and pull out a hard drive. Tom gave you this HDD. This HDD has all the content that you need for the night. But did you know that Tom had downloaded these videos from a torrent site?
Yes, all these heavy files were downloaded using a BitTorrent client. Not only this; Eminem’s Kamikaze on your smartphone or the Watch Dogs on your PC or even the Pulp fiction which you saw last week was probably downloaded using a BitTorrent client. BitTorrent isn’t something which works on a regular download-upload model. It is a protocol which works on “Peer-to-Peer” networking technology.
Developed by Bram Cohen in 2001, millions of people use BitTorrent concurrently at any given time. Even I have a torrent being downloaded in the background, while I am writing this blog.
Peer to Peer (P2P)
In a p2p network, each and every computer on the network acts as a server. The end-user computers are called peers. So, if you search for a favourite song of yours, the software algorithm will hunt down all the end-user computers for that particular file.
Once the computers containing the required files are located, you will be able to download them. Now, here comes the beautiful part: A p2p network enables you to download a file concurrently from all the computers, which contain the file. This means that each and every node(peer) will send you fragments of the required file.
Once all the fragments are received and are in place, your download is complete. There is a sharing of files between peers, hence the name.
So, let us see how it woks
You, for instance, upload a media file through a node i.e. your computer, using the BitTorrent protocol guidelines.
Another user who wants to download that same media file, is also using BitTorrent. (Let us call him Bill.) The trackers hunt down your computer, as it has the required file. Bill starts the downloading process.
The file that is being shared is distributed in small fragments called “Pieces”. All pieces are of the same size and are downloaded non-sequentially. Each piece is protected by a cryptographic hash, which assures the piece’s authenticity.
As soon as the first piece is downloaded, Bill’s computer begins to upload that single piece on the BitTorrent network. As more and more pieces are downloaded, more and more of them are uploaded. Time lapses and the full file is downloaded. At this point in time, there are two sources which are uploading the same file (your computer and Bill’s computer).
Bill, once a downloader, is now an uploader. Consequently, the number of uploaders increase with the increase in downloaders. The peers which upload information are called seeders and the ones which download are called leachers. A greater number of seeders means a greater download speed.
The delocalization of servers, requires much less bandwidth and also prevents spikes in the internet traffic.
The torrent file and the magnet link and client
A BitTorrent client is a program which implements the protocol. µTorrent, Vuze, BitLord etc. are all BitTorrent clients. One of the ways of using BitTorrent is by downloading the torrent file. It does not contain the files that are to be shared. What it contains is the information of the files (names, size etc.) and the address of worldwide computers, which contain the content. These files are downloaded with a “.torrent” extension.
Once downloaded, open the file in the torrent client, which will automatically take care of rest of the process. What makes this possible are the trackers, which are present in the torrent descriptor file. They get the internet location of the peers with sharing pieces.
The Magnetic Link, developed by Bitzi in 2002, works a bit differently. It identifies the content via cryptographic hash value rather than their location. So, you don’t have to download the torrent file separately. You just need to click the magnetic link, the BitTorrent client takes care of rest of the process.
Thank you for reading. Follow my blog for more fun, crisp and informative content.