Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multi tracker specification #82

Open
arvidn opened this issue Mar 7, 2018 · 5 comments
Open

multi tracker specification #82

arvidn opened this issue Mar 7, 2018 · 5 comments

Comments

@arvidn
Copy link
Contributor

arvidn commented Mar 7, 2018

I don't believe anyone has ever implemented the behavior specified by the multi-tracker extension, BEP12.

Specifically, uTorrent found it more useful to treat separate tiers as independent sources of peers, and will announce to trackers in separate tiers in parallel. Everyone seemed to expect and rely on this behavior so it was also implemented in libtorrent.

I propose the specification be updated to match the de-facto standard.

Now there's a private tracker that uses the multi-tracker extension in its torrents, but puts all trackers in the same tier. My reading of the specification (when I first implemented it in libtorrent) was that trackers in the same tier should be treated as load-balancing front-ends to the same peer database. Announces should be directed to a random host in that group, to evenly distribute the load.

I have not tested this, but this forum post suggests that uTorrent either doesn't support multiple trackers in the same tier, or it pins a single tracker to be used consistently within the tier (probably the latter).

The specification is not very clear on this point. We should clarify this as well.

Another aspect the specification is silent on is how &event=started and &event=stopped should be treated. Currently, libtorrent records whether it has sent a started event per tracker, regardless of tier. So this is not quite treating every tracker in a tier as just front-ends to the same database, since it will send started to the same tier multiple times, via different trackers.

Any thoughts on what the behavior should be?

@atomashpolskiy
Copy link

atomashpolskiy commented Mar 7, 2018

In fact there's at least one implementation that does exactly what's described in BEP-12 :) Though it does not disconnect from current peers upon switching between tiers, and I'm not sure if this behavior is consistent with BEP-27... as is announcing to multiple tiers in parallel, which means that the peer databases of different tiers become mixed with each other and ultimately converge to the same superset of peers (not to say that this is a bad thing). So yeah, there is definitely some confusion with multi-trackers and private trackers. Also, there are trackers, that are manually added by the user..

@arvidn
Copy link
Contributor Author

arvidn commented Mar 7, 2018

The specification doesn't mandate disconnecting any peers, at least not as far as I can tell.

The current use case for tiers, where they are all announced to independently, is have multiple trackers perform the same work, with the expectation that the majority of them will be down.

@ssiloti
Copy link
Contributor

ssiloti commented Mar 7, 2018

+1 on updating BEP 12 to match the de-facto standard behavior.

I think the current handling of events in libtorrent is probably the best choice. The other obvious option of sending one event per tier has much worse consequences if trackers within a tier do not share a backend.

In a ideal world tracker software would store a unique identifier on the backend and include that in every response. Then multiple trackers sharing a backend could be reliably identified.

@the8472
Copy link
Contributor

the8472 commented Mar 7, 2018

Another aspect the specification is silent on is how &event=started and &event=stopped should be treated. Currently, libtorrent records whether it has sent a started event per tracker, regardless of tier. So this is not quite treating every tracker in a tier as just front-ends to the same database, since it will send started to the same tier multiple times, via different trackers.

I believe opentracker does data replication via multicast between multiple nodes that ought to be published within the same tier. So treating a single tier as load-balancing frontends would be correct in that case.

Any thoughts on what the behavior should be?

Well, ideally something that's not load-multiplying when users or torrent sites paste dozens of trackers into a client. There are some sites that just add more trackers to the announce list of existing torrents.

Maybe start with announcing to all tiers and then settling for the one with the largest client count or at least querying the others less frequently?

@the8472
Copy link
Contributor

the8472 commented Mar 7, 2018

The specification doesn't mandate disconnecting any peers, at least not as far as I can tell.

But it does,

When a peer switches between trackers, the peer drops connections so that it cannot become an ongoing bridge between peers granted access from a private tracker and peers announcing to a public tracker. This partially mitigates the effect of an attacker modifying a metainfo file's announce-list and redistributing the metainfo file, e.g., via a public tracker web site.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants