CN101977177B - Method and device for establishing table entry of flow table and method and device for querying table entry of flow table - Google Patents

Method and device for establishing table entry of flow table and method and device for querying table entry of flow table Download PDF

Info

Publication number
CN101977177B
CN101977177B CN2010102425690A CN201010242569A CN101977177B CN 101977177 B CN101977177 B CN 101977177B CN 2010102425690 A CN2010102425690 A CN 2010102425690A CN 201010242569 A CN201010242569 A CN 201010242569A CN 101977177 B CN101977177 B CN 101977177B
Authority
CN
China
Prior art keywords
subclass
list item
keyword
mapping value
content information
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.)
Expired - Fee Related
Application number
CN2010102425690A
Other languages
Chinese (zh)
Other versions
CN101977177A (en
Inventor
陈彦俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Star Net Ruijie Networks Co Ltd
Original Assignee
Beijing Star Net Ruijie Networks Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Star Net Ruijie Networks Co Ltd filed Critical Beijing Star Net Ruijie Networks Co Ltd
Priority to CN2010102425690A priority Critical patent/CN101977177B/en
Publication of CN101977177A publication Critical patent/CN101977177A/en
Application granted granted Critical
Publication of CN101977177B publication Critical patent/CN101977177B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Computer And Data Communications (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method and a device for establishing a table entry of a flow table. The method for establishing the table entry of the flow table comprises the following steps of: dividing extracted content information into at least two subsets; corresponding all or part of the subsets to unique mapping values; and generating a key word of a to-be-established table entry according to the mapping value corresponding to each subset in all or part of the subsets so as to further generate the to-be-established table entry. The invention also discloses a method and a device for querying the table entry of the flow table; and the method comprises the following steps of: extracting content information for querying the key word of the to-be-queried table entry from a received message; querying the mapping value corresponding to each subset in all or part of the subsets of the extracted content information; and generating the key word of the to-be-queried table entry according to the searched mapping value and querying the corresponding table entry from the flow table through the generated key word. Because both the length of each subset and the length of the key word for generating the flow table are less than the maximum length which can be processed by a network processor, the network processor can realize the functions of establishing and querying the table entry of the flow table containing the complex key word.

Description

A kind of creation method, querying method and device that flows the table list item
Technical field
The present invention relates to field of network communication, relate in particular to a kind of creation method, querying method and device that flows the table list item.
Background technology
Along with popularizing of internet, network to people with great facility because the basic agreement IPv4 of IP network has adopted 32 address size at present, caused the anxiety of IP address resource.IP network protocol IP v6 of future generation has adopted 128 bit address, can provide huge address space to address this problem.
But the growth of IPv6 address has brought some technical intractabilities for the list item processing of network processing unit.Network processing unit (Network Processor, NP) be a kind of programming device of being formed by some microcode processors and hardware co-processor, (Quality of Service QoS) etc. has a wide range of applications in the field in the processing of network packet, protocal analysis, route querying, fire compartment wall, service quality.The technology of network processing unit in realizing a very important ring be the list item inquiry of stream table, the list item of stream table is that the keyword (KEY) according to list item generates index and operates.At present, the list item keyword of stream table all includes the IPv6 address in most of network applications, therefore, in the IPv6 of processor Network Based uses, continuous growth (keyword of some special purpose list items also needs to comprise other information) along with the keyword that flows the list item of showing, the list item of corresponding stream table also becomes more complicated.In case in the demands of applications, when the key length of the list item that flows table surpassed the limited processing ability of network processing unit, network processing unit just can't be finished with the list item of stream table and search relevant application.
Summary of the invention
The embodiment of the invention provides a kind of creation method, querying method and device that flows the table list item, in order to realize that the relevant list item of complicated stream table list item is created and application such as inquiry.
A kind of creation method that flows the table list item that the embodiment of the invention provides comprises:
From the message that receives, extract the content information of the keyword that is used for establishment list item to be created;
The described content information that extracts is divided at least two subclass, and the length of each subclass is not more than the maximum length that network processing unit can be handled;
With the corresponding unique mapping value respectively of each subclass in all or the described subclass of part;
Mapping value according to each the subclass correspondence in all or the described subclass of part, generate the keyword of described list item to be created, the length of the keyword of described list item to be created is not more than the maximum length that described network processing unit can be handled, wherein, described mapping value according to each the subclass correspondence in all subclass, generate the keyword of described list item to be created, comprising: the mapping value of each subclass correspondence in all subclass is made up, generate the keyword of described list item to be created; Described unique mapping value according to each concentrated subclass correspondence of parton, generate the keyword of described list item to be created, comprise: the mapping value of parton being concentrated each subclass correspondence, make up with other subclass except described part subclass in the described content information, generate the keyword of described list item to be created;
According to the keyword of described list item to be created, in the stream table, generate described list item to be created.
A kind of querying method that flows the table list item that the embodiment of the invention provides comprises:
From the message that receives, extract the content information of the keyword that is used for inquiry list item to be checked;
According to all or part of subclass of the content information that extracts, inquire about the mapping value of each subclass correspondence in the described all or part of subclass, the length of described each subclass is not more than the maximum length that network processing unit can be handled;
If all do not find, then in the stream table, create new list item;
If all find, then generate the keyword of list item to be checked according to the mapping value that finds, the length of the keyword that generates is not more than the maximum length that described network processing unit can be handled, wherein, described part subclass according to the content information that extracts, when inquiring the mapping value of concentrated each the subclass correspondence of described parton, the mapping value that described basis finds generates the keyword of list item to be checked, comprise: the described parton that will inquire is concentrated the mapping value of each subclass correspondence, and other subclass except described part subclass make up the keyword that generates described list item to be checked in the content information of described extraction; Described whole subclass according to the content information that extracts, when inquiring the mapping value of each subclass correspondence in described whole subclass, the mapping value that described basis finds generates the keyword of list item to be checked, comprising: the combination of the mapping value of each subclass correspondence generates the keyword of described list item to be checked in described whole subclass that will inquire;
By the keyword that generates, the corresponding list item of inquiry in the stream table; If in the stream table, do not inquire corresponding list item, in the stream table, create new list item;
Describedly in stream table, create new list item, comprising:
The content information of the keyword of the described list item to be checked that extracts is divided at least two subclass; The length of each subclass is not more than the maximum length that network processing unit can be handled; With the corresponding unique mapping value respectively of each subclass in all or the described subclass of part, according to the mapping value of each the subclass correspondence in all or the described subclass of part, generate the keyword of described new list item; The length of the keyword of described new list item is not more than the maximum length that described network processing unit can be handled; According to the keyword of described new list item, in the stream table, generate described new list item.
A kind of creation apparatus that flows the table list item that the embodiment of the invention provides comprises:
Extraction unit is for the content information that extracts the keyword that is used for establishment list item to be created from the message that receives;
Division unit, the described content information that is used for extracting is divided at least two subclass, and the length of each subclass is not more than the maximum length that network processing unit can be handled;
Map unit is used for each subclass of all or the described subclass of part corresponding unique mapping value respectively;
Creating unit, be used for the mapping value of each subclass correspondence of all subclass is made up, generate the keyword of described list item to be created, and the mapping value of parton being concentrated each subclass correspondence, make up with other subclass except described part subclass in the described content information, generate the keyword of described list item to be created, the length of the keyword of described list item to be created is not more than the maximum length that described network processing unit can be handled; And according to the keyword of described list item to be created, in the stream table, generate described list item to be created.
A kind of stream table list item inquiry unit that the embodiment of the invention provides comprises:
Extraction unit is for the content information that extracts the keyword that is used for inquiry list item to be checked from the message that receives;
Query unit is used for all or part of subclass according to the content information that extracts, and inquires about the mapping value of each subclass correspondence in the described all or part of subclass, and the length of described each subclass is not more than the maximum length that network processing unit can be handled; If all do not find, then notify described creating unit in the stream table, to create new list item; If all find, then according to whole subclass of the content information of the keyword of described list item to be checked, when inquiring the mapping value of each subclass correspondence in described whole subclass, the mapping value combination of each subclass correspondence in the described whole subclass that inquire is generated the keyword of described list item to be checked; Perhaps according to the part subclass of the content information of the keyword of described list item to be checked, when inquiring the mapping value of concentrated each the subclass correspondence of described parton, the described parton that inquires is concentrated the mapping value of each subclass correspondence, and other subclass except described part subclass make up the keyword that generates described list item to be checked in the described content information, and the length of the keyword of generation is not more than the maximum length that described network processing unit can be handled; And the keyword by generating, the corresponding list item of inquiry in the stream table; If in the stream table, do not inquire corresponding list item, then notify described creating unit in the stream table, to create new list item;
Creating unit is used for the notice according to described query unit, and the content information of the keyword of the described list item to be checked that extracts is divided at least two subclass; The total length of each subclass is not more than the maximum length that network processing unit can be handled; With the corresponding unique mapping value respectively of each subclass in all or the described subclass of part, according to the mapping value of each the subclass correspondence in all or the described subclass of part, generate the keyword of described new list item; The length of the keyword of described new list item is not more than the maximum length that described network processing unit can be handled; According to the keyword of described new list item, in the stream table, generate described new list item.
The beneficial effect of the embodiment of the invention comprises:
The creation method of the stream table list item that the embodiment of the invention provides, the content information that will extract from message is divided at least two subclass; The total length of each subclass is not more than the maximum length that network processing unit can be handled; All or each concentrated subclass of parton are distinguished corresponding unique mapping value; According to the mapping value of each the subclass correspondence in all or the described subclass of part, generate the keyword of list item to be created, and the length of the keyword of list item to be created is not more than the maximum length that network processing unit can be handled; According to the keyword of list item to be created, generate list item to be created.In the process of creating, owing to be divided into several short subclass of length with extracting complex contents information in the message, the length of each subclass does not surpass the treatable maximum length of network processing unit, subclass shone upon handle the length of creating the keyword of stream table list item in the back and also do not exceed the treatable maximum length of network processing unit, realized that network processing unit is to the establishment function of the stream table list item that comprises complex key word.
The querying method of the stream table list item that the embodiment of the invention provides, equally several subclass of the content information of the keyword by treating the inquiry list item are inquired about respectively, and generate the keyword of stream table list item to be checked according to Query Result, whether further inquire about this stream table list item by the keyword that generates is present in the stream table, if there is no, create a new stream table list item according to aforementioned creation method, because the length of each subclass of using in the query script, and the length of the keyword that the generates maximum length that all can handle less than network processing unit, realized that network processing unit is to the query function of the stream table list item that comprises complex key word.
On the whole, establishment, querying method and the device of the stream table list item that the embodiment of the invention provides, realized that network processing unit to correlation functions such as the establishment of the stream table list item that comprises complex key word and inquiries, makes the disposal ability of network processing unit not be restricted because of network technical development especially IPv6 technical development.
Description of drawings
The flow chart of the creation method of the stream table list item that Fig. 1 provides for the embodiment of the invention;
The flow chart of the querying method of the stream table list item that Fig. 2 provides for the embodiment of the invention;
Network processing unit and central processing unit connection diagram in the example that Fig. 3 provides for the embodiment of the invention;
The flow chart of inquiry stream table list item in the example that Fig. 4 provides for the embodiment of the invention;
The structural representation of the creation apparatus of the stream table list item that Fig. 5 provides for the embodiment of the invention;
The structural representation of the stream table list item inquiry unit that Fig. 6 provides for the embodiment of the invention.
Embodiment
Below in conjunction with accompanying drawing, a kind of creation method, querying method and device that flows the table list item that the embodiment of the invention is provided is described in detail.
At first a kind of creation method that flows the table list item that the embodiment of the invention is provided is described in detail.
As shown in Figure 1, the creation method of the stream table list item that the embodiment of the invention provides comprises the steps:
S101, from the message that receives, extract the content information of the keyword that is used for creating list item to be created;
S102, the content information that extracts is divided at least two subclass;
In this step S102, the length of each subclass is not more than the maximum length that network processing unit can be handled; The maximum length that network processing unit can be handled is to determine according to the disposal ability of network processing unit.
S103, each subclass that all or parton are concentrated be corresponding unique mapping value respectively;
S104, according to the mapping value of each the subclass correspondence in all or the described subclass of part, generate the keyword of list item to be created;
In this step S102, the maximum length that the length of the keyword of list item to be created can not can be handled greater than network processing unit;
The keyword of S105, the list item to be created created according to step S104 generates this list item to be created in the stream table.
Among the above-mentioned steps S101, the content information of the keyword of the list item of the stream table to be created that extracts comprises two in the following information at least:
Source IP address, purpose IP address, port numbers, protocol number, source interface number, COS (Type Of Service, TOS) and custom field information (flag field).
Among the above-mentioned steps S102, foregoing information can be divided into several parts, each part is as the subclass of this content information, for example with source IP address and purpose IP address as a subclass, with remaining other information as the another one subclass, certainly in the embodiment of the invention, do not do restriction to how dividing each subclass, the length that only need satisfy each subclass is no more than the maximum length that network processing unit can handle and gets final product.
If the mode that employing is shone upon one by one to all subclass of the content information of the keyword of list item to be created is so in above-mentioned steps S103, to the respectively corresponding unique mapping value of all subclass; Mapping value can preestablish, perhaps by calculating, as long as satisfy each subclass and corresponding a unique mapping value.Correspondingly, among the above-mentioned steps S104, according to the mapping value of each subclass correspondence in all subclass, generate the keyword of list item to be created, can make up by the mapping value with each subclass correspondence in all subclass, the keyword that generates list item to be created is realized.
Another part subclass is not done the mode that mapping is handled if employing is shone upon one by one to the part subclass of the content information of the keyword of list item to be created, and in above-mentioned steps S103, each subclass that parton is concentrated is the unique mapping value of correspondence respectively so; Correspondingly, among the above-mentioned steps S104, concentrate unique mapping value of each subclass correspondence according to parton, generate the keyword of list item to be created, by concentrating mapping value and other subclass of shining upon processing of each subclass correspondence to make up parton, the keyword that generates list item to be created is realized.
Preferably, each subclass of among the above-mentioned steps S103 all or parton being concentrated in the embodiment of the invention is respectively after the step of corresponding unique mapping value, can also be with each subclass in the part or all of subclass of the content information of the keyword of list item to be created, and the mapping value of this subclass correspondence generates mapping table and storage as the mapping table list item.
Create in the stream table after the stream table list item, certain list item in the deletion stream table can judge earlier that so the mapping value that comprises in the keyword mapping value that comprises and the keyword for the treatment of remove entries that whether has other list items in the stream table is identical if desired.
If there is such stream table list item, remove entries is treated in deletion in the stream table so, and keeps in mapping table with this and treat the mapping value corresponding mapping table item that comprises in the keyword of remove entries.
If there is no, the mapping value corresponding mapping table list item that in mapping table, comprises in the keyword of deletion and list item to be deleted so; And in the stream table, delete this and treat remove entries.
Correspondingly, the querying method of the stream table list item that the embodiment of the invention provides as shown in Figure 2, comprises the steps:
S201, from the message that receives, extract the content information of the keyword that is used for inquiry list item to be checked;
S101 is the same with above-mentioned steps, among this step S201, the content information of the keyword of the list item of the stream table to be created that extracts comprises one of following information at least: source IP address, purpose IP address, port numbers, protocol number, source interface number, TOS and custom field information (flag field).
S202, according to all or part of subclass of the content information that extracts, inquire about the mapping value of each subclass correspondence in all or part of subclass; The length of each subclass is not more than the maximum length that network processing unit can be handled; If the situation that the mapping value of certain subclass correspondence is not searched turns to step S206 so; If the mapping value of each subclass correspondence finds in all or part of subclass of the content information of the keyword of list item to be checked, then carry out following step S203;
In this step S202, can be according to all or part of subclass of the content information of the keyword of list item to be checked, the mapping value of each subclass correspondence is searched in inquiry one by one in mapping table.Need to prove, here to the content information of described keyword dividing subset how, corresponding with the dividing mode among the step S102 of the creation method of stream table list item; And here which subclass is inquired about, and which subclass to shine upon corresponding among the step S103 of the creation method of stream table list item.
The mapping value that S203, basis find generates the keyword of list item to be checked; Carry out following step S204 then;
S204, the keyword by generating, the corresponding list item of inquiry in the stream table; If in the stream table, inquire corresponding list item, then carry out following step S205; If in the stream table, do not inquire corresponding list item, then carry out following step S206;
S205, obtain the result of inquiry.
S206, in stream table, create new list item.
Among the above-mentioned steps S203, generate the keyword of list item to be checked according to the mapping value that finds, also be divided into two kinds of situations, a kind of is under whole subclass of the content information of the keyword of stream table list item have all been carried out situation that mapping handles in advance, in step S203, can directly the mapping value of each the subclass correspondence in the whole subclass that inquire be made up the keyword of generation list item to be checked in mapping table so.
Another kind is that the part subclass in the content information of the keyword of stream table list item has been carried out under the situation of mapping processing in advance, so in step S203, other subclass in the content information of the mapping value of each the subclass correspondence that the parton that inquires in mapping table can be concentrated and the keyword of list item to be checked except this part subclass make up, and generate the keyword of list item to be checked.
Among the above-mentioned steps S206, create the step of new list item in the stream table, roughly the same with the method that step S101-S105 describes, soon the content information of the keyword of the list item to be checked that extracts is divided at least two subclass; The total length of each subclass is not more than the maximum length that network processing unit can be handled; Each subclass that all or parton are concentrated is corresponding unique mapping value respectively, and unique mapping value of each subclass correspondence of concentrating according to all or parton generates the keyword of this new list item; The length of the keyword of the list item that this is new is not more than the maximum length that network processing unit can be handled; According to the keyword of new list item, generate new list item.
In order to be illustrated more clearly in creation method and the querying method of the above-mentioned stream table list item that the embodiment of the invention provides, be described in detail below in conjunction with the example in the practical application.
In this example, as shown in Figure 3, finish this technical scheme jointly by network processing unit and central processing unit, network processing unit receives message, at first message is resolved, extract the information relevant with the list item inquiry, it is the content information of the keyword of list item to be checked, source IP address (address of IPv6 type) for example, purpose IP address (address of IPv6 type), port numbers, protocol number, source interface number, TOS and custom field information etc., then foregoing information is divided into two sections (two subclass), be that example describes to be divided into two sections in this example, those skilled in the art can know by inference accordingly be divided into plural subclass processing mode similarly.
The source IP address that network processing unit extracts, purpose IP address, port numbers, protocol number, source interface number, TOS and custom field information is totally 42 bytes usually, the treated length that has exceeded network processing unit limits 38 bytes, for this reason, network processing unit need carry out following processing:
Foregoing information is divided into two parts:
First is IP address (length is 32 bytes), i.e. source IP address and purpose IP address;
Second portion is other information (length is 10 bytes) except the IP address.
The length of two parts of dividing is all less than 38 bytes.
Network processing unit shines upon processing to the content information of first, and first's content information is unique corresponding with mapping value 0x0001.The length of mapping value is 2 bytes, and the total length sum of mapping value 0x0001 and second portion is less than 38 bytes.
Create and safeguard two types tables of data:
One is mapping table, and the mapping table list item is IP address and corresponding mapping value, can search its corresponding mapping value by the IP address as keyword.
Another is stream table, and the keyword of each list item be " mapping value of IP address+other information " in the stream table, and the content that list item is stored is the statistical information number etc. of byte number, packet for example of this data flow.
For example:
Network processing unit extracts following content information from data flow:
Source IP address: 2000::1;
Purpose IP address: 1000::1;
Port numbers: 0x300,0x400;
Protocol number: 02(is used for the numbering of identifying user datagram protocol (UDP, User Data Protocol) agreement);
The flag(custom field): 02;
Source interface number: 0x010141;
TOS:0xFE。
The process of inquiry stream table list item is as follows:
Network processing unit uses keyword to be the 2000::1+1000::1(32 byte in mapping table) inquire about;
If use this keyword, in mapping table, do not inquire the corresponding mapping table item, network processing unit sends to central processing unit with this keyword so; Central processing unit shines upon processing with IP address 2000::1+1000::1, obtain its corresponding mapping value 0x0001(2 byte), and keyword of interpolation is 2000::1+1000::1 in mapping table, and mapping value is the mapping table list item of 0x0001.Central processing unit sends to network processing unit with this mapping item then.
Network processing unit is according to the information that receives, in the stream table, create the list item of a stream table, the keyword of this stream table list item is: other information of 0x0001+ (port numbers, protocol number, source interface number, TOS and flag), the memory contents of this stream table list item is the ASSOCIATE STATISTICS information of data flow.In this example, the length of the keyword " other information of 0x0001+ " of stream table list item is 12 bytes, but much smaller than the maximum treated length of network processing unit.
If network processing unit uses keyword to be 2000::1+1000::1, in mapping table, inquire the mapping value 0x0001 of this IP address correspondence, can use mapping value+other information of finding (port numbers, protocol number, source interface number, TOS and flag) as keyword so, further inquiry in the stream table;
If in the stream table, inquire relevant list item, obtain the content of storing in this list item so;
If in the stream table, do not inquire relevant list item, so also need in the stream table, create a list item, the keyword of this stream table list item is: other information of 0x0001+ (port numbers, protocol number, source interface number, TOS and flag), the memory contents of the stream table list item of establishment is the statistical information of data flow.
When deletion comprises the stream table list item of mapping value 0x0001 in the stream table if desired, if do not exist other stream table list items to comprise mapping value 0x0001 too in the stream table, need in the stream table, delete this so and treat remove entries, deletion 0x0001 corresponding mapping table item in mapping table.
Otherwise, if exist other stream table list items to comprise mapping value 0x0001 in the stream table, treat that with this mapping value that comprises in remove entries is identical, so, reserved keyword is that 0x0001, mapping value are the mapping item of 0x0001 in mapping table, only deletes this and treat remove entries in the stream table.
Above-mentioned example is to be divided into two parts with the content information that will extract (part is shone upon processing, a part shines upon processing) describe for example, also has a kind of mode, be about to content information and be divided into a plurality of Partial K 1, K2 ... Kn, and respectively all parts are all shone upon processing, obtain the mapping value E1 of various piece, E2 ... En, the length of the mapping value of each part is all less than the manageable maximum length of network processing unit, and the list item keyword (E1+E2 that forms after the each several part combination, En) total length is also less than the manageable maximum length of network processing unit.In this way, the query script of stream table list item comprises as shown in Figure 4:
The content of S401, extraction keyword, and be divided into K1, K2 ... Kn part;
S402, respectively with K1, K2 ... Kn is keyword, the query mappings table; If K1, K2 ... have at least one in mapping table, not have corresponding Query Result among the Kn, turn to execution in step S405 so; If K1, K2 ... Kn all finds corresponding mapping value in mapping table, then carry out following step S403;
S403, the K1 with inquiring, K2 ... the mapping value E1 of Kn correspondence, E2 ... the En combination, the E1+E2 after the use combination ... En inquires about in the stream table as keyword; If have corresponding stream table list item, turn to following step S404; Otherwise, turn to following step S405;
S404, directly obtain Query Result, inquiry is finished;
S405, use K1, K2 ... the mapping value E1 of Kn correspondence, E2 ... the combination of En generates list item and storage in the stream table as keyword.
Based on same inventive concept, the embodiment of the invention also provides a kind of creation apparatus and stream table list item inquiry unit that flows the table list item, because the creation apparatus of this stream table list item is similar with stream table list item querying method to the creation method of aforementioned stream table list item with the principle that stream table list item inquiry unit is dealt with problems, the creation apparatus that therefore should flow the table list item can be referring to the enforcement of method with the enforcement of stream table list item inquiry unit, and the repetition part repeats no more.
A kind of creation apparatus that flows the table list item that the embodiment of the invention provides as shown in Figure 5, comprising:
Extraction unit 501 is for the content information that extracts the keyword that is used for establishment list item to be created from the message that receives;
Division unit 502, the content information that is used for extracting is divided at least two subclass, and the length of each subclass is not more than the maximum length that network processing unit can be handled;
Map unit 503 is used for all or each concentrated subclass of parton are distinguished corresponding unique mapping value;
Creating unit 504 is used for unique mapping value of each subclass correspondence of concentrating according to all or parton, generates the keyword of list item to be created, and the length of the keyword of list item to be created is not more than the maximum length that network processing unit can be handled; And according to the keyword of list item to be created, in the stream table, generate list item to be created.
Further, the creating unit 504 that the embodiment of the invention provides, concrete being used for made up the mapping value of each subclass correspondence of all subclass, generates the keyword of described list item to be created.
Perhaps, further, the creating unit 504 that the embodiment of the invention provides, the concrete mapping value that is used for parton is concentrated each subclass correspondence makes up with other subclass except the part subclass in the content information, generates the keyword of list item to be created.
The map unit 503 that the embodiment of the invention provides also is used for the mapping value that the content information of each subclass of part or all of subclass is corresponding with this subclass as the mapping table list item, generates mapping table and stores.
Further, the creation apparatus of the stream table list item that the embodiment of the invention provides, as shown in Figure 5, also comprise delete cells 505, be used for when needs when stream is shown remove entries, judge that the mapping value that comprises in the keyword mapping value that comprises and the keyword for the treatment of remove entries that whether has other list items in the stream table is identical; If remove entries is treated in deletion in the stream table, and in mapping table, keep with this and treat the mapping value corresponding mapping table item that comprises in the keyword of remove entries; If not, deletion is treated the mapping value corresponding mapping table list item that comprises in the keyword of remove entries with this in mapping table, and deletes this and treat remove entries in the stream table.
The stream table list item inquiry unit that the embodiment of the invention provides as shown in Figure 6, comprising:
Extraction unit 601 is for the content information that extracts the keyword that is used for inquiry list item to be checked from the message that receives;
Query unit 602 is used for all or part of subclass according to the content information that extracts, and inquires about the mapping value of each subclass correspondence in all or part of subclass; The total length of each subclass is not more than the maximum length that network processing unit can be handled, if all do not find, then notifies creating unit 603 to create new list item in the stream table; If all find, then generate the keyword of list item to be checked according to the mapping value that finds, the length of the keyword of generation is not more than the maximum length that network processing unit can be handled; And the keyword by generating, the corresponding list item of inquiry in the stream table; If in the stream table, do not inquire corresponding list item, then notify creating unit 603 in the stream table, to create new list item;
Creating unit 603 is used for the notice according to query unit 602, and the content information of the keyword of the list item to be checked that extracts is divided at least two subclass; The total length of each subclass is not more than the maximum length that network processing unit can be handled; Each subclass that all or parton are concentrated is corresponding unique mapping value respectively, according to the mapping value of each the subclass correspondence in all or the described subclass of part, generates the keyword of new list item; The length of the keyword of new list item is not more than the maximum length that network processing unit can be handled; According to the keyword of the new list item of creating, in the stream table, generate new list item.
Further, query unit 602 in the stream table list item inquiry unit that the embodiment of the invention provides, be further used for the whole subclass according to the content information of the keyword of list item to be checked, when inquiring the mapping value of each subclass correspondence in whole subclass, the mapping value combination of each subclass correspondence in the whole subclass that inquire is generated the keyword of list item to be checked.
Further, query unit 602 in the stream table list item inquiry unit that the embodiment of the invention provides, be further used for the part subclass according to the content information of the keyword of list item to be checked, when inquiring the mapping value of concentrated each the subclass correspondence of parton, the parton that inquires is concentrated the mapping value of each subclass correspondence, and other subclass combinations except the part subclass generate the keyword of list item to be checked in the content information.
The creation method of the stream table list item that the embodiment of the invention provides, the content information that will extract from message is divided at least two subclass; The total length of each subclass is not more than the maximum length that network processing unit can be handled; All or each concentrated subclass of parton are distinguished corresponding unique mapping value; According to the mapping value of each the subclass correspondence in all or the described subclass of part, generate the keyword of list item to be created, and the length of the keyword of list item to be created is not more than the maximum length that network processing unit can be handled; According to the keyword of list item to be created, generate list item to be created.In the process of creating, owing to be divided into several short subclass of length with extracting complex contents information in the message, the length of each subclass does not surpass the treatable maximum length of network processing unit, subclass shone upon handle the length of creating the keyword of stream table list item in the back and also do not exceed the treatable maximum length of network processing unit, realized that network processing unit is to the establishment function of the stream table list item that comprises complex key word.
The querying method of the stream table list item that the embodiment of the invention provides, equally several subclass of the content information of the keyword by treating the inquiry list item are inquired about respectively, and generate the keyword of stream table list item to be checked according to Query Result, whether further inquire about this stream table list item by the keyword that generates is present in the stream table, if there is no, create a new stream table list item according to aforementioned creation method, because the length of each subclass of using in the query script, and the length of the keyword that the generates maximum length that all can handle less than network processing unit, realized that network processing unit is to the query function of the stream table list item that comprises complex key word.
On the whole, establishment, querying method and the device of the stream table list item that the embodiment of the invention provides, because in establishment and the query script, the length of the keyword of the stream table of the length of each subclass of the content information that extracts from data flow and generation is all less than the accessible maximum length of network processing unit, realized that network processing unit to correlation functions such as the establishment of the stream table list item that comprises complex key word and inquiries, makes the disposal ability of network processing unit not be restricted because of network technical development especially IPv6 technical development.In addition, because the disposal ability of network processing unit depends primarily on the micro-code instruction number in each phase process, if the micro-code instruction number of one of them phase process surpasses the linear speed instruction number then the entire process flow process can't reach linear speed.The main operation that influences the network processing unit performance is the inquiry of stream table list item, can adopt the mode that a plurality of subclass classifications (for example being divided into N subclass) are shone upon in the embodiment of the invention, like this when certain stream table list item of inquiry, the inquiry that only need carry out N time in principle gets final product, thereby the inquiry of stream table list item can't expend too much query statement, the querying method that adopts the embodiment of the invention to provide, unaffected for the disposal ability of network processing unit.
Obviously, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, if of the present invention these are revised and modification belongs within the scope of claim of the present invention and equivalent technologies thereof, then the present invention also is intended to comprise these changes and modification interior.

Claims (9)

1. a creation method that flows the table list item is characterized in that, comprising:
From the message that receives, extract the content information of the keyword that is used for establishment list item to be created;
The described content information that extracts is divided at least two subclass, and the length of each subclass is not more than the maximum length that network processing unit can be handled;
With the corresponding unique mapping value respectively of each subclass in all or the described subclass of part;
Mapping value according to each the subclass correspondence in all or the described subclass of part, generate the keyword of described list item to be created, the length of the keyword of described list item to be created is not more than the maximum length that described network processing unit can be handled, wherein, described mapping value according to each the subclass correspondence in all subclass, generate the keyword of described list item to be created, comprising: the mapping value of each subclass correspondence in all subclass is made up, generate the keyword of described list item to be created; Described unique mapping value according to each concentrated subclass correspondence of parton, generate the keyword of described list item to be created, comprise: the mapping value of parton being concentrated each subclass correspondence, make up with other subclass except described part subclass in the described content information, generate the keyword of described list item to be created;
According to the keyword of described list item to be created, in the stream table, generate described list item to be created.
2. the method for claim 1 is characterized in that, described content information for the keyword of creating list item to be created comprises two in the following information at least:
Source IP address, purpose IP address, port numbers, protocol number, source interface number, COS TOS and custom field information.
3. the method for claim 1 is characterized in that, each subclass in all or the described subclass of part respectively after the step of corresponding unique mapping value, is also comprised:
The mapping value that the content information of each subclass in the described part or all of subclass is corresponding with this subclass generates mapping table and storage as the mapping table list item.
4. method as claimed in claim 3 is characterized in that, also comprises:
When needs in stream table during remove entries, judge that the mapping value that comprises in the keyword of mapping value that the keyword that whether has other list items in the described stream table comprises and list item to be deleted is identical;
If, the described remove entries for the treatment of of deletion in the stream table; And in described mapping table, keep and the mapping value corresponding mapping table item for the treatment of to comprise in the keyword of remove entries;
If not, the described remove entries for the treatment of of deletion in the stream table; And the mapping value corresponding mapping table list item that in mapping table, comprises in the keyword of deletion and list item to be deleted.
5. a querying method that flows the table list item is characterized in that, comprising:
From the message that receives, extract the content information of the keyword that is used for inquiry list item to be checked;
According to all or part of subclass of the content information that extracts, inquire about the mapping value of each subclass correspondence in the described all or part of subclass, the length of described each subclass is not more than the maximum length that network processing unit can be handled;
If all do not find, then in the stream table, create new list item;
If all find, then generate the keyword of list item to be checked according to the mapping value that finds, the length of the keyword that generates is not more than the maximum length that described network processing unit can be handled, wherein, described part subclass according to the content information that extracts, when inquiring the mapping value of concentrated each the subclass correspondence of described parton, the mapping value that described basis finds generates the keyword of list item to be checked, comprise: the described parton that will inquire is concentrated the mapping value of each subclass correspondence, and other subclass except described part subclass make up the keyword that generates described list item to be checked in the content information of described extraction; Described whole subclass according to the content information that extracts, when inquiring the mapping value of each subclass correspondence in described whole subclass, the mapping value that described basis finds generates the keyword of list item to be checked, comprising: the combination of the mapping value of each subclass correspondence generates the keyword of described list item to be checked in described whole subclass that will inquire;
By the keyword that generates, the corresponding list item of inquiry in the stream table; If in the stream table, do not inquire corresponding list item, in the stream table, create new list item;
Describedly in stream table, create new list item, comprising:
The content information of the keyword of the described list item to be checked that extracts is divided at least two subclass; The length of each subclass is not more than the maximum length that network processing unit can be handled; With the corresponding unique mapping value respectively of each subclass in all or the described subclass of part, according to the mapping value of each the subclass correspondence in all or the described subclass of part, generate the keyword of described new list item; The length of the keyword of described new list item is not more than the maximum length that described network processing unit can be handled; According to the keyword of described new list item, in the stream table, generate described new list item.
6. a creation apparatus that flows the table list item is characterized in that, comprising:
Extraction unit is for the content information that extracts the keyword that is used for establishment list item to be created from the message that receives;
Division unit, the described content information that is used for extracting is divided at least two subclass, and the length of each subclass is not more than the maximum length that network processing unit can be handled;
Map unit is used for each subclass of all or the described subclass of part corresponding unique mapping value respectively;
Creating unit, be used for the mapping value of each subclass correspondence of all subclass is made up, generate the keyword of described list item to be created, and the mapping value of parton being concentrated each subclass correspondence, make up with other subclass except described part subclass in the described content information, generate the keyword of described list item to be created, the length of the keyword of described list item to be created is not more than the maximum length that described network processing unit can be handled; And according to the keyword of described list item to be created, in the stream table, generate described list item to be created.
7. device as claimed in claim 6 is characterized in that, described map unit also is used for the content information of each subclass that will the described part or all of subclass mapping value corresponding with this subclass as the mapping table list item, generates mapping table and also stores.
8. device as claimed in claim 7, it is characterized in that, also comprise delete cells, be used for when needs when stream is shown remove entries, judge that the mapping value that comprises in the keyword mapping value that comprises and the keyword for the treatment of remove entries that whether has other list items in the described stream table is identical; If, the described remove entries for the treatment of of deletion in the stream table, and in described mapping table, keep and the mapping value corresponding mapping table item for the treatment of to comprise in the keyword of remove entries; If not, the described remove entries for the treatment of of deletion in the stream table; And deletion and the mapping value corresponding mapping table list item for the treatment of to comprise in the keyword of remove entries in mapping table.
9. a stream table list item inquiry unit is characterized in that, comprising:
Extraction unit is for the content information that extracts the keyword that is used for inquiry list item to be checked from the message that receives;
Query unit is used for all or part of subclass according to the content information that extracts, and inquires about the mapping value of each subclass correspondence in the described all or part of subclass, and the length of described each subclass is not more than the maximum length that network processing unit can be handled; If all do not find, then notify described creating unit in the stream table, to create new list item; If all find, then according to whole subclass of the content information of the keyword of described list item to be checked, when inquiring the mapping value of each subclass correspondence in described whole subclass, the mapping value combination of each subclass correspondence in the described whole subclass that inquire is generated the keyword of described list item to be checked; Perhaps according to the part subclass of the content information of the keyword of described list item to be checked, when inquiring the mapping value of concentrated each the subclass correspondence of described parton, the described parton that inquires is concentrated the mapping value of each subclass correspondence, and other subclass except described part subclass make up the keyword that generates described list item to be checked in the described content information, and the length of the keyword of generation is not more than the maximum length that described network processing unit can be handled; And the keyword by generating, the corresponding list item of inquiry in the stream table; If in the stream table, do not inquire corresponding list item, then notify described creating unit in the stream table, to create new list item;
Creating unit is used for the notice according to described query unit, and the content information of the keyword of the described list item to be checked that extracts is divided at least two subclass; The total length of each subclass is not more than the maximum length that network processing unit can be handled; With the corresponding unique mapping value respectively of each subclass in all or the described subclass of part, according to the mapping value of each the subclass correspondence in all or the described subclass of part, generate the keyword of described new list item; The length of the keyword of described new list item is not more than the maximum length that described network processing unit can be handled; According to the keyword of described new list item, in the stream table, generate described new list item.
CN2010102425690A 2010-07-30 2010-07-30 Method and device for establishing table entry of flow table and method and device for querying table entry of flow table Expired - Fee Related CN101977177B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010102425690A CN101977177B (en) 2010-07-30 2010-07-30 Method and device for establishing table entry of flow table and method and device for querying table entry of flow table

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010102425690A CN101977177B (en) 2010-07-30 2010-07-30 Method and device for establishing table entry of flow table and method and device for querying table entry of flow table

Publications (2)

Publication Number Publication Date
CN101977177A CN101977177A (en) 2011-02-16
CN101977177B true CN101977177B (en) 2013-08-14

Family

ID=43577022

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010102425690A Expired - Fee Related CN101977177B (en) 2010-07-30 2010-07-30 Method and device for establishing table entry of flow table and method and device for querying table entry of flow table

Country Status (1)

Country Link
CN (1) CN101977177B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103166866B (en) * 2011-12-12 2016-08-03 华为技术有限公司 Generate the method for list item, the method receiving message and related device and system
CN104253876B (en) * 2013-06-28 2017-12-01 比威网络技术有限公司 The mapping item and management method that stateful IPv6 communicates with IPv4
CN103647718B (en) * 2013-12-13 2018-02-13 华为技术有限公司 The treating method and apparatus of packet

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006005402A (en) * 2004-06-15 2006-01-05 Hitachi Ltd Communication statistic collection apparatus
CN101247337A (en) * 2008-02-18 2008-08-20 华为技术有限公司 Packet forwarding method and equipment
CN101540723A (en) * 2009-04-20 2009-09-23 杭州华三通信技术有限公司 Flow stream searching method and device
CN101572670A (en) * 2009-05-07 2009-11-04 成都市华为赛门铁克科技有限公司 Data packet processing method based on flow table, device and network system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7743166B2 (en) * 2003-04-04 2010-06-22 Ellacoya Networks, Inc. Scaleable flow-based application and subscriber traffic control
US8015315B2 (en) * 2007-03-09 2011-09-06 Cisco Technology, Inc. Compression of IPV6 addresses in a netflow directory

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006005402A (en) * 2004-06-15 2006-01-05 Hitachi Ltd Communication statistic collection apparatus
CN101247337A (en) * 2008-02-18 2008-08-20 华为技术有限公司 Packet forwarding method and equipment
CN101540723A (en) * 2009-04-20 2009-09-23 杭州华三通信技术有限公司 Flow stream searching method and device
CN101572670A (en) * 2009-05-07 2009-11-04 成都市华为赛门铁克科技有限公司 Data packet processing method based on flow table, device and network system

Also Published As

Publication number Publication date
CN101977177A (en) 2011-02-16

Similar Documents

Publication Publication Date Title
US10616112B2 (en) System and method of loading an exact match table and longest prefix match table
US7039018B2 (en) Technique to improve network routing using best-match and exact-match techniques
CN101848248B (en) Rule searching method and device
CN111988231B (en) Mask quintuple rule matching method and device
WO2020114239A1 (en) Multicast message processing method and apparatus, storage medium and processor
CN101977177B (en) Method and device for establishing table entry of flow table and method and device for querying table entry of flow table
CN106713144B (en) Reading and writing method of message outlet information and forwarding engine
CN101345707A (en) Method and apparatus for implementing IPv6 packet classification
CN102291301A (en) Message characteristic matching method and device
CN106331196A (en) Method and device for realizing NAT
CN102577273A (en) Iterative parsing and classification
CN102184234A (en) Method and equipment used for inquiring, increasing, updating or deleting information processing rules
CN103457855B (en) Classless inter-domain routing table is established and the method and apparatus of message forwarding
WO2021135492A1 (en) Routing table entry processing method and device
JP2016503267A (en) Method and processing device for handling network protocol addresses
CN103812774A (en) TCAM based strategy configuration method, message processing method and corresponding device
CN105282055A (en) Method of identifying internal destinations of network packets and an apparatus thereof
CN114465757B (en) Method and device for realizing DDOS user matching based on Trie tree
CN108270880B (en) Method and system for realizing mapping between domain name trees
Tan et al. Efficient name lookup scheme based on hash and character trie in named data networking
US9544226B1 (en) Efficient address-based rule resolution in a network employing a bit-mapped index
Chandana et al. Efficient lookup for NLAPB in named data networking
CN112637070B (en) Method and equipment for searching table item
KR20020007015A (en) Addressing architecture and hierarchical routing method for IPv6 network using Postal code structure
CN114268585B (en) Three-layer route forwarding judging method based on TCAM

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20130814

Termination date: 20210730

CF01 Termination of patent right due to non-payment of annual fee