Skip to content

Commit

Permalink
Merge pull request #61 from bittorrent/dht-version-string
Browse files Browse the repository at this point in the history
Document client version field in DHT messages
  • Loading branch information
ssiloti committed May 2, 2017
2 parents 1a5fd50 + 369b2bc commit 6034458
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions beps/bep_0005.rst
Original file line number Diff line number Diff line change
Expand Up @@ -186,17 +186,20 @@ single packet is sent in response. There is no retry. There are three
message types: query, response, and error. For the DHT protocol, there
are four queries: ping, find_node, get_peers, and announce_peer.

A KRPC message is a single dictionary with two keys common to
A KRPC message is a single dictionary with three keys common to
every message and additional keys depending on the type of message.
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 characters 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
outstanding queries. Every message also has a key "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.
error. A key "v" should be included in every message with a client version
string. The string should be a two character client identifier registered
in BEP 20 [#BEP-20]_ followed by a two character version identifier. Not all
implementations include a "v" key so clients should not assume its presence.

Contact Encoding
----------------
Expand Down Expand Up @@ -418,6 +421,9 @@ References
.. [#entropy] Use SHA1 and plenty of entropy to ensure a unique ID.
.. [#BEP-20] BEP_0020. Peer ID Conventions.
(http://www.bittorrent.org/beps/bep_0020.html)
Copyright
=========

Expand Down

0 comments on commit 6034458

Please sign in to comment.