Menu
This article relies too much on to. Please improve this by adding. ( December 2012) Mainline DHT is the name given to the -based (DHT) used by to find peers via the.The idea of utilizing a DHT for distributed tracking was first implemented in Azureus 2.3.0.0 (now known as ) in May 2005, from which it gained significant popularity. Unrelated but similarly timed released their own similar DHT into their, called Mainline DHT and thus popularized the use of distributed tracking in the. Measurement shows by 2013 users of Mainline DHT is from 10 million to 25 million, with a daily churn of at least 10 million. Contents.Description Mainline DHT is based on the popular design.
To access the DHT though, you access other computers who have parts of it. If you thus can't access those other computers, then it will be slow. And as the DHT table is quite large and very distributed, your BitTorrent client will try and contact as many peers who have DHT as possible this becomes exponential in sloth. Linnet's How To Remember to like and subscribe See all my videoes in playlist / categories here https://www.youtube.com/channel/UCmd6xmZpPhJ6I9oe6hn65Hg/pl.
Previous to usage of a DHT for distributing peers, were the only method of finding peers. The key feature of using the DHT over trackers is that the decentralized approach favours the nature of the BitTorrent protocol. The DHT operates by distributing lists of peers identified by the hash of the torrent.Operation The SHA-1 hash of a torrent, the infohash, is synonymous with a Kademlia key, which is used for finding peers (values) in the overlay network. To find peers in a swarm, a node sends a getpeers query with the infohash as key (equivalent to a Kademlia FINDVALUE) to the closest known nodes (with respect to the key distance).
![Dht Dht](/uploads/1/2/4/2/124223620/375812577.png)
Like Kademlia, if the node does not return the value (peers), it persists further in an iterative operation. However, after the search is exhausted, the client then also inserts the peer contact information for itself onto the responding nodes with IDs closest to the infohash of the torrent.Token Nodes use an additional measure known as a token to ensure others don't sign up other hosts for torrents.
The return value for a query for peers includes this opaque value. For a node to announce that its controlling peer is downloading a torrent, it must present the token received from the same queried node in a recent query for peers. When a node attempts to 'announce' a torrent, the queried node checks the token against the querying node's IP address.Mainline DHT uses the SHA1 hash of the IP address concatenated onto a secret that changes every five minutes for a token value. Tokens up to ten minutes old are accepted.KRPC A node in the Mainline DHT consists of an IP and port combination.
Nodes communicate via an RPC protocol - KRPC. KRPC is a simple protocol that consists of nodes sending messages (queries, replies and errors) containing dictionaries over.A KRPC message is a single dictionary with two keys common to every message and additional keys depending on the type of message.
![Vuse How To Dsabble Dht Vuse How To Dsabble Dht](/uploads/1/2/4/2/124223620/282103459.jpg)
Every message has a key 't' with a string value representing a transaction ID. This transaction ID is generated by the querying node and is echoed in the response, so responses may be correlated with multiple queries to the same node. The transaction ID should be encoded as a short string of binary numbers, typically 2 octets are enough as they cover 2^16 outstanding queries. The other key contained in every KRPC message is 'y' with a single character value describing the type of message.
The value of the 'y' key is one of 'q' for query, 'r' for response, or 'e' for error.Queries Queries, or KRPC message dictionaries with a 'y' value of 'q', contain two additional keys; 'q' and 'a'. Key 'q' has a string value containing the method name of the query.
Key 'a' has a dictionary value containing named arguments to the query.Responses Responses, or KRPC message dictionaries with a 'y' value of 'r', contain one additional key 'r'. The value of 'r' is a dictionary containing named return values. Response messages are sent upon successful completion of a query.Errors Errors, or KRPC message dictionaries with a 'y' value of 'e', contain one additional key 'e'. The value of 'e' is a list.
The first element is an integer representing the error code. The second element is a string containing the error message. Errors are sent when a query cannot be fulfilled.Routing Table Buckets are structured differently from those in Kademlia.
Instead of a list of 160 buckets, BitTorrent starts with only one bucket. When a bucket becomes full, one of two things can happen:. The bucket is split.
Old nodes are pinged (like in Kademlia)Splitting is an operation that occurs only if our own node ID falls within the range of the bucket.