CN108664518A - A kind of method and device for realizing processing of tabling look-up - Google Patents
A kind of method and device for realizing processing of tabling look-up Download PDFInfo
- Publication number
- CN108664518A CN108664518A CN201710210525.1A CN201710210525A CN108664518A CN 108664518 A CN108664518 A CN 108664518A CN 201710210525 A CN201710210525 A CN 201710210525A CN 108664518 A CN108664518 A CN 108664518A
- Authority
- CN
- China
- Prior art keywords
- entry
- look
- crc
- result
- hash
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/08—Error detection or correction by redundancy in data representation, e.g. by using checking codes
- G06F11/10—Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
- G06F11/1004—Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's to protect a block of data words, e.g. CRC or checksum
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/08—Error detection or correction by redundancy in data representation, e.g. by using checking codes
- G06F11/10—Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
Abstract
A kind of realization is tabled look-up processing method and processing device, including:According to key (KEY) value of entry, determine that entry whether there is by cyclic redundancy check (CRC) polynomial computation;In the presence of determining entry, matching table address is determined according to the polynomial result of calculations of CRC;It is being returned after being tabled look-up to matching list according to determining matching table address as a result, determining that Hash (HASH) is tabled look-up address outside piece;Table look-up obtaining Hash and tabling look-up and return to KEY values according to the addresses of tabling look-up HASH outside determining piece, tabling look-up return according to KEY values and the Hash of entry whether KEY values are consistent carries out processing of tabling look-up.Present invention method, which reduces, needs the entry tabled look-up, reduces to pin resource, the occupancy of bandwidth resources, avoids influence to chip processing performance.
Description
Technical field
Present document relates to but be not limited to data processing technique, espespecially a kind of method and device for realizing processing of tabling look-up.
Background technology
With the development of network technology, network exchanging chip needs the relevant entries number of entries supported more and more, examines
Consider content adressable memory (CAM, content addressable memory) and three-state content addressing memory (TCAM,
Ternary content addressable memory) cost factor, prodigious in list item, the relevant technologies are general
Processing of tabling look-up is carried out using the mode of plug-in Double Data Rate synchronous DRAM (DDR).
Since plug-in DDR needs to consume more pin resource, the quantity of plug-in DDR will be restricted, DDR
Quantity just needs to reduce the access times of DDR in the case of being restricted, and in preventing Hash (HASH) from tabling look-up not, occurs needing more
Secondary the case where tabling look-up;If multiple list items coexist in one group of DDR, when different list items is required to repeatedly table look-up, can also require
Huge DDR access bandwidths are occupied, the efficiency tabled look-up and the processing for blocking chip are limited, greatly reduce the treatability of chip
Energy.
To sum up, in the case of list item number of entries is more, in the presence of the excessive pin resource of occupancy, bandwidth when being tabled look-up
Resource influences the problems such as process performance of chip.
Invention content
It is the general introduction of the theme to being described in detail herein below.This general introduction is not to limit the protection model of claim
It encloses.
The embodiment of the present invention provides a kind of method and device for realizing processing of tabling look-up, can reduce to pin resource, band
The occupancy of wide resource avoids influence to chip processing performance.
An embodiment of the present invention provides a kind of methods for realizing processing of tabling look-up, including:
According to the key KEY values of entry, determine that entry whether there is by cyclic redundancy check (CRC) polynomial computation;
In the presence of determining entry, matching table address is determined according to the polynomial result of calculations of CRC;
It is being returned after being tabled look-up to matching list according to determining matching table address as a result, determine piece outside Hash HASH table look-up
Address;
Table look-up obtaining Hash and tabling look-up and return to KEY values according to the addresses of tabling look-up HASH outside determining piece, according to the KEY of entry
Value and Hash, which table look-up return whether KEY values are consistent, carries out processing of tabling look-up.
Optionally, the determining entry, which whether there is, includes:
The KEY values of the entry are subjected to first default CRC polynomial computation;
It is tabled look-up using the 0th polynomial result of calculations of CRC as the address of the matching list;
By the matching list table look-up return result in addition to the 0th CRC the polynomial result of calculations of other CRC into
Row matching;
The matching list result of return of tabling look-up is matched with the polynomial result of calculations of other CRC in addition to the 0th CRC
When, determine that the entry exists.
Optionally, the KEY values according to entry are tabled look-up with Hash, and whether return KEY values are consistent to carry out processing packet of tabling look-up
It includes:
The KEY values of the entry and the Hash are tabled look-up, and to return to KEY values consistent, returns to the entry;The KEY of the entry
Value and the Hash table look-up return KEY values it is inconsistent, determine the entry miss.
Optionally, the method further includes:
The matching list table look-up return result and the others polynomial result of calculations of CRC in addition to the 0th CRC
When mismatch, handled central processor CPU is sent in the entry, or by the entry according to preset rules at
Reason.
Optionally, it is described determine that entry whether there is by cyclic redundancy check (CRC) polynomial computation before, the method
Further include:
It is related to second default mask MASK of business setting according to the entry;
To each entry, respective type is selected according to packet parsing result, business step, and/or application model respectively
MASK;
According to the MASK of selection, KEY values invalid in entry are filtered;
Wherein, the packet parsing result includes type of message.
Optionally, it is described determine that entry whether there is by cyclic redundancy check (CRC) polynomial computation before, the method
Further include:
Configure default Bloom Filter table of third;
CRC calculating is carried out to the KEY values of the entry, obtains CRC results;
All Bloom Filter tables are searched using the CRC results, obtain filter table result;
Judge that the entry whether there is according to the filter table result;
In the presence of determining the entry, continue to table look-up, in the absence of determining the entry, stops tabling look-up.
Optionally, the default Bloom Filter table of the configuration third includes:
According to the default Bloom Filter table of number of entries configuration third for supporting conflict.
On the other hand, the embodiment of the present invention also provides a kind of device for realizing processing of tabling look-up, including:First judging unit,
Matching list address location, Hash Round Robin data partition unit, processing unit of tabling look-up;Wherein,
First judging unit is used for:According to the key KEY values of entry, determined by cyclic redundancy check (CRC) polynomial computation
Entry whether there is;
Matching list address location is used for:In the presence of determining entry, with determining matching list according to the polynomial result of calculations of CRC
Location;
Hash Round Robin data partition unit is used for:Returned after being tabled look-up to matching list according to determining matching table address as a result, true
The outer Hash HASH of stator tables look-up address;
Processing unit of tabling look-up is used for:Table look-up according to the addresses of tabling look-up HASH outside determining piece and to obtain Hash and table look-up return
KEY values, being tabled look-up according to KEY values and the Hash of entry, whether KEY values are consistent carries out processing of tabling look-up for return.
Optionally, first judging unit is specifically used for:
The KEY values of the entry are subjected to first default CRC polynomial computation;
It is tabled look-up using the 0th polynomial result of calculations of CRC as the address of the matching list;
By the matching list table look-up return result in addition to the 0th CRC the polynomial result of calculations of other CRC into
Row matching;
The matching list result of return of tabling look-up is matched with the polynomial result of calculations of other CRC in addition to the 0th CRC
When, determine that the entry exists.
Optionally, the processing unit of tabling look-up is specifically used for:
Table look-up obtaining Hash and tabling look-up and return to KEY values, the KEY of the entry according to the addresses of tabling look-up HASH outside determining piece
Value and the Hash are tabled look-up, and to return to KEY values consistent, returns to the entry;The KEY values of the entry and the Hash are tabled look-up return
KEY values are inconsistent, determine the entry miss.
Optionally, the processing unit of tabling look-up is additionally operable to:
The matching list table look-up return result and the others polynomial result of calculations of CRC in addition to the 0th CRC
When mismatch, handled central processor CPU is sent in the entry, or by the entry according to preset rules at
Reason.
Optionally, described device further includes setting masking unit, mask selecting unit, filter element;Wherein,
Setting masking unit is used for:It is related to second default mask MASK of business setting according to the entry;
Mask selecting unit is used for:To each entry, respectively according to packet parsing result, business step, and/or application
The MASK of model selection respective type;
Filter element is used for:According to the MASK of selection, KEY values invalid in entry are filtered;
Wherein, the packet parsing result includes type of message.
Optionally, described device further includes dispensing unit, the second computing unit, the second lookup unit, the second determination unit
With second processing unit;Wherein,
Dispensing unit is used for:Configure default Bloom Filter table of third;
Second computing unit is used for:CRC calculating is carried out to the KEY values of the entry, obtains CRC results;
Second lookup unit is used for:All Bloom Filter tables are searched using the CRC results, obtain filter table knot
Fruit;
Second determination unit is used for:Judge that the entry whether there is according to the filter table result;
Second processing unit is used for:In the presence of determining the entry, continue to table look-up, in the absence of determining the entry, stop
Only table look-up.
Optionally, the dispensing unit is specifically used for:
According to the default Bloom Filter table of number of entries configuration third for supporting conflict.
Compared with the relevant technologies, technical scheme includes:According to key (KEY) value of entry, pass through cyclic redundancy school
It tests (CRC) polynomial computation and determines that entry whether there is;In the presence of determining entry, determined according to the polynomial result of calculations of CRC
Match table address;It is being returned after being tabled look-up to matching list according to determining matching table address as a result, determine piece outside Hash
(HASH) it tables look-up address;Table look-up obtaining Hash and tabling look-up and return to KEY values according to the addresses of tabling look-up HASH outside determining piece, according to item
Purpose KEY values and Hash, which table look-up return whether KEY values are consistent, carries out processing of tabling look-up.Present invention method reduces needs and looks into
The entry of table reduces to pin resource, the occupancy of bandwidth resources, avoids influence to chip processing performance.
Other features and advantages of the present invention will be illustrated in the following description, also, partly becomes from specification
It obtains it is clear that understand through the implementation of the invention.The purpose of the present invention and other advantages can be by specification, rights
Specifically noted structure is realized and is obtained in claim and attached drawing.
Description of the drawings
Attached drawing is used for providing further understanding technical solution of the present invention, and a part for constitution instruction, with this
The embodiment of application technical solution for explaining the present invention together, does not constitute the limitation to technical solution of the present invention.
Fig. 1 is the flow chart for the method that an alternate embodiment of the present invention realizes processing of tabling look-up;
Fig. 2 is the flow chart for the method that another alternative embodiment of the present invention realizes processing of tabling look-up;
Fig. 3 is the flow chart for the method that yet another alternative embodiment of the present invention realizes processing of tabling look-up;
Fig. 4 is the structure diagram for the device that the embodiment of the present invention realizes processing of tabling look-up;
Fig. 5 is that the present invention applies exemplary method flow diagram.
Specific implementation mode
To make the objectives, technical solutions, and advantages of the present invention clearer, below in conjunction with attached drawing to the present invention
Embodiment be described in detail.It should be noted that in the absence of conflict, in the embodiment and embodiment in the application
Feature mutually can arbitrarily combine.
Step shown in the flowchart of the accompanying drawings can be in the computer system of such as a group of computer-executable instructions
It executes.Also, although logical order is shown in flow charts, and it in some cases, can be with suitable different from herein
Sequence executes shown or described step.
Fig. 1 is the flow chart for the method that the embodiment of the present invention realizes processing of tabling look-up, as shown in Figure 1, including:
Step 100, key (KEY) value according to entry, determine that entry is by cyclic redundancy check (CRC) polynomial computation
No presence;
Optionally, determining that entry whether there is includes:
The KEY values of entry are subjected to first default CRC polynomial computation;
It tables look-up using the 0th polynomial result of calculations of CRC as the address of matching list;
Matching list is tabled look-up into the result of return and the polynomial result of calculation of other CRC in addition to the 0th CRC carries out
Match;
Matching list tables look-up the result of return when being matched with the polynomial result of calculations of other CRC in addition to the 0th CRC,
Determine that entry exists.
It should be noted that first default time can be true according to the number of entries for supporting to conflict by those skilled in the art
It is fixed.
In the presence of determining entry, matching table address is determined according to the polynomial result of calculations of CRC for step 101;
Step 102, returned after being tabled look-up to matching list according to determining matching table address as a result, determine piece outside Hash
HASH tables look-up address;
Step 103, address of being tabled look-up according to HASH outside determining piece, which table look-up obtaining Hash and tabling look-up, returns to KEY values, according to
KEY values and the Hash of entry are tabled look-up, and whether KEY values are consistent carries out processing of tabling look-up for return;
Optionally, it is tabled look-up according to the KEY values of entry and Hash and returns to the whether consistent processing that table look-up of KEY values and include:
KEY values and the Hash of entry table look-up return KEY values it is consistent, return entry;The KEY values and Hash of entry are tabled look-up return
KEY values are inconsistent, determine the entry miss.
Optionally, present invention method further includes:
Matching list tables look-up the result of return and the polynomial result of calculation of other CRC in addition to the 0th CRC mismatches
When, it is handled central processor CPU is sent in entry, or entry is handled according to preset rules.The present invention is implemented
Double Data Rate synchronous DRAM (DDR) outside piece can be arranged in example matching list.
Optionally, before step 100, present invention method can also include processing procedure as shown in Figure 2:
Step 200 is related to second default MASK of business setting according to entry;
Step 201, to each entry, respectively according to packet parsing result, business step, and/or application model select
The MASK of respective type;
It should be noted that how to select the MASK of respective type can be by those skilled in the art according to packet parsing knot
Fruit, business step, and/or application model etc. carry out analysis setting.
Step 202, the MASK according to selection are filtered KEY values invalid in entry;
Wherein, packet parsing result may include type of message.
The embodiment of the present invention is reduced by being filtered to KEY values invalid in entry to pin resource, bandwidth resources
Occupancy, avoid influence to chip processing performance.When network is tabled look-up, the content for designing KEY is more, such as in TCP most often
It is exactly five-tuple information, the embodiment of the present invention can effectively filter wherein useless content by MASK, prevent from searching and tie
Fruit mistake;For example, certain entries are only related to IP address, the letters such as port number are not shielded, and will cause entry lookup mistake;
The embodiment of the present invention can be filtered the constitution content without consideration in entry by MASK according to the business that entry is related to,
The constitution content because without considering is avoided, entry is caused to be stored in multiple positions.
Optionally, before step 100, present invention method can also include processing procedure as shown in Figure 3:
Default step 300, configuration third Bloom Filter table;
Optionally, the default Bloom Filter table of configuration of embodiment of the present invention third includes:
According to the default Bloom Filter table of number of entries configuration third for supporting conflict;
It should be noted that after supporting the number of entries of conflict can be by emulation determining maximum in the related technology,
Surplus is rule of thumb added to obtain.Bloom Filter of embodiment of the present invention table can be placed on static random access memory in piece
Device (SRAM).
Step 301 carries out CRC calculating to the KEY values of entry, obtains CRC results;
Step 302 searches all Bloom Filter tables using CRC results, obtains filter table result;
Step 303 judges that entry whether there is according to filter table result;
Step 304 in the presence of determining entry, continues to table look-up, and in the absence of determining entry, stops tabling look-up.
The embodiment of the present invention by there is no entry be filtered, reduce and pin resource, bandwidth resources accounted for
With, avoid influence to chip processing performance.By Bloom Filter, judge that entry whether there is, if entry is not deposited
It is handled being then directly fed to central processing unit (CPU), without wasting subsequent bandwidth of tabling look-up;Bloom fitter generally make
It is realized with static RAM in piece (SRAM, Static Random Access Memory);
In order to make content of the embodiment of the present invention understand, bloom fitter are illustrated below:
Bloom fitter generally can carry out multiple CRC calculating, and bloom fitter are carried out according to the result of multiple CRC
The inquiry of table, the result of only multiple CRC find bloom fitter results are that 1 entry just exists;Therefore, it is necessary to carry out
The case where repeatedly tabling look-up, need not generally supporting each cycle continuous processing can use this processing mode;Such as 4 periods
One situation of processing, the value of CRC is calculated separately using 4 CRC functions, with this search bloom fitter tables as a result, only
There is the case where all hitting, just carries out subsequent processing;Otherwise it is handled according to the case where miss;At bloom fitter tables
Reason Hash (HASH) conflict can have the case where multiple bits (bit), multiple bit to represent the quantity of conflict;Each bloom
Support 16 conflicts in the addresses fitter, it is necessary to 16bit;When most, needing to table look-up for 16 times just can determine that whether entry hits;Such as
Fruit has the requirement in rate, then Double Data Rate synchronous DRAM (DDR, Dual Data Rate) can not be waited for
It reads to return and just needs to initiate reading next time, the tape reading of worst situation DDR is wide to expand 16 times, due to the probability of HASH conflicts
Larger, the range bandwidth expansion of DDR is in 2 times or more, and for there are a plurality of types of entries in DDR, this bandwidth expansion is nothing
What method received.
It should be noted that the processing procedure and step 300 of step 200~202~304 processing procedure can be in this hair
It applies, can also implement separately as alternative embodiment simultaneously in bright embodiment.The embodiment of the present invention, if to treatment effeciency and
Required precision is higher, more set bloom fitter tables, multiple CRC functions can also be used to be handled, only whole bloom
The case where fitter is hit just carries out subsequent processing, is otherwise handled according to loss (MISS);
Compared with the relevant technologies, technical scheme includes:According to key (KEY) value of entry, pass through cyclic redundancy school
It tests (CRC) polynomial computation and determines that entry whether there is;In the presence of determining entry, determined according to the polynomial result of calculations of CRC
Match table address;It is being returned after being tabled look-up to matching list according to determining matching table address as a result, determine piece outside Hash
(HASH) it tables look-up address;Table look-up obtaining Hash and tabling look-up and return to KEY values according to the addresses of tabling look-up HASH outside determining piece, according to item
Purpose KEY values and Hash, which table look-up return whether KEY values are consistent, carries out processing of tabling look-up.Present invention method reduces needs and looks into
The entry of table reduces to pin resource, the occupancy of bandwidth resources, avoids influence to chip processing performance.
The embodiment of the present invention also provides a kind of computer storage media, and computer is stored in computer storage media to be held
Row instruction, computer executable instructions are used to execute above-mentioned realization and table look-up the method for processing.
The embodiment of the present invention also provides a kind of device for realizing processing of tabling look-up, including:Memory and processor;Wherein,
Processor is configured as executing the program instruction in memory;
Program instruction reads in processor and executes following operation:
Key (KEY) value of entry is carried out first and presets secondary cyclic redundancy check (CRC) polynomial computation;
It tables look-up using the 0th polynomial result of calculations of CRC as the address of matching list;
The result for return of tabling look-up is matched with the polynomial result of calculations of other CRC in addition to the 0th CRC;
When the result of return of tabling look-up is matched with the polynomial result of calculations of others CRC, determine that entry exists, and according to
Hash HASH outside piece is obtained with result to table look-up address;
The outer Hash of piece table look-up return when, compare the KEY values of entry and Hash table look-up whether return to KEY values consistent, entry
KEY values and Hash are tabled look-up, and to return to KEY values consistent, returns to the entry;The KEY values and Hash of entry table look-up return KEY values it is inconsistent,
Determine the entry miss.
Fig. 4 is the structure diagram for the device that the embodiment of the present invention realizes processing of tabling look-up, as shown in figure 4, including:First judges
Unit, matching list address location, Hash Round Robin data partition unit, processing unit of tabling look-up;Wherein,
First judging unit is used for:According to the key KEY values of entry, determined by cyclic redundancy check (CRC) polynomial computation
Entry whether there is;
Matching list address location is used for:In the presence of determining entry, with determining matching list according to the polynomial result of calculations of CRC
Location;
Hash Round Robin data partition unit is used for:Returned after being tabled look-up to matching list according to determining matching table address as a result, true
The outer Hash HASH of stator tables look-up address;
Processing unit of tabling look-up is used for:Table look-up according to the addresses of tabling look-up HASH outside determining piece and to obtain Hash and table look-up return
KEY values, being tabled look-up according to KEY values and the Hash of entry, whether KEY values are consistent carries out processing of tabling look-up for return.
Optionally, the first judging unit is specifically used for:
The KEY values of entry are subjected to first default CRC polynomial computation;
It tables look-up using the 0th polynomial result of calculations of CRC as the address of matching list;
Matching list is tabled look-up into the result of return and the polynomial result of calculation of other CRC in addition to the 0th CRC carries out
Match;
Matching list tables look-up the result of return when being matched with the polynomial result of calculations of other CRC in addition to the 0th CRC,
Determine that entry exists.
Optionally, processing unit of tabling look-up is specifically used for:
Table look-up obtaining Hash and tabling look-up and return to KEY values according to the addresses of tabling look-up HASH outside determining piece, the KEY values of entry and
Hash table look-up return KEY values it is consistent, return entry;The KEY values and Hash of entry table look-up return KEY values it is inconsistent, determination described in
Entry miss.
Optionally, processing unit of tabling look-up is additionally operable to:
Matching list tables look-up the result of return and the polynomial result of calculation of other CRC in addition to the 0th CRC mismatches
When, it is handled central processor CPU is sent in entry, or entry is handled according to preset rules.
Optionally, device further includes setting masking unit, mask selecting unit, filter element;Wherein,
Setting masking unit is used for:It is related to second default mask of business setting according to entry;
Mask selecting unit is used for:To each entry, respectively according to packet parsing result, business step, and/or application
The MASK of model selection respective type;
Filter element is used for:According to the MASK of selection, KEY values invalid in entry are filtered;
Wherein, packet parsing result includes type of message.
Optionally, device further includes dispensing unit, the second computing unit, the second lookup unit, the second determination unit and
Two processing units;Wherein,
Dispensing unit is used for:Configure default Bloom Filter table of third;
Second computing unit is used for:CRC calculating is carried out to the KEY values of entry, obtains CRC results;
Second lookup unit is used for:All Bloom Filter tables are searched using CRC results, obtain filter table result;
Second determination unit is used for:Judge that entry whether there is according to filter table result;
Second processing unit is used for:In the presence of determining entry, continue to table look-up, in the absence of determining entry, stops tabling look-up.
Optionally, dispensing unit is specifically used for:
According to the default Bloom Filter table of number of entries configuration third for supporting conflict.
Compared with the relevant technologies, technical scheme includes:According to key (KEY) value of entry, pass through cyclic redundancy school
It tests (CRC) polynomial computation and determines that entry whether there is;In the presence of determining entry, determined according to the polynomial result of calculations of CRC
Match table address;It is being returned after being tabled look-up to matching list according to determining matching table address as a result, determine piece outside Hash
(HASH) it tables look-up address;Table look-up obtaining Hash and tabling look-up and return to KEY values according to the addresses of tabling look-up HASH outside determining piece, according to item
Purpose KEY values and Hash, which table look-up return whether KEY values are consistent, carries out processing of tabling look-up.Present invention method reduces needs and looks into
The entry of table reduces to pin resource, the occupancy of bandwidth resources, avoids influence to chip processing performance.
The method of the present invention is carried out to understand detailed description below by way of using example, reconciliation is merely to illustrate using example
The present invention is released, is not intended to limit the present invention.
Fig. 5 is that the present invention applies exemplary method flow diagram, as shown in figure 5, including:
Step 500, configuration MASK values, operating mode and correlation are enabled etc.;
Here, operating mode, related enabled etc. can based on experience value be set according to art technology.
Step 501, initialization Bloom Filter table content, matching list content;
After the completion of step 502, initialization, the externally input data for including entry are received;
Step 503, the type according to input data choose corresponding MASK values, and the KEY values of data and MASK are carried out
Position with operation, obtain in place with the KEY values after operation;
Step 504, the KEY values obtained with operation using position carry out two or more CRC polynomial computations parallel, obtain
To 4 CRC result of calculations;
Step 505 looks into corresponding four Bloom Filter tables respectively using 4 crc values;
Step 506 looks into four Bloom Filter tables and obtains the return value of four Bloom Filters;
Step 507 judges hit or miss according to the return value of four Bloom Filters;Wherein, four Broomes
When the return value of filter is 1, hit is indicated, when to have one in the return value of four bloom fitter be not 1, expression
Miss;When miss, step 516 is executed;When hit, step 508 is executed;
Step 508, the polynomial computation that 8 difference CRC are carried out according to KEY values, obtain the CRC of 8 CRC polynomial computations
Result of calculation;
Step 509, according to the result of calculation inquiring and matching table of the 0th CRC, 16 matching values (value) are obtained, by first
A CRC is compared with 16 matching value values, exports the comparison result of 16 bits;The present embodiment exports the knot of 16*7bit in total
Fruit;
Step 510 sends out the final address of tabling look-up that 7 CRC are calculated according to 16bit results respectively.
Rule:First CRC obtains position offset value if it does, according to the matching result of highest priority;Such as
1, when the comparison result exported is 0xffff, i.e., all values match, and 0 deviation post comes into force, final CRC1's
Output address of tabling look-up is { CRC0,4 ' d0 };
2, when output result is 0x0f**, the 4th matching of highest priority match bit, 4 deviation posts come into force, final
The output address of tabling look-up of CRC1 is { CRC0,4 ' d4 };
3, when output result is 0x0011, the 11st matching of highest priority match bit, 11 deviation posts come into force, final
The output address of tabling look-up of CRC1 is { CRC0,4 ' d11 };
4, when output result is 0x0002, the 14th matching of highest priority match bit, 14 deviation posts come into force;Final
The output address of tabling look-up of CRC1 is { CRC0,4 ' d14 };
To sum up, the embodiment of the present invention, it is deviant to take the position of first effective (1);Follow-up effectively bit does not give birth to
Effect;
The result of CRC1~CRC7 is same, in the case of CRC1 is effective, using CRC1 output as a result, and so on,
If void in whole is handled in the way of miss;
Step 511, the result for obtaining 7 CRC1 to CRC7;
Whether effectively step 512 judges the result of 7 CRC1 to CRC7;When the result of 7 CRC1 to CRC7 is effective
When, execute step 513;If mismatched when the result of 7 CRC1 to CRC7 exists, step 516 is executed;
Step 513 chooses corresponding crc value according to priority and significant notation;
Step 514 searches matching value table according to the crc value of selection, obtains matching value and KEY values as return value;
The KEY values of entry match comparing, and judge whether to match by step 515 with the KEY values that meter reading returns;Such as
Really bar purpose KEY values are matched with the KEY values that meter reading returns, and execute step 517;If the KEY that the KEY values of entry are returned with meter reading
Value mismatches, and executes step 516;
Step 516 is handled according to preset rules;
Step 517, the result returned according to meter reading are handled.
One of ordinary skill in the art will appreciate that all or part of step in the above method can be instructed by program
Related hardware (such as processor) is completed, and described program can be stored in computer readable storage medium, as read-only memory,
Disk or CD etc..Optionally, all or part of step of above-described embodiment can also be come using one or more integrated circuits
It realizes.Correspondingly, the form realization of hardware may be used in each module/unit in above-described embodiment, such as passes through integrated electricity
Its corresponding function is realized on road, can also be realized in the form of software function module, such as is stored in by processor execution
Program/instruction in memory realizes its corresponding function.The present invention is not limited to the hardware and softwares of any particular form
In conjunction with.
Although disclosed herein embodiment it is as above, the content only for ease of understanding the present invention and use
Embodiment is not limited to the present invention.Technical staff in any fields of the present invention is taken off not departing from the present invention
Under the premise of the spirit and scope of dew, any modification and variation, but the present invention can be carried out in the form and details of implementation
Scope of patent protection, still should be subject to the scope of the claims as defined in the appended claims.
Claims (14)
1. a kind of method for realizing processing of tabling look-up, which is characterized in that including:
According to the key KEY values of entry, determine that entry whether there is by cyclic redundancy check (CRC) polynomial computation;
In the presence of determining entry, matching table address is determined according to the polynomial result of calculations of CRC;
It is being returned after being tabled look-up to matching list according to determining matching table address as a result, determine piece outside Hash HASH table look-up ground
Location;
Table look-up obtaining Hash and tabling look-up and return to KEY values according to the addresses of tabling look-up HASH outside determining piece, according to the KEY values of entry and
The Hash, which is tabled look-up, returns to whether KEY values unanimously carry out processing of tabling look-up.
2. according to the method described in claim 1, it is characterized in that, the determining entry is with the presence or absence of including:
The KEY values of the entry are subjected to first default CRC polynomial computation;
It is tabled look-up using the 0th polynomial result of calculations of CRC as the address of the matching list;
The matching list is tabled look-up into the result of return and the polynomial result of calculation of other CRC in addition to the 0th CRC carries out
Match;
The matching list tables look-up the result of return when being matched with the polynomial result of calculations of other CRC in addition to the 0th CRC,
Determine that the entry exists.
3. according to the method described in claim 1, it is characterized in that, the KEY values and Hash according to entry, which is tabled look-up, returns to KEY
The value processing that whether unanimously carries out tabling look-up includes:
The KEY values of the entry and the Hash are tabled look-up, and to return to KEY values consistent, returns to the entry;The KEY values of the entry and
The Hash table look-up return KEY values it is inconsistent, determine the entry miss.
4. according to the method described in claim 2, it is characterized in that, the method further includes:
The matching list table look-up return result and the others polynomial result of calculations of CRC in addition to the 0th CRC not
Timing is handled central processor CPU is sent in the entry, or the entry is handled according to preset rules.
5. according to Claims 1 to 4 any one of them method, which is characterized in that described multinomial by cyclic redundancy check (CRC)
Before formula calculating determines that entry whether there is, the method further includes:
It is related to second default mask MASK of business setting according to the entry;
To each entry, respective type is selected according to packet parsing result, business step, and/or application model respectively
MASK;
According to the MASK of selection, KEY values invalid in entry are filtered;
Wherein, the packet parsing result includes type of message.
6. according to Claims 1 to 4 any one of them method, which is characterized in that described multinomial by cyclic redundancy check (CRC)
Before formula calculating determines that entry whether there is, the method further includes:
Configure default Bloom Filter table of third;
CRC calculating is carried out to the KEY values of the entry, obtains CRC results;
All Bloom Filter tables are searched using the CRC results, obtain filter table result;
Judge that the entry whether there is according to the filter table result;
In the presence of determining the entry, continue to table look-up, in the absence of determining the entry, stops tabling look-up.
7. according to the method described in claim 6, it is characterized in that, default Bloom Filter table packet of the configuration third
It includes:
According to the default Bloom Filter table of number of entries configuration third for supporting conflict.
8. a kind of device for realizing processing of tabling look-up, which is characterized in that including:First judging unit, matching list address location, Hash
Address location, processing unit of tabling look-up;Wherein,
First judging unit is used for:According to the key KEY values of entry, entry is determined by cyclic redundancy check (CRC) polynomial computation
It whether there is;
Matching list address location is used for:In the presence of determining entry, matching table address is determined according to the polynomial result of calculations of CRC;
Hash Round Robin data partition unit is used for:It is being returned after being tabled look-up to matching list according to determining matching table address as a result, determine piece
Outer Hash HASH tables look-up address;
Processing unit of tabling look-up is used for:Table look-up obtaining Hash and tabling look-up and return to KEY values according to the addresses of tabling look-up HASH outside determining piece,
It tables look-up return according to the KEY values of entry and Hash whether KEY values is consistent and carry out processing of tabling look-up.
9. device according to claim 8, which is characterized in that first judging unit is specifically used for:
The KEY values of the entry are subjected to first default CRC polynomial computation;
It is tabled look-up using the 0th polynomial result of calculations of CRC as the address of the matching list;
The matching list is tabled look-up into the result of return and the polynomial result of calculation of other CRC in addition to the 0th CRC carries out
Match;
The matching list tables look-up the result of return when being matched with the polynomial result of calculations of other CRC in addition to the 0th CRC,
Determine that the entry exists.
10. device according to claim 8, which is characterized in that the processing unit of tabling look-up is specifically used for:
Table look-up obtaining Hash and tabling look-up and return to KEY values according to the addresses of tabling look-up HASH outside determining piece, the KEY values of the entry and
The Hash table look-up return KEY values it is consistent, return to the entry;The KEY values of the entry and the Hash, which are tabled look-up, returns to KEY values
It is inconsistent, determine the entry miss.
11. device according to claim 9, which is characterized in that the processing unit of tabling look-up is additionally operable to:
The matching list table look-up return result and the others polynomial result of calculations of CRC in addition to the 0th CRC not
Timing is handled central processor CPU is sent in the entry, or the entry is handled according to preset rules.
12. according to claim 8~11 any one of them device, which is characterized in that described device further includes setting mask list
Member, mask selecting unit, filter element;Wherein,
Setting masking unit is used for:It is related to second default mask MASK of business setting according to the entry;
Mask selecting unit is used for:To each entry, respectively according to packet parsing result, business step, and/or application model
Select the MASK of respective type;
Filter element is used for:According to the MASK of selection, KEY values invalid in entry are filtered;
Wherein, the packet parsing result includes type of message.
13. according to claim 8~11 any one of them device, which is characterized in that described device further includes dispensing unit,
Two computing units, the second lookup unit, the second determination unit and second processing unit;Wherein,
Dispensing unit is used for:Configure default Bloom Filter table of third;
Second computing unit is used for:CRC calculating is carried out to the KEY values of the entry, obtains CRC results;
Second lookup unit is used for:All Bloom Filter tables are searched using the CRC results, obtain filter table result;
Second determination unit is used for:Judge that the entry whether there is according to the filter table result;
Second processing unit is used for:In the presence of determining the entry, continue to table look-up, in the absence of determining the entry, stops looking into
Table.
14. device according to claim 13, which is characterized in that the dispensing unit is specifically used for:
According to the default Bloom Filter table of number of entries configuration third for supporting conflict.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710210525.1A CN108664518B (en) | 2017-03-31 | 2017-03-31 | Method and device for realizing table look-up processing |
PCT/CN2018/079946 WO2018177184A1 (en) | 2017-03-31 | 2018-03-22 | Method and device for implementing table lookup processing, apparatus, and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710210525.1A CN108664518B (en) | 2017-03-31 | 2017-03-31 | Method and device for realizing table look-up processing |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108664518A true CN108664518A (en) | 2018-10-16 |
CN108664518B CN108664518B (en) | 2021-12-07 |
Family
ID=63674222
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710210525.1A Active CN108664518B (en) | 2017-03-31 | 2017-03-31 | Method and device for realizing table look-up processing |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN108664518B (en) |
WO (1) | WO2018177184A1 (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114584482B (en) * | 2022-02-14 | 2023-09-08 | 阿里巴巴(中国)有限公司 | Method, device and network card for storing detection data based on memory |
CN117411738B (en) * | 2023-12-15 | 2024-03-08 | 格创通信(浙江)有限公司 | Multicast replication method, device, electronic equipment and storage medium |
CN117478626B (en) * | 2023-12-27 | 2024-04-05 | 天津光电聚能通信股份有限公司 | Quick matching searching system, method, equipment and medium based on group connection cache |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030223417A1 (en) * | 2002-06-04 | 2003-12-04 | Masashi Higashida | Method of processing data packets |
CN1489336A (en) * | 2003-01-27 | 2004-04-14 | 四川南山之桥微电子有限公司 | Network filtering processor |
CN101350788A (en) * | 2008-08-25 | 2009-01-21 | 中兴通讯股份有限公司 | Method for mixed loop-up table of network processor inside and outside |
CN101540723A (en) * | 2009-04-20 | 2009-09-23 | 杭州华三通信技术有限公司 | Flow stream searching method and device |
CN102682116A (en) * | 2012-05-14 | 2012-09-19 | 中兴通讯股份有限公司 | Method and device for processing table items based on Hash table |
CN102761394A (en) * | 2012-07-05 | 2012-10-31 | 中兴通讯股份有限公司 | Method and device for processing data |
CN103001878A (en) * | 2012-11-26 | 2013-03-27 | 中兴通讯股份有限公司 | Determination method and device for media access control (MAC) address Hash collision |
CN103918032A (en) * | 2011-10-31 | 2014-07-09 | 华为技术有限公司 | A method and apparatus for network table lookups |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7904460B2 (en) * | 2008-04-23 | 2011-03-08 | Microsoft Corporation | Determining computer information from processor properties |
CN104866502B (en) * | 2014-02-25 | 2020-10-13 | 深圳市中兴微电子技术有限公司 | Data matching method and device |
CN105376159A (en) * | 2014-08-25 | 2016-03-02 | 深圳市中兴微电子技术有限公司 | Packet processing and forwarding device and method |
-
2017
- 2017-03-31 CN CN201710210525.1A patent/CN108664518B/en active Active
-
2018
- 2018-03-22 WO PCT/CN2018/079946 patent/WO2018177184A1/en active Application Filing
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030223417A1 (en) * | 2002-06-04 | 2003-12-04 | Masashi Higashida | Method of processing data packets |
CN1489336A (en) * | 2003-01-27 | 2004-04-14 | 四川南山之桥微电子有限公司 | Network filtering processor |
CN1238996C (en) * | 2003-01-27 | 2006-01-25 | 四川南山之桥微电子有限公司 | Network filtering processor |
CN101350788A (en) * | 2008-08-25 | 2009-01-21 | 中兴通讯股份有限公司 | Method for mixed loop-up table of network processor inside and outside |
CN101540723A (en) * | 2009-04-20 | 2009-09-23 | 杭州华三通信技术有限公司 | Flow stream searching method and device |
CN103918032A (en) * | 2011-10-31 | 2014-07-09 | 华为技术有限公司 | A method and apparatus for network table lookups |
CN102682116A (en) * | 2012-05-14 | 2012-09-19 | 中兴通讯股份有限公司 | Method and device for processing table items based on Hash table |
CN102761394A (en) * | 2012-07-05 | 2012-10-31 | 中兴通讯股份有限公司 | Method and device for processing data |
CN103001878A (en) * | 2012-11-26 | 2013-03-27 | 中兴通讯股份有限公司 | Determination method and device for media access control (MAC) address Hash collision |
Non-Patent Citations (1)
Title |
---|
谭兴晔: "基于快速搜索树的路由查表算法", 《计算机应用研究》 * |
Also Published As
Publication number | Publication date |
---|---|
WO2018177184A1 (en) | 2018-10-04 |
CN108664518B (en) | 2021-12-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Dharmapurikar et al. | Fast and scalable pattern matching for content filtering | |
US9384145B2 (en) | Systems and methods for implementing dynamically configurable perfect hash tables | |
US7539031B2 (en) | Inexact pattern searching using bitmap contained in a bitcheck command | |
US7644080B2 (en) | Method and apparatus for managing multiple data flows in a content search system | |
US7624105B2 (en) | Search engine having multiple co-processors for performing inexact pattern search operations | |
US7539032B2 (en) | Regular expression searching of packet contents using dedicated search circuits | |
US8473523B2 (en) | Deterministic finite automata graph traversal with nodal bit mapping | |
US7529746B2 (en) | Search circuit having individually selectable search engines | |
Kumar et al. | Advanced algorithms for fast and scalable deep packet inspection | |
US7899978B2 (en) | Dynamic programmable intelligent search memory | |
CN1327674C (en) | Double stack compatible router searching device supporting access control listing function on core routers | |
US7565343B2 (en) | Search apparatus and search management method for fixed-length data | |
JP2004229163A (en) | Device and method for retrieving fixed length data, computer program, and computer readable recording medium | |
WO2008073824A1 (en) | Dynamic programmable intelligent search memory | |
US20150121034A1 (en) | Systems and Methods for Implementing Low-Latency Lookup Circuits Using Multiple Hash Functions | |
JP7170905B2 (en) | Traffic classification method and apparatus | |
US9471316B2 (en) | Using a single-instruction processor to process messages | |
EP4143691A1 (en) | Systems for providing an lpm implementation for a programmable data plane through a distributed algorithm | |
CN108664518A (en) | A kind of method and device for realizing processing of tabling look-up | |
US11258707B1 (en) | Systems for building data structures with highly scalable algorithms for a distributed LPM implementation | |
US9781062B2 (en) | Using annotations to extract parameters from messages | |
US9088476B2 (en) | Network communication system with packet forwarding and method of operation thereof | |
Lázaro et al. | Fast and efficient address search in System-on-a-Programmable-Chip using binary trees | |
JP2002374289A (en) | Retrieval system and method for registering retrieval condition to cam used therefor, and program thereof | |
CN116319551A (en) | High-efficiency network flow table design method based on FPGA |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |