Você está na página 1de 7

BITTORRENT WORKING

The key components of the Bit Torrent network are the tracker, the web server hosting the torrent file, seeds and peers. Let us assume Peer A wishes to download a file. 1. Download the torrent file The first step is to download a torrent file and open it with your Bit Torrent client program.The torrent file is the metafile containing information about the location of the tracker and verification hashes for the pieces of the file or it contains data that describes the file youre going to be downloading. It is usually hosted on some popular website. If the .torrent association has already been made on our web browser, a click on the url of the webpage is sufficient to download it.

2. Contact the Tracker The next step is to send a HTTP-GET request to the tracker. The tracker is a server which accepts requests for information about other peers on the network. The GET Request advertises Peer A's Peer id, IP address and Port number to the tracker, so that other peers in the network can get in touch with Peer A. Your Bit Torrent client uses information it found in the torrent file to connect to the tracker. The tracker is a server that provides you with a list of peers who are connected to the file that you are about to download.

3. Tracker Response The tracker responds with a list of peers, (ip address and port number), who are currently downloading or uploading the file. Say, Peer A sees Peers B and C in the response list from the tracker. Also, as indicated, let Peer C be a seed. A seed is a peer that has a complete copy of the file. When you finish downloading the file, your Bit Torrent client becomes a seed for the file and allows others to continue downloading it until you close the program. For a torrent to begin in the first place, it must have at least one seed.

4. Peer Connection Peer A then initiates TCP connections with the peers in the peer list it obtained from the tracker. Since B and C were on that list, Peer A connects to both and initiates a 3 way Bit torrent handshake.

5. Peer A downloads a piece from the network. Once the connection has been established and remote peer has been authenticated, the peers B and C advertise what pieces they already have with a BITFIELD message. Peer A expresses INTEREST since it does not have any pieces yet. Peer A then sends a REQUEST message requesting for a particular chunk of a piece. When the remote peers UNCHOKE Peer A, it starts downloading from them. Initially Peer A only downloads until it gets hold of a complete piece.

6. Piece exchange starts. After Peer A has successfully downloaded a complete piece and verified it against the hash in the .torrent file, it broadcasts a HAVE message indicating that it just got a piece. If other peers are interested then they can obtain it from Peer A. Now Peer A has boot strapped into the file swarming network and starts exchanging portions of the file with other leeches. Note, that Peer C is a seed and since it has a complete copy of the file, it only uploads to other leeches in the network.

7. Peers periodically contact tracker. The peers periodically contact the tracker to discover more peers. These Announce messages also act in advertising to the tracker of the peer's progress. The announce message consists of fields to indicate how much the peer has downloaded and how much is left. Finally, once Peer A completes downloading the fie, it disconnects from other seeds and becomes a seed, offering the file to other leeches in the network.

Você também pode gostar