Changeset 11187 for dotorg/trunk
- Timestamp:
- 11/20/09 09:16:34 (4 months ago)
- Files:
-
- 1 modified
-
dotorg/trunk/html/beps/bep_0032.rst (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dotorg/trunk/html/beps/bep_0032.rst
r11185 r11187 9 9 Content-Type: text/x-rst 10 10 Created: 14-Oct-2009 11 Post-History: 11 Post-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. 12 13 13 14 … … 15 16 ======== 16 17 17 This proposal describes a set of extensions to the BitTorrent DHT [#BEP-5]_18 to allow operation over IPv6.18 This document describes a set of extensions to the BitTorrent DHT 19 [#BEP-5]_ to allow operation over IPv6. 19 20 20 21 … … 29 30 address exhaustion. 30 31 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. 32 A number of extensions (mostly undocumented) to the BitTorrent 33 protocol have been defined in order to allow it to operate over IPv6. 34 Unfortunately, these extensions only allow locating IPv6 peers by 35 using trackers or through peer exchange -- but not from the DHT. This 36 document describes the procedures and message formats used in the IPv6 37 DHT. 45 38 46 39 … … 48 41 ========= 49 42 50 There are two distinct DHTs: the existing IPv4 DHT, and the newIPv6 DHT.43 There are two distinct DHTs: the IPv4 DHT, and the IPv6 DHT. 51 44 52 45 The two DHTs are independent, meaning that no IPv6 data is stored in the … … 60 53 mostly congruent. 61 54 62 By default, messages only carry data in the address family implied by the63 network layer protocol. In the case of the "nodes" and "nodes6" arguments64 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.55 Usually, messages only carry data in the address family implied by the 56 network layer protocol. In the case of the find_nodes and get_peers 57 requests, however, the requestor may optionally request that the reply 58 should contain IPv4 node information, IPv6 node information, or both. 66 59 67 60 … … 80 73 a dual-stack (IPv4 and IPv6) node can make bootstrap faster and 81 74 improve the reliability of the protocol by "leaking" data between the 82 two DHTs, as described in the following paragraphs.75 two DHTs, as described in the following sections. 83 76 84 77 … … 88 81 A dual-stack node that is bootstrapping its DHT will send find_nodes 89 82 requests in order to populate its routing tables. In order to accelerate 90 this process, it should request both "nodes" and "nodes6" fields.83 this process, it should request both IPv4 and IPv6 node information. 91 84 92 85 … … 94 87 '''''''''''''''''''''' 95 88 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.89 Once bootstrap is successful, a node should normally only request IPv4 90 node information from IPv4 nodes, and IPv6 node information from IPv6 91 nodes. Requesting node information for both address families in all 92 requests is unlikely to provide useful information, and hence 93 increases network traffic with no benefit. 101 94 102 95 In order to increase the reliability of the DHT after a single-protocol 103 96 network 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. 97 IPv4 node information to an IPv6 node, or a request for IPv6 node 98 information to an IPv4 node. 105 99 106 100 … … 145 139 146 140 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 NAT141 multi-homing is not as common as in IPv6, and in the presence of NAT 148 142 the issues are somewhat more complicated, so this specification 149 143 refrains from making any recommendations about binding of IPv4 … … 156 150 The PORT message, as defined in BEP-5, is extended to work over both 157 151 IPv4 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. 152 applies to the address it was sent from; this implies that a PORT 153 message sent over IPv4 only advertises participation in the IPv4 DHT, 154 and a PORT message sent over IPv6 only advertises participation in the 155 IPv6 DHT. 156 157 Multihomed hosts should take care to only send PORT messages over 158 connections established from the address on which they participate in 159 the DHT. 161 160 162 161 **Rationale**: in the presence of the LTEP extension negotiation 163 162 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). 170 168 171 169 … … 183 181 information for a single peer. 184 182 185 In a reply sent over IPv6, "values 'contains a list of strings, each183 In a reply sent over IPv6, "values" contains a list of strings, each 186 184 of which contains compact format IPv6 contact information for a single 187 185 peer. … … 189 187 Implementations of this specification must be able to properly parse 190 188 hybrid "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. 189 6-octet IPv4 values and 18-octet IPv6 values. However, implementations 190 should not send such hybrid lists, and must not send hybrid lists in 191 a reply to an IPv4 request that doesn't contain a "want" parameter. 195 192 196 193 **Rationale**: a request sent over IPv4 with no "want" parameter … … 205 202 '''''' 206 203 207 The "nodes6" parameter is analogous to the existing "nodes" parameter:208 whenpresent, it carries a string containing the compact IPv6 node209 info for the 8 closest good nodes in the sending node's IPv6 routing210 table. This parameter is allowed in replies to the find_nodes and 211 get_peers messages (see below).204 The "nodes6" parameter is analogous to the "nodes" parameter: when 205 present, it carries a string containing the compact IPv6 node 206 information for the 8 closest good nodes in the sending node's IPv6 207 routing table. This parameter is allowed in replies to the find_nodes 208 and get_peers messages (see below). 212 209 213 210 … … 230 227 sundry flags, which can simply be included in the top-level 231 228 dictionary of the message. Extending the "want" parameter without 232 good reason is discouraged.229 good reason is not recommended. 233 230 234 231 … … 239 236 '''''''''''''''''''''''' 240 237 241 A node sending a find_nodes or get_peers request should include242 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 onlyif the request's "want"245 parameter included a "4", and should include a "nodes6" parameter if246 and only if the request's "want" parameter included a "6".238 A node sending a find_nodes or get_peers request may include a "want" 239 parameter containing one or both of the strings "n4" or "n6". A node 240 replying to a find_nodes or get_peers request that includes a "want" 241 parameter should include a "nodes" parameter if the request's "want" 242 parameter contained the string "n4", and should include a "nodes6" 243 parameter if the request's "want" parameter contained the string "n6". 247 244 248 245 In the absence of a "want" parameter, the reply should include "nodes" … … 253 250 defined in BEP-5, which specifies that "nodes" and "values" are 254 251 mutually exclusive. However, this change makes the DHT more 255 reliable, and has been deployed by most implementations for over256 a year with nonegative effects.257 258 When a node receives a get_peers request and it has contact252 reliable, and has been deployed by most implementations with no 253 negative effects. 254 255 When a node receives a get_peers request and it has peer contact 259 256 information for the matching address family and info-hash, it should 260 257 additionally include a "values" parameter containing a list of 6-octet … … 288 285 ================ 289 286 290 I gratefully acknowledge the influence of *The 8472* and *arvid* over291 this work.287 I gratefully acknowledge the help of *The 8472* and *arvid* in 288 developing this specification. 292 289 293 290