Will the torrent client ask trackers for the pieces matching certain hashes, or pieces included in certain torrent file?

-1

Imagine that we have two torrent files. They contain similar, but not exactly the same files.

For example, one torrent is same as the other, but has some text files at the end of it.

Knowing that these two torrents will probably share most of the pieces, are BitTorrent clients able to exchange these pieces with other torrents?

I assume that this will only be possible if peers ask for any pieces on the tracker which has the right hash, instead of asking for specific portions of the currently downloading file.

Example diagram:
Example diagram

Edit - Just to be clear:

1. I am not referring to running multiple instances of clients on a machine in order to download a file which appears in two torrents.
2. I am not referring to downloading the same file with two different torrents.
3. What I'm asking is, if two different torrents, by chance, contain identical "pieces", not files, can the pieces be used interchangeably from a tracker to another?
4. To simply put it, I'm asking if it is possible for a single client downloading a single torrent file, to retrieve pieces from another torrent, assuming that those pieces are identical.
(Both torrents by chance include a piece with a same hash.)

For example, if I am only downloading torrent A, I will need blue and green pieces. Since Torrent B contains green and yellow pieces (not files), could it be possible to retrieve some green pieces from Torrent B?
If I am correct, each piece should have its own hash, so, if both Torrent A and Torrent B contain the same piece, they should be able to use that same piece. The peer could ask for the same pieces by their hashes on a tracker, and if so, identical pieces with identical hashes can theoretically be shared between torrents.
The chances of two torrents having the same piece is irrelevant, I'm asking you to accept that we have this situation, and tell me what does the Torrent protocols do if this is met.

David Refoua

Posted 2016-01-31T03:50:02.877

Reputation: 239

No, because nearly identical, wouldn't result in identical hashes – Ramhound – 2016-01-31T04:17:08.220

Doesn't each piece have its own hash? I'm not asking for the entire file by its hash, I know how it works. What I'm trying to ask is that, will the peer ask for the pieces by their hashes? If so, identical pieces with identical hashes can theoretically be shared between torrents. – David Refoua – 2016-01-31T05:16:51.903

1BitTorrent does not work like the way you think it does. The pieces together make up the hash of the entire torrent, all files and their pieces, most torrents are not made up of files you could replace. In most cases your going to have a single .ISO file,perhaps some text files. – Ramhound – 2016-01-31T06:37:34.883

So, if we have Torrent A which contains .iso + txt, and torrent B which only contains .iso file, if seeders leave Torrent B, can the client get pieces from Torrent A assuming up until the text, other pieces are identical? People suggest adding trackers for Torrent A to Torrent B in these situations, and this works. – David Refoua – 2016-01-31T06:45:12.027

If the text files were identical and had the same hash, and the .ISO files were identical and has the same hash, then the torrent would be identical. I don't understand your question. If you are going to say what other people say, provide us a link, so we can read what they actually said. – Ramhound – 2016-01-31T06:47:30.753

@Ramhound Thanks, I posted two links. Also, regarding your comment, I'm sure that I said Torrent A contained every file in Torrent B, plus files that were not in Torrent B. So, one torrent contains all of the other torrent's files, plus some extra files. – David Refoua – 2016-01-31T06:53:03.733

Answers

1

You cannot combine two torrents. The hash of each torrent will be different and there is no way of combining the two. You can download both and see what the final folder structure is in both folders. You may be able to grab the files that are not available in one and use it in the second one. Normally the EXTRA stuff is nothing to be concerned about....

Even if everything went smooth (i.e., no errors from simultaneous write attempts), it still wouldn't work because two instances of a bittorrent client wouldn't know what the other was doing -- each would still assume that certain pieces of a pre-allocated file are unreceived, and continue to request them.

If you try to download 2 different torrents for the same file to the same location, they will overwrite each other and interfere with the downloads.

If the two torrents are identical other than the announce URLs, then adding the second torrent will prompt to add the additional urls.

Now this trick might* work in a torrents containing multiple identical files; you just mark some do-not-download in one client, and the rest do-not-download in the other. (*The clients might still trip over each regarding file-spanning pieces saved as PART files.)

NobleMan

Posted 2016-01-31T03:50:02.877

Reputation: 476

Thanks, but I did not mean combining two torrents. What I'm asking is, if two different torrents, by chance, contain identical "pieces", not files, can the pieces be used interchangeably from a tracker to another? Please notice that I am looking at this a bit more technically. – David Refoua – 2016-01-31T05:19:24.587

I updated the post – NobleMan – 2016-01-31T05:31:26.423

Thanks for the nice explanation, but I'm afraid that I was not clear. I am not referring to running multiple instances of clients on a machine in order to download a file which appears in two torrents. To simply put it, I'm asking if it is possible for a single client downloading a single torrent, to retrieve pieces from another torrent, assuming that the pieces are similar. So, if I am only downloading torrent A, I will need blue and green pieces. Since Torrent B contains green and yellow pieces (not files), could it be possible to retrieve some green pieces from Torrent B? – David Refoua – 2016-01-31T06:24:33.723