Changeset 11187 for dotorg

Show
Ignore:
Timestamp:
11/20/09 09:16:34 (4 months ago)
Author:
bittorrent
Message:

updated bep32

Files:
1 modified

Legend:

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

    r11185 r11187  
    99Content-Type: text/x-rst 
    1010Created: 14-Oct-2009 
    11 Post-History:  
     11Post-History: 15-Oct-2009: Promote same ID in IPv6 and IPv4 nodes. Drop values6. Added some rationales 
     12              11-Nov-2011: Change want to be a list of flags.  Add nodes about MTU and source address selection.  Define behaviour of PORT message. 
    1213 
    1314 
     
    1516======== 
    1617 
    17 This proposal describes a set of extensions to the BitTorrent DHT [#BEP-5]_ 
    18 to allow operation over IPv6. 
     18This document describes a set of extensions to the BitTorrent DHT 
     19[#BEP-5]_ to allow operation over IPv6. 
    1920 
    2021 
     
    2930address exhaustion. 
    3031 
    31 A number of extensions (mostly undocumented) to the BitTorrent protocol 
    32 have been defined in order to allow it to operate over IPv6. 
    33 Unfortunately, these extensions only allow locating IPv6 peers by using 
    34 trackers or through peer exchange -- but not from the DHT.  This document 
    35 describes the procedures and message formats needed to deploy an IPv6 
    36 version of the BitTorrent DHT. 
    37  
    38 The extension described in this document also solves a long-standing 
    39 issue with the protocol defined in BEP-5.  The presence of contact 
    40 information in the reply is no longer governed by the presence of 
    41 a "values" key; this avoids the well-known problem of contact 
    42 information being masked by peer information.  While this is an 
    43 incompatible change, it is believed to be properly handled by all 
    44 deployed implementations. 
     32A number of extensions (mostly undocumented) to the BitTorrent 
     33protocol have been defined in order to allow it to operate over IPv6. 
     34Unfortunately, these extensions only allow locating IPv6 peers by 
     35using trackers or through peer exchange -- but not from the DHT.  This 
     36document describes the procedures and message formats used in the IPv6 
     37DHT. 
    4538 
    4639 
     
    4841========= 
    4942 
    50 There are two distinct DHTs: the existing IPv4 DHT, and the new IPv6 DHT. 
     43There are two distinct DHTs: the IPv4 DHT, and the IPv6 DHT. 
    5144 
    5245The two DHTs are independent, meaning that no IPv6 data is stored in the 
     
    6053mostly congruent. 
    6154 
    62 By default, messages only carry data in the address family implied by the 
    63 network layer protocol.  In the case of the "nodes" and "nodes6" arguments 
    64 in replies to the find_nodes and get_peers requests, however, the requestor 
    65 may request that the reply contain "nodes", "nodes6" or both fields. 
     55Usually, messages only carry data in the address family implied by the 
     56network layer protocol.  In the case of the find_nodes and get_peers 
     57requests, however, the requestor may optionally request that the reply 
     58should contain IPv4 node information, IPv6 node information, or both. 
    6659 
    6760 
     
    8073a dual-stack (IPv4 and IPv6) node can make bootstrap faster and 
    8174improve the reliability of the protocol by "leaking" data between the 
    82 two DHTs, as described in the following paragraphs. 
     75two DHTs, as described in the following sections. 
    8376 
    8477 
     
    8881A dual-stack node that is bootstrapping its DHT will send find_nodes 
    8982requests in order to populate its routing tables.  In order to accelerate 
    90 this process, it should request both "nodes" and "nodes6" fields. 
     83this process, it should request both IPv4 and IPv6 node information. 
    9184 
    9285 
     
    9487'''''''''''''''''''''' 
    9588 
    96 Once bootstrap is successful, a node should normally only request 
    97 "nodes" replies from IPv4 nodes, and "nodes6" replies from IPv6 nodes. 
    98 Requesting both address families in all requests is unlikely to 
    99 provide useful information, and hence uselessly increases network 
    100 traffic. 
     89Once bootstrap is successful, a node should normally only request IPv4 
     90node information from IPv4 nodes, and IPv6 node information from IPv6 
     91nodes.  Requesting node information for both address families in all 
     92requests is unlikely to provide useful information, and hence 
     93increases network traffic with no benefit. 
    10194 
    10295In order to increase the reliability of the DHT after a single-protocol 
    10396network outage, however, a node may *ocasionally* send a request for 
    104 "nodes" to an IPv6 node, or a request for "nodes6" to an IPv4 node. 
     97IPv4 node information to an IPv6 node, or a request for IPv6 node 
     98information to an IPv4 node. 
    10599 
    106100 
     
    145139 
    146140  The same issues apply to multi-homed IPv4 hosts.  However, in IPv4 
    147   multi-homing is not as common in IPv6, and in the presence of NAT 
     141  multi-homing is not as common as in IPv6, and in the presence of NAT 
    148142  the issues are somewhat more complicated, so this specification 
    149143  refrains from making any recommendations about binding of IPv4 
     
    156150The PORT message, as defined in BEP-5, is extended to work over both 
    157151IPv4 and IPv6.  The information provided by the PORT message only 
    158 applies to the address family it is carried over: a PORT message sent 
    159 over IPv4 only advertises participation in the IPv4 DHT, and a PORT 
    160 message sent over IPv6 only advertises participation in the IPv6 DHT. 
     152applies to the address it was sent from; this implies that a PORT 
     153message sent over IPv4 only advertises participation in the IPv4 DHT, 
     154and a PORT message sent over IPv6 only advertises participation in the 
     155IPv6 DHT. 
     156 
     157Multihomed hosts should take care to only send PORT messages over 
     158connections established from the address on which they participate in 
     159the DHT. 
    161160 
    162161  **Rationale**: in the presence of the LTEP extension negotiation 
    163162  protocol [#BEP-10]_, which advertises a peer's addresses across 
    164   address families, it might be possible to use the PORT message for 
    165   both address families.  However, since an implementation need not 
    166   participate in both DHTs, nor use the same port in both DHTs, this 
    167   specification leaves the role of bridging the two DHTs to the 
    168   'find_nodes' message (see below). 
    169  
     163  address families, it would in principle be possible to use the PORT 
     164  message for both address families.  However, since an implementation 
     165  need not participate in both DHTs, nor use the same port in both 
     166  DHTs, this specification leaves the role of bridging the two DHTs to 
     167  the 'find_nodes' message (see below). 
    170168 
    171169 
     
    183181information for a single peer. 
    184182 
    185 In a reply sent over IPv6, "values' contains a list of strings, each 
     183In a reply sent over IPv6, "values" contains a list of strings, each 
    186184of which contains compact format IPv6 contact information for a single 
    187185peer. 
     
    189187Implementations of this specification must be able to properly parse 
    190188hybrid "values" lists -- lists containing an arbitrary mixture of 
    191 6-octet IPv4 values and 18-octet IPv6 values.  However, 
    192 implementations should not send such hybrid lists, and must not send 
    193 hybrid lists in a reply to an IPv4 request that doesn't contain 
    194 a "want" parameter. 
     1896-octet IPv4 values and 18-octet IPv6 values.  However, implementations 
     190should not send such hybrid lists, and must not send hybrid lists in 
     191a reply to an IPv4 request that doesn't contain a "want" parameter. 
    195192 
    196193  **Rationale**: a request sent over IPv4 with no "want" parameter 
     
    205202'''''' 
    206203 
    207 The "nodes6" parameter is analogous to the existing "nodes" parameter: 
    208 when present, it carries a string containing the compact IPv6 node 
    209 info for the 8 closest good nodes in the sending node's IPv6 routing 
    210 table.  This parameter is allowed in replies to the find_nodes and 
    211 get_peers messages (see below). 
     204The "nodes6" parameter is analogous to the "nodes" parameter: when 
     205present, it carries a string containing the compact IPv6 node 
     206information for the 8 closest good nodes in the sending node's IPv6 
     207routing table.  This parameter is allowed in replies to the find_nodes 
     208and get_peers messages (see below). 
    212209 
    213210 
     
    230227   sundry flags, which can simply be included in the top-level 
    231228   dictionary of the message.  Extending the "want" parameter without 
    232    good reason is discouraged. 
     229   good reason is not recommended. 
    233230 
    234231 
     
    239236'''''''''''''''''''''''' 
    240237 
    241 A node sending a find_nodes or get_peers request should include 
    242 a "want" parameter containing one or both of the characters "4" or 
    243 "6".  A node replying to a find_nodes or get_peers request should 
    244 include a "nodes" parameter if and only if the request's "want" 
    245 parameter included a "4", and should include a "nodes6" parameter if 
    246 and only if the request's "want" parameter included a "6". 
     238A node sending a find_nodes or get_peers request may include a "want" 
     239parameter containing one or both of the strings "n4" or "n6".  A node 
     240replying to a find_nodes or get_peers request that includes a "want" 
     241parameter should include a "nodes" parameter if the request's "want" 
     242parameter contained the string "n4", and should include a "nodes6" 
     243parameter if the request's "want" parameter contained the string "n6". 
    247244 
    248245In the absence of a "want" parameter, the reply should include "nodes" 
     
    253250  defined in BEP-5, which specifies that "nodes" and "values" are 
    254251  mutually exclusive.  However, this change makes the DHT more 
    255   reliable, and has been deployed by most implementations for over 
    256   a year with no negative effects. 
    257  
    258 When a node receives a get_peers request and it has contact 
     252  reliable, and has been deployed by most implementations with no 
     253  negative effects. 
     254 
     255When a node receives a get_peers request and it has peer contact 
    259256information for the matching address family and info-hash, it should 
    260257additionally include a "values" parameter containing a list of 6-octet 
     
    288285================ 
    289286 
    290 I gratefully acknowledge the influence of *The 8472* and *arvid* over 
    291 this work. 
     287I gratefully acknowledge the help of *The 8472* and *arvid* in 
     288developing this specification. 
    292289 
    293290