WO2014205883A1 - 表项添加方法和交换机 - Google Patents
表项添加方法和交换机 Download PDFInfo
- Publication number
- WO2014205883A1 WO2014205883A1 PCT/CN2013/080021 CN2013080021W WO2014205883A1 WO 2014205883 A1 WO2014205883 A1 WO 2014205883A1 CN 2013080021 W CN2013080021 W CN 2013080021W WO 2014205883 A1 WO2014205883 A1 WO 2014205883A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- meter
- group
- entries
- controller
- importance
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 51
- 238000012545 processing Methods 0.000 abstract description 12
- 230000009286 beneficial effect Effects 0.000 abstract description 7
- 238000010586 diagram Methods 0.000 description 13
- 230000000875 corresponding effect Effects 0.000 description 7
- 238000005259 measurement Methods 0.000 description 4
- 230000032683 aging Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000006467 substitution reaction Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/04—Processing captured monitoring data, e.g. for logfile generation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/64—Hybrid switching systems
- H04L12/6418—Hybrid transport
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/06—Generation of reports
- H04L43/062—Generation of reports related to network traffic
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/21—Flow control; Congestion control using leaky-bucket
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/54—Organization of routing tables
Definitions
- the present invention relates to the field of communications technologies, and in particular, to an entry adding method and a switch. Background technique
- OpenFlow is a typical network device architecture with separate control and forwarding, and has attracted widespread attention.
- the switch In OpenFlow, the switch is connected to the controller (Controller) through a secure channel. In OpenFlow, the switch maintains three tables: flow tables, group tables, and meters.
- the flow table is the core data structure of the switch for forwarding policy control
- the group table is used to implement the core data structure of actions such as multicast, broadcast, or load balancing.
- the meter is used to implement quality of service (Quality of Service; hereinafter referred to as: QoS)
- QoS Quality of Service
- the switch is responsible for querying and managing flow tables, group tables, and meters.
- OpenFlow group entry can be as shown in Table 1.
- the controller adds a group entry to the switch through the OFPT_GROUP_MOD (OFPGC_ADD) message. If the addition is unsuccessful, the switch will return an error message (ofp_error_msg) and indicate the type of OFPET_ GROUP_MOD-FAILED and the corresponding code (where the group entry overflows back to the OFPGMFC-OUT-OF- GROUPS code; The action bucket overflows back to the OFPMUMC—OUT— OF—BUCKETS code).
- OFPT_GROUP_MOD OFPT_GROUP_MOD
- the controller can also add meter entries to the switch by sending a message. If the addition is unsuccessful, the switch returns an error message (ofp_error_msg) with the type and corresponding code.
- the group entry has no aging mechanism of the entry, so it is easy to cause the group to overflow.
- the meter entry also has no aging mechanism for the entry, which is likely to cause the meter to overflow.
- the controller sends a group entry, it does not know whether the group table is full. Only after receiving the error message sent by the switch, the controller can know that the group table is full, and then the corresponding processing will be performed.
- the controller sends the meter item, it does not know whether the meter is full. Only after receiving the error message sent by the switch, the controller can know that the meter is full, and then the corresponding processing will be performed.
- the embodiment of the invention provides an entry adding method and a switch.
- a first aspect of the embodiments of the present invention provides a method for adding an entry, including:
- the switch receives the first group of entries sent by the controller, where the first group of entries carries the importance indication information of the first group of entries, and the importance indication information of the first group of entries is used to indicate the location
- the switch determines that the first group of entries cannot be added to the group table, the switch determines whether a second group entry exists in the group table, and the second group table carries the second group table
- the importance indication information of the item is used to indicate the importance of the second group of entries, wherein the second group of entries is less important than the first
- the importance of the set of entries, the second set of entries includes a second action bucket; the number of the first action buckets is not greater than a sum of the first value and the number of the second action buckets, the first The value is the number of action buckets available in the group table;
- the switch deletes the second group entry, and adds the first group entry to the group table.
- the determining, by the switch, that the first group of entries cannot be added to the group table includes:
- the switch determines that there is no idle group entry in the group table or the number of the first action bucket is greater than the first value.
- the switch determines that the first group of entries cannot be added to the group table, The method further includes: when the switch determines that the number of idle group entries in the group table is greater than a preset upper limit of the group table, the switch sends a first message to the controller to notify the controller The number of the idle group entries in the group table is greater than the upper limit of the group table balance; when the switch determines that the number of idle group entries in the group table is less than a preset lower limit of the group table balance, Transmitting, by the switch, the second message to the controller, to notify the controller that the number of idle group entries in the group table is less than a lower limit of the group table balance;
- the switch determines that the remaining space of the action bucket in the group table is greater than a preset action bucket remaining amount upper limit
- the switch sends a third message to the controller to notify the controller of the group table.
- the remaining space of the action bucket is greater than the upper limit of the action bucket; when the switch determines that the remaining space of the action bucket in the group table is less than a preset lower limit of the action bucket, the switch sends the And the four messages are used to notify the controller that the remaining space of the action bucket in the group table is smaller than the lower limit of the action bucket.
- a second aspect of the present invention provides a method for adding an entry, including:
- the switch receives the first meter entry sent by the controller, where the first meter entry carries the importance indication information of the first meter entry, and the importance indicator information of the first meter entry is used to indicate the location
- the importance of the first meter item, the first meter item includes a first metering band;
- the switch determines that the first meter cannot be added to the meter, the switch determines whether a second meter exists in the meter, and the second meter carries the second meter
- the importance indication information of the item is used to indicate the importance of the second meter item, wherein the second meter item is less important than the first item
- the importance of a meter item, the second meter item includes a second metering strip; the number of the first metering strip is not greater than a sum of the first value and the number of the second metering strip, the first The value is the number of metering bands available in the meter;
- the switch When the second meter entry exists in the meter, the switch deletes the second meter entry, and adds the first meter entry to the meter.
- the determining, by the switch, that the first meter cannot be added to the meter includes: The switch determines that there is no idle meter entry in the meter or the number of the first metering band is greater than the first value.
- the importance indication information of the first The entry field, metering ID field, or new field of the entry is not limited to the second aspect or the first possible implementation manner of the second aspect.
- the switch determines that the first meter cannot be added to the meter, Also includes:
- the switch determines that the number of idle meter entries in the meter is greater than a preset upper limit of the meter, the switch sends a first message to the controller to notify the controller of the metering
- the number of idle meter entries in the table is greater than the upper limit of the meter balance; when the switch determines that the number of idle meter entries in the meter is less than a preset lower limit of the meter, the switch The controller sends a second message to notify the controller that the number of idle meter entries in the meter is less than a lower limit of the meter margin; and/or, when the switch determines the meter
- the switch sends a third message to the controller to notify the controller that the remaining space of the metering tape in the meter is greater than the metering band An upper limit of the balance; when the switch determines that the remaining space of the metering band in the meter is less than a preset lower limit of the meter
- a third aspect of the embodiments of the present invention provides a switch, including:
- a receiving module configured to receive a first group of entries sent by the controller, where the first group of entries carries the importance indication information of the first group of entries, and the importance indication information of the first group of entries
- the first group of entries includes a first action bucket
- the determining module is configured to determine that the first group of entries cannot be added in the group table, and Whether the second set of entries exists in the group table, the second set of entries carries the importance indication information of the second set of entries, and the importance indication information of the second set of entries is used to indicate the The importance of the second set of entries, wherein the second set of entries is less important than the first set of entries, and the second set of entries includes the second action bucket;
- the number of the first action buckets is not greater than the sum of the first value and the number of the second action buckets, and the first value is an action available in the group table The number of barrels;
- an adding module configured to: when the determining module determines that the second group entry exists in the group table, delete the second group entry, and add the first group entry to the group table in.
- the determining module is specifically configured to determine that the idle group entry or the number of the first action buckets in the group table is greater than Said the first value.
- the switch further includes: a sending module
- the sending module is configured to: before the determining module determines that the first group of entries cannot be added in the group table, when the determining module determines that the number of idle group entries in the group table is greater than a preset Sending a first message to the controller to notify the controller that the number of idle group entries in the group table is greater than the upper limit of the group table margin; when the determining module determines When the number of the idle group entries in the group table is less than the preset lower limit of the group table, the second message is sent to the controller to notify the controller of the idle group entries in the group table.
- the number is less than the lower limit of the group table; and/or
- the sending module is configured to: before the determining module determines that the first group of entries cannot be added in the group table, when the determining module determines that the remaining space of the action bucket in the group table is greater than a preset action bucket Sending a third message to the controller to notify the controller that the remaining space of the action bucket in the group table is greater than the action bucket remaining amount upper limit; when the determining module determines the group table When the remaining space of the middle action bucket is less than the preset lower limit of the action bucket, the fourth message is sent to the controller to notify the controller that the remaining space of the action bucket in the group table is smaller than the lower limit of the action bucket.
- a fourth aspect of the present invention provides a switch, including:
- a receiving module configured to receive a first meter that is sent by the controller, where the first meter carries the importance indication information of the first meter, and the importance indicator of the first meter Used to indicate the importance of the first meter item, where the first meter item includes a first metering band;
- a determining module configured to determine that the first meter item cannot be added to the meter, and determining whether a second meter item exists in the meter, where the second meter carries the second meter
- the importance indication information of the item, the importance indication information of the second meter item is used for Instructing the importance of the second meter item, wherein the second meter item is less important than the first meter item, and the second meter item includes a second metering band;
- the number of the first metering belt is not greater than a sum of the first value and the number of the second metering belt, and the first value is the number of metering belts available in the meter;
- Adding a module when the determining module determines that the second meter item exists in the meter, deleting the second meter item, and adding the first meter item to the meter in.
- the determining module is specifically configured to determine that the idle meter item does not exist in the meter, or the number of the first metering band is greater than Said the first value.
- the switch further includes: a sending module
- the sending module is configured to: before the determining module determines that the first meter cannot be added to the meter, the determining module determines that the number of idle meter items in the meter is greater than a preset Sending a first message to the controller to notify the controller that the number of idle meter entries in the meter is greater than an upper limit of the meter margin; when the determining module determines When the number of the idle meter entries in the meter is less than the preset lower limit of the meter, the second message is sent to the controller to notify the controller of the idle meter entries in the meter. The number is less than the lower limit of the gauge; and/or
- the sending module is configured to: before the determining module determines that the first meter cannot be added to the meter, the determining module determines that a remaining space of the metering band in the meter is greater than a preset metering band Sending a third message to the controller to notify the controller that the remaining space of the metering tape in the meter is greater than the metering belt margin upper limit; when the determining module determines the meter When the remaining space of the middle metering belt is less than the preset lower limit of the metering belt margin, the fourth message is sent to the controller to notify the controller that the remaining space of the metering belt in the meter is less than the lower limit of the metering belt margin.
- a fifth aspect of the embodiments of the present invention provides a switch, including: a transmitter, a receiver, a memory, and a processor respectively connected to the transmitter, the receiver, and the memory; the receiver, configured to receive The first group of entries sent by the controller, the first group of entries carrying the importance indication information of the first group of entries, and the importance indication information of the first group of entries
- the information is used to indicate the importance of the first group of entries, the first group of entries includes a first action bucket
- the memory is configured to store program code; when the program code is executed, the processing is performed
- the device performs the following operations: determining that the first group of entries cannot be added in the group table, and determining whether a second group of entries exists in the group table, where the second group carries the second group
- the importance indication information of the entry, the importance indication information of the second set of entries is used to indicate the importance of the second set of entries, wherein the second set of entries is less important than the The importance of the first set of entries, the second set of entries includes a
- the processor is configured to determine that the number of the idle group entries or the number of the first action buckets in the group table is greater than Said the first value.
- the transmitter is configured to determine, in the processor, that the group table cannot be added Before the first group of entries, when the processor determines that the number of idle group entries in the group table is greater than a preset upper limit of the group table, sending a first message to the controller to notify The number of idle group entries in the group table of the controller is greater than the upper limit of the group table; when the processor determines that the number of idle group entries in the group table is smaller than a preset group table And sending a second message to the controller, to notify the controller that the number of idle group entries in the group table is less than a lower limit of the group table margin; and/or,
- the transmitter configured to: when the processor determines that the first group of entries cannot be added in the group table, when the processor determines that the remaining space of the action bucket in the group table is greater than a preset action bucket Sending a third message to the controller to notify the controller that the remaining space of the action bucket in the group table is greater than the action bucket remaining amount upper limit; when the processor determines the group table When the remaining space of the middle action bucket is less than the preset lower limit of the action bucket, the fourth message is sent to the controller to notify the controller that the remaining space of the action bucket in the group table is smaller than the lower limit of the action bucket.
- a sixth aspect of the present invention provides a switch, including: a transmitter, a receiver, a memory, and a processor respectively connected to the transmitter, the receiver, and the memory;
- the receiver is configured to receive a first meter that is sent by the controller, where the first meter carries the importance indication information of the first meter, and the importance of the first meter
- the indication information is used to indicate the importance of the first meter item, and the first meter item includes a first metering band;
- the memory is configured to store program code; when the program code is executed, the processor is configured to perform the following operations: determining that the first meter cannot be added to the meter, and determining the meter Whether the second meter is present, the second meter carries the importance indication information of the second meter, and the importance indicator of the second meter is used to indicate the second meter
- the importance of the entry wherein the importance of the second meter is lower than the importance of the first meter, the second meter includes a second metering strip; The number is not greater than the sum of the first value and the number of the second metering bands, the first value being the number of metering bands available in the meter; and determining that the second is present in the meter
- the second meter item is deleted, and the first meter item is added to the meter.
- the processor is configured to determine that the idle meter item does not exist in the meter, or the number of the first metering band is greater than Said the first value.
- the transmitter is configured to determine, in the processor, that the meter cannot be added to the meter Before the first meter entry, when the processor determines that the number of idle meter entries in the meter is greater than a preset upper limit of the meter margin, sending a first message to the controller to notify The number of idle meter entries in the meter is greater than the upper limit of the meter balance; when the processor determines that the number of idle meter entries in the meter is less than a preset meter And sending a second message to the controller to notify the controller that the number of idle meter entries in the meter is less than a lower limit of the meter margin; and/or the transmitter, And before the processor determines that the remaining space of the metering band in the meter is greater than a preset upper limit of the metering band margin before the processor determines that the first meter item cannot be added in the meter, The controller sends a
- the beneficial effects of the embodiment of the present invention are: after the switch receives the first group of entries sent by the controller, and determines that the first group of entries cannot be added in the group table, the switch determines whether the second group of entries exists in the group table.
- the second group of entries carries the importance indication information of the second group of entries, and the importance indication information of the second group of entries is used to indicate the importance of the second group of entries, where the second set of entries is The importance is lower than the importance of the first set of entries, the second set of entries includes the second action bucket; the number of the first action buckets is not greater than the sum of the first value and the number of second action buckets, the first value The number of action buckets that are available in the above group table.
- the switch deletes the second group of entries and adds the first group of entries to the group table.
- the switch of the embodiment of the present invention can reduce the number of times the error message is sent to the controller, which is beneficial to reducing the processing load of the controller.
- the embodiment of the invention enables the switch to process important group entries in time, and improves the service quality of the important flows.
- FIG. 1 is a flow chart of an embodiment of a method for adding an entry of the present invention
- FIG. 2 is a flow chart of another embodiment of a method for adding an entry of the present invention.
- FIG. 3 is a schematic structural diagram of an embodiment of a switch according to the present invention.
- FIG. 4 is a schematic structural diagram of another embodiment of a switch according to the present invention.
- FIG. 5 is a schematic structural diagram of still another embodiment of a switch according to the present invention.
- FIG. 6 is a schematic structural diagram of still another embodiment of a switch according to the present invention.
- FIG. 7 is a schematic structural diagram of still another embodiment of a switch according to the present invention.
- FIG. 8 is a schematic structural diagram of still another embodiment of a switch according to the present invention.
- the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. It is a partial embodiment of the invention, and not all of the embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
- FIG. 1 is a flowchart of an embodiment of a method for adding an entry according to the present invention. As shown in FIG. 1, the method for adding an entry may include:
- the switch receives the first group of entries sent by the controller, where the first group of entries carries the importance indication information of the first group of entries, and the importance indication information of the first group of entries is used to indicate the first group.
- the importance of the entry, the first set of entries above includes the first action bucket.
- the importance indication information of the first group of entries is carried in a counter field, a group identification field, or a new field of the first group of entries.
- this new field can be important
- the embodiment of the present invention is not limited thereto, and the name of the newly added field is not limited in the embodiment of the present invention.
- the importance indication information of the first group of entries may also be carried in some information of the related flow table of the group table, for example, a field indicating the importance of the flow table.
- the switch determines that the first group entry cannot be added to the group table, and the switch determines whether the second group entry exists in the group table.
- the second group of entries carries the importance indication information of the second group of entries, and the importance indication information of the second group of entries is used to indicate the importance of the second group of entries, where the second group is The importance of the entry is lower than the importance of the first set of entries, and the second set of entries includes the second action bucket; the number of the first action bucket is not greater than the sum of the first value and the number of the second action bucket.
- the first value above is the number of action buckets available in the group table.
- the number of action buckets available in the group table is the difference between the maximum value of the action buckets included in the group table and the number of used action buckets in the group table.
- the switch determines that the first group of entries cannot be added to the group table.
- the switch determines that the number of idle group entries or the number of the first action buckets in the group table is greater than the first value.
- the switch deletes the second group entry, and adds the first group entry to the group table.
- the second group of entries may be a group entry or a plurality of group entries, which is not limited by the disclosure.
- the switch controls the switch.
- the device sends a first message to notify the controller that the number of idle group entries in the group table is greater than the upper limit of the group table margin; thus, the controller can learn that there are more remaining group entries in the group table. In this case, the controller can speed up the sending of the group entry to be added, and increase the number of group entries to be added to the switch.
- the switch determines that the number of idle group entries in the group table is less than the preset lower limit of the group table
- the switch sends a second message to the controller to notify the controller that the number of idle group entries in the group table is smaller than The lower limit of the group table in the above table; in this way, the controller can learn that the idle group entry in the group table is exhausted, and the controller can reduce the number of group entries to be added to the switch, and You can stop sending group entries to be added to the switch to prevent the group table entries from overflowing.
- the upper limit of the group table and the lower limit of the group table may be set according to performance requirements and switch performance in a specific implementation. In this embodiment, the upper limit of the group table and the lower limit of the group table margin are used. For example, the upper limit of the group table may be 80% of the total number of group entries included in the group table; the lower limit of the group table may be 10% of the total number of group entries included in the group table.
- the switch determines that the remaining space of the action bucket in the group table is greater than a preset upper limit of the action bucket
- the switch sends a third message to the controller to notify the controller that the remaining space of the action bucket in the group table is greater than the foregoing.
- the upper limit of the action bucket in this way, the controller can know that there are more remaining action buckets in the group table.
- the controller can speed up the sending speed of the group entry to be added, and can also increase the sending to the switch. Number of group entries to be added.
- the switch determines that the remaining space of the action bucket in the group table is less than the preset action bucket margin lower limit
- the switch sends a fourth message to the controller to notify the controller that the remaining space of the action bucket in the group table is smaller than the action bucket balance.
- the lower limit in this way, the controller can learn that the action buckets in the group table are exhausted.
- the controller can reduce the number of group entries to be added to the switch, and can also stop sending the to-be-added to the switch.
- the group table entry to prevent the action bucket from overflowing.
- the upper limit of the operation bucket and the lower limit of the operation bucket may be set according to performance requirements and switch performance in a specific implementation, and the upper limit and the upper limit of the operation bucket in the embodiment are
- the upper limit of the operation bucket remaining amount is not limited.
- the upper limit of the operation bucket remaining amount may be 80% of the total number of action buckets included in the group table; the lower limit of the group table margin may be the action bucket included in the group table. 10% of the total.
- the switch after the switch receives the first group of entries sent by the controller, and determines that the first group of entries cannot be added to the group table, the switch determines whether the second group of entries exists in the group table, and the second group The importance of the second set of entries is used to indicate the importance of the second set of entries, wherein the second set of entries is less important than the importance of the second set of entries.
- the importance of the first set of entries, the second set of entries includes a second action bucket; the number of the first action buckets is not greater than the sum of the first value and the number of second action buckets, and the first value is the group table
- the number of action buckets available in the switch if there is a second set of entries in the group table, the switch deletes the second set of entries, and adds the first set of entries to the above-mentioned group table; The group entry with higher importance is added. Therefore, the switch in the embodiment of the present invention can reduce the number of times the error message is sent to the controller, which is beneficial to reducing the processing load of the controller.
- the embodiment of the invention enables the switch to timely process important group entries and improve the service quality of the important flows.
- the switch can also send a message to the controller to notify the controller of the balance of the group table entry and/or the action bucket, which can prevent the overflow of the group table entry and/or the action bucket.
- the group entry after the importance field is added may be as shown in Table 2.
- the importance field is a new field, and the importance field carries the importance indication information of the group entry, and the importance indication information of the group entry is used to indicate the importance of the group entry, specifically, the group table.
- the importance indication information of the item may be the value of the importance field, that is, the value of the importance field may be used to indicate the importance of the group entry.
- the group table overflow problem can be solved by adding the above importance field to the group table item, and the problem can be decomposed into two problems of solving the group table item overflow and the action bucket overflow.
- the value of the action bucket field in all the group entries of the above group table is less than or equal to the maximum value of the action bucket of the above group table (GROUP_TABLE_MAX_BUCKETS).
- GROUP_ TABLE—MAX—ENTRIES M
- GROUP— TABLE— MAX— BUCKETS N
- group table entries are GG ⁇ .
- the corresponding importance fields are PP ⁇ Ps Ps, respectively.
- the corresponding action bucket field values are ⁇ ... ⁇ and the group table item to be added is the importance field of the group table item to be added.
- the value is ⁇ , and the value of the action bucket field is ⁇ .
- Shell lj the process of adding the first set of entries to be added is as follows:
- the switch receives the first set of entries sent by the controller.
- the value of the importance field in the first set of entries, and the value of the action bucket field is ⁇ .
- the switch determines that the first group of entries cannot be added to the group table, that is, the switch determines that there is no idle group entry in the group table or the number of the first action bucket is greater than the first value, where the first value is the foregoing group table.
- the number of action buckets available in the group table wherein the number of action buckets available in the group table is the difference between the maximum value of the action buckets of the group table and the number of used action buckets in the group table; that is, the switch After determining to add the first group of entries above, the group table entry will overflow and/or move. The bucket overflows.
- the switch compares P s and, if P s ⁇ P., that is, the importance is lower than the least significant group entry in the added table of the group table, the switch sends an error to the controller. Message, waiting for the external processor to go through the process; and if? 8 > , that is, the importance of ⁇ is higher than the group entry with the least importance of the added items in the above table, then a comparison is needed (B 1 +B 2 +...+B s- iB s +B i ) and N, if (Bi+Bs+. - .+B ⁇ -Bs+Bi) ⁇ N, ie Bi ⁇ (N- ( ⁇ +.
- G s is the second group of entries.
- the switch deletes G s from the above group table and adds it to the idle position of the above group table, where the idle position is The position obtained by the above group table after deleting 0 8 , that is, the position of 0 8 originally in the group table.
- the switch sends an error message to the controller, waiting for the external processor to process it; If the importance of the group is higher than the group entry with the second lowest importance in the added table, the switch compares (B 1 +B 2 +...-B s- i+B s +B i And N, if (B ⁇ +.
- the switch can compare (B 1 +B 2 +...-B s- iB s +B 1 ) and N, if (B 1 +B 2 + ...-B s- iB s +B 1 ) ⁇ N, ie 3 ⁇ 4 ⁇ (N- ( ⁇ !+ ⁇ 2 +...+ ⁇ 8- 2 ) ) + B S + B S-1 , then
- the replacement G s and G s-1 can be used, in which case the second set of entries includes G s and G s _ then the switch deletes G s and G s _ from the above group table and adds to the idle location of the above group table
- the free location is the location obtained by deleting the G s and G s _i in the above group table.
- the switch may be added to the original location in the group table, or may be added to the original table in the 0 8 The location in .
- the switch can further compare? 8 _ 2 and, if P s _ 2 ⁇ ⁇ , that is, the importance is lower than the importance of G s _ 2 , the switch sends an error message to the controller.
- the second set of entries is G s _ 2 , and the switch deletes G s _ 2 from the above group table, and adds to the idle location of the above group table, where the idle location is the above group table in which the G s is deleted.
- the position obtained after _ 2 that is, the position of G s _ 2 originally in the group table.
- the second set of entries includes G s and G s _ 2
- the switch deletes G ⁇ PG S _ 2 from the above group table, and adds to the idle location of the above group table, where the idle location is The location of the above group table obtained after deleting G s and 0 8 _ 2 , specifically, the switch may be added to the location where G s _ 2 is originally in the group table, or may be added to the original table of G s in the group table. position.
- the switch always adds the second group of the group table entries that are less important than the first group of entries in the group table according to the principle that the deleted second group of entries has the least number and the least importance.
- the table entry is deleted, and then the first set of table entries is added to the above group table.
- the switch compares P s and if P s ⁇ , the importance is lower than If the above group table has added the least important group table entry in the table entry, the switch sends an error message to the controller, waiting for the external processor to process it; and if? 8 > , that is, the importance is higher than the group entry with the least importance of the added items in the above table, then it needs to be compared
- the switch sends an error message to the controller, waiting for the external processor to perform a further processing; If the importance of ⁇ ⁇ is higher than the group entry with the second lowest importance in the added table of the above table, the switch compares ( ⁇ ..-Bs-2+Bs.i+Bs+Bi) and ⁇ , if ( ⁇ .
- the switch deletes G s _ 2 from the above group table, and adds to the idle location of the above group table, where the idle location is the above group table.
- the position obtained after deleting G s _ 2 that is, the position of G s _ 2 originally in the group table.
- the switch compares the importance of the added items in the order of the above-mentioned group table from the lowest to the highest, and compares the importance of the first set of entries to be added with the added items of the above-mentioned group table. Add the importance of a group entry and the first group of entries in the entry. If the added entry meets the criteria of the second set of entries, the added added entry is deleted, and the first set is deleted. Table entries are added to the above group table.
- the switch may save the group table entry overflow and/or the action bucket overflows, and the switch may add to the group by using the foregoing process.
- the switch sends different error codes to the controller. For example, when a group entry overflow occurs, if the replacement in the above table cannot be replaced If an entry is added, OFPGMFC_OUT_OF_ GROUPS is sent; and when an action bucket overflow occurs, if the added entry in the above group table cannot be replaced, OFPGMFC_OUT_OF_BUCKETS is sent.
- FIG. 2 is a flowchart of another embodiment of a method for adding an entry according to the present invention. As shown in FIG. 2, the method for adding an entry may include:
- the switch receives the first meter that is sent by the controller, where the first meter carries the importance indication information of the first meter, and the importance indicator of the first meter is used to indicate the first meter.
- the importance of the entry, the first meter entry includes the first metering band.
- the importance indication information of the first meter entry is carried in a counter field, a meter identifier field, or a new field of the first meter entry.
- the newly added field may be an importance field.
- the embodiment of the present invention is not limited thereto.
- the name of the newly added field is not limited in the embodiment of the present invention.
- the importance indication information of the first meter entry may also be carried in some information of the related flow table of the meter, for example, in a field indicating the importance of the flow table.
- the switch determines that the first meter cannot be added to the meter, and the switch determines whether the second meter exists in the meter.
- the second measurement item carries the importance indication information of the second measurement item, where the importance indication information of the second measurement item is used to indicate the importance of the second measurement item, where The importance of the second meter item is lower than the importance of the first meter item, and the second meter item includes the second metering band; the number of the first metering band is not greater than the first value and the number of the second metering band And the first value is the number of metering bands available in the meter.
- the number of metering belts available in the above meter is the difference between the maximum value of the metering belt in the meter and the number of used metering belts in the meter.
- the switch determines that the first meter cannot be added to the meter.
- the switch determines that the idle meter does not exist in the meter or the number of the first meter is greater than the first value.
- the switch deletes the second meter item, and adds the first meter item to the meter.
- the second meter entry may be a meter item or a plurality of meter items, which is not limited by the present invention.
- the switch controls the switch.
- the device sends a first message to notify the controller that the number of idle meter entries in the meter is greater than the upper limit of the meter balance; thus, the controller can know that there are more remaining meter items in the meter.
- the controller can speed up the sending speed of the meter to be added, and can also increase the number of the meter items to be added sent to the switch.
- the switch determines that the number of idle meter entries in the meter is less than the preset lower limit of the meter, the switch sends a second message to the controller to notify the controller of the number of idle meter entries in the meter.
- the controller is configured to reduce the number of idle entries to be added to the switch. You can also stop sending meter entries to be added to the switch to prevent meter entries from overflowing.
- the upper limit of the meter balance and the lower limit of the meter balance may be set according to performance requirements and switch performance in a specific implementation, and the upper limit of the meter balance and the lower limit of the meter balance in the embodiment are
- the upper limit of the meter balance may be 80% of the total number of the items included in the meter; the lower limit of the meter may be 10% of the total number of items included in the meter.
- the switch determines that the remaining space of the metering tape in the meter is greater than a preset
- the switch sends a third message to the controller to notify the controller that the remaining space of the metering band in the meter is greater than the upper limit of the metering band margin; thus, the controller can know the meter The action bucket has more remaining.
- the controller can speed up the sending of the meter to be added, and can also increase the number of meter items to be added to the switch.
- the switch determines that the remaining space of the metering band in the meter is less than the preset lower limit of the metering band margin
- the switch sends a fourth message to the controller to notify the controller that the remaining space of the metering band in the meter is smaller than the metering band The lower limit.
- the controller can know that the metering band in the meter will be used up.
- the controller can reduce the number of the meter items to be added sent to the switch, and can also stop sending the meter to be added to the switch. An entry to prevent the metering band from overflowing.
- the upper limit of the metering belt margin and the lower limit of the metering belt margin may be set according to performance requirements and switch performance in a specific implementation.
- the upper limit of the metering belt margin and the lower limit of the metering belt margin are used.
- the upper limit of the metering belt allowance may be 80% of the total number of metering belts included in the meter; the lower limit of the metering belt margin may be 10% of the total number of metering belts included in the meter.
- the switch determines whether the second meter exists in the meter, and the second meter
- the importance indicator information of the second meter entry is used in the entry, and the importance indicator information of the second meter entry is used to indicate the importance of the second meter entry, where the second meter item is less important than
- the importance of the first meter item, the second meter item includes a second metering band; the number of the first metering belt is not greater than the sum of the first value and the number of the second action barrel, and the first value is the meter
- the switch deletes the second meter and adds the first meter to the meter; thereby enabling priority on the switch.
- the switch in the embodiment of the present invention can reduce the number of times an error message is sent to the controller, which is beneficial to lowering the controller.
- the burden In addition, the embodiment of the invention enables the switch to timely process important metering items and improve the service quality of the important stream.
- the switch can send a message to the controller to inform the controller of the amount of meter entries and/or metering bands, which can prevent overflow of meter entries and/or metering bands.
- the process of adding a meter entry is the same as the process of adding a group entry, so
- For the process of adding an entry refer to the description of the process of adding a group entry in the above embodiment, and details are not described herein again.
- the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.
- FIG. 3 is a schematic structural diagram of an embodiment of a switch according to the present invention.
- the switch in this embodiment may implement the process of the embodiment shown in FIG. 1.
- the switch may include: a receiving module 31, a determining module 32, and adding Module 33;
- the receiving module 31 is configured to receive a first group of entries sent by the controller, where the first group of entries carries the importance indication information of the first group of entries, and the importance indication information of the first group of entries is used to indicate The importance of the first set of entries, the first set of entries includes the first action bucket.
- the importance indication information of the first group of entries is carried in a counter field, a group identification field, or a new field of the first group of entries.
- the newly added field may be an importance field, and the embodiment of the present invention is not limited thereto.
- the name of the newly added field is not limited in the embodiment of the present invention.
- the importance indication information of the first group of entries may also be carried in some information of the related flow table of the group table, for example, a field indicating the importance of the flow table.
- the determining module 32 is configured to determine that the first group of entries cannot be added to the group table, and whether the second group of entries is included in the group table, and the second group of entries carries the importance of the second group of entries
- the indication information, the importance indication information of the second group of entries is used to indicate the importance of the second group of entries, wherein the importance of the second group of entries is lower than the importance of the first group of entries, the second group
- the entry includes a second action bucket; the number of the first action bucket is not greater than a sum of the first value and the number of the second action buckets, and the first value is the number of action buckets available in the group table; wherein, the group The number of action buckets available in the table is the difference between the maximum value of the action buckets of the above group table and the number of used action buckets in the above group table.
- the adding module 33 is configured to: when the determining module 32 determines that the second group of entries exists in the group table, delete the second group of entries, and add the first group of entries to the group table.
- the foregoing second group entry may be a group entry or a plurality of group entries, which is not limited by the present invention.
- the determining module 32 is specifically configured to determine that the idle group entry or the upper group does not exist in the group table.
- the number of the first action buckets is greater than the first value.
- the determining module 32 determines that the first group of entries cannot be added in the group table, and the determining module 32 determines whether the second group exists in the group table.
- the switch in the embodiment of the present invention can reduce the number of times the error message is sent to the controller, which is beneficial to reducing the processing load of the controller.
- the embodiment of the invention enables the switch to timely process important group entries, thereby improving the service quality of the important flows.
- FIG. 4 is a schematic structural diagram of another embodiment of the switch according to the present invention.
- the switch is different from the switch shown in FIG. 3, and the switch shown in FIG. 4 further includes: a sending module 34, and a sending module 34, configured to
- the determining module 32 determines that the first group of entries cannot be added in the group table, and when the determining module 32 determines that the number of the idle group entries in the group table is greater than a preset upper limit of the group table, sending the first to the controller.
- the sending module 34 is configured to determine, in the determining module 32, that the group table cannot be Before adding the first group of entries, when the determining module 32 determines that the remaining space of the action bucket in the group table is greater than a preset upper limit of the action bucket, sending a third message to the controller, Notifying the controller that the remaining space of the action bucket in the group table is greater than the upper limit of the action bucket margin; and when the determining module 32 determines that the remaining space of the action bucket in the group table is less than a preset lower limit of the action bucket, sending the first to the controller
- the four messages are used to notify the controller that the number of idle group entries in the group table is greater than the upper limit of the group table; when the determining module 32 determines that the number of idle group entries in the group table is less than a preset lower limit of the group table And sending a second message to the controller, to notify the controller that the number of idle group entries in the group table is less than a lower limit of the group table balance; and/or, the sending module 34 is
- the upper limit of the group table and the lower limit of the group table may be set according to performance requirements and switch performance in a specific implementation.
- the upper limit of the group table and the lower limit of the group table margin are used.
- the upper limit of the above table table may be the above
- the group table contains 80% of the total number of group entries; the lower limit of the group table above may be 10% of the total number of group entries included in the above group table.
- the upper limit of the operation bucket and the lower limit of the operation bucket may be set according to performance requirements and switch performance in a specific implementation.
- the upper limit of the operation bucket and the lower limit of the operation bucket margin are not limited.
- the upper limit of the action bucket may be 80% of the total number of action buckets included in the group table; and the lower limit of the group schedule may be 10% of the total number of action buckets included in the group table.
- the sending module 34 may send a message to the controller to notify the controller of the balance of the group entry and/or the action bucket, and may prevent the overflow of the group entry and/or the action bucket.
- FIG. 5 is a schematic structural diagram of still another embodiment of the switch according to the present invention.
- the switch in this embodiment can implement the process of the embodiment shown in FIG. 1 of the present invention.
- the switch may include: a transmitter 41, a receiver 42, a memory 43, and a processor 44 connected to the transmitter 41, the receiver 42, and the memory 43, respectively; of course, the switch may further include an input/output device.
- the embodiments of the present invention are not limited herein.
- the receiver 42 is configured to receive the first group of entries sent by the controller, where the first group of entries carries the importance indication information of the first group of entries, and the importance indication information of the first group of entries is used. In order to indicate the importance of the first group of entries, the first group of entries includes the first action bucket.
- the importance indication information of the first group of entries is carried in a counter field, a group identification field, or a new field of the first group of entries.
- the newly added field may be an importance field, and the embodiment of the present invention is not limited thereto.
- the name of the newly added field is not limited in the embodiment of the present invention.
- the importance indication information of the first group of entries may also be carried in some information of the related flow table of the group table, for example, a field indicating the importance of the flow table.
- the number of action buckets available in the group table is the maximum value of the action bucket of the group table and the number of used action buckets in the group table. The difference; and when it is determined that there is a second set of entries in the above group table, delete the above Two sets of entries, and the first set of entries are added to the above group table.
- the second group of entries may be a group entry or a plurality of group entries, which is not limited by the disclosure.
- the processor 44 is specifically configured to determine that the idle group entry or the number of the first action buckets in the group table is greater than the first value.
- the transmitter 41 is configured to: before the processor 44 determines that the first group entry cannot be added in the group table, the processor 44 determines that the number of idle group entries in the group table is greater than a preset
- the first message is sent to the controller to notify the controller that the number of idle group entries in the group table is greater than the upper limit of the group table margin; and the processor 44 determines the idle group in the group table.
- the second message is sent to the controller to notify the controller that the number of idle group entries in the group table is less than the lower limit of the group table; and/or ,
- the transmitter 41 is configured to: before the processor 44 determines that the first group of entries cannot be added in the group table, when the processor 44 determines that the remaining space of the action bucket in the group table is greater than a preset upper limit of the action bucket, The controller sends a third message to notify the controller that the remaining space of the action bucket in the group table is greater than the upper limit of the action bucket margin; when the processor 44 determines that the remaining space of the action bucket in the group table is smaller than the preset action bucket margin The lower limit sends a fourth message to the controller to notify the controller that the remaining space of the action bucket in the group table is smaller than the lower limit of the action bucket.
- the upper limit of the group table and the lower limit of the group table may be set according to performance requirements and switch performance in a specific implementation.
- the upper limit of the group table and the lower limit of the group table margin are used.
- the upper limit of the group table may be 80% of the total number of group entries included in the group table; the lower limit of the group table may be 10% of the total number of group entries included in the group table.
- the upper limit of the operation bucket and the lower limit of the operation bucket may be set according to performance requirements and switch performance in a specific implementation.
- the upper limit of the operation bucket and the lower limit of the operation bucket margin are not limited.
- the upper limit of the action bucket may be 80% of the total number of action buckets included in the group table; and the lower limit of the group schedule may be 10% of the total number of action buckets included in the group table.
- the processor 44 determines that the first set of entries cannot be added in the group table, and the processor 44 determines whether the second set of tables exists in the group table.
- the second group of entries carries the importance indication information of the second group of entries, and the importance indication information of the second group of entries is used to indicate the importance of the second group of entries, where The importance of the second set of entries is lower than the importance of the first set of entries, and the second set of entries includes the second action bucket; the number of the first action buckets is not greater than the sum of the first value and the number of the second action buckets
- the first value is the number of action buckets available in the group table; if the second group entry exists in the group table, the processor 44 deletes the second group entry, and adds the first group entry to the foregoing In the group table, it is possible to preferentially add a group entry with higher importance on the switch.
- the switch in the embodiment of the present invention can reduce the number of times the error message is sent to the controller, which is beneficial to reducing the processing load of the controller.
- the embodiment of the invention enables the switch to process important group entries in time, and improves the service quality of the important flows.
- the transmitter 41 may also send a message to the controller to notify the controller of the balance of the group table entry and/or the action bucket, and may prevent overflow of the group table entry and/or the action bucket.
- FIG. 6 is a schematic structural diagram of still another embodiment of the switch according to the present invention.
- the switch in this embodiment can implement the process of the embodiment shown in FIG. 2.
- the switch may include: a receiving module 51, a determining module 52, and Add module 53;
- the receiving module 51 is configured to receive the first meter that is sent by the controller, where the first meter carries the importance indication information of the first meter, and the importance indicator of the first meter is used to indicate The importance of the first meter item, the first meter item includes the first metering band.
- the importance indication information of the first meter entry is carried in a counter field, a group identifier field, or a new field of the first meter entry.
- the newly added field may be an important field.
- the embodiment of the present invention is not limited thereto.
- the name of the newly added field is not limited in the embodiment of the present invention.
- the importance indication information of the foregoing first meter entry may also be carried in some information of the related flow table of the meter, for example, in a field indicating the importance of the flow table.
- the determining module 52 is configured to determine that the first meter item cannot be added to the meter, and determine whether the second meter item exists in the meter, and the second meter carries the importance of the second meter item.
- the indication information, the importance indication information of the second meter item is used to indicate the importance of the second meter item, wherein the importance of the second meter item is lower than the importance of the first meter item, the second meter
- the entry includes a second metering strip; the number of the first metering strip is not greater than a sum of the first value and the number of the second metering strips, the first value being the number of metering strips available in the meter; wherein, the metering
- the number of metering bands available in the table is the difference between the maximum value of the metering band of the above meter and the number of metering bands used in the meter.
- the adding module 53 is configured to determine, when the determining module 52, that the second meter exists in the meter When the item is deleted, the second meter item is deleted, and the first meter item is added to the meter.
- the second meter entry may be a meter item or a plurality of meter items, which is not limited by the present invention.
- the determining module 52 is specifically configured to determine that the idle meter item does not exist in the meter or the number of the first metering strip is greater than the first value.
- the determining module 52 determines that the first meter item cannot be added to the meter, and the determining module 52 determines whether the second meter exists in the meter.
- the second meter entry carries the importance indication information of the second meter, and the importance indication information of the second meter is used to indicate the importance of the second meter, where the second meter The importance of the item is lower than the importance of the first meter item, and the second meter item includes the second metering band; the number of the first metering band is not greater than the sum of the first value and the number of the second metering band, the first The value is the number of the metering bands available in the meter; if there is a second meter in the meter, the adding module 53 deletes the second meter and adds the first meter to the meter.
- the switch in the embodiment of the present invention can reduce the sending of an error message to the controller. Frequency and help to reduce the processing load on the controller.
- the embodiment of the invention enables the switch to process important metering items in time, and improves the service quality of the important stream.
- FIG. 7 is a schematic structural diagram of still another embodiment of the switch according to the present invention. The difference is that the switch shown in FIG. 7 further includes: a sending module 54 and a sending module 54 for The determining module 52 determines that the first meter cannot be added to the meter, and when the determining module 52 determines that the number of idle meter items in the meter is greater than a preset upper limit of the meter, sends the first to the controller.
- a message to notify the controller that the number of idle meter entries in the meter is greater than the upper limit of the meter balance; when the determining module 52 determines that the number of idle meter entries in the meter is less than the preset lower limit of the meter Sending a second message to the controller to notify the controller that the number of idle meter entries in the meter is less than the lower limit of the meter margin; and/or,
- the sending module 54 is configured to: before the determining module 52 determines that the first meter cannot be added to the meter, when the determining module 52 determines that the remaining space of the metering band in the meter is greater than a preset metering margin upper limit, The controller sends a third message to notify the controller that the remaining space of the metering band in the meter is greater than the upper limit of the metering band margin; when the determining module 52 determines When the remaining space of the measuring tape in the above meter is less than the preset lower limit of the metering band margin, the fourth message is sent to the controller to notify the controller that the remaining space of the metering band in the meter is smaller than the lower limit of the metering band.
- the upper limit of the meter balance and the lower limit of the meter balance may be set according to performance requirements and switch performance in a specific implementation, and the upper limit of the meter balance and the lower limit of the meter balance in the embodiment are
- the upper limit of the meter balance may be 80% of the total number of the items included in the meter; the lower limit of the meter may be 10% of the total number of items included in the meter.
- the upper limit of the metering belt margin and the lower limit of the metering belt margin may be set according to performance requirements and switch performance in a specific implementation.
- the upper limit of the metering belt margin and the lower limit of the metering belt margin are not limited.
- the upper limit of the metering belt allowance may be 80% of the total number of metering belts included in the meter; the lower limit of the metering table may be 10% of the total number of measuring belts included in the meter.
- the sending module 54 may send a message to the controller to notify the controller of the balance of the meter entry and/or the metering band, which may prevent overflow of the meter item and/or the metering band.
- FIG. 8 is a schematic structural diagram of still another embodiment of the switch according to the present invention.
- the switch in this embodiment can implement the process of the embodiment shown in FIG. 2 of the present invention.
- the switch may include: a transmitter 71, a receiver 72, a memory 73, and a processor 74 connected to the transmitter 71, the receiver 72, and the memory 73, respectively; of course, the switch may further include an input/output device.
- the embodiments of the present invention are not limited herein.
- the receiver 72 is configured to receive the first meter that is sent by the controller, where the first meter carries the importance indication information of the first meter, and the importance indicator of the first meter is used.
- the first meter item includes a first metering band.
- the importance indication information of the first meter entry is carried in a counter field, a group identifier field, or a new field of the first meter entry.
- the newly added field may be an important field.
- the embodiment of the present invention is not limited thereto.
- the name of the newly added field is not limited in the embodiment of the present invention.
- the importance indication information of the foregoing first meter entry may also be carried in some information of the related flow table of the meter, for example, in a field indicating the importance of the flow table.
- a memory 73 configured to store program code; when the program code is executed, causing a processor
- the second meter entry may be a meter item or a plurality of meter items
- the processor 74 is specifically configured to determine that the idle meter item does not exist in the meter or the number of the first meter strip is greater than the first value.
- the transmitter 71 is configured to: before the processor 74 determines that the first meter entry cannot be added to the meter, the processor 74 determines that the number of idle meter entries in the meter is greater than a preset When the meter upper limit is reached, the first message is sent to the controller to notify the controller that the number of idle meter entries in the meter is greater than the upper limit of the meter balance; when the processor 74 determines the idle meter in the meter When the number of entries is less than the preset lower limit of the meter, the second message is sent to the controller to notify the controller that the number of idle meters in the meter is less than the lower limit of the meter; and/or ,
- the transmitter 71 is configured to: before the processor 74 determines that the first meter cannot be added to the meter, when the processor 74 determines that the remaining space of the metering band in the meter is greater than a preset metering margin upper limit, The controller sends a third message to notify the controller that the remaining space of the metering band in the meter is greater than the upper limit of the metering band margin; when the processor 74 determines that the remaining space of the metering band in the meter is less than the preset metering margin At the lower limit, a fourth message is sent to the controller to notify the controller that the remaining space of the metering band in the meter is less than the lower limit of the metering band.
- the upper limit of the meter balance and the lower limit of the meter balance may be set according to performance requirements and switch performance in a specific implementation, and the upper limit of the meter balance and the lower limit of the meter balance in the embodiment are
- the upper limit of the meter balance may be 80% of the total number of the items included in the meter; the lower limit of the meter may be 10% of the total number of items included in the meter.
- the upper limit of the metering belt margin and the lower limit of the metering belt margin may be set according to performance requirements and switch performance in a specific implementation.
- the upper limit of the metering belt margin and the lower limit of the metering belt margin are not limited.
- the upper limit of the metering belt allowance may be 80% of the total number of metering belts included in the meter; the lower limit of the metering table may be 10% of the total number of measuring belts included in the meter.
- the processor 74 determines that the first meter cannot be added to the meter, and the processor 74 determines whether the second meter exists in the meter.
- the second meter entry carries the importance indication information of the second meter, and the importance indication information of the second meter is used to indicate the importance of the second meter, where the second meter The importance of the item is lower than the importance of the first meter item, and the second meter item includes the second metering band; the number of the first metering band is not greater than the sum of the first value and the number of the second metering band, the first The value is the number of the metering bands available in the meter; if the second meter exists in the meter, the processor 74 deletes the second meter and adds the first meter to the meter.
- the switch in the embodiment of the present invention can reduce the number of times the error message is sent to the controller, To reduce the processing burden on the controller.
- the embodiment of the invention enables the switch to process important meter items in time, and improves the service quality of the important stream.
- the transmitter 71 can also send a message to the controller to inform the controller of the balance of the meter entry and/or the metering band, which can prevent overflow of the meter entry and/or metering band.
- modules in the apparatus in the embodiments may be distributed in the apparatus of the embodiment according to the embodiment description, or the corresponding changes may be located in one or more apparatuses different from the embodiment.
- the modules of the above embodiments may be combined into one module, or may be split into multiple sub-modules.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Mining & Analysis (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本申请提供一种表项添加方法和交换机,该表项添加方法包括:交换机接收控制器发送的第一组表项,上述第一组表项中携带第一组表项的重要性指示信息,第一组表项包括第一动作桶;交换机确定无法在组表中添加第一组表项,确定上述组表中是否存在第二组表项,其中,第二组表项的重要性低于第一组表项的重要性,第二组表项包括第二动作桶;第一动作桶的数目不大于第一值与第二动作桶的数目之和,第一值为上述组表中可用的动作桶的数目;如果上述组表中存在第二组表项,则交换机删除上述第二组表项,且将第一组表项添加到上述组表中。本发明实施例可以实现在交换机上优先添加重要性较高的组表项,因此本发明实施例中的交换机能减少向控制器发送错误消息的次数,有利于降低控制器的处理负担。另外,本发明实施例能使交换机对重要的组表项进行及时处理,提高了重要流的服务质量。
Description
表项添加方法和交换机 技术领域
本发明涉及通信技术领域, 尤其涉及一种表项添加方法和交换机。 背景技术
随着网络设备新技术的不断发展, 网络设备向着控制和转发分离的架 构转变。 OpenFlow 便是一个典型的控制和转发相分离的网络设备架构, 并已经引起广泛的关注。
OpenFlow中, 交换机通过一个安全通道连接到控制器(Controller) 。 OpenFlow 中, 交换机维护三种表: 流表、 组表和计量表。 流表是交换机 进行转发策略控制的核心数据结构, 而组表用于实现组播、 广播或负载均 衡等动作的核心数据结构; 计量表是用来实现服务质量 (Quality of Service; 以下简称: QoS ) 业务的核心数据结构。 交换机负责对流表、 组 表和计量表进行查询和管理。
现有技术中, OpenFlow的组表项可以如表 1所示。
现 有 的 OpenFlow 协 议 中 规 定 , 控 制 器 通 过 OFPT_GROUP_MOD(OFPGC_ADD)消息向交换机添加组表项。 如果添加 不成功, 那么交换机会返回错误消息 ( ofp— error— msg ) , 并指明 OFPET— GROUP— MOD— FAILED的类型和相应代码 (其中, 组表项溢出返 回 OFPGMFC— OUT— OF— GROUPS 代 码 ; 动 作 桶 溢 出 返 回 OFPGMFC— OUT— OF— BUCKETS代码 ) 。
同样, 控制器也可以通过发送消息向交换机添加计量表项。 如果添加 不成功, 那么交换机会返回错误消息 (ofp— error— msg) , 并指明类型和相 应代码。
但是, 现有技术中, 组表项没有表项老化机制, 因此容易导致组表溢
出, 计量表项也没有表项老化机制, 容易导致计量表溢出。 控制器下发组 表项时, 并不知道组表是否已满, 只有在接收到交换机发送的错误消息之 后, 控制器才能获知组表已满, 进而才会进行相应处理。 同样, 控制器下 发计量表项时, 也并不知道计量表是否已满, 只有在接收到交换机发送的 错误消息之后, 控制器才能获知计量表已满, 进而才会进行相应处理。
通常控制器会先执行删除 (DELETE) 操作, 再执行添加 (ADD ) 操 作, 这样控制器增加了额外处理, 增加了控制器的负担。 发明内容
本发明实施例提供一种表项添加方法和交换机。
本发明实施例第一方面提供一种表项添加方法, 包括:
交换机接收控制器发送的第一组表项, 所述第一组表项中携带所述第 一组表项的重要性指示信息, 所述第一组表项的重要性指示信息用于指示 所述第一组表项的重要性, 所述第一组表项包括第一动作桶;
所述交换机确定无法在组表中添加所述第一组表项, 所述交换机确定 所述组表中是否存在第二组表项, 所述第二组表项中携带所述第二组表项 的重要性指示信息, 所述第二组表项的重要性指示信息用于指示所述第二 组表项的重要性, 其中, 所述第二组表项的重要性低于所述第一组表项的 重要性, 所述第二组表项包括第二动作桶; 所述第一动作桶的数目不大于 第一值与所述第二动作桶的数目之和, 所述第一值为所述组表中可用的动 作桶的数目;
如果所述组表中存在所述第二组表项, 则所述交换机删除所述第二组 表项, 且将所述第一组表项添加到所述组表中。
结合第一方面, 在第一方面的第一种可能的实现方式中, 所述交换机 确定无法在组表中添加所述第一组表项包括:
所述交换机确定所述组表中不存在空闲组表项或所述第一动作桶的 数目大于所述第一值。
结合第一方面, 在第一方面的第二种可能的实现方式中, 所述第一组 表项的重要性指示信息携带在所述第一组表项的计数器字段、 组标识字段 或新增字段中。
结合第一方面或者第一方面的第一种可能的实现方式, 在第一方面的 第三种可能的实现方式中, 所述交换机确定无法在组表中添加所述第一组 表项之前, 还包括: 当所述交换机确定所述组表中空闲组表项的个数大于 预先设置的组表余量上限时, 所述交换机向所述控制器发送第一消息, 以 通知所述控制器所述组表中空闲组表项的个数大于所述组表余量上限; 当 所述交换机确定所述组表中空闲组表项的个数小于预先设置的组表余量 下限时, 所述交换机向所述控制器发送第二消息, 以通知所述控制器所述 组表中空闲组表项的个数小于所述组表余量下限; 和 /或,
当所述交换机确定所述组表中动作桶的剩余空间大于预先设置的动 作桶余量上限时, 所述交换机向所述控制器发送第三消息, 以通知所述控 制器所述组表中动作桶的剩余空间大于所述动作桶余量上限; 当所述交换 机确定所述组表中动作桶的剩余空间小于预先设置的动作桶余量下限时, 所述交换机向所述控制器发送第四消息, 以通知所述控制器所述组表中动 作桶的剩余空间小于动作桶余量下限。
本发明第二方面提供一种表项添加方法, 包括:
交换机接收控制器发送的第一计量表项, 所述第一计量表项中携带所 述第一计量表项的重要性指示信息, 所述第一计量表项的重要性指示信息 用于指示所述第一计量表项的重要性, 所述第一计量表项包括第一计量 带;
所述交换机确定无法在计量表中添加所述第一计量表项, 所述交换机 确定所述计量表中是否存在第二计量表项, 所述第二计量表项中携带所述 第二计量表项的重要性指示信息, 所述第二计量表项的重要性指示信息用 于指示所述第二计量表项的重要性, 其中, 所述第二计量表项的重要性低 于所述第一计量表项的重要性, 所述第二计量表项包括第二计量带; 所述 第一计量带的数目不大于第一值与所述第二计量带的数目之和, 所述第一 值为所述计量表中可用的计量带的数目;
当所述计量表中存在所述第二计量表项时, 所述交换机删除所述第二 计量表项, 且将所述第一计量表项添加到所述计量表中。
结合第二方面, 在第二方面的第一种可能的实现方式中, 所述交换机 确定无法在计量表中添加所述第一计量表项包括:
所述交换机确定所述计量表中不存在空闲计量表项或所述第一计量 带的数目大于所述第一值。
结合第二方面或第二方面的第一种可能的实现方式, 在第二方面的第 二种可能的实现方式中, 所述第一计量表项的重要性指示信息携带在所述 第一计量表项的计数器字段、 计量标识字段或新增字段中。
结合第二方面或第二方面的第一种可能的实现方式, 在第二方面的第 三种可能的实现方式中, 所述交换机确定无法在计量表中添加所述第一计 量表项之前, 还包括:
当所述交换机确定所述计量表中空闲计量表项的个数大于预先设置 的计量表余量上限时, 所述交换机向所述控制器发送第一消息, 以通知所 述控制器所述计量表中空闲计量表项的个数大于所述计量表余量上限; 当 所述交换机确定所述计量表中空闲计量表项的个数小于预先设置的计量 表余量下限时, 所述交换机向所述控制器发送第二消息, 以通知所述控制 器所述计量表中空闲计量表项的个数小于所述计量表余量下限; 和 /或, 当所述交换机确定所述计量表中计量带的剩余空间大于预先设置的 计量带余量上限时, 所述交换机向所述控制器发送第三消息, 以通知所述 控制器所述计量表中计量带的剩余空间大于所述计量带余量上限; 当所述 交换机确定所述计量表中计量带的剩余空间小于预先设置的计量带余量 下限时, 所述交换机向所述控制器发送第四消息, 以通知所述控制器所述 计量表中计量带的剩余空间小于计量带余量下限。
本发明实施例第三方面提供一种交换机, 包括:
接收模块, 用于接收控制器发送的第一组表项, 所述第一组表项中携 带所述第一组表项的重要性指示信息, 所述第一组表项的重要性指示信息 用于指示所述第一组表项的重要性, 所述第一组表项包括第一动作桶; 确定模块, 用于确定无法在组表中添加所述第一组表项, 以及确定所 述组表中是否存在第二组表项, 所述第二组表项中携带所述第二组表项的 重要性指示信息, 所述第二组表项的重要性指示信息用于指示所述第二组 表项的重要性, 其中, 所述第二组表项的重要性低于所述第一组表项的重 要性, 所述第二组表项包括第二动作桶; 所述第一动作桶的数目不大于第 一值与所述第二动作桶的数目之和, 所述第一值为所述组表中可用的动作
桶的数目;
添加模块, 用于当所述确定模块确定所述组表中存在所述第二组表项 时, 删除所述第二组表项, 且将所述第一组表项添加到所述组表中。
结合第三方面, 在第三方面的第一种可能的实现方式中, 所述确定模 块, 具体用于确定所述组表中不存在空闲组表项或所述第一动作桶的数目 大于所述第一值。
结合第三方面或第三方面的第一种可能的实现方式, 在第三方面的第 二种可能的实现方式中, 所述交换机还包括: 发送模块;
所述发送模块, 用于在所述确定模块确定无法在组表中添加所述第一 组表项之前, 当所述确定模块确定所述组表中空闲组表项的个数大于预先 设置的组表余量上限时, 向所述控制器发送第一消息, 以通知所述控制器 所述组表中空闲组表项的个数大于所述组表余量上限; 当所述确定模块确 定所述组表中空闲组表项的个数小于预先设置的组表余量下限时, 向所述 控制器发送第二消息, 以通知所述控制器所述组表中空闲组表项的个数小 于所述组表余量下限; 和 /或,
所述发送模块, 用于在所述确定模块确定无法在组表中添加所述第一 组表项之前, 当所述确定模块确定所述组表中动作桶的剩余空间大于预先 设置的动作桶余量上限时, 向所述控制器发送第三消息, 以通知所述控制 器所述组表中动作桶的剩余空间大于所述动作桶余量上限; 当所述确定模 块确定所述组表中动作桶的剩余空间小于预先设置的动作桶余量下限时, 向所述控制器发送第四消息, 以通知所述控制器所述组表中动作桶的剩余 空间小于动作桶余量下限。
本发明第四方面提供一种交换机, 包括:
接收模块, 用于接收控制器发送的第一计量表项, 所述第一计量表项 中携带所述第一计量表项的重要性指示信息, 所述第一计量表项的重要性 指示信息用于指示所述第一计量表项的重要性, 所述第一计量表项包括第 一计量带;
确定模块, 用于确定无法在计量表中添加所述第一计量表项, 以及确 定所述计量表中是否存在第二计量表项, 所述第二计量表项中携带所述第 二计量表项的重要性指示信息, 所述第二计量表项的重要性指示信息用于
指示所述第二计量表项的重要性, 其中, 所述第二计量表项的重要性低于 所述第一计量表项的重要性, 所述第二计量表项包括第二计量带; 所述第 一计量带的数目不大于第一值与所述第二计量带的数目之和, 所述第一值 为所述计量表中可用的计量带的数目;
添加模块, 用于当所述确定模块确定所述计量表中存在所述第二计量 表项时, 删除所述第二计量表项, 且将所述第一计量表项添加到所述计量 表中。
结合第四方面, 在第四方面的第一种可能的实现方式中, 所述确定模 块, 具体用于确定所述计量表中不存在空闲计量表项或所述第一计量带的 数目大于所述第一值。
结合第四方面, 或者第四方面的第一种可能的实现方式, 在第四方面 的第二种可能的实现方式中, 所述交换机还包括: 发送模块;
所述发送模块, 用于在所述确定模块确定无法在计量表中添加所述第 一计量表项之前, 当所述确定模块确定所述计量表中空闲计量表项的个数 大于预先设置的计量表余量上限时, 向所述控制器发送第一消息, 以通知 所述控制器所述计量表中空闲计量表项的个数大于所述计量表余量上限; 当所述确定模块确定所述计量表中空闲计量表项的个数小于预先设置的 计量表余量下限时, 向所述控制器发送第二消息, 以通知所述控制器所述 计量表中空闲计量表项的个数小于所述计量表余量下限; 和 /或,
所述发送模块, 用于在所述确定模块确定无法在计量表中添加所述第 一计量表项之前, 当所述确定模块确定所述计量表中计量带的剩余空间大 于预先设置的计量带余量上限时, 向所述控制器发送第三消息, 以通知所 述控制器所述计量表中计量带的剩余空间大于所述计量带余量上限; 当所 述确定模块确定所述计量表中计量带的剩余空间小于预先设置的计量带 余量下限时, 向所述控制器发送第四消息, 以通知所述控制器所述计量表 中计量带的剩余空间小于计量带余量下限。
本发明实施例第五方面提供一种交换机, 包括: 发送器、 接收器、 存 储器以及分别与所述发送器、 所述接收器和所述存储器连接的处理器; 所述接收器, 用于接收控制器发送的第一组表项, 所述第一组表项中 携带所述第一组表项的重要性指示信息, 所述第一组表项的重要性指示信
息用于指示所述第一组表项的重要性, 所述第一组表项包括第一动作桶; 所述存储器, 用于存储程序代码; 所述程序代码被执行时, 使得所述 处理器执行下述操作: 确定无法在组表中添加所述第一组表项, 以及确定 所述组表中是否存在第二组表项, 所述第二组表项中携带所述第二组表项 的重要性指示信息, 所述第二组表项的重要性指示信息用于指示所述第二 组表项的重要性, 其中, 所述第二组表项的重要性低于所述第一组表项的 重要性, 所述第二组表项包括第二动作桶; 所述第一动作桶的数目不大于 第一值与所述第二动作桶的数目之和, 所述第一值为所述组表中可用的动 作桶的数目; 以及当确定所述组表中存在所述第二组表项时, 删除所述第 二组表项, 且将所述第一组表项添加到所述组表中。
结合第五方面,在第五方面的第一种可能的实现方式中,所述处理器, 具体用于确定所述组表中不存在空闲组表项或所述第一动作桶的数目大 于所述第一值。
结合第五方面或者第五方面的第一种可能的实现方式, 在第五方面的 第二种可能的实现方式中, 所述发送器, 用于在所述处理器确定无法在组 表中添加所述第一组表项之前, 当所述处理器确定所述组表中空闲组表项 的个数大于预先设置的组表余量上限时, 向所述控制器发送第一消息, 以 通知所述控制器所述组表中空闲组表项的个数大于所述组表余量上限; 当 所述处理器确定所述组表中空闲组表项的个数小于预先设置的组表余量 下限时, 向所述控制器发送第二消息, 以通知所述控制器所述组表中空闲 组表项的个数小于所述组表余量下限; 和 /或,
所述发送器, 用于在所述处理器确定无法在组表中添加所述第一组表 项之前, 当所述处理器确定所述组表中动作桶的剩余空间大于预先设置的 动作桶余量上限时, 向所述控制器发送第三消息, 以通知所述控制器所述 组表中动作桶的剩余空间大于所述动作桶余量上限; 当所述处理器确定所 述组表中动作桶的剩余空间小于预先设置的动作桶余量下限时, 向所述控 制器发送第四消息, 以通知所述控制器所述组表中动作桶的剩余空间小于 动作桶余量下限。
本发明第六方面提供一种交换机, 包括: 发送器、 接收器、 存储器以 及分别与所述发送器、 所述接收器和所述存储器连接的处理器;
所述接收器, 用于接收控制器发送的第一计量表项, 所述第一计量表 项中携带所述第一计量表项的重要性指示信息, 所述第一计量表项的重要 性指示信息用于指示所述第一计量表项的重要性, 所述第一计量表项包括 第一计量带;
所述存储器, 用于存储程序代码; 所述程序代码被执行时, 使得所述 处理器执行下述操作: 确定无法在计量表中添加所述第一计量表项, 以及 确定所述计量表中是否存在第二计量表项, 所述第二计量表项中携带所述 第二计量表项的重要性指示信息, 所述第二计量表项的重要性指示信息用 于指示所述第二计量表项的重要性, 其中, 所述第二计量表项的重要性低 于所述第一计量表项的重要性, 所述第二计量表项包括第二计量带; 所述 第一计量带的数目不大于第一值与所述第二计量带的数目之和, 所述第一 值为所述计量表中可用的计量带的数目; 以及当确定所述计量表中存在所 述第二计量表项时, 删除所述第二计量表项, 且将所述第一计量表项添加 到所述计量表中。
结合第六方面,在第六方面的第一种可能的实现方式中,所述处理器, 具体用于确定所述计量表中不存在空闲计量表项或所述第一计量带的数 目大于所述第一值。
结合第六方面或第六方面的第一种可能的实现方式, 在第六方面的第 二种可能的实现方式中, 所述发送器, 用于在所述处理器确定无法在计量 表中添加所述第一计量表项之前, 当所述处理器确定所述计量表中空闲计 量表项的个数大于预先设置的计量表余量上限时, 向所述控制器发送第一 消息, 以通知所述控制器所述计量表中空闲计量表项的个数大于所述计量 表余量上限; 当所述处理器确定所述计量表中空闲计量表项的个数小于预 先设置的计量表余量下限时, 向所述控制器发送第二消息, 以通知所述控 制器所述计量表中空闲计量表项的个数小于所述计量表余量下限; 和 /或, 所述发送器, 用于在所述处理器确定无法在计量表中添加所述第一计 量表项之前, 当所述处理器确定所述计量表中计量带的剩余空间大于预先 设置的计量带余量上限时, 向所述控制器发送第三消息, 以通知所述控制 器所述计量表中计量带的剩余空间大于所述计量带余量上限; 当所述处理 器确定所述计量表中计量带的剩余空间小于预先设置的计量带余量下限
时, 向所述控制器发送第四消息, 以通知所述控制器所述计量表中计量带 的剩余空间小于计量带余量下限。
本发明实施例的有益效果是: 交换机接收控制器发送的第一组表项之 后, 确定无法在组表中添加第一组表项, 则交换机确定上述组表中是否存 在第二组表项, 该第二组表项中携带第二组表项的重要性指示信息, 该第 二组表项的重要性指示信息用于指示第二组表项的重要性, 其中, 第二组 表项的重要性低于第一组表项的重要性, 第二组表项包括第二动作桶; 上 述第一动作桶的数目不大于第一值与第二动作桶的数目之和, 该第一值为 上述组表中可用的动作桶的数目; 如果上述组表中存在第二组表项, 则交 换机删除第二组表项, 且将第一组表项添加到上述组表中; 从而可以实现 在交换机上优先添加重要性较高的组表项, 因此本发明实施例中的交换机 能减少向控制器发送错误消息的次数, 有利于降低控制器的处理负担。 另 夕卜, 本发明实施例能使交换机对重要的组表项进行及时处理, 提高了重要 流的服务质量。 附图说明 为了更清楚地说明本发明实施例中的技术方案, 下面将对实施例描述 中所需要使用的附图作一简单地介绍, 显而易见地, 下面描述中的附图是 本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳 动性的前提下, 还可以根据这些附图获得其他的附图。
图 1为本发明表项添加方法一个实施例的流程图;
图 2为本发明表项添加方法另一个实施例的流程图;
图 3为本发明交换机一个实施例的结构示意图;
图 4为本发明交换机另一个实施例的结构示意图;
图 5为本发明交换机再一个实施例的结构示意图;
图 6为本发明交换机再一个实施例的结构示意图;
图 7为本发明交换机再一个实施例的结构示意图;
图 8为本发明交换机再一个实施例的结构示意图。 具体实施方式
为使本发明实施例的目的、 技术方案和优点更加清楚, 下面将结合本 发明实施例中的附图, 对本发明实施例中的技术方案进行清楚、 完整地描 述, 显然,所描述的实施例是本发明一部分实施例, 而不是全部的实施例。 基于本发明中的实施例, 本领域普通技术人员在没有作出创造性劳动前提 下所获得的所有其他实施例, 都属于本发明保护的范围。
图 1为本发明表项添加方法一个实施例的流程图, 如图 1所示, 该表 项添加方法可以包括:
101, 交换机接收控制器发送的第一组表项, 上述第一组表项中携带 第一组表项的重要性指示信息, 上述第一组表项的重要性指示信息用于指 示第一组表项的重要性, 上述第一组表项包括第一动作桶。
其中, 上述第一组表项的重要性指示信息携带在第一组表项的计数器 字段、 组标识字段或新增字段中。 举例来说, 该新增字段可以为重要性
( Importance ) 字段, 当然本发明实施例并不仅限于此, 本发明实施例对 新增字段的名称不作限定。 另外, 上述第一组表项的重要性指示信息还可 以携带在上述组表的相关流表的某些信息中, 例如指示流表重要性的字段 中。
102, 交换机确定无法在组表中添加上述第一组表项, 该交换机确定 上述组表中是否存在第二组表项。
其中, 上述第二组表项中携带第二组表项的重要性指示信息, 该第二 组表项的重要性指示信息用于指示第二组表项的重要性, 其中, 上述第二 组表项的重要性低于第一组表项的重要性, 上述第二组表项包括第二动作 桶; 第一动作桶的数目不大于第一值与上述第二动作桶的数目之和, 上述 第一值为组表中可用的动作桶的数目。
其中, 上述组表中可用的动作桶的数目为上述组表中所包含动作桶的 最大值与上述组表中已用的动作桶的数目之差。
具体地, 交换机确定无法在组表中添加上述第一组表项可以为: 交换 机确定上述组表中不存在空闲组表项或第一动作桶的数目大于上述第一 值。
103, 如果上述组表中存在上述第二组表项, 则交换机删除上述第二 组表项, 且将上述第一组表项添加到上述组表中。
其中, 上述第二组表项可以为一个组表项, 也可以为多个组表项, 本 发明对此不作限定。
本实施例中, 在交换机确定无法在组表中添加第一组表项之前, 当该 交换机确定上述组表中空闲组表项的个数大于预先设置的组表余量上限 时, 交换机向控制器发送第一消息, 以通知控制器上述组表中空闲组表项 的个数大于上述组表余量上限; 这样, 控制器就可获知该组表中的组表项 还有较多剩余, 这时, 控制器可以加快待添加的组表项的发送速度, 还可 以增加向交换机发送的待添加的组表项的个数。
当交换机确定上述组表中空闲组表项的个数小于预先设置的组表余 量下限时, 交换机向控制器发送第二消息, 以通知控制器上述组表中空闲 组表项的个数小于上述组表余量下限; 这样, 控制器就可获知该组表中的 空闲组表项将被用尽, 这时, 控制器可以减少向交换机发送的待添加的组 表项的个数, 还可以停止向交换机发送待添加的组表项, 以防止组表项溢 出。 其中, 上述组表余量上限和上述组表余量下限可以在具体实现时根据 性能要求和交换机性能等自行设定, 本实施例对上述组表余量上限和上述 组表余量下限的大小不作限定, 举例来说, 上述组表余量上限可以为上述 组表所包含组表项总数的 80%; 上述组表余量下限可以为上述组表所包含 组表项总数的 10%。
另外, 当上述交换机确定上述组表中动作桶的剩余空间大于预先设置 的动作桶余量上限时, 交换机向控制器发送第三消息, 以通知控制器上述 组表中动作桶的剩余空间大于上述动作桶余量上限; 这样, 控制器就可获 知该组表中的动作桶还有较多剩余, 这时, 控制器可以加快待添加的组表 项的发送速度, 还可以增加向交换机发送的待添加的组表项的个数。
当交换机确定上述组表中动作桶的剩余空间小于预先设置的动作桶 余量下限时, 交换机向控制器发送第四消息, 以通知控制器上述组表中动 作桶的剩余空间小于动作桶余量下限; 这样, 控制器就可获知该组表中的 动作桶将被用尽, 这时, 控制器可以减少向交换机发送的待添加的组表项 的个数, 还可以停止向交换机发送待添加的组表项, 以防止动作桶溢出。 其中, 上述动作桶余量上限和上述动作桶余量下限可以在具体实现时根据 性能要求和交换机性能等自行设定, 本实施例对上述动作桶余量上限和上
述动作桶余量下限的大小不作限定, 举例来说, 上述动作桶余量上限可以 为上述组表所包含动作桶总数的 80%; 上述组表余量下限可以为上述组表 所包含动作桶总数的 10%。
上述实施例中, 交换机接收控制器发送的第一组表项之后, 确定无法 在组表中添加第一组表项, 则交换机确定上述组表中是否存在第二组表 项, 该第二组表项中携带第二组表项的重要性指示信息, 该第二组表项的 重要性指示信息用于指示第二组表项的重要性, 其中, 第二组表项的重要 性低于第一组表项的重要性, 第二组表项包括第二动作桶; 上述第一动作 桶的数目不大于第一值与第二动作桶的数目之和, 该第一值为上述组表中 可用的动作桶的数目; 如果上述组表中存在第二组表项, 则交换机删除第 二组表项, 且将第一组表项添加到上述组表中; 从而可以实现在交换机上 优先添加重要性较高的组表项, 因此本发明实施例中的交换机能减少向控 制器发送错误消息的次数, 有利于降低控制器的处理负担。 另外, 本发明 实施例能使交换机对重要的组表项进行及时处理, 提高了重要流的服务质 量。 另外, 交换机还可以向控制器发送消息, 以向控制器通知组表项和 / 或动作桶的余量, 可以防止组表项和 /或动作桶的溢出。
下面以在组表项中新增的字段为重要性字段为例进行说明。
本发明实施例中, 增加重要性字段后的组表项可以如表 2所示。
表 2
表 2中, 重要性字段为新增字段, 该重要性字段携带组表项的重要性 指示信息, 组表项的重要性指示信息用于指示组表项的重要性, 具体地, 上述组表项的重要性指示信息可以为该重要性字段的值, 也就是说, 可以 用上述重要性字段的值来表示组表项的重要性。
本发明实施例可以通过在组表项中增加上述重要性字段解决组表溢出问 题, 进一歩可以分解为解决组表项溢出和动作桶溢出两个问题。
1、 通过重要性字段解决组表项溢出的问题。
当组表项条数达到上述组表所能添加组表项的最大数值
(GROUP— TABLE— MAX— ENTRIES )时, 成功进行组表项置换需要同时满足 两个条件:
( 1 ) 待添加的第一组表项的重要性高于要被置换的组表项的重要性; (2)置换后上述组表所有组表项中动作桶字段的值小于或等于上述组表 的动作桶的最大值 (GROUP— TABLE— MAX— BUCKETS) 。
若 置 换 不 成 功 , 则 向 控 制 器 发 送 错 误 消 息 (OFPGMFC— OUT— OF— GROUPS ) , 等待控制器进一歩处理。
2、 通过重要性字段解决动作桶溢出的问题。
当上述组表所有表项中动作桶字段的值之和达到上述组表的动作桶的最 大值 (GROUP— TABLE— MAX— BUCKETS ) 时, 成功进行组表项置换需要同 时满足两个条件:
( 1 ) 待添加的第一组表项的重要性高于要被置换的组表项的重要性;
(2)置换后上述组表所有组表项中动作桶字段的值小于或等于上述组表 的动作桶的最大值 (GROUP— TABLE— MAX— BUCKETS) 。
若 置 换 不 成 功 , 则 向 控 制 器 发 送 错 误 消 息 (OFPGMFC— OUT— OF— BUCKETS ) , 等待控制器进一歩处理。
下 面 假 设 GROUP— TABLE— MAX— ENTRIES=M , GROUP— TABLE— MAX— BUCKETS=N; 组表项分别为 G G^. ^Gs Gs, 对应 的重要性字段的值分别为 P P ^Ps Ps, 数值由小到大排列且数值越小重要 性越高, 对应的动作桶字段的值分别为^^^…^^^^并假设待添加的组表 项是 待添加的组表项中重要性字段的值为 ^, 动作桶字段的值是 ^。
贝 lj, 该待添加的第一组表项的添加过程如下:
首先, 交换机接收控制器发送的第一组表项 该第一组表项中重要性 字段的值为 , 动作桶字段的值是 ^。
然后, 交换机确定无法在组表中添加第一组表项, 即该交换机确定组表 中不存在空闲组表项或第一动作桶的数目大于第一值, 其中该第一值为上述 组表中可用的动作桶的数目, 其中, 上述组表中可用的动作桶的数目为上述 组表的动作桶的最大值与上述组表中已用的动作桶的数目之差; 也就是说, 交换机确定添加上述第一组表项 之后, 上述组表将发生组表项溢出和 /或动
作桶溢出。
具体地, 如果交换机确定8 = ^1, 即上述组表已添加组表项的个数等于上 述组表所能添加组表项的最大数值, 则交换机确定添加 之后, 该交换机保 存的组表将发生组表项溢出;
如果交换机确定8 < ^1, 并且 + .+ BS.1 + BS + B1> N, 则上述交换 机确定添加 之后, 交换机保存的组表将发生动作桶溢出;
如果交换机确定3 = ^1, + B2 +...+ Bs-1 + Bs + B, > N, 则交换机确 定添加 之后, 上述交换机保存的组表将发生组表项溢出和动作桶溢出。
最后, 一种实现方式中, 交换机比较 Ps和 , 如果 Ps < P., 即 的重要性 低于上述组表已添加表项中重要性最低的组表项, 则交换机向控制器发送错 误消息, 等候外部处理器进一歩处理; 而如果?8 > , 即^的重要性高于上述 组表已添加表项中重要性最低的组表项, 则还需进一歩比较 (B1+B2+...+Bs-i-Bs+Bi) 和 N, 若 (Bi+Bs+. - .+B^-Bs+Bi) ≤N, 即 Bi≤ (N- (Β^+. , .+Β^ ) ) +BS, 也就是说, 第一动作桶的数目不大于第一值与第 二动作桶的数目之和,其中, Bs即为第二动作桶的数目,(N Bi+B^ Bw ) ) 即为第一值, 则表明可以用 置换 Gs, 这时, Gs即为第二组表项, 接下来, 交换机从上述组表中删除 Gs, 并将 添加到上述组表的空闲位置, 这里的空 闲位置即为上述组表在删除 08后获得的位置,也就是 08原本在组表中的位置。
若 (B1+B2+...+Bs-i-Bs+Bi) >N, SPBi> (Ν- (Β^Β^. , .+Β^ ) ) +BS, 贝 lj 表明不可以用 置换 Gs, 这时, 交换机会进一歩
如果 Ps_i ≤ Ρ,, §卩 的重要性低于上述组表已添加表项中重要性次低的组表项, 则交换机向 控制器发送错误消息, 等候外部处理器进一歩处理; 而如果 即 的 重要性高于上述组表已添加表项中重要性次低的组表项, 则交换机进一歩比 较 (B1+B2+...-Bs-i+Bs+Bi)和 N, 若 (B^+. - .-Bs-i+Bs+Bi) ≤N, SPBi≤ (N- (B1+B2+...+Bs-2+Bs) ) + BS-1 , 也就是说, 第一动作桶的数目不大于第一值 与第二动作桶的数目之和, 其中, B 即为第二动作桶的数目, (N- (B1+B2+...+Bs-2+Bs) ) 即为第一值, 则表明可以用 置换 Gs-1, 这时, Gs-1 即为第二组表项, 接下来, 交换机从上述组表中删除 Gs_ 并将 添加到上述 组表的空闲位置, 这里的空闲位置即为上述组表在删除 Gs_i后获得的位置, 也 就是 Gs_i原本在组表中的位置。
若(Bi+Bs+. - .-B^+Bs+Bi) >N, 即 Bi> (N- (Β1+Β2+...+Β8-2+Β8) ) + BS-1, 则表明不可以用 置换 Gs_i, 这时, 交换机可以进一歩比较 (B1+B2+...-Bs-i-Bs+B1) 和 N, 如果 (B1+B2+...-Bs-i-Bs+B1) ≤N, 即 ¾≤ (N- (Β!+Β2+...+Β8-2 ) ) + BS + BS-1 , 则表明可以用 置换 Gs和 Gs-1, 这时, 第二 组表项包括 Gs和 Gs_ 于是交换机从上述组表中删除 Gs和 Gs_ 并将 添加到 上述组表的空闲位置,这里的空闲位置即为上述组表在删除 Gs和 Gs_i后获得的 位置, 具体地, 交换机可以将 添加到 原本在组表中的位置, 也可以将 添加到 08原本在组表中的位置。
而如果(Bi+B^. - .-Bw-Bs+Bi^N,即:^;^^:^+:^+…+:^^ +:^- :^, 则表明不可以用 置换 Gs和 Gs_ 这时, 交换机可以进一歩比较?8_2和 , 如 果 Ps_2 < Ρ,, 即 的重要性低于 Gs_2的重要性, 则交换机向控制器发送错误消 息, 等候外部处理器进一歩处理; 而如果 Ps_2 > , 即 的重要性高于 Gs_2的 重要性, 则交换机进一歩比较 (:^+:^+…+:^^ -:^^+:^^+:^+:^) 和 N, 如 ¾ (B!+B2+...+ Bs-3 - Bs-2 + Bs-i+Bs+Bi)≤N,即 ¾≤ (N- ( B!+B2+...+ Bs-3 +Bs-i+ Bs) ) + BS_2, 则表明可以用 置换 Gs_2, 这时, 第二组表项即为 Gs_2, 于是交 换机从上述组表中删除 Gs_2, 并将 添加到上述组表的空闲位置, 这里的空闲 位置即为上述组表在删除 Gs_2后获得的位置, 也就是 Gs_2原本在组表中的位 置。
而如果 ( B!+B2+...+ Bs-3 - Bs-2 + Bs-i+Bs+Bi) >Ν, §ΡΒι> (N- (B!+B2+...+ Bs-3 +Bs-1+ Bs) ) + Bs_2, 则表明不可以用 置换 Gs_2, 这时, 交换机可以进一 歩比较 ( B!+B2+...+ Bs-3 - Bs-2 + Bs-i-Bs+Bi)和 N, 如果 (B!+B2+...+ Bs-3 - Bs-2 + BS-1-BS+B1) ≤N, SPB^ (N- (B^+. - .+ B^ +Bs-i ) ) + Bs + Bs-2, 贝 Ij表明 可以用 置换 Gs和 Gs_2, 这时, 第二组表项包括 Gs和 Gs_2, 于是交换机从上述 组表中删除 G^PGS_2, 并将 添加到上述组表的空闲位置, 这里的空闲位置即 为上述组表在删除 Gs和 08_2后获得的位置, 具体地, 交换机可以将 添加到 Gs_2原本在组表中的位置, 也可以将 添加到 Gs原本在组表中的位置。
以此类推, 交换机总是按照删除的第二组表项的个数最少且重要性最低 的原则, 将上述组表已添加组表项中重要性低于上述第一组表项的第二组表 项删除, 然后将第一组表项添加到上述组表中。
另一种实现方式中, 交换机比较 Ps和 , 如果 Ps < , 即 的重要性低于
上述组表已添加表项中重要性最低的组表项, 则交换机向控制器发送错误消 息, 等候外部处理器进一歩处理; 而如果?8 > , 即 的重要性高于上述组表 已添加表项 中 重要性最低 的组表项 , 则还需进一歩 比较
( B1+B2+...+Bs-i-Bs+Bi) 和 N, 若 (Bi+B^. - .+B^-Bs+Bi) ≤N, 即 Bi≤ (N- (Β^+. , .+Β^ ) ) +BS, 也就是说, 第一动作桶的数目不大于第一值与第 二动作桶的数目之和,其中, Bs即为第二动作桶的数目,(N Bi+B^ Bw ) ) 即为第一值, 则表明可以用 置换 Gs, 这时, Gs即为第二组表项, 接下来, 交换机从上述组表中删除 Gs, 并将 添加到上述组表的空闲位置, 这里的空 闲位置即为上述组表在删除 Gs后获得的位置,也就是 Gs原本在组表中的位置。
若 (B1+B2+...+Bs-i-Bs+Bi) >Ν, §ΡΒι> (Ν- (Β^Β^. , .+Β^ ) ) +BS, 贝 lj 表明不可以用 置换 Gs, 这时, 交换机会进一歩
如果 Ps_i ≤ Ρ,, §卩 的重要性低于上述组表已添加表项中重要性次低的组表项, 则交换机向 控制器发送错误消息, 等候外部处理器进一歩处理; 而如果 即 的 重要性高于上述组表已添加表项中重要性次低的组表项, 则交换机进一歩比 较(Bi+Bs+. - .-Bw+Bs+Bi)和 N, 若(Β Β^. , .-Β^+Β^Β ) ≤Ν, 即 Bi≤ (N- (B1+B2+...+Bs-2+Bs) ) + BS-1 , 也就是说, 第一动作桶的数目不大于第一值 与第二动作桶的数目之和, 其中, B 即为第二动作桶的数目, (N- (B1+B2+...+Bs-2+Bs) ) 即为第一值, 则表明可以用 置换 Gs-1, 这时, Gs-1 即为第二组表项, 接下来, 交换机从上述组表中删除 Gs_ 并将 添加到上述 组表的空闲位置, 这里的空闲位置即为上述组表在删除 Gs_i后获得的位置, 也 就是 原本在组表中的位置。
若 (B1+B2+...-Bs-i+Bs+Bi) >N, SPBi> (Ν- (Β1+Β2+...+Β8-2+Β8) ) + BS-1, 则表明不可以用 置换 Gs_ 这时, 交换机会进一歩
如果 Ps_2 ≤ Ρ,, 即 的重要性低于上述组表已添加表项中重要性第三低的组表项, 则交换 机向控制器发送错误消息, 等候外部处理器进一歩处理; 而如果 Ρ Ρ 即 的重要性高于上述组表已添加表项中重要性次低的组表项, 则交换机进一 歩比较(Β ..-Bs-2+Bs.i+Bs+Bi)和 Ν,若(Β . ,Bs-2+Bs-1+Bs+Bi)≤N, 即 (N-
) + Bs-2, 也就是说, 第一动作桶的数 目不大于第一值与第二动作桶的数目之和,其中, Bs_2即为第二动作桶的数目, (N- (B1+B2+...+Bs-3+Bs-1+Bs) ) 即为第一值, 则表明可以用 置换 Gs-2, 这
时, Gs_2即为第二组表项, 接下来, 交换机从上述组表中删除 Gs_2, 并将 添 加到上述组表的空闲位置,这里的空闲位置即为上述组表在删除 Gs_2后获得的 位置, 也就是 Gs_2原本在组表中的位置。
以此类推, 交换机按照上述组表已添加表项的重要性由低到高的顺序, 依次对比待安装的第一组表项与上述组表已添加表项的重要性, 每次仅对比 已添加表项中的一个组表项与第一组表项的重要性, 若对比的已添加表项符 合第二组表项的条件, 则将该对比的已添加表项删除, 将第一组表项添加到 上述组表中。
需要说明的是,交换机确定添加上述待添加的第一组表项 之后, 该 交换机保存的组表将发生组表项溢出和 /或动作桶溢出时,交换机均可以通 过上述过程将 添加到上述组表中, 区别仅在于当不能用 置换上述组 表中的已添加表项时, 交换机向控制器发送的错误代码不同, 例如, 当发 生组表项溢出时, 如果不能 置换上述组表中的已添加表项, 则发送 OFPGMFC— OUT— OF— GROUPS; 而当发生动作桶溢出时, 如果不能 置 换上述组表中的已添加表项, 则发送 OFPGMFC— OUT— OF— BUCKETS。
图 2为本发明表项添加方法另一个实施例的流程图, 如图 2所示, 该 表项添加方法可以包括:
201 , 交换机接收控制器发送的第一计量表项, 上述第一计量表项中 携带第一计量表项的重要性指示信息, 上述第一计量表项的重要性指示信 息用于指示第一计量表项的重要性, 上述第一计量表项包括第一计量带。
其中, 上述第一计量表项的重要性指示信息携带在第一计量表项的计 数器字段、 计量标识字段或新增字段中。 举例来说, 该新增字段可以为重 要性 (Importance ) 字段, 当然本发明实施例并不仅限于此, 本发明实施 例对新增字段的名称不作限定。 另外, 上述第一计量表项的重要性指示信 息还可以携带在上述计量表的相关流表的某些信息中, 例如指示流表重要 性的字段中。
202, 交换机确定无法在计量表中添加第一计量表项, 该交换机确定 上述计量表中是否存在第二计量表项。
其中, 上述第二计量表项中携带第二计量表项的重要性指示信息, 该 第二计量表项的重要性指示信息用于指示第二计量表项的重要性, 其中,
上述第二计量表项的重要性低于第一计量表项的重要性, 上述第二计量表 项包括第二计量带; 第一计量带的数目不大于第一值与第二计量带的数目 之和, 上述第一值为上述计量表中可用的计量带的数目。
其中, 上述计量表中可用的计量带的数目为上述计量表中计量带的最 大值与上述计量表中已用计量带的数目之差。
具体地, 交换机确定无法在计量表中添加第一计量表项可以为: 交换 机确定上述计量表中不存在空闲计量表项或上述第一计量带的数目大于 第一值。
203, 当上述计量表中存在上述第二计量表项时, 交换机删除上述第 二计量表项, 且将上述第一计量表项添加到上述计量表中。
其中, 上述第二计量表项可以为一个计量表项, 也可以为多个计量表 项, 本发明对此不作限定。
本实施例中, 在交换机确定无法在计量表中添加第一计量表项之前, 当上述交换机确定上述计量表中空闲计量表项的个数大于预先设置的计 量表余量上限时, 交换机向控制器发送第一消息, 以通知控制器上述计量 表中空闲计量表项的个数大于上述计量表余量上限; 这样, 控制器就可获 知该计量表中的计量表项还有较多剩余, 这时, 控制器可以加快待添加的 计量表项的发送速度, 还可以增加向交换机发送的待添加的计量表项的个 数。
当上述交换机确定上述计量表中空闲计量表项的个数小于预先设置 的计量表余量下限时, 交换机向控制器发送第二消息, 以通知控制器上述 计量表中空闲计量表项的个数小于上述计量表余量下限; 这样, 控制器就 可获知该计量表中的空闲计量表项将被用尽, 这时, 控制器可以减少向交 换机发送的待添加的计量表项的个数, 还可以停止向交换机发送待添加的 计量表项, 以防止计量表项溢出。 其中, 上述计量表余量上限和上述计量 表余量下限可以在具体实现时根据性能要求和交换机性能等自行设定, 本 实施例对上述计量表余量上限和上述计量表余量下限的大小不作限定, 举 例来说, 上述计量表余量上限可以为上述计量表所包含计量表项总数的 80%;上述计量表余量下限可以为上述计量表所包含计量表项总数的 10%。
另外, 当上述交换机确定上述计量表中计量带的剩余空间大于预先设
置的计量带余量上限时, 交换机向控制器发送第三消息, 以通知控制器上 述计量表中计量带的剩余空间大于上述计量带余量上限; 这样, 控制器就 可获知该计量表中的动作桶还有较多剩余, 这时, 控制器可以加快待添加 的计量表项的发送速度, 还可以增加向交换机发送的待添加的计量表项的 个数。
当上述交换机确定上述计量表中计量带的剩余空间小于预先设置的 计量带余量下限时, 交换机向控制器发送第四消息, 以通知控制器上述计 量表中计量带的剩余空间小于计量带余量下限。 这样, 控制器就可获知该 计量表中的计量带将被用尽, 这时, 控制器可以减少向交换机发送的待添 加的计量表项的个数, 还可以停止向交换机发送待添加的计量表项, 以防 止计量带溢出。 其中, 上述计量带余量上限和上述计量带余量下限可以在 具体实现时根据性能要求和交换机性能等自行设定, 本实施例对上述计量 带余量上限和上述计量带余量下限的大小不作限定, 举例来说, 上述计量 带余量上限可以为上述计量表所包含计量带总数的 80%; 上述计量带余量 下限可以为上述计量表所包含计量带总数的 10%。
上述实施例中, 交换机接收控制器发送的第一计量表项之后, 确定无 法在组表中添加第一计量表项, 则交换机确定上述计量表中是否存在第二 计量表项, 该第二计量表项中携带第二计量表项的重要性指示信息, 该第 二计量表项的重要性指示信息用于指示第二计量表项的重要性, 其中, 第 二计量表项的重要性低于第一计量表项的重要性, 第二计量表项包括第二 计量带; 上述第一计量带的数目不大于第一值与第二动作桶的数目之和, 该第一值为上述计量表中可用的计量带的数目; 如果上述计量表中存在第 二计量表项, 则交换机删除第二计量表项, 且将第一计量表项添加到上述 计量表中; 从而可以实现在交换机上优先添加重要性较高的计量表项, 因 此本发明实施例中的交换机能减少向控制器发送错误消息的次数, 有利于 降低控制器的处理负担。 另外, 本发明实施例能使交换机对重要的计量表 项进行及时处理, 提高了重要流的服务质量。 另外, 交换机还可以向控制 器发送消息, 以向控制器通知计量表项和 /或计量带的余量, 可以防止计量 表项和 /或计量带的溢出。
本实施例中计量表项的添加过程与组表项的添加过程相同, 因此计量
表项的添加过程可以参见上述实施例中对组表项的添加过程的描述, 在此 不再赘述。
本领域普通技术人员可以理解: 实现上述方法实施例的全部或部分可 以通过程序指令相关的硬件来完成, 前述的程序可以存储于一计算机可读 取存储介质中, 该程序在执行时, 执行包括上述方法实施例的; 而前述的 存储介质包括: ROM、 RAM, 磁碟或者光盘等各种可以存储程序代码的 介质。
图 3为本发明交换机一个实施例的结构示意图, 本实施例中的交换机 可以实现图 1所示实施例的流程, 如图 3所示, 该交换机可以包括: 接收 模块 31、 确定模块 32和添加模块 33 ;
接收模块 31, 用于接收控制器发送的第一组表项, 上述第一组表项中 携带第一组表项的重要性指示信息, 上述第一组表项的重要性指示信息用 于指示第一组表项的重要性, 上述第一组表项包括第一动作桶。
其中, 上述第一组表项的重要性指示信息携带在第一组表项的计数器 字段、 组标识字段或新增字段中。 举例来说, 该新增字段可以为重要性字 段, 当然本发明实施例并不仅限于此, 本发明实施例对新增字段的名称不 作限定。 另外, 上述第一组表项的重要性指示信息还可以携带在上述组表 的相关流表的某些信息中, 例如指示流表重要性的字段中。
确定模块 32, 用于确定无法在组表中添加上述第一组表项, 以及确定 上述组表中是否存在第二组表项, 上述第二组表项中携带第二组表项的重 要性指示信息, 上述第二组表项的重要性指示信息用于指示第二组表项的 重要性, 其中, 第二组表项的重要性低于第一组表项的重要性, 第二组表 项包括第二动作桶; 第一动作桶的数目不大于第一值与上述第二动作桶的 数目之和, 该第一值为上述组表中可用的动作桶的数目; 其中, 上述组表 中可用的动作桶的数目为上述组表的动作桶的最大值与上述组表中已用 的动作桶的数目之差。
添加模块 33,用于当确定模块 32确定上述组表中存在第二组表项时, 删除上述第二组表项, 且将第一组表项添加到上述组表中。 其中, 上述第 二组表项可以为一个组表项,也可以为多个组表项,本发明对此不作限定。
其中, 确定模块 32, 具体用于确定上述组表中不存在空闲组表项或上
述第一动作桶的数目大于第一值。
上述交换机中, 接收模块 3 1 接收控制器发送的第一组表项之后, 确 定模块 32确定无法在组表中添加第一组表项, 则确定模块 32确定上述组 表中是否存在第二组表项, 该第二组表项中携带第二组表项的重要性指示 信息, 该第二组表项的重要性指示信息用于指示第二组表项的重要性, 其 中, 第二组表项的重要性低于第一组表项的重要性, 第二组表项包括第二 动作桶; 上述第一动作桶的数目不大于第一值与第二动作桶的数目之和, 该第一值为上述组表中可用的动作桶的数目; 如果上述组表中存在第二组 表项, 则添加模块 33 删除第二组表项, 且将第一组表项添加到上述组表 中; 从而可以实现在交换机上优先添加重要性较高的组表项, 因此, 本发 明实施例中的交换机能减少向控制器发送错误消息的次数, 有利于降低控 制器的处理负担。 另外, 本发明实施例能使交换机对重要的组表项进行及 时处理, 提高了重要流的服务质量。
图 4为本发明交换机另一个实施例的结构示意图, 与图 3所示的交换 机相比, 不同之处在于, 图 4所示的交换机中还包括: 发送模块 34 ; 发送模块 34, 用于在确定模块 32确定无法在组表中添加第一组表项 之前, 当确定模块 32确定上述组表中空闲组表项的个数大于预先设置的 组表余量上限时, 向控制器发送第一消息, 以通知控制器上述组表中空闲 组表项的个数大于组表余量上限; 当确定模块 32确定上述组表中空闲组 表项的个数小于预先设置的组表余量下限时, 向控制器发送第二消息, 以 通知控制器上述组表中空闲组表项的个数小于组表余量下限; 和 /或, 发送模块 34, 用于在确定模块 32确定无法在组表中添加第一组表项 之前, 当确定模块 32确定上述组表中动作桶的剩余空间大于预先设置的 动作桶余量上限时, 向控制器发送第三消息, 以通知控制器上述组表中动 作桶的剩余空间大于上述动作桶余量上限; 当确定模块 32确定上述组表 中动作桶的剩余空间小于预先设置的动作桶余量下限时, 向控制器发送第 四消息, 以通知控制器上述组表中动作桶的剩余空间小于动作桶余量下 限。
其中, 上述组表余量上限和上述组表余量下限可以在具体实现时根据 性能要求和交换机性能等自行设定, 本实施例对上述组表余量上限和上述 组表余量下限的大小不作限定, 举例来说, 上述组表余量上限可以为上述
组表所包含组表项总数的 80%; 上述组表余量下限可以为上述组表所包含 组表项总数的 10%。
上述动作桶余量上限和上述动作桶余量下限可以在具体实现时根据 性能要求和交换机性能等自行设定, 本实施例对上述动作桶余量上限和上 述动作桶余量下限的大小不作限定, 举例来说, 上述动作桶余量上限可以 为上述组表所包含动作桶总数的 80%; 上述组表余量下限可以为上述组表 所包含动作桶总数的 10%。
上述实施例中, 发送模块 34可以向控制器发送消息, 以向控制器通 知组表项和 /或动作桶的余量, 可以防止组表项和 /或动作桶的溢出。
图 5为本发明交换机再一个实施例的结构示意图, 本实施例中的交换 机可以实现本发明图 1所示实施例的流程。 如图 5所示, 该交换机可以包 括: 发送器 41、 接收器 42、 存储器 43 以及分别与发送器 41、 接收器 42 和存储器 43连接的处理器 44; 当然, 该交换机还可以包括输入输出装置 等通用部件, 本发明实施例在此不作任何限制。
其中, 接收器 42, 用于接收控制器发送的第一组表项, 上述第一组表 项中携带第一组表项的重要性指示信息, 上述第一组表项的重要性指示信 息用于指示第一组表项的重要性, 上述第一组表项包括第一动作桶。
其中, 上述第一组表项的重要性指示信息携带在第一组表项的计数器 字段、 组标识字段或新增字段中。 举例来说, 该新增字段可以为重要性字 段, 当然本发明实施例并不仅限于此, 本发明实施例对新增字段的名称不 作限定。 另外, 上述第一组表项的重要性指示信息还可以携带在上述组表 的相关流表的某些信息中, 例如指示流表重要性的字段中。
存储器 43, 用于存储程序代码; 所述程序代码被执行时, 使得处理器 44执行下述操作: 确定无法在组表中添加上述第一组表项, 以及确定上述 组表中是否存在第二组表项, 上述第二组表项中携带第二组表项的重要性 指示信息, 上述第二组表项的重要性指示信息用于指示第二组表项的重要 性, 其中, 第二组表项的重要性低于第一组表项的重要性, 第二组表项包 括第二动作桶; 第一动作桶的数目不大于第一值与上述第二动作桶的数目 之和, 该第一值为上述组表中可用的动作桶的数目; 其中, 上述组表中可 用的动作桶的数目为上述组表的动作桶的最大值与上述组表中已用的动 作桶的数目之差; 以及当确定上述组表中存在第二组表项时, 删除上述第
二组表项, 且将第一组表项添加到上述组表中。 其中, 上述第二组表项可 以为一个组表项, 也可以为多个组表项, 本发明对此不作限定。
本实施例中, 处理器 44, 具体用于确定上述组表中不存在空闲组表项 或上述第一动作桶的数目大于第一值。
本实施例中, 发送器 41, 用于在处理器 44确定无法在组表中添加上 述第一组表项之前, 当处理器 44确定上述组表中空闲组表项的个数大于 预先设置的组表余量上限时, 向上述控制器发送第一消息, 以通知控制器 上述组表中空闲组表项的个数大于上述组表余量上限; 当处理器 44确定 上述组表中空闲组表项的个数小于预先设置的组表余量下限时, 向控制器 发送第二消息, 以通知控制器上述组表中空闲组表项的个数小于上述组表 余量下限; 和 /或,
发送器 41,用于在处理器 44确定无法在组表中添加第一组表项之前, 当处理器 44确定上述组表中动作桶的剩余空间大于预先设置的动作桶余 量上限时, 向控制器发送第三消息, 以通知控制器上述组表中动作桶的剩 余空间大于上述动作桶余量上限; 当处理器 44确定上述组表中动作桶的 剩余空间小于预先设置的动作桶余量下限时, 向控制器发送第四消息, 以 通知控制器上述组表中动作桶的剩余空间小于动作桶余量下限。
其中, 上述组表余量上限和上述组表余量下限可以在具体实现时根据 性能要求和交换机性能等自行设定, 本实施例对上述组表余量上限和上述 组表余量下限的大小不作限定, 举例来说, 上述组表余量上限可以为上述 组表所包含组表项总数的 80%; 上述组表余量下限可以为上述组表所包含 组表项总数的 10%。
上述动作桶余量上限和上述动作桶余量下限可以在具体实现时根据 性能要求和交换机性能等自行设定, 本实施例对上述动作桶余量上限和上 述动作桶余量下限的大小不作限定, 举例来说, 上述动作桶余量上限可以 为上述组表所包含动作桶总数的 80%; 上述组表余量下限可以为上述组表 所包含动作桶总数的 10%。
上述交换机中, 接收器 42接收控制器发送的第一组表项之后, 处理 器 44确定无法在组表中添加第一组表项, 则处理器 44确定上述组表中是 否存在第二组表项, 该第二组表项中携带第二组表项的重要性指示信息, 该第二组表项的重要性指示信息用于指示第二组表项的重要性, 其中, 第
二组表项的重要性低于第一组表项的重要性, 第二组表项包括第二动作 桶; 上述第一动作桶的数目不大于第一值与第二动作桶的数目之和, 该第 一值为上述组表中可用的动作桶的数目; 如果上述组表中存在第二组表 项, 则处理器 44删除第二组表项, 且将第一组表项添加到上述组表中; 从而可以实现在交换机上优先添加重要性较高的组表项, 因此本发明实施 例中的交换机能减少向控制器发送错误消息的次数, 有利于降低控制器的 处理负担。另外,本发明实施例能使交换机对重要的组表项进行及时处理, 提高了重要流的服务质量。 另外, 发送器 41 还可以向控制器发送消息, 以向控制器通知组表项和 /或动作桶的余量, 可以防止组表项和 /或动作桶 的溢出。
图 6为本发明交换机再一个实施例的结构示意图, 本实施例中的交换 机可以实现图 2所示实施例的流程, 如图 6所示, 该交换机可以包括: 接 收模块 51、 确定模块 52和添加模块 53 ;
接收模块 51, 用于接收控制器发送的第一计量表项, 上述第一计量表 项中携带第一计量表项的重要性指示信息, 上述第一计量表项的重要性指 示信息用于指示第一计量表项的重要性, 上述第一计量表项包括第一计量 带。
其中, 上述第一计量表项的重要性指示信息携带在第一计量表项的计 数器字段、 组标识字段或新增字段中。 举例来说, 该新增字段可以为重要 性字段, 当然本发明实施例并不仅限于此, 本发明实施例对新增字段的名 称不作限定。 另外, 上述第一计量表项的重要性指示信息还可以携带在上 述计量表的相关流表的某些信息中, 例如指示流表重要性的字段中。
确定模块 52, 用于确定无法在计量表中添加上述第一计量表项, 以及 确定上述计量表中是否存在第二计量表项, 上述第二计量表项中携带第二 计量表项的重要性指示信息, 上述第二计量表项的重要性指示信息用于指 示第二计量表项的重要性, 其中, 第二计量表项的重要性低于第一计量表 项的重要性, 第二计量表项包括第二计量带; 第一计量带的数目不大于第 一值与上述第二计量带的数目之和, 该第一值为上述计量表中可用的计量 带的数目; 其中, 上述计量表中可用的计量带的数目为上述计量表的计量 带的最大值与上述计量表中已用的计量带的数目之差。
添加模块 53, 用于当确定模块 52确定上述计量表中存在第二计量表
项时, 删除上述第二计量表项, 且将第一计量表项添加到上述计量表中。 其中, 上述第二计量表项可以为一个计量表项, 也可以为多个计量表项, 本发明对此不作限定。
其中, 确定模块 52, 具体用于确定上述计量表中不存在空闲计量表项 或上述第一计量带的数目大于第一值。
上述交换机中, 接收模块 51 接收控制器发送的第一计量表项之后, 确定模块 52确定无法在计量表中添加第一计量表项, 则确定模块 52确定 上述计量表中是否存在第二计量表项, 该第二计量表项中携带第二计量表 项的重要性指示信息, 该第二计量表项的重要性指示信息用于指示第二计 量表项的重要性, 其中, 第二计量表项的重要性低于第一计量表项的重要 性, 第二计量表项包括第二计量带; 上述第一计量带的数目不大于第一值 与第二计量带的数目之和, 该第一值为上述计量表中可用的计量带的数 目; 如果上述计量表中存在第二计量表项, 则添加模块 53 删除第二计量 表项, 且将第一计量表项添加到上述计量表中; 从而可以实现在交换机上 优先添加重要性较高的计量表项, 因此, 本发明实施例中的交换机能减少 向控制器发送错误消息的次数, 有利于降低控制器的处理负担。 另外, 本 发明实施例能使交换机对重要的计量表项进行及时处理, 提高了重要流的 服务质量。
图 7为本发明交换机再一个实施例的结构示意图, 与图 6所示的交换 机相比, 不同之处在于, 图 7所示的交换机中还包括: 发送模块 54 ; 发送模块 54, 用于在确定模块 52确定无法在计量表中添加第一计量 表项之前, 当确定模块 52确定上述计量表中空闲计量表项的个数大于预 先设置的计量表余量上限时, 向控制器发送第一消息, 以通知控制器上述 计量表中空闲计量表项的个数大于计量表余量上限; 当确定模块 52确定 上述计量表中空闲计量表项的个数小于预先设置的计量表余量下限时, 向 控制器发送第二消息, 以通知控制器上述计量表中空闲计量表项的个数小 于计量表余量下限; 和 /或,
发送模块 54, 用于在确定模块 52确定无法在计量表中添加第一计量 表项之前, 当确定模块 52确定上述计量表中计量带的剩余空间大于预先 设置的计量带余量上限时, 向控制器发送第三消息, 以通知控制器上述计 量表中计量带的剩余空间大于上述计量带余量上限; 当确定模块 52确定
上述计量表中计量带的剩余空间小于预先设置的计量带余量下限时, 向控 制器发送第四消息, 以通知控制器上述计量表中计量带的剩余空间小于计 量带余量下限。
其中, 上述计量表余量上限和上述计量表余量下限可以在具体实现时 根据性能要求和交换机性能等自行设定, 本实施例对上述计量表余量上限 和上述计量表余量下限的大小不作限定, 举例来说, 上述计量表余量上限 可以为上述计量表所包含计量表项总数的 80%; 上述计量表余量下限可以 为上述计量表所包含计量表项总数的 10%。
上述计量带余量上限和上述计量带余量下限可以在具体实现时根据 性能要求和交换机性能等自行设定, 本实施例对上述计量带余量上限和上 述计量带余量下限的大小不作限定, 举例来说, 上述计量带余量上限可以 为上述计量表所包含计量带总数的 80%; 上述计量表余量下限可以为上述 计量表所包含计量带总数的 10%。
上述实施例中, 发送模块 54可以向控制器发送消息, 以向控制器通 知计量表项和 /或计量带的余量, 可以防止计量表项和 /或计量带的溢出。
图 8为本发明交换机再一个实施例的结构示意图, 本实施例中的交换 机可以实现本发明图 2所示实施例的流程。 如图 8所示, 该交换机可以包 括: 发送器 71、 接收器 72、 存储器 73 以及分别与发送器 71、 接收器 72 和存储器 73连接的处理器 74; 当然, 该交换机还可以包括输入输出装置 等通用部件, 本发明实施例在此不作任何限制。
其中, 接收器 72, 用于接收控制器发送的第一计量表项, 上述第一计 量表项中携带第一计量表项的重要性指示信息, 上述第一计量表项的重要 性指示信息用于指示第一计量表项的重要性, 上述第一计量表项包括第一 计量带。
其中, 上述第一计量表项的重要性指示信息携带在第一计量表项的计 数器字段、 组标识字段或新增字段中。 举例来说, 该新增字段可以为重要 性字段, 当然本发明实施例并不仅限于此, 本发明实施例对新增字段的名 称不作限定。 另外, 上述第一计量表项的重要性指示信息还可以携带在上 述计量表的相关流表的某些信息中, 例如指示流表重要性的字段中。
存储器 73, 用于存储程序代码; 所述程序代码被执行时, 使得处理器
74执行下述操作: 确定无法在计量表中添加上述第一计量表项, 以及确定
上述计量表中是否存在第二计量表项, 上述第二计量表项中携带第二计量 表项的重要性指示信息, 上述第二计量表项的重要性指示信息用于指示第 二计量表项的重要性, 其中, 第二计量表项的重要性低于第一计量表项的 重要性, 第二计量表项包括第二计量带; 第一计量带的数目不大于第一值 与上述第二计量带的数目之和, 该第一值为上述计量表中可用的计量带的 数目; 其中, 上述计量表中可用的计量带的数目为上述计量表的计量带的 最大值与上述计量表中已用的计量带的数目之差; 以及当确定上述计量表 中存在第二计量表项时, 删除上述第二计量表项, 且将第一计量表项添加 到上述计量表中。 其中, 上述第二计量表项可以为一个计量表项, 也可以 为多个计量表项, 本发明对此不作限定。
本实施例中, 处理器 74, 具体用于确定上述计量表中不存在空闲计量 表项或上述第一计量带的数目大于第一值。
本实施例中, 发送器 71, 用于在处理器 74确定无法在计量表中添加 上述第一计量表项之前, 当处理器 74确定上述计量表中空闲计量表项的 个数大于预先设置的计量表余量上限时, 向上述控制器发送第一消息, 以 通知控制器上述计量表中空闲计量表项的个数大于上述计量表余量上限; 当处理器 74确定上述计量表中空闲计量表项的个数小于预先设置的计量 表余量下限时, 向控制器发送第二消息, 以通知控制器上述计量表中空闲 计量表项的个数小于上述计量表余量下限; 和 /或,
发送器 71, 用于在处理器 74确定无法在计量表中添加第一计量表项 之前, 当处理器 74确定上述计量表中计量带的剩余空间大于预先设置的 计量带余量上限时, 向控制器发送第三消息, 以通知控制器上述计量表中 计量带的剩余空间大于上述计量带余量上限; 当处理器 74确定上述计量 表中计量带的剩余空间小于预先设置的计量带余量下限时, 向控制器发送 第四消息, 以通知控制器上述计量表中计量带的剩余空间小于计量带余量 下限。
其中, 上述计量表余量上限和上述计量表余量下限可以在具体实现时 根据性能要求和交换机性能等自行设定, 本实施例对上述计量表余量上限 和上述计量表余量下限的大小不作限定, 举例来说, 上述计量表余量上限 可以为上述计量表所包含计量表项总数的 80%; 上述计量表余量下限可以 为上述计量表所包含计量表项总数的 10%。
上述计量带余量上限和上述计量带余量下限可以在具体实现时根据 性能要求和交换机性能等自行设定, 本实施例对上述计量带余量上限和上 述计量带余量下限的大小不作限定, 举例来说, 上述计量带余量上限可以 为上述计量表所包含计量带总数的 80%; 上述计量表余量下限可以为上述 计量表所包含计量带总数的 10%。
上述交换机中, 接收器 72接收控制器发送的第一计量表项之后, 处 理器 74确定无法在计量表中添加第一计量表项, 则处理器 74确定上述计 量表中是否存在第二计量表项, 该第二计量表项中携带第二计量表项的重 要性指示信息, 该第二计量表项的重要性指示信息用于指示第二计量表项 的重要性, 其中, 第二计量表项的重要性低于第一计量表项的重要性, 第 二计量表项包括第二计量带; 上述第一计量带的数目不大于第一值与第二 计量带的数目之和, 该第一值为上述计量表中可用的计量带的数目; 如果 上述计量表中存在第二计量表项, 则处理器 74删除第二计量表项, 且将 第一计量表项添加到上述计量表中; 从而可以实现在交换机上优先添加重 要性较高的计量表项, 因此本发明实施例中的交换机能减少向控制器发送 错误消息的次数, 有利于降低控制器的处理负担。 另外, 本发明实施例能 使交换机对重要的计量表项进行及时处理, 提高了重要流的服务质量。 另 夕卜, 发送器 71还可以向控制器发送消息, 以向控制器通知计量表项和 /或 计量带的余量, 可以防止计量表项和 /或计量带的溢出。
本领域技术人员可以理解附图只是一个优选实施例的示意图, 附图中 的模块或流程并不一定是实施本发明所必须的。
本领域技术人员可以理解实施例中的装置中的模块可以按照实施例 描述进行分布于实施例的装置中, 也可以进行相应变化位于不同于本实施 例的一个或多个装置中。 上述实施例的模块可以合并为一个模块, 也可以 进一歩拆分成多个子模块。
最后应说明的是: 以上实施例仅用以说明本发明的技术方案, 而非对 其限制; 尽管参照前述实施例对本发明进行了详细的说明, 本领域的普通 技术人员应当理解: 其依然可以对前述各实施例所记载的技术方案进行修 改, 或者对其中部分技术特征进行等同替换; 而这些修改或者替换, 并不 使相应技术方案的本质脱离本发明各实施例技术方案的范围。
Claims
1、 一种表项添加方法, 其特征在于, 包括:
交换机接收控制器发送的第一组表项, 所述第一组表项中携带所述第 一组表项的重要性指示信息, 所述第一组表项的重要性指示信息用于指示 所述第一组表项的重要性, 所述第一组表项包括第一动作桶;
所述交换机确定无法在组表中添加所述第一组表项, 所述交换机确定 所述组表中是否存在第二组表项, 所述第二组表项中携带所述第二组表项 的重要性指示信息, 所述第二组表项的重要性指示信息用于指示所述第二 组表项的重要性, 其中, 所述第二组表项的重要性低于所述第一组表项的 重要性, 所述第二组表项包括第二动作桶; 所述第一动作桶的数目不大于 第一值与所述第二动作桶的数目之和, 所述第一值为所述组表中可用的动 作桶的数目;
当所述组表中存在所述第二组表项时, 所述交换机删除所述第二组表 项, 且将所述第一组表项添加到所述组表中。
2、 根据权利要求 1 所述的方法, 其特征在于, 所述交换机确定无法 在组表中添加所述第一组表项包括:
所述交换机确定所述组表中不存在空闲组表项或所述第一动作桶的 数目大于所述第一值。
3、 根据权利要求 1或 2所述的方法, 其特征在于, 所述第一组表项 的重要性指示信息携带在所述第一组表项的计数器字段、 组标识字段或新 增字段中。
4、 根据权利要求 1或 2所述的方法, 其特征在于, 所述交换机确定 无法在组表中添加所述第一组表项之前, 还包括:
当所述交换机确定所述组表中空闲组表项的个数大于预先设置的组 表余量上限时, 所述交换机向所述控制器发送第一消息, 以通知所述控制 器所述组表中空闲组表项的个数大于所述组表余量上限; 当所述交换机确 定所述组表中空闲组表项的个数小于预先设置的组表余量下限时, 所述交 换机向所述控制器发送第二消息, 以通知所述控制器所述组表中空闲组表 项的个数小于所述组表余量下限; 和 /或,
当所述交换机确定所述组表中动作桶的剩余空间大于预先设置的动
作桶余量上限时, 所述交换机向所述控制器发送第三消息, 以通知所述控 制器所述组表中动作桶的剩余空间大于所述动作桶余量上限; 当所述交换 机确定所述组表中动作桶的剩余空间小于预先设置的动作桶余量下限时, 所述交换机向所述控制器发送第四消息, 以通知所述控制器所述组表中动 作桶的剩余空间小于动作桶余量下限。
5、 一种表项添加方法, 其特征在于, 包括:
交换机接收控制器发送的第一计量表项, 所述第一计量表项中携带所 述第一计量表项的重要性指示信息, 所述第一计量表项的重要性指示信息 用于指示所述第一计量表项的重要性, 所述第一计量表项包括第一计量 带;
所述交换机确定无法在计量表中添加所述第一计量表项, 所述交换机 确定所述计量表中是否存在第二计量表项, 所述第二计量表项中携带所述 第二计量表项的重要性指示信息, 所述第二计量表项的重要性指示信息用 于指示所述第二计量表项的重要性, 其中, 所述第二计量表项的重要性低 于所述第一计量表项的重要性, 所述第二计量表项包括第二计量带; 所述 第一计量带的数目不大于第一值与所述第二计量带的数目之和, 所述第一 值为所述计量表中可用的计量带的数目;
当所述计量表中存在所述第二计量表项时, 所述交换机删除所述第二 计量表项, 且将所述第一计量表项添加到所述计量表中。
6、 根据权利要求 5所述的方法, 其特征在于, 所述交换机确定无法 在计量表中添加所述第一计量表项包括:
所述交换机确定所述计量表中不存在空闲计量表项或所述第一计量 带的数目大于所述第一值。
7、 根据权利要求 5或 6所述的方法, 其特征在于, 所述第一计量表 项的重要性指示信息携带在所述第一计量表项的计数器字段、计量标识字 段或新增字段中。
8、 根据权利要求 5或 6所述的方法, 其特征在于, 所述交换机确定 无法在计量表中添加所述第一计量表项之前, 还包括:
当所述交换机确定所述计量表中空闲计量表项的个数大于预先设置 的计量表余量上限时, 所述交换机向所述控制器发送第一消息, 以通知所
述控制器所述计量表中空闲计量表项的个数大于所述计量表余量上限; 当 所述交换机确定所述计量表中空闲计量表项的个数小于预先设置的计量 表余量下限时, 所述交换机向所述控制器发送第二消息, 以通知所述控制 器所述计量表中空闲计量表项的个数小于所述计量表余量下限; 和 /或, 当所述交换机确定所述计量表中计量带的剩余空间大于预先设置的 计量带余量上限时, 所述交换机向所述控制器发送第三消息, 以通知所述 控制器所述计量表中计量带的剩余空间大于所述计量带余量上限; 当所述 交换机确定所述计量表中计量带的剩余空间小于预先设置的计量带余量 下限时, 所述交换机向所述控制器发送第四消息, 以通知所述控制器所述 计量表中计量带的剩余空间小于计量带余量下限。
9、 一种交换机, 其特征在于, 包括:
接收模块, 用于接收控制器发送的第一组表项, 所述第一组表项中携 带所述第一组表项的重要性指示信息, 所述第一组表项的重要性指示信息 用于指示所述第一组表项的重要性, 所述第一组表项包括第一动作桶; 确定模块, 用于确定无法在组表中添加所述第一组表项, 以及确定所 述组表中是否存在第二组表项, 所述第二组表项中携带所述第二组表项的 重要性指示信息, 所述第二组表项的重要性指示信息用于指示所述第二组 表项的重要性, 其中, 所述第二组表项的重要性低于所述第一组表项的重 要性, 所述第二组表项包括第二动作桶; 所述第一动作桶的数目不大于第 —值与所述第二动作桶的数目之和, 所述第一值为所述组表中可用的动作 桶的数目;
添加模块, 用于当所述确定模块确定所述组表中存在所述第二组表项 时, 删除所述第二组表项, 且将所述第一组表项添加到所述组表中。
10、 根据权利要求 9所述的交换机, 其特征在于,
所述确定模块, 具体用于确定所述组表中不存在空闲组表项或所述第 一动作桶的数目大于所述第一值。
1 1、 根据权利要求 9或 10所述的交换机, 其特征在于, 还包括: 发 送模块;
所述发送模块, 用于在所述确定模块确定无法在组表中添加所述第一 组表项之前, 当所述确定模块确定所述组表中空闲组表项的个数大于预先
设置的组表余量上限时, 向所述控制器发送第一消息, 以通知所述控制器 所述组表中空闲组表项的个数大于所述组表余量上限; 当所述确定模块确 定所述组表中空闲组表项的个数小于预先设置的组表余量下限时, 向所述 控制器发送第二消息, 以通知所述控制器所述组表中空闲组表项的个数小 于所述组表余量下限; 和 /或,
所述发送模块, 用于在所述确定模块确定无法在组表中添加所述第一 组表项之前, 当所述确定模块确定所述组表中动作桶的剩余空间大于预先 设置的动作桶余量上限时, 向所述控制器发送第三消息, 以通知所述控制 器所述组表中动作桶的剩余空间大于所述动作桶余量上限; 当所述确定模 块确定所述组表中动作桶的剩余空间小于预先设置的动作桶余量下限时, 向所述控制器发送第四消息, 以通知所述控制器所述组表中动作桶的剩余 空间小于动作桶余量下限。
12、 一种交换机, 其特征在于, 包括:
接收模块, 用于接收控制器发送的第一计量表项, 所述第一计量表项 中携带所述第一计量表项的重要性指示信息, 所述第一计量表项的重要性 指示信息用于指示所述第一计量表项的重要性, 所述第一计量表项包括第 一计量带;
确定模块, 用于确定无法在计量表中添加所述第一计量表项, 以及确 定所述计量表中是否存在第二计量表项, 所述第二计量表项中携带所述第 二计量表项的重要性指示信息, 所述第二计量表项的重要性指示信息用于 指示所述第二计量表项的重要性, 其中, 所述第二计量表项的重要性低于 所述第一计量表项的重要性, 所述第二计量表项包括第二计量带; 所述第 一计量带的数目不大于第一值与所述第二计量带的数目之和, 所述第一值 为所述计量表中可用的计量带的数目;
添加模块, 用于当所述确定模块确定所述计量表中存在所述第二计量 表项时, 删除所述第二计量表项, 且将所述第一计量表项添加到所述计量 表中。
13、 根据权利要求 12所述的交换机, 其特征在于,
所述确定模块, 具体用于确定所述计量表中不存在空闲计量表项或所 述第一计量带的数目大于所述第一值。
14、 根据权利要求 12或 13所述的交换机, 其特征在于, 还包括: 发 送模块;
所述发送模块, 用于在所述确定模块确定无法在计量表中添加所述第 一计量表项之前, 当所述确定模块确定所述计量表中空闲计量表项的个数 大于预先设置的计量表余量上限时, 向所述控制器发送第一消息, 以通知 所述控制器所述计量表中空闲计量表项的个数大于所述计量表余量上限; 当所述确定模块确定所述计量表中空闲计量表项的个数小于预先设置的 计量表余量下限时, 向所述控制器发送第二消息, 以通知所述控制器所述 计量表中空闲计量表项的个数小于所述计量表余量下限; 和 /或,
所述发送模块, 用于在所述确定模块确定无法在计量表中添加所述第 一计量表项之前, 当所述确定模块确定所述计量表中计量带的剩余空间大 于预先设置的计量带余量上限时, 向所述控制器发送第三消息, 以通知所 述控制器所述计量表中计量带的剩余空间大于所述计量带余量上限; 当所 述确定模块确定所述计量表中计量带的剩余空间小于预先设置的计量带 余量下限时, 向所述控制器发送第四消息, 以通知所述控制器所述计量表 中计量带的剩余空间小于计量带余量下限。
15、 一种交换机, 其特征在于, 包括: 发送器、 接收器、 存储器以及 分别与所述发送器、 所述接收器和所述存储器连接的处理器;
所述接收器, 用于接收控制器发送的第一组表项, 所述第一组表项中 携带所述第一组表项的重要性指示信息, 所述第一组表项的重要性指示信 息用于指示所述第一组表项的重要性, 所述第一组表项包括第一动作桶; 所述存储器, 用于存储程序代码; 所述程序代码被执行时, 使得所述 处理器执行下述操作: 确定无法在组表中添加所述第一组表项, 以及确定 所述组表中是否存在第二组表项, 所述第二组表项中携带所述第二组表项 的重要性指示信息, 所述第二组表项的重要性指示信息用于指示所述第二 组表项的重要性, 其中, 所述第二组表项的重要性低于所述第一组表项的 重要性, 所述第二组表项包括第二动作桶; 所述第一动作桶的数目不大于 第一值与所述第二动作桶的数目之和, 所述第一值为所述组表中可用的动 作桶的数目; 以及当确定所述组表中存在所述第二组表项时, 删除所述第 二组表项, 且将所述第一组表项添加到所述组表中。
16、 根据权利要求 15所述的交换机, 其特征在于,
所述处理器, 具体用于确定所述组表中不存在空闲组表项或所述第一 动作桶的数目大于所述第一值。
17、 根据权利要求 15或 16所述的交换机, 其特征在于,
所述发送器, 用于在所述处理器确定无法在组表中添加所述第一组表 项之前, 当所述处理器确定所述组表中空闲组表项的个数大于预先设置的 组表余量上限时, 向所述控制器发送第一消息, 以通知所述控制器所述组 表中空闲组表项的个数大于所述组表余量上限; 当所述处理器确定所述组 表中空闲组表项的个数小于预先设置的组表余量下限时, 向所述控制器发 送第二消息, 以通知所述控制器所述组表中空闲组表项的个数小于所述组 表余量下限; 和 /或,
所述发送器, 用于在所述处理器确定无法在组表中添加所述第一组表 项之前, 当所述处理器确定所述组表中动作桶的剩余空间大于预先设置的 动作桶余量上限时, 向所述控制器发送第三消息, 以通知所述控制器所述 组表中动作桶的剩余空间大于所述动作桶余量上限; 当所述处理器确定所 述组表中动作桶的剩余空间小于预先设置的动作桶余量下限时, 向所述控 制器发送第四消息, 以通知所述控制器所述组表中动作桶的剩余空间小于 动作桶余量下限。
18、 一种交换机, 其特征在于, 包括: 发送器、 接收器、 存储器以及 分别与所述发送器、 所述接收器和所述存储器连接的处理器;
所述接收器, 用于接收控制器发送的第一计量表项, 所述第一计量表 项中携带所述第一计量表项的重要性指示信息, 所述第一计量表项的重要 性指示信息用于指示所述第一计量表项的重要性, 所述第一计量表项包括 第一计量带;
所述存储器, 用于存储程序代码; 所述程序代码被执行时, 使得所述 处理器执行下述操作: 确定无法在计量表中添加所述第一计量表项, 以及 确定所述计量表中是否存在第二计量表项, 所述第二计量表项中携带所述 第二计量表项的重要性指示信息, 所述第二计量表项的重要性指示信息用 于指示所述第二计量表项的重要性, 其中, 所述第二计量表项的重要性低 于所述第一计量表项的重要性, 所述第二计量表项包括第二计量带; 所述
第一计量带的数目不大于第一值与所述第二计量带的数目之和, 所述第一 值为所述计量表中可用的计量带的数目; 以及当确定所述计量表中存在所 述第二计量表项时, 删除所述第二计量表项, 且将所述第一计量表项添加 到所述计量表中。
19、 根据权利要求 18所述的交换机, 其特征在于,
所述处理器, 具体用于确定所述计量表中不存在空闲计量表项或所述 第一计量带的数目大于所述第一值。
20、 根据权利要求 18或 19所述的交换机, 其特征在于,
所述发送器, 用于在所述处理器确定无法在计量表中添加所述第一计 量表项之前, 当所述处理器确定所述计量表中空闲计量表项的个数大于预 先设置的计量表余量上限时, 向所述控制器发送第一消息, 以通知所述控 制器所述计量表中空闲计量表项的个数大于所述计量表余量上限; 当所述 处理器确定所述计量表中空闲计量表项的个数小于预先设置的计量表余 量下限时, 向所述控制器发送第二消息, 以通知所述控制器所述计量表中 空闲计量表项的个数小于所述计量表余量下限; 和 /或,
所述发送器, 用于在所述处理器确定无法在计量表中添加所述第一计 量表项之前, 当所述处理器确定所述计量表中计量带的剩余空间大于预先 设置的计量带余量上限时, 向所述控制器发送第三消息, 以通知所述控制 器所述计量表中计量带的剩余空间大于所述计量带余量上限; 当所述处理 器确定所述计量表中计量带的剩余空间小于预先设置的计量带余量下限 时, 向所述控制器发送第四消息, 以通知所述控制器所述计量表中计量带 的剩余空间小于计量带余量下限。
Priority Applications (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201380077892.9A CN105379207B (zh) | 2013-06-28 | 2013-07-24 | 表项添加方法和交换机 |
EP13887701.4A EP3001617B1 (en) | 2013-06-28 | 2013-07-24 | Entry adding method and switch |
US14/981,412 US9942113B2 (en) | 2013-06-28 | 2015-12-28 | Entry adding method and switch |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2013/078453 WO2014205812A1 (zh) | 2013-06-28 | 2013-06-28 | 组表项的添加方法和交换机 |
CNPCT/CN2013/078453 | 2013-06-28 |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US14/981,412 Continuation US9942113B2 (en) | 2013-06-28 | 2015-12-28 | Entry adding method and switch |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2014205883A1 true WO2014205883A1 (zh) | 2014-12-31 |
Family
ID=52140887
Family Applications (2)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2013/078453 WO2014205812A1 (zh) | 2013-06-28 | 2013-06-28 | 组表项的添加方法和交换机 |
PCT/CN2013/080021 WO2014205883A1 (zh) | 2013-06-28 | 2013-07-24 | 表项添加方法和交换机 |
Family Applications Before (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2013/078453 WO2014205812A1 (zh) | 2013-06-28 | 2013-06-28 | 组表项的添加方法和交换机 |
Country Status (3)
Country | Link |
---|---|
US (1) | US9942113B2 (zh) |
EP (1) | EP3001617B1 (zh) |
WO (2) | WO2014205812A1 (zh) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107404435B (zh) * | 2016-05-19 | 2021-10-15 | 中兴通讯股份有限公司 | 一种管理组表项的方法和装置 |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101431474A (zh) * | 2007-11-07 | 2009-05-13 | 丛林网络公司 | 用于流监控的系统和方法 |
CN101686200A (zh) * | 2009-08-21 | 2010-03-31 | 杭州华三通信技术有限公司 | 路由转发的方法和设备 |
CN102685006A (zh) * | 2012-05-03 | 2012-09-19 | 中兴通讯股份有限公司 | 一种转发数据报文的方法及装置 |
CN102843298A (zh) * | 2012-09-12 | 2012-12-26 | 盛科网络(苏州)有限公司 | 实现交换机芯片Openflow流表优先级的方法及系统 |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7817549B1 (en) * | 2006-06-30 | 2010-10-19 | Extreme Networks, Inc. | Flexible flow-aging mechanism |
CN101753458B (zh) * | 2009-12-30 | 2012-05-23 | 杭州华三通信技术有限公司 | 一种nd邻居表项的处理方法及装置 |
CA2786429A1 (en) * | 2010-01-06 | 2011-07-14 | Nec Corporation | Communication control system and communication control method |
CN102868578A (zh) * | 2012-10-11 | 2013-01-09 | 盛科网络(苏州)有限公司 | Openflow交换机表项容量的测试方法及测试系统 |
CN102882746B (zh) * | 2012-10-11 | 2015-04-22 | 盛科网络(苏州)有限公司 | Openflow交换机系统中流表添加速率的测试方法及系统 |
-
2013
- 2013-06-28 WO PCT/CN2013/078453 patent/WO2014205812A1/zh active Application Filing
- 2013-07-24 EP EP13887701.4A patent/EP3001617B1/en active Active
- 2013-07-24 WO PCT/CN2013/080021 patent/WO2014205883A1/zh active Application Filing
-
2015
- 2015-12-28 US US14/981,412 patent/US9942113B2/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101431474A (zh) * | 2007-11-07 | 2009-05-13 | 丛林网络公司 | 用于流监控的系统和方法 |
CN101686200A (zh) * | 2009-08-21 | 2010-03-31 | 杭州华三通信技术有限公司 | 路由转发的方法和设备 |
CN102685006A (zh) * | 2012-05-03 | 2012-09-19 | 中兴通讯股份有限公司 | 一种转发数据报文的方法及装置 |
CN102843298A (zh) * | 2012-09-12 | 2012-12-26 | 盛科网络(苏州)有限公司 | 实现交换机芯片Openflow流表优先级的方法及系统 |
Non-Patent Citations (1)
Title |
---|
See also references of EP3001617A4 * |
Also Published As
Publication number | Publication date |
---|---|
EP3001617A1 (en) | 2016-03-30 |
US20160119201A1 (en) | 2016-04-28 |
EP3001617A4 (en) | 2016-07-06 |
WO2014205812A1 (zh) | 2014-12-31 |
EP3001617B1 (en) | 2018-03-21 |
US9942113B2 (en) | 2018-04-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Zafer et al. | A calculus approach to energy-efficient data transmission with quality-of-service constraints | |
CA2940754C (en) | Network packet latency management | |
WO2017162008A1 (zh) | 一种ack/nack反馈方法及相关设备 | |
WO2020001428A1 (zh) | Csi反馈的方法、装置、终端、基站及存储介质 | |
CN109802997B (zh) | 一种节点设备的选择方法及其相关设备 | |
US20130308651A1 (en) | Packet Processing Method, Device and System | |
JP2016519473A (ja) | データ送信方法、基地局及びユーザ装置 | |
JP6454412B2 (ja) | 制御メッセージの伝送方法、装置及びコンピュータ記憶媒体 | |
CN104023408A (zh) | 调度器及其基于网络多路径并行传输的数据调度方法 | |
US20170126828A1 (en) | Sending Method and Apparatus and Computer Storage Medium of Notification Message | |
WO2013000116A1 (zh) | 一种漏桶限速方法及装置 | |
WO2020191013A1 (en) | Latency based forwarding of packets for service-level objectives (slo) with quantified delay ranges | |
JP6301505B2 (ja) | 伝送バッファサイズを決定する方法及びデバイス | |
WO2017032059A1 (zh) | 缓冲区状态报告生成方法及装置 | |
WO2022116458A1 (zh) | 一种tbs确定方法 | |
WO2014205883A1 (zh) | 表项添加方法和交换机 | |
US11516145B2 (en) | Packet control method, flow table update method, and node device | |
CN110191473B (zh) | 一种网络扩容方法、装置和计算机可读存储介质 | |
WO2023165293A1 (zh) | 信道状态信息更新方法、基站、设备及存储介质 | |
CN114281426B (zh) | 任务卸载方法、装置、电子设备及可读存储介质 | |
WO2017161971A1 (zh) | 一种反馈信息的传输方法及装置 | |
WO2021120764A1 (zh) | 一种收发数据的方法及装置 | |
WO2021008263A1 (zh) | 数据传输方法、装置及系统 | |
JP2021083053A (ja) | スイッチ装置 | |
Yu et al. | Improving achievable traffic load of secondary users under GoS constraints in cognitive wireless networks |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 13887701 Country of ref document: EP Kind code of ref document: A1 |
|
WWE | Wipo information: entry into national phase |
Ref document number: 2013887701 Country of ref document: EP |
|
NENP | Non-entry into the national phase |
Ref country code: DE |