Changeset 10763
- Timestamp:
- 02/14/2008 01:38:02 PM (11 months ago)
- Files:
-
- 1 modified
-
dotorg/trunk_fixed/html/beps/bep_0008.html (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dotorg/trunk_fixed/html/beps/bep_0008.html
r10598 r10763 38 38 <tr class="field"><th class="field-name">Title:</th><td class="field-body">Tracker Peer Obfuscation</td> 39 39 </tr> 40 <tr class="field"><th class="field-name">Version:</th><td class="field-body">10 597</td>41 </tr> 42 <tr class="field"><th class="field-name">Last-Modified:</th><td class="field-body"><a class="reference external" href="https://svn.bittorrent.com/trac.cgi/browser/dotorg/trunk/html/beps/bep_0008.rst">2008-02- 07 17:08:03 -0800 (Thu, 07Feb 2008)</a></td>40 <tr class="field"><th class="field-name">Version:</th><td class="field-body">10762</td> 41 </tr> 42 <tr class="field"><th class="field-name">Last-Modified:</th><td class="field-body"><a class="reference external" href="https://svn.bittorrent.com/trac.cgi/browser/dotorg/trunk/html/beps/bep_0008.rst">2008-02-14 13:37:25 -0800 (Thu, 14 Feb 2008)</a></td> 43 43 </tr> 44 44 <tr class="field"><th class="field-name">Author:</th><td class="field-body">David Harrison <dave at bittorrent.com>, Anthony Ciani <tony at ciani.phy.uic.edu>, Arvid Norberg <arvid at bittorrent.com>, Greg Hazel <greg at bittorrent.com></td> … … 107 107 <p>We distinguish between the <em>tracker peer list</em> and the <em>returned peer 108 108 list</em>. The <em>tracker peer list</em> contains the ip-port pairs of all 109 peers that have reported to the tracker that they are downloading or 110 seeding a given file with a given infohash. The tracker may store 111 this peer list however it wishes. The <em>returned peer list</em> contains a 112 packed array of ip-port pairs conforming to the BitTorrent protocol 113 specification. If the swarm is sufficiently large then the returned 114 ip-port pairs constitute a subset of the ip-port pairs in the115 <em>tracker peer list</em>.</p>109 known peers in a given torrent, i.e., those peers that have reported to 110 the tracker that they are downloading or seeding a given file with a 111 given infohash. The tracker may store this peer list however it 112 wishes. The <em>returned peer list</em> contains a packed array of ip-port 113 pairs conforming to the BitTorrent protocol specification. If the 114 swarm is sufficiently large then the returned ip-port pairs constitute 115 a subset of the ip-port pairs in the <em>tracker peer list</em>.</p> 116 116 <p>The returned peer list is encrypted using RC4-drop768 encryption using 117 the infohash as a shared secret and optionally an initialization118 vector.</p>117 the infohash as a shared secret and optionally employing an 118 initialization vector.</p> 119 119 <p>For the remainder of this document RC4 refers to RC4-drop768. In the 120 120 process of encryption, RC4 generates a pseudorandom string that is … … 174 174 <p>The tracker MAY also cache the encrypted tracker peer list. To 175 175 support this the tracker MUST pass two additional keys <em>i</em> and <em>n</em> 176 each with 32-bit integer values ,except the tracker MAY omit <em>i</em> and177 <em>n</em> when <em>i=0</em> and the returned peer list is the entiretracker peer178 list . Whether the tracker returns <em>i</em> and <em>n</em>, the first 8 bytes of176 each with 32-bit integer values, except the tracker MAY omit <em>i</em> and 177 <em>n</em> when <em>i=0</em> and the <em>returned peer list</em> is the entire <em>tracker peer 178 list</em>. Whether the tracker returns <em>i</em> and <em>n</em>, the first 8 bytes of 179 179 the RC4 psuedorandom string are reserved for obscuring <em>i</em> and <em>n</em>. 180 180 We come back to this momentarily. Decryption starts by XORing from … … 183 183 encrypted the tracker peer list starting from the first byte after the 184 184 discarded and reserved bytes in the pseudorandom string then <em>i</em> also 185 corresponds to the <em>ith</em> ip-port pair in the tracker peer list and the 186 starting point of the copy into the returned request.</p> 185 corresponds to the <em>ith</em> ip-port pair in the tracker peer list.</p> 187 186 <p>So that the client and the tracker do not have to generate an 188 187 arbitrarily long pseudorandom string to support large swarms, we … … 209 208 list consisting of 3 ip-port pairs, and using an RC4 pseudorandom string 210 209 of length <em>n=2</em>. <em>n</em> is small for purposes of illustration. Also, for the 211 purpose of illustration, the tracker returns only 3peers at a time.</p>210 purpose of illustration, the tracker returns only 2 peers at a time.</p> 212 211 <pre class="literal-block"> 213 212 Given the following peer list … … 229 228 <p>Because the RC4 pseudorandom string is shorter than the tracker 230 229 peer list, we wrap to the beginning of the pseudorandom string.</p> 231 <p>In the first response, the tracker would return:</p> 230 <p>A tracker returning the first two peers would return the bencoded 231 equivalent of:</p> 232 232 <pre class="literal-block"> 233 233 peers=74de24afa2df5201bedb15d7, i=0, n=2 234 234 </pre> 235 <p>In the second response, the tracker would return:</p> 235 <p>A tracker returning the second and third peer would return the 236 bencoded equivalent of:</p> 236 237 <pre class="literal-block"> 237 238 peers=5201bedb15d72443e3f1a2df, i=1, n=2 238 239 </pre> 240 <p>In each response the tracker includes additional keys such as the 241 rerequest <tt class="docutils literal"><span class="pre">interval</span></tt> and the initialization vector <tt class="docutils literal"><span class="pre">iv</span></tt>.</p> 239 242 <p>The tracker response MUST remain a valid bencoded message.</p> 240 243 </div> … … 269 272 plaintext as the next twenty bytes, hence also defeating the purpose 270 273 of the shared secret.</p> 271 <p>If the tracker does not know enough peers that support MSE to return272 the desired number of peers then it MAY include peers that are not 273 assumed to support MSE. If a peer closes a connection in response to 274 an encrypted header then the initiating peer should try other peers in 275 the peer list returning to the peer that closed the connection only274 <p>If the tracker does not know enough peers assumed to support MSE to 275 return the desired number of peers then it MAY include peers that are 276 not assumed to support MSE. If a peer closes a connection in response 277 to an encrypted header then the initiating peer SHOULD try other peers 278 in the peer list returning to the peer that closed the connection only 276 279 when all other peers known or not yet known to support MSE have been 277 280 tried and have failed to provide "adequate performance." We