CN104363177B - A kind of optimization method and device of rule table entry for Message processing - Google Patents

A kind of optimization method and device of rule table entry for Message processing Download PDF

Info

Publication number
CN104363177B
CN104363177B CN201410638579.4A CN201410638579A CN104363177B CN 104363177 B CN104363177 B CN 104363177B CN 201410638579 A CN201410638579 A CN 201410638579A CN 104363177 B CN104363177 B CN 104363177B
Authority
CN
China
Prior art keywords
table entry
rule table
tcam
packet
time interval
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.)
Active
Application number
CN201410638579.4A
Other languages
Chinese (zh)
Other versions
CN104363177A (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.)
Kyland Technology Co Ltd
Original Assignee
Kyland 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 Kyland Technology Co Ltd filed Critical Kyland Technology Co Ltd
Priority to CN201410638579.4A priority Critical patent/CN104363177B/en
Priority to PCT/CN2014/092780 priority patent/WO2016070478A1/en
Publication of CN104363177A publication Critical patent/CN104363177A/en
Application granted granted Critical
Publication of CN104363177B publication Critical patent/CN104363177B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The present invention provides a kind of optimization method and device of rule table entry for Message processing, accuracy to improve Message processing, switching equipment is received after pending packet in this method, it is determined that the rule table entry handled the packet, and after using the rule table entry to processing data packets, the number of times that the rule table entry is used is updated, according to the number of times that each rule table entry is used after renewal, the rule table entry preserved in TCAM is updated.Present invention also offers corresponding device.Due in embodiments of the present invention by counting the number of times that each rule table entry is used, the number of times used according to rule table entry, the rule table entry preserved in TCAM is updated, therefore can be in the case where largely not taking TCAM spaces, preserve the rule table entry being more often used by a user, so as to reduce the waste of TCAM space resources, it is ensured that packet is normally processed.

Description

