Show
Ignore:
Timestamp:
05/27/2008 09:03:51 PM (6 months ago)
Author:
dave
Message:

rebuild html files.

Files:
1 modified

Legend:

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

    r11088 r11107  
    3939<tr class="field"><th class="field-name">Title:</th><td class="field-body">BitTorrent Cache Discovery Protocol</td> 
    4040</tr> 
    41 <tr class="field"><th class="field-name">Version:</th><td class="field-body">11087</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, 19 May 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> 
    4444</tr> 
    4545<tr class="field"><th class="field-name">Author:</th><td class="field-body">David Harrison &lt;dave&#32;&#97;t&#32;bittorrent.com&gt;, Stanislav Shalunov &lt;shalunov&#32;&#97;t&#32;bittorrent.com&gt;, Greg Hazel &lt;greg&#32;&#97;t&#32;bittorrent.com&gt;</td> 
     
    6161<p class="topic-title first">Contents</p> 
    6262<ul class="simple"> 
    63 <li><a class="reference internal" href="#motivation" id="id9">Motivation</a></li> 
    64 <li><a class="reference internal" href="#the-discovery-mechanism" id="id10">The Discovery Mechanism</a></li> 
    65 <li><a class="reference internal" href="#iterative-queries" id="id11">Iterative Queries</a></li> 
    66 <li><a class="reference internal" href="#network-address-translators" id="id12">Network Address Translators</a></li> 
    67 <li><a class="reference internal" href="#example" id="id13">Example</a></li> 
    68 <li><a class="reference internal" href="#references" id="id14">References</a></li> 
    69 <li><a class="reference internal" href="#copyright" id="id15">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> 
    7070</ul> 
    7171</div> 
     
    8686those that share the access network.  When subsequent peers transfer 
    8787from their ISP's cache, the ISP experiences less transit traffic.</p> 
     88<p>The key words &quot;MUST&quot;, &quot;MUST NOT&quot;, &quot;REQUIRED&quot;, &quot;SHALL&quot;, &quot;SHALL 
     89NOT&quot;, &quot;SHOULD&quot;, &quot;SHOULD NOT&quot;, &quot;RECOMMENDED&quot;,  &quot;MAY&quot;, and 
     90&quot;OPTIONAL&quot; in this document are to be interpreted as described in 
     91IETF <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> 
    8892</div> 
    8993<div class="section" id="the-discovery-mechanism"> 
     
    113117tracker is called a <em>cache tracker</em>, but the protocol to talk to this 
    114118tracker is no different from the standard BitTorrent tracker protocol 
    115 described in <a class="footnote-reference" href="#bep-3" id="id1">[1]</a>.</p> 
     119described in <a class="footnote-reference" href="#bep-3" id="id2">[1]</a>.</p> 
    116120<p>When the BitTorrent client joins a swarm it announces to one or more 
    117121of the trackers referenced in the .torrent file and announces to the 
     
    119123other peers that announced the same file to the cache tracker.</p> 
    120124<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="id2">[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="id3">[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>. 
     126The 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> 
    123127</div> 
    124128<div class="section" id="iterative-queries"> 
     
    132136</pre> 
    133137<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="id4">[4]</a> then all subdomains of pacbell.net that 
     138section 4.3.2 in <a class="footnote-reference" href="#rfc-1034" id="id5">[4]</a> then all subdomains of pacbell.net that 
    135139do not have an exact label match will match the wildcard.  Thus,</p> 
    136140<pre class="literal-block"> 
     
    150154_bittorrent-tracker._tcp.*.pacbell.net 
    151155</pre> 
    152 <p>However, section 4.3.3 in <a class="footnote-reference" href="#rfc-1034" id="id5">[4]</a> specifies that wildcards only 
     156<p>However, section 4.3.3 in <a class="footnote-reference" href="#rfc-1034" id="id6">[4]</a> specifies that wildcards only 
    153157appear as the first label in a domain name.  This restriction was 
    154 lifted in <a class="footnote-reference" href="#rfc-4592" id="id6">[6]</a>, but not with semantics applicable to our use 
     158lifted in <a class="footnote-reference" href="#rfc-4592" id="id7">[7]</a>, but not with semantics applicable to our use 
    155159case.  An asterisk not at the beginning of a domain name is not 
    156160treated like a wildcard.  Only a lookup for the exact domain name</p> 
     
    159163</pre> 
    160164<p>matches.</p> 
    161 <p>We propose an alternative that avoids wildcards and has the advantage 
    162 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 returned when querying for</p> 
     165<p>We propose an alternative that avoids wildcards and allows 
     166suborganizations to override SRV records provided by parent 
     167organizations: the peer starts by querying using its fully-qualified 
     168domain name returned from the reverse DNS lookup, and if this fails 
     169then it queries again after removing the most specific (leftmost) 
     170label in the domain name.  For example, if no SRV records are returned 
     171when querying for</p> 
    168172<pre class="literal-block"> 
    169173_bittorrent-tracker._tcp.adsl-69-107-0-14.dsl.pltn13.pacbell.net 
     
    177181_bittorrent-tracker.pltn13.pacbell.net 
    178182</pre> 
    179 <p>The search removes one domain at a time terminating when one or more 
     183<p>The search removes one label at a time terminating when one or more 
    180184resource records are found or before querying the root domain or 
    181185top-level domains that are not ccTLDs, e.g., .com, .org, .net. We 
    182 avoid querying the root or global top-level domains given the low 
    183 likelihood that caches would be defined globally, and thus clients 
    184 would unnecessarily burden the root domain name servers with queries 
     186avoid querying the root or top-level domains given the low likelihood 
     187that caches would be defined globally, and thus clients would 
     188unnecessarily burden the root domain name servers with queries 
    185189generating negative results. We considered stopping before querying 
    186190country-level domains, but a country providing public infrastructure 
     
    197201address.  This globally-routable address is the host's <em>external IP 
    198202address</em>.</p> 
    199 <p>When finding a cache, the BitTorrent client must use its host's 
    200 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 
     204BitTorrent 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 
     207for the <em>Extension Protocol</em> proposed in <a class="footnote-reference" href="#bep-10" id="id9">[2]</a>.</p> 
    204208</div> 
    205209<div class="section" id="example"> 
    206210<h1>Example</h1> 
    207 <p>In our example, we used AT&amp;T's PacBell network.  AT&amp;T could implement 
     211<p>In our example, we use AT&amp;T's PacBell network.  AT&amp;T could implement 
    208212cache discovery by adding the following lines to the zone file for 
    209213pacbell.net,</p> 
     
    214218<p>Now when a client performs cache discovery, it performs three DNS 
    215219queries removing labels before reaching the domain name pacbell.net, 
    216 at which point the SRV record would be returned and the client would 
    217 then query tracker.pacbell.net to obtain caches.</p> 
     220at which point the SRV record is returned and the client queries 
     221tracker.pacbell.net to obtain the domain names of caches.</p> 
    218222<p>In Python, the cache tracker's port and domain can be obtained using 
    219223PyDNS using the following code:</p> 
     
    226230names = name.split('.') 
    227231while names and names[0] not in tlds: 
    228    name = &quot;_bittorrent._tcp.&quot; + &quot;.&quot;.join(names) 
     232   name = &quot;_bittorrent-tracker._tcp.&quot; + &quot;.&quot;.join(names) 
    229233   req = DNS.Request( name=name, qtype=&quot;SRV&quot;, protocol=&quot;udp&quot;) 
    230234   response = req.req() 
     
    243247;; flags: qr aa rd ra; Ques: 1, Ans: 1, Auth: 2, Addit: 3 
    244248;; QUESTIONS: 
    245 ;;      _bittorrent._tcp.pacbell.net, type = SRV, class = IN 
     249;;      _bittorrent-tracker._tcp.pacbell.net, type = SRV, class = IN 
    246250 
    247251;; 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') 
    249253 
    250254;; AUTHORITY RECORDS: 
     
    272276<colgroup><col class="label" /><col /></colgroup> 
    273277<tbody valign="top"> 
    274 <tr><td class="label"><a class="fn-backref" href="#id1">[1]</a></td><td>BEP_0003. The BitTorrent Protocol Specification, Cohen 
    275 (<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> 
    276280</tbody> 
    277281</table> 
     
    279283<colgroup><col class="label" /><col /></colgroup> 
    280284<tbody valign="top"> 
    281 <tr><td class="label"><a class="fn-backref" href="#id8">[2]</a></td><td>BEP_0010.  Extension Protocol. Norberg, Strigeus, Hazel 
    282 (<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> 
    283287</tbody> 
    284288</table> 
     
    286290<colgroup><col class="label" /><col /></colgroup> 
    287291<tbody valign="top"> 
    288 <tr><td class="label"><a class="fn-backref" href="#id7">[3]</a></td><td>BEP_0024.  Tracker Returns External IP.  Harrison 
    289 (<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> 
    290294</tbody> 
    291295</table> 
     
    293297<colgroup><col class="label" /><col /></colgroup> 
    294298<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, 
     300November 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> 
    297307</tbody> 
    298308</table> 
     
    300310<colgroup><col class="label" /><col /></colgroup> 
    301311<tbody valign="top"> 
    302 <tr><td class="label"><a class="fn-backref" href="#id3">[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 (DNS 
     312<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 
    303313SRV). 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> 
    305315</tbody> 
    306316</table> 
     
    308318<colgroup><col class="label" /><col /></colgroup> 
    309319<tbody valign="top"> 
    310 <tr><td class="label"><a class="fn-backref" href="#id6">[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. Lewis 
    311 (<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 
     321System. Lewis.  <a class="reference external" href="http://www.faqs.org/rfcs/rfc4592.html">http://www.faqs.org/rfcs/rfc4592.html</a></td></tr> 
    312322</tbody> 
    313323</table>