[bittorrent] Re: HAVE messages

Olaf van der Spek olafvdspek at gmail.com
Thu Jun 23 06:10:59 EDT 2005

On 6/23/05, Elliott Mitchell <ehem at m5p.com> wrote:
> If you're in a heavily seeded swarm, your peers will never send HAVE
> messages as seeds will only need BITFIELD messages to advertise their
> status. In a fresh swarm with one seed, your peers will end up sending
> HAVE messages for every piece. The average is likely to be one HAVE

For 1/2 of the pieces if you don't send HAVEs to peer that already
have that pieces.

> Most clients request blocks of 32K at a time (while the baseline defaults
> to 16K), for which it takes 8 messages to complete a piece. Multiplying

Piece size isn't fixed.

> those two numbers, we should expect to receive a wave of HAVE messages
> every 32 blocks we download. So with 32 peers each HAVE message will be

Do you assume your peers download as fast as you?

> I suspect weighting the random number generator may be a better approach
> than simply choosing those pieces first though. Notably at the start it
> is more notable that pieces all peers have are worthless (you won't be
> able to upload them), than that rare pieces are valuable.

But not that valuable, as it's less likely you can complete them
before being choked.
> I haven't seen the mainline implement it despite being obvious. I figure
> there is a reason, but I've never seen it mentioned.

It's 'harder' to implement and your peers don't see your exact
progress (neither of which is really an issue).
> At the same time I doubt 5 is sufficient in the general case. Figure DSL
> lines have around 50ms round-trip, and 2-10mbps (I've heard of 100mbps in
> some places). So 10-50KB in-flight, about 3 requests; perhaps the
> defaults aren't as bad as I thought, and 5 might work here. Local
> transfers, or very high bandwidth areas might do 5ms round-trip and
> 1000mbps though. In this case we see a need for 30 requests in-flight,
> and the defaults don't work.

It's an issue when bandwidth * delay is high.

More information about the BitTorrent mailing list