3 ms·
Sufficiently evolved torrent clients follow a tit-for-tat protocol: - If you're nice with me I'll be nice with you - If you're mean with me I'll be mean with
by rakoo 2y ago
Sufficiently evolved torrent clients follow a tit-for-tat protocol:
- If you're nice with me I'll be nice with you
- If you're mean with me I'll be mean with you
This is the best answer for the Prisoner's dilemma (https://en.wikipedia.org/wiki/Prisoner's_dilemma https://en.wikipedia.org/wiki/Prisoner's_dilemma) on the long run, ie a situation where peers don't trust each other but will both gain if both cooperate.
In bittorrent it's typically implemented as follows: peers start by sending a very minimal content, and see what the other replies. If they reply with low enough latency then slowly increase the amount of content that is sent and see if they reply with the same increased amount of content; if they do, continue up to the max of what the network link allows (in combination with other peers of course). If at some point the other peer doesn't send something equivalent (even though we know they have it and we asked for it) then that peer can be cut off for not being cooperative.
Situation is different for seeds of course, because they have everything and want nothing, but they can have a similar behaviour -- start sending a little, increase slowly over time
- BonoboIO 2y agoDid knew, that the client does that with the tit-for-that. In an ideal world the network would prioritize to upload to high speed like webseeds, so the webseeds can distribute even faster for everyone else. Or do I make a mistake in my mind and the network already distributes efficiently and it is not needed.
- rakoo 2y agoA single node distributing everything "because it's fast" isn't really the architecture that bittorrent is aiming for, and I don't think it's one we should be aiming for. Try downloading any well distributed torrent and you'll see your bandwidth capacity automatically maxxed out. The gradual decision with an emerging selection of better sources always leads to that. Bittorrent doesn't really have an efficiency problem
- andai 2y ago> [tit for tat] is the best answer for the Prisoner's dilemma on the long run This is fascinating. Have there been any simulations about this? I'm sure they've looked into this in game theory, but I'm wondering if you have a big swarm of torrent clients, does the scale of the population change the outcome, or is it the same? (It seems like it would be wise when designing the torrent clients to run such simulations, so I'm thinking this probably has been done at some point.)
- __MatrixMan__ 2y agoIt's only the best answer if the other party is bothering to seek the best answer in real time, and in ways that you can't predict. If your opponent is governed by some algorithm, which is the case for torrent clients, you may need to depart from tit for tat in order to break them out of a needlessly adversarial mode. Or, if you're feeling like the bad guy today, you might need to depart from tit for tat to put them in an irrationally cooperative mode.
- rakoo 2y agoIf a peer doesn't respond quickly enough they can be disconnected from and marked as bad. Even if they had good intentions their latency might be too high and it's good to disconnect from them. Check out this very nice link from a sibling comment: https://ncase.me/trust/ https://ncase.me/trust/. You'll see that an adversarial node either is too adversarial and will be cut off, or still gives just enough to not be cut off but if there are other, more cooperative nodes, they will be favored. Being adversarial doesn't work in the long run.