CN109600313A - Message forwarding method and device - Google Patents

Message forwarding method and device Download PDF

Info

Publication number
CN109600313A
CN109600313A CN201710946318.2A CN201710946318A CN109600313A CN 109600313 A CN109600313 A CN 109600313A CN 201710946318 A CN201710946318 A CN 201710946318A CN 109600313 A CN109600313 A CN 109600313A
Authority
CN
China
Prior art keywords
flow entry
level
flow
message
hash
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201710946318.2A
Other languages
Chinese (zh)
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.)
Maipu Communication Technology Co Ltd
Original Assignee
Maipu Communication Technology 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 Maipu Communication Technology Co Ltd filed Critical Maipu Communication Technology Co Ltd
Priority to CN201710946318.2A priority Critical patent/CN109600313A/en
Publication of CN109600313A publication Critical patent/CN109600313A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering

Abstract

The present invention provides a kind of message forwarding method and device, is related to data communication technology field.This method and device improve the speed for searching flow entry, help to improve the service efficiency of memory by searching for the flow entry of Coutinuous store.Specifically, this method is by receiving message, and extracts key value from the received message and carry out Hash calculating;Judge whether find the flow entry to match with the key value in the corresponding level-one flow table of Hash concordance list according to the hash value of calculating, wherein the level-one flow table is the storage organization for saving the flow entry using one piece of contiguous memory;If so, forwarding the message according to flow entry matched in the level-one flow table.Wherein, the administration overhead when flow entry being continuously stored in level-one flow table improves the access efficiency of memory and reduces storage allocation, and then improve the search speed of flow entry and the service efficiency of memory.

Description