A kind of optimization method and device of rule table entry for Message processing
Technical field
The present invention relates to the optimization in industrial Ethernet technology field, more particularly to a kind of rule table entry for Message processing Method and device.
Background technology
In the prior art, the network equipment when carrying out the processing of packet, it is necessary to inquire about each flow table for being preserved in CPU, example Such as nat translation table, the forwarding of packet is carried out according to the nat translation table.Multigroup action list item is preserved in each flow table, is identified Processing action to the packet, for example, for nat translation table, every group of action list item includes:The source IP address of Intranet and end Number information, and corresponding outer net purpose IP address and port number information.Due to preserving many groups in each flow table List item is acted, the data volume that each flow table is included can be very big, and the flow table being stored in CPU can be caused very to CPU operation Big pressure, influences CPU treatment effeciency, and influences the forward efficiency of packet.
In order to improve the forward efficiency of packet, each flow table that each packet will can be handled in the prior art In corresponding action list item be saved in a rule table entry, and the rule table entry is stored in FPGA-TCAM hardware.But TCAM internal memory typically only has 5M sizes, therefore the size of TCAM memory headrooms will directly affect rule list item size.When Exist substantial amounts of packet need forwarding when, the rule table entry that each packet is required to look up is different, will now be deposited in TCAM Store up substantial amounts of rule table entry.
But, in actual processing data packets, only 20%~30% rule table entry is often made in each rule table entry With remaining 70%~80% rule table entry is rarely used or used once in a while in a certain time of concentration section.But existing The full content for having each rule table entry in technology is all stored in TCAM, and being rarely used in each rule table entry, or The rule table entry used once in a while in a certain time of concentration section will cause the waste of TCAM space resources, in addition, if each rule The space that list item takes is more than the rule table entry being often used in TCAM space, each rule table entry and will be unable to correctly be issued to In TCAM, some packets are caused not to be normally processed.
The content of the invention
In view of the above problems, it is proposed that the present invention so as to provide one kind overcome above mentioned problem or at least in part solve on State a kind of optimization method and device of rule table entry for Message processing of problem.
The embodiments of the invention provide a kind of optimization method of the rule table entry for Message processing, this method includes:
Switching equipment is according to the pending packet received, it is determined that the rule list handled the packet , wherein preserving each action list item handled the packet in the rule table entry;
The packet is handled using the rule table entry of determination, and time used the rule table entry Number is updated;
According to the number of times that each rule table entry is used after renewal, each rule table entry preserved in TCAM is updated.
In order to reduce CPU workload, the quantity of the rule table entry preserved in TCAM is further effectively reduced, in this hair Switching equipment described in bright embodiment is according to the pending packet received, it is determined that the rule handled the packet Then list item includes:
The packet received is sent to TCAM by switching equipment, and TCAM determines the rule handled the packet List item;
It is described that the packet is handled using the rule table entry determined, and the rule table entry is used Number of times be updated including:
The TCAM judges the current rule table entry for itself whether preserving determination;
When itself preserves the rule table entry, the packet is handled using the rule table entry itself preserved, And updated in the number of times locally used the rule table entry;
When itself does not preserve the rule table entry, the packet is sent to CPU, passes through the rule preserved in CPU List item is handled the packet, and CPU is locally updated at it to the number of times that the rule table entry is used.
In order to reduce CPU workload, the quantity of the rule table entry preserved in TCAM, the friendship are further effectively reduced Exchange device is according to the pending packet received, it is determined that the rule table entry handled the packet includes:
The packet received is sent to TCAM by switching equipment, and TCAM determines the rule handled the packet List item;
It is described that the packet is handled using the rule table entry determined, and the rule table entry is used Number of times be updated including:
The TCAM judges the current rule table entry for itself whether preserving determination;
When itself preserves the rule table entry, the packet is handled using the rule table entry itself preserved, And updated in the number of times locally used the rule table entry;
When itself does not preserve the rule table entry, judge whether the quantity of the rule table entry itself preserved is less than setting Amount threshold;
When the quantity for the rule table entry that itself is preserved is less than the amount threshold of setting, to rule table entry described in CPU request, The packet is handled using the rule table entry of request, and the number of times used the rule table entry is carried out more Newly;When the quantity for the rule table entry that itself is preserved is not less than the amount threshold set, the packet is sent to CPU, led to Cross the rule table entry preserved in CPU to handle the packet, and CPU is locally used at it the rule table entry Number of times be updated.
In order to improve the treatment effeciency of packet, it is ensured that the rule table entry preserved in TCAM is the rule more often used List item, reduces TCAM and CPU interaction times, described according to the number of times that each rule table entry is used after renewal, in TCAM Preserve each rule table entry be updated including:
The CPU of switching equipment sends solicited message according to the very first time interval of setting to TCAM, obtains what TCAM was preserved The number of times that each rule table entry is used;
The number of times used according to the TCAM that the receives each rule table entry returned, and itself preserve according to first when Between be spaced the number of times that each rule table entry of renewal is used, according to the order of the number of times used from big to small to each rule List item is ranked up;
The rule table entry of setting quantity before ranking results middle position is rested against is issued in TCAM.
In order to improve the treatment effeciency of packet, it is ensured that the rule table entry preserved in TCAM is the rule more often used List item, reduces TCAM and CPU interaction times, described according to the number of times that each rule table entry is used after renewal, in TCAM Preserve each rule table entry be updated including:
The CPU of switching equipment sends solicited message according to the second time interval of setting to TCAM, obtains what TCAM was preserved The number of times that each rule table entry updated according to the second time interval is used;And
Statistics is in the period of the second time interval, and each rule table entry updated according to very first time interval is each The summation of the number of times used in very first time interval;
The number of times that each rule table entry updated according to the second time interval returned according to the TCAM received is used, The number of times that is used of each rule table entry updated according to the second time interval itself preserved, and statistics according to the very first time The summation for the number of times that each rule table entry that interval updates is used in each very first time interval, according to the number of times used Order from big to small is ranked up to each rule table entry;
The rule table entry of the first quantity before ranking results middle position is rested against is issued in TCAM, and by first quantity The renewal time of rule table entry is set to the second time interval;
Under other rule table entries of the second quantity before ranking results middle position in current very first time interval is rested against TCAM is dealt into, and the renewal time of the rule table entry of second quantity is set to very first time interval, wherein when second Between at intervals of very first time interval integral multiple.
The embodiments of the invention provide a kind of optimization device of the rule table entry for Message processing, described device includes:
Determining module, for according to the pending packet received, it is determined that the rule handled the packet Then list item, wherein preserving each action list item handled the packet in the rule table entry;
Number of times update module, for being handled using the rule table entry determined the packet, and to described The number of times that rule table entry is used is updated;
Entry updating module, it is each to what is preserved in TCAM for according to the number of times that each rule table entry is used after renewal Rule table entry is updated.
In order to reduce CPU workload, the quantity of the rule table entry preserved in TCAM is further effectively reduced, in this hair Determining module described in bright embodiment, specifically for the packet received is sent into TCAM, TCAM is determined to the data Wrap the rule table entry handled;
The number of times update module, specifically for judging the current rule table entry for itself whether preserving determination;When When itself preserves the rule table entry, the packet is handled using the rule table entry itself preserved, and local right The number of times that the rule table entry is used updates;When itself does not preserve the rule table entry, the packet is sent to CPU, is handled the packet by the rule table entry preserved in CPU, and makes CPU local to the rule table entry at it The number of times used is updated.
In order to improve the treatment effeciency of packet, it is ensured that the rule table entry preserved in TCAM is the rule more often used List item, reduction TCAM and CPU interaction times, the determining module, specifically for the packet received is sent into TCAM, TCAM determines the rule table entry handled the packet;
The number of times update module, specifically for judging the current rule table entry for itself whether preserving determination;When When itself preserves the rule table entry, the packet is handled using the rule table entry itself preserved, and local right The number of times that the rule table entry is used updates;When itself does not preserve the rule table entry, the rule list itself preserved is judged Whether the quantity of item is less than the amount threshold of setting;When the quantity of the rule table entry itself preserved is less than the amount threshold of setting When, to rule table entry described in CPU request, the packet is handled using the rule table entry of request, and to described The number of times that rule table entry is used is updated, when amount threshold of the quantity not less than setting of the rule table entry itself preserved When, the packet is sent to CPU, the packet handled by the rule table entry preserved in CPU, and make CPU Locally the number of times that the rule table entry is used is updated at it.
In order to improve the treatment effeciency of packet, it is ensured that the rule table entry preserved in TCAM is the rule more often used List item, reduction TCAM and CPU interaction times, the entry updating module, specifically for the very first time interval according to setting, Solicited message is sent to TCAM, the number of times that each rule table entry of TCAM preservations is used is obtained;TCAM according to receiving is returned The number of times that is used of each rule table entry updated according to very first time interval returned, and itself preserve according between the very first time The number of times used every each rule table entry of renewal, according to the order of the number of times used from big to small to each rule table entry It is ranked up;The rule table entry of setting quantity before ranking results middle position is rested against is issued in TCAM.
In order to improve the treatment effeciency of packet, it is ensured that the rule table entry preserved in TCAM is the rule more often used List item, reduces TCAM and CPU interaction times, and the entry updating module was specifically additionally operable between the second time according to setting Every to TCAM transmission solicited messages, each rule table entry updated according to the second time interval for obtaining TCAM preservations is used Number of times;And count in the period of the second time interval, each rule table entry updated according to very first time interval is every The summation of the number of times used in individual very first time interval;Updated according to what the TCAM received was returned according to the second time interval The number of times that is used of each rule table entry, each rule table entry updated according to the second time interval itself preserved used Number of times, and each rule table entry updated according to very first time interval of statistics used in each very first time interval The summation of number of times, is ranked up according to the order of the number of times used from big to small to each rule table entry;By in ranking results The rule table entry of the first forward quantity of position is issued in TCAM, and by between the renewal time of the rule table entry of first quantity Every being set to the second time interval;The second quantity before ranking results middle position in current very first time interval is rested against its His rule table entry is issued to TCAM, and the renewal time of this group of rule table entry is set into very first time interval, wherein the Two time intervals are the integral multiple at very first time interval.
The embodiments of the invention provide a kind of optimization method and device of the rule table entry for Message processing, in this method Switching equipment is received after pending packet, it is determined that the rule table entry handled the packet, and using the rule After then list item is to processing data packets, the number of times that the rule table entry is used is updated, according to each rule table entry after renewal The number of times used, is updated to the rule table entry preserved in TCAM.Due to each by statistics in embodiments of the present invention The number of times that rule table entry is used, the number of times used according to rule table entry is updated to the rule table entry preserved in TCAM, Therefore the rule table entry being more often used by a user can be preserved in TCAM spaces, so as to reduce the wave of TCAM space resources Take, it is ensured that packet is normally processed.
Described above is only the general introduction of technical solution of the present invention, in order to better understand the technological means of the present invention, And can be practiced according to the content of specification, and in order to allow above and other objects of the present invention, feature and advantage can Become apparent, below especially exemplified by the embodiment of the present invention.
Brief description of the drawings
By reading the detailed description of hereafter preferred embodiment, various other advantages and benefit is common for this area Technical staff will be clear understanding.Accompanying drawing is only used for showing the purpose of preferred embodiment, and is not considered as to the present invention Limitation.And in whole accompanying drawing, identical part is denoted by the same reference numerals.In the accompanying drawings:
Fig. 1 is a kind of optimization process of rule table entry for Message processing provided in an embodiment of the present invention;
Fig. 2 is a kind of optimization process for rule table entry for Message processing that the embodiment of the present invention one is provided;
Fig. 3 is a kind of optimization process for rule table entry for Message processing that the embodiment of the present invention two is provided:
Fig. 4 is a kind of optimization process for rule table entry for Message processing that the embodiment of the present invention three is provided;
Fig. 5 is a kind of optimization process for rule table entry for Message processing that the embodiment of the present invention four is provided;
Fig. 6 is a kind of optimization structure drawing of device of rule table entry for Message processing provided in an embodiment of the present invention.
Embodiment
In order to reduce the waste of TCAM space resources, it is ensured that packet is normally processed, and the embodiments of the invention provide one Plant the optimization method and device of the rule table entry for Message processing.
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although showing the disclosure in accompanying drawing Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here Limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure Complete conveys to those skilled in the art.
With reference to explanation accompanying drawing, the embodiment of the present invention is illustrated.
Fig. 1 is a kind of optimization process of rule table entry for Message processing provided in an embodiment of the present invention, the process bag Include following steps:
S101:Switching equipment is according to the pending packet received, it is determined that the rule handled the packet Then list item, wherein preserving each action list item handled the packet in the rule table entry.
Specifically, switching equipment is received by physical internet ports after pending packet in embodiments of the present invention, will The pending packet is sent to FPGA TCAM processing.TCAM is received after the pending packet, it is determined that pair The rule table entry that the pending packet is handled.
Each action list item to the processing of corresponding data bag is preserved in each rule table entry in embodiments of the present invention, it is each dynamic Make processing of the list item mark to the packet to act, for example, conversion process of address and port numbers etc. is acted, to five-tuple, 12 Processing action of tuple etc..
S102:The packet is handled using the rule table entry of determination, and the rule table entry is made Number of times is updated.
In order to reduce the waste of TCAM space resources in inventive embodiments, it is ensured that packet is normally processed, record is every Whether the number of times that individual rule table entry is used, used, it is determined whether the rule table entry is used according to each rule table entry Number of times be updated.
Specifically, 1000 rule table entries are for example locally saved, when it is determined that using rule table entry A to currently pending When packet is handled, the packet is handled using rule table entry A, and corresponding being made rule table entry A Number of times update, will rule table entry A plus one by the number of times used.
S103:According to the number of times that each rule table entry is used after renewal, each rule table entry preserved in TCAM is carried out Update.
When the time interval of setting arrives, switching equipment counts the number of times that each rule table entry is used, according to each The number of times that rule table entry is used, is updated to each rule table entry preserved in TCAM.
Due to by counting the number of times that each rule table entry is used, being made in embodiments of the present invention according to rule table entry Number of times, is updated to the rule table entry preserved in TCAM, thus can in the case where largely not taking TCAM spaces, The rule table entry being more often used by a user is issued to TCAM, so as to reduce the waste of TCAM space resources, it is ensured that data It is coated with normal process.
In embodiments of the present invention in order to effectively reduce the waste of TCAM space resources, it is ensured that packet is normally located Reason, can preserve some rule table entries being relatively often used in the TCAM of switching equipment, but most rule table entry is still In the CPU of the preserving existence intersection property exchange device.In order to realize the record of the number of times used each rule table entry, the TCAM of switching equipment The number of times that each rule table entry that itself is preserved is used can be updated with CPU.
The rule table entry for setting quantity can be issued to TCAM by CPU first, and the rule table entry of the setting quantity can be CPU is arbitrarily handed down to TCAM, i.e. CPU and any regular list item for setting quantity is issued into TCAM.
When switching equipment receives pending packet by physical internet ports, the pending packet is sent to TCAM, TCAM determine the rule table entry handled the packet.When TCAM locally preserves the rule table entry, using this The rule table entry that ground is preserved is handled the packet, and the number of times used the rule table entry is updated, by this Rule table entry plus one by the number of times used.When TCAM does not locally preserve the rule table entry, in order to realize the place to the packet The packet is sent to CPU by reason, TCAM, sends the packet due to preserving all rule table entries in CPU, therefore working as To after CPU, the rule table entry that CPU is preserved according to itself is handled the packet, and locally the rule table entry is made Number of times is updated, plus one by the number of times used by the rule table entry.
Whether each rule table entry that TCAM and CPU is preserved according to itself is used, and rule of correspondence list item is used Number of times is updated.When the time interval of setting arrives, time that CPU is used according to each rule table entry in itself and TCAM Number, is ranked up to rule table entry, and the rule table entry of the higher setting quantity of access times is updated and arrives TCAM.
Fig. 2 is a kind of optimization process for rule table entry for Message processing that the embodiment of the present invention one is provided, the process Comprise the following steps:
S201:Switching equipment receives pending packet by physical internet ports, and the packet received is sent to TCAM。
S202:TCAM determines the rule table entry handled the packet, wherein being preserved in the rule table entry Each action list item handled the packet.
S203:TCAM judges currently itself whether preserve the rule table entry, when judged result is to be, carries out step S204, otherwise, carries out step S205.
S204:The packet is handled using the rule table entry itself preserved, and locally to the rule table entry The number of times used updates.
S205:The packet is sent to CPU, by the rule table entry that is preserved in CPU to the packet at Reason, and CPU is locally updated at it to the number of times that the rule table entry is used.
S206:At set time intervals, according to the number of times that each rule table entry is used after renewal, to being protected in TCAM Each rule table entry deposited is updated.
In order to reduce the waste of TCAM space resources, it is ensured that packet is normally processed, it can set what is preserved in TCAM The quantity of rule table entry, at the beginning of processing data packets, any rule table entry is not preserved in TCAM.Set when TCAM receives exchange During the pending packet that preparation is sent, it is determined that the rule table entry handled the packet, is judging locally not preserve this During rule table entry, and the quantity of the rule table entry itself preserved, when being less than the amount threshold of setting, TCAM is to the CPU request rule List item, and the packet is handled using the rule table entry of request, and in time locally used the rule table entry Number be updated, will the rule table entry plus one by the number of times used.
The rule table entry is not preserved when TCAM judgements are local, but the quantity of the rule table entry itself preserved is not less than setting During threshold value, the packet is sent to CPU by TCAM, due to preserving all rule table entries in CPU, therefore is worked as the packet It is sent to after CPU, CPU is handled the packet according to rule table entry itself is saved in, and CPU is local to the rule at it The number of times that then list item is used is updated, plus one by the number of times used by the rule table entry.
Fig. 3 is a kind of optimization process for rule table entry for Message processing that the embodiment of the present invention two is provided, the process Comprise the following steps:
S301:Switching equipment receives pending packet by physical internet ports, and the packet received is sent to TCAM。
S302:TCAM determines the rule table entry handled the packet, wherein being preserved in the rule table entry Each action list item handled the packet.
S303:TCAM judges currently itself whether preserve the rule table entry, when judged result is to be, carries out step S304, otherwise, carries out step S305.
S304:The packet is handled using the rule table entry itself preserved, and locally to the rule table entry The number of times used updates.
S305:TCAM judges whether the quantity of the rule table entry itself preserved is less than the amount threshold of setting, when judgement knot Fruit is when being, carries out step S306, otherwise, carries out step S307.
S306:Rule table entry described in TCAM to CPU request, is carried out using the rule table entry of request to the packet Processing, and locally the number of times that the rule table entry is used is being updated.
S307:The packet is sent to CPU by TCAM, and the rule table entry that CPU is preserved according to itself is entered to the packet Row is handled, and CPU is updated in the number of times that its local rule table entry to the processing packet is used.
S308:CPU at set time intervals, according to the number of times that each rule table entry is used after renewal, to TCAM Each rule table entry of middle preservation is updated.
The rule table entry of setting amount threshold can be preserved in the embodiment of the present invention in TCAM, when TCAM is determined to data When the rule table entry that bag is handled is not held in local, and the quantity of the rule table entry locally preserved is less than setting amount threshold When, then the rule table entry that TCAM is handled the packet to CPU request, and will be preserved from the rule table entry of CPU request To local, if follow-up have packet to need using rule table entry processing again, TCAM can be directly using locally preserving Rule table entry processing, without again to CPU request, so as to reduce CPU workload.When not preserving to enter packet in TCAM Row processing rule table entry, and own local preserve rule table entry quantity not less than setting amount threshold when, TCAM The packet is sent to CPU, the rule table entry that CPU is preserved according to itself is handled the packet.
Because the number of times that some rule table entries are used is recorded in TCAM, the number of times record that some rule table entries are used In CPU, the CPU of switching equipment counts the number of times that each rule table entry is used at set time intervals, according to each The number of times that rule table entry is used, is updated to the rule table entry preserved in TCAM.
The CPU of switching equipment can be updated to the rule table entry preserved in TCAM at set time intervals, should Time interval can be for example very first time interval, specifically, according to the number of times that each rule table entry is used after renewal, it is right Each rule table entry preserved in TCAM be updated including:
The CPU of switching equipment sends solicited message according to the very first time interval of setting to TCAM, obtains what TCAM was preserved The number of times that each rule table entry is used;
The number of times used according to the TCAM that the receives each rule table entry returned, and itself preserve according to first when Between be spaced the number of times that each rule table entry of renewal is used, according to the order of the number of times used from big to small to each rule List item is ranked up;
The rule table entry of setting quantity before ranking results middle position is rested against is issued in TCAM.
In embodiments of the present invention the CPU of switching equipment according to setting very first time interval, to the rule preserved in TCAM Then list item is updated.Specifically, when the very first time, interval was arrived, CPU obtains each rule preserved in itself and TCAM The number of times that list item is used.The number of times that a part of rule table entry is used is stored in CPU, and some rule table entry is made Number of times is stored in TCAM, and CPU sends solicited message at each very first time interval to TCAM, obtains what TCAM was preserved The number of times that each rule table entry is used.TCAM is received after the request of CPU transmissions, by each rule table entry locally preserved The number of times used is sent to CPU.
Fig. 4 is a kind of optimization process for rule table entry for Message processing that the embodiment of the present invention three is provided, the process Comprise the following steps:
S401:Switching equipment receives pending packet by physical internet ports, and the packet received is sent to TCAM。
S402:TCAM determines the rule table entry handled the packet, wherein being preserved in the rule table entry Each action list item handled the packet.
S403:TCAM judges currently itself whether preserve the rule table entry, when judged result is to be, carries out step S404, otherwise, carries out step S405.
S404:The packet is handled using the rule table entry itself preserved, and locally to the rule table entry The number of times used updates.
S405:TCAM judges whether the quantity for itself being saved in rule table entry is less than the amount threshold of setting, when judgement knot Fruit is when being, carries out step S406, otherwise, carries out step S407.
S406:Rule table entry described in TCAM to CPU request, is carried out using the rule table entry of request to the packet Handle, and the number of times used the rule table entry is updated.
S407:The packet is sent to CPU by TCAM, and the rule table entry that CPU is preserved according to itself is entered to the packet Row is handled, and CPU is updated in the number of times that its local rule table entry to the processing packet is used.
S408:CPU sends solicited message according to the very first time interval of setting to TCAM, obtains each of TCAM preservations The number of times that rule table entry is used.
S409:The number of times that CPU is used according to the TCAM received each rule table entries returned, and itself preservation are every The number of times that individual rule table entry is used, is ranked up according to the order of the number of times used from big to small to each rule table entry.
S410:The rule table entry of setting quantity before CPU rests against ranking results middle position is issued in TCAM.
In order to improve the treatment effeciency of packet, it is ensured that the rule table entry preserved in TCAM is the rule more often used List item, reduces TCAM and CPU interaction times, in embodiments of the present invention can be stored in the rule table entry more often used In TCAM.Further, since some rule table entries may be used in section of a certain time of concentration once in a while, in order to ensure to be preserved in TCAM Rule table entry, disclosure satisfy that the current demand to Message processing, therefore the very first time can be set in embodiments of the present invention Interval, is regularly updated to the rule table entry preserved in TCAM.
In addition, in embodiments of the present invention in order to further improve the treatment effeciency of packet, it is ensured that preserved in TCAM Rule table entry is the rule table entry more often used, reduces TCAM and CPU interaction times, determines relatively to be often used in rule table entry , and the renewal time for the rule table entry being frequently used is set for the second time interval, by the rule table entry being frequently used Renewal time be set to very first time interval, wherein the second time interval is more than very first time interval, the second time interval is The very first time interval integral multiple.
Specifically, it is described ranking results middle position is rested against before the rule table entry of setting quantity be issued to TCAM and include:
The CPU of switching equipment sends solicited message according to the second time interval of setting to TCAM, obtains what TCAM was preserved The number of times that each rule table entry updated according to the second time interval is used;And
Statistics is in the period of the second time interval, and each rule table entry updated according to very first time interval is each The summation of the number of times used in very first time interval;
The number of times that each rule table entry updated according to the second time interval returned according to the TCAM received is used, The number of times that is used of each rule table entry updated according to the second time interval itself preserved, and statistics according to the very first time The summation for the number of times that each rule table entry that interval updates is used in each very first time interval, according to the number of times used Order from big to small is ranked up to each rule table entry;
The rule table entry of the first quantity before ranking results middle position is rested against is issued in TCAM, and by first quantity The renewal time of rule table entry is set to the second time interval;
Under other rule table entries of the second quantity before ranking results middle position in current very first time interval is rested against TCAM is dealt into, and the renewal time of the rule table entry of second quantity is set to very first time interval, wherein when second Between at intervals of very first time interval integral multiple.
The renewal frequency for the rule table entry being relatively often used can be adjusted to the second time interval through the above way, its In the second time interval be the very first time interval integral multiple, such as can be 3 times, 5 times, 7 times.In addition, in order to right When rule table entry in TCAM is updated, TCAM is set to tell the update cycle of each rule table entry, CPU is issued to TCAM During each rule table entry, the renewal time interval of each rule table entry can be identified, such as 1 represents using very first time interval Update, 0 represents to update using the second time interval.TCAM can also according to renewal time interval difference, divide different rule Then list item storage region, respectively first area and second area, the rule table entry updated according to very first time interval is preserved In the first region, the rule table entry updated according to the second time interval is preserved in the second area.
TCAM is received after each rule table entry that CPU is issued, and itself is preserved using the CPU each rule table entries issued Rule table entry be updated, i.e., the rule table entry issued using this CPU replaces local saved rule table entry, and remembers Record the number of times that each rule table entry is used.
When the very first time, interval was arrived, CPU sends solicited message to TCAM, obtains each according to first of TCAM preservations The number of times that the rule table entry that time interval updates is used.TCAM is received after the solicited message, will locally be preserved according to The number of times that each rule table entry that one time interval updates is used is sent to CPU.CPU receive TCAM transmission according to first The number of times that is used of each rule table entry that time interval updates, and according to being updated according to very first time interval of locally preserving The number of times that each rule table entry is used, counts the number of times that each rule table entry updated according to very first time interval is used, Each rule table entry is ranked up according to the descending order of the number of times used, in ranking results forward first is set The rule table entry of fixed number amount is issued to TCAM, and TCAM is according to the rule table entry received, to locally preserving according to the very first time The rule table entry that interval updates is updated.
When the second time interval arrives, CPU sends solicited message to TCAM, obtains each according to second of TCAM preservations The number of times that the rule table entry that time interval updates is used.TCAM is received after the solicited message, will locally be preserved according to The number of times that each rule table entry that two time intervals update is used is sent to CPU.CPU receive TCAM transmission according to second The number of times that is used of each rule table entry that time interval updates, and according to being updated according to the second time interval of locally preserving The number of times that each rule table entry is used, counts the number of times that each rule table entry updated according to the second time interval is used.
Further, since the second time interval is the integral multiple at very first time interval, it can be considered that at each second Between interlude section include integer very first time interval, according to being counted in each very first time interval according to first The number of times that is used of each rule table entry that time interval updates, it is determined that in the period of second time interval, according to the The summation for the number of times that each rule table entry that one time interval updates is used.Statistics is updated according to second time interval The number of times that each rule table entry is used, and determine in the period of second time interval, according to very first time interval The each rule table entry updated is entered by the summation of access times according to the order of the number of times used from big to small to rule table entry Row sequence, is issued to TCAM, TCAM is according to the rule list received by the rule table entry of the first quantity forward in ranking results , the rule table entry updated according to the second time interval locally preserved is updated.
In addition, because the second time interval is the integral multiple at very first time interval, therefore when according to the second time interval pair When the rule table entry preserved in TCAM is updated, the rule table entry updated according to very first time interval is also updating, therefore will The rule table entry of the second forward quantity of ranking results position is issued to TCAM in current very first time interval, and this second is counted The renewal time of the rule table entry of amount is set to very first time interval, and TCAM is according to the rule table entry received, to local The rule table entry updated according to very first time interval preserved is updated.
Fig. 5 is a kind of optimization process for rule table entry for Message processing that the embodiment of the present invention four is provided, the process Comprise the following steps:
S501:Switching equipment receives pending packet by physical internet ports, and the packet received is sent to TCAM。
S502:TCAM determines the rule table entry handled the packet, wherein being preserved in the rule table entry Each action list item handled the packet.
S503:TCAM judges currently itself whether preserve the rule table entry, when judged result is to be, carries out step S504, otherwise, carries out step S505.
S504:The packet is handled using the rule table entry itself preserved, and locally to the rule table entry The number of times used updates.
S505:TCAM judges whether the quantity for itself being saved in rule table entry is less than the amount threshold of setting, when judgement knot Fruit is when being, carries out step S506, otherwise, carries out step S507.
S506:Rule table entry described in TCAM to CPU request, is carried out using the rule table entry of request to the packet Handle, and the number of times used the rule table entry is updated.
S507:The packet is sent to CPU by TCAM, and the rule table entry that CPU is preserved according to itself is entered to the packet Row is handled, and CPU is updated in the number of times that its local rule table entry to the processing packet is used.
S508:CPU according to setting the second time interval, to TCAM send solicited message, obtain TCAM preserve according to The number of times that each rule table entry that second time interval updates is used.
S509:The each rule table entry updated according to very first time interval of statistics is in the period of the second time interval The summation of the number of times each used in very first time interval.
S510:What each rule table entry updated according to the second time interval returned according to the TCAM received was used Number of times, the number of times that is used of each rule table entry updated according to the second time interval itself preserved, and statistics according to the The summation for the number of times that the rule table entry that one time interval updates is used, according to the order of the number of times used from big to small to every Individual rule table entry is ranked up.
S511:The rule table entry of the first quantity before ranking results middle position is rested against is issued in TCAM, and the group is advised Then the renewal time of list item is set to the second time interval.By position in the ranking results in current very first time interval Other rule table entries of the second forward quantity are issued to TCAM, and the renewal time of this group of rule table entry is set into One time interval, wherein the second time interval is the integral multiple at very first time interval.
Below by a specific embodiment, the present invention is described in detail.
Switching equipment receives IP+ port numbers for 192.168.2.3 by physical port:3456 packet, this is counted TCAM is sent to according to bag, TCAM determines that the packet is sent to outer net IP+ port numbers 236.251.31.35:80, TCAM search this Whether ground preserves the rule table entry for handling the packet, when locally preserving the rule table entry, using the rule locally preserved Then list item handles the packet, and the IP+ port numbers of the packet are replaced with into 236.251.31.35:3536, and it is local should Rule table entry plus 1 by the number of times used.
When not preserving the rule table entry locally, TCAM judges whether the quantity of the rule table entry itself preserved is less than setting Amount threshold (1000), when the quantity of the rule table entry locally preserved is less than the amount threshold of setting, TCAM is to CPU request The rule table entry, after the rule table entry of request is saved in locally, the packet is handled using the rule table entry of preservation, and Locally the rule table entry plus 1 by the number of times used;When quantity of the quantity not less than setting of the rule table entry locally preserved During threshold value, the packet is sent to CPU by TCAM, and the rule table entry that CPU is preserved using itself is handled the packet, The rule table entry handled the packet locally plus 1 by CPU by the number of times used.
CPU according to setting the very first time interval to TCAM send solicited message, obtain TCAM preserve according to first when Between be spaced the number of times that each rule table entry of renewal is used, TCAM is received after the solicited message, will locally preserve according to The number of times that each rule table entry of very first time interval renewal is used is sent to CPU.CPU receive TCAM transmissions according to the The number of times that each rule table entry that one time interval updates is used, and updated according to locally preserving according to very first time interval The number of times that is used of each rule table entry, count time that each rule table entry updated according to very first time interval is used Number, is ranked up according to the descending order of the number of times used to each rule table entry, by ranking results forward the The rule table entry of one setting quantity (1000) is issued to TCAM, and TCAM is according to the rule table entry received, to pressing for locally preserving The rule table entry updated according to very first time interval is updated.
Afterwards, in each very first time interval CPU in the manner described above, the rule table entry preserved in TCAM is carried out more Newly.
Or, two time intervals can also be set, the very first time interval and the second time interval, wherein between the second time The integral multiple at very first time interval is divided into, is updated in rule table entry of each time interval respectively to different frequency of use.
Such as the second time interval is the very first time 3 times of interval.Before first the second time interval arrives, it can deposit Two the very first time interval.For the two interval, when being arrived at each very first time interval, CPU is to TCAM the very first times Solicited message is sent, the number of times used according to each rule table entry of very first time interval renewal that TCAM is preserved is obtained, TCAM is received after the solicited message, and each rule table entry updated according to very first time interval locally preserved is used Number of times is sent to CPU.CPU receives time that each rule table entry updated according to very first time interval of TCAM transmissions is used Number, and the number of times that each rule table entry updated according to locally preserving according to very first time interval is used, statistics is according to the The number of times that each rule table entry that one time interval updates is used, according to the descending order of the number of times used to each Rule table entry is ranked up, and the rule table entry of the first setting quantity (1000) forward in ranking results is issued into TCAM, TCAM is updated according to the rule table entry received to the rule table entry updated according to very first time interval locally preserved.
During the 3rd very first time interval arrival, when being also first the second time interval arrival, CPU is sent to TCAM please Information is sought, the number of times used according to each rule table entry of very first time interval renewal that TCAM is preserved is obtained, according to TCAM The number of times that is used of each rule table entry returned, very first time for itself preserving in interval each rule table entry used The summation for the number of times that each rule table entry is used in number of times, three very first time intervals of statistics, according to each rule table entry quilt The summation of access times, is ranked up to rule table entry, the first quantity (the 1st~200) before ranking results middle position is rested against Rule table entry is issued in TCAM, and the renewal time of the rule table entry of first quantity is set into the second time interval.And The rule table entry of (the 201st~1000) of the second quantity before the ranking results middle position is rested against is issued to TCAM, by this second The renewal time of the rule table entry of quantity is set to very first time interval.
Or, because also having counted each according to the rule table entry updated between the very first time at current very first time interval The number of times used, therefore it is directed to the second quantity before the ranking results middle position of the current very first time time interval is rested against (800) other rule table entries are issued to TCAM, and the renewal time of the rule table entry of second quantity is set into One time interval., may the forward rule list in the current position gone out in very first time interval stats due to during statistics , the rule table entry updated with being issued in TCAM according to the second time interval is identical, therefore it is determined that between the current very first time When the rule table entry of the second quantity before ranking results middle position is rested against, it is confirmed that the rule list determined with the second time interval Item is different.
For example, the first quantity is 200, the second quantity is 800, the 1st~200 rule before ranking results middle position is rested against List item is issued to TCAM, is set into the second time interval, CPU is according to current the renewal time of 200 rule table entries Determine that 800 other rule table entries are issued to TCAM in the ranking results of one time interval, by the renewal of 800 rule table entries Set of time is very first time interval, it is determined that during 800 other rule table entries, according to the position in ranking results, in the past Search the rule table entries different from the rule table entry that the second time interval updates successively backward, find out 800 rule table entries, i.e., The rule table entry updated for the use very first time interval of determination.
Each very first time interval after only updates the rule table entry of the second quantity, between each second time Every the rule table entry for updating the first quantity.Even if the rule table entry updated according to the second time interval preserved in TCAM is first Quantity, it is the second quantity to make the rule table entry updated according to the second time interval preserved in TCAM.
Due to by counting the number of times that each rule table entry is used, being made in embodiments of the present invention according to rule table entry Number of times, is updated to the rule table entry preserved in TCAM, thus can in the case where largely not taking TCAM spaces, The rule table entry being more often used by a user is preserved, so as to reduce the waste of TCAM space resources, it is ensured that packet is normal Processing.
Fig. 6 is a kind of optimization structure drawing of device of rule table entry for Message processing provided in an embodiment of the present invention, institute Stating device includes:
Determining module 61, the pending packet received for basis, it is determined that the packet is handled Rule table entry, wherein preserving each action list item handled the packet in the rule table entry;
Number of times update module 62, for being handled using the rule table entry determined the packet, and to institute The number of times that rule table entry used is stated to be updated;
Entry updating module 63, for according to the number of times that each rule table entry is used after renewal, to what is preserved in TCAM Each rule table entry is updated.
In order to reduce CPU workload, the quantity of the rule table entry preserved in TCAM is further effectively reduced, in this hair Determining module 61 described in bright embodiment, specifically for the packet received is sent into TCAM, TCAM is determined to the number The rule table entry handled according to bag;
The number of times update module 62, specifically for judging the current rule table entry for itself whether preserving determination; When itself preserves the rule table entry, the packet is handled using the rule table entry itself preserved, and local The number of times used the rule table entry updates;When itself does not preserve the rule table entry, the packet is sent to CPU, is handled the packet by the rule table entry preserved in CPU, and makes CPU local to the rule table entry at it The number of times used is updated.
In order to improve the treatment effeciency of packet, it is ensured that the rule table entry preserved in TCAM is the rule more often used List item, reduces TCAM and CPU interaction times, the determining module 61, specifically for the packet received is sent to TCAM, TCAM determine the rule table entry handled the packet;
The number of times update module 62, specifically for judging the current rule table entry for itself whether preserving determination; When itself preserves the rule table entry, the packet is handled using the rule table entry itself preserved, and local The number of times used the rule table entry updates;When itself does not preserve the rule table entry, the rule itself preserved is judged Whether the quantity of list item is less than the amount threshold of setting;When the quantity of the rule table entry itself preserved is less than the amount threshold of setting When, to rule table entry described in CPU request, the packet is handled using the rule table entry of request, and to described The number of times that rule table entry is used is updated, when amount threshold of the quantity not less than setting of the rule table entry itself preserved When, the packet is sent to CPU, the packet handled by the rule table entry preserved in CPU, and make CPU Locally the number of times that the rule table entry is used is updated at it.
In order to improve the treatment effeciency of packet, it is ensured that the rule table entry preserved in TCAM is the rule more often used List item, reduces TCAM and CPU interaction times, the entry updating module 63, specifically between the very first time according to setting Every to TCAM transmission solicited messages, each rule table entry updated according to very first time interval for obtaining TCAM preservations is used Number of times;The number of times used according to the TCAM that the receives each rule table entry returned, and itself preserve according to first when Between be spaced the number of times that each rule table entry of renewal is used, according to the order of the number of times used from big to small to each rule List item is ranked up;The rule table entry of setting quantity before ranking results middle position is rested against is issued in TCAM.
In order to improve the treatment effeciency of packet, it is ensured that the rule table entry preserved in TCAM is the rule more often used List item, reduces TCAM and CPU interaction times, and the entry updating module 63 is specifically additionally operable to the second time according to setting Interval, solicited message is sent to TCAM, is obtained each rule table entry updated according to the second time interval of TCAM preservations and is made Number of times;And count in the period of the second time interval, each rule table entry updated according to very first time interval exists The summation of the number of times each used in very first time interval;According to the TCAM that receives return according to the second time interval more The number of times that new each rule table entry is used, each rule table entry updated according to the second time interval itself preserved is made Number of times, and each rule table entry updated according to very first time interval of statistics are used in each very first time interval Number of times summation, each rule table entry is ranked up according to the order of the number of times used from big to small;By ranking results The rule table entry of the first quantity before middle position is rested against is issued in TCAM, and by the renewal time of the rule table entry of first quantity It is set to the second time interval;The second quantity before ranking results middle position in current very first time interval is rested against Other rule table entries are issued to TCAM, and the renewal time of this group of rule table entry is set into very first time interval, wherein Second time interval is the integral multiple at very first time interval.
The embodiments of the invention provide a kind of optimization method and device of the rule table entry for Message processing, in this method Switching equipment is received after pending packet, it is determined that the rule table entry handled the packet, and using the rule After then list item is to processing data packets, the number of times that the rule table entry is used is updated, according to each rule table entry after renewal The number of times used, is updated to the rule table entry preserved in TCAM.Due to each by statistics in embodiments of the present invention The number of times that rule table entry is used, the number of times used according to rule table entry is updated to the rule table entry preserved in TCAM, Therefore the rule table entry being more often used by a user can be preserved, in the case where largely not taking TCAM spaces so as to drop The waste of low TCAM space resources, it is ensured that packet is normally processed.
Algorithm and display be not inherently related to any certain computer, virtual system or miscellaneous equipment provided herein. Various general-purpose systems can also be used together with based on teaching in this.As described above, construct required by this kind of system Structure be obvious.In addition, the present invention is not also directed to any certain programmed language.It is understood that, it is possible to use it is various Programming language realizes the content of invention described herein, and the description done above to language-specific is to disclose this hair Bright preferred forms.
In the specification that this place is provided, numerous specific details are set forth.It is to be appreciated, however, that the implementation of the present invention Example can be put into practice in the case of these no details.In some instances, known method, structure is not been shown in detail And technology, so as not to obscure the understanding of this description.
Similarly, it will be appreciated that in order to simplify the disclosure and help to understand one or more of each inventive aspect, exist Above in the description of the exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes In example, figure or descriptions thereof.However, the method for the disclosure should be construed to reflect following intention:It is i.e. required to protect The application claims of shield features more more than the feature being expressly recited in each claim.More precisely, such as following Claims reflect as, inventive aspect is all features less than single embodiment disclosed above.Therefore, Thus the claims for following embodiment are expressly incorporated in the embodiment, wherein each claim is in itself All as the separate embodiments of the present invention.
Those skilled in the art, which are appreciated that, to be carried out adaptively to the module in the equipment in embodiment Change and they are arranged in one or more equipment different from the embodiment.Can be the module or list in embodiment Member or component be combined into a module or unit or component, and can be divided into addition multiple submodule or subelement or Sub-component.In addition at least some in such feature and/or process or unit exclude each other, it can use any Combination is disclosed to all features disclosed in this specification (including adjoint claim, summary and accompanying drawing) and so to appoint Where all processes or unit of method or equipment are combined.Unless expressly stated otherwise, this specification (including adjoint power Profit is required, summary and accompanying drawing) disclosed in each feature can or similar purpose identical, equivalent by offer alternative features come generation Replace.
Although in addition, it will be appreciated by those of skill in the art that some embodiments described herein include other embodiments In included some features rather than further feature, but the combination of the feature of be the same as Example does not mean in of the invention Within the scope of and form different embodiments.For example, in the following claims, times of embodiment claimed One of meaning mode can be used in any combination.
The present invention all parts embodiment can be realized with hardware, or with one or more processor run Software module realize, or realized with combinations thereof.It will be understood by those of skill in the art that can use in practice Microprocessor or digital signal processor (DSP) realize the rule table entry for Message processing according to embodiments of the present invention Optimization device in some or all parts some or all functions.The present invention is also implemented as being used to perform this In described method some or all equipment or program of device (for example, computer program and computer program Product).Such program for realizing the present invention can be stored on a computer-readable medium, or can have one or many The form of individual signal.Such signal can be downloaded from internet website and obtained, either on carrier signal provide or with Any other form is provided.
It should be noted that the present invention will be described rather than limits the invention for above-described embodiment, and ability Field technique personnel can design alternative embodiment without departing from the scope of the appended claims.In the claims, Any reference symbol between bracket should not be configured to limitations on claims.Word "comprising" is not excluded the presence of not Element or step listed in the claims.Word "a" or "an" before element does not exclude the presence of multiple such Element.The present invention can be by means of including the hardware of some different elements and coming real by means of properly programmed computer It is existing.In if the unit claim of equipment for drying is listed, several in these devices can be by same hardware branch To embody.The use of word first, second, and third does not indicate that any order.These words can be explained and run after fame Claim.
Obviously, those skilled in the art can carry out the essence of various changes and modification without departing from the present invention to the present invention God and scope.So, if these modifications and variations of the present invention belong to the scope of the claims in the present invention and its equivalent technologies Within, then the present invention is also intended to comprising including these changes and modification.

