IMFile

IMFile

A Free And Unlimited BT / HTTP / HTTPS / eD2k Download Software From Singapore

How to understand the compact peer node list returned by Tracker

Introduction#

In order to reduce the size of the Tracker response and reduce the memory and computational requirements of the Tracker, the Tracker can return peer nodes as packed strings instead of as a bencoded list.

In this document, the interpretation of the keywords "MUST," "MUST NOT," "REQUIRED," "SHALL," "SHALL NOT," "SHOULD," "SHOULD NOT," "RECOMMENDED," "MAY," and "OPTIONAL" should be referred to as described in IETF RFC 2119.

Overview#

According to the BitTorrent protocol specification, a peer node wishing to transfer a file will contact a central Tracker. The Tracker will return a list of peer nodes currently transferring the file. This list of peer nodes is implemented as a series of bencoded dictionaries. Each dictionary in the list contains three fields: peer id, ip, and port.

Among them, the peer id is 20 bytes plus an additional 3 bytes of bencoding payload. The ip is a string that includes a domain name or IP address, along with an integer port number. The length of the ip is variable, but since it can be a domain name in its longest form, it cannot exceed 255 bytes, plus an additional 4 bytes of bencoding payload. Bencoded integers are also variable in length, but since they represent a port number, their length will not exceed 7 bytes, including bencoding payload.

According to the BitTorrent protocol specification, the list of peer nodes in the BitTorrent protocol is stored in the form of bencoded dictionaries, with each dictionary containing three fields: peer id, ip, and port, representing the unique identifier, IP address, and port number of the peer node, respectively.

Therefore,

total peer list length in bytes < n * ( 23 + 259 + 7 )

A compact format is now commonly used to represent each peer node, where each peer node is represented using only 6 bytes. The first 4 bytes contain a 32-bit IPv4 address, and the remaining 2 bytes contain the port number. Both the address and the port number are in network byte order.

It is recommended that trackers default to returning the compact format. By including "compact=0" in the announce URL, the client suggests the use of the original format by the tracker, and similarly, "compact=1" suggests the use of the compact format by the tracker. However, the "compact" key-value pair is only a suggestion: the tracker can choose to return either format. "Compact" is a suggestive setting so that the tracker may only support the compact format. However, the client must continue to support both formats.

Based on the above description, it is recommended that the tracker return a compact format list of peer nodes by default. By specifying the corresponding parameter in the announce URL, the client can suggest the use of the original format or the compact format by the tracker. However, the tracker can ultimately decide which format to return. The client must support both formats.

Example:

GET /announce?peer_id=aaaaaaaaaaaaaaaaaaaa&info_hash=aaaaaaaaaaaaaaaaaaaa
&port=6881&left=0&downloaded=100&uploaded=0&compact=1

The "compact format" data format in the BitTorrent protocol. In traditional BitTorrent tracker responses, a key called "peers" is used to represent the list of peer nodes, with its value being a bencoded list.

However, in the "compact format," the same "peers" key is used, but the value of the key is a bencoded string instead of a list. Unlike the traditional format, the "compact format" does not include the ID (peer id) of the peer nodes. Although lacking the information of the peer node ID, this compact format has been widely used for many years without causing any issues.

This "compact format" is supported by most mainstream BitTorrent clients such as IMFile, qBittorrent, libtorrent, uTorrent, etc.

Summary#

In peer-to-peer file sharing networks, when you connect to a Tracker to obtain information about other users sharing the file, the Tracker typically returns a list of peer nodes that are currently sharing the file. This information can include IP addresses, port numbers, etc.

"Compact Peer Lists" in Tracker Returns refers to a compact representation or format for the list of peer nodes. Compared to other formats, such as detailed node lists, the compact peer list uses less data to represent node information, thereby reducing network traffic and resource consumption.

Typically, compact peer lists are represented in binary and use a specific encoding scheme. They usually include the IP address and port number of the nodes, and specific information about the nodes can be obtained by decoding and processing the list.

In conclusion, "Tracker Returns Compact Peer Lists" means that the tracker returns a list of peer nodes represented in a compact format, which can be used to establish connections with other users sharing the file.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.