Message forwarding method and device
Technical field
The present invention relates to data communication technology fields, in particular to a kind of message forwarding method and device.
Background technique
In data communication technology field, the Forwarding plane of data communications equipment (for example, router) needs to handle Control business, for example, accesses control list (Access Control List, ACL), service quality (Quality Of Service, QOS) etc..Currently, the control business such as ACL, QOS can be according to hexa-atomic group of (source address, source port, destination of message Location, destination port, four protocol number of layer and interface index) or eight tuples (source address, source port, destination address, destination port, Four protocol number of layer, service type, the mark of layer four and interface index) unique definition one stream, made using hexa-atomic group or eight tuples Flow entry is constructed for key value, includes key value and other fields in flow entry.And flow stream searching method ratio in the prior art It is relatively time-consuming, it is not able to satisfy data message forwarding performance requirement generally.
Therefore, how to provide one kind can solution to the problems described above and device, to be needed as those skilled in the art The technical issues of solution.
Summary of the invention
In order to overcome the deficiencies in the prior art described above, the present invention provides a kind of message forwarding method and device, passes through company It renews storage flow entry and improves the search speed of flow entry, and then solve the above problems.
To achieve the goals above, technical solution provided by present pre-ferred embodiments is as follows:
For method, present pre-ferred embodiments provide a kind of message forwarding method, are applied to communication equipment, the side Method includes:
Message is received, and extracts key value from the received message and carries out Hash calculating, to obtain and the message Corresponding hash value;
Judge whether find and the key value in the corresponding level-one flow table of Hash concordance list according to the hash value The flow entry to match, wherein the level-one flow table is the storage organization for saving the flow entry using one piece of contiguous memory;
If so, forwarding the message according to flow entry matched in the level-one flow table;
If it is not, then being searched in the corresponding second level flow table of Hash concordance list according to calculated hash value and the key value Matched flow entry forwards the message according to flow entry matched in the second level flow table, wherein the second level flow table is to make The storage organization of flow entry is saved with conflict chained list.
In the preferred embodiment, above-mentioned that level-one stream corresponding in Hash concordance list is judged according to the hash value The step of flow entry to match with the key value whether is found in table, comprising:
Matched Hash list item is searched in the Hash concordance list according to the hash value, according to the matched of lookup Index point in Hash list item, what the correspondence continuous memory cell lookup in the level-one flow table matched with the key Flow entry;The conflict flow entry that can be stored in the level-one flow table that index point in the matched Hash list item is directed toward Storage unit number, the number of flow entry that can be stored less than the chained list that conflicts in the second level flow table.
In the preferred embodiment, the above method further include:
If do not found in the second level flow table with the matched flow entry of the key value, judge described matched Whether the storage unit in the level-one flow table that the index point in Hash list item is directed toward for memory contention flow entry has time It is not busy;
If so, storage includes the corresponding flow entry of the message of the key value in idle storage unit;
If it is not, then creating the corresponding flow entry of the message including the key value in the second level flow table.
In the preferred embodiment, above-mentioned that level-one stream corresponding in Hash concordance list is judged according to the hash value The step of flow entry to match with the key value whether is found in table, comprising:
The hash value flow entry that conflicts identical with the hash value of the message is chosen from all conflict flow entrys;
The key value of the message is compared with the key value for the flow entry that conflicts selected, if the two Key value is identical, then the conflict flow entry is the flow entry with the message successful match.
In the preferred embodiment, before the step of above-mentioned reception message, the method also includes:
Distribution includes the memory headroom of multiple continuous storage units to construct the level-one flow table, and each storage is single Member is for saving a flow entry.
In the preferred embodiment, above-mentioned distribution includes the memory headroom of multiple continuous storage units to construct The step of level-one flow table, comprising:
Multiple flow entrys are stored with using the structure type of two-dimensional array, the level-one flow table is obtained with building.
For device, presently preferred embodiments of the present invention provides a kind of apparatus for forwarding message, is applied to communication equipment, described Device includes:
Computing unit is received, for receiving message, and key value is extracted from the received message and carries out Hash calculating, To obtain hash value corresponding with the message;
First matching judgment unit is in the corresponding level-one flow table of Hash concordance list for being judged according to the hash value It is no to find the flow entry to match with the key value, wherein the level-one flow table is to be saved using one piece of contiguous memory The storage organization of the flow entry;
First retransmission unit is when being, according to the level-one for the judging result in the first matching judgment unit Matched flow entry forwards the message in flow table;
Second retransmission unit, for the judging result in the first matching judgment unit be it is no when, according to calculated Hash value is searched in the corresponding second level flow table of Hash concordance list and the matched flow entry of the key value, according to the secondary streams Matched flow entry forwards the message in table, wherein the second level flow table is to save depositing for flow entry using conflict chained list Storage structure.
In the preferred embodiment, above-mentioned first matching judgment unit is also used to:
Matched Hash list item is searched in the Hash concordance list according to the hash value, according to the matched of lookup Index point in Hash list item, what the correspondence continuous memory cell lookup in the level-one flow table matched with the key Flow entry;The conflict flow entry that can be stored in the level-one flow table that index point in the matched Hash list item is directed toward Storage unit number, the number of flow entry that can be stored less than the chained list that conflicts in the second level flow table.
In the preferred embodiment, above-mentioned apparatus further includes the second matching judgment unit, is used for:
If do not found in the second level flow table with the matched flow entry of the key value, judge described matched Whether the storage unit in the level-one flow table that the index point in Hash list item is directed toward for memory contention flow entry has time It is not busy;
If so, storage includes the corresponding flow entry of the message of the key value in idle storage unit;
If it is not, then creating the corresponding flow entry of the message including the key value in the second level flow table.
In the preferred embodiment, above-mentioned first matching judgment unit is also used to:
The hash value flow entry that conflicts identical with the hash value of the message is chosen from all conflict flow entrys;
The key value of the message is compared with the key value for the flow entry that conflicts selected, if the two Key value is identical, then the conflict flow entry is the flow entry with the message successful match.
In terms of existing technologies, message forwarding method and device provided by the invention at least have below beneficial to effect Fruit: this method and device improve the speed for searching flow entry, help to improve memory by searching for the flow entry of Coutinuous store Service efficiency.Specifically, this method is by receiving message, and extracts key value from the received message and carry out Hash meter It calculates;Judge whether find and the key value phase in the corresponding level-one flow table of Hash concordance list according to the hash value of calculating The flow entry matched, wherein the level-one flow table is the storage organization for saving the flow entry using one piece of contiguous memory;If It is that the message is then forwarded according to flow entry matched in the level-one flow table.Scheme provided by the invention reduces in distribution Administration overhead when depositing, and then improve the search speed of flow entry and the service efficiency of memory.
To enable the above objects, features and advantages of the present invention to be clearer and more comprehensible, present pre-ferred embodiments are cited below particularly, And cooperate appended attached drawing, it is described in detail below.
Detailed description of the invention
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below will be to needed in the embodiment attached Figure is briefly described.It should be appreciated that the following drawings illustrates only certain embodiments of the present invention, therefore it is not construed as pair The restriction of range for those of ordinary skill in the art without creative efforts, can also be according to this A little attached drawings obtain other relevant attached drawings.
Fig. 1 is one of the flow diagram of message forwarding method that present pre-ferred embodiments provide.
Fig. 2 is the structural schematic diagram for the tissue flow entry that present pre-ferred embodiments provide.
Fig. 3 is the two of the flow diagram for the message forwarding method that present pre-ferred embodiments provide.
Fig. 4 is one of the block diagram of apparatus for forwarding message that present pre-ferred embodiments provide.
Fig. 5 is the two of the block diagram for the apparatus for forwarding message that present pre-ferred embodiments provide.
Icon: 100- apparatus for forwarding message;110- receives computing unit;120- the first matching judgment unit;130- first Retransmission unit;The second retransmission unit of 140-;150- the second matching judgment unit.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description.Obviously, described embodiment is only a part of the embodiments of the present invention, instead of all the embodiments.It is logical The component for the embodiment of the present invention being often described and illustrated herein in the accompanying drawings can be arranged and be designed with a variety of different configurations.
Therefore, the detailed description of the embodiment of the present invention provided in the accompanying drawings is not intended to limit below claimed The scope of the present invention, but be merely representative of selected embodiment of the invention.Based on the embodiment of the present invention, those skilled in the art Member's every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
It should also be noted that similar label and letter indicate similar terms in following attached drawing, therefore, once a certain Xiang Yi It is defined in a attached drawing, does not then need that it is further defined and explained in subsequent attached drawing.In addition, term " the One ", " second " etc. is only used for distinguishing description, is not understood to indicate or imply relative importance.
With reference to the accompanying drawing, it elaborates to some embodiments of the present invention.In the absence of conflict, following Feature in embodiment and embodiment can be combined with each other.
In the equipment (for example, router) of data communication, forwarding surface needs to handle some control business and such as accesses control List (Access Control List, ACL) processed, service quality (Quality Of Service, QOS) etc..ACL, QOS etc. Control business need using in message five-tuple (source address, source port, four protocol number of destination address, destination port and layer) or Seven tuple of person (source address, source port, destination address, destination port, four protocol number of layer, service type (Type Of Service, Tos) indicate with layer four) classification control is carried out to message.
Therefore, a stream can be defined with the tuple of message.For example, with hexa-atomic group of (source address, source port, mesh of message Address, destination port, four protocol number of layer and interface index) or eight tuples (source address, source port, destination address, destination Mouth, four protocol number of layer, service type, layer four mark and interface index) it can be flowed with unique definition one;Use hexa-atomic group or eight Tuple constructs flow entry as key value, includes key value and other fields (such as forwarding information) in flow entry.When the equipment After interface to message, flow entry is first searched in flow table, and corresponding operation is then executed according to the flow entry of lookup, than Such as, it is E-Packeted according to forwarding information.
First embodiment:
Fig. 1 is please referred to, is one of the flow diagram of message forwarding method that present pre-ferred embodiments provide.The present invention The message forwarding method of offer can be applied to communication equipment, this method by inquiry Coutinuous store first in a communications device Multiple flow entrys improve the speed of inquiry flow entry, facilitate the processing speed for promoting the control business such as ACL, QOS.
Below by message forwarding method shown in Fig. 1 detailed process and step be described in detail.In this implementation In example, message forwarding method be may comprise steps of:
Step S210, receive message, and from the received message extract key value carry out Hash calculating, with obtain with The corresponding hash value of the message.
Before step S210, this method can also include the steps that creating level-one flow table.For example, distribution includes multiple companies The memory headroom of continuous storage unit is to construct the level-one flow table, and each storage unit is for saving a flow entry. The flow entry can wrap from corresponding message and extract key value (such as five-tuple or seven tuples), then utilize the key value It carries out Hash operation and obtains corresponding hash value etc., the flow entry with identical hash value and different key values is flowed as conflict List item.
Further, the structure type that two-dimensional array can be used stores multiple flow entrys, obtains the level-one stream with building Table, that is, level-one flow table storage flow table item in continuous memory.Each storage unit of the two-dimensional array stores one Flow entry, the number for the flow entry that conflicts be it is fixed, for the flow entry of hash value conflict, level-one flow table is without vacant storage When unit memory contention flow entry, just conflict flow entry is put into second level flow table corresponding to same Hash index list item, two Grade flow table is the storage organization for saving flow entry using conflict chained list.It is continuously deposited based on above-mentioned design compared to discrete storage The flow entry of storage reduces administration overhead when storage allocation, facilitates the service efficiency for promoting memory.
Whether step S220, judge to find in the corresponding level-one flow table of Hash concordance list and institute according to the hash value State the flow entry that key value matches, wherein the level-one flow table is to save the flow entry using one piece of contiguous memory Storage organization.
Further, the key value can be the five-tuple extracted from message or seven tuples.Hash value is to obtain Key value based on, hash value is calculated such as above-mentioned Hash by carrying out to key value.Wherein, key value and message phase Corresponding, there may be identical hash values for different key values, it is also possible to which there are different hash values, wherein the hash value and Key value can be used as the characteristic value of the message.
It is understood that the number of flow entry can according to the size for the continuous memory cell that communication equipment is distributed with And byte-sized shared by each flow entry and be arranged, be not especially limited here.
In the present embodiment, step S220 may include: to be searched in the Hash concordance list according to the hash value The Hash list item matched, according to the index point in the matched Hash list item of lookup, the correspondence in the level-one flow table is continuous Storage unit searches the flow entry to match with the key;Index point in the matched Hash list item is directed toward described The number of the storage unit for the conflict flow entry that can be stored in level-one flow table, can less than conflict chained list in the second level flow table The number of the flow entry of storage.Since level-one flow table is generated earlier than second level flow table, so the level-one flow table for frequency of use Hit frequency is higher.The number for the flow entry that conflicts in level-one flow table can be set according to the actual situation.
It further, referring to figure 2., is the structural schematic diagram for the tissue flow entry that present pre-ferred embodiments provide, In KEY shown in Fig. 2 be the key value abbreviation.In the present embodiment, flow entry all in level-one flow table is located at one In the continuous memory of block.For example, its storage form can (P and Q be true according to the actual situation for two-dimensional array L1flow [P] [Q] Fixed, P can be the number of cryptographic Hash, and it is whole more than or equal to 0 that Q, which can be the number of the conflict flow entry of same cryptographic Hash, Number) or other forms.Understandably, array L1flow [P] [Q] stores up to P*Q flow entry, memory size P*Q The memory size that a flow entry occupies.The access of level-one flow table is then the access of two-dimensional array, specific storage mode, such as: The flow entry that hash value is 0 is stored on the conflict chain that HASH value 0 is, for example, L1Flow [0] [0], L1Flow [0] [1] ..., L1Flow[0][Q-1];The flow entry that hash value is 1 is stored in [1] [0] L1Flow on the conflict chain that member HASH value 1 is, L1Flow [1] [1] ..., L1Flow [1] [Q-1], and so on.
Referring once again to Fig. 1, step S230, if so, according to flow entry matched in level-one flow table forwarding Message.
In the present embodiment, from all conflict streams in the level-one flow table that the index point in matched Hash list item is directed toward Key value flow entry identical with the key value of the message is chosen in list item;If detecting key value in matched Hash list item In the key value of the level-one flow table conflict flow entry that is included that is directed toward of index point in, then include the conflict of the key value Flow entry is just target flow entry, the flow entry which namely searches required for message based on the received.
It is to be appreciated that since the flow entry of level-one flow table is stored in the continuous storage unit in address;Processor (ratio Such as, CPU) cache multiple flow entrys can once be read from memory according to its reading of content width, carry out message It is first inquired from cache before forwarding, the number of rdma read can be reduced, and then improve search speed.
Step S240, if it is not, then searched in the corresponding second level flow table of Hash concordance list according to calculated hash value with The matched flow entry of key value forwards the message according to flow entry matched in the second level flow table, wherein described two Grade flow table is the storage organization for saving flow entry using conflict chained list.
In the present embodiment, since the number for saving the corresponding conflict flow entry of same hash value in level-one flow table is limited Fixed, when level-one flow table does not place the conflict unit of same hash value conflict flow entry, conflict flow entry is put into same In second level flow table corresponding to Hash index list item.After finding target flow entry, this method can also include that will find The corresponding flow entry pointer storage of the target flow entry the first predeterminated position is recorded.First predeterminated position can be according to reality Border situation is configured, for example is message descriptor.Wherein, message descriptor is the control block of stored messages information.
The controls such as ACL, QOS business can be recorded in the first predeterminated position by the query path searched for the first time.To When executing the controls business such as ACL, QOS again according to the message or execute other business, it can be used directly in the first predeterminated position The query path of middle record further speeds up the processing speed of control business.
Second embodiment:
Referring to figure 3., be present pre-ferred embodiments provide message forwarding method flow diagram two.Second is real Its step principle of message forwarding method of example offer is provided and reaches technical effect and essentially identical in first embodiment, difference Place is that the method that second embodiment provides can also include step S250, step S260 and step S270.
Step S250, if do not found in the second level flow table with the matched flow entry of the key value, judge institute State the storage unit that memory contention flow entry is used in the level-one flow table that the index point in matched Hash list item is directed toward It is whether available free.
Step S260, if so, storage includes that the message of the key value is corresponding in idle storage unit Flow entry.
Step S270, if it is not, the then message corresponding stream of the creation including the key value in the second level flow table List item.
Understandably, since the number for saving the corresponding conflict flow entry of same hash value in level-one flow table is that have restriction , when level-one flow table does not place the conflict unit of same hash value conflict flow entry, just conflict flow entry is put into same In second level flow table corresponding to Hash index list item.If not being matched to and message key value pair in level-one flow table and second level flow table The flow entry answered then is searched whether in level-one flow table there are vacant storage unit, if without empty storage list in level-one flow table Member distributes discrete storage unit then to create flow entry corresponding with the message, that is, creates the stream in second level flow table List item.
Wherein, whether search vacant storage unit and can be regarded as searching having in above-mentioned L1flow [P] [Q] not stored has The member (for example, L1flow [1] [1]) of flow entry exists, if present, just using the member as empty storage unit to deposit The corresponding flow entry of the received message of storage institute.
If being stored with flow entry in above-mentioned L1flow [P] [Q] member, then created and the message in second level flow table Corresponding flow entry.And second level flow table is generally the one or more flow entrys stored in discrete memory space and constitutes.
It should be noted that then the message gives correspondence due to not finding matched flow entry in two-stage flow table Business module carry out the processing of corresponding process.
Based on above-mentioned design, when receiving message identical with the message again, corresponding flow table can be directly found , further increase the speed for searching flow entry.
In the present embodiment, after finding target flow entry, this method can also include the target that will be found The first above-mentioned predeterminated position is recorded in the corresponding flow entry pointer storage of flow entry, and which is not described herein again.
Generally, the corresponding storage unit number for memory contention flow entry of a certain hash value has in level-one flow table Limit just constructs corresponding flow entry when the conflict flow entry is corresponding when the storage unit is all filled with from second level flow table. For example, received message calculates the key value of the message, hash value as needed first, according to key value, hash value and report Forwarding information of text etc. forms flow entry;If memory space corresponding with the hash value is filled with flow entry in level-one flow table, no There are extra memory spaces to store the flow entry, then distributes discrete memory space, and flow entry is stored in and the Hash It is worth in corresponding memory space.
3rd embodiment:
It referring to figure 4., is one of the block diagram for the apparatus for forwarding message 100 that present pre-ferred embodiments provide.It should Apparatus for forwarding message 100 can be adapted for message forwarding method shown in FIG. 1, and then the speed for searching flow entry can be improved.It should Apparatus for forwarding message 100 may include receive computing unit 110, the first matching judgment unit 120, the first retransmission unit 130 with And second retransmission unit 140.
Computing unit 110 is received, for receiving message, and key value is extracted from the received message and carries out Hash meter It calculates, to obtain hash value corresponding with the message.Specifically, receiving computing unit 110 can be used for executing step shown in FIG. 1 Rapid S210, concrete operations content can refer to the detailed description to step S210.
First matching judgment unit 120, for judging level-one flow table corresponding in Hash concordance list according to the hash value In whether find the flow entry to match with the key value, wherein the level-one flow table be use one piece of contiguous memory come Save the storage organization of the flow entry.Specifically, the first matching judgment unit 120 can be used for executing step shown in FIG. 1 S220, concrete operations content can refer to the detailed description to step S220.
First retransmission unit 130 is when being, according to institute for the judging result in the first matching judgment unit 120 It states matched flow entry in level-one flow table and forwards the message.Specifically, the first retransmission unit 130 can be used for executing Fig. 1 institute The step S230 shown, concrete operations content can refer to the detailed description to step S230, and which is not described herein again.
Second retransmission unit 140, for the judging result in the first matching judgment unit 120 be it is no when, according to meter The hash value of calculating is searched in the corresponding second level flow table of Hash concordance list and the matched flow entry of the key value, according to described Matched flow entry forwards the message in second level flow table, wherein the second level flow table is to save flow table using conflict chained list The storage organization of item.Specifically, the second retransmission unit 140 can be used for executing step S240 shown in FIG. 1, concrete operations content It can refer to the detailed description to step S240, which is not described herein again.
It further, referring to figure 5., is the box signal for the apparatus for forwarding message 100 that present pre-ferred embodiments provide The two of figure.The apparatus for forwarding message 100 can also include the second matching judgment unit 150.
Second matching judgment unit 150, if matched with the key value for not found in the second level flow table Flow entry then judges in the level-one flow table of the index point direction in the matched Hash list item for memory contention stream Whether the storage unit of list item is available free;If so, storage includes the report of the key value in idle storage unit The corresponding flow entry of text;If it is not, then creating the corresponding flow table of the message including the key value in the second level flow table ?.
Specifically, the second matching judgment unit 150 can be used for executing step S250, step S260 and step shown in Fig. 3 Rapid S270, concrete operations content can refer to the detailed description to step S250 to step S270, and which is not described herein again.
In conclusion the present invention provides a kind of message forwarding method and device.This method and device are by searching for continuously depositing The flow entry of storage improves the speed for searching flow entry, helps to improve the service efficiency of memory.Specifically, this method passes through Message is received, and extracts key value from the received message and carries out Hash calculating;Judged according to the hash value of calculating The flow entry to match with the key value whether is found in the corresponding level-one flow table of Hash concordance list, wherein the level-one Flow table is the storage organization for saving the flow entry using one piece of contiguous memory;If so, according in the level-one flow table The flow entry matched forwards the message.Wherein, the flow entry being continuously stored in level-one flow table improves the access efficiency of memory And reduces administration overhead when storage allocation, and then improve the search speed of flow entry and the service efficiency of memory.
The foregoing is only a preferred embodiment of the present invention, is not intended to restrict the invention, for the skill of this field For art personnel, the invention may be variously modified and varied.All within the spirits and principles of the present invention, made any to repair Change, equivalent replacement, improvement etc., should all be included in the protection scope of the present invention.

