Changeset 11105

Show
Ignore:
Timestamp:
05/27/2008 08:57:09 PM (3 months ago)
Author:
dave
Message:

Fix references and spacing.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • dotorg/trunk/html/beps/bep_0026.rst

    r11100 r11105  
    1414======== 
    1515 
    16 `Zeroconf`_ is a collection of protocols including ipv4 link local networking, `mDNS`_, and `DNS service-discovery`_. This document aims to outline an extension for BitTorrent clients to allow them to find peers on a local-link network using the zeroconf `DNS service-discovery`_ system. It was written in the hope that clients could standardise the way in which they found peers on the local-link in order to maximize the functionality of the BitTorrent protocol.  
     16`Zeroconf`_ is a collection of protocols including ipv4 link local 
     17networking, `mDNS`_, and `DNS service-discovery`_. This document aims 
     18to outline an extension for BitTorrent clients to allow them to find 
     19peers on a local-link network using the zeroconf `DNS 
     20service-discovery`_ system. It was written in the hope that clients 
     21could standardise the way in which they found peers on the local-link 
     22in order to maximize the functionality of the BitTorrent protocol. 
    1723 
    1824 
     
    2026========= 
    2127 
    22 Many networks today consist of computers that have a fast network connection (tens or hundreds of megabits/s) to a local area network, in addition to a relatively slower (hundreds of kilobits/s or a few megabits/s) connection to the wider internet. Such networks exist in places such as university colleges, defence barracks and community wifi networks.  If two hosts on the same (fast) local-link network wish to download the same torrent at the moment they only share packets across their slow internet connection. The BitTorrent Zeroconf Peer Advertising and Discovery Extension will allow automatic discovery of these peers to each other so that packets can be quickly transfered across the fast local network as opposed to across their slow internet connections. Effectively the effort of downloading the torrent can now be distributed between the hosts on a local-link network. 
     28Many networks today consist of computers that have a fast network 
     29connection (tens or hundreds of megabits/s) to a local area network, 
     30in addition to a relatively slower (hundreds of kilobits/s or a few 
     31megabits/s) connection to the wider internet. Such networks exist in 
     32places such as university colleges, defence barracks and community 
     33wifi networks.  If two hosts on the same (fast) local-link network 
     34wish to download the same torrent at the moment they only share 
     35packets across their slow internet connection. The BitTorrent Zeroconf 
     36Peer Advertising and Discovery Extension will allow automatic 
     37discovery of these peers to each other so that packets can be quickly 
     38transfered across the fast local network as opposed to across their 
     39slow internet connections. Effectively the effort of downloading the 
     40torrent can now be distributed between the hosts on a local-link 
     41network. 
    2342 
    2443 
     
    2645============ 
    2746 
    28 In order to facilitate the BitTorrent Zeroconf Peer Advertising and Discovery Extension each host is going to be required to run a zeroconf service discovery daemon. This is relatively trivial as there are many available for free but two particularly good zeroconf implementations are: 
     47In order to facilitate the BitTorrent Zeroconf Peer Advertising and 
     48Discovery Extension each host is going to be required to run a 
     49zeroconf service discovery daemon. This is relatively trivial as there 
     50are many available for free but two particularly good zeroconf 
     51implementations are: 
    2952 
    30531. Apple's `Bonjour`_ for Mac OS X (included by default), Windows and POSIX systems 
     
    32552. `Avahi`_ recommended for Linux and BSD clients and already available in many Linux and BSD distributions. 
    3356 
    34 Note that you can only run one zeroconf instance per host due to it binding to specific ports on your network interfaces, so it is **not** recommended to build the whole zeroconf daemon/server into your client. It is much better plug into a system wide service using the API's: it cuts down your code and allows other services e.g. http, ftp to advertise themselves using the same daemon.  
     57Note that you can only run one zeroconf instance per host due to it 
     58binding to specific ports on your network interfaces, so it is **not** 
     59recommended to build the whole zeroconf daemon/server into your 
     60client. It is much better plug into a system wide service using the 
     61API's: it cuts down your code and allows other services e.g. http, ftp 
     62to advertise themselves using the same daemon. 
    3563 
    3664Method 
    3765====== 
    3866 
    39 Each host will be required to publish (via zeroconf) the service type _bittorrent._tcp. with the instance name as the torrent peer-id (in hex). 
     67Each host will be required to publish (via zeroconf) the service type 
     68_bittorrent._tcp. with the instance name as the torrent peer-id (in 
     69hex). 
    4070 
    4171``<peer-id>._bittorrent._tcp.`` 
     
    4777``4d336d342d312d2d343834616435313564343437._32f17bbf96bdc77de85bb91ff8d56f124e817c0a._sub._bittorrent._tcp.`` 
    4878 
    49 The above-mentioned zeroconf implementations provide good documentation for developers on how to do this. If the client uses the same peer-id for all torrents it has loaded, then for each additional torrent file, only the subservice needs to be added. If the client uses a different peer-id for each torrent then a _bittorrent._tcp. service will have to be  added for each torrent file with the respective subservice. This is also true if each torrent uses a different port. 
     79The above-mentioned zeroconf implementations provide good 
     80documentation for developers on how to do this. If the client uses the 
     81same peer-id for all torrents it has loaded, then for each additional 
     82torrent file, only the subservice needs to be added. If the client 
     83uses a different peer-id for each torrent then a 
     84_bittorrent._tcp. service will have to be added for each torrent file 
     85with the respective subservice. This is also true if each torrent uses 
     86a different port. 
    5087 
    51 In simple terms you can publish subtypes using the Apple Bonjour API by passing them as a comma separated list after the service type (you don't need to pass in the "_sub" label, since mDNSResponder will automatically add it for you). 
     88In simple terms you can publish subtypes using the Apple Bonjour API 
     89by passing them as a comma separated list after the service type (you 
     90don't need to pass in the "_sub" label, since mDNSResponder will 
     91automatically add it for you). 
    5292 
    5393``"_bittorrent._tcp,_info-hash1,_info-hash2,_info-hash3"`` 
    5494 
    55 For the Avahi C API use the function  ``avahi_entry_group_add_service()`` to establish the parent _bittorrent._tcp service and ``avahi_entry_group_add_service_subtype()`` with ``_<info-hash>._sub._bittorrent._tcp.`` as the 'type' parameter to establish the subservices. For both functions the <peer-id> should be used for the 'name' parameter. 
     95For the Avahi C API use the function 
     96``avahi_entry_group_add_service()`` to establish the parent 
     97_bittorrent._tcp service and 
     98``avahi_entry_group_add_service_subtype()`` with 
     99``_<info-hash>._sub._bittorrent._tcp.`` as the 'type' parameter to 
     100establish the subservices. For both functions the <peer-id> should be 
     101used for the 'name' parameter. 
    56102 
    57 Clients will need to browse for _<info-hash>._sub._bittorrent._tcp in order to discover peers participating in the same torrent. Once again good documentation is provided on how to browse for zeroconf services in  the above implementations. The replies will be in the form of <peer-id>._bittorrent._tcp. Note: Some Macintosh official bittorrent clients have a zeroconf implementation built in that publishes its services in the form of:  
     103Clients will need to browse for _<info-hash>._sub._bittorrent._tcp in 
     104order to discover peers participating in the same torrent. Once again 
     105good documentation is provided on how to browse for zeroconf services 
     106in the above implementations. The replies will be in the form of 
     107<peer-id>._bittorrent._tcp. Note: Some Macintosh official bittorrent 
     108clients have a zeroconf implementation built in that publishes its 
     109services in the form of: 
    58110 
    59111``_bittorrent-<info-hash>._tcp.``  
     
    61113``_bittorrent-32f17bbf96bdc77de85bb91ff8d56f124e817c0a._tcp.`` 
    62114 
    63 However this does not comply with RFC 2782 as the service name needs to be 14 characters or less in addition to the fact that it is not a service type but in fact a service instance it is advertising. Clients may choose to also browse for these services for backwards compatibility purposes (minimal effect - only one client is known to do this) however they should not publish in this format. 
     115However this does not comply with RFC 2782 as the service name needs 
     116to be 14 characters or less in addition to the fact that it is not a 
     117service type but in fact a service instance it is advertising. Clients 
     118may choose to also browse for these services for backwards 
     119compatibility purposes (minimal effect - only one client is known to 
     120do this) however they should not publish in this format. 
    64121 
    65122 
     
    67124============== 
    68125 
    69 Clients should consider a couple of options when implementing the BitTorrent Zeroconf Peer Advertising and Discovery Extension specifically: 
     126Clients should consider a couple of options when implementing the 
     127BitTorrent Zeroconf Peer Advertising and Discovery Extension 
     128specifically: 
    70129 
    71130* an option to not advertise torrents via zeroconf 
     
    77136======== 
    78137 
    79 * I suspect the published peer-id need not be the hexed string as I have it now. A simple unique string may be all that is required (i.e. a hostname or a human readable computer name) with any uniqueness conflicts handled by zeroconf automatically. We ultimately only need to know what is on offer (as denoted by the info-hash) and where to get it (the resolved IP address). 
     138* I suspect the published peer-id need not be the hexed string as I 
     139  have it now. A simple unique string may be all that is required 
     140  (i.e. a hostname or a human readable computer name) with any 
     141  uniqueness conflicts handled by zeroconf automatically. We 
     142  ultimately only need to know what is on offer (as denoted by the 
     143  info-hash) and where to get it (the resolved IP address). 
    80144 
    81 * The mainline client and others may like to examine `pybonjour`_. pybonjour provides a pure-Python interface to  Apple `Bonjour`_ and compatible  DNS-SD libraries (such as  `Avahi`_).  
     145* The mainline client and others may like to examine 
     146  `pybonjour`_. pybonjour provides a pure-Python interface to Apple 
     147  `Bonjour`_ and compatible DNS-SD libraries (such as `Avahi`_). 
    82148 
    83 * Newer zeroconf implementations such as Bonjour include support for wide area service discovery. (Avahi can browse but not publish these yet). This may be another consideration in support of this BEP.  
     149* Newer zeroconf implementations such as Bonjour include support for 
     150  wide area service discovery. (Avahi can browse but not publish these 
     151  yet). This may be another consideration in support of this BEP. 
    84152 
    85153* May make a nice companion to BEP 9. 
     
    89157========== 
    90158 
    91 .. Zeroconf: Zero Configuration Networking (Zeroconf) 
    92    (http://www.zeroconf.org) 
     159.. _`Zeroconf`: Zero Configuration Networking (Zeroconf) 
     160   http://www.zeroconf.org 
    93161 
    94 .. mDNS: Multicast Domain Name System (mDNS) 
    95    (http://www.multicastdns.org) 
     162.. _`mDNS`: Multicast Domain Name System (mDNS) 
     163   http://www.multicastdns.org 
    96164 
    97 .. DNS service-discovery: DNS service-discovery (DNS-SD) 
    98    (http://www.dns-sd.org) 
     165.. _`DNS service-discovery`: DNS service-discovery (DNS-SD) 
     166   http://www.dns-sd.org 
    99167 
    100 .. Avahi: Avahi 
    101    (http://www.avahi.org) 
     168.. _`Avahi`: Avahi 
     169   http://www.avahi.org 
    102170 
    103 .. Bonjour: Apple's Bonjour 
    104    (http://developer.apple.com/networking/bonjour/) 
     171.. _`Bonjour`: Apple's Bonjour 
     172   http://developer.apple.com/networking/bonjour/ 
    105173 
    106 .. pybonjour: pybonjour 
    107    (http://o2s.csail.mit.edu/o2s-wiki/pybonjour) 
     174.. _`pybonjour`: pybonjour 
     175   http://o2s.csail.mit.edu/o2s-wiki/pybonjour 
    108176 
    109177