Changeset 11184 for dotorg/trunk

Show
Ignore:
Timestamp:
10/29/09 16:46:10 (5 months ago)
Author:
bittorrent
Message:

updated bep32

Files:
1 modified

Legend:

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

    r11182 r11184  
    1 BEP: 32 
     1BEP: XXX 
    22Title: BitTorrent DHT Extensions for IPv6 
    33Version: $Revision$ 
     
    99Content-Type: text/x-rst 
    1010Created: 14-Oct-2009 
    11 Post-History: 15-Oct-2009: Promote same ID in IPv6 and IPv4 nodes. Drop values6. Added some rationales 
     11Post-History:  
    1212 
    1313 
     
    1717This proposal describes a set of extensions to the BitTorrent DHT [#BEP-5]_ 
    1818to allow operation over IPv6. 
    19  
    20 **This is a very early draft**, and **not suitable for implementation**.  Yet. 
    2119 
    2220 
     
    7674 
    7775 
    78 Double-stack nodes 
    79 ------------------ 
     76Dual-stack nodes 
     77---------------- 
    8078 
    8179While conceptually equivalent to a pair of single-protocol nodes, 
    82 a double-stack (IPv4 and IPv6) node can make bootstrap faster and 
     80a dual-stack (IPv4 and IPv6) node can make bootstrap faster and 
    8381improve the reliability of the protocol by "leaking" data between the 
    8482two DHTs, as described in the following paragraphs. 
     
    8886''''''''''''' 
    8987 
    90 A double-stack node that is bootstrapping its DHT will send find_nodes 
     88A dual-stack node that is bootstrapping its DHT will send find_nodes 
    9189requests in order to populate its routing tables.  In order to accelerate 
    9290this process, it should request both "nodes" and "nodes6" fields. 
     
    105103network outage, however, a node may *ocasionally* send a request for 
    106104"nodes" to an IPv6 node, or a request for "nodes6" to an IPv4 node. 
     105 
     106 
     107Maximum packet size 
     108------------------- 
     109 
     110A node obeying this specification must not send UDP datagrams with 
     111a payload larger than 1024 octets, and must be able to receive UDP 
     112datagrams with a payload of 1024 octets or less.  (In the interest of 
     113robustness, a node should be able to receive datagrams with larger 
     114payloads.) 
     115 
     116  **Rationale**: a UDP datagram with a payload of 1024 octets easily 
     117  fits within the IPv6 minimum maximum packet size, which is 1280 
     118  octets [#IPv6]_.  In particular, such a packet will cross a Teredo 
     119  tunnel with no fragmentation. 
     120 
     121  In principle, IPv4 nodes might be unable to reassemble packets 
     122  larger than 576 octets [#IPv4]_; in practice, however, due to the 
     123  predominance of Ethernet networks, all IPv4 nodes are able to 
     124  reassemble packets up to 1500 octets. 
     125 
     126 
     127Source address selection 
     128------------------------ 
     129 
     130The IPv6 DHT should use a socket bound to one of the host's global 
     131unicast IPv6 addresses rather than the "unspecified address" (::/128). 
     132When selecting to which address to bind, Teredo addresses (addresses 
     133in 2001:0000::/32) should be avoided if other global unicast addresses 
     134are available. 
     135 
     136  **Rationale**: The DHT relies on the publicly visible IP address of 
     137  each node to remain constant.  Since multi-homing is common in IPv6, 
     138  it is particularly important to bind the IPv6 socket to a well-defined 
     139  address. 
     140 
     141  While Teredo traffic can, in principle, be more efficient than 
     142  native traffic, especially when speaking to other Teredo hosts, 
     143  experience shows that Teredo routing tends to be brittle; hence, 
     144  Teredo addresses should be avoided whenever possible. 
     145 
     146  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 
     148  the issues are somewhat more complicated, so this specification 
     149  refrains from making any recommendations about binding of IPv4 
     150  sockets. 
     151 
     152 
     153Changes to the BitTorrent protocol 
     154================================== 
     155 
     156The PORT message, as defined in BEP-5, is extended to work over both 
     157IPv4 and IPv6.  The information provided by the PORT message only 
     158applies to the address family it is carried over: a PORT message sent 
     159over IPv4 only advertises participation in the IPv4 DHT, and a PORT 
     160message sent over IPv6 only advertises participation in the IPv6 DHT. 
     161 
     162  **Rationale**: in the presence of the LTEP extension negotiation 
     163  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 
    107170 
    108171 
     
    154217The "want" parameter is allowed in the find_nodes and get_peers requests, 
    155218and governs the presence or absence of the "nodes" and "nodes6" parameters 
    156 in the requested reply.  Its value is a string of one or more characters, 
    157 which may include 
    158  
    159   * "4": the node requests the presence of a "nodes" key; 
    160  
    161   * "6": the node requests the presence of a "nodes6" key. 
    162  
    163 For future extensibility, other characters may be present in the string, 
     219in the requested reply.  Its value is a list of one or more strings, which 
     220may include 
     221 
     222  * "n4": the node requests the presence of a "nodes" key; 
     223 
     224  * "n6": the node requests the presence of a "nodes6" key. 
     225 
     226For future extensibility, other strings may be present in the list, 
    164227and must be silently ignored on reception. 
    165228 
    166    **Note**: the "want" parameter is currently under discussion.  It 
    167    has been suggested that it should be renamed to "flags", and that 
    168    it should be a list of flags rather than a string.  This author 
    169    is not convinced yet. 
     229   **Rationale**: the "want" parameter is not intended to carry random 
     230   sundry flags, which can simply be included in the top-level 
     231   dictionary of the message.  Extending the "want" parameter without 
     232   good reason is discouraged. 
    170233 
    171234 
     
    188251 
    189252  **Rationale**: this is an incompatible change to the protocol 
    190   defined in BEP-5 [#BEP-5]_, which specifies that "nodes" and 
    191   "values" are mutually exclusive.  However, this change makes the DHT 
    192   more reliable, and has been deployed by most implementations for 
    193   over a year with no negative effects. 
     253  defined in BEP-5, which specifies that "nodes" and "values" are 
     254  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. 
    194257 
    195258When a node receives a get_peers request and it has contact 
     
    207270  **Rationale**: if the requesting node is a single-stack node, it has 
    208271  no interest in values of the other address family.  If the 
    209   requesting node is a double-stack node, then it must perform the two 
     272  requesting node is a dual-stack node, then it must perform the two 
    210273  announces in parallel; providing both sets of data in both sets of 
    211274  replies merely increases the amount of traffic without giving any 
     
    235298   (http://www.bittorrent.org/beps/bep_0005.html) 
    236299 
     300.. [#BEP-10] BEP_0010.  Extension Protocol. 
     301   (http://www.bittorrent.org/beps/bep_0010.html) 
     302 
     303.. [#IPv6] RFC 2460.  Internet Protocol, Version 6 (IPv6) Specification. 
     304   S. Deering, R. Hinden. December 1998. 
     305 
     306.. [#IPv4] RFC 791.  Internet Protocol.  J. Postel.  September 1981. 
    237307 
    238308 
     
    240310========= 
    241311 
    242 This document has been placed in the public domain. 
     312This document is in the public domain. 
    243313 
    244314