Claims (10)

1. a kind of message forwarding method, which is characterized in that be applied to communication equipment, which comprises
Message is received, and extracts key value from the received message and carries out Hash calculating, it is corresponding with the message to obtain Hash value;
Judge whether find and the key value phase in the corresponding level-one flow table of Hash concordance list according to the hash value The flow entry matched, wherein the level-one flow table is the storage organization for saving the flow entry using one piece of contiguous memory;
If so, forwarding the message according to flow entry matched in the level-one flow table;
It is matched if it is not, then being searched in the corresponding second level flow table of Hash concordance list according to calculated hash value with the key value Flow entry, the message is forwarded according to flow entry matched in the second level flow table, wherein the second level flow table is using punching Prominent chained list saves the storage organization of flow entry.
2. the method according to claim 1, wherein described judge according to the hash value in Hash concordance list pair The step of whether finding the flow entry to match with the key value in the level-one flow table answered, comprising:
Matched Hash list item is searched in the Hash concordance list according to the hash value, according to the matched Hash table of lookup Index point in, the correspondence continuous memory cell in the level-one flow table search the flow table to match with the key ?;The conflict flow entry that can be stored in the level-one flow table that index point in the matched Hash list item is directed toward is deposited The number of storage unit, less than the number for the flow entry that conflict chained list can store in the second level flow table.
3. according to the method described in claim 2, it is characterized in that, the method also includes:
If do not found in the second level flow table with the matched flow entry of the key value, judge the matched Hash table Whether the storage unit in the level-one flow table that the index point in is directed toward for memory contention flow entry is available free;
If so, storage includes the corresponding flow entry of the message of the key value in idle storage unit;
If it is not, then creating the corresponding flow entry of the message including the key value in the second level flow table.
4. according to the method described in claim 2, it is characterized in that, described judge according to the hash value in Hash concordance list pair The step of whether finding the flow entry to match with the key value in the level-one flow table answered, comprising:
The hash value flow entry that conflicts identical with the hash value of the message is chosen from all conflict flow entrys;
The key value of the message is compared with the key value for the flow entry that conflicts selected, if the key of the two It is worth identical, then the conflict flow entry is flow entry with the message successful match.
5. method according to any of claims 1-4, which is characterized in that before the step of the reception message, institute State method further include:
Distribution includes the memory headroom of multiple continuous storage units to construct the level-one flow table, and each storage unit is used In one flow entry of preservation.
6. according to the method described in claim 5, it is characterized in that, the distribution includes the memory of multiple continuous storage units The step of space is to construct the level-one flow table, comprising:
Multiple flow entrys are stored with using the structure type of two-dimensional array, the level-one flow table is obtained with building.
7. a kind of apparatus for forwarding message, which is characterized in that be applied to communication equipment, described device includes:
Computing unit is received, for receiving message, and key value is extracted from the received message and carries out Hash calculating, with To hash value corresponding with the message;
First matching judgment unit, for judging whether look into the corresponding level-one flow table of Hash concordance list according to the hash value Find the flow entry to match with the key value, wherein the level-one flow table is described to save using one piece of contiguous memory The storage organization of flow entry;
First retransmission unit is when being, according to the level-one flow table for the judging result in the first matching judgment unit In matched flow entry forward the message;
Second retransmission unit, for the judging result in the first matching judgment unit be it is no when, according to calculated Hash Value is searched in the corresponding second level flow table of Hash concordance list and the matched flow entry of the key value, according in the second level flow table Matched flow entry forwards the message, wherein the second level flow table is the storage knot for saving flow entry using conflict chained list Structure.
8. device according to claim 7, which is characterized in that the first matching judgment unit is also used to:
Matched Hash list item is searched in the Hash concordance list according to the hash value, according to the matched Hash table of lookup Index point in, the correspondence continuous memory cell in the level-one flow table search the flow table to match with the key ?;The conflict flow entry that can be stored in the level-one flow table that index point in the matched Hash list item is directed toward is deposited The number of storage unit, less than the number for the flow entry that conflict chained list can store in the second level flow table.
9. device according to claim 8, which is characterized in that described device further includes the second matching judgment unit, is used for:
If do not found in the second level flow table with the matched flow entry of the key value, judge the matched Hash table Whether the storage unit in the level-one flow table that the index point in is directed toward for memory contention flow entry is available free;
If so, storage includes the corresponding flow entry of the message of the key value in idle storage unit;
If it is not, then creating the corresponding flow entry of the message including the key value in the second level flow table.
10. device according to claim 8, which is characterized in that the first matching judgment unit is also used to:
The hash value flow entry that conflicts identical with the hash value of the message is chosen from all conflict flow entrys;
The key value of the message is compared with the key value for the flow entry that conflicts selected, if the key of the two It is worth identical, then the conflict flow entry is flow entry with the message successful match.
CN201710946318.2A 2017-09-30 2017-09-30 Message forwarding method and device Pending CN109600313A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710946318.2A CN109600313A (en) 2017-09-30 2017-09-30 Message forwarding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710946318.2A CN109600313A (en) 2017-09-30 2017-09-30 Message forwarding method and device

