Difference between revisions of "AICH"

From AMule Project FAQ
Jump to: navigation, search
Line 21: Line 21:
 
It will ask for the [[Root Hash]] to other [[client]]s. If at least 10 [[client]]s send you the same [[Root Hash]] and that is 92% or more of the total [[Root Hash]]es recieved, that [[Root Hash]] will be considered as reliable for the '''current session only'''. It will not be stored anywhere in disk and will only be kept in memory. Also, it will not be shared with any other [[client]] who asks for it.
 
It will ask for the [[Root Hash]] to other [[client]]s. If at least 10 [[client]]s send you the same [[Root Hash]] and that is 92% or more of the total [[Root Hash]]es recieved, that [[Root Hash]] will be considered as reliable for the '''current session only'''. It will not be stored anywhere in disk and will only be kept in memory. Also, it will not be shared with any other [[client]] who asks for it.
  
When the file download is completed, the [[Root Hash]] will be calculated, with the whole [[AICH Hashset]], stored in ''½/.aMule/known2.met'' and shared with any [[client]] who asks for it.
+
When the file download is completed, the [[Root Hash]] will be calculated, with the whole [[AICH Hashset]], stored in ''~/.aMule/known2.met'' and shared with any [[client]] who asks for it.
  
 
== Storing the [[AICH Hashset]] ==
 
== Storing the [[AICH Hashset]] ==
  
Once a file has been completly downloaded, [[aMule]] builds it's complete [[AICH Hashset]] and stores it in '~/.aMule/known2.met' so whenever a [[client]] asks for it, it can provide it without having to recalculate it every time.
+
Once a file has been completly downloaded, [[aMule]] builds it's complete [[AICH Hashset]] and stores it in ''~/.aMule/known2.met'' so whenever a [[client]] asks for it, it can provide it without having to recalculate it every time.
  
 
Please notice that as long as the AICH method can be applied to a file, [[ICH]] will be disabled for that file.
 
Please notice that as long as the AICH method can be applied to a file, [[ICH]] will be disabled for that file.

Revision as of 02:49, 20 October 2004

Description

ICH's success has no point to be discussed about, but it comes to an end where being able to actually know which exact part of the chunk is corrupt would make life easier. This comes specially significant when several chunk are corrupt. AICH (Advanced Intelligent Corruption Handler) takes part in this problem and allows aMule and any client supporting it to actually know which exact part/s of the chunk is/are corrupt.

Definitions

Each chunk is divided into 53 180KB parts and each of this parts is hashed using the SHA1 algorithm. Each of this hashes is called a Block hash. The whole Block Hashes hashset is called the AICH Hashset. By combining the Block hashes two-by-two each on the part next to it, aMule will get a whole tree of hashes (this tree is actually the AICH Hashset). Each hash which isn't neither a Block Hash nor the Root Hash, is a Verifying Hash. The hash at te top level is the Root Hash and it is supposed to be provided by the ed2k links when releasing.

The actual work

When a chunk is known to be corrupt, aMule will try to get an AICH Hashset from some client sharing that file and which has already completed it. It will ask for the all hashes of the 53 parts in the corrupt chunk and the necessary Verifying Hashes to complete the AICH Hashset tree up to the Root Hash.

Once it gets the Block Hashes and the Verifying Hashes, it builds up the tree to get the Root Hash and check if it's the same as the Root Hash the original ed2k links provided. If it is, those Block Hashes will be considered as reliable. If it isn't, those Block Hashes and Verifying Hashes will be dropped and considered fakes.

Once the Block Hashes are considered reliable, each 180KB part in the corrupted chunk will be hashed (using the SHA1 algorithm) in order to compare the resulting hash with the recieved Block Hashes. If they are the same, then that part is not corrupted, so there's no need to redownload it. If they're not the same, then that part is corrupted and it will be redownloaded.

How is the Root Hash spread?

The ideal way to spread the Root Hash is through the ed2k links. But many times files are downloaded through the search feture in the ed2k clients. Also, the ed2k links might not include the Root Hash in their URL. In such cases an alternative method is used to grap the file's Root Hash.

It will ask for the Root Hash to other clients. If at least 10 clients send you the same Root Hash and that is 92% or more of the total Root Hashes recieved, that Root Hash will be considered as reliable for the current session only. It will not be stored anywhere in disk and will only be kept in memory. Also, it will not be shared with any other client who asks for it.

When the file download is completed, the Root Hash will be calculated, with the whole AICH Hashset, stored in ~/.aMule/known2.met and shared with any client who asks for it.

Storing the AICH Hashset

Once a file has been completly downloaded, aMule builds it's complete AICH Hashset and stores it in ~/.aMule/known2.met so whenever a client asks for it, it can provide it without having to recalculate it every time.

Please notice that as long as the AICH method can be applied to a file, ICH will be disabled for that file.