问题
I'm reading Bittorrent Request parameter that need to be sent to announce URL over here
Question 1:
- left params:
left: The number of bytes this client still has to download in base ten ASCII. Clarification: The number of bytes needed to download to be 100% complete and get all the included files in the torrent.
also BEEP-3 states
The number of bytes this peer still has to download, encoded in base ten ascii. Note that this can't be computed from downloaded and the file length since it might be a resume, and there's a chance that some of the downloaded data failed an integrity check and had to be re-downloaded.
Now, if I'm starting my torrent download or anytime what possible value should I give to left.
Question 2:
While reading through spec no where I found how often the client should query for announce to get the update lists of peers.
Any word on that
I found this answer to this in term of interval
and min interval
in the Tracker response.
回答1:
Answer 1:
The left= value you send in an announce is the minimum number of bytes left you need to download to fully get all the pieces in the torrent, no matter if you intend to download all of the files in it or not.
So if you start to download a torrent from scratch that all the files in it has
the total size of: 1 234 567 890 bytes:
You send in the first announce: left=1234567890, downloaded=0 and uploaded=0
Even if only want to download 567 890 123 bytes from that torrent:
You still send in the first announce: left=1234567890, downloaded=0 and uploaded=0
Then, when it's time for the second announce, you have succeeded to download 234 524 288 bytes without any hash fails and uploaded 87 654 400 bytes to other peers;
You send in the second announce:
left=1000043602, downloaded=234524288 and uploaded=87654400
Third announce, you have succeeded to download 258 786 432 bytes more that passed the hash check and uploaded 98 762 752 bytes more to other peers, but this time there was 3 hash fails (piece size: 262 144 bytes);
You send in the third announce:
left=741257170, downloaded=493310720, uploaded=186417152 and corrupt=786432
(A client that don't send corrupt would instead send downloaded=494097152)
Fourth announce: [TODO]
Reservation: Other than the offical BEP3, how this is done is mostly undocumented conventions and above answer is based on best effort checking common clients with Wireshark.
来源:https://stackoverflow.com/questions/44194433/understanding-bittorrent-tracker-request