Changeset 11101
- Timestamp:
- 05/27/2008 07:02:55 PM (6 months ago)
- Files:
-
- 1 modified
-
dotorg/trunk/html/beps/bep_0022.rst (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dotorg/trunk/html/beps/bep_0022.rst
r11087 r11101 29 29 those that share the access network. When subsequent peers transfer 30 30 from their ISP's cache, the ISP experiences less transit traffic. 31 32 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL 33 NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and 34 "OPTIONAL" in this document are to be interpreted as described in 35 IETF RFC 2119 [#RFC-2119]_. 31 36 32 37 … … 127 132 matches. 128 133 129 We propose an alternative that avoids wildcards and has the advantage130 that it allows suborganizations to override the SRV records provided 131 by parent organizations: the peer starts by querying using its 132 fully-qualified domain name returned from the reverse DNS lookup, and 133 if this fails then it queries again after removing the most specific 134 (leftmost) label in the domain name. For example, if no SRV records 135 are returnedwhen querying for134 We propose an alternative that avoids wildcards and allows 135 suborganizations to override SRV records provided by parent 136 organizations: the peer starts by querying using its fully-qualified 137 domain name returned from the reverse DNS lookup, and if this fails 138 then it queries again after removing the most specific (leftmost) 139 label in the domain name. For example, if no SRV records are returned 140 when querying for 136 141 137 142 :: … … 151 156 _bittorrent-tracker.pltn13.pacbell.net 152 157 153 The search removes one domainat a time terminating when one or more158 The search removes one label at a time terminating when one or more 154 159 resource records are found or before querying the root domain or 155 160 top-level domains that are not ccTLDs, e.g., .com, .org, .net. We 156 avoid querying the root or global top-level domains given the low157 likelihood that caches would be defined globally, and thus clients 158 wouldunnecessarily burden the root domain name servers with queries161 avoid querying the root or top-level domains given the low likelihood 162 that caches would be defined globally, and thus clients would 163 unnecessarily burden the root domain name servers with queries 159 164 generating negative results. We considered stopping before querying 160 165 country-level domains, but a country providing public infrastructure … … 174 179 address*. 175 180 176 When finding a cache, the BitTorrent client must use its host's 177 external IP address. A BitTorrent client can obtain its host's 178 external IP either from the *external ip* key returned from a tracker 179 implementing BEP 24 [#BEP-24]_ or from peers using the *yourip* 180 extension defined for the *Extension Protocol* proposed in [#BEP-10]_. 181 181 The BitTorrent client must use its host's external IP address. A 182 BitTorrent client MAY obtain its host's external IP either from the 183 *external ip* key returned from a tracker implementing BEP 24 184 [#BEP-24]_ or from peers implementing the *yourip* extension defined 185 for the *Extension Protocol* proposed in [#BEP-10]_. 182 186 183 187 Example 184 188 ======= 185 189 186 In our example, we use dAT&T's PacBell network. AT&T could implement190 In our example, we use AT&T's PacBell network. AT&T could implement 187 191 cache discovery by adding the following lines to the zone file for 188 192 pacbell.net, … … 195 199 Now when a client performs cache discovery, it performs three DNS 196 200 queries removing labels before reaching the domain name pacbell.net, 197 at which point the SRV record would be returned and the client would198 t hen query tracker.pacbell.net to obtaincaches.201 at which point the SRV record is returned and the client queries 202 tracker.pacbell.net to obtain the domain names of caches. 199 203 200 204 In Python, the cache tracker's port and domain can be obtained using … … 208 212 names = name.split('.') 209 213 while names and names[0] not in tlds: 210 name = "_bittorrent ._tcp." + ".".join(names)214 name = "_bittorrent-tracker._tcp." + ".".join(names) 211 215 req = DNS.Request( name=name, qtype="SRV", protocol="udp") 212 216 response = req.req() … … 227 231 ;; flags: qr aa rd ra; Ques: 1, Ans: 1, Auth: 2, Addit: 3 228 232 ;; QUESTIONS: 229 ;; _bittorrent ._tcp.pacbell.net, type = SRV, class = IN233 ;; _bittorrent-tracker._tcp.pacbell.net, type = SRV, class = IN 230 234 231 235 ;; ANSWERS: 232 _bittorrent ._tcp.pacbell.net 600 SRV (5, 0, 6969, 'cache.pacbell.net')236 _bittorrent-tracker._tcp.pacbell.net 600 SRV (5, 0, 6969, 'cache.pacbell.net') 233 237 234 238 ;; AUTHORITY RECORDS: … … 255 259 ========== 256 260 257 .. [#BEP-3] BEP_0003. The BitTorrent Protocol Specification, Cohen 258 (http://www.bittorrent.org/beps/bep_0003.html)259 260 .. [#BEP-10] BEP_0010. Extension Protocol. Norberg, Strigeus, Hazel 261 (http://www.bittorrent.org/beps/bep_0010.html)262 263 .. [#BEP-24] BEP_0024. Tracker Returns External IP. Harrison 264 (http://www.bittorrent.org/beps/bep_0024.html)261 .. [#BEP-3] BEP_0003. The BitTorrent Protocol Specification, Cohen. 262 http://www.bittorrent.org/beps/bep_0003.html 263 264 .. [#BEP-10] BEP_0010. Extension Protocol. Norberg, Strigeus, Hazel. 265 http://www.bittorrent.org/beps/bep_0010.html 266 267 .. [#BEP-24] BEP_0024. Tracker Returns External IP. Harrison. 268 http://www.bittorrent.org/beps/bep_0024.html 265 269 266 270 .. [#RFC-1034] RFC-1034. DOMAIN NAMES - CONCEPTS AND FACILITIES. Mockapetris, 267 November 1987. (http://tools.ietf.org/html/rfc1034) 271 November 1987. http://tools.ietf.org/html/rfc1034 272 273 .. [#RFC-2119] RFC-2119. http://www.ietf.org/rfc/rfc2119.txt 268 274 269 275 .. [#RFC-2782] RFC-2782. A DNS RR for specifying the location of services (DNS 270 276 SRV). Gulbrandsen, Vixie, Esibov. February 2000. 271 (http://tools.ietf.org/html/rfc2782)272 273 .. [#RFC-4592] RFC-4592. The Role of Wildcards in the Domain Name System. Lewis274 (http://www.faqs.org/rfcs/rfc4592.html)277 http://tools.ietf.org/html/rfc2782 278 279 .. [#RFC-4592] RFC-4592. The Role of Wildcards in the Domain Name 280 System. Lewis. http://www.faqs.org/rfcs/rfc4592.html 275 281 276 282