BitTorrent overview

BitTorrent is a popular distributed file system. Basically, the file sharing process in BT is shown in Figure 4, which can be described in the following five steps:

1 Peer A interacts with the web server and downloads the .torrent file.
2 Peer A interacts with its trackers found in the *.torrent file and requests a set of peers in the Torrent network.
3 The tracker sends a specific number of peers in the Torrent network.
4 Peer A randomly selects a part of the participant nodes from the list as its neighbor nodes and establishes contact with them.
5 Peer A can use swarming technology to exchange file fragment data with its neighbors.

Insert picture description here

In BitTorrent, when each file is distributed, an overlay network called Torrent is established. Torrent is composed of nodes in the network, which can be divided into two types: seed and leecher.

Seed is the client node that has a complete copy of the file, and leecher is the client node that downloads the file. In addition to seed and leecher, a web server and tracker are also required. If a node wants to join Torrent, it can get the .torrent file from the web server. This file contains information about the file, including the name, length, hash digest and the URL of the tracker. A tracker is a special node that is used to store metadata of other active nodes in the network. A node can interact with the tracker, and then obtain information about the number of ip and port pairs of other nodes in the network, and then randomly select 20-40 nodes in the list as its neighbors.

In BT, swarming (a file swapping technology) is used to split files into fixed-size segments, each segment is usually 256KB in size. When a segment is completely downloaded, the node compares the SHA1 hash value of the segment with the value in the .torrent file. If it matches, the node will declare the availability of this complete segment to its neighbors for subsequent file exchange and download.

This article is translated from
[1]. Engineering; Studies from Sun Yat-sen University Further Understanding of Engineering (When Blockchain Meets Distributed File Systems: an Overview, Challenges, and Open Issues)[J]. Journal of Engineering,2020.

Guess you like

Origin blog.csdn.net/weixin_40986490/article/details/115005830