[bittorrent] data exchange

Adrian Ulrich torrent at blinkenlights.ch
Tue Mar 31 01:49:38 EDT 2009


Hi,

> are there any resources specifically about the on-wire protocol?

http://wiki.theory.org/BitTorrentSpecification#Peer_wire_protocol_.28TCP.29

has everything you need to know

> the client sets up tcp connections with the (some of the) peers it retrieves
> from tracker and starts with a handshake, then it continues with "an
> alternating stream of length prefixes and messages". the files are sent in
> the 'piece' messages?

Yes: The peer will send out some 'interested' messages to peers that have interesting (un-downloaded)
pieces. After receiving an unchoce message from some of them it will send 'request' messages
and should receive 'piece' messages.

Wireshark/Ethereal understands the BitTorrent protocol so you can use it to peek into
'live' bittorrent traffic. This might help you to understand the protocol and how it's used.

Regards,
 Adrian





More information about the BitTorrent mailing list