[bittorrent] One connection for download and upload?

Michael Parker mgp at ucla.edu
Thu Nov 2 11:40:25 EST 2006


On Nov 2, 2006, at 8:22 AM, Yao-Chin Wu wrote:
> Dear all,
>
>     I am a college student and doing a project related to P2P  
> structure. Bittorrent is a excellent resource for us, and we are  
> trying to understand its code as much as possible.
>
>     Accroding to the Bittorrent client implemented by Bram Cohen,  
> it looks like using only one connection when peer A is downloading  
> a piece from peer B and peer B also wants to download a piece from  
> peer A ( one connection for downloading and uploading also). Is  
> that correct? Is there other implementatioins using seperated  
> connections for this situation? Which one may be better? Thank you  
> for your help!
>

Yes, the standard is that there is only one connection between them.  
I don't think there's much point to separated connections for  
uploading and downloading -- by using a single connection you can cut  
the overhead from the TCP headers in half. Also, if two different  
connections were used, that gives me the impression that each side is  
responsible for creating one of the connections (although not  
necessarily). But with the prevalence of NATs and firewalls today,  
you'd be running a greater risk of one side not being able to connect  
at all, and hence one side not being able to download or upload at all.

- Mike





More information about the BitTorrent mailing list