Publications (1)

Publication Number Publication Date
CN109600313A true CN109600313A (en) 2019-04-09

Family

ID=65956628

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710946318.2A Pending CN109600313A (en) 2017-09-30 2017-09-30 Message forwarding method and device

Country Status (1)

Country Link
CN (1) CN109600313A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112491723A (en) * 2020-12-07 2021-03-12 上海励驰半导体有限公司 Gateway message forwarding method, device, storage medium and gateway
WO2021135491A1 (en) * 2019-12-31 2021-07-08 盛科网络(苏州)有限公司 Flow table matching method and apparatus
CN113595822A (en) * 2021-07-26 2021-11-02 北京恒光信息技术股份有限公司 Data packet management method, system and device
CN114338529A (en) * 2021-12-29 2022-04-12 杭州迪普信息技术有限公司 Quintuple rule matching method and device
WO2022193929A1 (en) * 2021-03-19 2022-09-22 翱捷科技股份有限公司 Network device, and method for sharing sending and receiving caches thereof
CN115208810A (en) * 2021-04-12 2022-10-18 益思芯科技(上海)有限公司 Forwarding flow table accelerating method and device, electronic equipment and storage medium
CN115914102A (en) * 2023-02-08 2023-04-04 阿里巴巴(中国)有限公司 Data forwarding method, flow table processing method, device and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101247337A (en) * 2008-02-18 2008-08-20 华为技术有限公司 Packet forwarding method and equipment
CN102882810A (en) * 2012-10-26 2013-01-16 杭州迪普科技有限公司 Rapid message transmitting method and device
US20140369348A1 (en) * 2013-06-17 2014-12-18 Futurewei Technologies, Inc. Enhanced Flow Entry Table Cache Replacement in a Software-Defined Networking Switch
CN106302179A (en) * 2016-07-29 2017-01-04 杭州迪普科技有限公司 A kind of method and device managing concordance list

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101247337A (en) * 2008-02-18 2008-08-20 华为技术有限公司 Packet forwarding method and equipment
CN102882810A (en) * 2012-10-26 2013-01-16 杭州迪普科技有限公司 Rapid message transmitting method and device
US20140369348A1 (en) * 2013-06-17 2014-12-18 Futurewei Technologies, Inc. Enhanced Flow Entry Table Cache Replacement in a Software-Defined Networking Switch
CN106302179A (en) * 2016-07-29 2017-01-04 杭州迪普科技有限公司 A kind of method and device managing concordance list

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021135491A1 (en) * 2019-12-31 2021-07-08 盛科网络(苏州)有限公司 Flow table matching method and apparatus
CN112491723A (en) * 2020-12-07 2021-03-12 上海励驰半导体有限公司 Gateway message forwarding method, device, storage medium and gateway
CN112491723B (en) * 2020-12-07 2022-03-01 上海励驰半导体有限公司 Gateway message forwarding method, device, storage medium and gateway
WO2022193929A1 (en) * 2021-03-19 2022-09-22 翱捷科技股份有限公司 Network device, and method for sharing sending and receiving caches thereof
CN115208810A (en) * 2021-04-12 2022-10-18 益思芯科技(上海)有限公司 Forwarding flow table accelerating method and device, electronic equipment and storage medium
CN113595822A (en) * 2021-07-26 2021-11-02 北京恒光信息技术股份有限公司 Data packet management method, system and device
CN113595822B (en) * 2021-07-26 2024-03-22 北京恒光信息技术股份有限公司 Data packet management method, system and device
CN114338529A (en) * 2021-12-29 2022-04-12 杭州迪普信息技术有限公司 Quintuple rule matching method and device
CN114338529B (en) * 2021-12-29 2024-03-08 杭州迪普信息技术有限公司 Five-tuple rule matching method and device
CN115914102A (en) * 2023-02-08 2023-04-04 阿里巴巴(中国)有限公司 Data forwarding method, flow table processing method, device and system

