-
Notifications
You must be signed in to change notification settings - Fork 104
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
BEP: Extensions supported by tracker #145
Comments
how would you expect clients to act on this tracker response? normally clients just include extra parameters on the GET request as best-effort, assuming they will be ignored if not supported. Is that problematic? In my mind, one of the most significant improvements that could be supported by something like this would be if the tracker responds with its max HTTP pipeline depth, allowing clients to pipeline announces to different torrents over the same connection. |
@arvidn Clients will send announce requests with only the get parameter properties linked to the extensions list response. The concept of pipelining is indeed quite useful. As far as I know, there's no standardized limit defined in the RFC, leaving it up to individual implementations. Most servers have a reasonable depth, and it's worth considering whether pipelining should be linked to HTTP/2 multiplexing in this context as well? |
In any case, I see no reason not to include extensions supported by the tracker server in the list. |
The point of v2 hashes being truncated is to preserve the DHT protocol and the tracker protocol. The tracker doesn't need to recognise whether the hash is a sha1-hash or a truncated sha-256 hash. I suppose if you have a whitelist of valid hashes, you could "not support" v2 by not whitelisting them. Is that what you mean?
In order for there to be a second announce sent via IPv6, the tracker hostname must resolve to and IPv6 address and it must be connectable via that IP address. What does it mean for a tracker to have its hostname resolve to an IPv6 address, and be reachable via IPv6, but not support IPv6?
I seem to recall that, 15 years ago, Apache had a quite unreasonable default of 5 pipelined requests. Perhaps this situation has improved. |
Clients initiate two parallel requests for hybrid torrents. While refining TorrentPier's announce script, we encountered a challenge in obtaining the complete v2 hash for finding it in the database and updating statistics. Instead, we resorted to using a 'LIKE' SQL operator with to find matching hashes. Unfortunately, this approach proved to be less performant than anticipated, especially with large tables, due to index bypass. Furthermore, during discussions with the administration of a prominent tracker regarding the implementation of the BitTorrent v2 protocol, particularly in allowing hybrids, they raised a concern about the potential strain posed by parallel hybrid requests, which could add to the server load. For trackers endorsing the v2 protocol, a significant reduction in the number of requests for hybrids can be achieved by exclusively announcing the full v2 hash, since it belongs to the same info. Regarding IPv6, you are absolutely correct. It slipped from my mind for a moment. The default setting for HTTP/2 concurrent streams in Nginx is 128, unfortunately, I wasn't able to locate precise information regarding Apache. |
A client still has to do both requests to obtain peer lists for both infohashes to be able to tell v1 and v2 peers apart and to know which hash to send in the handshake.
This seems like an implementation detail of the particular tracker that could easily be worked around in various ways and shouldn't require protocol changes. |
For hybrid torrents, the info hashes remain consistent as they are registered under the same topic for the tracker. AFAIK for peer handshakes, connection upgrading helps in this scenario.
Overall, there's nothing what can't be solved here, but is there any need to truncate info-hashes for the future, summing up complexity with workarounds, wouldn't it be beneficial to provide full hashes for trackers requesting them? Also my proposal involves reducing the load through the utilization of additional requests or queries. |
There seems to be some misunderstanding here. If a torrent is hybrid it means current clients should be able to support both v1 and v2 peers. Which means they need to obtain separate peer lists because in theory these swarms could be completely disjoint - a bunch of (legacy) v1-only and (future) v2-only peers that all happen to have ingested that hybrid torrent. That in turn means a hybrid peer has to contact the tracker twice to get those peer lists to know which peer it has to contact with the v1 hash and which with the v2 hash. The peers might support both, but this is not guaranteed.
There are no plans to send the full hashes because peer discovery mechanisms (trackers, DHT) have no essentially no need for the full infohashes. Internally a tracker can entirely deal with the truncated form without loss of functionality. And I think you're overstating the complexity. Prefix lookups ought to be trivial. They're simple string operations. Sure a particular implementation may happened to have chosen a data structure that doesn't support it, but that doesn't mean alternatives are inherently more complex. |
Since most clients support v1, for us this approach with hybrids came up: We save statistics only for its v1 hash announcements (recording peer uploads and downloads) and responding. For its v2 announcements, response is the same as we would respond for a provided v1 hash (we use cached response with same peers list), but this is applicable only for hybrid torrents; v2-only torrents are handled through a separate statistics. Could you please clarify what you mean by v2-only (future) peers? Yes, there was some confusion regarding the terms "tracker" and "indexer". I think that most people commonly use "tracker" to refer to both, as an indexer typically operates with its own tracker software.
My concerns about adoption of the BitTorrent v2 for tracker (indexers) are as follows: The indexer's tracker is unable to distinguish the provided info-hash version. Consequently:
All of these issues are interlinked. I'm unsure of any potential issues that could arise from sending full v2 hashes to trackers (specifically indexers) that explicitly request them. This action shouldn't interfere with existing client implementations of BEP52. |
For now. We have to plan for the long term where eventually pure v2 clients may be written.
Yeah that's not really correct. Probably not particularly harmful at the moment but semantically incorrect. And specs certainly shouldn't be written with such behavior in mind.
The torrent file may be hybrid but clients might only support v2 at some point in the future. The hybrid format is meant as a way to enable gradual transition towards that future.
For private torrent sites.
1: I don't see what makes v2 so special here about database hits. If database lookups are costly your server process should have some in-memory negative hit cache (something like a 2: As explained above, you can't do that because clients operate on the model that v1 and v2 torrents are distinct swarms. So they must announce both for hybrid torrents. You're basically operating on an incompatible model. 3: That's a quite peculiar argument. You'd just use those extra bits to tell v1 and v2 torrents apart based on the length of the hash and fast-reject them? That's not really why we picked a longer hash. So as far as purpose goes, there still is not really one for conveying those extra bits to a tracker. Anyway, what magnitude of requests per second and how many database rows are we talking about? I want to get an idea whether this really is a protocol issue or an application issue. |
Okay, I didn't expect that change, in fact I didn't expect any alterations to v2 from now, thanks for clarifying this. I observed this feature in BiglyBT but was uncertain if it would eventually become a standard. Sending a truncated v2 hash introduces unnecessary complexity to the development process. We considered preserving the current model for now, as we're uncertain about future modifications. Even if accounting stats for hybrid torrents were to fail at some point due to the absence of v1 announces for hybrids, it would serve as a strong motivation to either update the tracker software or transition to v2-only torrents. Nevertheless, my BEP proposal remains. |
What are your referring to as having changed?
It's standard as so far as it's documented here.
I don't think you've demonstrated that, but perhaps the details are in exactly what you mean by "the development process". As the8472 pointed out, a tracker (as defined by both BEP52 and the original BEP3) doesn't need to concern itself with full sha-256 info-hashes at all. An index probably would though. If you need a mapping from truncated v2 -> full v2 or vice versa, that sounds like one more column in a database table. So, some complexity for you if you need it. But weigh that against the simplification for everyone who doesn't. They can use unmodified trackers and it just works.
I think it would be helpful to include some (strong) motivations in the BEP. Surely you wouldn't expect announces to be two-phase, where these extensions are looked up (best-effort) first, and then announced. As far as I can tell, I don't see how or why any client would change behavior based on the v2 signal you propose. This could also probably be clarified, to make a stronger argument. |
Perhaps we could say that a client should keep track of the v1 and v2 announce interval separately. Then a tracker can set a higher announce interval for a v2 hash if most clients are using v1 anyway (or support upgrades) which should lessen most of the load. Or vice versa, if v2 support is widespread the tracker can decrease the v1 rate. |
Here's a proposal in
.rst
format:https://gist.github.com/kovalensky/2d0e6e6b52c50cc96b8bdc4809f4db44
The text was updated successfully, but these errors were encountered: