[bittorrent] bittorrent] One connection for download and upload?

Yao-Chin Wu yaochinwu at yahoo.com
Fri Nov 3 01:08:27 EST 2006


Thank you for your prompt response.

I have this idea mainly because it is easier to implement. The thread handles its own inbound or outbound connection can focus only on its own job. Besides, in typical case, a peer may not always need to send and receive data from the same peer. But, it seems like it is not a good idea at all. If other members can also provide your opinion, that will also be appreciated.

BTW, Mike mentioned that one connection is the standard in this situation. And there is a short paragraphe in Bittorrent protocal, which says,"Peer connections are symmetrical. Messages sent in both directions look the same, and data can flow in either direction." Does your point come from here? If it is the standard, there must be no Bittorrent client designed to use separated connections because it could even fail to work with other existing implmentation: one peer cannot handle download and upload in one connectoin while its uploader assumes it could, and send a request message through this connection and would never get response. Thank you.

Yao-Chin


Alan McGovern <alan.mcgovern at gmail.com> wrote: Hi,

There's no point in not using the same connection to both send and receive data. No program that i know of would use a seperate socket to send data and receive data from the the same host, it's inefficient and awkward. 

Thanks,
Alan.

(forgot to hit "reply to all" the first time, sorry)

 
On 11/2/06,  Michael Parker <mgp at ucla.edu> wrote:  
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


_______________________________________________ 
BitTorrent mailing list
BitTorrent at lists.ibiblio.org
 http://lists.ibiblio.org/mailman/listinfo/bittorrent 


  
 _______________________________________________
BitTorrent mailing list
BitTorrent at lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/bittorrent


 
---------------------------------
Cheap Talk? Check out Yahoo! Messenger's low  PC-to-Phone call rates.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ibiblio.org/pipermail/bittorrent/attachments/20061102/fe7807da/attachment.html 


More information about the BitTorrent mailing list