Similar Documents

Publication Publication Date Title
CN109600313A (en) Message forwarding method and device
US10097378B2 (en) Efficient TCAM resource sharing
CN102025643B (en) Flow table search method and device
CN101345694A (en) Method for fast searching, positioning and matching access control list
CN108710629B (en) Top-k query method and system based on named data network
CN103714134A (en) Network flow data index method and system
CN105429879B (en) Flow entry querying method, equipment and system
CN108494574B (en) Network function parallel processing infrastructure in NFV
CN102035735A (en) Device and method for providing forwarding and qos information
US20150271236A1 (en) Communicating tuples in a message
WO2018036100A1 (en) Data message forwarding method and apparatus
CN107040393B (en) Route management method and equipment
WO2003058463A1 (en) Method and apparatus for representing label switched paths
CN103248573A (en) Centralization management switch for OpenFlow and data processing method of centralization management switch
CN100426791C (en) Engine apparatus for route forwarding table address searching
CN103888364A (en) Message shunting method and device
CN108111422B (en) DPDK-based data high-speed multi-path forwarding method and device
CN100472427C (en) Data packet recursive flow sorting method
CN106411553B (en) Method and device for optimizing service chain path
CN105335307B (en) A kind of loading method and device of acl rule
CN109754021B (en) Online packet classification method based on range tuple search
CN109254844B (en) Triangle calculation method of large-scale graph
CN114189468B (en) Multi-identification network system routing method based on identification clustering
JP2000083055A (en) Router
CN103999435B (en) For the apparatus and method of efficient network address translation and ALG process

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20190409

RJ01 Rejection of invention patent application after publication