Brief description of BitTorrent protocol principles

Source: Internet
Author: User

It was ant when I got in touch with my computer and used the software to download it. Then we used the BT tool. Now there are countless software downloads, however, we still need to know about the BitTorrent protocol. This is also the specification for BT seeds and BT downloads. For normal HTTP/FTP downloads, the TCP/IP protocol is used, the BitTorrent protocol is a P2P File Transfer Protocol Based on the TCP/IP protocol, which is at the application layer of the TCP/IP structure. BitTorrent also contains many specific content protocols and extension protocols, and is constantly expanding 。

According to the BitTorrent protocol, the file publisher generates a. torrent file based on the file to be released, that is, the seed file, also referred to as the seed file 。

. A torrent file is essentially a text file, which contains Tracker information and file information. Tracker information is mainly the address of the Tracker server to be used in BT download and the settings for the Tracker server, the file information is generated based on the calculation of the target file, the calculation result is encoded according to the Bencode rules in the BitTorrent protocol. The main principle is to divide the downloaded files into equal-size blocks, the block size must be 2 K integer to the power (because it is a virtual block, each block file is not generated on the hard disk), and the index information and Hash Verification Code of each block are written. torrent file; so ,. the torrent file is the index of the downloaded file 。

To download the file content, you must first obtain the corresponding. torrent file and then use the BT client to download it 。

During the download, the BT client first resolves the issue. the torrent file obtains the Tracker address and then connects to the Tracker server. The Tracker server responds to the download request and provides the IP addresses of other Downloaders (including publishers) of the downloader. The downloader then connects to other Downloaders, according. the torrent file informs the other party of the blocks they already have, and then exchanges the data that the other party does not have. In this case, no other servers are required to participate, disperses the data traffic on a single line, this reduces the burden on servers 。

The Hash verification code and. the comparison in the torrent file indicates that the block is correct if the block is the same, and the block needs to be downloaded again if the block is different 。

For HTTP/FTP downloads, the published files are only on one or more servers, and there are too many people to download them. The bandwidth of the server is very high and very slow. However, BitTorrent downloads are characterized, the more people you download, the more bandwidth you provide, and the more seeds you need to download 。

Some users turn off the download task after the download is complete and provide a small amount of data to other users. To avoid such behavior, super seed exists in the unofficial BitTorrent protocol) this algorithm allows the file publisher to publish a file in several steps. Instead of providing all the content of the file at a time, the publisher slowly opens the proportion of the downloaded content to prolong the download time, A person with a high speed must provide data to others before downloading the data. A person with a low speed has more opportunities to obtain data 。

The BitTorrent protocol principle in this figure, the different parts of a file are distinguished by different colors. When the transmission starts, only the seed release has all the files. During transmission, some users obtain some files (represented by colored lines). As the transmission continues, all files are published in the system. At this time, the seed owner can exit, it does not affect the propagation of the file 。

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.