How does Torrent work ? Interesting question, huh? Deep Kakkad deep-kakkad.github.io
So, What is BitTorrent ? Basically, BitTorrent is a peer to peer file sharing system.
The typical questions – Who? When? Answer is - Bram Cohen, July 2001
The Question :- How?? To know the whole process, we need to understand basic stuff. And, to make it simple, we’ll read a story.
The story! Imagine… You’re sitting in an exam hall. But (as expected), you don’t know answer to a question. But, you can read people’s mind. You’ll read everyone’s mind and conclude which of them know the answer. Then, you’ll conclude(by reading minds), who knows the full or partial answer. And, at last, you have your answer.
Compare… Now, The answer you don’t know = the file to be downloaded Mind reading ability = BitTorrent client Reading of mind = peer exchange/torrent download People who know complete answer = Seeders People who know partial answer = L eecher
One more Layman Example… There is one person having a book, 30 people want to read. Two possibilities :- 1) The person having book will go to each person to let them xerox the book. (problem :- It might take a lot of time. ) 2) The person having book won’t let other 29 copy. (oh no, this is not what we want!)
Optimal solution… In this situation, optimal solution would be :- The 29 go to the 1 and each tear out a page and photocopy it, then give it back. Now everyone has at least 1 page. Now they can either go back to the 1 person and get another page, or they can go to any of the other people and get a copy of the pages they do have.
How to see it in “Torrent’s” terms? The peers first obtain a metadata file for each object. Now, What does meta-data contain? The SHA-1 hashes of all pieces. A mapping of the pieces to files. Piece size. Length of the file. A tracker reference.
How to see it in “Torrent’s” terms? First off, File is split up into pieces… And, SHA-1 is created for each part.
How to see it in “Torrent’s” terms? (The secret) The file pieces are downloaded by leecher , meanwhile, replicas of file are created. As soon as a leecher has a completed download of a piece, it can potentially share it with other downloaders . Eventually each leecher becomes a seeder by obtaining all the pieces, and assembles the file.
And, This was the stuff you didn’t knew was happening, when you were downloading a movie from torrent last time!