Arts & Culture

A Serial and Non-collision Hash Algorithm

Description
A Serial and Non-collision Hash Algorithm Fengjun Shang College of Computer Science and Technology, Chongqing University of Posts and Telecommunications, Chongqing , China. uot.edum
Categories
Published
of 5
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Related Documents
Share
Transcript
A Serial and Non-collision Hash Algorithm Fengjun Shang College of Computer Science and Technology, Chongqing University of Posts and Telecommunications, Chongqing , China. uot.edum Fengjun Shang Key Laboratory of Opto-electronic Technology and System of Ministry of Education, College of Optoelectronic Engineering, Chongqing University, Chongqing , China. Abstract-ln order to deal with classification of P packets, a novel F' classification is proposed based the serial and non-collision hash (SNH) algorithm, which is based on Non-Collision Hash Trie-Tree Algorithm and Grid of Tries algorithm. The core of algorithm has three park: One is the structure of hash function, which is constructed mainly based on destination port and protocol type field so that the hash function can avoid space explosion problem; Two is that we transform Grid of Tries'for' the Trie-tree pruned and jumping table in order to reduce space complexity toward source P prefix; Three is that we use the Trie-tree pruned toward destination P prefix so that stock space will not exceed total rule number, at the same time, we introduce the serial algorithm in the source port lookup. After expanding normally, it doesn't increase the time complex of algorithm, because we introduce the jumping table. me SNH algorithm used to packet classification includes two phases. The first is preprocessing phase, in which hash table and Trie-tree pruned are created based on matching rule set. The second is, matching phase in which packet classification is executed. The test results show that the classification rate of SNH algorithm is up to 0.4 million packets per second and the maximum memory consumed is 8MB for 10,000 rules. Keywords : P classification; l whp algorithm; Trie-tree; Non-collision hash; Grid oftries. NTRODUCTON nternet service provider (SP) is going to provide more value added services to end users. Examples of these services are firewall packet filtering, policy routing, traffic accounting and quality of service (QoS) applications such as integrated services (ntserv) and differentiated services (DiffSer~)'~'. All these functions need classification of P packets. P classification is an instance of the best matching filter problem. n theory, seven fields can be used for the filter: destinatiodsource P address (32 bits each), destinatiodsource transport port (16 bits each), type of service (8 bits), protocol type (8 bits) and flag of transport layer (8 bits). The sum of bits of these fields is 120 (we assume that all the seven fields reside in 1P packet header for the sake of convenience, although some fields are in TCP header actually.) Statistical results of some actual filter databases used by SPs show that 17Y'of the filters specify only one field, 23% specify three fields, and 60% specify four fields'']. But actual filter databases usually use only five fields: destinatiodsouice F' addresses, destinatiodsource ports and protocol type. Based on the number of combination of destination ports and protocol value in actual filters is very small, we construct a laokup table that can be used to look up^? This paper has two contributions. First, we construct the hash function based on destination port and protocol type field so that the hash function can avoid space explosion problem. Next, we use jumping table in the'grid of Tries toward source F' prefix, at the same time, we transform Grid of Tries for the Trie-tree pruned.andjumping table in order to reduce space complexity. 'We evaluate the SNH algorithm using both simulations and analyses. This paper is organized as follows. n Sections 111 we introduce the related works. The SNH algorithm is introduced in Section V and evaluated in Section V. n Section V we introduce our conclusion and future works. We first discuss related work.. '.. U. PERFORMANCE METRCS FOR LOOKUP AND PACKET CLASSFCATON ALGORTHMS To develop and discuss an P address lookup or packet /04/$ EEE. 591 . classification algorithm, some performance metrics need to be specified. Some of the performance metrics are briefly discussed as follows: a) Search time. This metric gives the number of times of accessing the memory for a lookup of the table in the worst case. The measurement in average case is not important as in the worst case in the literature. This metric reflects the search speed of the lookup algorithm. b) Memory storage requirements. deal algorithms need to achieve linear space complexity with respect to the size of table. c) Update speed. The nternet is a dynmic system The rout fmm one network to another network can,bz changed due to various reasons. Corresponding to these changes, the entries in the P address lookup table need to be updated. The F' address lookup table may have hundreds of updates per second[ . Algorithms need to adapt to these changes. Algorithms can create the table from scratch or incrementally add or delete entries in the table. d) Scalability. P lookup algorithms must be scalable with respect to the number of prefixes. P lookup algorithms must also be scalable to Pv6. h addition to these, packet classification algorithms must be scalable with respect to the number of fields RELATED WORKS A. RFC Algorithmm The problem of packet classification can be viewed as one of mapping S bits in the packet header to T bits of classd, (where T=logN, and Tee) in a manner dictated by the N classifier rules. A simple and unrealistic) way of doing this mapping might be to pre-compute the value of classd for each of the different packet headers. This would yield the answer in one step (one memory access) but would require too much memory. The main aim of RFC is to perform the same mapping but over several stages. The mapping is performed recursively, at each stage the algorithm performs a reduction, mapping one set of values to a smaller set. B. Modular Algorithm Modular algorithm[ is an p classification algorithm based on statistics. t may optimize the lookup data structure according to the distribution of filter matching ratio and P traffic. Short of effective statistic parameters, this algorithm cannot be practically used for P routers now. C. Cross-Product Algorithm Crossproducting algorithm[ is based on caches. For bigger classifiers, the authors propose a caching technique (on-demand crossproducting) with a non-deterministic classification time. D. Jumping Table P Classification Algorithm The P classification algorithm[61 converts multiple fields' P classification to two fields' P classification by using jumping table. Firstly, the algorithm constructs the jumping table. Secondly, we lookup destinatiodsource P address so that we may get the rule index. The algorithm's has shortcoming that space complexity is big and leads to space explosion. The destinatiodsource P lookup mainly introduce Grid of Tries algorithm expounded on the E. E. Grid of Tries Algorithm A solution called Grid of Tries is proposed in [3]. n this scheme, the hie-tree data structure is extended to two dimensions. This is a good solution if the filters are restricted to only two fields, but it is difficult to extend it to apply to more fields. F. Non-Collision Hash Trie-Tree Algorithm Non-collision Hash Trie-Tree Algorithm' is a kind of the algorithm which will transform multidimensional for two dimensional classification algorithm. According to sourceldestination port and protocol type field, we construct hash function, because three type fields' crossproduct is few, that is, lookup once. But this algorithm also has shortcoming: () t may suffer from space explosion; (2) Average time consumed and space requirement are great under the worst conditions. n this paper, we proposed a novel lookup algorithm called the absolute serial and Non-Collision Hash (SNH) algorithm, which is based on Non-Collision Hash Trie-Tree Algorithm and Grid of Tries algorithm. Average time consumed and space requirement of this algorithm are less than the Non-Collision Hash algorithm. V. THE SERAL CLASSFCATON ALGORTHM A. Basic Algorithm 592 This paper discusses the algorithm based on the absolute serial and Non-Collision Hash (SNH) and multidimensional P classification algorithm. The core of algorithm has three parts: One is the construction of hash function, which is constructed mainly based on destination porl and protocol type field so that the hash function can avoid space explosion problem; Two is that we introduce jumping table in the Grid of Tries toward source P prefix, at the same time, we transform Grid of Tries for the Trie-tree pruned and jumping table in order to reduce space complexity; 'bee is that we use the Trie-tree pruned toward destination P prefix so that stock space will not exceed total rule number (general 64 K), at the same time, we introduce the serial algorithm in the source port lookup. AAer expanding normally, it doesn't increase the time complexity of algorithm because we introduce the jumping table. Space complexity consumed and space requirement of this algorithm are less than those of Non-Collision Hash. ddort oroto E Source port table Source-port Dest-tries Jump Lnblo --- Source-tries R k, R 4 Rule index Fig.1 The absolute serial and Non-collision hash Algorithm We use the Trie-tree pruned toward destination '9 prefix of the packet header. To decrease to consume space, according to the destination P prefix of distribution, we prune the Trie-tree, so that stock space will not exceed total rule number (general 64 K), at the same time, the end-point points to tine source P jumping table. Source P prefix of the packet header is split up into 2 chunks that are used to index into multiple memories in parallel. The contents of each memory are chosen so that the result of the lookup is natrower than the index i.e. requires fewer bits. The high 16 bits of Source 1P prefix of the packet header is formed a jumping tables, and the low 16 bits of Source P prefix pairs of the packet header is formed a Trie-trees. The highest bit is in the high 16 hits ofsource P prefix pairs of the packet header, which is labeled for either lookup. To decrease to time complexity, we introduce the Trie-tree pruned toward source P low 16bit, at the same time, the end-pint stores the rule index value. Figure 1 shows the lookup process stated above. E. The Source/Desfination Port and Protocol Fields Lookup Algorithm When classifying a packet with its header H(sport, dport, proto) (representing sourceldestination pott and protocol respectively, we do not consider P address fields in this step). We first look up two tables using dport and proto as the indices respectively. We use a function of these lookup result g(fd(dport),fp(proto)) as the index to perform another lookup. The result is h (g (fd which is the pointer to a set of source port. Figure 2 shows the lookup process stated above. We number the datination port as 0.1.2,..., D-l(D is maximum number of the destination port). And it is the same with fp. The rectangle represents a lookup table and g is hash function. According to our definitions of fd we have, O d SD-, OCpCP-(P is the maximum protocol number). We choose g(d,p)=pd+p. We may prove g will not cause any co~~ision' . Algorithms tables. and 2 are the setup algorithm of these Algorithm 1: construction of fd (fp) table At first, we number the destination prt from 0 to the total port number, at the same time, the protocol field is numbered. For example, 21 numbers 'V, 80 numbers , all are numbered. Second, new rule is added on the table' end. When we lookup table, the table' content is the table' address. Algorithm 2: construction of h table At first, according to absolute Non- collision hash function, we can construct h table. Second, if it has new rule, we reconstructs h table. 593 Because h table is little, reconstructing time of h table is short.(commonly for ms). dport proto T&m & Source port table.c Source-port Fig.2 The three fields lookup algorithm C. Lookup in Destination-Source P Pairs n this paper, we proposed a novel lookup algorithm called jumping table trie-tree algorithm, which is based on Grid oftries algorithm. At first, toward the destination P prefix, we use the Trie-tree pruned. Toward the source P prefix, we will split up into two chunks: high l6bit and low hbit. We build one jumping table according to the high 16 bit, which has 64K entrances. n every entrance 17bit, the highest bit is mark bit: 0 expresses that prefix length does not be larger than 16, to get complete this P prefix; 1 expresses prefix len$h to be larger than 16(shown in the fig.3), we need to search' for Source-Trie tree continuously. For Source-Trie tree, the terminal point of this tree is rule index, the P classification algorithm structural diagram showed as Fig.4. After lookup the source port table, we can directly lookup soureeldestination P and get the index of this d e index and then complete classification works. n order to lookup destinatiodsource P, we construct source P high 6 bits table. Algorithm: Construction source-p high 16 bit :able Firstly, Source P prefix of the packet header is split up into two chunks that are used to index into multiple memories in parallel. We construct source P high l6bit table by increasing. When the rule does not have some content, we make out the table. The maximum content of the table is 128K. n every entrance 17hit, the highest hit is mark bit: 0 expresses that prefix length does not be larger than 16, to get complete this P prefix; expresses prefix length to be larger than 16, we need to search for Source-Trie tree continuously. Secondly, we will expand the table to 128K so that the every item ofthe table has one entrance. Lastly, toward going on lookup item, we lookup the corresponding Trie-tree to complete classification work. 15-0~., Label: lbit Fig.3 The high dbit structure Fig.4 The system structure of the algorithm v. LOOKUP PERFORMANCE n the worst case, the total number of memory access is 2W(W is P prefix width)+4 toward Non-collision. What's more, the time consumed is irrelevant to the number of filters. n contrast, the SNH needs 2W-6+4(ookup table need read memory time)tl(jumping table need read memory time) memory accesses in the worst case. t is a little more complicated as for the space complexity of the absolute serial and Non-Collision Hash (SNH) algorithm. The numbers of entries of the fd table is 65536, the numbers of entries of the fp tables is 256 and the number of entries of table h is DX P. Theoretically speaking, the number of table h s entries could be up to 65536x256. However, as analyzed above, D and P are rather small in normal cases, so we expect that the number of table h's entries is quite small'41. As for the jumping table trie-tree, since a jumping table needs 128kB(but usually this is very few) at the most and there are 16 bit Tric-tree at the most, space needed is about 8kB. Thus we could es$mate that the total space is Hash-Size (Maximun is 2MB)+Jump table- Size +Trie-tree-Size+Source port- Size in the worst case, while Non-collision for multi-fields also needs about Hash-Size+ZNW, where Hash-Size denotes the space for hash table. n order to gain more time efficiency, the hash table usually consumes a lot of memory, up to space explosion. We design a virtual environment to perform a testing. 594 Our concern focuses on the relative performance between SNH and Non-collision, so the virtual environment will suffice. We make reasonable assumptions about P flows and filters and generate P packet flow and filters from a random number generator. Testing results are shown in figure 5 and figure 6. Noncol means Non-collision hash algorithm. router to keep up with a Gigabit link For future work, we would like to create other filter lookup algorithms that are specialized for fast multiple fields' classification. For example, we may use Lakshman and Stiliadis proposing a 2-dimensional classification algorithm (LS algorithm)[ . Nowadays, we are researching high-speed network model, including researching the fast P packet classification algorithm. 300 loo. a 5000 iooao 15aaa m Noncol Fig. 5 Comparison oftime performance between SNH and Non-collision hash where x-axis plots the number of filters and y-axis plots the total milliseconds consumed while processing.10' packets a 1 o 5000 moo Fig. 6 Comparison of space performance between SNH and Non-collision hash where x-axis plots the number of filters and y-axis plots the maximum memory (MB) consumed. V. CONCLUSON AND FUllJRE WORKS n this paper, we discuss the problem of P classification using the SNH algorithm. The idea is to converts multiple fields' P classification to two fields' P classification by using Non collision hash. Based on the measurements for the individual components on Pentium 11, We estimate 3.0 P s for average packet classification. Hardware engines can do better because of increased opportunities for parallelism and pipelining. Given that the average packet ' size is around 2000 bits, a worst case lookup time of 3.0!J s allows 0.4 million packets per second, which allows a. REFERENCES [] P.Gupta and N.McKeo,wn. Packet classification on multiple fields. ACM Computer Review, 1999,29(4): [2] T.Y.C.Woo. A Modular Approach to Packet Classification: Algorithms and Results. n: Gruein R ed. Proceedings of EEE lnfocom2000. San Francisco, CA: EEE Computer Society Press, 2000: [3] V.Srinivasn, G.Varghese, S.Suri, et al. Fast Scalable Level Four Switching. ACM Computer Review, 1998, 28(4): [4] XU Ke,etc. A Non-Collision Hash Tric-Tree Based Fast P Classification Algorithm. n.comput.sci & Techol., 17(2):21Y-226,2002. [51 T.V. Lakshman and D. Stiliadis. High-speed policy-based packet forwarding using efficient multi-dimensional range matching , Proceedings of ACM Sigcomm,pages , Sep [6] Xu Ke, LlAN Zhi-yong, WU Jian-ping, XU Ming-wei.A 1P Classification Algorithm Based on Jumping Table Applying to Multiple Fields. Mini-Micro Systems200 1, 22( 12): [7] S. Blake, D. Black, M. Carlson, E. Davies, 2. Wang and W. Weiss, An Architecture for Differentiated Services, RFC 2475, nternet request for Comments, December [X C. Labovitz, G. R. Malan and F. Jahannian, nternet routing instability Proceeding1 of ACM SGCOMM '97, 1997, pp
Search
Similar documents
View more...
Related Search
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks