2006-09-23 23:24:28 +02:00
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
< html xmlns = "http://www.w3.org/1999/xhtml" xml:lang = "en" lang = "en" >
< head >
< meta http-equiv = "Content-Type" content = "text/html; charset=utf-8" / >
2006-11-28 19:18:37 +01:00
< meta name = "generator" content = "Docutils 0.5: http://docutils.sourceforge.net/" / >
2006-09-23 23:24:28 +02:00
< title > < / title >
< meta name = "author" content = "Arvid Norberg, arvid@rasterbar.com" / >
< link rel = "stylesheet" href = "style.css" type = "text/css" / >
< / head >
< body >
< div class = "document" >
2006-11-28 19:18:37 +01:00
2006-09-23 23:24:28 +02:00
< table class = "docinfo" frame = "void" rules = "none" >
< col class = "docinfo-name" / >
< col class = "docinfo-content" / >
< tbody valign = "top" >
< tr > < th class = "docinfo-name" > Author:< / th >
< td > Arvid Norberg, < a class = "last reference" href = "mailto:arvid@rasterbar.com" > arvid@ rasterbar.com< / a > < / td > < / tr >
< / tbody >
< / table >
2007-03-08 22:42:37 +01:00
< div class = "section" id = "mainline-dht-extensions" >
< h1 > Mainline DHT extensions< / h1 >
2006-09-23 23:24:28 +02:00
< p > libtorrent implements a few extensions to the Mainline DHT protocol.< / p >
2007-03-08 22:42:37 +01:00
< div class = "section" id = "client-identification" >
< h2 > client identification< / h2 >
2006-09-23 23:24:28 +02:00
< p > In each DHT packet, an extra key is inserted named " v" . This is a string
describing the client and version used. This can help alot when debugging
and finding errors in client implementations. The string is encoded as four
characters, two characters describing the client and two characters interpreted
as a binary number describing the client version.< / p >
< p > Currently known clients:< / p >
< table border = "1" class = "docutils" >
< colgroup >
< col width = "65%" / >
< col width = "35%" / >
< / colgroup >
< tbody valign = "top" >
< tr > < td > uTorrent< / td >
< td > < tt class = "docutils literal" > < span class = "pre" > UT< / span > < / tt > < / td >
< / tr >
< tr > < td > libtorrent< / td >
< td > < tt class = "docutils literal" > < span class = "pre" > LT< / span > < / tt > < / td >
< / tr >
< tr > < td > MooPolice< / td >
< td > < tt class = "docutils literal" > < span class = "pre" > MP< / span > < / tt > < / td >
< / tr >
< tr > < td > GetRight< / td >
< td > < tt class = "docutils literal" > < span class = "pre" > GR< / span > < / tt > < / td >
< / tr >
< / tbody >
< / table >
< / div >
2007-03-08 22:42:37 +01:00
< div class = "section" id = "ipv6-support" >
< h2 > IPv6 support< / h2 >
< p > The DHT messages that don't support IPv6 are the < tt class = "docutils literal" > < span class = "pre" > nodes< / span > < / tt > replies.
They encode all the contacts as 6 bytes packed together in sequence in a
2006-09-23 23:24:28 +02:00
string. The problem is that IPv6 endpoints cannot be encoded as 6 bytes, but
needs 18 bytes. The extension libtorrent applies is to add another key, called
2007-03-08 22:42:37 +01:00
< tt class = "docutils literal" > < span class = "pre" > nodes2< / span > < / tt > .< / p >
< p > < tt class = "docutils literal" > < span class = "pre" > nodes2< / span > < / tt > may be present in replies that contains a < tt class = "docutils literal" > < span class = "pre" > nodes< / span > < / tt > key. It is encoded
as a list of strings. Each string represents one contact and is encoded as 20
bytes node-id and then a variable length encoded IP address (6 bytes in IPv4 case
and 18 bytes in IPv6 case).< / p >
< p > As an optimization, libtorrent does not include the extra key in case there are
only IPv4 nodes present.< / p >
2006-09-23 23:24:28 +02:00
< / div >
< / div >
< / div >
< / body >
< / html >