Changeset 11107 for dotorg/trunk/html/beps/bep_0022.html
- Timestamp:
- 05/27/2008 09:03:51 PM (6 months ago)
- Files:
-
- 1 modified
-
dotorg/trunk/html/beps/bep_0022.html (modified) (19 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dotorg/trunk/html/beps/bep_0022.html
r11088 r11107 39 39 <tr class="field"><th class="field-name">Title:</th><td class="field-body">BitTorrent Cache Discovery Protocol</td> 40 40 </tr> 41 <tr class="field"><th class="field-name">Version:</th><td class="field-body">11 087</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_0022.rst">2008-05- 19 16:16:31 -0700 (Mon, 19May 2008)</a></td>41 <tr class="field"><th class="field-name">Version:</th><td class="field-body">11101</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_0022.rst">2008-05-27 19:02:55 -0700 (Tue, 27 May 2008)</a></td> 44 44 </tr> 45 45 <tr class="field"><th class="field-name">Author:</th><td class="field-body">David Harrison <dave at bittorrent.com>, Stanislav Shalunov <shalunov at bittorrent.com>, Greg Hazel <greg at bittorrent.com></td> … … 61 61 <p class="topic-title first">Contents</p> 62 62 <ul class="simple"> 63 <li><a class="reference internal" href="#motivation" id="id 9">Motivation</a></li>64 <li><a class="reference internal" href="#the-discovery-mechanism" id="id1 0">The Discovery Mechanism</a></li>65 <li><a class="reference internal" href="#iterative-queries" id="id1 1">Iterative Queries</a></li>66 <li><a class="reference internal" href="#network-address-translators" id="id1 2">Network Address Translators</a></li>67 <li><a class="reference internal" href="#example" id="id1 3">Example</a></li>68 <li><a class="reference internal" href="#references" id="id1 4">References</a></li>69 <li><a class="reference internal" href="#copyright" id="id1 5">Copyright</a></li>63 <li><a class="reference internal" href="#motivation" id="id10">Motivation</a></li> 64 <li><a class="reference internal" href="#the-discovery-mechanism" id="id11">The Discovery Mechanism</a></li> 65 <li><a class="reference internal" href="#iterative-queries" id="id12">Iterative Queries</a></li> 66 <li><a class="reference internal" href="#network-address-translators" id="id13">Network Address Translators</a></li> 67 <li><a class="reference internal" href="#example" id="id14">Example</a></li> 68 <li><a class="reference internal" href="#references" id="id15">References</a></li> 69 <li><a class="reference internal" href="#copyright" id="id16">Copyright</a></li> 70 70 </ul> 71 71 </div> … … 86 86 those that share the access network. When subsequent peers transfer 87 87 from their ISP's cache, the ISP experiences less transit traffic.</p> 88 <p>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL 89 NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and 90 "OPTIONAL" in this document are to be interpreted as described in 91 IETF <a class="reference external" href="http://www.faqs.org/rfcs/rfc2119.html">RFC 2119</a> <a class="footnote-reference" href="#rfc-2119" id="id1">[5]</a>.</p> 88 92 </div> 89 93 <div class="section" id="the-discovery-mechanism"> … … 113 117 tracker is called a <em>cache tracker</em>, but the protocol to talk to this 114 118 tracker is no different from the standard BitTorrent tracker protocol 115 described in <a class="footnote-reference" href="#bep-3" id="id 1">[1]</a>.</p>119 described in <a class="footnote-reference" href="#bep-3" id="id2">[1]</a>.</p> 116 120 <p>When the BitTorrent client joins a swarm it announces to one or more 117 121 of the trackers referenced in the .torrent file and announces to the … … 119 123 other peers that announced the same file to the cache tracker.</p> 120 124 <p>A cache is a BitTorrent peer. A client MAY treat it preferentially.</p> 121 <p>Reverse DNS lookups are described in <a class="reference external" href="http://www.faqs.org/rfcs/rfc1034.html">RFC 1034</a> <a class="footnote-reference" href="#rfc-1034" id="id 2">[4]</a>.122 The SRV resource record type is described in <a class="reference external" href="http://www.faqs.org/rfcs/rfc2782.html">RFC 2782</a> <a class="footnote-reference" href="#rfc-2782" id="id 3">[5]</a>.</p>125 <p>Reverse DNS lookups are described in <a class="reference external" href="http://www.faqs.org/rfcs/rfc1034.html">RFC 1034</a> <a class="footnote-reference" href="#rfc-1034" id="id3">[4]</a>. 126 The SRV resource record type is described in <a class="reference external" href="http://www.faqs.org/rfcs/rfc2782.html">RFC 2782</a> <a class="footnote-reference" href="#rfc-2782" id="id4">[6]</a>.</p> 123 127 </div> 124 128 <div class="section" id="iterative-queries"> … … 132 136 </pre> 133 137 <p>However, if wildcards are implemented according to the algorithm in 134 section 4.3.2 in <a class="footnote-reference" href="#rfc-1034" id="id 4">[4]</a> then all subdomains of pacbell.net that138 section 4.3.2 in <a class="footnote-reference" href="#rfc-1034" id="id5">[4]</a> then all subdomains of pacbell.net that 135 139 do not have an exact label match will match the wildcard. Thus,</p> 136 140 <pre class="literal-block"> … … 150 154 _bittorrent-tracker._tcp.*.pacbell.net 151 155 </pre> 152 <p>However, section 4.3.3 in <a class="footnote-reference" href="#rfc-1034" id="id 5">[4]</a> specifies that wildcards only156 <p>However, section 4.3.3 in <a class="footnote-reference" href="#rfc-1034" id="id6">[4]</a> specifies that wildcards only 153 157 appear as the first label in a domain name. This restriction was 154 lifted in <a class="footnote-reference" href="#rfc-4592" id="id 6">[6]</a>, but not with semantics applicable to our use158 lifted in <a class="footnote-reference" href="#rfc-4592" id="id7">[7]</a>, but not with semantics applicable to our use 155 159 case. An asterisk not at the beginning of a domain name is not 156 160 treated like a wildcard. Only a lookup for the exact domain name</p> … … 159 163 </pre> 160 164 <p>matches.</p> 161 <p>We propose an alternative that avoids wildcards and has the advantage162 that it allows suborganizations to override the SRV records provided 163 by parent organizations: the peer starts by querying using its 164 fully-qualified domain name returned from the reverse DNS lookup, and 165 if this fails then it queries again after removing the most specific 166 (leftmost) label in the domain name. For example, if no SRV records 167 are returnedwhen querying for</p>165 <p>We propose an alternative that avoids wildcards and allows 166 suborganizations to override SRV records provided by parent 167 organizations: the peer starts by querying using its fully-qualified 168 domain name returned from the reverse DNS lookup, and if this fails 169 then it queries again after removing the most specific (leftmost) 170 label in the domain name. For example, if no SRV records are returned 171 when querying for</p> 168 172 <pre class="literal-block"> 169 173 _bittorrent-tracker._tcp.adsl-69-107-0-14.dsl.pltn13.pacbell.net … … 177 181 _bittorrent-tracker.pltn13.pacbell.net 178 182 </pre> 179 <p>The search removes one domainat a time terminating when one or more183 <p>The search removes one label at a time terminating when one or more 180 184 resource records are found or before querying the root domain or 181 185 top-level domains that are not ccTLDs, e.g., .com, .org, .net. We 182 avoid querying the root or global top-level domains given the low183 likelihood that caches would be defined globally, and thus clients 184 wouldunnecessarily burden the root domain name servers with queries186 avoid querying the root or top-level domains given the low likelihood 187 that caches would be defined globally, and thus clients would 188 unnecessarily burden the root domain name servers with queries 185 189 generating negative results. We considered stopping before querying 186 190 country-level domains, but a country providing public infrastructure … … 197 201 address. This globally-routable address is the host's <em>external IP 198 202 address</em>.</p> 199 <p> When finding a cache, the BitTorrent client must use its host's200 external IP address. A BitTorrent client can obtain its host's 201 external IP either from the <em>external ip</em> key returned from a tracker 202 implementing BEP 24 <a class="footnote-reference" href="#bep-24" id="id7">[3]</a> or from peers using the <em>yourip</em> 203 extension defined for the <em>Extension Protocol</em> proposed in <a class="footnote-reference" href="#bep-10" id="id8">[2]</a>.</p>203 <p>The BitTorrent client must use its host's external IP address. A 204 BitTorrent client MAY obtain its host's external IP either from the 205 <em>external ip</em> key returned from a tracker implementing BEP 24 206 <a class="footnote-reference" href="#bep-24" id="id8">[3]</a> or from peers implementing the <em>yourip</em> extension defined 207 for the <em>Extension Protocol</em> proposed in <a class="footnote-reference" href="#bep-10" id="id9">[2]</a>.</p> 204 208 </div> 205 209 <div class="section" id="example"> 206 210 <h1>Example</h1> 207 <p>In our example, we use dAT&T's PacBell network. AT&T could implement211 <p>In our example, we use AT&T's PacBell network. AT&T could implement 208 212 cache discovery by adding the following lines to the zone file for 209 213 pacbell.net,</p> … … 214 218 <p>Now when a client performs cache discovery, it performs three DNS 215 219 queries removing labels before reaching the domain name pacbell.net, 216 at which point the SRV record would be returned and the client would217 t hen query tracker.pacbell.net to obtaincaches.</p>220 at which point the SRV record is returned and the client queries 221 tracker.pacbell.net to obtain the domain names of caches.</p> 218 222 <p>In Python, the cache tracker's port and domain can be obtained using 219 223 PyDNS using the following code:</p> … … 226 230 names = name.split('.') 227 231 while names and names[0] not in tlds: 228 name = "_bittorrent ._tcp." + ".".join(names)232 name = "_bittorrent-tracker._tcp." + ".".join(names) 229 233 req = DNS.Request( name=name, qtype="SRV", protocol="udp") 230 234 response = req.req() … … 243 247 ;; flags: qr aa rd ra; Ques: 1, Ans: 1, Auth: 2, Addit: 3 244 248 ;; QUESTIONS: 245 ;; _bittorrent ._tcp.pacbell.net, type = SRV, class = IN249 ;; _bittorrent-tracker._tcp.pacbell.net, type = SRV, class = IN 246 250 247 251 ;; ANSWERS: 248 _bittorrent ._tcp.pacbell.net 600 SRV (5, 0, 6969, 'cache.pacbell.net')252 _bittorrent-tracker._tcp.pacbell.net 600 SRV (5, 0, 6969, 'cache.pacbell.net') 249 253 250 254 ;; AUTHORITY RECORDS: … … 272 276 <colgroup><col class="label" /><col /></colgroup> 273 277 <tbody valign="top"> 274 <tr><td class="label"><a class="fn-backref" href="#id 1">[1]</a></td><td>BEP_0003. The BitTorrent Protocol Specification, Cohen275 (<a class="reference external" href="http://www.bittorrent.org/beps/bep_0003.html">http://www.bittorrent.org/beps/bep_0003.html</a>)</td></tr>278 <tr><td class="label"><a class="fn-backref" href="#id2">[1]</a></td><td>BEP_0003. The BitTorrent Protocol Specification, Cohen. 279 <a class="reference external" href="http://www.bittorrent.org/beps/bep_0003.html">http://www.bittorrent.org/beps/bep_0003.html</a></td></tr> 276 280 </tbody> 277 281 </table> … … 279 283 <colgroup><col class="label" /><col /></colgroup> 280 284 <tbody valign="top"> 281 <tr><td class="label"><a class="fn-backref" href="#id 8">[2]</a></td><td>BEP_0010. Extension Protocol. Norberg, Strigeus, Hazel282 (<a class="reference external" href="http://www.bittorrent.org/beps/bep_0010.html">http://www.bittorrent.org/beps/bep_0010.html</a>)</td></tr>285 <tr><td class="label"><a class="fn-backref" href="#id9">[2]</a></td><td>BEP_0010. Extension Protocol. Norberg, Strigeus, Hazel. 286 <a class="reference external" href="http://www.bittorrent.org/beps/bep_0010.html">http://www.bittorrent.org/beps/bep_0010.html</a></td></tr> 283 287 </tbody> 284 288 </table> … … 286 290 <colgroup><col class="label" /><col /></colgroup> 287 291 <tbody valign="top"> 288 <tr><td class="label"><a class="fn-backref" href="#id 7">[3]</a></td><td>BEP_0024. Tracker Returns External IP. Harrison289 (<a class="reference external" href="http://www.bittorrent.org/beps/bep_0024.html">http://www.bittorrent.org/beps/bep_0024.html</a>)</td></tr>292 <tr><td class="label"><a class="fn-backref" href="#id8">[3]</a></td><td>BEP_0024. Tracker Returns External IP. Harrison. 293 <a class="reference external" href="http://www.bittorrent.org/beps/bep_0024.html">http://www.bittorrent.org/beps/bep_0024.html</a></td></tr> 290 294 </tbody> 291 295 </table> … … 293 297 <colgroup><col class="label" /><col /></colgroup> 294 298 <tbody valign="top"> 295 <tr><td class="label">[4]</td><td><em>(<a class="fn-backref" href="#id2">1</a>, <a class="fn-backref" href="#id4">2</a>, <a class="fn-backref" href="#id5">3</a>)</em> <a class="reference external" href="http://www.faqs.org/rfcs/rfc1034.html">RFC-1034</a>. DOMAIN NAMES - CONCEPTS AND FACILITIES. Mockapetris, 296 November 1987. (<a class="reference external" href="http://tools.ietf.org/html/rfc1034">http://tools.ietf.org/html/rfc1034</a>)</td></tr> 299 <tr><td class="label">[4]</td><td><em>(<a class="fn-backref" href="#id3">1</a>, <a class="fn-backref" href="#id5">2</a>, <a class="fn-backref" href="#id6">3</a>)</em> <a class="reference external" href="http://www.faqs.org/rfcs/rfc1034.html">RFC-1034</a>. DOMAIN NAMES - CONCEPTS AND FACILITIES. Mockapetris, 300 November 1987. <a class="reference external" href="http://tools.ietf.org/html/rfc1034">http://tools.ietf.org/html/rfc1034</a></td></tr> 301 </tbody> 302 </table> 303 <table class="docutils footnote" frame="void" id="rfc-2119" rules="none"> 304 <colgroup><col class="label" /><col /></colgroup> 305 <tbody valign="top"> 306 <tr><td class="label"><a class="fn-backref" href="#id1">[5]</a></td><td><a class="reference external" href="http://www.faqs.org/rfcs/rfc2119.html">RFC-2119</a>. <a class="reference external" href="http://www.ietf.org/rfc/rfc2119.txt">http://www.ietf.org/rfc/rfc2119.txt</a></td></tr> 297 307 </tbody> 298 308 </table> … … 300 310 <colgroup><col class="label" /><col /></colgroup> 301 311 <tbody valign="top"> 302 <tr><td class="label"><a class="fn-backref" href="#id 3">[5]</a></td><td><a class="reference external" href="http://www.faqs.org/rfcs/rfc2782.html">RFC-2782</a>. A DNS RR for specifying the location of services (DNS312 <tr><td class="label"><a class="fn-backref" href="#id4">[6]</a></td><td><a class="reference external" href="http://www.faqs.org/rfcs/rfc2782.html">RFC-2782</a>. A DNS RR for specifying the location of services (DNS 303 313 SRV). Gulbrandsen, Vixie, Esibov. February 2000. 304 (<a class="reference external" href="http://tools.ietf.org/html/rfc2782">http://tools.ietf.org/html/rfc2782</a>)</td></tr>314 <a class="reference external" href="http://tools.ietf.org/html/rfc2782">http://tools.ietf.org/html/rfc2782</a></td></tr> 305 315 </tbody> 306 316 </table> … … 308 318 <colgroup><col class="label" /><col /></colgroup> 309 319 <tbody valign="top"> 310 <tr><td class="label"><a class="fn-backref" href="#id 6">[6]</a></td><td><a class="reference external" href="http://www.faqs.org/rfcs/rfc4592.html">RFC-4592</a>. The Role of Wildcards in the Domain Name System. Lewis311 (<a class="reference external" href="http://www.faqs.org/rfcs/rfc4592.html">http://www.faqs.org/rfcs/rfc4592.html</a>)</td></tr>320 <tr><td class="label"><a class="fn-backref" href="#id7">[7]</a></td><td><a class="reference external" href="http://www.faqs.org/rfcs/rfc4592.html">RFC-4592</a>. The Role of Wildcards in the Domain Name 321 System. Lewis. <a class="reference external" href="http://www.faqs.org/rfcs/rfc4592.html">http://www.faqs.org/rfcs/rfc4592.html</a></td></tr> 312 322 </tbody> 313 323 </table>