BEP: 4
Title: Assigned Numbers
Version: $Revision$
Last-Modified: $Date$
Author:  David Harrison <dave@bittorrent.com>
Status:  Active
Type:    Process
Created: 10-Jan-2008
Post-History:


This document describes the known bit allocations and message IDs for
the BitTorrent protocol.  To request a bit allocation contact
editor@bittorrent.org.  Contact the same address if you are aware of
any omissions.

Reserved Bit Allocations
========================

::

 reserved[0]
 0x80  Azureus Messaging Protocol

 reserved[2]
 0x08  BitTorrent Location-aware Protocol (no known implementations)

 reserved[5]
 0x10  LTEP (Libtorrent Extension Protocol)
 0x02  Extension Negotiation Protocol
 0x01  Extension Negotiation Protocol

 reserved[7]
 0x01  BitTorrent DHT
 0x02  XBT Peer Exchange 
 0x04  suggest, haveall, havenone, reject request, and allow fast extensions
 0x08  NAT Traversal

There are known collisions::

 reserved[0]
 0xFF  BitComet Extension Protocol

 reserved[1]
 0xFF  BitComet Extension Protocol

 reserved[7]
 0x01  XBT Metadata Exchange (implemented only in XBT)

It is recommended that further extensions use the Extension Protocol
[#BEP-10]_, a.k.a., LibTorrent Extension Protocol (LTEP).  With LTEP,
extension bit collisions become impossible since no new extension bits
are allocated.  With LTEP, message ID collisions also become
impossible because message IDs are allocated on demand at the
beginning of the connection.  Extension *name* collisions become
possible, but the probability is much less likely.

Reserved Message IDs
====================

::

 Core Protocol:
 0x00   choke
 0x01   unchoke
 0x02   interested
 0x03   not interested
 0x04   have
 0x05   bitfield
 0x06   request
 0x07   piece
 0x08   cancel

 DHT Extension:
 0x09   port

 Fast Extensions:
 0x0D   suggest
 0x0E   have all
 0x0F   have none
 0x10   reject request
 0x11   allowed fast

 Additional IDs used in deployed clients:
 0x14   LTEP Handshake (implemented in libtorrent, uTorrent,...)

References
==========

.. [#BEP-10] BEP_0010.  Extension Protocol. Norberg, Strigeus, Hazel.
   http://www.bittorrent.org/beps/bep_0010.html

Copyright
=========

This document has been placed in the public domain.



..
   Local Variables:
   mode: indented-text
   indent-tabs-mode: nil
   sentence-end-double-space: t
   fill-column: 70
   coding: utf-8
   End:
