[bittorrent] TCP question

Adrian Ulrich torrent at blinkenlights.ch
Mon Jul 10 15:04:48 EDT 2006

> After peer B have finished downloading a piece from peer A , if peer B know
> peer A have some pieces which B don't have , B is still interested in A .But
> if  these pieces are not rarest for B for a long time , so that B will
> select other peer to download its rarest piece ,during this time, do B still
> remain the TCP connection with A?

Well: If peer B is unchoked it would make sense for B to request pieces
from A even if they are not so-very-rare.

If, for some reason, peer B isn't willing to request pieces from A it
can choke itself.

I guess that most clients will close a connection with state
 am_choking = 1 && peer_choking = 1
after a 'few' minutes. (My client does .. after about 30 min.)

> By the way, how  can you make the conclusion ?

Which point do you mean exactly?
Your first question? (-> is the tcp-connection re-used for the next

Well: Startup some common BT client and run snoop/ethereal or
have a look at http://wiki.theory.org/BitTorrentSpecification (Queuing)

> from the BitTorrent spec

The BT-Specs are (sadly) non-existent :-(
 http://wiki.theory.org/BitTorrentSpecification is so far the
 best documentation known to me.

 Someone should really write something like an RFC for BT...

 The source of Mainline isn't an useable form of
 spec/documentation... or would you read the source
 of Sendmail or Bind if you needed to implement SMTP/DNS ?


More information about the BitTorrent mailing list