Claims (8)

1. the optimization method of a kind of rule table entry for Message processing, it is characterised in that this method includes:
Switching equipment is according to the pending packet received, it is determined that the rule table entry handled the packet, its Described in preserve each action list item handled the packet in rule table entry;
The packet is handled using the rule table entry of determination, and the number of times used the rule table entry enters Row updates;
According to the number of times that each rule table entry is used after renewal, each rule table entry preserved in TCAM is updated, specifically For:The CPU of switching equipment according to setting very first time interval, to TCAM send solicited message, obtain TCAM preserve according to The number of times that each rule table entry of very first time interval renewal is used;The each rule table entry returned according to the TCAM received The number of times used, and the number of times that each rule table entry updated according to very first time interval itself preserved is used, according to The order of the number of times used from big to small is ranked up to each rule table entry;Setting number before ranking results middle position is rested against The rule table entry of amount is issued in TCAM.
2. the method as described in claim 1, it is characterised in that the switching equipment is according to the pending data received Bag, it is determined that the rule table entry handled the packet includes:
The packet received is sent to TCAM by switching equipment, and TCAM determines the rule list handled the packet ;
It is described that the packet is handled using the rule table entry determined, and time used the rule table entry Number be updated including:
The TCAM judges the current rule table entry for itself whether preserving determination;
When itself preserves the rule table entry, using the rule table entry processing packet itself preserved, and The local number of times used the rule table entry updates;
When itself does not preserve the rule table entry, the packet is sent to CPU, passes through the rule table entry preserved in CPU The packet is handled, and CPU is locally updated at it to the number of times that the rule table entry is used.
3. the method as described in claim 1, it is characterised in that the switching equipment is according to the pending data received Bag, it is determined that the rule table entry handled the packet includes:
The packet received is sent to TCAM by switching equipment, and TCAM determines the rule list handled the packet ;
It is described that the packet is handled using the rule table entry determined, and time used the rule table entry Number be updated including:
The TCAM judges the current rule table entry for itself whether preserving determination;
When itself preserves the rule table entry, using the rule table entry processing packet itself preserved, and The local number of times used the rule table entry updates;
When itself does not preserve the rule table entry, judge whether the quantity of the rule table entry itself preserved is less than the quantity of setting Threshold value;
When the quantity for the rule table entry that itself is preserved is less than the amount threshold of setting, to rule table entry described in CPU request, use The rule table entry of request is handled the packet, and the number of times used the rule table entry is updated; When the quantity for the rule table entry that itself is preserved is not less than the amount threshold set, the packet is sent to CPU, passed through The rule table entry preserved in CPU is handled the packet, and makes what CPU was locally used the rule table entry at it Number of times is updated.
4. the method as described in claim 1, it is characterised in that time used according to each rule table entry after renewal Number, each rule table entry preserved in TCAM is updated including:
The CPU of switching equipment according to setting the second time interval, to TCAM send solicited message, obtain TCAM preserve according to The number of times that each rule table entry that second time interval updates is used;And
Statistics is in the period of the second time interval, and each rule table entry updated according to very first time interval is each first The summation of the number of times used in time interval;
The number of times that each rule table entry updated according to the second time interval returned according to the TCAM received is used, itself The number of times that is used of each rule table entry updated according to the second time interval preserved, and statistics according to very first time interval The summation of number of times that each rule table entry updated is used in each very first time interval, according to the number of times used from big Each rule table entry is ranked up to small order;
The rule table entry of the first quantity before ranking results middle position is rested against is issued in TCAM, and by the rule of first quantity The renewal time of list item is set to the second time interval;
Other rule table entries of the second quantity before ranking results middle position in current very first time interval is rested against are issued to TCAM, and the renewal time of the rule table entry of second quantity is set to very first time interval, wherein between the second time It is divided into the integral multiple at very first time interval.
5. the optimization device of a kind of rule table entry for Message processing, it is characterised in that described device includes:
Determining module, for according to the pending packet received, it is determined that the rule list handled the packet , wherein preserving each action list item handled the packet in the rule table entry;
Number of times update module, for being handled using the rule table entry determined the packet, and to the rule The number of times that list item is used is updated;
Entry updating module, for according to the number of times that each rule table entry is used after renewal, to each rule preserved in TCAM List item is updated, wherein, the entry updating module, specifically for the very first time interval according to setting, is sent to TCAM Solicited message, obtains the number of times used according to each rule table entry of very first time interval renewal that TCAM is preserved;According to connecing The number of times that each rule table entry that the TCAM that receives is returned is used, and itself preserve according to very first time interval update it is every The number of times that individual rule table entry is used, is ranked up according to the order of the number of times used from big to small to each rule table entry; The rule table entry of setting quantity before ranking results middle position is rested against is issued in TCAM.
6. device as claimed in claim 5, it is characterised in that the determining module, specifically for by the packet received TCAM is sent to, TCAM determines the rule table entry handled the packet;
The number of times update module, specifically for judging the current rule table entry for itself whether preserving determination;When itself When preserving the rule table entry, the packet is handled using the rule table entry itself preserved, and locally to described The number of times that rule table entry is used updates;When itself does not preserve the rule table entry, the packet is sent to CPU, led to Cross the rule table entry preserved in CPU to handle the packet, and CPU is locally used at it the rule table entry Number of times be updated.
7. device as claimed in claim 5, it is characterised in that the determining module, specifically for by the packet received TCAM is sent to, TCAM determines the rule table entry handled the packet;
The number of times update module, specifically for judging the current rule table entry for itself whether preserving determination;When itself When preserving the rule table entry, the packet is handled using the rule table entry itself preserved, and locally to described The number of times that rule table entry is used updates;When itself does not preserve the rule table entry, the rule table entry of itself preservation is judged Whether quantity is less than the amount threshold of setting;When the quantity for the rule table entry that itself is preserved is less than the amount threshold of setting, to Rule table entry described in CPU request, is handled the packet using the rule table entry of request, and to the rule list The number of times that item is used is updated, when the quantity for the rule table entry that itself is preserved is not less than the amount threshold set, by institute State packet and be sent to CPU, the packet is handled by the rule table entry preserved in CPU, and make CPU local at its The number of times that the rule table entry is used is updated.
8. device as claimed in claim 5, it is characterised in that the entry updating module, is specifically additionally operable to according to setting Second time interval, solicited message is sent to TCAM, obtains each rule updated according to the second time interval that TCAM is preserved The number of times that list item is used;And count in the period of the second time interval, each rule updated according to very first time interval The then summation for the number of times that list item is used in each very first time interval;During according to the TCAM returns received according to second Between be spaced the number of times that each rule table entry of renewal is used, itself preserve according to the second time interval update each rule The number of times that list item is used, and each rule table entry updated according to very first time interval counted is at each very first time interval The summation of the middle number of times used, is ranked up according to the order of the number of times used from big to small to each rule table entry;Will The rule table entry of the first quantity before ranking results middle position is rested against is issued in TCAM, and by the rule table entry of first quantity Renewal time is set to the second time interval;Before ranking results middle position in current very first time interval is rested against Other rule table entries of two quantity are issued to TCAM, and the renewal time of the rule table entry of second quantity is set into One time interval, wherein the second time interval is the integral multiple at very first time interval.
CN201410638579.4A 2014-11-06 2014-11-06 A kind of optimization method and device of rule table entry for Message processing Active CN104363177B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201410638579.4A CN104363177B (en) 2014-11-06 2014-11-06 A kind of optimization method and device of rule table entry for Message processing
PCT/CN2014/092780 WO2016070478A1 (en) 2014-11-06 2014-12-02 Rule table entry optimization method and apparatus for message processing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410638579.4A CN104363177B (en) 2014-11-06 2014-11-06 A kind of optimization method and device of rule table entry for Message processing

