WO2014067055A1 - Method and device for refreshing flow table - Google Patents

Method and device for refreshing flow table Download PDF

Info

Publication number
WO2014067055A1
WO2014067055A1 PCT/CN2012/083700 CN2012083700W WO2014067055A1 WO 2014067055 A1 WO2014067055 A1 WO 2014067055A1 CN 2012083700 W CN2012083700 W CN 2012083700W WO 2014067055 A1 WO2014067055 A1 WO 2014067055A1
Authority
WO
WIPO (PCT)
Prior art keywords
flow
flow table
version number
node
table block
Prior art date
Application number
PCT/CN2012/083700
Other languages
French (fr)
Chinese (zh)
Inventor
田加鑫
李文涛
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2012/083700 priority Critical patent/WO2014067055A1/en
Priority to CN201280021542.6A priority patent/CN103907318B/en
Publication of WO2014067055A1 publication Critical patent/WO2014067055A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/38Flow based routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/54Organization of routing tables

Definitions

  • the present invention relates to the field of information technology, and in particular, to a method and an apparatus for refreshing a flow table.
  • a group of messages with the same quintuple information is often referred to as a stream, also known as a data stream or a message stream.
  • the forwarding path and service processing required for the packet flow are usually stored in a flow node of the flow table in the form of quintuple information and service information.
  • the flow table may include multiple flows. A node, each stream node stores only the quintuple information and service information of a packet flow; and then forwards the packet according to the corresponding flow node information in the flow table, thereby improving the forwarding speed.
  • a forwarding device such as a router or a switch obtains the quintuple information of the text by parsing, and queries the flow table of the quintuple information. If it is determined that there is no corresponding flow node in the flow table at this time, the packet may be determined to be the first packet of the corresponding flow, and basic forwarding is required.
  • the basic forwarding process includes: parsing the packet driving information, obtaining the packet ingress port, and parsing the packet link layer information, where the link layer information includes the link type, the packet source, and the media access control (media access control).
  • IP Internet Protocol
  • the IP layer message information includes the source and destination IP addresses of the message, whether it is a fragmented message, or a differentiated service code point ( Differentiated service code point, DSCP) priority, protocol type, etc.
  • query routing table determine downlink interface
  • IP text lifetime time to live, TTL
  • packet fragmentation packet link layer encapsulation
  • each forwarding interface In the basic forwarding process, in the process of parsing and encapsulating packets, each forwarding interface needs to perform statistics on the packets, limit the rate of transmission, and filter packets according to firewall settings. These operations are considered to be The forwarding interface processes the service of the packet; the specific content of the operation is saved as the service information.
  • the forwarding device creates a flow node in the flow table according to the quintuple information of the packet, and saves the quintuple information and the service information of the packet as the flow node information in the flow. In the node. Subsequent packets with the same quintuple information can be directly forwarded according to the information of the flow node; the process of forwarding the message according to the flow node information is generally called flow forwarding.
  • the present invention provides a method and a device for refreshing a flow table, which can save system resources of the forwarding device and improve the processing efficiency of the processor for forwarding packets.
  • the present invention provides a method for refreshing a flow table, including:
  • the current version number of the existing flow node and the existing flow node are obtained.
  • the information is updated according to the service information of the to-be-forwarded packet.
  • the current version number of the existing flow node is set to be consistent with the current version number of the flow table block where the existing flow node is located, according to the matching rule;
  • the flow table is divided into a plurality of flow table blocks according to a preset configuration rule, each flow table block includes a plurality of flow nodes, and each flow table block is provided with a corresponding one of adjustable version numbers, each Existing stream nodes are also provided with a corresponding adjustable version number.
  • the method for refreshing the flow table further includes: if the quintuple information of any one of the flow nodes in the flow table and the quintuple information of the to-be-forwarded packet If they are different, create a new flow node for the quintuple information, and determine a flow table block where the new flow node is located;
  • the service information and the quintuple information of the to-be-forwarded packet are stored in the new flow node; and the corresponding forwarding interface is determined according to the service information of the to-be-forwarded packet;
  • the method for refreshing the flow table further includes:
  • the method for refreshing the flow table further includes:
  • the method for refreshing the flow table further includes:
  • the method before the acquiring the quintuple information of the to-be-forwarded packet, the method further includes: initializing Mapping table for flow tables and forwarding interfaces.
  • mapping table of the initialization flow table and the forwarding interface includes:
  • each flow table block includes a plurality of flow nodes
  • the present invention provides a device for refreshing a flow table, including:
  • a first acquiring unit configured to obtain quintuple information of the to-be-forwarded packet
  • a searching unit configured to search for a flow table according to the quintuple information of the to-be-forwarded packet obtained by the first acquiring unit
  • a second obtaining unit configured to: when determining that the locating unit determines that the quintuple information of the existing flow node in the flow table is the same as the quintuple information of the to-be-forwarded message, acquiring the existing The current version number of the flow node and the current version number of the flow table block where the existing flow node is located, and the current version number of the existing flow node and the current version number of the flow table block where the existing flow node is located are transmitted to Update unit
  • An update unit configured to determine, according to the matching rule, that the current version number of the existing flow node acquired by the second acquiring unit is different from the current version number of the flow table block where the existing flow node is located, according to the to-be-forwarded
  • the service information of the packet is updated with the existing flow node information, and the current version number of the existing flow node is set to be consistent with the current version number of the flow table block where the existing flow node is located according to the matching rule;
  • the flow table is divided into a plurality of flow table blocks according to a preset configuration rule, each flow table block includes a plurality of flow nodes, and each flow table block is provided with a corresponding one of adjustable version numbers, each Existing stream nodes are also provided with a corresponding adjustable version number.
  • the device for refreshing the flow table further includes: a creating unit, configured to determine, in the flow table obtained by the second acquiring unit, five of any one of the flow nodes When the tuple information is different from the quintuple information of the to-be-forwarded packet, a new flow node is created for the quintuple information, and the flow table block where the new flow node is located is determined;
  • a third acquiring unit configured to acquire service information of the to-be-forwarded packet and a current version number of the flow table block where the new flow node is located;
  • a storage unit configured to store the service information and the quintuple information of the to-be-forwarded message in a new flow node created by the creating unit;
  • a first determining unit configured to determine, according to the service information of the to-be-forwarded packet that is obtained by the third acquiring unit, a corresponding forwarding interface
  • a third obtaining unit configured to acquire a mapping table of the forwarding interface determined by the first determining unit
  • the updating unit is configured to update an identifier corresponding to the flow table block where the new flow node is located in the mapping table of the forwarding interface acquired by the third acquiring unit; and the new flow node according to the matching rule
  • the current version number is set to match the current version number of the flow table block in which the new stream node is located.
  • the flow table refreshing apparatus further includes:
  • the updating unit is further configured to determine a current version of the existing stream node according to the matching rule When the number and the current version number of the flow table block where the existing flow node is located are the same, the information of the existing flow node is kept unchanged.
  • the device for refreshing the flow table further includes:
  • a second determining unit configured to determine, when the state of the at least one forwarding interface is changed, the forwarding interface to be adjusted; determining, according to the correspondence between the forwarding interface to be adjusted and the flow table block, the flow table block to be adjusted;
  • a first adjusting unit configured to adjust, according to a preset adjustment rule, a current version number of the to-be-adjusted flow table block determined by the second determination by the unit.
  • the device for refreshing the flow table further includes:
  • a third determining unit configured to: when it is detected that the state of the at least one service processing operation changes, determine a forwarding interface to be adjusted that processes the at least one service processing operation in which the state changes; according to the to-be-adjusted forwarding interface and the flow table Corresponding relationship between blocks, determining a flow table block to be adjusted;
  • a second adjusting unit configured to adjust a current version number of the to-be-adjusted flow table block determined by the third determining unit according to a preset adjustment rule.
  • the device for refreshing the flow table further includes:
  • An initialization unit configured to initialize a mapping table of the flow table and the forwarding interface.
  • the initializing unit includes:
  • a first obtaining sub-unit configured to acquire a correspondence between all current services and a forwarding interface, and store a correspondence between the current all services and the forwarding interface
  • a second obtaining subunit configured to acquire a current flow table
  • each flow table block includes a plurality of flow nodes
  • Setting a subunit configured to set a version number for each flow table block obtained by the dividing subunit, and Set an initial value for the version number of each flow table block;
  • a sub-unit is configured to establish a mapping table for each forwarding interface, where the mapping table is used for the correspondence between the storage forwarding interface and the flow table block.
  • An embodiment of the present invention provides a method and an apparatus for refreshing a flow table.
  • the flow table of the forwarding device is divided into a plurality of flow table blocks, and an adjustable version number is set for each flow table block, and each flow table block includes For each flow node, set an adjustable version number for each flow node.
  • When creating a flow node set the version number of the flow node to the version number of the flow table block.
  • the service processing operation status or interface status changes. Only the version number of the related flow table block is updated, and when the message to be forwarded is processed, it is determined whether the flow node needs to be updated by determining whether the version number of the flow node and the version number of the flow table block where the flow node is located are the same. Information.
  • the original stream node in the process of refreshing the flow table, the original stream node does not need to be deleted first, and then the new stream node is re-learned, but the original stream node is retained and only the stored content is updated. There is no need to repeatedly request the processor to release and reallocate system resources, thereby reducing system resource waste and greatly improving the processing efficiency of the processor for forwarding messages.
  • FIG. 1 is a flowchart of a method for refreshing a flow table according to an embodiment of the present invention
  • FIG. 2 is a flowchart of another method for refreshing a flow table according to an embodiment of the present invention.
  • FIG. 3 is a flowchart of another method for refreshing a flow table according to an embodiment of the present invention.
  • FIG. 4 is a flowchart of another method for refreshing a flow table according to an embodiment of the present invention.
  • FIG. 5 is a flowchart of another method for refreshing a flow table according to an embodiment of the present invention.
  • FIG. 6 is a flowchart of another method for refreshing a flow table according to an embodiment of the present invention.
  • 6A is a logical structural diagram of a flow table according to an embodiment of the present invention
  • 6B is a logical structural diagram of another flow table according to an embodiment of the present invention
  • 6C is a logical structural diagram of another flow table according to an embodiment of the present invention.
  • 6D is a logical structural diagram of another flow table according to an embodiment of the present invention.
  • 6E is a logical structural diagram of another flow table according to an embodiment of the present invention.
  • FIG. 7 is a structural block diagram of a device for refreshing a flow table according to an embodiment of the present invention.
  • FIG. 8 is a block diagram of a device for refreshing a flow table according to another embodiment of the present invention
  • FIG. 9 is a block diagram of another device for refreshing a flow table according to an embodiment of the present invention
  • FIG. A block diagram of a device for refreshing another flow table is provided.
  • FIG. 11 is a block diagram of another device for refreshing a flow table according to an embodiment of the present invention
  • FIG. 12 is another flow chart according to an embodiment of the present invention.
  • a block diagram of a composition of a refreshed device FIG. 13 is a block diagram of a device for refreshing another flow table according to an embodiment of the present invention.
  • the technical solution provided by the present invention sets an adjustable version number for each flow table block by dividing the flow table of the forwarding device into a plurality of flow table blocks; each flow table block includes a plurality of flow nodes, for each The stream node sets an adjustable version number.
  • each flow table block includes a plurality of flow nodes, for each The stream node sets an adjustable version number.
  • When creating a stream node set the version number of the stream node to the same version number of the stream table block.
  • the service processing operation status changes or the interface status changes the flow node in the flow table is not directly refreshed, but the version number of the related flow table block is updated.
  • the version of the flow node is determined. Whether the number and the version number of the flow table block where the stream node is located are the same, to identify whether the information of the stream node needs to be updated.
  • the version number of each flow node in the flow table block needs to be created or adjusted based on the version number of the flow table block.
  • version number is not limited, for example, an integer, and the initial time may be 0. It can be understood that the flow table is divided into how many flow table blocks, and how many flow nodes are included in each flow table block. Pre-configured.
  • the method and device for refreshing the flow table provided by the embodiment of the present invention are applied to the process of packet forwarding, and are particularly applicable to the flow table refreshing process of the forwarding device.
  • FIG. 1 is a flowchart of a flow table refreshing method according to an embodiment of the present invention. As shown in FIG. 1, the method includes:
  • the quintuple information of the to-be-forwarded packet includes a source IP address, a destination IP address, a source port number, a destination port number, and a protocol number of the to-be-forwarded packet.
  • a flow node is stored in the flow table, and each flow node has unique quintuple information. According to the quintuple information of the to-be-forwarded packet, the flow table is searched, and whether the flow table is There is a flow node corresponding to the to-be-forwarded packet.
  • the quintuple information of the existing flow node is the same as the quintuple information of the to-be-forwarded packet, the current version number of the existing flow node and the existing The current version number of the flow table block where the stream node is located.
  • the flow node corresponding to the to-be-forwarded packet is obtained;
  • the current version number of the flow node and the current version number of the flow table block where the existing flow node is located may be based on the current version number of the existing flow node and the current version of the flow table block where the existing flow node is located. No., determining whether the information in the existing stream node needs to be updated.
  • the information of the flow node is set, and the current version number of the existing flow node is set to be consistent with the current version number of the flow table block where the existing flow node is located according to the matching rule.
  • the matching rule is that the version number of the flow node is the same as the version number of the flow table block where the flow node is located
  • the flow node has the flow node corresponding to the to-be-forwarded packet, that is, the existing flow node, And determining a current version number of the existing flow node and a current version of the flow table block where the existing flow node is located
  • the service processing status may be changed or the interface status may be changed.
  • the information of the existing flow node is updated according to the service information of the packet to be forwarded. Specifically, the existing information is updated.
  • the service information in the flow node does not need to delete the existing flow node and re-establish a new flow node, thereby avoiding the processor of the forwarding device releasing and reallocating system resources, reducing system resource waste, and improving processor forwarding.
  • the efficiency of the message does not need to delete the existing flow node and re-establish a new flow node, thereby avoiding the processor of the forwarding device releasing and reallocating system resources, reducing system resource waste, and improving processor forwarding. The efficiency of the message.
  • a method for refreshing a flow table by dividing the entire flow table into a plurality of flow table blocks, setting a version number for each flow table block, and setting a corresponding version number for each flow node.
  • the packet to be forwarded is received, it is determined whether the version number of the stream node corresponding to the packet to be forwarded is the same as the version number of the flow table block, so that the flow stream is not refreshed first.
  • the node re-learns to generate a new stream node, but retains the original stream node and only updates its stored content, so that the processor is not required to repeatedly release and reallocate system resources, thereby reducing system resource waste, greatly Improve the processing efficiency of the processor for forwarding messages.
  • the technical solution of the present invention is introduced by using the version number of the stream node and the version number of the flow block in which the stream node is located as the matching rule.
  • the version number of the stream node is the same as the version number of the stream table block, and the version number of the stream table block is set as an example, but the method cannot be used.
  • the matching rule may also be set, for example, the version number of the stream node is a multiple of the version number of the stream table block, and the version number of the stream node is consistent with the version number of the stream table block, and Update the version number according to the matching rule.
  • the version number of the flow node is twice as large as the version number of the flow table block.
  • the first time the version number of the flow node is 2, and the version number of the flow table block is 1, the flow node
  • the version number of the flow table block is the same as the version number of the flow table block.
  • the version of the flow table block is updated to be updated based on the information of the flow node. 2, and the version number of the stream node is 2, and the version number of the stream node is inconsistent with the version number of the stream table block.
  • the information of the stream node needs to be updated according to the service information of the packet to be forwarded, and the version of the stream node is updated. The number is adjusted to 4.
  • FIG. 2 another method for refreshing a flow table according to an embodiment of the present invention is shown in FIG. 2, where the method includes: 201. Initialize a mapping table of the flow table and the forwarding interface.
  • mapping table of the initialization flow table and the forwarding interface includes:
  • mapping between the current service processing operations and the forwarding interface is obtained, and the correspondence between the current service processing operations and the forwarding interface is stored.
  • different forwarding interfaces can perform the same service processing operations, and can also perform different service processing operations, and which service processing operations can be performed by each forwarding interface are preset.
  • the correspondence between the current service processing operations and the forwarding interface is stored, that is, the service processing operations that can be performed by each forwarding interface are stored, so as to facilitate the subsequent change of the service processing state and the forwarding interface state. Processing when a change occurs.
  • the correspondence between the current all service processing operations and the forwarding interface is not fixed, when a new service processing operation is enabled or a certain service processing operation is stopped, or When a forwarding interface is enabled or disabled, you need to update the mapping between all current service processing operations and forwarding interfaces.
  • a single forwarding device generally only sets one flow table.
  • the flow table is divided into several flow table blocks; wherein each flow table block includes several flow nodes.
  • the preset configuration rule is used to indicate how many flow table blocks are divided into flow table blocks, and how many flow nodes are included in each flow table block.
  • the flow table includes up to 24 flow nodes, and the flow table can be divided into three flow table blocks, and each flow table block includes eight flow nodes.
  • the method for dividing the flow table into a plurality of flow table blocks may include: obtaining all memory spaces occupied by the flow table, and dividing the entire memory space into a plurality of memory regions, each The memory area is used as a flow table block, and each flow table block is assigned an index number.
  • Each flow table block can determine each flow table block according to its own memory size and the memory size occupied by each flow node. How many stream nodes can be included.
  • the version number can be set to an integer, such as 1, 2, etc.; Points, such as 0. 1 , 1. 2, etc. Among them, the initial value can be 0 or other fixed value.
  • mapping table is established for each forwarding interface, where the mapping table is used to store the correspondence between the forwarding interface and the flow table block.
  • the mapping table is a mapping between the storage forwarding interface and the flow table block, and the mapping table of each forwarding interface stores an identifier for each flow table block, which is used to represent Whether the forwarding interface has a corresponding relationship with the flow table block;
  • the mapping table may be, but is not limited to, implemented by using a bit field mapping table bi tmap form; one bit in the bi tma identifies a flow table block in the flow table, and the bit position is "1" indicates that the forwarding interface has a corresponding relationship with the flow table block, and a bit of "0" indicates that the forwarding interface does not have a corresponding relationship with the flow table block.
  • the bi tmap of interface 1 is "11100011", indicating that interface 1 has a corresponding relationship with the first, 2, 3, 7, and 8 flow table blocks in the flow table.
  • the corresponding relationship between the forwarding interface and the flow table block indicates that the forwarding interface can complete the service processing operation corresponding to the service information of the flow node in the flow table block corresponding to the forwarding interface.
  • the quintuple information of the to-be-forwarded packet includes the source IP address of the to-be-forwarded packet, the destination IP address of the packet, the source port number, the destination port number, and the protocol number.
  • the quintuple information of the existing flow node is the same as the quintuple information of the to-be-forwarded packet, obtain the current version number of the existing flow node and the existing The current version number of the flow table block where the stream node is located.
  • the service information is updated according to the service information of the to-be-forwarded packet. And the current version number of the existing flow node is set to be consistent with the current version number of the flow table block where the existing flow node is located according to the matching rule.
  • a method for refreshing a flow table according to an embodiment of the present invention includes:
  • the quintuple information corresponding to the to-be-forwarded packet includes a source IP address, a destination IP address, a source port number, a destination port number, and a protocol number of the to-be-forwarded packet.
  • Each stream node includes quintuple information and service information.
  • the current version number of the existing flow node and the flow table of the existing flow node are obtained.
  • the current version number of the block is the same as the quintuple information.
  • step 305 is performed after the step 304 is performed, it means that the to-be-forwarded packet cannot be forwarded by using the basic forwarding process.
  • the service to be forwarded is obtained. Information.
  • updating the information of the existing flow node according to the service information of the to-be-forwarded message includes: updating the service information of the existing flow node by using the service information of the to-be-forwarded message; specifically, The service information of the existing flow node may be replaced by the service information of the to-be-forwarded packet obtained in the basic forwarding process.
  • step 306 is performed after the execution of step 304, it means that the message can be forwarded according to the information of the existing stream node in the flow table.
  • the matching rule is whether the current version number of the stream node is the same as the current version number of the stream table block where the stream node is located.
  • the method for determining the flow table block where the new flow node is located includes: calculating, according to the quintuple information of the to-be-forwarded message, a hash hash algorithm, and calculating an index number of the flow node; The quotient of the index number divided by the current number of stream table blocks is the index number of the flow table block where the stream node is located. According to the index number of the flow table block, the flow table block where the flow node is located can be determined.
  • the index number of the flow node is calculated as 55, and there are currently 10 flow table blocks, and the index numbers are respectively 0-9, and each flow table block includes For 10 stream nodes, the quotient value obtained by dividing 55 by 10 is 5, and the stream node with index number 55 is in the flow table block with index number 5.
  • step 307 is performed after the step 302 is performed, it means that the to-be-forwarded packet cannot be forwarded by the flow, and then the to-be-forwarded packet performs a basic forwarding process.
  • the service information of the to-be-forwarded packet can be obtained in the basic forwarding process of the packet.
  • the query may be performed after the query is performed by using the correspondence between all current service processing operations and forwarding interfaces stored in step 201.
  • the mapping table of the forwarding interface is the mapping table established in step 202.
  • the embodiment provides a setting method, including: in the mapping table of the forwarding interface, the flow table block corresponding to the forwarding interface has a corresponding position set to 1; and the forwarding interface does not correspond to the forwarding interface.
  • the matching rule is whether the current version number of the stream node is the same as the current version number of the flow table block where the stream node is located. Then, the current version number of the new stream node may be set to the current version number of the stream table block where the new stream node is located.
  • 31 3 can also be executed before 31 1 .
  • the embodiment of the present invention further provides a method for refreshing the flow table when the state of the service processing operation changes and the state of the forwarding interface changes.
  • Process flow As shown in Figure 4, the pre-processing flow of the method for refreshing the flow table when the operation state changes based on the business processing includes: 401. When it is detected that a state of the at least one service processing operation changes, determine a to-be-adjusted forwarding interface that processes the at least one service processing operation in which the state changes.
  • step 401 the method for determining the to-be-adjusted forwarding interface of the at least one service processing operation in which the status is changed may be searched by referring to the correspondence between the forwarding interface and the service processing operation obtained in step 2011.
  • step 402 the correspondence between the forwarding interface and the flow table block to be adjusted may refer to the mapping table in step 205.
  • the preset adjustment rule may be preset according to a specific implementation manner. For example, if the version number is set to an integer, the current version number may be incremented or decremented by one. If the version number is set to a floating point number, the current version number may be increased by 0.1 or minus 0.1.
  • the description herein is only one embodiment provided in this embodiment, which is not limited by the embodiment of the present invention.
  • the adjustment of the version number needs to be performed according to the service processing operation in which the status changes.
  • the number of forwarding interfaces has been adjusted multiple times. For example, if there are two forwarding interfaces corresponding to the service processing operation whose current status changes, the version number of the flow table block corresponding to one of the forwarding interfaces is adjusted first, and then the adjustment result is adjusted and the other forwarding is performed.
  • the interface has the version number of the corresponding flow table block.
  • the adjustment of the version number needs to be adjusted multiple times according to the number of forwarding interfaces whose status changes. For example, if there are two forwarding interfaces in the current state change, the version number of the flow table block corresponding to one of the forwarding interfaces is adjusted first, and then the flow matching the other forwarding interface is adjusted on the result of the adjustment. The version number of the table block.
  • the flow table may be adjusted according to the service processing operation in which the state changes according to the steps 401-403, and then the steps are combined.
  • 501-502 Adjust the flow table according to the forwarding interface whose status changes. Or, in combination with steps 501-502, the flow table is adjusted according to the forwarding interface whose appearance changes, and then combined with steps 401-403, the flow table is adjusted according to the service processing operation in which the state changes.
  • the pre-processing flow of the method for refreshing the flow table shown in FIG. 4 and FIG. 5 causes the version number of the flow node in the flow table to be inconsistent with the version number of the flow table block, thereby triggering the flow table refresh.
  • the flow table refreshing process provided by the embodiment of the present invention is specifically described in conjunction with the flow table shown in FIG. 6A, and FIG. 6 is shown.
  • the flow table shown in FIG. 6A is divided into two flow table blocks, each flow table block includes eight flow nodes, the index numbers of the flow table blocks are respectively 0, 1, and the version number of each flow table block is ⁇ ; There are 8 flow nodes in the flow table, the index numbers are 0-15, and the version number of each flow node is v0.
  • the process of refreshing the flow table includes:
  • the matching rule is whether the current version number of the flow node is the same as the current version number of the flow table block where the flow node is located.
  • An embodiment of the present invention provides a method for refreshing a flow table.
  • the flow table is divided into a plurality of flow table blocks, and each flow table block includes a plurality of flow nodes, and a corresponding version number is set for each flow table block. And setting a corresponding version number for the flow node in the flow table block, so that in the process of refreshing the flow table, the original flow node does not need to be deleted first, and then the new flow node is re-learned, but the original flow node is retained. Only the contents of the storage are updated, so that the processor is not required to repeatedly release and reallocate system resources, thereby reducing system resource waste and greatly improving the processing efficiency of the processor for forwarding messages.
  • An embodiment of the present invention provides a device for refreshing a flow table, which is used to implement the method for refreshing the flow table shown in Figures 1 to 6 of the present invention.
  • the apparatus includes: a first obtaining unit 71, a searching unit 72, a second obtaining unit 73, and an updating unit 74.
  • the first obtaining unit 71 is configured to obtain quintuple information of the to-be-forwarded message.
  • the quintuple information of the to-be-forwarded packet includes a source IP address, a destination IP address, a source port number, a destination port number, and a protocol number of the to-be-forwarded packet.
  • the searching unit 72 is configured to search the flow table according to the quintuple information of the to-be-forwarded message acquired by the first acquiring unit 71.
  • a flow node is stored in the flow table, and each flow node has unique quintuple information. According to the quintuple information of the to-be-forwarded packet, the flow table is searched, and whether the flow table is There is a flow node corresponding to the to-be-forwarded packet.
  • the second obtaining unit 73 is configured to: when determining that the searching unit 72 determines that the quintuple information of the existing flow node in the flow table is the same as the quintuple information of the to-be-forwarded message, The current version number of the existing flow node and the current version number of the flow table block where the existing flow node is located, and the current version number of the existing flow node and the current version number of the flow table block where the existing flow node is located Transfer to the update unit.
  • the updating unit 74 is configured to determine, according to the matching rule, that the current version number of the existing stream node acquired by the second acquiring unit 73 is different from the current version number of the stream table block where the existing stream node is located, according to the The service information of the to-be-forwarded packet is updated with the existing flow node information, and the current version number of the existing flow node is set to be consistent with the current version number of the flow table block where the existing flow node is located according to the matching rule.
  • the flow table is divided into a plurality of flow table blocks according to a preset configuration rule, each flow table block includes a plurality of flow nodes, and each flow table block is provided with an adjustable version number, and each of the existing flow table blocks has an adjustable version number.
  • the flow nodes are also provided with an adjustable version number, and the version number of each flow node in a flow table block needs to be created or adjusted based on the version number of the flow table block.
  • the apparatus further includes: a creating unit 75, a third obtaining unit 76, a storage unit 77, a first determining unit 78, and a third obtaining unit 79.
  • a creating unit 75 configured to: when it is determined that the quintuple information of any one of the flow nodes obtained by the second obtaining unit 73 is different from the quintuple information of the to-be-forwarded packet, The quintuple information creates a new flow node and determines a flow table block in which the new flow node is located.
  • the method for determining the flow table block where the new flow node is located includes: according to the waiting The quintuple information of the forwarded message is combined with the hash hash algorithm to calculate the index number of the flow node.
  • the quotient value obtained by dividing the index number of the flow node by the current flow table block number is the flow table block where the flow node is located. Index number. According to the index number of the flow table block, the flow table block where the flow node is located can be determined.
  • the third obtaining unit 76 is configured to obtain the service information of the to-be-forwarded packet and the current version number of the flow table block where the new flow node is located.
  • the storage unit 77 is configured to store the service information and the quintuple information of the to-be-forwarded message in a new flow node created by the creating unit 75.
  • the first determining unit 78 is configured to determine, according to the service information of the to-be-forwarded packet that is obtained by the third acquiring unit 76, a corresponding forwarding interface.
  • the third obtaining unit 79 is configured to acquire a mapping table of the forwarding interface determined by the first determining unit 78.
  • the updating unit 74 is configured to update an identifier corresponding to the flow table block where the new flow node is located in the mapping table of the forwarding interface acquired by the third obtaining unit 79; and the new rule according to the matching rule
  • the current version number of the flow node is set to be consistent with the current version number of the flow table block in which the new flow node is located.
  • the updating unit 74 updates the identifier corresponding to the flow table block where the new flow node is located in the mapping table of the forwarding interface acquired by the third obtaining unit 79, and may follow the following setting steps, including the forwarding In the mapping table of the interface, the flow table block corresponding to the forwarding interface has a corresponding position set to 1; and the flow table block not corresponding to the forwarding interface has a corresponding position set to 0. For example, if there are eight flow table blocks in the flow table, and the first, third, fourth, and fifth flow table blocks have a corresponding relationship with the same forwarding interface, the mapping table of the forwarding interface should be set to 10111000.
  • the updating unit 74 is further configured to: when determining, according to the matching rule, that a current version number of the existing flow node is consistent with a current version number of the flow table block where the existing flow node is located, The information of the existing stream node does not change.
  • the apparatus further includes: a second determining unit 710, a first adjusting unit 711.
  • a second determining unit 710 configured to: when detecting that a state of the at least one forwarding interface changes, Determining the forwarding interface to be adjusted; determining the flow table block to be adjusted according to the correspondence between the forwarding interface to be adjusted and the flow table block.
  • the first adjusting unit 711 is configured to adjust a current version number of the to-be-adjusted flow table block determined by the second determining unit 710 according to a preset adjustment rule.
  • the preset adjustment rule may be preset according to a specific implementation manner. For example, if the version number is set to an integer, the current version number may be incremented or decremented by one. If the version number is set to a floating point number, the current version number may be increased by 0.1 or minus 0.1.
  • the description herein is only one embodiment provided in this embodiment, which is not limited by the embodiment of the present invention.
  • the apparatus further includes: a third determining unit 712 and a second adjusting unit 71 3.
  • the third determining unit 712 is configured to: when it is detected that the state of the at least one service processing operation changes, determine the to-be-adjusted forwarding interface that processes the at least one service processing operation in which the state changes; according to the to-be-adjusted forwarding interface and the flow The correspondence between the table blocks determines the flow table block to be adjusted.
  • the second adjusting unit 71 3 is configured to adjust a current version number of the to-be-adjusted flow table block determined by the third determining unit 712 according to a preset adjustment rule.
  • the preset adjustment rule may be preset according to a specific implementation manner. For example, if the version number is set to an integer, the current version number may be incremented or decremented by one. If the version number is set to a floating point number, the current version number may be increased by 0.1 or minus 0.1.
  • the description herein is only one embodiment provided in this embodiment, which is not limited by the embodiment of the present invention.
  • the apparatus further includes: an initializing unit 714.
  • the initializing unit 714 is configured to initialize a mapping table of the flow table and the forwarding interface.
  • the initializing unit 714 includes: a first obtaining subunit 7141, a second obtaining subunit 7142, a dividing subunit 7143, a setting subunit 7144, and a establishing subunit 7145.
  • the first obtaining sub-unit 7141 is configured to obtain a correspondence between all the current services and the forwarding interface, and store a correspondence between the current services and the forwarding interface.
  • the second obtaining subunit 7142 is configured to acquire a current flow table.
  • a dividing subunit 7143 configured to, according to a preset configuration rule, the second obtaining subunit 7142
  • the obtained flow table is divided into several flow table blocks; wherein each flow table block includes several flow nodes.
  • the setting subunit 7144 is configured to set a version number for each flow table block obtained by the dividing subunit 7143, and set an initial value for the version number of each flow table block.
  • the establishing subunit 7145 is configured to establish a mapping table for each forwarding interface, where the mapping table is used to store a correspondence between the forwarding interface and the flow table block.
  • An embodiment of the present invention provides a device for refreshing a flow table, by dividing a flow node in the entire flow table into blocks, and setting a corresponding version number for each flow node, and setting a corresponding version for each flow table block. No., in the process of refreshing the flow table, it is not necessary to delete the original stream node first, and then learn to generate a new stream node, but retain the original stream node and only update the stored content, so that there is no need to repeatedly request The processor releases and reallocates system resources, thereby reducing system resource waste and greatly improving the processing efficiency of the processor for forwarding messages.
  • An embodiment of the present invention provides a device for refreshing a flow table. As shown in FIG.
  • the device includes: a processor 1 301 and a memory 1 302.
  • the processor 1301 and the memory 1302 can be connected by using a bus or other manner.
  • the memory 1302 Program code is stored therein, and the program code includes computer operation instructions.
  • the processor 1301 executes the program code for:
  • the quintuple information of the to-be-forwarded packet searching the flow table according to the quintuple information of the to-be-forwarded packet; if the quintuple information of the existing flow node exists in the flow table, and the to-be-forwarded If the quintuple information of the packet is the same, the current version number of the existing stream node and the current version number of the stream table block where the existing stream node is located are obtained; if the current rule of the existing stream node is determined according to the matching rule If the version number is inconsistent with the current version number of the flow table block where the existing flow node is located, the existing flow node information is updated according to the service information of the to-be-forwarded packet, and the existing flow node is matched according to the matching rule.
  • the current version number is set to be consistent with the current version number of the flow table block where the existing flow node is located; wherein the flow table is divided into several flow table blocks according to a preset configuration rule, and each flow table block includes several Each flow table block is provided with an adjustable version number, and each existing flow node is also provided with an adjustable version number, and the version number of each flow node in a flow table block is required. Created or adjusted on the basis of the version number of the block on the flow table.
  • the memory 1 302 is configured to store the flow table.
  • the processor 1301 is further configured to: when the quintuple information of any one of the flow nodes in the flow table is different from the quintuple information of the to-be-forwarded packet,
  • the tuple information creates a new flow node, and determines a flow table block in which the new flow node is located.
  • the service information of the to-be-forwarded packet and the current version number of the flow table block where the new flow node is located are obtained.
  • the service information and the quintuple information of the to-be-forwarded packet are stored in the new flow node; the corresponding forwarding interface is determined according to the service information of the to-be-forwarded packet; and the mapping of the forwarding interface is obtained.
  • the memory 1 302 is further configured to store the mapping table.
  • the processor 1301 is further configured to determine, according to the matching rule, that a current version number of the existing flow node and a current version number of the flow table block where the existing flow node is located are consistent, and maintain the The information of the existing stream node is unchanged.
  • the processor 1301 is further configured to: when it is detected that the state of the at least one forwarding interface changes, determine the forwarding interface to be adjusted; determine the to-be-adjusted flow according to the correspondence between the forwarding interface to be adjusted and the flow table block a table block; adjusts a current version number of the flow table block to be adjusted according to a preset adjustment rule.
  • the processor 1301 is further configured to: when it is detected that the state of the at least one service processing operation changes, determine, to be adjusted, the forwarding interface to be adjusted to process the at least one service processing operation in which the state changes; Determining the correspondence between the forwarding interface and the flow table block, and determining the flow table block to be adjusted; adjusting the current version number of the flow table block to be adjusted according to a preset adjustment rule.
  • the processor 1301 is further configured to initialize a mapping table of the flow table and the forwarding interface.
  • the specific manner of the processor 1 301 executing the program code to implement the mapping table of the initialization flow table and the forwarding interface is: acquiring a correspondence between all current services and a forwarding interface, and storing the Corresponding relationship between all the current services and the forwarding interface; obtaining the current flow table; dividing the flow table into a plurality of flow table blocks according to a preset configuration rule; wherein each flow table block package Include a number of flow nodes; set a version number for each flow table block, and set an initial value for each flow table block version number; respectively, establish a mapping table for each forwarding interface, the mapping table is used for storing and forwarding interfaces Correspondence with the flow table block.
  • An embodiment of the present invention provides a device for refreshing a flow table.
  • the processor executes the operation instruction in the memory, divides the flow nodes in the entire flow table into blocks, and sets a corresponding version number for each flow node.
  • Each flow table block sets a corresponding version number, so that in the process of refreshing the flow table, it is not necessary to delete the original stream node first, and then re-learn to generate a new stream node, but retain the original stream node and only update its storage.
  • the content does not need to repeatedly request the processor to release and reallocate system resources, thereby reducing the waste of system resources and greatly improving the processing efficiency of the processor for forwarding messages.
  • the present invention can be implemented by means of software plus necessary general hardware, and of course, by hardware, but in many cases, the former is a better implementation. .
  • the technical solution of the present invention which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a readable storage medium, such as a floppy disk of a computer.
  • a hard disk or optical disk or the like includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the methods described in various embodiments of the present invention.

