source: trunk/misc/azureus.txt @ 2726

Last change on this file since 2726 was 2726, checked in by joshe, 15 years ago

Add URL for some more documentation of the azureus protocol.
Fix typo.

File size: 2.8 KB
Line 
1This is a somewhat incomplete description of the Azureus messaging
2protocol which is further described here:
3
4http://www.azureuswiki.com/index.php/Azureus_messaging_protocol
5
6Like normal bittorrent messages, all azureus messages begin with the
7length of the rest of the message in bytes as a 4-byte integer in
8network byte order.  This length does not include the 4 bytes for the
9length itself.
10
11After that is another 4-byte network byte order integer containing the
12length of the following message id string in bytes, then the message
13id string, then a 1 byte integer containing the protocol version.  The
14current version is 1.
15
16The message payload format for various message IDs is below.
17
18AZ_HANDSHAKE
19payload is a bencoded dictionary:
20    identity:
21        string, 20 bytes client identity.  The identity should be
22        calculated once on startup similarly to the peer_id, except
23        than each byte should be completely random and not limited to
24        alphanumeric characters.
25    client:
26        string, client name.  eg: Transmission
27    version:
28        string, client version.  eg: 0.7
29    tcp_port: (optional)
30        int, tcp port for incoming peer connections.
31    udp_port: (optional)
32        int, udp listening port (what is this used for exactly?)
33    udp2_port: (optional)
34        int, udp non-data listening port (I don't know what this is for either)
35    handshake_type: (optional)
36        int, 0 for plain or 1 for crypto
37    messages:
38        list, each item is a dict for the supported messages and versions:
39            id:
40                string, message id
41            ver:
42                string, 1 byte version, currently 1
43
44AZ_PEER_EXCHANGE
45these messages should be sent approximately once a minute (is this true?)
46payload is a bencoded dictionary:
47    infohash:
48        string, 20 byte info_hash for the torrent
49    added:
50        list, each item is a 6 byte string for an IP address and port
51        added since the last peer exchange message.
52    added_HST:
53        string, one byte for each item in the added list.
54        Each byte is the handshake type (0 plain, 1 crypto) for the matching
55        item in the added list.
56    added_UDP:
57        string, two bytes for each item in the added list.
58        Each pair of bytes is the UDP port (network byte order) for the
59        matching item in the added list.
60    dropped:
61        same format as added, contains peers dropped since last peer exchange
62    dropped_HST:
63        same format as added_HST
64    dropped_UDP:
65        same format as added_UDP
66
67BT_KEEP_ALIVE
68zero-length payload
69
70The following messages all have the same payload as the corresponding
71bittorrent message, not including the bittorrent 4-byte length and
721-byte id.
73
74BT_CHOKE        - 0
75BT_UNCHOKE      - 1
76BT_INTERESTED   - 2
77BT_UNINTERESTED - 3
78BT_HAVE         - 4
79BT_BITFIELD     - 5
80BT_REQUEST      - 6
81BT_PIECE        - 7
82BT_CANCEL       - 8
Note: See TracBrowser for help on using the repository browser.