Publications (2)

Publication Number Publication Date
CN104363177A CN104363177A (en) 2015-02-18
CN104363177B true CN104363177B (en) 2017-10-10

Family

ID=52530404

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410638579.4A Active CN104363177B (en) 2014-11-06 2014-11-06 A kind of optimization method and device of rule table entry for Message processing

Country Status (2)

Country Link
CN (1) CN104363177B (en)
WO (1) WO2016070478A1 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107786447B (en) * 2017-11-09 2020-06-16 锐捷网络股份有限公司 Message forwarding method and device based on FPGA
CN109842557B (en) * 2017-11-28 2021-06-11 英业达科技有限公司 Method and switch for managing flow rule table
CN108616587B (en) * 2018-04-24 2022-01-25 新华三技术有限公司 Table item synchronization method and device and network equipment
CN110191014B (en) * 2019-05-20 2021-01-26 杭州迪普信息技术有限公司 Method and device for counting hit times of rule table entries
CN116915703B (en) * 2023-09-13 2023-12-08 中移(苏州)软件技术有限公司 Table item expelling method and device and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101388110A (en) * 2008-10-31 2009-03-18 深圳市同洲电子股份有限公司 Data rapidly-reading method and apparatus
EP2597831A1 (en) * 2011-11-22 2013-05-29 Telefonaktiebolaget LM Ericsson (PUBL) Mechanism for packet forwarding using switch pools in flow- based, split-architecture networks
CN103200101A (en) * 2013-04-15 2013-07-10 昆山天元昌电子有限公司 Method and device of open flow multi-table inquiry based on exchange chip
CN103973571A (en) * 2013-02-05 2014-08-06 中兴通讯股份有限公司 Network processor and routing searching method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101883055B (en) * 2010-07-19 2013-11-20 福建星网锐捷网络有限公司 Capacity expansion realization method and device of routing forwarding table and switching device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101388110A (en) * 2008-10-31 2009-03-18 深圳市同洲电子股份有限公司 Data rapidly-reading method and apparatus
EP2597831A1 (en) * 2011-11-22 2013-05-29 Telefonaktiebolaget LM Ericsson (PUBL) Mechanism for packet forwarding using switch pools in flow- based, split-architecture networks
CN103973571A (en) * 2013-02-05 2014-08-06 中兴通讯股份有限公司 Network processor and routing searching method
CN103200101A (en) * 2013-04-15 2013-07-10 昆山天元昌电子有限公司 Method and device of open flow multi-table inquiry based on exchange chip