Abstract

Disclosed are a method and device for refreshing a flow table, reducing the waste of system resources and improving the processing efficiency of a processor on a forwarding message. With the present invention, a flow table of a forwarding device is divided into several flow table blocks, and each of the flow table blocks is provided with an adjustable version number respectively; and each of the flow table blocks comprises several flow nodes, and when the flow nodes are established, an adjustable version number is provided for the flow nodes. When a service processing operation state changes or an interface state changes, only the version number of a relevant flow table block is updated, and when a message to be forwarded is processed, judging whether the version number of a flow node is identical to the version number of the flow table block where the flow node is located, so as to recognize whether the information about the flow node needs to be updated.

Description

刷新的方法及装置 技术领域  Refreshing method and device
本发明涉及信息技术领域, 尤其涉及一种流表刷新的方法及装置。  The present invention relates to the field of information technology, and in particular, to a method and an apparatus for refreshing a flow table.
背景技术 当一组报文具有相同的五元组信息是, 可以认为这一组报文有相同的转 发行为, 即需要使用相同的转发路径, 并接受相同的业务处理。 通常将具有 相同五元组信息的一组报文, 称为流, 也称为数据流或报文流。 为了提升转 发性能, 通常会将报文流所需要的转发路径和业务处理以五元组信息和业务 信息的形式存储于转发设备中流表的一个流节点中; 其中, 流表可包括多个 流节点, 每个流节点只存储一个报文流的五元组信息和业务信息; 然后根据 流表中对应的流节点信息对报文进行流转发, 提高转发速度。 Background of the Invention When a group of messages has the same quintuple information, it can be considered that the group of messages has the same forwarding, that is, the same forwarding path needs to be used, and the same service processing is accepted. A group of messages with the same quintuple information is often referred to as a stream, also known as a data stream or a message stream. In order to improve the forwarding performance, the forwarding path and service processing required for the packet flow are usually stored in a flow node of the flow table in the form of quintuple information and service information. The flow table may include multiple flows. A node, each stream node stores only the quintuple information and service information of a packet flow; and then forwards the packet according to the corresponding flow node information in the flow table, thereby improving the forwarding speed.
当报文从一个转发接口进入时, 诸如路由器、 交换机等转发设备通过解 析获取该 文的五元组信息, 并 居五元组信息查询流表。 若确定此时该才艮 文在流表中没有对应的流节点, 则可认定该报文为对应的流的首包, 需要进 行基本转发。 基本转发的流程包括: 解析报文驱动信息, 获取报文入端口; 解析报文链路层信息, 该链路层信息包括链路类型、 报文源和目的媒体访问 控制( media access control, 筒称 MAC )信息等; 解析报文网际协议 ( Internet Protocol, 筒称 IP )层信息, 该 IP层报文信息包括报文的源和目的 IP地址, 是否是分片报文, 差分服务代码点 (differentiated services code point, 筒称 DSCP )优先级, 协议类型等; 查询路由表, 决定下行接口; IP 文生存时间 ( time to live, 筒称 TTL )递减与报文分片; 报文链路层封装, 封装报文的源 和目的 MAC信息、 链路类型; 报文驱动信息封装; 将报文从下行接口发送出 去。 在此基本转发流程中, 在对报文的解析和封装的过程中, 各个转发接口 需要对该报文进行统计、 传输限速、 根据防火墙设置对报文进行过滤等操作, 这些操作被认为是转发接口对该报文的业务处理操作; 操作的具体内容作为 业务信息进行保存。 在完成该报文的基本转发时, 转发设备根据该报文的五元组信息在流表 中创建流节点, 并将该报文的五元组信息和业务信息作为流节点信息保存在 该流节点中。 后续具有相同五元组信息的报文可以根据该流节点信息, 直接 转发; 这种根据流节点信息转发 文的过程, 通常称为流转发。 When a packet enters from a forwarding interface, a forwarding device such as a router or a switch obtains the quintuple information of the text by parsing, and queries the flow table of the quintuple information. If it is determined that there is no corresponding flow node in the flow table at this time, the packet may be determined to be the first packet of the corresponding flow, and basic forwarding is required. The basic forwarding process includes: parsing the packet driving information, obtaining the packet ingress port, and parsing the packet link layer information, where the link layer information includes the link type, the packet source, and the media access control (media access control). MAC information, etc.; Analyze the Internet Protocol (IP) layer information of the message, the IP layer message information includes the source and destination IP addresses of the message, whether it is a fragmented message, or a differentiated service code point ( Differentiated service code point, DSCP) priority, protocol type, etc.; query routing table, determine downlink interface; IP text lifetime (time to live, TTL) decrement and packet fragmentation; packet link layer encapsulation The source and destination MAC information of the encapsulated packet, the link type, and the packet-driven information encapsulation; the packet is sent out from the downlink interface. In the basic forwarding process, in the process of parsing and encapsulating packets, each forwarding interface needs to perform statistics on the packets, limit the rate of transmission, and filter packets according to firewall settings. These operations are considered to be The forwarding interface processes the service of the packet; the specific content of the operation is saved as the service information. When the basic forwarding of the packet is completed, the forwarding device creates a flow node in the flow table according to the quintuple information of the packet, and saves the quintuple information and the service information of the packet as the flow node information in the flow. In the node. Subsequent packets with the same quintuple information can be directly forwarded according to the information of the flow node; the process of forwarding the message according to the flow node information is generally called flow forwarding.
然而, 当业务处理操作状态发生变化或者接口状态发生变化时, 例如某 个接口开启或关闭, 某个新的业务处理操作被启动或某个业务处理操作被暂 停使用等, 为保证流表中的流节点信息的正确性, 需要将发生状态变化的业 务处理操作或接口相关联的所有流节点信息全部刷新。 而在流表刷新的过程 中, 发明人发现现有技术中至少存在如下问题:  However, when the status of the service processing operation changes or the interface status changes, for example, an interface is opened or closed, a new service processing operation is started, or a certain service processing operation is suspended, etc., to ensure that the flow table is in use. For the correctness of the flow node information, it is necessary to refresh all the flow node information associated with the service processing operation or the interface in which the state change occurs. In the process of refreshing the flow table, the inventors found that at least the following problems exist in the prior art:
每次的流表刷新过程中, 都需要删除原有的流节点, 然后再重新建立流 节点来存储新的流节点信息。 当流表中有大量流节点信息要刷新时, 就需要 删除大量的流节点, 并重新创建大量的流节点, 使得流表刷新过程占用转发 设备的处理器的大量***资源, 造成处理器不能及时处理报文转发, 从而降 低了处理器转发报文的效率。  Each time the flow table is refreshed, the original stream node needs to be deleted, and then the stream node is re-established to store the new stream node information. When a large number of flow node information is to be refreshed in the flow table, a large number of flow nodes need to be deleted, and a large number of flow nodes are re-created, so that the flow table refresh process occupies a large amount of system resources of the processor of the forwarding device, causing the processor to fail in time. Handles packet forwarding, which reduces the efficiency of the processor to forward packets.
发明内容 Summary of the invention
有鉴于此, 本发明提供了一种流表刷新的方法及装置, 能够节约转发设 备的***资源, 提高处理器对于转发报文的处理效率。  In view of the above, the present invention provides a method and a device for refreshing a flow table, which can save system resources of the forwarding device and improve the processing efficiency of the processor for forwarding packets.
为达到上述目的, 本发明的实施例采用如下技术方案:  In order to achieve the above object, the embodiment of the present invention adopts the following technical solutions:
第一方面, 本发明提供了一种流表刷新的方法, 包括:  In a first aspect, the present invention provides a method for refreshing a flow table, including:
获取待转发报文的五元组信息;  Obtain the quintuple information of the packet to be forwarded;
根据所述待转发报文的五元组信息, 查找流表;  And searching for a flow table according to the quintuple information of the to-be-forwarded packet;
若所述流表中存在一个已有流节点的五元组信息与所述待转发报文的五 元组信息相同, 则获取所述已有流节点的当前版本号以及所述已有流节点所 在流表块的当前版本号;  If the quintuple information of the existing flow node is the same as the quintuple information of the to-be-forwarded packet, the current version number of the existing flow node and the existing flow node are obtained. The current version number of the flow table block;
若按照匹配规则确定所述已有流节点的当前版本号与所述已有流节点所 在流表块的当前版本号不一致, 则根据所述待转发报文的业务信息更新所述 已有流节点信息, 并按照所述匹配规则将所述已有流节点的当前版本号设置 为与所述已有流节点所在流表块的当前版本号一致; And if the current version number of the existing flow node is inconsistent with the current version number of the flow table block where the existing flow node is located according to the matching rule, the information is updated according to the service information of the to-be-forwarded packet. The current version number of the existing flow node is set to be consistent with the current version number of the flow table block where the existing flow node is located, according to the matching rule;
其中, 所述流表根据预先的配置规则, 分为若干个流表块, 每个流表块 包括若干个流节点, 每个流表块均设置有对应的一个可调整的版本号, 每个 已有流节点也均设置有对应的一个可调整的版本号。  The flow table is divided into a plurality of flow table blocks according to a preset configuration rule, each flow table block includes a plurality of flow nodes, and each flow table block is provided with a corresponding one of adjustable version numbers, each Existing stream nodes are also provided with a corresponding adjustable version number.
在第一方面的第一种可能实现方式中, 所述流表刷新的方法还包括: 若所述流表中任意一个流节点的五元组信息与所述待转发报文的五元组 信息均不相同, 则为所述五元组信息创建一个新的流节点, 并确定所述新的 流节点所在的流表块;  In a first possible implementation manner of the first aspect, the method for refreshing the flow table further includes: if the quintuple information of any one of the flow nodes in the flow table and the quintuple information of the to-be-forwarded packet If they are different, create a new flow node for the quintuple information, and determine a flow table block where the new flow node is located;
获取所述待转发报文的业务信息以及所述新的流节点所在的流表块的当 前版本号;  Obtaining the service information of the to-be-forwarded packet and the current version number of the flow table block where the new flow node is located;
将所述待转发报文的业务信息和五元组信息存储在所述新的流节点中; 根据所述待转发报文的业务信息, 确定对应的转发接口;  The service information and the quintuple information of the to-be-forwarded packet are stored in the new flow node; and the corresponding forwarding interface is determined according to the service information of the to-be-forwarded packet;
获取所述转发接口的映射表, 并更新所述转发接口的映射表中所述新的 流节点所在的流表块对应的标识;  Obtaining a mapping table of the forwarding interface, and updating an identifier corresponding to the flow table block where the new flow node is located in the mapping table of the forwarding interface;
按照所述匹配规则将所述新的流节点的当前版本号设置为与所述新的流 节点所在的流表块的当前版本号一致。  And setting a current version number of the new flow node to be consistent with a current version number of the flow table block in which the new flow node is located according to the matching rule.
根据第一方面或第一方面的第一种可能实现方式, 在第一方面的第二种 可能实现方式中, 所述流表刷新的方法还包括:  According to the first aspect or the first possible implementation manner of the first aspect, in the second possible implementation manner of the first aspect, the method for refreshing the flow table further includes:
若按照所述匹配规则确定所述已有流节点的当前版本号以及所述已有流 节点所在流表块的当前版本号一致, 保持所述已有流节点的信息不变。  If the current version number of the existing stream node and the current version number of the stream table block where the existing stream node is located are consistent according to the matching rule, the information of the existing stream node is kept unchanged.
根据第一方面或第一方面的第一种或第二种可能实现方式, 在第三种可 能实现方式中, 所述流表刷新的方法还包括:  According to the first aspect or the first or second possible implementation manner of the first aspect, in a third possible implementation, the method for refreshing the flow table further includes:
当检测到至少一个转发接口的状态发生变化时, 确定待调整转发接口; 根据所述待调整转发接口与流表块之间的对应关系, 确定待调整流表块; 根据预设的调整规则, 调整所述待调整流表块的当前版本号。  Determining the forwarding interface to be adjusted when the state of the at least one forwarding interface is changed; determining the flow table block to be adjusted according to the correspondence between the forwarding interface and the flow table block to be adjusted; according to a preset adjustment rule, Adjusting the current version number of the flow table block to be adjusted.
根据第一方面或第一方面的第一种至第三种任一种可能实现方式, 在第 四种可能实现方式中, 所述流表刷新的方法还包括: According to the first aspect or the first to third possible implementation manners of the first aspect, In the four possible implementation manners, the method for refreshing the flow table further includes:
当检测到至少一个业务处理操作的状态发生变化时, 确定处理所述状态 发生变化的至少一个业务处理操作的待调整转发接口;  Determining, when it is detected that the state of the at least one service processing operation changes, processing the to-be-adjusted forwarding interface of the at least one service processing operation in which the state changes;
根据所述待调整转发接口与流表块之间的对应关系, 确定待调整流表块; 根据预设的调整规则, 调整所述待调整流表块的当前版本号。  Determining, according to the preset adjustment rule, the current version number of the to-be-adjusted flow table block, according to the correspondence between the forwarding interface to be adjusted and the flow table block.
根据第一方面或第一方面的第一种至第四种任一种可能实现方式, 在第 五种可能实现方式中, 在所述获取待转发报文的五元组信息之前还包括: 初始化流表和转发接口的映射表。  According to the first aspect or the first to fourth possible implementation manners of the first aspect, in the fifth possible implementation manner, before the acquiring the quintuple information of the to-be-forwarded packet, the method further includes: initializing Mapping table for flow tables and forwarding interfaces.
根据第一方面的第五种可能实现方式, 在第六种可能实现方式中, 所述 初始化流表和转发接口的映射表包括:  According to a fifth possible implementation manner of the first aspect, in a sixth possible implementation, the mapping table of the initialization flow table and the forwarding interface includes:
获取当前所有业务和转发接口之间的对应关系, 并存储所述当前所有业 务和转发接口之间的对应关系;  Obtaining a correspondence between all the current services and the forwarding interface, and storing a correspondence between the current all services and the forwarding interface;
获取当前流表;  Get the current flow table;
根据预先的配置规则, 将所述流表分为若干个流表块; 其中, 每个流表 块包括若干个流节点;  Dividing the flow table into a plurality of flow table blocks according to a pre-configuration rule; wherein each flow table block includes a plurality of flow nodes;
为每个流表块设置版本号, 并为每个流表块的版本号设置初始值; 为每个转发接口分别建立一个映射表, 所述映射表用于存储转发接口与 流表块之间的对应关系。  Setting a version number for each flow table block, and setting an initial value for each flow table block version number; respectively, establishing a mapping table for each forwarding interface, the mapping table being used between the storage forwarding interface and the flow table block Correspondence.
第二方面, 本发明提供了一种流表刷新的装置, 包括:  In a second aspect, the present invention provides a device for refreshing a flow table, including:
第一获取单元, 用于获取待转发报文的五元组信息;  a first acquiring unit, configured to obtain quintuple information of the to-be-forwarded packet;
查找单元, 用于根据所述第一获取单元获取到的待转发报文的五元组信 息, 查找流表;  a searching unit, configured to search for a flow table according to the quintuple information of the to-be-forwarded packet obtained by the first acquiring unit;
第二获取单元, 用于在确定所述查找单元确定所述流表中存在一个已有 流节点的五元组信息与所述待转发报文的五元组信息相同时, 获取所述已有 流节点的当前版本号以及所述已有流节点所在流表块的当前版本号, 将所述 已有流节点的当前版本号以及所述已有流节点所在流表块的当前版本号传输 至更新单元; 更新单元, 用于在按照匹配规则确定所述第二获取单元获取到的已有流 节点的当前版本号与所述已有流节点所在流表块的当前版本号不一致时, 根 据所述待转发报文的业务信息更新所述已有流节点信息, 并按照所述匹配规 则将所述已有流节点的当前版本号设置为与所述已有流节点所在流表块的当 前版本号一致; a second obtaining unit, configured to: when determining that the locating unit determines that the quintuple information of the existing flow node in the flow table is the same as the quintuple information of the to-be-forwarded message, acquiring the existing The current version number of the flow node and the current version number of the flow table block where the existing flow node is located, and the current version number of the existing flow node and the current version number of the flow table block where the existing flow node is located are transmitted to Update unit An update unit, configured to determine, according to the matching rule, that the current version number of the existing flow node acquired by the second acquiring unit is different from the current version number of the flow table block where the existing flow node is located, according to the to-be-forwarded The service information of the packet is updated with the existing flow node information, and the current version number of the existing flow node is set to be consistent with the current version number of the flow table block where the existing flow node is located according to the matching rule;
其中, 所述流表根据预先的配置规则, 分为若干个流表块, 每个流表块 包括若干个流节点, 每个流表块均设置有对应的一个可调整的版本号, 每个 已有流节点也均设置有对应的一个可调整的版本号。  The flow table is divided into a plurality of flow table blocks according to a preset configuration rule, each flow table block includes a plurality of flow nodes, and each flow table block is provided with a corresponding one of adjustable version numbers, each Existing stream nodes are also provided with a corresponding adjustable version number.
在第二方面的第一种可能实现方式中, 所述流表刷新的装置还包括: 创建单元, 用于在确定所述第二获取单元获取到的所述流表中任意一个 流节点的五元组信息与所述待转发报文的五元组信息均不相同时, 为所述五 元组信息创建一个新的流节点, 并确定所述新的流节点所在的流表块;  In a first possible implementation manner of the second aspect, the device for refreshing the flow table further includes: a creating unit, configured to determine, in the flow table obtained by the second acquiring unit, five of any one of the flow nodes When the tuple information is different from the quintuple information of the to-be-forwarded packet, a new flow node is created for the quintuple information, and the flow table block where the new flow node is located is determined;
第三获取单元, 用于获取所述待转发报文的业务信息以及所述新的流节 点所在的流表块的当前版本号;  a third acquiring unit, configured to acquire service information of the to-be-forwarded packet and a current version number of the flow table block where the new flow node is located;
存储单元, 用于将所述待转发报文的业务信息和五元组信息存储在所述 创建单元创建的新的流节点中;  a storage unit, configured to store the service information and the quintuple information of the to-be-forwarded message in a new flow node created by the creating unit;
第一确定单元, 用于根据所述第三获取单元获取到的所述待转发报文的 业务信息, 确定对应的转发接口;  a first determining unit, configured to determine, according to the service information of the to-be-forwarded packet that is obtained by the third acquiring unit, a corresponding forwarding interface;
第三获取单元, 用于获取所述第一确定单元确定的所述转发接口的映射 表;  a third obtaining unit, configured to acquire a mapping table of the forwarding interface determined by the first determining unit;
所述更新单元, 用于更新所述第三获取单元获取到的转发接口的映射表 中所述新的流节点所在的流表块对应的标识; 按照所述匹配规则将所述新的 流节点的当前版本号设置为与所述新的流节点所在的流表块的当前版本号一 致。  The updating unit is configured to update an identifier corresponding to the flow table block where the new flow node is located in the mapping table of the forwarding interface acquired by the third acquiring unit; and the new flow node according to the matching rule The current version number is set to match the current version number of the flow table block in which the new stream node is located.
根据第二方面或第二方面的第一种可能实现方式, 在第二方面的第二种 可能实现方式中, 所述流表刷新装置还包括:  According to the second aspect or the first possible implementation manner of the second aspect, in the second possible implementation manner of the second aspect, the flow table refreshing apparatus further includes:
所述更新单元还用于在按照所述匹配规则确定所述已有流节点的当前版 本号以及所述已有流节点所在流表块的当前版本号一致时, 保持所述已有流 节点的信息不变。 The updating unit is further configured to determine a current version of the existing stream node according to the matching rule When the number and the current version number of the flow table block where the existing flow node is located are the same, the information of the existing flow node is kept unchanged.
根据第二方面或第二方面的第一种或第二种可能实现方式, 在第三种可 能实现方式中, 所述流表刷新的装置还包括:  According to the second aspect or the first or second possible implementation manner of the second aspect, in a third possible implementation, the device for refreshing the flow table further includes:
第二确定单元, 用于在检测到至少一个转发接口的状态发生变化时, 确 定待调整转发接口; 根据所述待调整转发接口与流表块之间的对应关系, 确 定待调整流表块;  a second determining unit, configured to determine, when the state of the at least one forwarding interface is changed, the forwarding interface to be adjusted; determining, according to the correspondence between the forwarding interface to be adjusted and the flow table block, the flow table block to be adjusted;
第一调整单元, 用于根据预设的调整规则, 调整所述第二确定以单元确 定的所述待调整流表块的当前版本号。  And a first adjusting unit, configured to adjust, according to a preset adjustment rule, a current version number of the to-be-adjusted flow table block determined by the second determination by the unit.
根据第二方面或第二方面的第一种至第三种任一种可能实现方式, 在第 四种可能实现方式中, 所述流表刷新的装置还包括:  According to the second aspect or the first to the third possible implementation manner of the second aspect, in the fourth possible implementation, the device for refreshing the flow table further includes:
第三确定单元, 用于在检测到至少一个业务处理操作的状态发生变化时, 确定处理所述状态发生变化的至少一个业务处理操作的待调整转发接口; 根 据所述待调整转发接口与流表块之间的对应关系, 确定待调整流表块;  a third determining unit, configured to: when it is detected that the state of the at least one service processing operation changes, determine a forwarding interface to be adjusted that processes the at least one service processing operation in which the state changes; according to the to-be-adjusted forwarding interface and the flow table Corresponding relationship between blocks, determining a flow table block to be adjusted;
第二调整单元, 用于根据预设的调整规则, 调整所述第三确定单元确定 的所述待调整流表块的当前版本号。  And a second adjusting unit, configured to adjust a current version number of the to-be-adjusted flow table block determined by the third determining unit according to a preset adjustment rule.
结合第二方面或第二方面的第一种至第四种任一种可能实现方式, 在第 五种可能实现方式中, 所述流表刷新的装置还包括:  With reference to the second aspect or the first to fourth possible implementation manners of the second aspect, in the fifth possible implementation, the device for refreshing the flow table further includes:
初始化单元, 用于初始化流表和转发接口的映射表。  An initialization unit, configured to initialize a mapping table of the flow table and the forwarding interface.
结合第二方面的第五种可能实现方式, 在第六种可能实现方式中, 所述 初始化单元包括:  With reference to the fifth possible implementation of the second aspect, in a sixth possible implementation, the initializing unit includes:
第一获取子单元, 用于获取当前所有业务和转发接口之间的对应关系, 并存储所述当前所有业务和转发接口之间的对应关系;  a first obtaining sub-unit, configured to acquire a correspondence between all current services and a forwarding interface, and store a correspondence between the current all services and the forwarding interface;
第二获取子单元, 用于获取当前流表;  a second obtaining subunit, configured to acquire a current flow table;
划分子单元, 用于根据预先的配置规则, 将所述第二获取子单元获取到 的流表分为若干个流表块; 其中, 每个流表块包括若干个流节点;  a sub-unit, configured to divide the flow table obtained by the second obtaining sub-unit into a plurality of flow table blocks according to a pre-configuration rule; wherein each flow table block includes a plurality of flow nodes;
设置子单元, 用于为所述划分子单元得到的每个流表块设置版本号, 并 为每个流表块的版本号设置初始值; Setting a subunit, configured to set a version number for each flow table block obtained by the dividing subunit, and Set an initial value for the version number of each flow table block;
建立子单元, 用于为每个转发接口分别建立一个映射表, 所述映射表用 于存储转发接口与流表块之间的对应关系。  A sub-unit is configured to establish a mapping table for each forwarding interface, where the mapping table is used for the correspondence between the storage forwarding interface and the flow table block.
本发明实施例提供了一种流表刷新的方法及装置, 通过将转发设备的流 表分成若干个流表块, 为每个流表块设置一个可调整的版本号, 每个流表块 包括若干个流节点, 为每个流节点设置一个可调整的版本号; 在创建流节点 时将流节点的版本号设置为所在流表块的版本号一致; 当业务处理操作状态 或者接口状态发生变化时只更新相关的流表块的版本号, 而到处理待转发报 文时, 再通过判断流节点的版本号和流节点所在的流表块的版本号是否一致, 来识别是否需要更新流节点的信息。 采用本发明提供的技术方案, 在流表刷 新的过程中, 不需要先删除原有流节点, 再重新学习生成新的流节点, 而是 保留原有流节点并只更新其存储的内容, 这样就不需要反复要求处理器释放 和重新分配***资源, 从而减少了***资源浪费, 极大地提高了处理器对于 转发报文的处理效率。  An embodiment of the present invention provides a method and an apparatus for refreshing a flow table. The flow table of the forwarding device is divided into a plurality of flow table blocks, and an adjustable version number is set for each flow table block, and each flow table block includes For each flow node, set an adjustable version number for each flow node. When creating a flow node, set the version number of the flow node to the version number of the flow table block. When the service processing operation status or interface status changes. Only the version number of the related flow table block is updated, and when the message to be forwarded is processed, it is determined whether the flow node needs to be updated by determining whether the version number of the flow node and the version number of the flow table block where the flow node is located are the same. Information. According to the technical solution provided by the present invention, in the process of refreshing the flow table, the original stream node does not need to be deleted first, and then the new stream node is re-learned, but the original stream node is retained and only the stored content is updated. There is no need to repeatedly request the processor to release and reallocate system resources, thereby reducing system resource waste and greatly improving the processing efficiency of the processor for forwarding messages.
附图说明 DRAWINGS
施例或现有技术描述中所需要使用的附图作筒单地介绍, 显而易见地, 下面 描述中的附图仅仅是本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动的前提下, 还可以根据这些附图获得其他的附图。 The drawings used in the examples or the description of the prior art are described in a single manner. It is obvious that the drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art do not pay Other drawings can also be obtained from these drawings on the premise of creative labor.
图 1为本发明实施例提供的一种流表刷新的方法流程图;  FIG. 1 is a flowchart of a method for refreshing a flow table according to an embodiment of the present invention;
图 2为本发明实施例提供的另一种流表刷新的方法流程图;  2 is a flowchart of another method for refreshing a flow table according to an embodiment of the present invention;
图 3为本发明实施例提供的另一种流表刷新的方法流程图;  FIG. 3 is a flowchart of another method for refreshing a flow table according to an embodiment of the present invention;
图 4为本发明实施例提供的另一种流表刷新的方法流程图;  FIG. 4 is a flowchart of another method for refreshing a flow table according to an embodiment of the present invention;
图 5为本发明实施例提供的另一种流表刷新的方法流程图;  FIG. 5 is a flowchart of another method for refreshing a flow table according to an embodiment of the present invention;
图 6为本发明实施例提供的另一种流表刷新的方法流程图;  FIG. 6 is a flowchart of another method for refreshing a flow table according to an embodiment of the present invention;
图 6A为本发明实施例提供的一种流表的逻辑结构图; 图 6B为本发明实施例提供的另一种流表的逻辑结构图; 6A is a logical structural diagram of a flow table according to an embodiment of the present invention; 6B is a logical structural diagram of another flow table according to an embodiment of the present invention;
图 6C为本发明实施例提供的另一种流表的逻辑结构图;  6C is a logical structural diagram of another flow table according to an embodiment of the present invention;
图 6D为本发明实施例提供的另一种流表的逻辑结构图;  6D is a logical structural diagram of another flow table according to an embodiment of the present invention;
图 6E为本发明实施例提供的另一种流表的逻辑结构图;  6E is a logical structural diagram of another flow table according to an embodiment of the present invention;
图 7为本发明实施例提供的一种流表刷新的装置的组成框图;  FIG. 7 is a structural block diagram of a device for refreshing a flow table according to an embodiment of the present invention;
图 8为本发明实施例提供的另一种流表刷新的装置的组成框图; 图 9为本发明实施例提供的另一种流表刷新的装置的组成框图; 图 1 0为本发明实施例提供的另一种流表刷新的装置的组成框图; 图 1 1为本发明实施例提供的另一种流表刷新的装置的组成框图; 图 12为本发明实施例提供的另一种流表刷新的装置的组成框图; 图 1 3为本发明实施例提供的另一种流表刷新的装置的组成框图。  FIG. 8 is a block diagram of a device for refreshing a flow table according to another embodiment of the present invention; FIG. 9 is a block diagram of another device for refreshing a flow table according to an embodiment of the present invention; FIG. A block diagram of a device for refreshing another flow table is provided. FIG. 11 is a block diagram of another device for refreshing a flow table according to an embodiment of the present invention; FIG. 12 is another flow chart according to an embodiment of the present invention. A block diagram of a composition of a refreshed device; FIG. 13 is a block diagram of a device for refreshing another flow table according to an embodiment of the present invention.
具体实施方式 下面将结合本发明实施例中的附图, 对本发明实施例中的技术方案进行 清楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而 不是全部的实施例。 基于本发明中的实施例, 本领域普通技术人员在没有作 出创造性劳动前提下所获得的所有其他实施例, 都属于本发明保护的范围。 The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. example. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
本发明提供的技术方案, 通过将转发设备的流表分成若干个流表块, 为 每个流表块分别设置一个可调整的版本号; 每个流表块包括若干个流节点, 为每个流节点设置一个可调整的版本号; 在创建流节点时将流节点的版本号 设置为所在流表块的版本号一致。 当业务处理操作状态发生变化或者接口状 态发生变化时, 不是直接刷新流表中的流节点, 而是通过更新相关的流表块 的版本号, 当处理待转发报文时, 判断流节点的版本号和流节点所在的流表 块的版本号是否一致, 来识别是否需要更新流节点的信息。  The technical solution provided by the present invention sets an adjustable version number for each flow table block by dividing the flow table of the forwarding device into a plurality of flow table blocks; each flow table block includes a plurality of flow nodes, for each The stream node sets an adjustable version number. When creating a stream node, set the version number of the stream node to the same version number of the stream table block. When the service processing operation status changes or the interface status changes, the flow node in the flow table is not directly refreshed, but the version number of the related flow table block is updated. When the packet to be forwarded is processed, the version of the flow node is determined. Whether the number and the version number of the flow table block where the stream node is located are the same, to identify whether the information of the stream node needs to be updated.
本发明实施例中, 流表块内的各个流节点的版本号需要在该流表块的版 本号的基础上进行创建或调整。  In the embodiment of the present invention, the version number of each flow node in the flow table block needs to be created or adjusted based on the version number of the flow table block.
需要说明的是,版本号的具体形式不限,例如为整数,初始时刻可以为 0。 可以理解的是, 流表分为多少个流表块, 每个流表块包括多少个流节点可以 预先配置。 It should be noted that the specific form of the version number is not limited, for example, an integer, and the initial time may be 0. It can be understood that the flow table is divided into how many flow table blocks, and how many flow nodes are included in each flow table block. Pre-configured.
本发明实施例提供的流表刷新的方法和装置, 应用于报文转发的过程中, 尤其适用于转发设备的流表刷新过程。  The method and device for refreshing the flow table provided by the embodiment of the present invention are applied to the process of packet forwarding, and are particularly applicable to the flow table refreshing process of the forwarding device.
参见图 1 ,为本发明实施例提供的一种流表刷新的方法,如图 1所示,所述 方法包括:  FIG. 1 is a flowchart of a flow table refreshing method according to an embodiment of the present invention. As shown in FIG. 1, the method includes:
101、 获取待转发报文的五元组信息。  101. Obtain quintuple information of the packet to be forwarded.
其中, 所述待转发报文的五元组信息包括该待转发报文的源 IP地址、 目 的 IP地址、 源端口号、 目的端口号、 协议号。  The quintuple information of the to-be-forwarded packet includes a source IP address, a destination IP address, a source port number, a destination port number, and a protocol number of the to-be-forwarded packet.
102、 根据所述待转发报文的五元组信息, 查找流表。  102. Search for a flow table according to the quintuple information of the to-be-forwarded packet.
其中, 所述流表中存储有流节点, 每个流节点都有唯一的五元组信息; 根据所述待转发报文的五元组信息查找流表, 就可以判断所述流表中是否有 对应所述待转发报文的流节点。  A flow node is stored in the flow table, and each flow node has unique quintuple information. According to the quintuple information of the to-be-forwarded packet, the flow table is searched, and whether the flow table is There is a flow node corresponding to the to-be-forwarded packet.
103、 若所述流表中存在一个已有流节点的五元组信息与所述待转发报文 的五元组信息相同, 则获取所述已有流节点的当前版本号以及所述已有流节 点所在流表块的当前版本号。  If the quintuple information of the existing flow node is the same as the quintuple information of the to-be-forwarded packet, the current version number of the existing flow node and the existing The current version number of the flow table block where the stream node is located.
若所述流表中存在一个已有流节点的五元组信息与所述待转发报文的五 元组信息相同, 表示有对应所述待转发报文的流节点; 通过获取所述已有流 节点的当前版本号以及所述已有流节点所在流表块的当前版本号, 就可以根 据所述已有流节点的当前版本号, 和所述已有流节点所在流表块的当前版本 号, 判断所述已有流节点中的信息是否需要更新。  If the quintuple information of the existing flow node is the same as the quintuple information of the to-be-forwarded packet, the flow node corresponding to the to-be-forwarded packet is obtained; The current version number of the flow node and the current version number of the flow table block where the existing flow node is located may be based on the current version number of the existing flow node and the current version of the flow table block where the existing flow node is located. No., determining whether the information in the existing stream node needs to be updated.
104、 若按照匹配规则, 确定所述已有流节点的当前版本号与所述已有流 节点所在流表块的当前版本号不一致, 则根据所述待转发报文的业务信息更 新所述已有流节点的信息, 并按照所述匹配规则将所述已有流节点的当前版 本号设置为与所述已有流节点所在流表块的当前版本号一致。  And determining, according to the matching rule, that the current version number of the existing flow node is different from the current version number of the flow table block where the existing flow node is located, and updating the service information according to the service information of the to-be-forwarded packet. The information of the flow node is set, and the current version number of the existing flow node is set to be consistent with the current version number of the flow table block where the existing flow node is located according to the matching rule.
以所述匹配规则为流节点的版本号与流节点所在流表块的版本号是否相 同为例, 若流表中存在所述待转发报文对应的流节点, 即所述已有流节点, 且确定所述已有流节点的当前版本号与所述已有流节点所在流表块的当前版 本号不同, 可能是业务处理操作状态发生了变化或者接口状态发生了变化, 此时只需根据待转发报文的业务信息更新所述已有流节点的信息, 具体的, 更新所述已有流节点中的业务信息, 而不用删除所述已有流节点再重新建立 新的流节点, 从而避免了转发设备的处理器释放和重新分配***资源, 减少 了***资源浪费, 提高了处理器转发报文的效率。 For example, if the matching rule is that the version number of the flow node is the same as the version number of the flow table block where the flow node is located, if the flow node has the flow node corresponding to the to-be-forwarded packet, that is, the existing flow node, And determining a current version number of the existing flow node and a current version of the flow table block where the existing flow node is located If the number is different, the service processing status may be changed or the interface status may be changed. In this case, the information of the existing flow node is updated according to the service information of the packet to be forwarded. Specifically, the existing information is updated. The service information in the flow node does not need to delete the existing flow node and re-establish a new flow node, thereby avoiding the processor of the forwarding device releasing and reallocating system resources, reducing system resource waste, and improving processor forwarding. The efficiency of the message.
采用本发明实施例提供的一种流表刷新的方法, 通过将整个流表分为若 干个流表块, 为每个流表块设置版本号, 并为每个流节点设置对应的版本号, 当收到待转发报文时, 通过判断该待转发报文对应的流节点的版本号与所在 流表块的版本号是否一致, 使得在流表刷新的过程中, 不需要先删除原有流 节点, 再重新学习生成新的流节点, 而是保留原有流节点并只更新其存储的 内容, 这样就不需要反复要求处理器释放和重新分配***资源, 从而减少了 ***资源浪费, 极大地提高了处理器对于转发报文的处理效率。  A method for refreshing a flow table according to an embodiment of the present invention, by dividing the entire flow table into a plurality of flow table blocks, setting a version number for each flow table block, and setting a corresponding version number for each flow node. When the packet to be forwarded is received, it is determined whether the version number of the stream node corresponding to the packet to be forwarded is the same as the version number of the flow table block, so that the flow stream is not refreshed first. The node re-learns to generate a new stream node, but retains the original stream node and only updates its stored content, so that the processor is not required to repeatedly release and reallocate system resources, thereby reducing system resource waste, greatly Improve the processing efficiency of the processor for forwarding messages.
需要说明的是, 以下为方便叙述, 均以流节点的版本号与流节点所在流 表块的版本号是否相同作为所述匹配规则来介绍本发明技术方案。 本发明实 施例中, 以最筒单的实现方式, 即将流节点的版本号与所在流表块的版本号 是否相同, 不同则设置为所在流表块的版本号为例进行说明, 但并不能作为 对本发明的限定。 可以理解的是, 也可以设置匹配规则, 例如流节点的版本 号与所在的流表块的版本号是倍数关系, 来判断流节点的版本号和所在的流 表块的版本号是否一致, 并根据匹配规则更新版本号。 举例来说, 流节点的 版本号与所在的流表块的版本号成 2倍关系,第一时刻,流节点的版本号为 2 , 所在流表块的版本号都为 1 , 则流节点的版本号和所在的流表块的版本号一 致, 无需更新流节点, 待转发报文根据流节点的信息进行转发; 第二时刻, 由于业务或者接口状态发生变化, 流表块的版本号更新为 2 , 而流节点的版本 号为 2 , 此时流节点的版本号和所在的流表块的版本号不一致, 需要根据待转 发报文的业务信息更新流节点的信息, 并将流节点的版本号调整为 4。  It should be noted that, in the following, for convenience of description, the technical solution of the present invention is introduced by using the version number of the stream node and the version number of the flow block in which the stream node is located as the matching rule. In the embodiment of the present invention, the version number of the stream node is the same as the version number of the stream table block, and the version number of the stream table block is set as an example, but the method cannot be used. As a limitation of the invention. It can be understood that the matching rule may also be set, for example, the version number of the stream node is a multiple of the version number of the stream table block, and the version number of the stream node is consistent with the version number of the stream table block, and Update the version number according to the matching rule. For example, the version number of the flow node is twice as large as the version number of the flow table block. The first time, the version number of the flow node is 2, and the version number of the flow table block is 1, the flow node The version number of the flow table block is the same as the version number of the flow table block. The version of the flow table block is updated to be updated based on the information of the flow node. 2, and the version number of the stream node is 2, and the version number of the stream node is inconsistent with the version number of the stream table block. The information of the stream node needs to be updated according to the service information of the packet to be forwarded, and the version of the stream node is updated. The number is adjusted to 4.
参见图 2 , 为本发明实施例提供的另一种流表刷新的方法,如图 2 所示, 所述方法包括: 201、 初始化流表和转发接口的映射表。 Referring to FIG. 2, another method for refreshing a flow table according to an embodiment of the present invention is shown in FIG. 2, where the method includes: 201. Initialize a mapping table of the flow table and the forwarding interface.
具体的, 所述初始化流表和转发接口的映射表包括:  Specifically, the mapping table of the initialization flow table and the forwarding interface includes:
201 1、 获取当前所有业务处理操作和转发接口之间的对应关系, 并存储 所述当前所有业务处理操作和转发接口之间的对应关系。  The mapping between the current service processing operations and the forwarding interface is obtained, and the correspondence between the current service processing operations and the forwarding interface is stored.
其中, 需要说明的是, 不同的转发接口可以执行相同的业务处理操作, 也可以执行不同的业务处理操作, 每个转发接口可以执行哪些业务处理操作 是预先设置好的。 在本实施例中, 将当前所有业务处理操作和转发接口之间 的对应关系进行存储, 即将每个转发接口可执行的业务处理操作进行存储, 以方便后续当业务处理操作状态变化和转发接口状态发生变化时的处理。  It should be noted that different forwarding interfaces can perform the same service processing operations, and can also perform different service processing operations, and which service processing operations can be performed by each forwarding interface are preset. In this embodiment, the correspondence between the current service processing operations and the forwarding interface is stored, that is, the service processing operations that can be performed by each forwarding interface are stored, so as to facilitate the subsequent change of the service processing state and the forwarding interface state. Processing when a change occurs.
在本实施例中, 所述当前所有业务处理操作和转发接口之间的对应关系 并不是固定不变的, 当有新的业务处理操作被启用或者某个业务处理操作被 停止使用时, 又或者当某个转发接口开启或者关闭时, 需要及时更新当前所 有业务处理操作和转发接口之间的对应关系。  In this embodiment, the correspondence between the current all service processing operations and the forwarding interface is not fixed, when a new service processing operation is enabled or a certain service processing operation is stopped, or When a forwarding interface is enabled or disabled, you need to update the mapping between all current service processing operations and forwarding interfaces.
2012、 获取当前流表。  2012, get the current flow table.
其中, 单独一个转发设备一般只设置一个流表。  Among them, a single forwarding device generally only sets one flow table.
201 3、 根据预先的配置规则, 将所述流表分为若干个流表块; 其中, 每 个流表块包括若干个流节点。 其中, 在步骤 201 3中, 所述预设的配置规则用 于指示将流表分为多少个流表块, 每个流表块包括多少个流节点。 例如, 流 表包括最多 24个流节点, 可将该流表分为 3个流表块, 每个流表块包括 8个 流节点。 在本实施例中, 所述将所述流表分为若干个流表块具体的实现方法 可以包括获取流表占用的全部内存空间, 将所述全部内存空间划分为若干个 内存区域, 每个内存区域作为一个流表块, 并为每个流表块分别分配一个索 引号, 每个流表块根据自身的内存大小以及每个流节点所占用的内存大小, 即可确定每个流表块可包括多少个流节点。  201 3. According to a pre-configuration rule, the flow table is divided into several flow table blocks; wherein each flow table block includes several flow nodes. In step 2013, the preset configuration rule is used to indicate how many flow table blocks are divided into flow table blocks, and how many flow nodes are included in each flow table block. For example, the flow table includes up to 24 flow nodes, and the flow table can be divided into three flow table blocks, and each flow table block includes eight flow nodes. In this embodiment, the method for dividing the flow table into a plurality of flow table blocks may include: obtaining all memory spaces occupied by the flow table, and dividing the entire memory space into a plurality of memory regions, each The memory area is used as a flow table block, and each flow table block is assigned an index number. Each flow table block can determine each flow table block according to its own memory size and the memory size occupied by each flow node. How many stream nodes can be included.
2014、 为每个流表块设置版本号, 并将每个流表块的版本号设置为初始 值。  2014, set the version number for each flow table block, and set the version number of each flow table block to the initial value.
在本实施例中, 版本号可以设置为整数, 例如 1 , 2等; 也可以设置为浮 点数, 例如 0. 1 , 1. 2等。 其中, 初始值可为 0或其他固定值。 In this embodiment, the version number can be set to an integer, such as 1, 2, etc.; Points, such as 0. 1 , 1. 2, etc. Among them, the initial value can be 0 or other fixed value.
在创建新的流节点时, 可以将新的流节点的版本号设置为该新的流节点 所在的流表块当前的版本号。  When creating a new stream node, you can set the version number of the new stream node to the current version number of the stream table block where the new stream node is located.
2015、 为每个转发接口分别建立一个映射表, 所述映射表用于存储转发 接口与流表块之间的对应关系。  In 2015, a mapping table is established for each forwarding interface, where the mapping table is used to store the correspondence between the forwarding interface and the flow table block.
其中, 所述映射表为本发明实施例中设置的用于存储转发接口与流表块 之间的对应关系, 每个转发接口的映射表中对应每个流表块存储一个标识, 用于表示转发接口与流表块是否有对应关系; 所述映射表可以但不局限于使 用位域映射表 bi tmap形式来实现, bi tma 中一个比特位标识流表中的一个流 表块, 比特位为 "1" 表示转发接口与流表块具有对应关系, 而比特位为 "0" 则表示转发接口与流表块不具有对应关系。 举例来说, 接口 1 的 bi tmap 为 "11100011" , 表示接口 1与所述流表中的第 1、 2、 3、 7、 8流表块有对应关 系。  The mapping table is a mapping between the storage forwarding interface and the flow table block, and the mapping table of each forwarding interface stores an identifier for each flow table block, which is used to represent Whether the forwarding interface has a corresponding relationship with the flow table block; the mapping table may be, but is not limited to, implemented by using a bit field mapping table bi tmap form; one bit in the bi tma identifies a flow table block in the flow table, and the bit position is "1" indicates that the forwarding interface has a corresponding relationship with the flow table block, and a bit of "0" indicates that the forwarding interface does not have a corresponding relationship with the flow table block. For example, the bi tmap of interface 1 is "11100011", indicating that interface 1 has a corresponding relationship with the first, 2, 3, 7, and 8 flow table blocks in the flow table.
其中, 所述转发接口与流表块之间的对应关系表示该转发接口可完成与 该转发接口对应的流表块中的流节点的业务信息对应的业务处理操作。  The corresponding relationship between the forwarding interface and the flow table block indicates that the forwarding interface can complete the service processing operation corresponding to the service information of the flow node in the flow table block corresponding to the forwarding interface.
202、 获取待转发报文的五元组信息。  202. Obtain quintuple information of the to-be-forwarded packet.
其中, 所述待转发报文的五元组信息包括该待转发报文的源 IP地址、 报 文目的 IP地址、 源端口号、 目的端口号、 协议号。  The quintuple information of the to-be-forwarded packet includes the source IP address of the to-be-forwarded packet, the destination IP address of the packet, the source port number, the destination port number, and the protocol number.
具体可参考 101 , 在此不再赘述。  For details, refer to 101, and details are not described herein.
203、 根据所述待转发报文的五元组信息, 查找流表。  203. Search for a flow table according to the quintuple information of the to-be-forwarded packet.
具体可参考 102 , 在此不再赘述。  For details, refer to 102, and details are not described herein.
204、 若所述流表中存在一个已有流节点的五元组信息与所述待转发报文 的五元组信息相同, 则获取所述已有流节点的当前版本号以及所述已有流节 点所在流表块的当前版本号。  204. If the quintuple information of the existing flow node is the same as the quintuple information of the to-be-forwarded packet, obtain the current version number of the existing flow node and the existing The current version number of the flow table block where the stream node is located.
具体可参考 103 , 在此不再赘述。  For details, refer to 103, and details are not described here.
205、 若按照匹配规则确定所述已有流节点的当前版本号与所述已有流节 点所在流表块的当前版本号不一致, 则根据所述待转发报文的业务信息更新 所述已有流节点的信息, 并按照匹配规则将所述已有流节点的当前版本号设 置为与所述已有流节点所在流表块的当前版本号一致。 205. If it is determined that the current version number of the existing flow node is inconsistent with the current version number of the flow table block where the existing flow node is located, the service information is updated according to the service information of the to-be-forwarded packet. And the current version number of the existing flow node is set to be consistent with the current version number of the flow table block where the existing flow node is located according to the matching rule.
具体可参考 104 , 在此不再赘述。  For details, refer to 104, and details are not described here.
参见图 3 , 为本发明实施例提供的又一种流表刷新的方法,如图 3 所示, 所述方法包括:  Referring to FIG. 3, a method for refreshing a flow table according to an embodiment of the present invention is provided. As shown in FIG. 3, the method includes:
301、 初始化流表和转发接口的映射表。  301. Initialize a mapping table of the flow table and the forwarding interface.
具体可参考 201 , 在此不再赘述。  For details, refer to 201, and details are not described herein.
302、 获取待转发报文的五元组信息。  302. Obtain quintuple information of the to-be-forwarded packet.
其中,所述待转发报文对应的五元组信息包括该待转发报文的源 IP地址、 目的 IP地址、 源端口号、 目的端口号、 协议号。  The quintuple information corresponding to the to-be-forwarded packet includes a source IP address, a destination IP address, a source port number, a destination port number, and a protocol number of the to-be-forwarded packet.
303、 根据所述待转发报文的五元组信息, 查找所述流表。 若在所述流表 中查找到一个已有流节点的五元组信息与所述待转发报文的五元组信息相同 时, 则执行 304-307; 若所述流表中任意一个流节点的五元组信息与所述五元 组信息均不相同时, 执行步骤 308-313。  303. Search for the flow table according to the quintuple information of the to-be-forwarded packet. If the quintuple information of the existing flow node is the same as the quintuple information of the to-be-forwarded packet, the process performs 304-307; if any flow node in the flow table When the quintuple information is different from the quintuple information, steps 308-313 are performed.
其中, 每个流节点中包括五元组信息和业务信息。  Each stream node includes quintuple information and service information.
304、 当所述流表中存在一个已有流节点的五元组信息与所述五元组信息 相同时, 获取所述已有流节点的当前版本号以及所述已有流节点所在流表块 的当前版本号。  When the quintuple information of the existing flow node is the same as the quintuple information, the current version number of the existing flow node and the flow table of the existing flow node are obtained. The current version number of the block.
305、 判断所述已有流节点的当前版本号以及所述已有流节点所在流表块 的当前版本号是否相同。  305. Determine whether the current version number of the existing flow node and the current version number of the flow table block where the existing flow node is located are the same.
306、 若按照匹配规则确定所述已有流节点的当前版本号以及所述已有流 节点所在流表块的当前版本号不一致, 根据所述待转发报文的业务信息更新 所述已有流节点的信息, 并按照匹配规则将所述已有流节点的当前版本号设 置为与所述已有流节点所在流表块的当前版本号一致。  306. If the current version number of the existing flow node and the current version number of the flow table block where the existing flow node is located are inconsistent according to the matching rule, update the existing flow according to the service information of the to-be-forwarded packet. The information of the node, and the current version number of the existing flow node is set to be consistent with the current version number of the flow table block where the existing flow node is located according to the matching rule.
其中, 需要说明的是, 若在步骤 304执行之后需执行步骤 305 , 则意味着 所述待转发报文不能进行流转发, 那么此时应该使用基本转发流程对所述待 转发报文进行转发。 在此基本转发流程中, 即可获取到所述待转发报文的业 务信息。 It should be noted that, if the step 305 is performed after the step 304 is performed, it means that the to-be-forwarded packet cannot be forwarded by using the basic forwarding process. In the basic forwarding process, the service to be forwarded is obtained. Information.
具体的, 根据所述待转发报文的业务信息更新所述已有流节点的信息包 括: 用所述待转发报文的业务信息更新所述已有流节点中的业务信息; 具体 来说, 可依照所述待转发报文通过基本转发流程中获取到的所述待转发报文 的业务信息, 替换所述已有流节点的业务信息。  Specifically, updating the information of the existing flow node according to the service information of the to-be-forwarded message includes: updating the service information of the existing flow node by using the service information of the to-be-forwarded message; specifically, The service information of the existing flow node may be replaced by the service information of the to-be-forwarded packet obtained in the basic forwarding process.
307、 若按照匹配规则确定所述已有流节点的当前版本号以及所述已有流 节点所在流表块的当前版本号一致, 保持所述已有流节点的信息不变。  307. If the current version number of the existing flow node and the current version number of the flow table block where the existing flow node is located are consistent according to the matching rule, the information of the existing flow node is kept unchanged.
其中, 需要说明的是, 若在步骤 304执行之后需执行步骤 306 , 则意味着 报文可以根据流表中所述已有流节点的信息进行流转发。  It should be noted that, if step 306 is performed after the execution of step 304, it means that the message can be forwarded according to the information of the existing stream node in the flow table.
例如匹配规则为流节点的当前版本号与所述流节点所在流表块的当前版 本号是否相同。  For example, the matching rule is whether the current version number of the stream node is the same as the current version number of the stream table block where the stream node is located.
308、 当所述流表中任意一个流节点的五元组信息与所述五元组信息均不 相同时, 为所述待转发报文的五元组信息创建一个新的流节点, 并确定所述 新的流节点所在的流表块。  308. When the quintuple information of any one of the flow nodes is different from the quintuple information, create a new flow node for the quintuple information of the to-be-forwarded packet, and determine The flow table block in which the new flow node is located.
其中, 所述确定所述新的流节点所在的流表块的方法包括: 根据所述待 转发报文的五元组信息结合哈希 hash算法, 计算出流节点的索引号; 将该流 节点的索引号除以当前流表块数量得到的商值, 即为该流节点所在流表块的 索引号。 根据所述流表块的索引号, 即可确定该流节点所在流表块。 例如, 根据所述待转发报文的五元组信息结合 hash算法, 计算出流节点的索引号为 55 , 当前共有 10个流表块,索引号分别为 0-9 ,每个流表块包括 10个流节点, 则 55除以 10得到的商值为 5 , 则索引号为 55的流节点在索引号为 5的流表 块中。  The method for determining the flow table block where the new flow node is located includes: calculating, according to the quintuple information of the to-be-forwarded message, a hash hash algorithm, and calculating an index number of the flow node; The quotient of the index number divided by the current number of stream table blocks is the index number of the flow table block where the stream node is located. According to the index number of the flow table block, the flow table block where the flow node is located can be determined. For example, according to the quintuple information of the to-be-forwarded message combined with the hash algorithm, the index number of the flow node is calculated as 55, and there are currently 10 flow table blocks, and the index numbers are respectively 0-9, and each flow table block includes For 10 stream nodes, the quotient value obtained by dividing 55 by 10 is 5, and the stream node with index number 55 is in the flow table block with index number 5.
另外, 需要说明的是, 若在执行步骤 302之后, 需要执行步骤 307 , 则意 味着所述待转发报文不能进行流转发, 那么此时所述待转发报文进行基本转 发流程。  In addition, it should be noted that, if the step 307 is performed after the step 302 is performed, it means that the to-be-forwarded packet cannot be forwarded by the flow, and then the to-be-forwarded packet performs a basic forwarding process.
309、 获取所述待转发 >¾文的业务信息以及所述新的流节点所在的流表块 的当前版本号。 其中, 所述待转发报文的业务信息可以在该报文的基本转发流程中获取。309. Obtain the service information of the to-be-forwarded message and the current version number of the flow table block where the new flow node is located. The service information of the to-be-forwarded packet can be obtained in the basic forwarding process of the packet.
31 0、 将所述待转发报文的业务信息和五元组信息存储在所述新的流节点 中。 31 0. Store the service information and the quintuple information of the to-be-forwarded packet in the new flow node.
31 1、 根据所述业务信息, 确定与所述业务信息对应的转发接口。  31 1. Determine, according to the service information, a forwarding interface corresponding to the service information.
具体的, 可通过步骤 201 中存储的当前所有业务处理操作和转发接口之 间的对应关系进行查询后确定。  Specifically, the query may be performed after the query is performed by using the correspondence between all current service processing operations and forwarding interfaces stored in step 201.
312、 获取所述转发接口的映射表, 并更新所述转发接口的映射表中所述 新的流节点所在的流表块对应的标识。  312. Obtain a mapping table of the forwarding interface, and update an identifier corresponding to the flow table block where the new flow node is located in the mapping table of the forwarding interface.
其中, 所述转发接口的映射表即为步骤 202中建立的映射表。  The mapping table of the forwarding interface is the mapping table established in step 202.
本实施例在此提供一种置位方法, 包括: 在所述转发接口的映射表中, 与该转发接口有对应关系的流表块, 其对应位置设置为 1 ; 而与该转发接口没 有对应关系的流表块, 其对应位置设置为 0。 例如, 流表中共有 8个流表块, 第 1、 3、 4、 5个流表块与同一个转发接口有对应关系, 则在该转发接口的映 射表中应设置为 10111000。  The embodiment provides a setting method, including: in the mapping table of the forwarding interface, the flow table block corresponding to the forwarding interface has a corresponding position set to 1; and the forwarding interface does not correspond to the forwarding interface. The flow table block of the relationship whose corresponding position is set to 0. For example, if there are eight flow table blocks in the flow table, and the first, third, fourth, and fifth flow table blocks have a corresponding relationship with the same forwarding interface, the mapping table of the forwarding interface should be set to 10111000.
31 3、 按照所述匹配规则将所述新的流节点的当前版本号设置为与所述新 的流节点所在的流表块的当前版本号一致。  31. Set the current version number of the new flow node to be consistent with the current version number of the flow table block where the new flow node is located according to the matching rule.
例如, 匹配规则为流节点的当前版本号与所述流节点所在流表块的当前 版本号是否相同。 则可以将所述新的流节点的当前版本号设置为所述新的流 节点所在的流表块的当前版本号。  For example, the matching rule is whether the current version number of the stream node is the same as the current version number of the flow table block where the stream node is located. Then, the current version number of the new stream node may be set to the current version number of the stream table block where the new stream node is located.
需要说明的是, 31 3也可以在 31 1之前执行。  It should be noted that 31 3 can also be executed before 31 1 .
在本实施例中, 值得说明的是, 当业务处理操作状态发生变化或者转发 接口状态发生变化时, 例如某个转发接口开启或关闭, 某个业务处理操作被 启动或某个业务处理操作被暂停使用等, 都会触发流表更新。  In this embodiment, it is worth noting that when the service processing operation status changes or the forwarding interface status changes, for example, a forwarding interface is enabled or disabled, a certain service processing operation is started or a certain service processing operation is suspended. Use, etc., will trigger the flow table update.
在本发明图 1、 图 2或图 3所示的流表刷新的方法基础上, 本发明实施例 还提供了业务处理操作状态发生变化和转发接口状态发生变化时, 流表刷新 的方法的预处理流程。 如图 4 所示, 为基于业务处理操作状态发生变化时, 流表刷新的方法的预处理流程, 包括: 401、 当检测到至少一个业务处理操作的状态发生变化时, 确定处理所述 状态发生变化的至少一个业务处理操作的待调整转发接口。 On the basis of the method for refreshing the flow table shown in FIG. 1, FIG. 2 or FIG. 3, the embodiment of the present invention further provides a method for refreshing the flow table when the state of the service processing operation changes and the state of the forwarding interface changes. Process flow. As shown in Figure 4, the pre-processing flow of the method for refreshing the flow table when the operation state changes based on the business processing includes: 401. When it is detected that a state of the at least one service processing operation changes, determine a to-be-adjusted forwarding interface that processes the at least one service processing operation in which the state changes.
在步骤 401 中, 确定所述状态发生变化的至少一个业务处理操作的待调 整转发接口的实现方法可参照步骤 2011中已获取到的转发接口与业务处理操 作之间的对应关系进行查找。  In step 401, the method for determining the to-be-adjusted forwarding interface of the at least one service processing operation in which the status is changed may be searched by referring to the correspondence between the forwarding interface and the service processing operation obtained in step 2011.
402、 根据所述待调整转发接口与流表块之间的对应关系, 确定待调整流 表块。  402. Determine, according to the correspondence between the forwarding interface to be adjusted and the flow table block, the flow table block to be adjusted.
在步骤 402中,待调整转发接口与流表块之间的对应关系可参照步骤 205 中的映射表。  In step 402, the correspondence between the forwarding interface and the flow table block to be adjusted may refer to the mapping table in step 205.
403、 根据预设的调整规则, 调整待调整流表块的当前版本号。  403. Adjust a current version number of the flow table block to be adjusted according to a preset adjustment rule.
其中, 所述预设的调整规则可以根据具体实现方式预设设置, 例如若版 本号设置为整数, 则可以将所述当前版本号加 1或减 1。 若版本号设置为浮点 数, 则可以将所述当前版本号加 0. 1或减 0. 1。 当然, 此处的描述只是本实施 例中提供的一种实施方案, 本发明实施例对此并不限制。  The preset adjustment rule may be preset according to a specific implementation manner. For example, if the version number is set to an integer, the current version number may be incremented or decremented by one. If the version number is set to a floating point number, the current version number may be increased by 0.1 or minus 0.1. Of course, the description herein is only one embodiment provided in this embodiment, which is not limited by the embodiment of the present invention.
值得说明的是, 上述步骤 401至 403的执行过程中, 如果所述状态发生 变化的业务处理操作对应的转发接口多于一个, 则版本号的调整需要根据所 述状态发生变化的业务处理操作对应的转发接口的数量多次调整。 例如, 当 前状态发生变化的业务处理操作对应的转发接口有两个, 则先调整与其中一 个转发接口有对应关系的流表块的版本号, 然后在此调整结果上, 再调整与 另一个转发接口有对应关系的流表块的版本号。  It is to be noted that, in the execution of the foregoing steps 401 to 403, if the service processing operation in which the status changes is more than one forwarding interface, the adjustment of the version number needs to be performed according to the service processing operation in which the status changes. The number of forwarding interfaces has been adjusted multiple times. For example, if there are two forwarding interfaces corresponding to the service processing operation whose current status changes, the version number of the flow table block corresponding to one of the forwarding interfaces is adjusted first, and then the adjustment result is adjusted and the other forwarding is performed. The interface has the version number of the corresponding flow table block.
如图 5 所示, 为基于转发接口状态发生变化时, 流表刷新的方法的预处 理流程, 包括:  As shown in Figure 5, the pre-processing flow of the method for refreshing the flow table when the status of the forwarding interface changes is as follows:
501、当检测到至少一个转发接口状态发生变化时,确定待调整转发接口; 并根据所述待调整转发接口与流表块之间的对应关系, 确定待调整流表块。  501. When it is detected that the state of the at least one forwarding interface is changed, determine the forwarding interface to be adjusted; and determine, according to the correspondence between the forwarding interface to be adjusted and the flow table block, the flow table block to be adjusted.
502、 根据预设的调整规则, 调整所述待调整流表块的当前版本号。  502. Adjust a current version number of the to-be-adjusted flow table block according to a preset adjustment rule.
具体的, 可以参见 403 , 在此不再赘述。  For details, see 403, and details are not described here.
值得说明的是, 上述步骤 501至 502的执行过程中, 如果所述状态发生 变化的转发接口多于一个, 则版本号的调整需要根据所述状态发生变化的转 发接口的数量多次调整。 例如, 当前状态发生变化转发接口有两个, 则先调 整与其中一个转发接口有对应关系的流表块的版本号, 然后在此调整结果上, 再调整与另一个转发接口有对应关系的流表块的版本号。 It is worth noting that during the execution of the above steps 501 to 502, if the state occurs If there are more than one forwarding interface, the adjustment of the version number needs to be adjusted multiple times according to the number of forwarding interfaces whose status changes. For example, if there are two forwarding interfaces in the current state change, the version number of the flow table block corresponding to one of the forwarding interfaces is adjusted first, and then the flow matching the other forwarding interface is adjusted on the result of the adjustment. The version number of the table block.
另外, 值得说明的是, 若存在若干个业务处理操作和若干个转发接口同 时出现状态变化时, 则可先结合步骤 401-403 ,根据出现状态变化的业务处理 操作对流表进行调整, 再结合步骤 501-502 , 根据出现状态变化的转发接口对 流表进行调整。 或者, 先结合步骤 501-502 , 根据出现状态变化的转发接口对 流表进行调整,再结合步骤 401-403 ,根据出现状态变化的业务处理操作对流 表进行调整。  In addition, it is worth noting that if there are several service processing operations and a plurality of forwarding interfaces change state at the same time, the flow table may be adjusted according to the service processing operation in which the state changes according to the steps 401-403, and then the steps are combined. 501-502: Adjust the flow table according to the forwarding interface whose status changes. Or, in combination with steps 501-502, the flow table is adjusted according to the forwarding interface whose appearance changes, and then combined with steps 401-403, the flow table is adjusted according to the service processing operation in which the state changes.
可以理解的是, 图 4和图 5所示的流表刷新的方法的预处理流程将导致 流表中流节点的版本号与流表块的版本号不一致, 从而触发流表刷新。  It can be understood that the pre-processing flow of the method for refreshing the flow table shown in FIG. 4 and FIG. 5 causes the version number of the flow node in the flow table to be inconsistent with the version number of the flow table block, thereby triggering the flow table refresh.
具体的, 在此结合如图 6A所示的流表, 具体描述本发明实施例提供的一 种流表刷新的过程, 参见图 6。 图 6A所示的流表分为 2个流表块, 每个流表 块包括 8个流节点, 流表块的索引号分别为 0、 1 ,每个流表块的版本号为 νθ ; 在该流表中已设置有 8个流节点, 索引号分别为 0-15 , 每个流节点的版本号 为 v0。 如图 6所示, 所述流表刷新的过程包括:  Specifically, the flow table refreshing process provided by the embodiment of the present invention is specifically described in conjunction with the flow table shown in FIG. 6A, and FIG. 6 is shown. The flow table shown in FIG. 6A is divided into two flow table blocks, each flow table block includes eight flow nodes, the index numbers of the flow table blocks are respectively 0, 1, and the version number of each flow table block is νθ; There are 8 flow nodes in the flow table, the index numbers are 0-15, and the version number of each flow node is v0. As shown in FIG. 6, the process of refreshing the flow table includes:
601、 当与流表块 1具有对应关系的转发接口状态发生变化时, 则将流表 块 1的当前版本号 νθ调整为 vl , 调整结果参照图 6B。  601. When the state of the forwarding interface corresponding to the flow table block 1 changes, the current version number νθ of the flow table block 1 is adjusted to v1, and the adjustment result is referred to FIG. 6B.
602、 当与流表块 0和流表块 1均具有对应关系的转发接口状态发生变化 时, 则将流表块 0的当前版本号 vl调整为 v2 , 同时将流表块 1的当前版本号 νθ调整为 vl , 调整结果参照图 6C。  602. When the state of the forwarding interface that has a corresponding relationship between the flow table block 0 and the flow table block 1 changes, the current version number v1 of the flow table block 0 is adjusted to v2, and the current version number of the flow table block 1 is Νθ is adjusted to vl, and the adjustment result is shown in Fig. 6C.
603、 获取待转发报文 1的五元组信息。  603. Obtain quintuple information of the message to be forwarded.
604、 根据所述待转发报文 1的五元组信息, 查找所述流表。  604. Search for the flow table according to the quintuple information of the to-be-forwarded packet 1.
605、 当确定所述流表中流节点 2的五元组信息与所述待转发 >¾文 1的五 元组信息相同时, 获取流节点 2的当前版本号 vQ以及流节点 2所在流表块 0 的当前版本号 vl。 606、 确定所述流节点 2的当前版本号与流节点 2所在流表块 Q的当前版 本号不同, 则将所述待转发报文 1进行基本转发。 605. When it is determined that the quintuple information of the flow node 2 in the flow table is the same as the quintuple information of the message to be forwarded, obtain the current version number vQ of the flow node 2 and the flow table block where the flow node 2 is located. The current version number of v is vl. 606. Determine that the current version number of the flow node 2 is different from the current version number of the flow table block Q where the flow node 2 is located, and then forward the packet to be forwarded.
本实施例中, 匹配规则为流节点的当前版本号与所述流节点所在流表块 的当前版本号是否相同。  In this embodiment, the matching rule is whether the current version number of the flow node is the same as the current version number of the flow table block where the flow node is located.
607、 根据所述待转发报文 1的业务信息更新所述流节点 2的信息, 并将 所述流节点 2的当前版本号 νθ设置为所述流节点 2所在流表块 Q的当前版本 号 vl , 调整结果参照图 6D所示。  607. Update the information of the flow node 2 according to the service information of the to-be-forwarded message 1, and set the current version number νθ of the flow node 2 to the current version number of the flow table block Q where the flow node 2 is located. Vl, the adjustment result is shown in Fig. 6D.
608、 获取待转发报文 2的五元组信息。  608. Obtain quintuple information of the message 2 to be forwarded.
609、 当确定所述流表中流节点 8的五元组信息与所述待转发 >¾文 2的五 元组信息相同时, 获取流节点 8的当前版本号 vQ以及流节点 8所在流表块 1 的当前版本号 v2。  609. When it is determined that the quintuple information of the flow node 8 in the flow table is the same as the quintuple information of the to-be-forwarded packet, obtain the current version number vQ of the flow node 8 and the flow table block where the flow node 8 is located. The current version number of 1 is v2.
610、 确定所述流节点 8的当前版本号与流节点 8所在流表块 1的当前版 本号不同, 则将所述待转发报文 2进行基本转发。  610. Determine that the current version number of the flow node 8 is different from the current version number of the flow table block 1 where the flow node 8 is located, and then forward the forwarded message 2 to the basic forwarding.
611、 根据所述待转发报文 2对应的业务信息更新所述流节点 8的信息, 并将所述流节点 8的当前版本号 νθ设置为所述流节点 8所在流表块 1的当前 版本号 v2 , 调整结果参照图 6E。  611. Update the information of the flow node 8 according to the service information corresponding to the to-be-forwarded message 2, and set the current version number νθ of the flow node 8 to the current version of the flow table block 1 where the flow node 8 is located. No. v2, the adjustment result is shown in Fig. 6E.
本发明实施例提供了一种流表刷新的方法, 通过将整个流表分为若干个 流表块, 每个流表块包括若干个流节点, 为每个流表块设置对应的版本号, 并为流表块中的流节点设置对应的版本号, 使得在流表刷新的过程中, 不需 要先删除原有流节点, 再重新学习生成新的流节点, 而是保留原有流节点并 只更新其存储的内容, 这样就不需要反复要求处理器释放和重新分配***资 源, 从而减少了***资源浪费, 极大地提高了处理器对于转发报文的处理效 率。  An embodiment of the present invention provides a method for refreshing a flow table. The flow table is divided into a plurality of flow table blocks, and each flow table block includes a plurality of flow nodes, and a corresponding version number is set for each flow table block. And setting a corresponding version number for the flow node in the flow table block, so that in the process of refreshing the flow table, the original flow node does not need to be deleted first, and then the new flow node is re-learned, but the original flow node is retained. Only the contents of the storage are updated, so that the processor is not required to repeatedly release and reallocate system resources, thereby reducing system resource waste and greatly improving the processing efficiency of the processor for forwarding messages.
本发明实施例提供了一种流表刷新的装置, 用于实现本发明图 1-图 6所 示的流表刷新的方法。 如图 7所示, 所述装置包括: 第一获取单元 71、 查找 单元 72、 第二获取单元 73、 更新单元 74。  An embodiment of the present invention provides a device for refreshing a flow table, which is used to implement the method for refreshing the flow table shown in Figures 1 to 6 of the present invention. As shown in FIG. 7, the apparatus includes: a first obtaining unit 71, a searching unit 72, a second obtaining unit 73, and an updating unit 74.
第一获取单元 71 , 用于获取待转发报文的五元组信息。 其中, 所述待转发报文的五元组信息包括该待转发报文的源 IP地址、 目 的 IP地址、 源端口号、 目的端口号、 协议号。 The first obtaining unit 71 is configured to obtain quintuple information of the to-be-forwarded message. The quintuple information of the to-be-forwarded packet includes a source IP address, a destination IP address, a source port number, a destination port number, and a protocol number of the to-be-forwarded packet.
查找单元 72 ,用于根据所述第一获取单元 71获取到的待转发报文的五元 组信息, 查找流表。  The searching unit 72 is configured to search the flow table according to the quintuple information of the to-be-forwarded message acquired by the first acquiring unit 71.
其中, 所述流表中存储有流节点, 每个流节点都有唯一的五元组信息; 根据所述待转发报文的五元组信息查找流表, 就可以判断所述流表中是否有 对应所述待转发报文的流节点。  A flow node is stored in the flow table, and each flow node has unique quintuple information. According to the quintuple information of the to-be-forwarded packet, the flow table is searched, and whether the flow table is There is a flow node corresponding to the to-be-forwarded packet.
第二获取单元 73 ,用于在确定所述查找单元 72确定所述流表中存在一个 已有流节点的五元组信息与所述待转发报文的五元组信息相同时, 获取所述 已有流节点的当前版本号以及所述已有流节点所在流表块的当前版本号, 将 所述已有流节点的当前版本号以及所述已有流节点所在流表块的当前版本号 传输至更新单元。  The second obtaining unit 73 is configured to: when determining that the searching unit 72 determines that the quintuple information of the existing flow node in the flow table is the same as the quintuple information of the to-be-forwarded message, The current version number of the existing flow node and the current version number of the flow table block where the existing flow node is located, and the current version number of the existing flow node and the current version number of the flow table block where the existing flow node is located Transfer to the update unit.
更新单元 74 ,用于在按照匹配规则确定所述第二获取单元 73获取到的已 有流节点的当前版本号与所述已有流节点所在流表块的当前版本号不一致 时, 根据所述待转发报文的业务信息更新所述已有流节点信息, 并按照匹配 规则将所述已有流节点的当前版本号设置为与所述已有流节点所在流表块的 当前版本号一致。  The updating unit 74 is configured to determine, according to the matching rule, that the current version number of the existing stream node acquired by the second acquiring unit 73 is different from the current version number of the stream table block where the existing stream node is located, according to the The service information of the to-be-forwarded packet is updated with the existing flow node information, and the current version number of the existing flow node is set to be consistent with the current version number of the flow table block where the existing flow node is located according to the matching rule.
其中, 所述流表根据预先的配置规则, 分为若干个流表块, 每个流表块 包括若干个流节点, 每个流表块均设置有一个可调整的版本号, 每个已有流 节点也均设置有一个可调整的版本号, 并且一个流表块内的各个流节点的版 本号需要在该流表块的版本号的基础上进行创建或调整。  The flow table is divided into a plurality of flow table blocks according to a preset configuration rule, each flow table block includes a plurality of flow nodes, and each flow table block is provided with an adjustable version number, and each of the existing flow table blocks has an adjustable version number. The flow nodes are also provided with an adjustable version number, and the version number of each flow node in a flow table block needs to be created or adjusted based on the version number of the flow table block.
可选的是, 如图 8所示, 该装置还包括: 创建单元 75、 第三获取单元 76、 存储单元 77、 第一确定单元 78、 第三获取单元 79。  Optionally, as shown in FIG. 8, the apparatus further includes: a creating unit 75, a third obtaining unit 76, a storage unit 77, a first determining unit 78, and a third obtaining unit 79.
创建单元 75 ,用于在确定所述第二获取单元 73获取到的所述流表中任意 一个流节点的五元组信息与所述待转发报文的五元组信息均不相同时, 为所 述五元组信息创建一个新的流节点, 并确定所述新的流节点所在的流表块。  a creating unit 75, configured to: when it is determined that the quintuple information of any one of the flow nodes obtained by the second obtaining unit 73 is different from the quintuple information of the to-be-forwarded packet, The quintuple information creates a new flow node and determines a flow table block in which the new flow node is located.
其中, 所述确定所述新的流节点所在的流表块的方法包括: 根据所述待 转发报文的五元组信息结合哈希 hash算法, 计算出流节点的索引号; 将该流 节点的索引号除以当前流表块数量得到的商值, 即为该流节点所在流表块的 索引号。 根据所述流表块的索引号, 即可确定该流节点所在流表块。 The method for determining the flow table block where the new flow node is located includes: according to the waiting The quintuple information of the forwarded message is combined with the hash hash algorithm to calculate the index number of the flow node. The quotient value obtained by dividing the index number of the flow node by the current flow table block number is the flow table block where the flow node is located. Index number. According to the index number of the flow table block, the flow table block where the flow node is located can be determined.
第三获取单元 76 , 用于获取所述待转发报文的业务信息以及所述新的流 节点所在的流表块的当前版本号。  The third obtaining unit 76 is configured to obtain the service information of the to-be-forwarded packet and the current version number of the flow table block where the new flow node is located.
存储单元 77 , 用于将所述待转发报文的业务信息和五元组信息存储在所 述创建单元 75创建的新的流节点中。  The storage unit 77 is configured to store the service information and the quintuple information of the to-be-forwarded message in a new flow node created by the creating unit 75.
第一确定单元 78 ,用于根据所述第三获取单元 76获取到的所述待转发报 文的业务信息, 确定对应的转发接口。  The first determining unit 78 is configured to determine, according to the service information of the to-be-forwarded packet that is obtained by the third acquiring unit 76, a corresponding forwarding interface.
第三获取单元 79 ,用于获取所述第一确定单元 78确定的所述转发接口的 映射表。  The third obtaining unit 79 is configured to acquire a mapping table of the forwarding interface determined by the first determining unit 78.
所述更新单元 74 ,用于更新所述第三获取单元 79获取到的转发接口的映 射表中所述新的流节点所在的流表块对应的标识; 按照所述匹配规则将所述 新的流节点的当前版本号设置为与所述新的流节点所在的流表块的当前版本 号一致。  The updating unit 74 is configured to update an identifier corresponding to the flow table block where the new flow node is located in the mapping table of the forwarding interface acquired by the third obtaining unit 79; and the new rule according to the matching rule The current version number of the flow node is set to be consistent with the current version number of the flow table block in which the new flow node is located.
其中, 所述更新单元 74更新所述第三获取单元 79获取到的转发接口的 映射表中所述新的流节点所在的流表块对应的标识可以遵循如下置位步骤, 包括在所述转发接口的映射表中, 与该转发接口有对应关系的流表块, 其对 应位置设置为 1 ; 而与该转发接口没有对应关系的流表块, 其对应位置设置为 0。 例如, 流表中共有 8个流表块, 第 1、 3、 4、 5个流表块与同一个转发接 口有对应关系, 则在该转发接口的映射表中应设置为 10111000。  The updating unit 74 updates the identifier corresponding to the flow table block where the new flow node is located in the mapping table of the forwarding interface acquired by the third obtaining unit 79, and may follow the following setting steps, including the forwarding In the mapping table of the interface, the flow table block corresponding to the forwarding interface has a corresponding position set to 1; and the flow table block not corresponding to the forwarding interface has a corresponding position set to 0. For example, if there are eight flow table blocks in the flow table, and the first, third, fourth, and fifth flow table blocks have a corresponding relationship with the same forwarding interface, the mapping table of the forwarding interface should be set to 10111000.
可选的是, 所述更新单元 74 , 还用于在按照所述匹配规则确定所述已有 流节点的当前版本号以及所述已有流节点所在流表块的当前版本号一致时, 保持所述已有流节点的信息不变。  Optionally, the updating unit 74 is further configured to: when determining, according to the matching rule, that a current version number of the existing flow node is consistent with a current version number of the flow table block where the existing flow node is located, The information of the existing stream node does not change.
可选的是, 如图 9所示, 该装置还包括: 第二确定单元 710、 第一调整单 元 711。  Optionally, as shown in FIG. 9, the apparatus further includes: a second determining unit 710, a first adjusting unit 711.
第二确定单元 710 , 用于在检测到至少一个转发接口的状态发生变化时, 确定待调整转发接口; 根据所述待调整转发接口与流表块之间的对应关系, 确定待调整流表块。 a second determining unit 710, configured to: when detecting that a state of the at least one forwarding interface changes, Determining the forwarding interface to be adjusted; determining the flow table block to be adjusted according to the correspondence between the forwarding interface to be adjusted and the flow table block.
第一调整单元 711 , 用于根据预设的调整规则, 调整所述第二确定 710单 元确定的所述待调整流表块的当前版本号。  The first adjusting unit 711 is configured to adjust a current version number of the to-be-adjusted flow table block determined by the second determining unit 710 according to a preset adjustment rule.
其中, 其中, 所述预设的调整规则可以根据具体实现方式预设设置, 例 如若版本号设置为整数, 则可以将所述当前版本号加 1或减 1。 若版本号设置 为浮点数, 则可以将所述当前版本号加 0. 1或减 0. 1。 当然, 此处的描述只是 本实施例中提供的一种实施方案, 本发明实施例对此并不限制。  The preset adjustment rule may be preset according to a specific implementation manner. For example, if the version number is set to an integer, the current version number may be incremented or decremented by one. If the version number is set to a floating point number, the current version number may be increased by 0.1 or minus 0.1. Of course, the description herein is only one embodiment provided in this embodiment, which is not limited by the embodiment of the present invention.
可选的是, 如图 10所示, 该装置还包括: 第三确定单元 712、 第二调整 单元 71 3。  Optionally, as shown in FIG. 10, the apparatus further includes: a third determining unit 712 and a second adjusting unit 71 3.
第三确定单元 712 ,用于在检测到至少一个业务处理操作的状态发生变化 时, 确定处理所述状态发生变化的至少一个业务处理操作的待调整转发接口; 根据所述待调整转发接口与流表块之间的对应关系, 确定待调整流表块。  The third determining unit 712 is configured to: when it is detected that the state of the at least one service processing operation changes, determine the to-be-adjusted forwarding interface that processes the at least one service processing operation in which the state changes; according to the to-be-adjusted forwarding interface and the flow The correspondence between the table blocks determines the flow table block to be adjusted.
第二调整单元 71 3 , 用于根据预设的调整规则, 调整所述第三确定单元 712确定的所述待调整流表块的当前版本号。  The second adjusting unit 71 3 is configured to adjust a current version number of the to-be-adjusted flow table block determined by the third determining unit 712 according to a preset adjustment rule.
其中, 所述预设的调整规则可以根据具体实现方式预设设置, 例如若版 本号设置为整数, 则可以将所述当前版本号加 1或减 1。 若版本号设置为浮点 数, 则可以将所述当前版本号加 0. 1或减 0. 1。 当然, 此处的描述只是本实施 例中提供的一种实施方案, 本发明实施例对此并不限制。  The preset adjustment rule may be preset according to a specific implementation manner. For example, if the version number is set to an integer, the current version number may be incremented or decremented by one. If the version number is set to a floating point number, the current version number may be increased by 0.1 or minus 0.1. Of course, the description herein is only one embodiment provided in this embodiment, which is not limited by the embodiment of the present invention.
可选的是, 如图 11所示, 该装置还包括: 初始化单元 714。  Optionally, as shown in FIG. 11, the apparatus further includes: an initializing unit 714.
初始化单元 714 , 用于初始化流表和转发接口的映射表。  The initializing unit 714 is configured to initialize a mapping table of the flow table and the forwarding interface.
可选的是,如图 12所示,所述初始化单元 714包括:第一获取子单元 7141、 第二获取子单元 7142、划分子单元 7143、设置子单元 7144、建立子单元 7145。  Optionally, as shown in FIG. 12, the initializing unit 714 includes: a first obtaining subunit 7141, a second obtaining subunit 7142, a dividing subunit 7143, a setting subunit 7144, and a establishing subunit 7145.
第一获取子单元 7141 , 用于获取当前所有业务和转发接口之间的对应关 系, 并存储所述当前所有业务和转发接口之间的对应关系。  The first obtaining sub-unit 7141 is configured to obtain a correspondence between all the current services and the forwarding interface, and store a correspondence between the current services and the forwarding interface.
第二获取子单元 7142 , 用于获取当前流表。  The second obtaining subunit 7142 is configured to acquire a current flow table.
划分子单元 7143 ,用于根据预先的配置规则,将所述第二获取子单元 7142 获取到的流表分为若干个流表块; 其中, 每个流表块包括若干个流节点。 设置子单元 7144 ,用于为所述划分子单元 7143得到的每个流表块设置版 本号, 并为每个流表块的版本号设置初始值。 a dividing subunit 7143, configured to, according to a preset configuration rule, the second obtaining subunit 7142 The obtained flow table is divided into several flow table blocks; wherein each flow table block includes several flow nodes. The setting subunit 7144 is configured to set a version number for each flow table block obtained by the dividing subunit 7143, and set an initial value for the version number of each flow table block.
建立子单元 7145 , 用于为每个转发接口分别建立一个映射表, 所述映射 表用于存储转发接口与流表块之间的对应关系。  The establishing subunit 7145 is configured to establish a mapping table for each forwarding interface, where the mapping table is used to store a correspondence between the forwarding interface and the flow table block.
本发明实施例提供了一种流表刷新的装置, 通过将整个流表中的流节点 按块进行划分, 并为每个流节点设置对应的版本号, 为每个流表块设置对应 的版本号, 使得在流表刷新的过程中, 不需要先删除原有流节点, 再重新学 习生成新的流节点, 而是保留原有流节点并只更新其存储的内容, 这样就不 需要反复要求处理器释放和重新分配***资源, 从而减少了***资源浪费, 极大地提高了处理器对于转发报文的处理效率。 本发明实施例提供了一种流表刷新的装置, 如图 1 3所示, 包括: 处理器 1 301和存储器 1 302 ,处理器 1301和存储器 1302可通过总线或其它方式连接, 所述存储器 1302内存储有程序代码, 所述程序代码包括计算机操作指令。 所 述处理器 1301执行所述程序代码, 用于:  An embodiment of the present invention provides a device for refreshing a flow table, by dividing a flow node in the entire flow table into blocks, and setting a corresponding version number for each flow node, and setting a corresponding version for each flow table block. No., in the process of refreshing the flow table, it is not necessary to delete the original stream node first, and then learn to generate a new stream node, but retain the original stream node and only update the stored content, so that there is no need to repeatedly request The processor releases and reallocates system resources, thereby reducing system resource waste and greatly improving the processing efficiency of the processor for forwarding messages. An embodiment of the present invention provides a device for refreshing a flow table. As shown in FIG. 13 , the device includes: a processor 1 301 and a memory 1 302. The processor 1301 and the memory 1302 can be connected by using a bus or other manner. The memory 1302 Program code is stored therein, and the program code includes computer operation instructions. The processor 1301 executes the program code for:
获取待转发报文的五元组信息; 根据所述待转发报文的五元组信息, 查 找流表; 若所述流表中存在一个已有流节点的五元组信息与所述待转发报文 的五元组信息相同, 则获取所述已有流节点的当前版本号以及所述已有流节 点所在流表块的当前版本号; 若按照匹配规则确定所述已有流节点的当前版 本号与所述已有流节点所在流表块的当前版本号不一致, 则根据所述待转发 报文的业务信息更新所述已有流节点信息, 并按照匹配规则将所述已有流节 点的当前版本号设置为与所述已有流节点所在流表块的当前版本号一致; 其中, 所述流表根据预先的配置规则, 分为若干个流表块, 每个流表块 包括若干个流节点, 每个流表块均设置有一个可调整的版本号, 每个已有流 节点也均设置有一个可调整的版本号, 并且一个流表块内的各个流节点的版 本号需要在该流表块的版本号的基础上进行创建或调整。 所述存储器 1 302 , 用于存储所述流表。 Obtaining the quintuple information of the to-be-forwarded packet; searching the flow table according to the quintuple information of the to-be-forwarded packet; if the quintuple information of the existing flow node exists in the flow table, and the to-be-forwarded If the quintuple information of the packet is the same, the current version number of the existing stream node and the current version number of the stream table block where the existing stream node is located are obtained; if the current rule of the existing stream node is determined according to the matching rule If the version number is inconsistent with the current version number of the flow table block where the existing flow node is located, the existing flow node information is updated according to the service information of the to-be-forwarded packet, and the existing flow node is matched according to the matching rule. The current version number is set to be consistent with the current version number of the flow table block where the existing flow node is located; wherein the flow table is divided into several flow table blocks according to a preset configuration rule, and each flow table block includes several Each flow table block is provided with an adjustable version number, and each existing flow node is also provided with an adjustable version number, and the version number of each flow node in a flow table block is required. Created or adjusted on the basis of the version number of the block on the flow table. The memory 1 302 is configured to store the flow table.
可选的是, 所述处理器 1 301还用于当所述流表中任意一个流节点的五元 组信息与所述待转发报文的五元组信息均不相同时, 为所述五元组信息创建 一个新的流节点, 并确定所述新的流节点所在的流表块; 获取所述待转发报 文的业务信息以及所述新的流节点所在的流表块的当前版本号; 将所述待转 发报文的业务信息和五元组信息存储在所述新的流节点中; 根据所述待转发 报文的业务信息, 确定对应的转发接口; 获取所述转发接口的映射表, 并更 新所述转发接口的映射表中所述新的流节点所在的流表块对应的标识; 按照 所述匹配规则将所述新的流节点的当前版本号设置为与所述新的流节点所在 的流表块的当前版本号一致。  Optionally, the processor 1301 is further configured to: when the quintuple information of any one of the flow nodes in the flow table is different from the quintuple information of the to-be-forwarded packet, The tuple information creates a new flow node, and determines a flow table block in which the new flow node is located. The service information of the to-be-forwarded packet and the current version number of the flow table block where the new flow node is located are obtained. The service information and the quintuple information of the to-be-forwarded packet are stored in the new flow node; the corresponding forwarding interface is determined according to the service information of the to-be-forwarded packet; and the mapping of the forwarding interface is obtained. a table, and updating an identifier corresponding to the flow table block where the new flow node is located in the mapping table of the forwarding interface; setting a current version number of the new flow node to the new one according to the matching rule The current version number of the flow table block where the flow node is located is the same.
所述存储器 1 302 , 还用于存储所述映射表。  The memory 1 302 is further configured to store the mapping table.
可选的是, 所述处理器 1 301还用于在按照所述匹配规则确定所述已有流 节点的当前版本号以及所述已有流节点所在流表块的当前版本号一致, 保持 所述已有流节点的信息不变。  Optionally, the processor 1301 is further configured to determine, according to the matching rule, that a current version number of the existing flow node and a current version number of the flow table block where the existing flow node is located are consistent, and maintain the The information of the existing stream node is unchanged.
所述处理器 1 301 ,还用于当检测到至少一个转发接口的状态发生变化时, 确定待调整转发接口; 根据所述待调整转发接口与流表块之间的对应关系, 确定待调整流表块; 根据预设的调整规则, 调整所述待调整流表块的当前版 本号。  The processor 1301 is further configured to: when it is detected that the state of the at least one forwarding interface changes, determine the forwarding interface to be adjusted; determine the to-be-adjusted flow according to the correspondence between the forwarding interface to be adjusted and the flow table block a table block; adjusts a current version number of the flow table block to be adjusted according to a preset adjustment rule.
可选的是, 所述处理器 1 301 , 还用于当检测到至少一个业务处理操作的 状态发生变化时, 确定处理所述状态发生变化的至少一个业务处理操作的待 调整转发接口; 根据所述待调整转发接口与流表块之间的对应关系, 确定待 调整流表块; 根据预设的调整规则, 调整所述待调整流表块的当前版本号。  Optionally, the processor 1301 is further configured to: when it is detected that the state of the at least one service processing operation changes, determine, to be adjusted, the forwarding interface to be adjusted to process the at least one service processing operation in which the state changes; Determining the correspondence between the forwarding interface and the flow table block, and determining the flow table block to be adjusted; adjusting the current version number of the flow table block to be adjusted according to a preset adjustment rule.
可选的是, 所述处理器 1 301还用于初始化流表和转发接口的映射表。 可选的是, 所述处理器 1 301执行所述程序代码实现所述初始化流表和转 发接口的映射表的具体方式为: 获取当前所有业务和转发接口之间的对应关 系, 并存储所述当前所有业务和转发接口之间的对应关系; 获取当前流表; 根据预先的配置规则, 将所述流表分为若干个流表块; 其中, 每个流表块包 括若干个流节点; 为每个流表块设置版本号, 并为每个流表块的版本号设置 初始值; 为每个转发接口分别建立一个映射表, 所述映射表用于存储转发接 口与流表块之间的对应关系。 Optionally, the processor 1301 is further configured to initialize a mapping table of the flow table and the forwarding interface. Optionally, the specific manner of the processor 1 301 executing the program code to implement the mapping table of the initialization flow table and the forwarding interface is: acquiring a correspondence between all current services and a forwarding interface, and storing the Corresponding relationship between all the current services and the forwarding interface; obtaining the current flow table; dividing the flow table into a plurality of flow table blocks according to a preset configuration rule; wherein each flow table block package Include a number of flow nodes; set a version number for each flow table block, and set an initial value for each flow table block version number; respectively, establish a mapping table for each forwarding interface, the mapping table is used for storing and forwarding interfaces Correspondence with the flow table block.
本发明实施例提供了一种流表刷新的装置, 通过处理器执行存储器中的 操作指令, 将整个流表中的流节点按块进行划分, 并为每个流节点设置对应 的版本号, 为每个流表块设置对应的版本号, 使得在流表刷新的过程中, 不 需要先删除原有流节点, 再重新学习生成新的流节点, 而是保留原有流节点 并只更新其存储的内容, 这样就不需要反复要求处理器释放和重新分配*** 资源, 从而减少了***资源浪费, 极大地提高了处理器对于转发报文的处理 效率。  An embodiment of the present invention provides a device for refreshing a flow table. The processor executes the operation instruction in the memory, divides the flow nodes in the entire flow table into blocks, and sets a corresponding version number for each flow node. Each flow table block sets a corresponding version number, so that in the process of refreshing the flow table, it is not necessary to delete the original stream node first, and then re-learn to generate a new stream node, but retain the original stream node and only update its storage. The content does not need to repeatedly request the processor to release and reallocate system resources, thereby reducing the waste of system resources and greatly improving the processing efficiency of the processor for forwarding messages.
通过以上的实施方式的描述, 所属领域的技术人员可以清楚地了解到本 发明可借助软件加必需的通用硬件的方式来实现, 当然也可以通过硬件, 但 很多情况下前者是更佳的实施方式。 基于这样的理解, 本发明的技术方案本 质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来, 该 计算机软件产品存储在可读取的存储介质中, 如计算机的软盘, 硬盘或光盘 等, 包括若干指令用以使得一台计算机设备(可以是个人计算机, 服务器, 或者网络设备等)执行本发明各个实施例所述的方法。  Through the description of the above embodiments, those skilled in the art can clearly understand that the present invention can be implemented by means of software plus necessary general hardware, and of course, by hardware, but in many cases, the former is a better implementation. . Based on such understanding, the technical solution of the present invention, which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a readable storage medium, such as a floppy disk of a computer. A hard disk or optical disk or the like includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the methods described in various embodiments of the present invention.
以上所述, 仅为本发明的具体实施方式, 但本发明的保护范围并不局限 于此, 任何熟悉本技术领域的技术人员在本发明揭露的技术范围内, 可轻易 想到变化或替换, 都应涵盖在本发明的保护范围之内。 因此, 本发明的保护 范围应以所述权利要求的保护范围为准。  The above is only the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily think of changes or substitutions within the technical scope of the present invention. It should be covered by the scope of the present invention. Therefore, the scope of the invention should be determined by the scope of the appended claims.

