Skip to content
This repository was archived by the owner on Feb 8, 2023. It is now read-only.
This repository was archived by the owner on Feb 8, 2023. It is now read-only.

Alternative BitSwap strategies #20

Open
@ghost

Description

There is room for more Bitswap strategies.

This one prefers the peer with the best debt ratio, while still seeding to peers with a worse ratio, if there is no better peer to seed to.

larsg, couple of relatively obvious things i see re implementation details
1: when you decide not to send a block, you do so by introducing a 10s delay before retry. this is possibly the worst possible thing to do
2: slightly related (since it triggers 1, especially when just connecting to someone for the first time... at least on paper), it tries way too hard to be "fair" and invents the wrong 0-sum game from an optimal throughput standpoint
larsg, i was actually planning to hang out in #ipfs if/when things settle down a bit
it's the closest thing to usable content-addressable-networking that i've come across
you are very much invited to
(i'm reading up what you mean about the 0-sum game)
i haven't gotten very close to bitswap yet
oh the ledger and debt ratio?
basically, you try to be fair by keeping upload/download ratio per peer at close to 1.0 (and enforce it with the stupid delay noted before)
ah yep
total data transferred isn't a terribly good metric to use if your goal is moving bits as fast as possible
better would be to send blocks to peer with the most favorable ratio until you've saturated your upload
if the only person who wants something has a terrible ratio, they still get it. so they can't hurt other people's chances of getting data from you
so that the peer's ratio gets worse and we start letting another peer leech?
right, or another peer who already had a better ratio decides they want a new block
yeah
that sounds simple enough that it could actually work :P
mind if i hand that on?
you are encouraged to
great
it's vaguely similar in end result to how cjdns's QoS is supposed to work
that is, the way to get higher priority is to ask for less
it self-corrects without depending on any constants that might be picked wrong (see: the 10s timeout)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions