Peer exchange or PEX is a
communications protocol
A communication protocol is a system of rules that allows two or more entities of a communications system to transmit information via any variation of a physical quantity. The protocol defines the rules, syntax, semantics (computer science), sem ...
that augments the
BitTorrent
BitTorrent is a Protocol (computing), communication protocol for peer-to-peer file sharing (P2P), which enables users to distribute data and electronic files over the Internet in a Decentralised system, decentralized manner. The protocol is d ...
file sharing protocol. It allows a group of users (or
peers) that are collaborating to share a given file to do so more swiftly and efficiently.
In the original design of the BitTorrent file sharing protocol, peers (users) in a file sharing group (known as a "swarm") relied upon a central computer server called a
tracker to find each other and to maintain the swarm. PEX greatly reduces the reliance of peers on a tracker by allowing each peer to directly update others in the swarm as to which peers are currently in the swarm. By reducing dependency on a centralized tracker, PEX increases the speed, efficiency, and robustness of the BitTorrent protocol.
Description
Users wishing to obtain a copy of a file typically first download a
torrent file that describes the file(s) to be shared, as well as the
URL
A uniform resource locator (URL), colloquially known as an address on the Web, is a reference to a resource that specifies its location on a computer network and a mechanism for retrieving it. A URL is a specific type of Uniform Resource Identi ...
s of one or more central computers called
trackers that maintain a list of peers currently sharing the file(s) described in the .torrent file. In the original BitTorrent design, peers then depended on this central tracker to find each other and maintain the swarm. Later development of
distributed hash table
A distributed hash table (DHT) is a Distributed computing, distributed system that provides a lookup service similar to a hash table. Key–value pairs are stored in a DHT, and any participating node (networking), node can efficiently retrieve the ...
s (DHTs) meant that partial lists of peers could be held by other computers in the swarm and the load on the central tracker computer could be reduced. PEX allows peers in a swarm to exchange information about the swarm directly without asking (
polling) a tracker computer or a DHT. By doing so, PEX leverages the knowledge of peers that a user is connected to by asking them for the addresses of peers that they are connected to. This is faster and more efficient than relying solely on one tracker and reduces the processing load on the tracker. It also keeps swarms together when the tracker is down.
Peer exchange cannot be used on its own to introduce a new peer to a swarm. To make initial contact with a swarm, each peer must either connect to a tracker using a ".torrent" file, or else use a router computer called a
bootstrap node to find a distributed hash table (DHT) which describes a swarm's list of peers. For most BitTorrent users, DHT and PEX will start to work automatically after the user launches a BitTorrent client and opens a .torrent file. A notable exception is "private torrents" which are not freely available; these will commonly disable DHT.
Peer Exchange Conventions
Extensions to BitTorrent such as PEX are typically implemented using one of two common extension protocols, AZMP or LTEP. Both types of peer exchange send messages containing a group of peers to be added to the swarm and a group of peers to be removed.
It was agreed between the
Azureus and
μTorrent
μTorrent, or uTorrent (see pronunciation), is a proprietary adware BitTorrent client owned and developed by Rainberry, Inc. The " μ" (Greek letter " mu") in its name comes from the SI prefix "micro-", referring to the program's small memo ...
developers that any clients which implement either of the mechanisms above try to obey the following limits when sending PEX messages:
* There should be no more than 50 added peers and 50 removed peers sent in any given PEX message.
* A peer exchange message should not be sent more frequently than once a minute.
Some clients may choose to enforce these limits and drop connections from clients that ignore them.
DHT
To create a PEX protocol providing a uniformly-distributed peer selection, one could form a small distributed hash table (DHT) local to a torrent. For each desired new peer one would look up a (uniformly) random key, and use the node responsible for the key as a new peer. This is conceptually simple but would require quite some overhead.
For "trackerless" torrents, it is not clear if PEX provides any value since the
mainline DHT
Mainline DHT is the name given to the Kademlia-based distributed hash table (DHT) used by Comparison of BitTorrent clients, BitTorrent clients to find peers via the BitTorrent protocol. The idea of using a DHT for distributed tracking in BitTorrent ...
can distribute load as necessary. Each DHT node acting as a tracker may store only a subset of the peers, but these are ''maximal'' subsets constrained only by DHT node load rather than by a single peer's view. Private torrents commonly disable the DHT, and for this case, PEX might be useful provided the peer obtains enough peers from the tracker.
Versions
There are three incompatible PEX implementations (making distinct "networks" in swarm)
*
Vuze – introduced in Azureus
*
BitComet
BitComet (originally named SimpleBT client from versions 0.11 to 0.37) is a cross-protocol BitTorrent, HTTP and FTP client written in C++ for Microsoft Windows and available in 52 different languages. Its first public release was version 0.28. T ...
– proprietary – introduced in BitComet, from version 1.19 supports BEP11, compatible with MainLine
*
MainLine – introduced in μTorrent
Clients supporting peer exchange
Most BitTorrent clients use PEX to gather peers in addition to trackers and DHT. With the 3.0.5.0 release of Vuze, all major BitTorrent clients now have compatible peer exchange.
Each of these clients implement some version of peer exchange:
*
aria2, μTorrent PEX support
*
Vuze, formerly Azureus, and clients based on it (The Vuze PEX is only compatible with the Transmission client. PEX with other clients has been implemented into Vuze and into Azureus from 3.0.4.3 onwards)
*
BitComet
BitComet (originally named SimpleBT client from versions 0.11 to 0.37) is a cross-protocol BitTorrent, HTTP and FTP client written in C++ for Microsoft Windows and available in 52 different languages. Its first public release was version 0.28. T ...
supports PEX using a proprietary protocol in its older versions. Starting with v.1.19 it also added support for the μTorrent/Mainline implementation of PEX, based on the Extension Protocol.
*
Bitflu
*
BitTorrent
BitTorrent is a Protocol (computing), communication protocol for peer-to-peer file sharing (P2P), which enables users to distribute data and electronic files over the Internet in a Decentralised system, decentralized manner. The protocol is d ...
*
KTorrent has implemented full μTorrent PEX support as of 2.1 RC1
*
libtorrent
libtorrent is an open-source implementation of the BitTorrent protocol. It is written in and has its main library interface in C++. Its most notable features are support for Mainline DHT, IPv6, HTTP seeds and μTorrent's peer exchange. libtor ...
and clients based on it (
Deluge
A deluge is a large downpour of rain, often a flood.
The Deluge refers to the flood narrative in the biblical book of Genesis.
Deluge or Le Déluge may also refer to:
History
*Deluge (history), the Swedish and Russian invasion of the Polish-L ...
,
qBittorrent
qBittorrent is a cross-platform free and open-source BitTorrent client written in native application, native C++. It relies on Boost (C++ libraries), Boost, OpenSSL, zlib, Qt (software), Qt 6 toolkit and the libtorrent-rasterbar library (for th ...
,
MooPolice) compatible with
μTorrent
μTorrent, or uTorrent (see pronunciation), is a proprietary adware BitTorrent client owned and developed by Rainberry, Inc. The " μ" (Greek letter " mu") in its name comes from the SI prefix "micro-", referring to the program's small memo ...
*
Tixati
Tixati is a proprietary Linux and Windows BitTorrent client written in C++. It has standalone and portable versions with each new client version.
Features
In addition to standard BitTorrent client-sharing functions, Tixati provides inte ...
*
μTorrent
μTorrent, or uTorrent (see pronunciation), is a proprietary adware BitTorrent client owned and developed by Rainberry, Inc. The " μ" (Greek letter " mu") in its name comes from the SI prefix "micro-", referring to the program's small memo ...
*
Opera
Opera is a form of History of theatre#European theatre, Western theatre in which music is a fundamental component and dramatic roles are taken by Singing, singers. Such a "work" (the literal translation of the Italian word "opera") is typically ...
9.5, μTorrent PEX support
*
qBittorrent
qBittorrent is a cross-platform free and open-source BitTorrent client written in native application, native C++. It relies on Boost (C++ libraries), Boost, OpenSSL, zlib, Qt (software), Qt 6 toolkit and the libtorrent-rasterbar library (for th ...
, μTorrent PEX support
*
rTorrent
*
Transmission (compatible with both the μTorrent and Vuze implementations)
*
XTorrent being based on Transmission source code, equally fully supports the Vuze and μTorrent implementations as of version 1.0 (v40)
Xtorrent P2P (for Mac OS X)
/ref>
References
{{DEFAULTSORT:Peer Exchange
BitTorrent