Changeset 10762
- Timestamp:
- 02/14/2008 01:37:25 PM (11 months ago)
- Files:
-
- 1 modified
-
dotorg/trunk_fixed/html/beps/bep_0008.rst (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dotorg/trunk_fixed/html/beps/bep_0008.rst
r10597 r10762 59 59 We distinguish between the *tracker peer list* and the *returned peer 60 60 list*. The *tracker peer list* contains the ip-port pairs of all 61 peers that have reported to the tracker that they are downloading or 62 seeding a given file with a given infohash. The tracker may store 63 this peer list however it wishes. The *returned peer list* contains a 64 packed array of ip-port pairs conforming to the BitTorrent protocol 65 specification. If the swarm is sufficiently large then the returned 66 ip-port pairs constitute a subset of the ip-port pairs in the67 *tracker peer list*.61 known peers in a given torrent, i.e., those peers that have reported to 62 the tracker that they are downloading or seeding a given file with a 63 given infohash. The tracker may store this peer list however it 64 wishes. The *returned peer list* contains a packed array of ip-port 65 pairs conforming to the BitTorrent protocol specification. If the 66 swarm is sufficiently large then the returned ip-port pairs constitute 67 a subset of the ip-port pairs in the *tracker peer list*. 68 68 69 69 The returned peer list is encrypted using RC4-drop768 encryption using 70 the infohash as a shared secret and optionally an initialization71 vector. 70 the infohash as a shared secret and optionally employing an 71 initialization vector. 72 72 73 73 For the remainder of this document RC4 refers to RC4-drop768. In the … … 141 141 The tracker MAY also cache the encrypted tracker peer list. To 142 142 support this the tracker MUST pass two additional keys *i* and *n* 143 each with 32-bit integer values ,except the tracker MAY omit *i* and144 *n* when *i=0* and the returned peer list is the entiretracker peer145 list . Whether the tracker returns *i* and *n*, the first 8 bytes of143 each with 32-bit integer values, except the tracker MAY omit *i* and 144 *n* when *i=0* and the *returned peer list* is the entire *tracker peer 145 list*. Whether the tracker returns *i* and *n*, the first 8 bytes of 146 146 the RC4 psuedorandom string are reserved for obscuring *i* and *n*. 147 147 We come back to this momentarily. Decryption starts by XORing from … … 150 150 encrypted the tracker peer list starting from the first byte after the 151 151 discarded and reserved bytes in the pseudorandom string then *i* also 152 corresponds to the *ith* ip-port pair in the tracker peer list and the 153 starting point of the copy into the returned request. 152 corresponds to the *ith* ip-port pair in the tracker peer list. 154 153 155 154 So that the client and the tracker do not have to generate an … … 179 178 list consisting of 3 ip-port pairs, and using an RC4 pseudorandom string 180 179 of length *n=2*. *n* is small for purposes of illustration. Also, for the 181 purpose of illustration, the tracker returns only 3peers at a time.180 purpose of illustration, the tracker returns only 2 peers at a time. 182 181 183 182 :: … … 202 201 peer list, we wrap to the beginning of the pseudorandom string. 203 202 204 In the first response, the tracker would return:: 203 A tracker returning the first two peers would return the bencoded 204 equivalent of:: 205 205 206 206 peers=74de24afa2df5201bedb15d7, i=0, n=2 207 207 208 In the second response, the tracker would return:: 208 A tracker returning the second and third peer would return the 209 bencoded equivalent of:: 209 210 210 211 peers=5201bedb15d72443e3f1a2df, i=1, n=2 212 213 In each response the tracker includes additional keys such as the 214 rerequest ``interval`` and the initialization vector ``iv``. 211 215 212 216 The tracker response MUST remain a valid bencoded message. … … 250 254 of the shared secret. 251 255 252 If the tracker does not know enough peers that support MSE to return253 the desired number of peers then it MAY include peers that are not 254 assumed to support MSE. If a peer closes a connection in response to 255 an encrypted header then the initiating peer should try other peers in 256 the peer list returning to the peer that closed the connection only256 If the tracker does not know enough peers assumed to support MSE to 257 return the desired number of peers then it MAY include peers that are 258 not assumed to support MSE. If a peer closes a connection in response 259 to an encrypted header then the initiating peer SHOULD try other peers 260 in the peer list returning to the peer that closed the connection only 257 261 when all other peers known or not yet known to support MSE have been 258 262 tried and have failed to provide "adequate performance." We