Advanced Intelligent Corruption Handling
Advanced Intelligent Corruption Handling ( AICH for short ) is an error correction system that is intended to correct transmission errors in the eDonkey2000 P2P network with minimal effort. In the long term, it is intended to replace the older but much worse Intelligent Corruption Handling ( ICH for short ).
Intelligent corruption handling
Although ICH is quite effective, it has the limitation that only complete 9500 kB chunks can be checked, but not smaller ones. If a 9500 KB chunk contains an error, it will be downloaded again in 180 KB chunks. After each 180 KB block has been reloaded, the entire 9500 KB chunk is checked for correctness. On average, this saves 50% of the bandwidth, assuming a statistical uniform distribution of errors in chunks. If there is more than one faulty position in such a block, or if malicious clients repeatedly falsify faulty data or even an entire section, ICH can no longer be used effectively, because the faulty blocks are still transmitted in full, i.e. 9500 kB again (furthermore, correct data can be replaced by incorrect data - ICH does not recognize this either).
Advanced Intelligent Corruption Handling
This is where AICH comes in to establish data integrity with minimal redownloading effort. For this purpose, the object to be transferred is divided into 9500 kB chunks. Each chunk is broken down into 180 kB blocks, which results in 53 blocks per chunk. A hash value is calculated for each block using the SHA1 algorithm . These values are called block hash and form the lowest level of a complete AICH hash tree . The picture shows a complete hash tree for a file consisting of four chunks. Each chunk contains 53 blocks, which makes 212 node hashes on the lowest level and 423 on all 7 tree levels up to the root hash . The entire tree is called the AICH hash set .
The blue and yellow points show the mathematical dependencies of the smallest block hashes up to the root hash. This means that a root hash can be used to check whether a file has been loaded completely and without errors.
Troubleshooting
Whenever an error is discovered, a recovery package with a complete AICH hash set is requested from any other client . The requested hash set contains their block hashes for all 53 blocks and also verify hashes for the entire hash tree. The number of verify hashes depends on the number of parts of the file (2 x > = 'number of parts', where x indicates the number of verify hashes).
After receipt, the verify hashes from the recovery package are checked against the trustworthy root hash. If they match, all 53 blocks of the faulty part are checked against block hashes by the recovery package. If block hashes do not match, the corresponding blocks are requested again for download.
Trusted root hash
The best way to get trustworthy root hashes is to request files for download using their root hash. Assuming that the source of this connection is trustworthy, the root hash is immediately trusted and this is stored for this file. If no root hash was available, the root hash provided by the sending client must be trusted. eMule only trusts this source if at least ten different sources send the same value and if at least 92% of all sources agree with this value. If this is classified as untrustworthy, it is only valid for this session and is neither saved nor can hashlinks be generated from it.