Presentation on theme: "Ln -s /usr/timtimmah /usr/kevinstanonik. TORRENT BASICS You want to get a file to other people. BUT you don’t have the bandwidth to have everyone."— Presentation transcript:
ln -s /usr/timtimmah /usr/kevinstanonik
TORRENT BASICS You want to get a file to other people. BUT you don’t have the bandwidth to have everyone download the file from you. What can you do? Tell people to mirror the download People are stupid, they don’t care and won’t listen. Host it on another site But where’s the fun in that? Set up a torrent
Let’s use an idea you know
Take your file:
Let’s use an idea you know Take your file: Break it into smaller pieces
Let’s use an idea you know Now share those that piece with your friends so they all have the same piece as you
BUT THAT’S NOT A WHOLE PIZZA That’s because we’re not done yet!
BUT THAT’S NOT A WHOLE PIZZA That’s because we’re not done yet! We keep copying slices over until your friends have all the pieces you have. This is your tube of internets
Now we’re done. Now they take those smaller pieces: And they turn it back into your pizza to enjoy it’s delicious noms:
And that’s the baby-basics But everyone knows that, right?
.torrent Each piece of the file(block) has a SHA1 hash. The.torrent file has the list of these hashes so when you want another piece of the file, you ask for a specific hash. Basically: Block Hash
.torrent When you finish downloading the block, the client runs it through a SHA1 hash algorithm and makes sure it matches the hash in the.torrent. This is how the error checking and file distribution of it works.
Some Terms Peer – Another seeder or leacher Seed(er) – Someone who has the entire file Uploads only. Leech(er) – Someone who does not have the entire file but is downloading it. Downloads and uploads. Tracker – A central machine which tracks who is downloading what (in a good way) Swarm – The group of seeders and leechers Scrape – Checking for more leechers/seeders
The real world basics When you seed, you tell the tracker that you have 100% of the data and you will share that with others. When someone leeches, they tell the tracker that they have x% and will share what they have and download the rest. When leeching, you don’t download the pieces in any order and that’s ok. When a leecher has 100%, it becomes a seeder.
Scrapes When you’re connecting to the tracker, you scrape the tracker for new users on that particular torrent. I pulled the head of a.torrent file to show the trackers and its scrape conventions, can you guess what I’m downloading?
Example Suzy seeds awesome_pictures.rar.exe Billy downloads the torrent and starts it up. The tracker now has 2 users and their ips which get shared. Suzy starts sending Billy blocks and Billy checks their hash to see if the file transferred properly. Billy finishes downloading all the blocks and reconstitutes it into awesome_pictures.rar.exe Billy becomes a seeder and now has tons of viruses because he’s an idiot.
Now imagine this scaled When you have 100’s of seeders you can download a separate block from each of them to increase throughput. This will decrease total draw on your system after the initial seed and increase speeds for everyone.
Other (decentralized) ways to connect Peer Exchange: Instead of using a central tracker to find out who’s available, you ask your peers who they’re connected to. This cuts down on the need for a central tracker and if it goes down, you can still find new users to connect to. Distributed Hash Table: You share the hash information for the torrent and THEN people can connect to you for the file’s information.