[patch] -Enhanced Chunk Selection- (based on jicxicmic)
This is a new algorithm for the selection of the chunks to download. This selection process is one of the CRITICAL parts of the eDonkey network. The algorithm must insure the best spreading of files. To avoid a premature stop, all blocks requested from the same source are located within the same chunk.
The selection is based on 4 criteria:
1. Frequency of the chunk (availability), very rare chunks must be downloaded as quickly as possible to become a new available source.
2. Parts used for preview (first + last chunk), preview or check a file (e.g. movie, mp3)
3. Request state (downloading in process), try to ask each source for another chunk. Spread the requests between all sources.
4. Completion (shortest-to-complete), partially retrieved chunks should be completed before starting to download a other one.
The rarity of the chunks defines three groups:
For very rare (3 or <10%) chunks (release mode), the selection is done in the order:
- less downloaded chunk (availability)
- shortest-to-complete chunk
- random chunk
For rare (<50%) chunks (spread mode)
- downloading in progress
- less downloaded chunk (availability)
- shortest-to-complete chunk
- first/last then chunk (if selected in preferences)
- random chunk
For common chunks (share mode)
- downloading in progress
- shortest-to-complete chunk
- first/last chunk (if selected in preferences)
- random chunk
Bookmarks