CN109194665A - A kind of generation method that message finds key value and device - Google Patents
A kind of generation method that message finds key value and device Download PDFInfo
- Publication number
- CN109194665A CN109194665A CN201811081606.7A CN201811081606A CN109194665A CN 109194665 A CN109194665 A CN 109194665A CN 201811081606 A CN201811081606 A CN 201811081606A CN 109194665 A CN109194665 A CN 109194665A
- Authority
- CN
- China
- Prior art keywords
- key assignments
- field
- selector
- spliced
- bits
- 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
- 238000000034 method Methods 0.000 title claims abstract description 18
- 238000005194 fractionation Methods 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 4
- 230000005540 biological transmission Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 230000000452 restraining effect Effects 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/10—Network architectures or network communication protocols for network security for controlling access to devices or network resources
- H04L63/101—Access control lists [ACL]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Hardware Design (AREA)
- Computer Security & Cryptography (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
Present invention discloses a kind of generation method that message finds key value and device, method includes that the field that packet parsing obtains is divided into five groups;TCAM, which is searched, according to the forwarding information of message obtains selector corresponding with field groups;The field of selector selection respective numbers is simultaneously spliced to form the first to the 5th key assignments;Second, first key assignments is spliced into the 6th key assignments, the five, the 4th, third key assignments are spliced into the 7th key assignments;6th key assignments is split into multiple 16 bits and selects several to be spliced into the 8th key assignments by preset selector;8th key assignments is split into the 9th key assignments and the tenth key assignments, seven key assignments and the 9th key assignments are spliced into the 11st key assignments, select several 1 bits, 2 bits and 4 bits using preset selector and is spliced into the 12nd key assignments;12nd key assignments and the tenth key assignments are spliced into message and found key value.The present invention makes TCAM that can efficiently utilize TCAM resource when being applied to ACL.
Description
Technical field
The present invention relates to technical field of the computer network, more particularly, to a kind of method and device that message finds key value.
Background technique
The expansion of network size and the increase of flow, control to network security and become network management to the distribution of bandwidth
Important content.It can control by being filtered the access that illegal user can be effectively prevented to network to message, while also
Flow saves Internet resources.ACL (Access Control List, accesses control list) is usually used in being filtered message,
It is an orderly rule set, and the filtering to message is realized by these rules.After the port of equipment receives message, when
Front port analyzes message according to the acl rule of application, is allowed according to default rule or message is forbidden to pass through, ACL can
Message is filtered by the source address of message, destination address, port numbers etc..
TCAM (Ternary Content Addressable Memory, three-state content addressing memory) is usually used in quickly
Search the list items such as ACL, routing.In actual deployment in use, due to can not know end user configuration combine, be typically only capable to by
Find key value (Key) of ACL is divided into 160bit, 320bit and 640bit three classes, and in actual deployment in use, really needing
The field information matched, for uniquely finding key value in fact seldom, such as most of applications only need IPv4 source address, due to
IPv4 source address only has 32bit, so the TCAM that width is 80bit is enough, and uses the Key of 160bit, then causes
The waste of TCAM resource.
Summary of the invention
It is an object of the invention to overcome the deficiencies of existing technologies, providing one kind can be efficiently sharp when TCAM being made to be applied to ACL
The generation method and device to be found key value with the message of TCAM resource.
To achieve the above object, the following technical solutions are proposed: a kind of generation method that message finds key value by the present invention, including
Following steps:
S100 carries out parsing to received message and obtains several fields, and several described fields are at least divided into the
One field groups, the second field groups, third field groups, the 4th field groups and the 5th field groups;
S200 searches TCAM according to the forwarding information that the message carries, if obtaining for selecting in the first field groups
The first selector of dry field, is used in third the second selector for selecting several fields in the second field groups
The third selector of several fields is selected in field groups, for selecting the 4th of several fields the to select in the 4th field groups
Device and the 5th selector for selecting several fields in the 5th field groups;
S300, the selector obtained using step S200 select field in corresponding field groups, and by first selector
The field of selection is spliced to form the first key assignments, and the field that second selector selects is spliced to form the second key assignments, third is selected
The field of device selection is spliced to form third key assignments, and the field that the 4th selector selects is spliced to form the 4th key assignments, by the 5th choosing
The field for selecting device selection is spliced to form the 5th key assignments;
Second key assignments, the first key assignments are spliced to form the 6th key assignments by S400 in order, by the 5th key assignments, the 4th key assignments and
Third key assignments is spliced to form the 7th key assignments in order;
6th key assignments is split into M 16 bits by S500, and using preset 6th selector at the M 16
Selected in bit it is N number of be spliced to form the 8th key assignments, N is less than or equal to M, and N, M are integer;
8th key assignments is split into the 9th key assignments and the tenth key assignments by S600;
7th key assignments and the 9th key assignments are spliced to form the 11st key assignments, and use preset 7th selection by S700
Device, the 8th selector and the 9th selector select several 1 bits, 2 bits and 4 bits to press respectively in the 11st key assignments
Sequential concatenation forms the 12nd key assignments;
12nd key assignments and the tenth key assignments are spliced to form message in order and found key value by S800.
Preferably, in the step s 100, the bit according to occupied by each field divides several described fields
Group.
Preferably, each field accounts for 32 bits, each field in second field groups in first field groups
16 bits are accounted for, each field accounts for 8 bits in the third field groups, and each field accounts for 4 in the 4th field groups
A bit, each field accounts for 2 bits in the 5th field groups.
Preferably, in step s 200, the information that the message carries is selected from message arrival end slogan, message outlet port
Number, one or more of forwarding informations such as logic source port number, logic destination slogan, type of message.
Preferably, in step S600, high P bits of the 8th key assignments are the 9th key assignments, the 8th key assignments
Low Q bit is the tenth key assignments, and P, Q are integer.
Present invention further teaches a kind of generating means that message finds key value, including
Packet parsing grouping module obtains several fields for carrying out parsing to received message, and will be described several
A field is at least divided into the first field groups, the second field groups, third field groups, the 4th field groups and the 5th field groups;
Selector obtains module, and the forwarding information for being carried according to the message searches TCAM, obtains for first
The first selector of several fields is selected in field groups, for selecting the second of several fields to select in the second field groups
Device, the third selector for selecting several fields in third field groups, for selecting several in the 4th field groups
4th selector of field and the 5th selector for selecting several fields in the 5th field groups;
First splicing module selects field for the selector using acquisition in corresponding field groups, and first is selected
The field for selecting device selection is spliced to form the first key assignments, the field that second selector selects is spliced to form the second key assignments, by third
The field of selector selection is spliced to form third key assignments, the field that the 4th selector selects is spliced to form the 4th key assignments, by the
The field of five selectors selection is spliced to form the 5th key assignments;
Second splicing module, for the second key assignments, the first key assignments to be spliced to form the 6th key assignments in order, by the 5th key
Value, the 4th key assignments and third key assignments are spliced to form the 7th key assignments in order
First splits module, for the 6th key assignments to be split into M 16 bits, and uses preset 6th selector
Selected in the M 16 bits it is N number of be spliced to form the 8th key assignments, N is less than or equal to M, and N, M are integer;
Second splits module, for the 8th key assignments to be split into the 9th key assignments and the tenth key assignments;
Third splicing module, for the 7th key assignments and the 9th key assignments to be spliced to form the 11st key assignments, and using pre-
If the 7th selector, the 8th selector and the 9th selector select several 1 bits, 2 respectively in the 11st key assignments
Bit and 4 bits are spliced to form the 12nd key assignments in order;
4th splicing module, for the 12nd key assignments and the tenth key assignments to be spliced to form message key for searching in order
Value.
Preferably, the packet parsing grouping module includes parsing module and grouping module, the parsing module for pair
Received message carries out parsing and obtains several fields, and the grouping module is used to several described fields being at least divided into first
Field groups, the second field groups, third field groups, the 4th field groups and the 5th field groups.
Preferably, grouping module bit quantity according to occupied by each field is grouped.
Preferably, each field in first field groups occupies 32 bits, in second field groups
Each field occupies 16 bits, and each field occupies 8 bits, the 4th field in the third field groups
Each field in group occupies 4 bits, and each field in the 5th field groups occupies 2 bits.
Preferably, the 8th key assignments is split into high P bit and low Q bit by the second fractionation module, described
High P bit is the 9th key assignments, and P, Q are integer.
The beneficial effects of the present invention are:
The generation method and device that a kind of message of the present invention finds key value can be efficient when TCAM being made to be applied to ACL
Utilize TCAM resource, while also can avoid occurring rear end design the case where can not restraining in ASIC design.
Detailed description of the invention
Fig. 1 is flow chart of the method for the present invention schematic diagram;
Fig. 2 is that the embodiment of the present invention principal diagram is intended to;
Fig. 3 is structural block diagram schematic diagram of the invention.
Specific embodiment
Below in conjunction with attached drawing of the invention, clear, complete description is carried out to the technical solution of the embodiment of the present invention.
The generation method that a kind of disclosed message finds key value, makes TCAM (TernaryContent
Addressable Memory, three-state content addressing memory) it is applied to ACL (AccessControl List, access control column
Table) when, TCAM resource can be efficiently utilized, while also can avoid occurring the case where rear end design can not restrain in ASIC design.
As shown in Figure 1, a kind of generation method that message finds key value, includes the following steps:
S100, carries out parsing to the message received and obtains several fields, several described fields are at least divided into the
One field groups, the second field groups, third field groups, the 4th field groups, the 5th field groups;
Specifically, message is the data cell exchanged in network with transmission, and message is constantly packaged into transmission process
Grouping, packet, frame transmit, and finally make comprising the information such as two layers, three layers in message, two layers of information include mac source address, MAC
Destination address, ethernet type, VLAN etc., three-layer information include IP source address, IP destination address etc..By taking IP packet as an example,
IP packet is made of stem and data portion, wherein the stem of IP packet includes source address field, destination address field (DAF), stem
Checksum field, protocol fields etc., each field occupies certain bit, such as source address field and destination address field (DAF)
32 bits are occupied, stem checksum field occupies 16 bits, protocol fields occupy 8 bits.
When implementation, it can get several for including in the information such as two layers, three layers by parse to the message received
Field, further can the bit according to occupied by each field message is divided into several groups.In the present embodiment, according to each
Message is divided into five groupings, i.e. the first field groups, the second field groups, third field groups, the 4th by bit occupied by field
Field groups and the 5th field groups, wherein each field in the first field groups occupies 32 bits, in the second field groups
Each field occupies 16 bits, and each field occupies 8 bits in third field groups, every in the 4th field groups
A field occupies 4 bits, and each field in the 5th field groups occupies 2 bits.It certainly, can also when implementation
The field for occupying 1 bit is divided into one group.
Step 200, TCAM is searched according to the forwarding information that the message carries, obtained for being selected in the first field groups
The first selector of several fields, the second selector for selecting several fields in the second field groups, for the
The third selector of several fields is selected in three field groups, for selecting the 4th of several fields the to select in the 4th field groups
Select device and the 5th selector for selecting several fields in the 5th field groups;
Specifically, the selector entry for selecting field quantity in each field groups is stored in TCAM, when implementation,
It is searched in TCAM according to message forwarding information and can be obtained the corresponding selector of respective field group, selector can be according to user's need
Ask configuration.Further according to message carry forwarding information searched in TCAM after can get selected in the first field groups it is several
The first selector of a field, the second selector that several fields are selected in the second field groups select in third field groups
It selects the third selector of several fields, select in the 4th field groups the 4th selector of several fields and in the 5th field
The 5th selector of several fields is selected in group.When it is implemented, selecting 4 words in the first field groups with first selector
Section, second selector selected in the second field groups 10 fields, third selector selected in third field groups 8 fields,
It is best that 4th selector selects 8 fields in 10 fields of the 4th field group selection, the 5th selector in the 5th field groups.
In the present embodiment, message forwarding information includes but is not limited to message arrival end slogan (srcPort), message outlet end
Slogan (dstPort), logic source port number (logicSrcPort), logic destination slogan (logicDstProt), message class
Type (packetType).
Step S300, the selector obtained using step S200 selects field in corresponding field groups, and first is selected
The field for selecting device selection is spliced to form the first key assignments, the field that second selector selects is spliced to form the second key assignments, by third
The field of selector selection is spliced to form third key assignments, the field that the 4th selector selects is spliced to form the 4th key assignments, by the
The field of five selectors selection is spliced to form the 5th key assignments;
Specifically, step S200 obtains selector corresponding to each field groups, each selector mark by searching for TCAM
The quantity for selecting field in respective field group is shown, 4 fields has been selected in the first field groups as described above, in the second field
In group select 10 fields, in third field groups select 8 fields, in 10 fields of the 4th field group selection, in the 5th word
Duan Zuzhong selects 8 fields.
Using selector after selecting required amount of field in corresponding field groups, the field of selection is spliced to form phase
Select in first field groups 4 fields are such as spliced to form the first key assignments of 128bit by the key assignments answered, will be in the second field groups
10 fields of selection are spliced to form the second key assignments of 160bit, and select in third field groups 8 fields are spliced to form
10 fields selected in 4th field groups are spliced to form the 4th key assignments of 40bit, by the 5th word by the third key assignments of 64bit
8 fields of Duan Zuzhong selection are spliced to form the 5th key assignments of 16bit.
Second key assignments, the first key assignments are spliced to form the 6th key assignments, by the 5th key assignments, the 4th key by step S400 in order
Value and third key assignments are spliced to form the 7th key assignments in order;
6th key assignments is split into M 16 bits by step S500, and using preset 6th selector in the M
Selected in a 16 bit it is N number of be spliced to form the 8th key assignments, N is less than or equal to M, and N, M are integer;
8th key assignments is split into the 9th key assignments and the tenth key assignments by step S600, wherein the 9th key assignments is the
High P bits of eight key assignments, the tenth key assignments are low Q bits of the 8th key assignments, and P, Q are integer;
7th key assignments and the 9th key assignments are spliced to form the 11st key assignments, and use the preset 7th by step S700
Selector, the 8th selector and the 9th selector select several 1 bits, 2 bits and 4 ratios respectively in the 11st key assignments
Spy is spliced to form the 12nd key assignments in order;
12nd key assignments and the tenth key assignments are spliced to form message in order and found key value by step S800.
Specifically, when implementation, the second key assignments, the first key assignments are spliced to form the 6th key assignments in order first, by the 5th key
Value, the 4th key assignments and third key assignments are spliced to form the 7th key assignments in order, as 160bit the second key assignments and 128bit first
Key assignments is spliced to form the 6th key assignments of 288bit in order, by the 5th key assignments of 16bit, the 4th key assignments of 40bit and 64bit
Third key assignments is spliced to form the 7th key assignments of 120bit in order;
Secondly, the 6th key assignments is split into M 16bit, and selected in M 16 bits using preset 6th selector
It is N number of to be spliced to form the 8th key assignments, the 6th key assignments of 288bit is such as split into 18 16bit, and select by the 6th selector
10 16bit are spliced to form the 8th key assignments of 160bit;
Thirdly, the 8th key assignments is split into the 9th key assignments and the tenth key assignments, and by the 7th key assignments and the 9th key assignments by suitable
Sequence is spliced to form the 11st key assignments, and using preset 7th selector, the 8th selector and the 9th selector in the 11st key
Several 1bit, several 2bit and several 4bit are selected in value, and are spliced to form the 12nd key assignments in order.The present embodiment
In, the 9th key assignments is high P bits of the 8th key assignments, and the tenth key assignments is low Q bits of the 8th key assignments, and P, Q are integer.As incited somebody to action
The 8th key assignments of 160bit splits into the 9th key assignments of high 96bit and the tenth key assignments of low 64bit, and by the 7th key of 120bit
The 9th key assignments of value and 96bit are spliced to form the 11st key assignments of 216bit, by preset 7th selector in the 11st key
2 1bit are selected in value, the 8th selector selects 5 2bit, and the 9th selector selects 21 4bit, by 2 1bit, 5
2bit, 21 4bit are spliced to form the 12nd key assignments of 96bit;Finally, the 12nd key assignments and the tenth key assignments are spliced in order
It forms final message to find key value, is such as spliced to form the tenth key assignments of the 12nd key assignments of above-mentioned 96bit and 64bit
The message of 160bit finds key value (Key).
As shown in Fig. 2, by taking the key for the 160bit of ACL as an example, being looked into message of the present invention in the present embodiment
Key assignments generation method is looked for be described in detail.
Firstly, being grouped to the field that packet parsing obtains according to bit occupied by each field, it is divided into 5
Group, i.e. the first field groups (32bit), the second field groups (16bit), third field groups (8bit), the 4th field groups (4bit),
Five field groups (2bit).
Secondly, according to the forwarding information of message search TCAM, obtain first selector, second selector, third selector,
4th selector and the 5th selector, wherein first selector selects 4 fields in the first field groups, and second selector exists
10 fields are selected in second field groups, third selector selects 8 fields in third field groups, and the 4th selector is the 4th
10 fields are selected in field groups, the 5th selector selects 8 fields in the 5th field groups.
Secondly, select in the first field groups 4 fields to be spliced to form to the first key assignments of 128bit, by the second field groups
10 fields of middle selection are spliced to form the second key assignments of 160bit, and select in third field groups 8 fields are spliced to form
10 fields selected in 4th field groups are spliced to form the 4th key assignments of 40bit, by the 5th word by the third key assignments of 64bit
8 fields of Duan Zuzhong selection are spliced to form the 5th key assignments of 16bit.
Secondly, the first key assignments of the second key assignments of 160bit and 128bit to be spliced to form to the 6th key of 288bit in order
The 5th key assignments, the 4th key assignments of 40bit and the third key assignments of 64bit of 16bit, are spliced to form the 7th key of 120bit by value
Value;
Secondly, the 6th key assignments is split into 18 16bit, and 10 16bit are selected using preset 6th selector, most
It is spliced to form the 8th key assignments of 160bit eventually;
Secondly, the 8th key assignments is split into two parts, high 96bit is the 9th key assignments, and low 64bit is the tenth key assignments, by the
Seven key assignments and the 9th key assignments are spliced to form the 11st key assignments of 216bit in order;
Secondly, selecting 2 1bit in the 11st key assignments using preset 7th selector, the 8th selector is the 11st
In key assignments select 5 2bit, the 9th selector select in the 11st key assignments select 21 4bit, by 2 1bit, 5 2bit,
21 4bit are spliced to form the 12nd key assignments of 96bit;
Finally, the tenth key assignments of the 12nd key assignments of 96bit and 64bit to be spliced to form to the message key for searching of 160bit
Value.
As shown in figure 3, find key value generating means present invention further teaches a kind of message, including
Packet parsing grouping module obtains several fields for carrying out parsing to received message, and will be described several
A field is at least divided into the first field groups, the second field groups, third field groups, the 4th field groups and the 5th field groups;
Selector obtains module, and the forwarding information for being carried according to the message searches TCAM, obtains for first
The first selector of several fields is selected in field groups, for selecting the second of several fields to select in the second field groups
Device, the third selector for selecting several fields in third field groups, for selecting several in the 4th field groups
4th selector of field and the 5th selector for selecting several fields in the 5th field groups;
First splicing module, for using the selector of acquisition to select field in corresponding field groups and by first choice
The field of device selection is spliced to form the first key assignments, and the field that second selector selects is spliced to form the second key assignments, third is selected
The field for selecting device selection is spliced to form third key assignments, the field that the 4th selector selects is spliced to form the 4th key assignments, by the 5th
The field of selector selection is spliced to form the 5th key assignments;
Second splicing module, for the second key assignments, the first key assignments to be spliced to form the 6th key assignments in order, by the 5th key
Value, the 4th key assignments and third key assignments are spliced to form the 7th key assignments in order;
First splits module, for the 6th key assignments to be split into M 16 bits, and uses preset 6th selector
It selects N number of to be spliced to form the 8th key assignments in the M 16 bits;
Second splits module, for the 8th key assignments to be split into the 9th key assignments and the tenth key assignments;
Third splicing module, for the 7th key assignments and the 9th key assignments to be spliced to form the 11st key assignments, and using pre-
If the 7th selector, the 8th selector and the 9th selector select several 1 bits, 2 respectively in the 11st key assignments
Bit and 4 bits are spliced to form the 12nd key assignments in order;
4th splicing module, for the 12nd key assignments and the tenth key assignments to be spliced to form message key for searching in order
Value.
Specifically, message receiving module includes parsing module and grouping module, parsing module be used for received message into
Row parsing obtains several fields;Grouping module is used to several described fields being at least divided into the first field groups, the second field
Group, third field groups, the 4th field groups and the 5th field groups.When implementation, grouping module bit according to occupied by each field
Bit quantity is grouped, such as will be that the field of 32bit is divided into one group.
In the present embodiment, each field in the first field groups occupies 32 bits, each of second field groups
Field occupies 16 bits, and each field occupies 8 bits, each word in the 4th field groups in third field groups
Duan Jun occupies 4 bits, and each field in the 5th field groups occupies 2 bits.
Further, when selector obtains module according to the forwarding information of message lookup TCAM, the forward packets of message
Include but be not limited to message arrival end slogan (srcPort), message Egress port number (dstPort), logic source port number
(logicSrcPort), logic destination slogan (logicDstProt), type of message (packetType).
Further, the 8th key assignments is split into high P bit and low Q bit, the high P by the second fractionation module
Position bit is the 9th key assignments, and the low Q bit is the tenth key assignments, and P, Q are integer.
Technology contents and technical characteristic of the invention have revealed that as above, however those skilled in the art still may base
Make various replacements and modification without departing substantially from spirit of that invention, therefore, the scope of the present invention in teachings of the present invention and announcement
It should be not limited to the revealed content of embodiment, and should include various without departing substantially from replacement and modification of the invention, and be this patent Shen
Please claim covered.
Claims (10)
1. a kind of generation method that message finds key value, which comprises the steps of:
S100 carries out parsing to received message and obtains several fields, and several described fields are at least divided into the first word
Section group, the second field groups, third field groups, the 4th field groups and the 5th field groups;
S200 searches TCAM according to the forwarding information that the message carries, obtains for selecting several in the first field groups
The first selector of field, is used in third field the second selector for selecting several fields in the second field groups
Selected in group the third selector of several fields, the 4th selector for selecting several fields in the 4th field groups and
For selecting the 5th selector of several fields in the 5th field groups;
S300, the selector obtained using step S200 selects field in corresponding field groups, and first selector is selected
Field be spliced to form the first key assignments, by second selector select field be spliced to form the second key assignments, third selector is selected
The field selected is spliced to form third key assignments, the field that the 4th selector selects is spliced to form the 4th key assignments, by the 5th selector
The field of selection is spliced to form the 5th key assignments;
Second key assignments, the first key assignments are spliced to form the 6th key assignments, by the 5th key assignments, the 4th key assignments and third by S400 in order
Key assignments is spliced to form the 7th key assignments in order;
6th key assignments is split into M 16 bits by S500, and using preset 6th selector in the M 16 bits
Middle selection is N number of to be spliced to form the 8th key assignments, and N is less than or equal to M, and N, M are integer;
8th key assignments is split into the 9th key assignments and the tenth key assignments by S600;
7th key assignments and the 9th key assignments are spliced to form the 11st key assignments by S700, and use preset 7th selector, the
Eight selectors and the 9th selector select several 1 bits, 2 bits and 4 bits in order in the 11st key assignments respectively
It is spliced to form the 12nd key assignments;
12nd key assignments and the tenth key assignments are spliced to form message in order and found key value by S800.
2. the method according to claim 1, wherein in the step s 100, the ratio according to occupied by each field
Special position is grouped several described fields.
3. the method according to claim 1, wherein each field accounts for 32 bits in first field groups
, each field accounts for 16 bits in second field groups, and each field accounts for 8 bits in the third field groups,
Each field accounts for 4 bits in 4th field groups, and each field accounts for 2 bits in the 5th field groups.
4. the method according to claim 1, wherein in step s 200, the information that the message carries is selected from
One of message arrival end slogan, message Egress port number, logic source port number, logic destination slogan, type of message or
It is several.
5. the method according to claim 1, wherein in step S600, high P bits of the 8th key assignments
For the 9th key assignments, low Q bits of the 8th key assignments are the tenth key assignments, and P, Q are integer.
6. a kind of generating means that message finds key value, which is characterized in that including
Packet parsing grouping module obtains several fields for carrying out parsing to received message, and will several described words
Section is at least divided into the first field groups, the second field groups, third field groups, the 4th field groups and the 5th field groups;
Selector obtains module, and the forwarding information for being carried according to the message searches TCAM, obtains in the first field
Selected in group the first selector of several fields, the second selector for selecting several fields in the second field groups,
For selecting the third selector of several fields in third field groups, for selecting several fields in the 4th field groups
The 4th selector and the 5th selector for selecting several fields in the 5th field groups;
First splicing module selects field for the selector using acquisition in corresponding field groups, and by first selector
The field of selection is spliced to form the first key assignments, and the field that second selector selects is spliced to form the second key assignments, third is selected
The field of device selection is spliced to form third key assignments, and the field that the 4th selector selects is spliced to form the 4th key assignments, by the 5th choosing
The field for selecting device selection is spliced to form the 5th key assignments;
Second splicing module, for the second key assignments, the first key assignments to be spliced to form the 6th key assignments in order, by the 5th key assignments,
Four key assignments and third key assignments are spliced to form the 7th key assignments in order;
First splits module, for the 6th key assignments to be split into M 16 bits, and using preset 6th selector in institute
State selected in M 16 bits it is N number of be spliced to form the 8th key assignments, N is less than or equal to M, and N, M are integer;
Second splits module, for the 8th key assignments to be split into the 9th key assignments and the tenth key assignments;
Third splicing module, for the 7th key assignments and the 9th key assignments to be spliced to form the 11st key assignments, and using preset
7th selector, the 8th selector and the 9th selector select several 1 bits, 2 bits in the 11st key assignments respectively
It is spliced to form the 12nd key assignments in order with 4 bits;
4th splicing module, for the 12nd key assignments and the tenth key assignments to be spliced to form message in order and find key value.
7. device according to claim 6, which is characterized in that the packet parsing grouping module includes parsing module and divides
Group module, the parsing module are used to carry out received message parsing and obtain several fields, and the grouping module is used for will
Several described fields are at least divided into the first field groups, the second field groups, third field groups, the 4th field groups and the 5th field
Group.
8. device according to claim 7, which is characterized in that grouping module bit according to occupied by each field
Bit quantity is grouped.
9. device according to claim 6, which is characterized in that each field in first field groups occupies 32
Bit, each field in second field groups occupy 16 bits, and each field is equal in the third field groups
8 bits are occupied, each field in the 4th field groups occupies 4 bits, every in the 5th field groups
A field occupies 2 bits.
10. device according to claim 6, which is characterized in that the second fractionation module splits the 8th key assignments
At high P bit and low Q bit, the high P bit is the 9th key assignments, and the low Q bit is the tenth key assignments, and P, Q are
Integer.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201811081606.7A CN109194665B (en) | 2018-09-17 | 2018-09-17 | Message lookup key value generation method and device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201811081606.7A CN109194665B (en) | 2018-09-17 | 2018-09-17 | Message lookup key value generation method and device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN109194665A true CN109194665A (en) | 2019-01-11 |
| CN109194665B CN109194665B (en) | 2020-10-20 |
Family
ID=64911568
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201811081606.7A Active CN109194665B (en) | 2018-09-17 | 2018-09-17 | Message lookup key value generation method and device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN109194665B (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109905322A (en) * | 2019-04-01 | 2019-06-18 | 盛科网络(苏州)有限公司 | A kind of method and device of message matching information pre-processing |
| CN110390525A (en) * | 2019-07-31 | 2019-10-29 | 中国工商银行股份有限公司 | The direct access method and block chain node of block chain world state |
Citations (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1863142A (en) * | 2005-08-19 | 2006-11-15 | 华为技术有限公司 | Method for providing different service quality tactics to data stream |
| US7193997B2 (en) * | 2001-03-19 | 2007-03-20 | International Business Machines Corporation | Packet classification |
| CN101242362A (en) * | 2008-03-07 | 2008-08-13 | 华为技术有限公司 | Find key value generation device and method |
| CN101478447A (en) * | 2009-01-08 | 2009-07-08 | 中国人民解放军信息工程大学 | Method and apparatus for deep packet detection |
| CN102622434A (en) * | 2011-12-31 | 2012-08-01 | 成都市华为赛门铁克科技有限公司 | Data storage method, data searching method and device |
| CN103475584A (en) * | 2012-06-07 | 2013-12-25 | 中兴通讯股份有限公司 | Query method and query device for ternary content addressable memory (TCAM) |
| CN103501268A (en) * | 2013-09-29 | 2014-01-08 | 杭州华三通信技术有限公司 | Method and device for scheduling TCAM (Ternary Content Addressable Memory) resource |
| CN104009921A (en) * | 2014-04-28 | 2014-08-27 | 开网科技(北京)有限公司 | Data message forwarding method based on any field matching |
| CN105429882A (en) * | 2015-10-21 | 2016-03-23 | 盛科网络(苏州)有限公司 | Message editing realization method and apparatus based on conventional switching chip search mode |
| CN106506468A (en) * | 2016-10-31 | 2017-03-15 | 盛科网络(苏州)有限公司 | A kind of method that minimizing ACE entries are consumed |
-
2018
- 2018-09-17 CN CN201811081606.7A patent/CN109194665B/en active Active
Patent Citations (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7193997B2 (en) * | 2001-03-19 | 2007-03-20 | International Business Machines Corporation | Packet classification |
| CN1863142A (en) * | 2005-08-19 | 2006-11-15 | 华为技术有限公司 | Method for providing different service quality tactics to data stream |
| CN101242362A (en) * | 2008-03-07 | 2008-08-13 | 华为技术有限公司 | Find key value generation device and method |
| CN101478447A (en) * | 2009-01-08 | 2009-07-08 | 中国人民解放军信息工程大学 | Method and apparatus for deep packet detection |
| CN102622434A (en) * | 2011-12-31 | 2012-08-01 | 成都市华为赛门铁克科技有限公司 | Data storage method, data searching method and device |
| CN103475584A (en) * | 2012-06-07 | 2013-12-25 | 中兴通讯股份有限公司 | Query method and query device for ternary content addressable memory (TCAM) |
| CN103501268A (en) * | 2013-09-29 | 2014-01-08 | 杭州华三通信技术有限公司 | Method and device for scheduling TCAM (Ternary Content Addressable Memory) resource |
| CN104009921A (en) * | 2014-04-28 | 2014-08-27 | 开网科技(北京)有限公司 | Data message forwarding method based on any field matching |
| CN105429882A (en) * | 2015-10-21 | 2016-03-23 | 盛科网络(苏州)有限公司 | Message editing realization method and apparatus based on conventional switching chip search mode |
| CN106506468A (en) * | 2016-10-31 | 2017-03-15 | 盛科网络(苏州)有限公司 | A kind of method that minimizing ACE entries are consumed |
Non-Patent Citations (2)
| Title |
|---|
| HUI YU ; JING CHEN ; JIANPING WANG ; S.Q. ZHENG: "High-performance TCAM-based IP lookup engines", 《IEEE INFOCOM WORKSHOPS 2008》 * |
| 邱小勇,杨路,张克环,卞云峰: "TCAM在万兆网络设备中的应用", 《全国网络与信息安全技术研讨会’2005》 * |
Cited By (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109905322A (en) * | 2019-04-01 | 2019-06-18 | 盛科网络(苏州)有限公司 | A kind of method and device of message matching information pre-processing |
| CN109905322B (en) * | 2019-04-01 | 2021-05-07 | 盛科网络(苏州)有限公司 | Message matching information preprocessing method and device |
| CN110390525A (en) * | 2019-07-31 | 2019-10-29 | 中国工商银行股份有限公司 | The direct access method and block chain node of block chain world state |
| CN110390525B (en) * | 2019-07-31 | 2022-05-20 | 中国工商银行股份有限公司 | Direct access method for block chain world state and block chain node |
Also Published As
| Publication number | Publication date |
|---|---|
| CN109194665B (en) | 2020-10-20 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US6208649B1 (en) | Derived VLAN mapping technique | |
| EP2100406B1 (en) | Method and apparatus for implementing multicast routing | |
| US7315547B2 (en) | Packet forwarding device | |
| US6922410B1 (en) | Organization of databases in network switches for packet-based data communications networks | |
| US7289498B2 (en) | Classifying and distributing traffic at a network node | |
| EP1408655B1 (en) | Method and device for double tagging of data packets | |
| US6496502B1 (en) | Distributed multi-link trunking method and apparatus | |
| EP1408656B1 (en) | Method and device for transparent LAN services | |
| US8792497B2 (en) | Method and apparatus for performing link aggregation | |
| US7327727B2 (en) | Atomic lookup rule set transition | |
| US20030009466A1 (en) | Search engine with pipeline structure | |
| CN108768866B (en) | Cross-card forwarding method and device for multicast message, network equipment and readable storage medium | |
| US10212069B2 (en) | Forwarding of multicast packets in a network | |
| CN110442570B (en) | BitMap high-speed fuzzy search method | |
| US20090135833A1 (en) | Ingress node and egress node with improved packet transfer rate on multi-protocol label switching (MPLS) network, and method of improving packet transfer rate in MPLS network system | |
| US7082134B1 (en) | Redirect checking in a network device | |
| CN101505279A (en) | Route searching method and apparatus | |
| GB2350534A (en) | Packet-based network device with forwarding database having a trie search facility | |
| US7526603B1 (en) | High-speed low-power CAM-based search engine | |
| US7486672B2 (en) | Apparatus and method for searching trie trees using masks with non-symbol boundaries and flooding default routes in a massively parallel router | |
| CN110035074A (en) | A kind of chip implementing method and device of ACL matching UDF message | |
| CN101729420B (en) | Data processing method and data processing device | |
| CN109194665A (en) | A kind of generation method that message finds key value and device | |
| US20110249676A1 (en) | Method and System for Forwarding and Switching Traffic in a Network Element | |
| CN115834478A (en) | Method for realizing PBR high-speed forwarding by using TCAM |
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 | ||
| CP03 | Change of name, title or address |
Address after: 215101 unit 13 / 16, 4th floor, building B, No. 5, Xinghan street, Suzhou Industrial Park, Jiangsu Province Patentee after: Suzhou Shengke Communication Co.,Ltd. Address before: Unit 13 / 16, 4th floor, building B, No.5 Xinghan street, Suzhou Industrial Park, 215000 Jiangsu Province Patentee before: CENTEC NETWORKS (SU ZHOU) Co.,Ltd. |
|
| CP03 | Change of name, title or address |