A fast hash packet classification algorithm

Fengjun Shang,Xuezeng Pan
2007-01-01
Journal of Computational Information Systems
Abstract:The process of categorizing packets into 'flows' in an Internet router is called packet classification. All packets belonging to the same flow obey a pre-defined rule and are processed in a similar manner by the router. In general, packet classification on multiple fields is a difficult problem. In this paper, an algorithm is proposed called Hash Packet Classification based on Non-collision Hash and XOR Hash (NHXH). The NHXH algorithm introduces XOR operation to obtain a hash key value. The computation of an NHXH algorithm key value consists of three steps. Firstly, the non-collision hash function is structured, which is constructed mainly based on destination/source port and protocol type field so that the hash function usually can avoid space explosion problem. Secondly, the source/destination IP pairs are concatenated and then dividing the packet header into 4 chunks, each of which has 16bits in size. Thirdly, each chunk is mapped into stochastic space and XOR operation on the random number mapped 4 chunks. Because the stochastic space follows even distribution after XORing operation so that its collision rate is limitary. Lastly, every rule index is found in order to ensure the validity so that the final rule index is acquired. The test results show that the classification rate of NHXH algorithm is up to 2 million packets per second and the maximum memory consumed is 8MB for 10000 rules.
What problem does this paper attempt to address?