The wikipedia article is useful http://en.wikipedia.org/wiki/BitTorrent_(protocol) and the specification for those that are curious will be maintained here http://wiki.theory.org/BitTorrentSpecification. [Bit Torrent, Inc went closed source/protocol on us not long ago, so the wiki spec is likely the one you want to keep up with and not the original spec as published by Bit Torrent, Inc.]
Basically bit torrent is a specific P2P protocol that is understood by clients such as KTorrent, (micro)Torrent, Azureus, and others. [I am only familiar with KTorrent which I know is FOSS].
This P2P protocol will generally use a "tracker" to keep tabs on the users (peers) that are participating in the sharing. You give up some bits to others automatically while they give up some bits to you. So that the system works efficiently and reliably, the file that is being shared (you can "seed" any file at all that you want to share with others) is shared in specific sized chunks and each of these chunks has a hash/checksum associated with it and distributed to all peers so that each peer can verify when it has correctly finished downloading a chunk from another peer. Thus the system has protection from those that want to poison other peers.
Well, you can distribute poison (corrupted files, trojans, etc) as the initial seeder. Assuming you trust the initial seeder though, then you can have confidence that participating peers (including those that graduate from leechers to seeders) cannot contaminate the file chunks they give you (your bit torrent client would reject the chunk as it only accepts chunk that match the checksums in the original .torrent file).
Let me say right now that I just seeded Linpus Linux http://linuxtracker.org/download.php?id=7521efbf6e7e6fb7a1cbac220eec0dbe3d87ebd8&f=LinpusLinux-LiveCD-i386.iso.torrent and what everyone should always do after a binary download from anywhere (at least if you expect to run it) is to check the md5sum of the file. The value for this torrent/iso file is "61cd5d05f853d8c6d71da973b5c2d987" which you can verify is what the Linpus website shows. If they are not showing that, either I am lying, made a mistake, or they changed their binary at some point between the time I downloaded it a few days ago and when you checked (so if you come across this thread in the far off future, expect the md5sums to disagree because they likely will have upgraded their download offering, necessarily leading to a new md5sum for it).
On Linux check the md5 of a new download by using the md5sum cli "command". Eg, "md5sum LinpusLinux-LiveCD-i386.iso" (and the result in this case should be "61cd5d05f853d8c6d71da973b5c2d987 ..."). If you don't have md5sum installed, get it or ask for help. If you get a bad md5sum checksum, there was a problem along the way, and you will likely have to redo the download. [Maybe you haven't finished downloading the file entirely yet, or you are looking at the wrong md5 sum or downloaded the wrong file, or you did "wget -c http://..." from a site that changed binaries on you over the time you were downloading (an issue if you downloaded the file through a slow modem connection over many days as happened to me once)... or maybe you just have a flaky system or were extremely unlucky (eg, a very very strong solar flare may have changed the bits on your computer's hardware memory).]
OK, on a modern distro, you should hopefully have a bit torrent client installed and when you click on a ".torrent" link on a webpage, you should be offered the option to save to disk or to open it in the bit torrent client. In any case, you are safe saving it to disk and then from inside your bit torrent client opening it up.
What is a .torrent file?
It's a file with a very simple structure (you will realize that if you can manage to make sense of the specification linked at the top). Basically there is some administrative info at the top of the .torrent file and then you get a long list of hash sums (sha-1 I think) for each of the chunks in the file to be shared.
What do you do with a .torrent file? How do you participate in a torrent? How do you start a torrent (to share your own files)?
The person that wants to create a new torrent has to create such a .torrent file and then upload it to a "tracker". KTorrent created my .torrent file for the Linpus .iso I had downloaded from the Linpus website (because that .iso was the file I wanted to share as a torrent). To create the .torrent file in KTorrent, I clicked on File -> New. In the dialogue that popped up, I had to determine the chunk size (I chose 1MB). After pointing to the file on disk for which I wanted to generate the .torrent I was basically done. KTorrent then created the .torrent file. Actually, I also supplied a tracker url to KTorrent when building the .torrent file, but I think that may not have been necessary (I'll have to check later).
At this point you find a website (a server actually since the port for bit torrent is not 80, but they probably have a website, too) that provides tracker services, eg, linuxtracker.org. You have to set up an account with them. Once logged in, you are given the option to upload a torrent file and you are also shown the url for their tracker (not sure if that url is necessary, but I did put that url into KTorrent when setting up to build the .torrent .. it was http://linuxtracker.org/announce.php or something like that; the real tracker url you get later on, the one that actually works, looks different though -- see following paragraphs).
When using linuxtracker.org's webform to upload a .torrent file, I had to fill some basic information and point to the .torrent file on disk. The tracker then uses the .torrent file I just uploaded in order to coordinate the peers. The tracker distributes that .torrent file to all peers that click on the .torrent link (like the one provided at the top of this post). Also the bit torrent protocol requires that your torrent client keep a dialogue with the tracker. That is how you know (your torrent client app knows) about new peers (I think). Remember the .torrent file is fairly small and basically holds the name of the file, the number of chunks and sizes, etc, as well as the hash sums for each chunk. So at 1mb, this Linpus torrent has between 600 and 700 chunks.
Anyway, once I uploaded the .torrent file, KTorrent requires that you open up the torrent (File -> Open the .torrent file you already saved to disk if you saved to disk (after uploading to linuxtracker, not the original .torrent you created) or click on the .torrent link in a web browser and choose to open with KTorrent) as if you were going to download it even though you will have the file you are going to seed already on the hard drive.
Where does this torrent link come from when you are the initial seeder? Well, what I did after uploading the .torrent file was to do a search for "Linpus" on linuxtracker.org. That gave me one result only (I got zero results intially because the torrent was not active.. so put "All" in the field right next to the search box in order to see inactive torrents, too). The torrent link is the one right to the right of the name (it will end in .torrent).
Do this download attempt even if KTorrent indicates you are already seeding that torrent. In reality you are not (a bug?) because that entry was created before you had actually logged in and set things up through linuxtracker (maybe other trackers don't require this step, in which case KTorrent would not have a bug). Once you click on the link to download the torrent, it will appear as a new torrent on your status indicator, and it will instantaneously be "downloaded" entirely. The difference with this new torrent is that it will work while the initial one will not. You can go into the menu and stop/delete the initial torrent to clear up your status window (you will also note that the tracker status (the "Trackers" tab) for that initial link will indicate that the tracker is not communicating with KTorrent; this is unlike the case when you opened up the torrent after the upload to linuxtracker, as that torrent will be communicating with linuxtracker.org and it has a different announce url).
Hopefully I didn't lose anyone with this last part of the discussion. If you have problems seeding, then you will know what I mean; otherwise, don't worry too much about what I just said. Torrent clients besides KTorrent should work differently. I found this out from reading on the linuxtracker forums of people that were having trouble seeding up a file and they were using KTorrent. Anyway, the key is to open up/click on the torrent link you get from linuxtracker *after* you have uploaded your .torrent file to them (try this even if you don't use KTorrent). The torrent you created initially (to upload) can be reused and uploaded to other trackers. I think the tracker modifies the copy of the .torrent file you upload to suit their needs (eg, to put a tracker url inside that corresponds to their service)... So don't think you can use the .torrent file until after you upload it to a tracker [but your bit torrent client may do this transparently.. I am guessing.. if the tracker works with anonymous seeders or something and you provided a tracker url when creating the .torrent ???$##$@^#%$%??].
When you click on the .torrent link, you need not be logged on. In fact, I think it's preferable not to be logged on. I wasn't, and the reason was because of something I read on the forums. Things may work out if you are logged on though. [To participate in a torrent that is already set up on linuxtracker.org, you need not have anything to do with linuxtracker; you only log on if you want to use them as a tracker for a torrent you want to set up.]
The info in the .torrent file, in conjunction with the tracker (whose url will be inside that file somewhere I believe), gives torrent clients all the info needed to start finding peers and uploading/downloading (u/l and d/l) the correct chunks.
So when seeding a file, the initial download will done instantaneously because the file is right on the hard drive and you were the only peer at that point in time. Those that come after will participate normally, getting chunks from you (if you are online) or from any other peer that has a chunk they are missing and is online participating in the torrent.


, I know, but just to be safe, remember to bring the salt shaker.












Joined: 2007-09-10