Claims

权利要求 书 claims
1、 一种流表刷新的方法, 其特征在于, 包括: 1. A method for refreshing flow tables, which is characterized by including:
获取待转发报文的五元组信息; Obtain the five-tuple information of the message to be forwarded;
根据所述待转发报文的五元组信息, 查找流表; Search the flow table according to the five-tuple information of the message to be forwarded;
若所述流表中存在一个已有流节点的五元组信息与所述待转发报文的五元 组信息相同, 则获取所述已有流节点的当前版本号以及所述已有流节点所在流 表块的当前版本号; If there is an existing flow node in the flow table whose five-tuple information is the same as the five-tuple information of the message to be forwarded, obtain the current version number of the existing flow node and the existing flow node The current version number of the flow table block;
若按照匹配规则确定所述已有流节点的当前版本号与所述已有流节点所在 流表块的当前版本号不一致, 则根据所述待转发报文的业务信息更新所述已有 流节点信息, 并按照所述匹配规则将所述已有流节点的当前版本号设置为与所 述已有流节点所在流表块的当前版本号一致; If it is determined according to the matching rules that the current version number of the existing flow node is inconsistent with the current version number of the flow table block where the existing flow node is located, then the existing flow node is updated according to the service information of the message to be forwarded. information, and set the current version number of the existing flow node to be consistent with the current version number of the flow table block where the existing flow node is located according to the matching rule;
其中, 所述流表根据预先的配置规则, 分为若干个流表块, 每个流表块包 括若干个流节点, 每个流表块均设置有对应的一个可调整的版本号, 每个已有 流节点也均设置有对应的一个可调整的版本号。 Among them, the flow table is divided into several flow table blocks according to pre-configured rules. Each flow table block includes several flow nodes. Each flow table block is set with a corresponding adjustable version number. Each flow table block is provided with a corresponding adjustable version number. Existing flow nodes are also set with a corresponding adjustable version number.
2、 根据权利要求 1所述的方法, 其特征在于, 还包括: 2. The method according to claim 1, further comprising:
若所述流表中任意一个流节点的五元组信息与所述待转发报文的五元组信 息均不相同, 则为所述五元组信息创建一个新的流节点, 并确定所述新的流节 点所在的流表块; If the five-tuple information of any flow node in the flow table is different from the five-tuple information of the message to be forwarded, create a new flow node for the five-tuple information, and determine the The flow table block where the new flow node is located;
获取所述待转发报文的业务信息以及所述新的流节点所在的流表块的当前 版本号; Obtain the service information of the message to be forwarded and the current version number of the flow table block where the new flow node is located;
将所述待转发报文的业务信息和五元组信息存储在所述新的流节点中; 根据所述待转发报文的业务信息, 确定对应的转发接口; Store the service information and quintuple information of the message to be forwarded in the new flow node; determine the corresponding forwarding interface according to the service information of the message to be forwarded;
获取所述转发接口的映射表, 并更新所述转发接口的映射表中所述新的流 节点所在的流表块对应的标识; Obtain the mapping table of the forwarding interface, and update the identification corresponding to the flow table block where the new flow node is located in the mapping table of the forwarding interface;
按照所述匹配规则将所述新的流节点的当前版本号设置为与所述新的流节 点所在的流表块的当前版本号一致。 According to the matching rule, the current version number of the new flow node is set to be consistent with the current version number of the flow table block where the new flow node is located.
3、 根据权利要求 1或 2所述的方法, 其特征在于, 还包括: 若按照所述匹配规则确定所述已有流节点的当前版本号以及所述已有流节 点所在流表块的当前版本号一致, 保持所述已有流节点的信息不变。 3. The method according to claim 1 or 2, further comprising: If it is determined according to the matching rules that the current version number of the existing flow node and the current version number of the flow table block where the existing flow node is located are consistent, the information of the existing flow node is kept unchanged.
4、 根据权利要求 1- 3任意一项所述的方法, 其特征在于, 还包括: 当检测到至少一个转发接口的状态发生变化时, 确定待调整转发接口; 根 据所述待调整转发接口与流表块之间的对应关系, 确定待调整流表块; 4. The method according to any one of claims 1 to 3, further comprising: when a change in the status of at least one forwarding interface is detected, determining the forwarding interface to be adjusted; Correspondence between flow table blocks, determine flow table blocks to be adjusted;
根据预设的调整规则, 调整所述待调整流表块的当前版本号。 According to the preset adjustment rules, the current version number of the flow table block to be adjusted is adjusted.
5、 根据权利要求 1-4任意一项所述的方法, 其特征在于, 还包括: 当检测到至少一个业务处理操作的状态发生变化时, 确定处理所述状态发 生变化的至少一个业务处理操作的待调整转发接口; 5. The method according to any one of claims 1 to 4, further comprising: when a change in the status of at least one business processing operation is detected, determining to process at least one business processing operation in which the status has changed. The forwarding interface to be adjusted;
根据所述待调整转发接口与流表块之间的对应关系, 确定待调整流表块; 根据预设的调整规则, 调整所述待调整流表块的当前版本号。 Determine the flow table block to be adjusted according to the corresponding relationship between the forwarding interface to be adjusted and the flow table block; adjust the current version number of the flow table block to be adjusted according to the preset adjustment rules.
6、 根据权利要求 1-5任意一项所述的方法, 其特征在于, 在所述获取待转 发才艮文的五元组信息之前, 还包括: 6. The method according to any one of claims 1 to 5, characterized in that, before obtaining the five-tuple information of the text to be forwarded, it further includes:
初始化流表和转发接口的映射表。 Initialize the flow table and forwarding interface mapping table.
7、 根据权利要求 6所述的方法, 其特征在于, 所述初始化流表和转发接口 的映射表包括: 7. The method according to claim 6, characterized in that the mapping table between the initialization flow table and the forwarding interface includes:
获取当前所有业务和转发接口之间的对应关系, 并存储所述当前所有业务 和转发接口之间的对应关系; Obtain the corresponding relationship between all current services and the forwarding interface, and store the corresponding relationship between all current services and the forwarding interface;
获取当前流表; Get the current flow table;
根据所述预先的配置规则, 将所述流表分为若干个流表块; 其中, 每个流 表块包括若干个流节点; According to the pre-configured rules, the flow table is divided into several flow table blocks; wherein each flow table block includes several flow nodes;
为每个流表块设置版本号, 并将每个流表块的版本号设置为初始值; 为每个转发接口分别建立一个映射表, 所述映射表用于存储转发接口与流 表块之间的对应关系。 Set a version number for each flow table block, and set the version number of each flow table block to an initial value; Establish a mapping table for each forwarding interface, and the mapping table is used to store the relationship between the forwarding interface and the flow table block. correspondence between.
8、 一种流表刷新的装置, 其特征在于, 包括: 8. A device for refreshing flow tables, characterized by including:
第一获取单元, 用于获取待转发报文的五元组信息; The first acquisition unit is used to acquire the five-tuple information of the message to be forwarded;
查找单元, 用于根据所述第一获取单元获取到的待转发报文的五元组信息, 查找流表; A search unit, configured to obtain the five-tuple information of the message to be forwarded according to the first acquisition unit, Find flow table;
第二获取单元, 用于在确定所述查找单元确定所述流表中存在一个已有流 节点的五元组信息与所述待转发报文的五元组信息相同时, 获取所述已有流节 点的当前版本号以及所述已有流节点所在流表块的当前版本号, 将所述已有流 节点的当前版本号以及所述已有流节点所在流表块的当前版本号传输至更新单 元; The second acquisition unit is configured to acquire the existing five-tuple information of an existing flow node in the flow table when the search unit determines that the five-tuple information of the packet to be forwarded is the same as the five-tuple information of the packet to be forwarded. The current version number of the flow node and the current version number of the flow table block where the existing flow node is located, transmit the current version number of the existing flow node and the current version number of the flow table block where the existing flow node is located to update unit;
更新单元, 用于在按照匹配规则确定所述第二获取单元获取到的已有流节 点的当前版本号与所述已有流节点所在流表块的当前版本号不一致时, 根据所 述待转发报文的业务信息更新所述已有流节点信息, 并按照所述匹配规则将所 述已有流节点的当前版本号设置为与所述已有流节点所在流表块的当前版本号 一致; The update unit is configured to, when it is determined according to the matching rules that the current version number of the existing flow node obtained by the second acquisition unit is inconsistent with the current version number of the flow table block where the existing flow node is located, according to the to-be-forwarded The service information of the message updates the existing flow node information, and sets the current version number of the existing flow node to be consistent with the current version number of the flow table block where the existing flow node is located according to the matching rule;
其中, 所述流表根据预先的配置规则, 分为若干个流表块, 每个流表块包 括若干个流节点, 每个流表块均设置有对应的一个可调整的版本号, 每个已有 流节点也均设置有对应的一个可调整的版本号。 Among them, the flow table is divided into several flow table blocks according to pre-configured rules. Each flow table block includes several flow nodes. Each flow table block is set with a corresponding adjustable version number. Each flow table block is provided with a corresponding adjustable version number. Existing flow nodes are also set with a corresponding adjustable version number.
9、 根据权利要求 8所述的装置, 其特征在于, 该装置还包括: 9. The device according to claim 8, characterized in that, the device further includes:
创建单元, 用于在确定所述第二获取单元获取到的所述流表中任意一个流 节点的五元组信息与所述待转发报文的五元组信息均不相同时, 为所述五元组 信息创建一个新的流节点, 并确定所述新的流节点所在的流表块; The creation unit is configured to: when it is determined that the five-tuple information of any flow node in the flow table obtained by the second acquisition unit is different from the five-tuple information of the message to be forwarded, The five-tuple information creates a new flow node and determines the flow table block where the new flow node is located;
第三获取单元, 用于获取所述待转发报文的业务信息以及所述新的流节点 所在的流表块的当前版本号; The third acquisition unit is used to acquire the service information of the message to be forwarded and the current version number of the flow table block where the new flow node is located;
存储单元, 用于将所述待转发报文的业务信息和五元组信息存储在所述创 建单元创建的新的流节点中; A storage unit, configured to store the service information and quintuple information of the message to be forwarded in the new flow node created by the creation unit;
第一确定单元, 用于根据所述第三获取单元获取到的所述待转发报文的业 务信息, 确定对应的转发接口; The first determining unit is configured to determine the corresponding forwarding interface based on the business information of the message to be forwarded obtained by the third obtaining unit;
第三获取单元, 用于获取所述第一确定单元确定的所述转发接口的映射表; 所述更新单元, 用于更新所述第三获取单元获取到的转发接口的映射表中 所述新的流节点所在的流表块对应的标识; 按照所述匹配规则将所述新的流节 点的当前版本号设置为与所述新的流节点所在的流表块的当前版本号一致。 The third obtaining unit is used to obtain the mapping table of the forwarding interface determined by the first determining unit; the updating unit is used to update the new mapping table of the forwarding interface obtained by the third obtaining unit. The identifier corresponding to the flow table block where the flow node is located; The new flow section is added according to the matching rules. The current version number of the node is set to be consistent with the current version number of the flow table block where the new flow node is located.
10、 根据权利要求 8或 9所述的装置, 其特征在于, 所述更新单元还用于 在按照所述匹配规则确定所述已有流节点的当前版本号以及所述已有流节点所 在流表块的当前版本号一致时, 保持所述已有流节点的信息不变。 10. The device according to claim 8 or 9, characterized in that, the update unit is further configured to determine the current version number of the existing flow node and the flow where the existing flow node is located according to the matching rule. When the current version numbers of the table blocks are consistent, the information of the existing flow nodes is kept unchanged.
11、根据权利要求 8-10任意一项所述的装置, 其特征在于, 该装置还包括: 第二确定单元, 用于在检测到至少一个转发接口的状态发生变化时, 确定 待调整转发接口; 根据所述待调整转发接口与流表块之间的对应关系, 确定待 调整流表块; 11. The device according to any one of claims 8-10, characterized in that, the device further includes: a second determination unit, configured to determine the forwarding interface to be adjusted when a change in the status of at least one forwarding interface is detected. ; Determine the flow table block to be adjusted based on the correspondence between the forwarding interface to be adjusted and the flow table block;
第一调整单元, 用于根据预设的调整规则, 调整所述第二确定单元确定的 所述待调整流表块的当前版本号。 The first adjustment unit is configured to adjust the current version number of the flow table block to be adjusted determined by the second determination unit according to the preset adjustment rules.
12、根据权利要求 8-11任意一项所述的装置, 其特征在于, 该装置还包括: 第三确定单元, 用于在检测到至少一个业务处理操作的状态发生变化时, 确定处理所述状态发生变化的至少一个业务处理操作的待调整转发接口; 根据 所述待调整转发接口与流表块之间的对应关系, 确定待调整流表块; 12. The device according to any one of claims 8-11, characterized in that the device further includes: a third determining unit, configured to determine whether to process the state of at least one business processing operation when a change in state is detected. The forwarding interface to be adjusted for at least one business processing operation whose status has changed; determining the flow table block to be adjusted based on the correspondence between the forwarding interface to be adjusted and the flow table block;
第二调整单元, 用于根据预设的调整规则, 调整所述第三确定单元确定的 所述待调整流表块的当前版本号。 The second adjustment unit is configured to adjust the current version number of the flow table block to be adjusted determined by the third determination unit according to the preset adjustment rules.
1 3、根据权利要求 8-12任意一项所述的装置, 其特征在于, 该装置还包括: 初始化单元, 用于初始化流表和转发接口的映射表。 13. The device according to any one of claims 8-12, characterized in that the device further includes: an initialization unit, used to initialize the mapping table between the flow table and the forwarding interface.
14、 根据权利要求 1 3所述的装置, 其特征在于, 所述初始化单元包括: 第一获取子单元, 用于获取当前所有业务和转发接口之间的对应关系, 并 存储所述当前所有业务和转发接口之间的对应关系; 14. The device according to claim 13, characterized in that the initialization unit includes: a first acquisition subunit, used to obtain the correspondence between all current services and the forwarding interface, and store the current all services and the corresponding relationship between the forwarding interface;
第二获取子单元, 用于获取当前流表; The second acquisition subunit is used to obtain the current flow table;
划分子单元, 用于根据所述预先的配置规则, 将所述第二获取子单元获取 到的流表分为若干个流表块; 其中, 每个流表块包括若干个流节点; Divide sub-units, used to divide the flow table obtained by the second acquisition sub-unit into several flow table blocks according to the pre-configured rules; wherein, each flow table block includes several flow nodes;
设置子单元, 用于为所述划分子单元得到的每个流表块设置版本号, 将每 个流表块的版本号设置为初始值; Set a subunit, used to set a version number for each flow table block obtained by dividing the subunit, and set the version number of each flow table block to an initial value;
建立子单元, 用于为每个转发接口分别建立一个映射表, 所述映射表用于 存储转发接口与流表块之间的对应关系。 Establish a subunit for establishing a mapping table for each forwarding interface, and the mapping table is used to Correspondence between store-and-forward interfaces and flow table blocks.
PCT/CN2012/083700 2012-10-29 2012-10-29 Method and device for refreshing flow table WO2014067055A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2012/083700 WO2014067055A1 (en) 2012-10-29 2012-10-29 Method and device for refreshing flow table
CN201280021542.6A CN103907318B (en) 2012-10-29 2012-10-29 Method and device for refreshing flow table

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2012/083700 WO2014067055A1 (en) 2012-10-29 2012-10-29 Method and device for refreshing flow table

