Changeset 11097 for dotorg/trunk/html/beps/bep_0023.html
- Timestamp:
- 05/21/2008 12:01:40 AM (6 months ago)
- Files:
-
- 1 modified
-
dotorg/trunk/html/beps/bep_0023.html (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dotorg/trunk/html/beps/bep_0023.html
r11084 r11097 37 37 <tr class="field"><th class="field-name">BEP:</th><td class="field-body">23</td> 38 38 </tr> 39 <tr class="field"><th class="field-name">Title:</th><td class="field-body">Tracker Returns PackedPeer Lists</td>39 <tr class="field"><th class="field-name">Title:</th><td class="field-body">Tracker Returns Compact Peer Lists</td> 40 40 </tr> 41 41 <tr class="field"><th class="field-name">Version:</th><td class="field-body">11083</td> … … 61 61 <p class="topic-title first">Contents</p> 62 62 <ul class="simple"> 63 <li><a class="reference internal" href="#abstract" id="id 3">Abstract</a></li>64 <li><a class="reference internal" href="#overview" id="id 4">Overview</a></li>65 <li><a class="reference internal" href="#references" id="id 5">References</a></li>66 <li><a class="reference internal" href="#copyright" id="id 6">Copyright</a></li>63 <li><a class="reference internal" href="#abstract" id="id5">Abstract</a></li> 64 <li><a class="reference internal" href="#overview" id="id6">Overview</a></li> 65 <li><a class="reference internal" href="#references" id="id7">References</a></li> 66 <li><a class="reference internal" href="#copyright" id="id8">Copyright</a></li> 67 67 </ul> 68 68 </div> … … 72 72 computational requirements in trackers, trackers may return 73 73 peers as a packed string rather than as a bencoded list.</p> 74 <p>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL 75 NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and 76 "OPTIONAL" in this document are to be interpreted as described in 77 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">[3]</a>.</p> 74 78 </div> 75 79 <div class="section" id="overview"> 76 80 <h1>Overview</h1> 77 <p>In BitTorrent as described in BEP 3 <a class="footnote-reference" href="#bep-3" id="id 1">[1]</a>, peers wishing to81 <p>In BitTorrent as described in BEP 3 <a class="footnote-reference" href="#bep-3" id="id2">[1]</a>, peers wishing to 78 82 transfer a file contact a central tracker. This tracker returns a 79 83 list of peers that are currently transferring the file. The list of … … 83 87 containing a domain name or an IP address, and an integer port number. 84 88 The <em>ip</em> is variable length, but since in its longest form it is a 85 domain name it cannot exceed 255 bytes <a class="footnote-reference" href="#rfc-1034" id="id 2">[2]</a> plus 4 bytes89 domain name it cannot exceed 255 bytes <a class="footnote-reference" href="#rfc-1034" id="id3">[2]</a> plus 4 bytes 86 90 bencoding overhead. Bencoded integers are also variable length but 87 91 since it is a port number, it cannot be more than 7 bytes including 88 92 bencoding overhead. Thus,</p> 89 <dl class="docutils"> 90 <dt>::</dt> 91 <dd>total peer list length in bytes < n * ( 23 + 259 + 7 )</dd> 92 </dl> 93 <p>It is common now to use a packed format where each peer is represented 93 <pre class="literal-block"> 94 total peer list length in bytes < n * ( 23 + 259 + 7 ) 95 </pre> 96 <p>It is common now to use a compact format where each peer is represented 94 97 using only 6 bytes. The first 4 bytes contain the 32-bit ipv4 address. 95 98 The remaining two bytes contain the port number. Both address and port 96 99 use network-byte order.</p> 97 <p>The packed format uses the same <em>peers</em> key in the bencoded tracker 100 <p>When the client's announce URL contains <em>compact=1</em> the tracker MAY 101 return the peers using compact format. When <em>compact=0</em> or it is not 102 specified then the tracker MUST return using the original format 103 described in <a class="footnote-reference" href="#bep-3" id="id4">[1]</a>. For example,</p> 104 <pre class="literal-block"> 105 GET /announce?peer_id=aaaaaaaaaaaaaaaaaaaa&info_hash=aaaaaaaaaaaaaaaaaaaa 106 &port=6881&left=0&downloaded=100&uploaded=0&compact=1 107 </pre> 108 <p>The compact format uses the same <em>peers</em> key in the bencoded tracker 98 109 response, but the value is a bencoded string rather than a bencoded 99 110 list.</p> 100 <p>The peer id does not appear in the packedformat. The format has been111 <p>The peer id does not appear in the compact format. The format has been 101 112 in use for years and the lack of a peer id has posed no problems.</p> 102 <p>This packedformat is supported by BitTorrent mainline, Azureus,113 <p>This compact format is supported by BitTorrent mainline, Azureus, 103 114 libtorrent, uTorrent, and probably most other clients.</p> 104 115 </div> … … 108 119 <colgroup><col class="label" /><col /></colgroup> 109 120 <tbody valign="top"> 110 <tr><td class="label"> <a class="fn-backref" href="#id1">[1]</a></td><td>BEP_0003. The BitTorrent Protocol Specification, Cohen121 <tr><td class="label">[1]</td><td><em>(<a class="fn-backref" href="#id2">1</a>, <a class="fn-backref" href="#id4">2</a>)</em> BEP_0003. The BitTorrent Protocol Specification, Cohen 111 122 (<a class="reference external" href="http://www.bittorrent.org/beps/bep_0003.html">http://www.bittorrent.org/beps/bep_0003.html</a>)</td></tr> 112 123 </tbody> … … 115 126 <colgroup><col class="label" /><col /></colgroup> 116 127 <tbody valign="top"> 117 <tr><td class="label"><a class="fn-backref" href="#id 2">[2]</a></td><td><a class="reference external" href="http://www.faqs.org/rfcs/rfc1034.html">RFC-1034</a>. DOMAIN NAMES - CONCEPTS AND FACILITIES. Mockapetris,128 <tr><td class="label"><a class="fn-backref" href="#id3">[2]</a></td><td><a class="reference external" href="http://www.faqs.org/rfcs/rfc1034.html">RFC-1034</a>. DOMAIN NAMES - CONCEPTS AND FACILITIES. Mockapetris, 118 129 November 1987. (<a class="reference external" href="http://tools.ietf.org/html/rfc1034">http://tools.ietf.org/html/rfc1034</a>)</td></tr> 130 </tbody> 131 </table> 132 <table class="docutils footnote" frame="void" id="rfc-2119" rules="none"> 133 <colgroup><col class="label" /><col /></colgroup> 134 <tbody valign="top"> 135 <tr><td class="label"><a class="fn-backref" href="#id1">[3]</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> 119 136 </tbody> 120 137 </table>