A hash method to calculate the longest prefix matching lpm rule index

A longest prefix matching and rule technology, applied in the storage field, can solve problems such as unsatisfactory performance, and achieve the effect of simple method, simplified complexity, and easy operation

Active Publication Date: 2022-02-11
CORIGINE ELECTRONICS TECH CO LTD
View PDF7 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0008] According to its comparison with IPSX hash algorithm and CRC32 hash algorithm, it has better discreteness and efficiency, but this algorithm is limited to fixed-length four-tuple rules, for the situation where the length of LPM rules and the variable tuple area are uncertain , unsatisfactory performance

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A hash method to calculate the longest prefix matching lpm rule index
  • A hash method to calculate the longest prefix matching lpm rule index
  • A hash method to calculate the longest prefix matching lpm rule index

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0034] Embodiment 1: data A=1011100011, based on n=7,

[0035] Then rule A has a hash value of length 8

[0036] hash 8 =((1∧0)<<7)|((0∧1)<<6)|((1∧1)<<5)|((1∧1)<<4)|((1∧0 )<<3)|((0∧0)<<2)|((0∧0)),

[0037] hash 8 =1100100;

[0038] Then rule A has a hash value of length 9

[0039] hash 9 =((1λ1)<<7)|((1∧0)<<6)|((0∧0)<<5)|((0∧1)<<4)|((1∧0)< <3)|((0∧0)<<2)|((0∧1)),

[0040] hash 9 =0101101.

Embodiment 2

[0041] Embodiment 2: According to figure 2, a storage unit can store up to 16k rules, that is, n=14. The first 14 bits of the rule 10010000111011101110111000111001011100 are 10010000111011, then the rule has a hash value of length 14, which is the first fourteen bits; in the hash value of length 15, the rule has a hash value of length 14 and the fifteenth bit Combined together, it is 100100001110111, and the XOR operation is performed in turn to obtain a hash value of 10110001001100; the hash value of the rule with a length of 16 is combined by the hash value with a length of 15 of the rule and the sixteenth bit, which is 101100010011000, do the XOR operation in turn to get the hash value 11010011010100; the hash value of the rule with a length of 17 is combined with the 17th bit of the rule, which is 110100110101001, and the XOR is performed in turn The hash value obtained by the operation is 01110101111101; the hash value of the rule is 18 in length, and the hash value of ...

Embodiment 3

[0057] Embodiment 3: According to 3 and 4, for the same storage structure as Embodiment 2, the LPM rule with a length less than or equal to 14, its storage process is as follows Figure 4 所示,初始存储结构里没有规则,基地址为10010000111000,首先添加规则一100100001111,需要在地址为10010000111100、10010000111101、10010000111110和10010000111111上填写100100001111;添加规则二10010000111111,需要在地址为10010000111111上填写10010000111111; 添加规则三1001000011110,需要在地址为10010000111100和10010000111101上填写1001000011110;删除规则一100100001111,须把地址为10010000111110的数据擦除;添加规则四10010000111,需要在地址为10010000111000、10010000111001、10010000111010、10010000111011和10010000111110上 Fill in 10010000111; delete rule 2 10010000111111, change the address 10010000111111 to 10010000111; delete rule 3 1001000011110, change the address 10010000111100, 10010000111101 to 1001000011.

[0058] The benefits of the present invention are: the method of the present invention is simple and easy to operate, and the calculation and storage methods of the hash value are explained in detail fo...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a hash method for calculating the index of the longest prefix matching LPM rule, which is characterized in that it includes the following steps: S1, ensuring that the storage structure of each storage unit storing the LPM rule is the same, and each storage unit can store 2 n rule, that is, each storage unit determines the position of the rule in the storage unit by n bits, and marks the length of its initial stored LPM rule for each storage unit; S2, when the LPM rule length L exceeds n, the Based on the previous n bits, XOR operations are performed bit by bit backward, and the cycle repeats until the hash value of the specified length of the LPM is calculated; S3. When the length L of the LPM rule does not exceed n, the hash value of the LPM rule is the LPM The first L position of the rule.

Description

technical field [0001] The invention relates to the field of storage technology, in particular to a hash method for calculating the longest prefix matching LPM rule index. Background technique [0002] Based on the rapid development of the current network era, each network node has greater requirements on the capacity of the LPM (Longest Prefix Match) rule. LPM rule storage can be implemented in a variety of hardware structures, but no matter which implementation method, in the face of massive LPM storage management and access, it is necessary to quickly index the specific location of the LPM rule, and the corresponding result of this rule has been obtained or how to handle it. In an environment with a large number of identical storage units, the degree of discrete storage rules determines the actual storage capacity of the LPM. Therefore, how to ensure the discrete distribution of LPM rules is the most important thing in storing LPM rules. [0003] At present, the indust...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Patents(China)
IPC IPC(8): G06F16/22
CPCG06F16/2228G06F16/2272
Inventor 王娜张远超陈盈安卢笙
Owner CORIGINE ELECTRONICS TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products