Also Published As

Publication number Publication date
CN104363177A (en) 2015-02-18
WO2016070478A1 (en) 2016-05-12

Similar Documents

Publication Publication Date Title
CN104363177B (en) A kind of optimization method and device of rule table entry for Message processing
US20200336370A1 (en) Consistent hashing for network traffic dispatching
Rautureau et al. Vulnerability of animal trade networks to the spread of infectious diseases: a methodological approach applied to evaluation and emergency control strategies in cattle, France, 2005
CN104283806B (en) Business chain processing method and equipment
CN104468365B (en) A kind of method, system and device for obtaining equipment room topological connection relation
US20190116133A1 (en) Ruled-based network traffic interception and distribution scheme
CN107908690A (en) A kind of data processing method based on big data OA operation analysis
CN106529682A (en) Method and apparatus for processing deep learning task in big-data cluster
CN104408169B (en) Dimension querying method and device based on Multidimensional Expressions language
US20140215492A1 (en) Dynamic provisioning of message groups
CN106416197A (en) Method and system for load balancing anycast data traffic
CN106411778B (en) The method and device of data forwarding
CN102314336B (en) A kind of data processing method and system
CN106202324A (en) The data processing method of a kind of real-time calculating platform and device
CN104994171A (en) Distributed storage method and system
CN103605756B (en) Data processing method and device for on-line analytical processing
CN104537304B (en) File checking and killing method, device and system
CN106570097A (en) Sequence generating method and device
CN111382114B (en) Data transmission method and device for network on chip and electronic equipment
CN103530337B (en) Identify the device and method of Invalid parameter in uniform resource position mark URL
CN104009924B (en) Message processing method and device based on TCAM and FPGA
EP3100436B1 (en) Maintaining routing information for a distributed service provided by service instances
CN109495435A (en) The firewall update method and device of server
CN105630583A (en) Data processing method and device
CN103793509B (en) Group figure grasping means and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant