[BitTorrent] BT2 & hash trees

Gregorio Roper gregorio at gmx.li
Sun Jul 18 09:08:09 EDT 2004


I am currently working on a new BT implementation in java (based on LimeWire, whether it 
makes its way into the LimeWire mainline is highly uncertain, though) and after reading 
the discussion about the hash trees I have a couple of suggestions (which are mostly 
rather selfish because they would implementing BT2 for me a lot easier).

Is there any chance of using a block size of 1024 bytes for the hash tree, since it 
completely removes any limitations imposed by the block size, even for small files and 
it's also the block size recommended by THEX[1] which is used by several p2p networks that 
could then be used as a backup in case the tracker fails.

I didn't find any comment on how the pieces of a torrent will be addressed. If I 
understood correctly that BT2 is supposed to allow cross-trading, may I suggest that the 
pieces be addressed similar to: <file root hash><log2(pieceSize) or level in hash 
The <log2(pieceSize)> part would give me the advantage that the piece size of the two 
torrents doesn't even have to be the same, so you don't have to define a fixed piece size 
in the protocol.
A further advantage of using either <log2(pieceSize)> or the level in the hash tree (which 
is isomorph to the piece size) is that I can save HAVE messages:
If I download an 2GB file and although I have the first 16 levels of a hash tree (allowing 
a piece size as low as 64KB) from the .torrent file, I may decide dynamically to announce 
only completed 1MB pieces (and download in 1MB pieces). I could also adjust the size of 
the initial BITFIELD message by adding an identifier for the piece size.
I believe this would reduce the overhead at almost no added complexity. I mean you will 
need the piece size anyway to understand a BITFIELD or HAVE message and it doesn't make 
any difference whether you get it from the .torrent file or from the BITFIELD / HAVE message.

[1] http://www.open-content.net/specs/draft-jchapweske-thex-02.html


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!

Yahoo! Groups Links

<*> To visit your group on the web, go to:

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

<*> Your use of Yahoo! Groups is subject to:

More information about the BitTorrent mailing list