Publications (1)

Publication Number Publication Date
WO2014067055A1 true WO2014067055A1 (en) 2014-05-08

Family

ID=50626294

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/083700 WO2014067055A1 (en) 2012-10-29 2012-10-29 Method and device for refreshing flow table

Country Status (2)

Country Link
CN (1) CN103907318B (en)
WO (1) WO2014067055A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105490827A (en) * 2014-09-17 2016-04-13 华为技术有限公司 Method and device for obtaining network state
CN114629842A (en) * 2022-03-30 2022-06-14 阿里巴巴(中国)有限公司 Flow table processing method, electronic device, readable storage medium and product

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115129685A (en) * 2021-03-24 2022-09-30 阿里巴巴新加坡控股有限公司 Data processing method and device, electronic equipment and computer readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101043434A (en) * 2006-06-30 2007-09-26 华为技术有限公司 Method for refreshing conversational list
US20070280227A1 (en) * 2006-05-30 2007-12-06 Nec Corporation Packet distribution system using reproducing appartus and packet distribution method
CN101247337A (en) * 2008-02-18 2008-08-20 华为技术有限公司 Packet forwarding method and equipment
CN102215156A (en) * 2010-04-02 2011-10-12 华为技术有限公司 Method, device and system for realizing flow forwarding

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070280227A1 (en) * 2006-05-30 2007-12-06 Nec Corporation Packet distribution system using reproducing appartus and packet distribution method
CN101043434A (en) * 2006-06-30 2007-09-26 华为技术有限公司 Method for refreshing conversational list
CN101247337A (en) * 2008-02-18 2008-08-20 华为技术有限公司 Packet forwarding method and equipment
CN102215156A (en) * 2010-04-02 2011-10-12 华为技术有限公司 Method, device and system for realizing flow forwarding

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105490827A (en) * 2014-09-17 2016-04-13 华为技术有限公司 Method and device for obtaining network state
CN114629842A (en) * 2022-03-30 2022-06-14 阿里巴巴(中国)有限公司 Flow table processing method, electronic device, readable storage medium and product

