Changeset 11183 for dotorg/trunk

Show
Ignore:
Timestamp:
10/15/09 19:42:35 (5 months ago)
Author:
bittorrent
Message:

updated html

Files:
1 modified

Legend:

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

    r11179 r11183  
    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">11178</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-15 21:57:32 +0000 (Thu, 15 Oct 2009)</a></td> 
     41<tr class="field"><th class="field-name">Version:</th><td class="field-body">11182</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-16 02:42:16 +0000 (Fri, 16 Oct 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</td> 
    5858</tr> 
    5959</tbody> 
     
    6363<p class="topic-title first">Contents</p> 
    6464<ul class="simple"> 
    65 <li><a class="reference internal" href="#abstract" id="id2">Abstract</a></li> 
    66 <li><a class="reference internal" href="#introduction" id="id3">Introduction</a></li> 
    67 <li><a class="reference internal" href="#operation" id="id4">Operation</a><ul> 
    68 <li><a class="reference internal" href="#single-protocol-nodes" id="id5">Single-protocol nodes</a></li> 
    69 <li><a class="reference internal" href="#double-stack-nodes" id="id6">Double-stack nodes</a><ul> 
    70 <li><a class="reference internal" href="#bootstrapping" id="id7">Bootstrapping</a></li> 
    71 <li><a class="reference internal" href="#stationary-operation" id="id8">Stationary operation</a></li> 
    72 </ul> 
    73 </li> 
    74 </ul> 
    75 </li> 
    76 <li><a class="reference internal" href="#changes-and-extensions-to-existing-messages" id="id9">Changes and extensions to existing messages</a><ul> 
    77 <li><a class="reference internal" href="#new-parameters" id="id10">New parameters</a><ul> 
    78 <li><a class="reference internal" href="#nodes6" id="id11">nodes6</a></li> 
    79 <li><a class="reference internal" href="#values6" id="id12">values6</a></li> 
    80 <li><a class="reference internal" href="#want" id="id13">want</a></li> 
    81 </ul> 
    82 </li> 
    83 <li><a class="reference internal" href="#changes-to-message-semantics" id="id14">Changes to message semantics</a><ul> 
    84 <li><a class="reference internal" href="#find-nodes-and-get-peers" id="id15">find_nodes and get_peers</a></li> 
    85 <li><a class="reference internal" href="#announce-peers" id="id16">announce_peers</a></li> 
    86 </ul> 
    87 </li> 
    88 </ul> 
    89 </li> 
    90 <li><a class="reference internal" href="#acknowledgements" id="id17">Acknowledgements</a></li> 
    91 <li><a class="reference internal" href="#references" id="id18">References</a></li> 
    92 <li><a class="reference internal" href="#copyright" id="id19">Copyright</a></li> 
     65<li><a class="reference internal" href="#abstract" id="id3">Abstract</a></li> 
     66<li><a class="reference internal" href="#introduction" id="id4">Introduction</a></li> 
     67<li><a class="reference internal" href="#operation" id="id5">Operation</a><ul> 
     68<li><a class="reference internal" href="#single-protocol-nodes" id="id6">Single-protocol nodes</a></li> 
     69<li><a class="reference internal" href="#double-stack-nodes" id="id7">Double-stack nodes</a><ul> 
     70<li><a class="reference internal" href="#bootstrapping" id="id8">Bootstrapping</a></li> 
     71<li><a class="reference internal" href="#steady-state-operation" id="id9">Steady-state operation</a></li> 
     72</ul> 
     73</li> 
     74</ul> 
     75</li> 
     76<li><a class="reference internal" href="#changes-and-extensions-to-existing-messages" id="id10">Changes and extensions to existing messages</a><ul> 
     77<li><a class="reference internal" href="#changes-to-existing-parameters" id="id11">Changes to existing parameters</a><ul> 
     78<li><a class="reference internal" href="#values" id="id12">values</a></li> 
     79</ul> 
     80</li> 
     81<li><a class="reference internal" href="#new-parameters" id="id13">New parameters</a><ul> 
     82<li><a class="reference internal" href="#nodes6" id="id14">nodes6</a></li> 
     83<li><a class="reference internal" href="#want" id="id15">want</a></li> 
     84</ul> 
     85</li> 
     86<li><a class="reference internal" href="#changes-to-message-semantics" id="id16">Changes to message semantics</a><ul> 
     87<li><a class="reference internal" href="#find-nodes-and-get-peers" id="id17">find_nodes and get_peers</a></li> 
     88<li><a class="reference internal" href="#announce-peers" id="id18">announce_peers</a></li> 
     89</ul> 
     90</li> 
     91</ul> 
     92</li> 
     93<li><a class="reference internal" href="#acknowledgements" id="id19">Acknowledgements</a></li> 
     94<li><a class="reference internal" href="#references" id="id20">References</a></li> 
     95<li><a class="reference internal" href="#copyright" id="id21">Copyright</a></li> 
    9396</ul> 
    9497</div> 
     
    97100<p>This proposal describes a set of extensions to the BitTorrent DHT <a class="footnote-reference" href="#bep-5" id="id1">[1]</a> 
    98101to allow operation over IPv6.</p> 
    99 <p><strong>This is a very early draft</strong>, and not suitable for implementation.  Yet.</p> 
     102<p><strong>This is a very early draft</strong>, and <strong>not suitable for implementation</strong>.  Yet.</p> 
    100103</div> 
    101104<div class="section" id="introduction"> 
     
    113116describes the procedures and message formats needed to deploy an IPv6 
    114117version of the BitTorrent DHT.</p> 
    115 <p>The extension described in this document also solves a long-standing issue 
    116 with the protocol defined in BEP-5, and does so without endangering 
    117 compatibility.  When a get_peers request is sent with an explicit request 
    118 for an address family, the presence of contact information in the reply is 
    119 no longer governed by the presence of a &quot;values&quot; key; this avoids the 
    120 well-known problem of contact information being masked by peer information.</p> 
     118<p>The extension described in this document also solves a long-standing 
     119issue with the protocol defined in BEP-5.  The presence of contact 
     120information in the reply is no longer governed by the presence of 
     121a &quot;values&quot; key; this avoids the well-known problem of contact 
     122information being masked by peer information.  While this is an 
     123incompatible change, it is believed to be properly handled by all 
     124deployed implementations.</p> 
    121125</div> 
    122126<div class="section" id="operation"> 
     
    126130IPv4 DHT, and, conversely, no IPv4 data is stored in the IPv6 DHT.  A node 
    127131wishing to participate in both DHTs must maintain two distinct routing 
    128 tables, one for IPv4 and one for IPv6.  A node may choose to use the same 
    129 node id in both tables, or distinct node ids.</p> 
    130 <p>Most KRPC messages have the same semantics when carried over IPv4 and IPv6. 
    131 In particular, no IPv6 addresses are ever carried in the existing &quot;nodes&quot; 
    132 and &quot;peers&quot; keys of KRPC messages -- instead, new keys &quot;nodes6&quot; and 
    133 &quot;peers6&quot; are defined.</p> 
     132tables, one for IPv4 and one for IPv6.</p> 
     133<p>While this is not strictly necessary, a node should use the same node 
     134id in both tables.  This simplifies implementation and debugging, and 
     135slightly increases efficiency in the case where the two DHTs are 
     136mostly congruent.</p> 
    134137<p>By default, messages only carry data in the address family implied by the 
    135138network layer protocol.  In the case of the &quot;nodes&quot; and &quot;nodes6&quot; arguments 
     
    140143<p>A single-protocol node (IPv4 or IPv6) only participates in one DHT.  Such 
    141144a node does not need to explicitly request data in a given family -- the 
    142 data provided by default is sufficient.</p> 
     145data provided by default is exactly what it needs.</p> 
    143146</div> 
    144147<div class="section" id="double-stack-nodes"> 
    145148<h2>Double-stack nodes</h2> 
    146149<p>While conceptually equivalent to a pair of single-protocol nodes, 
    147 a double-stack (IPv4 and IPv6) node can make use of a number of features of 
    148 the protocol to make its operation more efficient and to generally improve 
    149 the reliability of the DHT.</p> 
     150a double-stack (IPv4 and IPv6) node can make bootstrap faster and 
     151improve the reliability of the protocol by &quot;leaking&quot; data between the 
     152two DHTs, as described in the following paragraphs.</p> 
    150153<div class="section" id="bootstrapping"> 
    151154<h3>Bootstrapping</h3> 
     
    154157this process, it should request both &quot;nodes&quot; and &quot;nodes6&quot; fields.</p> 
    155158</div> 
    156 <div class="section" id="stationary-operation"> 
    157 <h3>Stationary operation</h3> 
    158 <p>Once bootstrap is successful, a node should not request data in both 
    159 address families; it should only request &quot;nodes&quot; replies from IPv4 nodes, 
    160 and &quot;nodes6&quot; replies from IPv6 nodes.  Requesting both address families is 
    161 unlikely to provide any useful information, and unnecessarily increases 
    162 network traffic.</p> 
     159<div class="section" id="steady-state-operation"> 
     160<h3>Steady-state operation</h3> 
     161<p>Once bootstrap is successful, a node should normally only request 
     162&quot;nodes&quot; replies from IPv4 nodes, and &quot;nodes6&quot; replies from IPv6 nodes. 
     163Requesting both address families in all requests is unlikely to 
     164provide useful information, and hence uselessly increases network 
     165traffic.</p> 
    163166<p>In order to increase the reliability of the DHT after a single-protocol 
    164 network outage, a node may <em>ocasionally</em> send a request for &quot;nodes&quot; to an 
    165 IPv6 node, or a request for &quot;nodes6&quot; to an IPv4 node.</p> 
     167network outage, however, a node may <em>ocasionally</em> send a request for 
     168&quot;nodes&quot; to an IPv6 node, or a request for &quot;nodes6&quot; to an IPv4 node.</p> 
    166169</div> 
    167170</div> 
     
    169172<div class="section" id="changes-and-extensions-to-existing-messages"> 
    170173<h1>Changes and extensions to existing messages</h1> 
     174<div class="section" id="changes-to-existing-parameters"> 
     175<h2>Changes to existing parameters</h2> 
     176<div class="section" id="values"> 
     177<h3>values</h3> 
     178<p>In a reply sent over IPv4, the &quot;values&quot; parameter contains a list of 
     179strings, each of which contains compact format IPv4 contact 
     180information for a single peer.</p> 
     181<p>In a reply sent over IPv6, &quot;values' contains a list of strings, each 
     182of which contains compact format IPv6 contact information for a single 
     183peer.</p> 
     184<p>Implementations of this specification must be able to properly parse 
     185hybrid &quot;values&quot; lists -- lists containing an arbitrary mixture of 
     1866-octet IPv4 values and 18-octet IPv6 values.  However, 
     187implementations should not send such hybrid lists, and must not send 
     188hybrid lists in a reply to an IPv4 request that doesn't contain 
     189a &quot;want&quot; parameter.</p> 
     190<blockquote> 
     191<strong>Rationale</strong>: a request sent over IPv4 with no &quot;want&quot; parameter 
     192could originate from a node that implements plain BEP-5, and which 
     193might therefore be unable to parse a hybrid list.</blockquote> 
     194</div> 
     195</div> 
    171196<div class="section" id="new-parameters"> 
    172197<h2>New parameters</h2> 
    173198<div class="section" id="nodes6"> 
    174199<h3>nodes6</h3> 
    175 <p>The &quot;nodes6&quot; parameter is allowed in replies to the find_nodes and 
    176 get_peers messages.  When present, it carries a string containing the 
    177 compact IPv6 node info for the 8 closest good nodes in the sending node's 
    178 IPv6 routing table.</p> 
    179 </div> 
    180 <div class="section" id="values6"> 
    181 <h3>values6</h3> 
    182 <p>The &quot;values6&quot; parameter is allowed in replies to the get_peers message 
    183 being sent over IPv6.  Its value is a list of strings, each of which 
    184 contains compact format IPv6 contact information for a single peer.</p> 
     200<p>The &quot;nodes6&quot; parameter is analogous to the existing &quot;nodes&quot; parameter: 
     201when present, it carries a string containing the compact IPv6 node 
     202info for the 8 closest good nodes in the sending node's IPv6 routing 
     203table.  This parameter is allowed in replies to the find_nodes and 
     204get_peers messages (see below).</p> 
    185205</div> 
    186206<div class="section" id="want"> 
     
    198218<p>For future extensibility, other characters may be present in the string, 
    199219and must be silently ignored on reception.</p> 
     220<blockquote> 
     221<strong>Note</strong>: the &quot;want&quot; parameter is currently under discussion.  It 
     222has been suggested that it should be renamed to &quot;flags&quot;, and that 
     223it should be a list of flags rather than a string.  This author 
     224is not convinced yet.</blockquote> 
    200225</div> 
    201226</div> 
     
    204229<div class="section" id="find-nodes-and-get-peers"> 
    205230<h3>find_nodes and get_peers</h3> 
    206 <p>A node sending a find_nodes or get_peers request should include a &quot;want&quot; 
    207 parameter containing one or both of the characters &quot;4&quot; or &quot;6&quot;.  A node 
    208 replying to a find_nodes or get_peers request must include a &quot;nodes&quot; 
    209 parameter if the request's &quot;want&quot; parameter included a &quot;4&quot;, and a &quot;nodes6&quot; 
    210 parameter if the request's &quot;want&quot; parameter included a &quot;6&quot;.</p> 
    211 <p>In the absence of a &quot;want&quot; parameter, the behaviour of the replying node is 
    212 more involved.  For a reply to a find_nodes request, the node should 
    213 include &quot;nodes&quot; if the request was sent over IPv4, and include &quot;nodes6&quot; if 
    214 the request was sent over IPv6.</p> 
    215 <p>For a get_peers request with no &quot;want&quot; parameter, value should only be 
    216 included if there is no &quot;values&quot; or &quot;values6&quot; parameter.  If no &quot;values&quot; or 
    217 &quot;values6&quot; parameter is being sent, the presence of &quot;nodes&quot; or &quot;nodes6&quot; is 
    218 governed by the network-layer protocol of the request, as above.</p> 
    219 <blockquote> 
    220 <strong>Rationale</strong>: it has been suggested that the reply to a get_peers 
    221 request should always include a &quot;nodes&quot; or &quot;nodes6&quot; parameter, 
    222 independently of the presence of a &quot;values&quot; or &quot;values6&quot; parameter. 
    223 While this is clearly a better semantics, it is not backward-compatible, 
    224 and it is not known whether it breaks any deployed implementations.</blockquote> 
    225 <p>When a node receives a get_peers request and it has contact information for 
    226 the matching address family and info-hash, it should include either 
    227 a &quot;values&quot; parameter (if the request was sent over IPv4) or a &quot;values6&quot; 
    228 parameter in the reply.</p> 
    229 <p>A reply sent over IPv4 must not contain a &quot;values6&quot; parameter, and a reply 
    230 sent over IPv6 must not contain a &quot;values&quot; parameter.  In other words, the 
    231 &quot;want&quot; parameter only governs the presence of the &quot;nodes&quot; and &quot;nodes6&quot; 
    232 parameters.</p> 
     231<p>A node sending a find_nodes or get_peers request should include 
     232a &quot;want&quot; parameter containing one or both of the characters &quot;4&quot; or 
     233&quot;6&quot;.  A node replying to a find_nodes or get_peers request should 
     234include a &quot;nodes&quot; parameter if and only if the request's &quot;want&quot; 
     235parameter included a &quot;4&quot;, and should include a &quot;nodes6&quot; parameter if 
     236and only if the request's &quot;want&quot; parameter included a &quot;6&quot;.</p> 
     237<p>In the absence of a &quot;want&quot; parameter, the reply should include &quot;nodes&quot; 
     238if the request was sent over IPv4, and should include &quot;nodes6&quot; if the 
     239request was sent over IPv6.</p> 
     240<blockquote> 
     241<strong>Rationale</strong>: this is an incompatible change to the protocol 
     242defined in BEP-5 <a class="footnote-reference" href="#bep-5" id="id2">[1]</a>, which specifies that &quot;nodes&quot; and 
     243&quot;values&quot; are mutually exclusive.  However, this change makes the DHT 
     244more reliable, and has been deployed by most implementations for 
     245over a year with no negative effects.</blockquote> 
     246<p>When a node receives a get_peers request and it has contact 
     247information for the matching address family and info-hash, it should 
     248additionally include a &quot;values&quot; parameter containing a list of 6-octet 
     249strings if the request was sent over IPv4, and a list of 18-octet 
     250strings if the request was sent over IPv6.</p> 
     251<p>A reply sent over IPv4 should not contain 18-octet IPv6 contact 
     252information, and a reply sent over IPv6 should not contain 6-octet 
     253IPv4 contact information.  In other words, the &quot;want&quot; parameter only 
     254governs the presence of the &quot;nodes&quot; and &quot;nodes6&quot; parameters, not the 
     255interpretation of &quot;values&quot;.</p> 
     256<blockquote> 
     257<strong>Rationale</strong>: if the requesting node is a single-stack node, it has 
     258no interest in values of the other address family.  If the 
     259requesting node is a double-stack node, then it must perform the two 
     260announces in parallel; providing both sets of data in both sets of 
     261replies merely increases the amount of traffic without giving any 
     262extra information.</blockquote> 
    233263</div> 
    234264<div class="section" id="announce-peers"> 
     
    243273<div class="section" id="acknowledgements"> 
    244274<h1>Acknowledgements</h1> 
    245 <p>I gratefully acknowledge the influence of <em>The 8472</em> over this work.</p> 
     275<p>I gratefully acknowledge the influence of <em>The 8472</em> and <em>arvid</em> over 
     276this work.</p> 
    246277</div> 
    247278<div class="section" id="references"> 
     
    250281<colgroup><col class="label" /><col /></colgroup> 
    251282<tbody valign="top"> 
    252 <tr><td class="label"><a class="fn-backref" href="#id1">[1]</a></td><td>BEP_0005.  DHT Protocol. 
     283<tr><td class="label">[1]</td><td><em>(<a class="fn-backref" href="#id1">1</a>, <a class="fn-backref" href="#id2">2</a>)</em> BEP_0005.  DHT Protocol. 
    253284(<a class="reference external" href="http://www.bittorrent.org/beps/bep_0005.html">http://www.bittorrent.org/beps/bep_0005.html</a>)</td></tr> 
    254285</tbody>