[BitTorrent] Re: bt2 protocol features

Justin Cormack justin at street-vision.com
Mon Jun 7 17:25:03 EDT 2004


 
> The reason to have small blocks is to have a low startup time (time 
> until first block is complete) and so you don't need to discard much 
> data in case a block verification fails.

thats not a very good reason, as block verify failure is a very rare event.
There are some other good reasons for having small blocks though. It would
be nice to have a BT filesystem module, and a small block size would map
better to this (though is not essential even with the current protocol, you
just have to cache enough to be able to do the sha1sums, though the multi
file stuff now is really horrible to do this with). I was thinking
of writing one when I finish my client.

> The reason to have large blocks is to decrease the amount of overhead 
> the HAVE messages generate, the amount of hashes you need and the amount 
> of state the client needs to maintain.

Though the client needs to maintain the partial block info at the moment.
I am just getting to this stage in coding and there are some issues related
to this - if you keep this data per peer, do you throw away partial blocks
if the peer dies for example.

> > more compact descriptor than a bitmap, by specifying ranges of blocks
> > you have and dont have, as these are particularly short in the cases of
> > clients with all or none of the blocks, and also for clients that dont
> > download blocks completely randomly.
> 
> For a 10 gb torrent, the BITFIELD message is only 640 bytes, so I doubt 
> you can make it much shorter.
> A range would need two 32-bit integers and that'd take up the same 
> amount of space as 64 normal blocks, so you'd have to be large ranges.

I was thinking if you made blocks really small. At 10GB, with 4k blocks,
the bitmap is 312k which is rather big. But I think you could do rather
better most of the time with a range, or a tree of have dont haves. I
will try to come up with something more concrete to see if this is feasible.

I am writing a client for LAN type connections, aiming at 1Gbit+ performance,
so I do have some odd biases. Hopefully I will have finished enough soon to
start some benchmarking on some of the issues that concern me...

Justin




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/dkFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/BitTorrent/

<*> To unsubscribe from this group, send an email to:
     BitTorrent-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 



More information about the BitTorrent mailing list