Also Published As

Publication number Publication date
CN103907318B (en) 2017-04-12
CN103907318A (en) 2014-07-02

Similar Documents

Publication Publication Date Title
US9071529B2 (en) Method and apparatus for accelerating forwarding in software-defined networks
US9571382B2 (en) Method, controller, and system for processing data packet
US10237130B2 (en) Method for processing VxLAN data units
US8634415B2 (en) Method and system for routing network traffic for a blade server
US10608899B2 (en) Service directory for quick and simplified application identification
US9887881B2 (en) DNS-assisted application identification
US10193707B2 (en) Packet transmission method and apparatus
JP7034187B2 (en) Data processing methods, network interface cards, and servers
US20220209993A1 (en) CLOUD SCALE MULTI-TENANCY FOR RDMA OVER CONVERGED ETHERNET (RoCE)
EP2773073B1 (en) Entry generation method, message receiving method, and corresponding device and system
WO2015131486A1 (en) Multicast packet forwarding method and device
WO2017107814A1 (en) Method, apparatus and system for propagating qos policies
WO2015043327A1 (en) Routing method, device and system
TWI661698B (en) Method and device for forwarding Ethernet packet
WO2017113300A1 (en) Route determining method, network configuration method and related device
JP2020520612A (en) Packet transmission method, edge device, and machine-readable storage medium
WO2017186159A1 (en) Packet transmission
US10819640B1 (en) Congestion avoidance in multipath routed flows using virtual output queue statistics
WO2016107379A1 (en) Packet sending method and apparatus
WO2021233327A1 (en) Message processing method and apparatus, announcement method and apparatus, network bridge node, source device, storage medium, and message processing system
WO2018024187A1 (en) Message monitoring
WO2016029345A1 (en) Network flow information statistics method and apparatus
WO2015081551A1 (en) Method, device and system for implementing packet routing in network
WO2014198064A1 (en) Method for processing message and forwarder
WO2021104284A1 (en) Method for establishing table entry regarding data transmission, and related device

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: 12887381

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12887381

Country of ref document: EP

Kind code of ref document: A1