Changeset 11188


Ignore:
Timestamp:
11/20/09 09:16:55 (8 months ago)
Author:
bittorrent
Message:

updated bep32 html

File:
1 edited

Legend:

Unmodified
Added
Removed
  • dotorg/trunk/html/beps/bep_0032.html

    r11186 r11188  
    3939<tr class="field"><th class="field-name">Title:</th><td class="field-body">BitTorrent DHT Extensions for IPv6</td> 
    4040</tr> 
    41 <tr class="field"><th class="field-name">Version:</th><td class="field-body">11185</td> 
    42 </tr> 
    43 <tr class="field"><th class="field-name">Last-Modified:</th><td class="field-body"><a class="reference external" href="http://bittorrent.org/trac/browser/dotorg/trunk/html/beps/bep_0032.rst">2009-10-29 23:46:53 +0000 (Thu, 29 Oct 2009)</a></td> 
     41<tr class="field"><th class="field-name">Version:</th><td class="field-body">11187</td> 
     42</tr> 
     43<tr class="field"><th class="field-name">Last-Modified:</th><td class="field-body"><a class="reference external" href="http://bittorrent.org/trac/browser/dotorg/trunk/html/beps/bep_0032.rst">2009-11-20 17:16:34 +0000 (Fri, 20 Nov 2009)</a></td> 
    4444</tr> 
    4545<tr class="field"><th class="field-name">Author:</th><td class="field-body">Juliusz Chroboczek &lt;jch&#32;&#97;t&#32;pps.jussieu.fr&gt;</td> 
     
    5555<tr class="field"><th class="field-name">Created:</th><td class="field-body">14-Oct-2009</td> 
    5656</tr> 
    57 <tr class="field"><th class="field-name">Post-History:</th><td class="field-body"></td> 
     57<tr class="field"><th class="field-name">Post-History:</th><td class="field-body">15-Oct-2009: Promote same ID in IPv6 and IPv4 nodes. Drop values6. Added some rationales 
     5811-Nov-2011: Change want to be a list of flags.  Add nodes about MTU and source address selection.  Define behaviour of PORT message.</td> 
    5859</tr> 
    5960</tbody> 
     
    101102<div class="section" id="abstract"> 
    102103<h1>Abstract</h1> 
    103 <p>This proposal describes a set of extensions to the BitTorrent DHT <a class="footnote-reference" href="#bep-5" id="id1">[1]</a> 
    104 to allow operation over IPv6.</p> 
     104<p>This document describes a set of extensions to the BitTorrent DHT 
     105<a class="footnote-reference" href="#bep-5" id="id1">[1]</a> to allow operation over IPv6.</p> 
    105106</div> 
    106107<div class="section" id="introduction"> 
     
    112113deploy BitTorrent over the IPv6 protocol, which does not suffer from 
    113114address exhaustion.</p> 
    114 <p>A number of extensions (mostly undocumented) to the BitTorrent protocol 
    115 have been defined in order to allow it to operate over IPv6. 
    116 Unfortunately, these extensions only allow locating IPv6 peers by using 
    117 trackers or through peer exchange -- but not from the DHT.  This document 
    118 describes the procedures and message formats needed to deploy an IPv6 
    119 version of the BitTorrent DHT.</p> 
    120 <p>The extension described in this document also solves a long-standing 
    121 issue with the protocol defined in BEP-5.  The presence of contact 
    122 information in the reply is no longer governed by the presence of 
    123 a &quot;values&quot; key; this avoids the well-known problem of contact 
    124 information being masked by peer information.  While this is an 
    125 incompatible change, it is believed to be properly handled by all 
    126 deployed implementations.</p> 
     115<p>A number of extensions (mostly undocumented) to the BitTorrent 
     116protocol have been defined in order to allow it to operate over IPv6. 
     117Unfortunately, these extensions only allow locating IPv6 peers by 
     118using trackers or through peer exchange -- but not from the DHT.  This 
     119document describes the procedures and message formats used in the IPv6 
     120DHT.</p> 
    127121</div> 
    128122<div class="section" id="operation"> 
    129123<h1>Operation</h1> 
    130 <p>There are two distinct DHTs: the existing IPv4 DHT, and the new IPv6 DHT.</p> 
     124<p>There are two distinct DHTs: the IPv4 DHT, and the IPv6 DHT.</p> 
    131125<p>The two DHTs are independent, meaning that no IPv6 data is stored in the 
    132126IPv4 DHT, and, conversely, no IPv4 data is stored in the IPv6 DHT.  A node 
     
    137131slightly increases efficiency in the case where the two DHTs are 
    138132mostly congruent.</p> 
    139 <p>By default, messages only carry data in the address family implied by the 
    140 network layer protocol.  In the case of the &quot;nodes&quot; and &quot;nodes6&quot; arguments 
    141 in replies to the find_nodes and get_peers requests, however, the requestor 
    142 may request that the reply contain &quot;nodes&quot;, &quot;nodes6&quot; or both fields.</p> 
     133<p>Usually, messages only carry data in the address family implied by the 
     134network layer protocol.  In the case of the find_nodes and get_peers 
     135requests, however, the requestor may optionally request that the reply 
     136should contain IPv4 node information, IPv6 node information, or both.</p> 
    143137<div class="section" id="single-protocol-nodes"> 
    144138<h2>Single-protocol nodes</h2> 
     
    152146a dual-stack (IPv4 and IPv6) node can make bootstrap faster and 
    153147improve the reliability of the protocol by &quot;leaking&quot; data between the 
    154 two DHTs, as described in the following paragraphs.</p> 
     148two DHTs, as described in the following sections.</p> 
    155149<div class="section" id="bootstrapping"> 
    156150<h3>Bootstrapping</h3> 
    157151<p>A dual-stack node that is bootstrapping its DHT will send find_nodes 
    158152requests in order to populate its routing tables.  In order to accelerate 
    159 this process, it should request both &quot;nodes&quot; and &quot;nodes6&quot; fields.</p> 
     153this process, it should request both IPv4 and IPv6 node information.</p> 
    160154</div> 
    161155<div class="section" id="steady-state-operation"> 
    162156<h3>Steady-state operation</h3> 
    163 <p>Once bootstrap is successful, a node should normally only request 
    164 &quot;nodes&quot; replies from IPv4 nodes, and &quot;nodes6&quot; replies from IPv6 nodes. 
    165 Requesting both address families in all requests is unlikely to 
    166 provide useful information, and hence uselessly increases network 
    167 traffic.</p> 
     157<p>Once bootstrap is successful, a node should normally only request IPv4 
     158node information from IPv4 nodes, and IPv6 node information from IPv6 
     159nodes.  Requesting node information for both address families in all 
     160requests is unlikely to provide useful information, and hence 
     161increases network traffic with no benefit.</p> 
    168162<p>In order to increase the reliability of the DHT after a single-protocol 
    169163network outage, however, a node may <em>ocasionally</em> send a request for 
    170 &quot;nodes&quot; to an IPv6 node, or a request for &quot;nodes6&quot; to an IPv4 node.</p> 
     164IPv4 node information to an IPv6 node, or a request for IPv6 node 
     165information to an IPv4 node.</p> 
    171166</div> 
    172167</div> 
     
    206201Teredo addresses should be avoided whenever possible.</p> 
    207202<p>The same issues apply to multi-homed IPv4 hosts.  However, in IPv4 
    208 multi-homing is not as common in IPv6, and in the presence of NAT 
     203multi-homing is not as common as in IPv6, and in the presence of NAT 
    209204the issues are somewhat more complicated, so this specification 
    210205refrains from making any recommendations about binding of IPv4 
     
    217212<p>The PORT message, as defined in BEP-5, is extended to work over both 
    218213IPv4 and IPv6.  The information provided by the PORT message only 
    219 applies to the address family it is carried over: a PORT message sent 
    220 over IPv4 only advertises participation in the IPv4 DHT, and a PORT 
    221 message sent over IPv6 only advertises participation in the IPv6 DHT.</p> 
     214applies to the address it was sent from; this implies that a PORT 
     215message sent over IPv4 only advertises participation in the IPv4 DHT, 
     216and a PORT message sent over IPv6 only advertises participation in the 
     217IPv6 DHT.</p> 
     218<p>Multihomed hosts should take care to only send PORT messages over 
     219connections established from the address on which they participate in 
     220the DHT.</p> 
    222221<blockquote> 
    223222<strong>Rationale</strong>: in the presence of the LTEP extension negotiation 
    224223protocol <a class="footnote-reference" href="#bep-10" id="id4">[2]</a>, which advertises a peer's addresses across 
    225 address families, it might be possible to use the PORT message for 
    226 both address families.  However, since an implementation need not 
    227 participate in both DHTs, nor use the same port in both DHTs, this 
    228 specification leaves the role of bridging the two DHTs to the 
    229 'find_nodes' message (see below).</blockquote> 
     224address families, it would in principle be possible to use the PORT 
     225message for both address families.  However, since an implementation 
     226need not participate in both DHTs, nor use the same port in both 
     227DHTs, this specification leaves the role of bridging the two DHTs to 
     228the 'find_nodes' message (see below).</blockquote> 
    230229</div> 
    231230<div class="section" id="changes-and-extensions-to-existing-messages"> 
     
    238237strings, each of which contains compact format IPv4 contact 
    239238information for a single peer.</p> 
    240 <p>In a reply sent over IPv6, &quot;values' contains a list of strings, each 
     239<p>In a reply sent over IPv6, &quot;values&quot; contains a list of strings, each 
    241240of which contains compact format IPv6 contact information for a single 
    242241peer.</p> 
    243242<p>Implementations of this specification must be able to properly parse 
    244243hybrid &quot;values&quot; lists -- lists containing an arbitrary mixture of 
    245 6-octet IPv4 values and 18-octet IPv6 values.  However, 
    246 implementations should not send such hybrid lists, and must not send 
    247 hybrid lists in a reply to an IPv4 request that doesn't contain 
    248 a &quot;want&quot; parameter.</p> 
     2446-octet IPv4 values and 18-octet IPv6 values.  However, implementations 
     245should not send such hybrid lists, and must not send hybrid lists in 
     246a reply to an IPv4 request that doesn't contain a &quot;want&quot; parameter.</p> 
    249247<blockquote> 
    250248<strong>Rationale</strong>: a request sent over IPv4 with no &quot;want&quot; parameter 
     
    257255<div class="section" id="nodes6"> 
    258256<h3>nodes6</h3> 
    259 <p>The &quot;nodes6&quot; parameter is analogous to the existing &quot;nodes&quot; parameter: 
    260 when present, it carries a string containing the compact IPv6 node 
    261 info for the 8 closest good nodes in the sending node's IPv6 routing 
    262 table.  This parameter is allowed in replies to the find_nodes and 
    263 get_peers messages (see below).</p> 
     257<p>The &quot;nodes6&quot; parameter is analogous to the &quot;nodes&quot; parameter: when 
     258present, it carries a string containing the compact IPv6 node 
     259information for the 8 closest good nodes in the sending node's IPv6 
     260routing table.  This parameter is allowed in replies to the find_nodes 
     261and get_peers messages (see below).</p> 
    264262</div> 
    265263<div class="section" id="want"> 
     
    281279sundry flags, which can simply be included in the top-level 
    282280dictionary of the message.  Extending the &quot;want&quot; parameter without 
    283 good reason is discouraged.</blockquote> 
     281good reason is not recommended.</blockquote> 
    284282</div> 
    285283</div> 
     
    288286<div class="section" id="find-nodes-and-get-peers"> 
    289287<h3>find_nodes and get_peers</h3> 
    290 <p>A node sending a find_nodes or get_peers request should include 
    291 a &quot;want&quot; parameter containing one or both of the characters &quot;4&quot; or 
    292 &quot;6&quot;.  A node replying to a find_nodes or get_peers request should 
    293 include a &quot;nodes&quot; parameter if and only if the request's &quot;want&quot; 
    294 parameter included a &quot;4&quot;, and should include a &quot;nodes6&quot; parameter if 
    295 and only if the request's &quot;want&quot; parameter included a &quot;6&quot;.</p> 
     288<p>A node sending a find_nodes or get_peers request may include a &quot;want&quot; 
     289parameter containing one or both of the strings &quot;n4&quot; or &quot;n6&quot;.  A node 
     290replying to a find_nodes or get_peers request that includes a &quot;want&quot; 
     291parameter should include a &quot;nodes&quot; parameter if the request's &quot;want&quot; 
     292parameter contained the string &quot;n4&quot;, and should include a &quot;nodes6&quot; 
     293parameter if the request's &quot;want&quot; parameter contained the string &quot;n6&quot;.</p> 
    296294<p>In the absence of a &quot;want&quot; parameter, the reply should include &quot;nodes&quot; 
    297295if the request was sent over IPv4, and should include &quot;nodes6&quot; if the 
     
    301299defined in BEP-5, which specifies that &quot;nodes&quot; and &quot;values&quot; are 
    302300mutually exclusive.  However, this change makes the DHT more 
    303 reliable, and has been deployed by most implementations for over 
    304 a year with no negative effects.</blockquote> 
    305 <p>When a node receives a get_peers request and it has contact 
     301reliable, and has been deployed by most implementations with no 
     302negative effects.</blockquote> 
     303<p>When a node receives a get_peers request and it has peer contact 
    306304information for the matching address family and info-hash, it should 
    307305additionally include a &quot;values&quot; parameter containing a list of 6-octet 
     
    332330<div class="section" id="acknowledgements"> 
    333331<h1>Acknowledgements</h1> 
    334 <p>I gratefully acknowledge the influence of <em>The 8472</em> and <em>arvid</em> over 
    335 this work.</p> 
     332<p>I gratefully acknowledge the help of <em>The 8472</em> and <em>arvid</em> in 
     333developing this specification.</p> 
    336334</div> 
    337335<div class="section" id="references"> 
Note: See TracChangeset for help on using the changeset viewer.