I just wrote this up to hopefully get some consistancy from
which to work from for a bittorrent zeroconf
protocol.
I would like to ask for some constuctive criticism and any
commentry from people as to how well it is
likely to work.
Thanks,
Robin Perkins
{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf330
{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique;
\f3\fmodern\fcharset77 Courier;\f4\fmodern\fcharset77 Courier-Bold;}
{\colortbl;\red255\green255\blue255;}
\paperw11900\paperh16840\margl1440\margr1440\vieww11520\viewh11340\viewkind0
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\qc\pardirnatural
\f0\b\fs36 \cf0 BitTorrent Zeroconf Client Extension
\fs24 \
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural
\f1\b0 \cf0 \
Robin Perkins\
\f2\i Draft 1
\f1\i0 \
14 April 2006
\f0\b\fs26 \
{\field{\*\fldinst{HYPERLINK "http://www.ether.net.au/~robin/bittorrent_zeroconf_ext.rtf"}}{\fldrslt
\f1\b0 http://www.ether.net.au/~robin/bittorrent_zeroconf_ext.rtf}}
\f1\b0 \
\f0\b \
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural
\cf0 \ul \ulc0 Purpose
\f1\b0\fs24 \ulnone \
This document aims to outline an extension for BitTorrent clients to allow them to find peers on a local-link network using the zeroconf 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.\
\
Many networks today consist of computers that have a fast network connection (tens of megabits) to a local area network, in addition to a relatively slower (parts or a few megabits) 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 local-link network wish to download the same torrent at the moment they only share packets across their slow internet connection. The
\f2\i BitTorrent Zeroconf Client Extension
\f1\i0 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.\
\
\f0\b\fs26 \ul Requirements
\f1\b0\fs24 \
\ulnone In order to facilitate the
\f2\i BitTorrent Zeroconf Client Extension
\f1\i0 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:\
\'a5 Apple's Bonjour ({\field{\*\fldinst{HYPERLINK "http://developer.apple.com/networking/bonjour/"}}{\fldrslt http://developer.apple.com/networking/bonjour/}}) for Mac OS X (included by default), Windows and POSIX systems\
and\
\'a5\'caAvahi available from ({\field{\*\fldinst{HYPERLINK "http://avahi.org"}}{\fldrslt http://avahi.org}}) recommended for Linux and BSD clients and already available in many Linux and BSD distributions.\
\
\f0\b\fs26 \ul Method
\f1\b0\fs24 \
\ulnone 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). Then publish a subservice that is the torrent info hash (in hex). The result will be something in the form of:\
\
\f3 <peer-id>._<info-hash>._bittorrent._tcp.
\f1 \
e.g.\
\f4\b 4d336d342d312d2d343834616435313564343437
\f3\b0 ._32f17bbf96bdc77de85bb91ff8d56f124e817c0a._bittorrent._tcp.
\f1 \
\
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.\
\
Clients will need to browse for _<info-hash>._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. Note: The current Macintosh standard bittorrent client does have a zeroconf implementation built in that publishes its services in the form of: \
\
\f3 _bittorrent-<info-hash>._tcp.
\f1 \
i.e.\
\f3 _bittorrent-32f17bbf96bdc77de85bb91ff8d56f124e817c0a._tcp.\
\f1 \
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 - only one client is known to do this) however they should not publish in this format.\
\
\f0\b\fs26 \ul Considerations\
\f1\b0\fs24 \ulnone Clients should consider a couple of options when implementing the
\f2\i BitTorrent Zeroconf Client Extension
\f1\i0 specifically:\
\'a5 an option to not advertise torrents via zeroconf\
\'a5 an option not to upload limit local-link peers (or possibly have a separate rule).\
\
\
}
_______________________________________________
avahi mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/avahi