摘要: P2P下载中文件完整性校验会影响下载性能,针对该问题,提出一种校验延迟的隐藏算法。利用文件完整性校验中使用的哈希算法的流式特性和TCP异步接收缓冲区的特点,将大文件块的哈希计算分成多次对较小的子数据块的计算,收到一个子数据块后,就开始计算哈希。由于计算每一个子数据块的哈希的时间开销很小,保证了计算延迟可以被TCP异步接收缓冲区所隐藏,使哈希计算与数据接收几乎可以并行进行,消除其对P2P文件下载性能的影响,提高了下载效率。
关键词:
P2P下载,
文件校验,
延迟隐藏,
SHA1算法,
MD4算法
Abstract: A latency hiding algorithm, called HASH-Latency Hiding(HASH-LH), is promoted. By leveraging the streaming process characteristics of the Hash algorithms used for P2P file integrity verification and the asynchronous receiving buffer of TCP, it is reasonable for HASH-LH to divide a big file block into multiple smaller sub-blocks, which makes the latency much shorter for calculating Hash values on each sub-block. Furthermore, the Hash calculation starts just after the first sub-block is received. As the latency of each sub-block Hash calculation becomes as short as it can be hidden by the asynchronous receiving buffer of TCP, it makes calculation and receiving processed nearly at the same time. As a result, all the latency from file verification is hidden and performance boosts up.
Key words:
P2P downloading,
file verification,
latency hiding,
SHA1 algorithm,
MD4 algorithm
中图分类号:
贺鹏程, 王劲林, 邓浩江, 孙鹏. P2P文件完整性校验延迟隐藏算法[J]. 计算机工程, 2010, 36(15): 29-31.
HE Feng-Cheng, WANG Jin-Lin, DENG Gao-Jiang, SUN Feng. Latency Hiding Algorithm for P2P File Integrity Verification[J]. Computer Engineering, 2010, 36(15): 29-31.