WO2016070332A1 - 流表项处理方法和装置 - Google Patents

流表项处理方法和装置 Download PDF

Info

Publication number
WO2016070332A1
WO2016070332A1 PCT/CN2014/090273 CN2014090273W WO2016070332A1 WO 2016070332 A1 WO2016070332 A1 WO 2016070332A1 CN 2014090273 W CN2014090273 W CN 2014090273W WO 2016070332 A1 WO2016070332 A1 WO 2016070332A1
Authority
WO
WIPO (PCT)
Prior art keywords
flow entry
matching
unit
flow
format
Prior art date
Application number
PCT/CN2014/090273
Other languages
English (en)
French (fr)
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/CN2014/090273 priority Critical patent/WO2016070332A1/zh
Priority to CN201480040608.5A priority patent/CN105765922B/zh
Publication of WO2016070332A1 publication Critical patent/WO2016070332A1/zh

Links

Images

Definitions

  • the embodiments of the present invention relate to the field of communications technologies, and in particular, to a method and an apparatus for processing a flow entry.
  • OpenFlow OpenFlow technology separates the two functions of data forwarding and routing control of network transmission devices (such as switches and routers), and manages OpenFlow switches (Central) through a centralized controller (Controller). And configuration.
  • a transmission device usually adopts a three-unit data processing architecture, which is a software unit, an adaptation unit, and a hardware unit.
  • the controller configures routing for the transport stream and delivers the routing information to the software unit of the transport device.
  • the routing information of the data stream is recorded in the data flow table (FlowTable) of the software unit, and the data flow flow table is composed of the flow table entries of the hierarchical structure, and each flow entry corresponds to one routing forwarding rule.
  • FlowTable data flow table
  • the flow entry includes Match Fields and Actions.
  • the Match field is used to record the identifier of the flow entry.
  • the command is used to record the operations that the data flow that matches the identifier of the flow entry should perform.
  • the transport data stream arrives at the OpenFlow switch, and the OpenFlow switch first searches the hardware unit for the flow entry that matches the data flow, and when not found, reports the data flow to the software unit.
  • the software unit searches for a flow entry that matches the data flow, and maps the found flow entry to the hardware unit through the adaptation unit to implement forwarding of the data flow in the hardware unit.
  • the embodiment of the present invention provides a method and a device for processing a flow entry, which are used to solve the problem that the flow entry of the software unit in the OpenFlow switch is inconsistent with the flow entry of the hardware unit.
  • the embodiment of the present invention provides a method for processing a flow entry, which is applied to an OpenFlow OpenFlow switch, where the OpenFlow switch includes a hardware unit, where the hardware unit is configured to store data directly forwarded by a hardware interface of the OpenFlow switch.
  • Flow flow entry the method includes:
  • the new flow entry is added to the hardware unit of the OpenFlow switch.
  • the OpenFlow switch further includes: a software unit configured to convert routing information into a flow entry, and store the flow entry; and Converting, by the software unit, a format of the flow table entry into an adaptation unit of the hardware unit identification format;
  • the converting the routing information into a new flow entry includes: converting, by the software unit, the routing information into a new flow entry in a first format
  • the adding the new flow entry to the hardware unit of the OpenFlow switch includes:
  • the adapting unit converts the new flow entry of the first format into a new flow entry of the second format identifiable by the hardware unit;
  • the method further includes:
  • the adapting unit converts the matching flow entry of the first format into a matching flow entry of the second format
  • the matching flow entry of the second format is deleted in the hardware unit.
  • the new flow entry has a higher priority The priority of the matching flow entry.
  • the matching domain includes at least one of a packet type, an ingress port number, a source hardware access control MAC address, a destination MAC address, a source Internet Protocol IP address, a destination IP address, and a virtual local area network VLAN information.
  • the embodiment of the present invention provides a flow entry processing device, which is applied to an OpenFlow OpenFlow switch, where the OpenFlow switch includes a hardware unit, where the hardware unit is configured to store data directly forwarded by a hardware interface of the OpenFlow switch.
  • Flow flow entry the device includes:
  • a receiving module configured to receive routing information sent by the controller
  • a conversion module configured to convert the routing information into a new flow entry
  • a matching module configured to match a matching domain of the newly created flow entry with a matching domain of the stored data flow, and determine a matching domain of the data flow forwarded by using the newly created flow entry; wherein the stored data flow
  • the matching field is a matching field of the data stream forwarded by the flow entry stored by the hardware unit;
  • the adding module is configured to add the new flow entry to the hardware unit of the OpenFlow switch when determining a matching domain of the data flow that is forwarded by using the new flow entry.
  • the OpenFlow switch further includes: a software unit configured to convert routing information into a flow entry, and store the flow entry; and Converting, by the software unit, a format of the flow table entry into an adaptation unit of the hardware unit identification format;
  • the software unit is specifically configured to convert the routing information into a new flow entry in a first format.
  • the adapting unit is specifically configured to convert the new flow entry of the first format into a new flow entry of the second format identifiable by the hardware unit;
  • the adding module is specifically configured to add a new flow entry of the second format to the hardware unit of the OpenFlow switch.
  • the matching module is further configured to match, by using a matching field of the determined data stream, the software unit The matching field of the flow entry obtains the matching flow entry in the first format.
  • the adapting unit specifically converts the matching flow entry of the first format into a matching flow entry of the second format
  • the device further includes a deletion module, where the deletion module is configured to delete the matching flow entry of the second format in the hardware unit.
  • the new flow entry has a higher priority The priority of the matching flow entry.
  • the matching domain includes: a packet type, an ingress port number, and source hardware access. Control at least one of a MAC address, a destination MAC address, a source Internet Protocol IP address, a destination IP address, and a virtual local area network VLAN information.
  • the OpenFlow switch after receiving the routing information sent by the controller, converts the routing information into a new flow entry, and matches the matching domain of the stored data flow with the new flow entry.
  • the matching domain determines the matching domain of the data stream that is forwarded by using the new flow entry.
  • the matching domain of the stored data flow is the matching domain of the data flow forwarded by the flow entry stored by the hardware unit. Therefore, the new domain is determined to be used.
  • the flow entry of the flow unit and the hardware unit of the software unit in the OpenFlow switch are consistently added to the hardware unit of the OpenFlow switch. .
  • Embodiment 1 is a flowchart of Embodiment 1 of a method for processing a flow entry according to the present invention
  • FIG. 2 is a schematic diagram of an embodiment of a flow entry processing system according to the present invention.
  • Embodiment 3 is a flowchart of Embodiment 2 of a method for processing a flow entry according to the present invention
  • Embodiment 4 is a flowchart of Embodiment 1 of generating description information of a data stream in a unit according to the present invention
  • FIG. 5 is a flowchart of Embodiment 3 of a method for processing a flow entry according to the present invention.
  • Embodiment 4 is a flowchart of Embodiment 4 of a method for processing a flow entry according to the present invention
  • Embodiment 7 is a flowchart of Embodiment 2 of generating description information of a data stream in a description unit of the present invention
  • FIG. 8 is a schematic structural diagram of an embodiment of a flow entry processing apparatus according to the present invention.
  • FIG. 9 is a schematic structural diagram of an embodiment of a flow entry processing device according to an embodiment of the present invention.
  • the flow entry processing method of the embodiment of the present invention can be applied to an OpenFlow OpenFlow switch, where the OpenFlow switch includes a hardware unit, and the hardware unit is configured to store a flow entry of the data flow directly forwarded by the hardware interface of the OpenFlow switch.
  • FIG. 1 is a flowchart of Embodiment 1 of a method for processing a flow entry according to the present invention. As shown in FIG. 1 , the method in this embodiment may include the following content.
  • the OpenFlow switch receives routing information sent by the controller.
  • the routing configuration of the transport stream is performed by the controller, and the controller can configure routing or update routing for the transport stream according to the network topology, and send the routing information to the switch, so that the switch performs data transmission.
  • the routing information of the data stream is stored in the data flow table of the software unit in the form of a flow entry, and each flow entry corresponds to a route forwarding rule.
  • the description information of the data stream matching the flow entry in the hardware unit may be added by adding a description unit for storing the description information of the data flow (for example, the matching field of the data flow) in the OpenFlow switch. It is stored in the description unit to make the flow entry of the software unit and the flow entry of the hardware unit consistent by the bridge function of the description unit.
  • the OpenFlow switch first searches for a flow entry that matches the data flow in the hardware unit. Therefore, when it is determined that a flow entry related to the newly created flow entry exists in the hardware unit, the new flow table is created. Items are added to the hardware unit to ensure that the data stream is transmitted according to the latest routing information. Preferably, the priority of the newly created flow entry is higher than the priority of the matching flow entry.
  • the OpenFlow switch After receiving the routing information sent by the controller, the OpenFlow switch converts the routing information into a new flow entry, and determines that the matching domain of the stored data flow matches the matching domain of the newly created flow entry.
  • the matching field of the data stream that is forwarded by using the new flow entry is forwarded because the matching domain of the stored data flow is forwarded by the flow entry stored by the hardware unit.
  • the matching field of the data stream Therefore, after determining the matching field of the data stream that is forwarded by using the new flow entry, the flow of the software unit in the OpenFlow switch is further implemented by adding the new flow entry to the hardware unit of the OpenFlow switch. The consistency of the flow entries of the entry and the hardware unit.
  • the OpenFlow switch further comprises: a software unit for converting routing information into a flow entry and storing the flow entry; and converting the format of the flow entry converted by the software unit into a hardware unit
  • An adaptation unit that identifies the format.
  • converting the routing information into the newly created flow entry includes: the software unit converting the routing information into a new flow entry in the first format, where the newly created flow entry in the first format is a flow entry identifiable by the software unit.
  • adding the new flow entry to the hardware unit of the OpenFlow switch includes: the adapting unit converts the new flow entry in the first format to the new flow entry in the second format, where the new flow table in the second format The entry is a flow entry that is recognizable by the hardware unit. Further, by adding the new flow entry of the second format to the hardware unit of the OpenFlow switch, the latest routing information of the transport data stream is finally updated to the flow entry of the hardware unit in the OpenFlow switch.
  • FIG. 2 is a schematic diagram of an embodiment of a flow entry processing system provided by the present invention.
  • the system of this embodiment may include: a controller and an OpenFlow switch, and the OpenFlow switch is in communication with other transmission devices.
  • the OpenFlow switch in this embodiment adopts a four-layer data processing architecture, which is a software unit, a description unit, an adaptation unit, and a hardware unit from top to bottom. An explanation will now be given of possible operations involved in the system of the present embodiment.
  • S201 The OpenFlow switch receives the data flow packet from the other transmission device through the input port In Port.
  • the S202 and the OpenFlow switch do not find the flow entry that matches the data flow packet in the hardware unit, and report the data flow message to the software unit.
  • S203 The OpenFlow switch does not find a flow entry that matches the data flow packet in the software unit, and reports the data flow message to the controller; S204, the controller configures the route for the data flow message according to the network topology, and The routing information is sent to the software unit of the OpenFlow switch. After the S205 and the OpenFlow switch generate the flow entry of the data flow packet according to the routing information sent by the controller, the trigger description unit requests the software unit to obtain the flow entry of the data flow packet.
  • the OpenFlow switch sends the flow entry of the data flow message to the description unit by the software unit;
  • S207 the OpenFlow switch sends the flow entry of the data flow message to the adaptation unit by the description unit;
  • S208 OpenFlow switch Mapping the flow entry of the data flow packet to the hardware unit by the adaptation unit;
  • S209 the OpenFlow switch finding the number and the number in the hardware unit After the packet flow matches the flow entry, by the number of the output port Out Port The flow message is sent to other transmission devices.
  • the method further includes: matching the matching field of the flow entry that is stored in the software unit with the matching domain of the determined data flow to obtain the matching flow entry in the first format;
  • the matching flow entry of the first format is converted into the matching flow entry of the second format; the matching flow entry of the second format is deleted in the hardware unit.
  • FIG. 3 is a flowchart of Embodiment 2 of a method for processing a flow entry according to the present invention. As shown in FIG. 3, the method in this embodiment may include the following content.
  • the OpenFlow switch receives routing information of the first data stream sent by the controller.
  • the first data stream may be any transport data stream, and the routing configuration of the transport data stream is performed by the controller.
  • the controller may configure routing or update routing for the transport data stream according to the network topology, and send the routing information to the OpenFlow switch to enable OpenFlow.
  • the switch performs data transfer.
  • first data stream, the second data stream, and the third data stream in this context may be the same data stream, partially the same data stream, or completely different data streams.
  • the OpenFlow switch generates a first flow entry of the first data flow according to the routing information, and records the data in the data flow table of the software unit.
  • the routing information of the data stream is recorded in the data flow table of the software unit in the form of a flow entry, and each flow entry corresponds to a routing forwarding rule.
  • the OpenFlow switch searches, in the description unit, description information of the second data stream that matches the first flow entry, where the description unit includes description information of the data flow that matches the flow entry in the hardware unit, and the second data flow and The second flow entry in the hardware unit matches.
  • the second data stream is an arbitrary transmission data stream. Since the process of mapping the flow entry in the software unit to the hardware unit requires the intervention of the data flow, there is a problem that the flow entry of the software unit and the flow entry of the hardware unit are inconsistent. Determining a description unit between the software unit and the adaptation unit, and describing description information of the data stream matching the flow table entry that has been mapped by the software unit to the hardware unit and still existing in the hardware unit is recorded in the description unit to describe the unit The bridge function makes the flow table entries of the software unit and the flow entries of the hardware unit consistent.
  • the OpenFlow switch searches, in the software unit, a third flow entry that matches the second data flow.
  • the OpenFlow switch sends the third flow entry to the hardware unit through the adaptation unit.
  • the first flow entry of the first data flow corresponds to the latest routing information of the first data flow
  • the OpenFlow switch finds the description information of the second data flow that matches the first flow entry in the description unit, and learns the hardware.
  • the second flow entry in the unit that matches the second data flow because the second flow entry corresponds to outdated routing information, the second flow entry in the hardware unit needs to be deleted.
  • the OpenFlow switch after receiving the routing information of the first data stream sent by the controller, the OpenFlow switch generates a first flow entry of the first data flow according to the routing information of the first data flow, and searches and describes the first flow in the description unit.
  • the description information of the second data stream matched by the entry because the description unit includes the description information of the data flow that matches the flow entry in the hardware unit, so that the second matching of the second data flow in the hardware unit can be known.
  • the second flow entry is then found in the software unit by matching the third flow entry that matches the second data flow, and then sending the third flow entry to the hardware unit through the adaptation unit, and then The second-flow entry is deleted, and the consistency of the flow entry of the software unit and the flow entry of the hardware unit is implemented. Therefore, the flow entry processing method provided by the embodiment of the present invention solves the problem that the flow entry of the software unit in the network OpenFlow switch is inconsistent with the flow entry of the hardware unit, and ensures that the data flow is performed according to the latest routing information.
  • the description unit is located between the software unit and the adaptation unit.
  • the generation of the description information of the data flow in the description unit may include:
  • the OpenFlow switch receives a third data stream sent by another transmission device.
  • the third data stream can be any transport data stream.
  • the OpenFlow switch searches, in the hardware unit, a fourth flow entry that matches the third data flow.
  • the OpenFlow switch first searches for a flow entry matching the data flow in the hardware unit, and reports the data flow to the software unit when the data is not found.
  • the OpenFlow switch searches for a fourth flow entry in the software unit.
  • the OpenFlow switch searches for the fourth flow entry matching the third data flow in the software unit. If the software unit cannot find the third flow entry, the third data flow can be further reported to the control.
  • the controller configures a route for the third data stream, and sends the routing information to the software unit of the OpenFlow switch.
  • the OpenFlow switch generates a flow entry of the third data flow according to the routing information, and records the data in the software unit. In the flow table.
  • the OpenFlow switch sends the fourth flow entry that is found by the software unit to the hardware unit by using the adaptation unit, and records the description information of the third data flow to the description unit.
  • the OpenFlow switch records the description information of the third data stream to the description unit by mapping the fourth flow entry to the hardware unit through the adaptation unit, so that the description unit includes the flow entry in the hardware unit. Description of the data stream.
  • the description information of the data flow matching the flow entry is recorded.
  • the consistency of the flow entry of the software unit and the flow entry of the hardware unit can be realized by describing the bridge function of the unit.
  • FIG. 5 is a flowchart of Embodiment 3 of a method for processing a flow entry according to the present invention. As shown in FIG. 5, the method in this embodiment may include:
  • the OpenFlow switch receives routing information of the first data stream sent by the controller.
  • the OpenFlow switch generates a first flow entry of the first data flow according to the routing information, and records the data in the data flow table of the software unit.
  • the OpenFlow switch searches, in the description unit, description information of the second data stream that matches the first flow entry, where the description unit includes description information of the data flow that matches the flow entry in the hardware unit, and the second data flow The second flow entry in the hardware unit matches.
  • the method for executing S501-S503 is similar to the method for executing S301-S303 in Embodiment 2, and details are not described herein again.
  • the OpenFlow switch sends the third flow entry to the hardware unit through the adaptation unit.
  • the first flow entry of the first data flow corresponds to the latest routing information of the first data flow
  • the OpenFlow switch finds the description information of the second data flow that matches the first flow entry in the description unit, and learns the hardware.
  • the priority value in the flow entry indicates the priority of the data flow that matches the flow entry. The greater the priority value, the higher the priority.
  • the first flow entry may be further compared And the priority of the second data stream, when the priority value in the first flow entry is smaller than the priority of the second data flow, selecting to continue to use the routing information in the second flow entry to the first data flow Performing the transmission; when the priority value in the first flow entry is greater than the priority of the second data flow, selecting to delete the second flow entry in the hardware unit, and implementing the first routing information in the first flow entry
  • the data stream performs the transfer. In order to not affect the data stream being transmitted, it is necessary to further search for a third flow entry that matches the second data flow in the software unit, and after the third flow entry is sent to the hardware unit through the adaptation unit, Then delete the second flow entry in the hardware unit.
  • the OpenFlow switch after receiving the routing information of the first data stream sent by the controller, the OpenFlow switch generates a first flow entry of the first data flow according to the routing information of the first data flow, and further searches and describes in the description unit.
  • the description information of the second data stream matched by the first data stream is compared with the priority value of the first flow entry and the second data flow priority, where the priority value in the first flow entry is greater than the second data flow.
  • the third unit entry that matches the second data stream is further searched in the software unit, and after the third stream entry is sent to the hardware unit through the adaptation unit, the second unit in the hardware unit is The flow entry is deleted, and the transmission of the first data flow is performed according to a high priority.
  • the description information of the data flow in the description unit is classified and recorded, and the description information of the data flow having the same message type is recorded in the same type of data flow information table.
  • the description information of the data flow in the description unit includes the matching domain information of the data flow and the priority of the data flow, and the matching domain information of the data flow includes: a packet type of the data flow, an ingress port number of the data stream, and a data flow. At least one of a source MAC address, a destination MAC address of the data stream, a source IP address of the data stream, a destination IP address of the data stream, and VLAN information of the data stream.
  • the message types of the data stream are: ARP, IPV4, IPV4-TCP, IPV4-UDP, IPV4-ICMP, IPV4-MPLS, IPV6, IPV6-TCP, IPV6-UDP, IPV6-ICMP, and IPV6-MPLS, according to the data.
  • the type of the flow packet can be divided into the following types: ARP, IPV4, IPV4-TCP, IPV4-UDP, IPV4-ICMP, IPV4-MPLS, IPV6, IPV6-TCP, and IPV6-UDP. , IPV6-ICMP and IPV6-MPLS.
  • Table 3 is a schematic flow entry information table.
  • each row of the flow entry information table corresponds to the information of a flow entry.
  • the packet type of the data flow matching the flow entry is ARP.
  • the packet type of the data stream matching the flow entry of the flow entry information table of the IPV4 type is IPV4, which is matched with the flow entry of the flow entry information table of the IPV4-TCP type.
  • the packet type of the configured data stream is IPV4-TCP.
  • the packet type of the data stream matching the flow entry of the IPV4-UDP flow entry information table is IPV4-UDP, and the IPV4-ICMP type flow table.
  • the packet type of the data flow matching the flow entry of the item information table is IPV4-ICMP
  • the packet type of the data flow matching the flow entry of the IPV4-MPLS flow entry information table is IPV4-MPLS.
  • the packet type of the data stream matching the flow entry of the flow entry information table of the IPV6 type is IPV6
  • the packet type of the data flow matching the flow entry of the flow entry information table of the IPV6-TCP type is IPV6-TCP, which matches the flow entry of the flow entry of the IPV6-UDP flow entry information table, is IPV6-UDP, and matches the flow entry of the flow entry information table of the IPV6-ICMP type.
  • the packet type of the data stream is IPV6-ICMP
  • the packet type of the data stream matching the flow entry of the flow entry information table of the IPV6-MPLS type is IPV6-MPLS.
  • Each row in the table field corresponds to the matching domain information of a flow entry, and can also be regarded as the matching identifier information of the data flow that matches the flow entry.
  • FIG. 6 is a flowchart of Embodiment 4 of a method for processing a flow entry according to the present invention. As shown in FIG. 6, the method of this embodiment may include the following.
  • S601 The OpenFlow switch receives a new flow entry from the flow table sent by the controller.
  • the new message sent by the controller includes information about the route it configured for the transport stream.
  • S602 The OpenFlow switch generates a new flow entry according to the message sent by the controller.
  • the routing information of the data stream is recorded in the data flow table of the software unit in the form of a flow entry, and each flow entry corresponds to a routing forwarding rule.
  • the OpenFlow switch searches the description information of the data flow in the description unit, and determines whether the hardware unit has a flow entry with the same matching domain condition as the newly added flow entry.
  • the description unit searches for the description information of the data stream that matches the newly added flow entry.
  • S604 The OpenFlow switch deletes the flow entry in the hardware unit that has the same matching domain condition as the newly added flow entry.
  • the OpenFlow switch deletes the coherent flow entry in the hardware unit, so that when the data flow matching the coherent flow entry is performed, the data flow is reported to the software unit, and the software unit searches for the data unit.
  • the new flow entry is added, and the new flow entry is mapped to the hardware unit through the adaptation unit, so that the data flow is performed according to the routing information in the newly added flow entry.
  • FIG. 7 is a flowchart of Embodiment 2 of generating description information of a data stream in a description unit of the present invention. As shown in FIG. 7, the generation of the description information of the data flow in the description unit may include:
  • the OpenFlow switch receives the data stream sent by other OpenFlow switches.
  • the OpenFlow switch searches, in the hardware unit, whether there is a flow entry that matches the data flow.
  • the OpenFlow switch first searches for a flow entry matching the data flow in the hardware unit, and reports the data flow to the software unit when the data is not found.
  • S704 The OpenFlow switch finds, in the software unit, a flow entry that matches the data flow.
  • the OpenFlow switch searches for a flow entry that matches the data flow in the software unit. If it is not found in the software unit, the data flow can be further reported to the controller, and the controller configures the route for the data flow, and the routing information is The software unit sent to the OpenFlow switch, the OpenFlow switch generates a flow entry of the data flow according to the routing information, and records it in the data flow table of the software unit.
  • the OpenFlow switch maps the flow entry that is found by the software unit to the hardware unit, and saves the description information of the data flow that matches the flow entry to the description unit.
  • the OpenFlow switch saves the description information of the data flow that matches the flow table entry to the description unit, so that the description unit includes the flow entry in the hardware unit, while mapping the flow entry to the hardware unit through the adaptation unit. A description of the matching data stream.
  • the OpenFlow switch performs transmission on the data stream according to the flow entry in the hardware unit that matches the data flow.
  • the description information of the data flow matching the flow entry is The description is performed on the description unit, so that the description unit includes description information of the data flow that matches the flow entry in the hardware unit, and the flow entry of the software unit and the flow entry of the hardware unit can be implemented by describing the bridge function of the unit. Consistency.
  • FIG. 8 is a schematic structural diagram of an embodiment of a flow entry processing apparatus according to the present invention.
  • the device can be applied to an OpenFlow OpenFlow switch.
  • the OpenFlow switch includes a hardware unit, and the hardware unit is configured to store a flow entry of a data flow directly forwarded by a hardware interface of the OpenFlow switch.
  • the flow entry processing device of this embodiment may include: a receiving module 801, a converting module 802, a matching module 803, and an adding module 804.
  • the receiving module 801 is configured to receive routing information sent by the controller;
  • the converting module 802 is configured to convert the routing information into a new flow entry;
  • the matching module 803 is configured to match the newly created flow with a matching domain of the stored data flow.
  • Matching field 804 is used when determining to use the new stream entry to enter When the matching domain of the forwarded data stream is used, the new flow entry is added to the hardware unit of the OpenFlow switch.
  • the device in this embodiment may be used to perform the method in the method embodiment shown in FIG. 1.
  • the implementation principle is similar to the technical effect to be achieved, and details are not described herein again.
  • the OpenFlow switch further comprises: a software unit for converting routing information into a flow entry and storing the flow entry; and a format of the flow entry for converting the software unit Converting to an adaptation unit of the hardware unit identification format; further, the software unit is specifically configured to convert the routing information into a new flow entry of a first format; further, the adaptation unit is specifically configured to: Converting the new flow entry of the first format to the new flow entry of the second format that can be identified by the hardware unit; the adding module 804 can be specifically configured to add the new flow entry of the second format to the new flow entry.
  • the hardware unit of the OpenFlow switch In the hardware unit of the OpenFlow switch.
  • the matching field may be at least one of a packet type, an ingress port number, a source hardware access control MAC address, a destination MAC address, a source Internet Protocol IP address, a destination IP address, and a virtual local area network VLAN information.
  • the priority of the newly created flow entry is higher than the priority of the matching flow entry.
  • the matching module 803 is further configured to match the matching field of the flow entry stored by the software unit with the matching field of the determined data flow to obtain a matching flow entry in the first format;
  • the matching unit specifically converts the matching flow entry of the first format into a matching flow entry of the second format.
  • the device may further include a deleting module 805, where the deleting module 805 may be configured to delete the matching flow entry of the second format in the hardware unit.
  • FIG. 9 is a schematic structural diagram of an embodiment of a flow entry processing device according to an embodiment of the present invention.
  • the device may be an OpenFlow switch.
  • the flow entry processing device includes at least one processor 901 (eg, a CPU), a memory 903, and at least one communication bus 904 for implementing connection communication between devices.
  • the processor 901 is configured to execute an executable module, such as a computer program, stored in the memory 903.
  • the memory 903 may include a high speed random access memory (RAM), and may also include a non-volatile memory such as at least one disk memory.
  • RAM high speed random access memory
  • non-volatile memory such as at least one disk memory.
  • the memory 903 stores a program 905 that can be executed by the processor 901.
  • the program includes executing a flow entry processing method, the method comprising:
  • the OpenFlow switch receives routing information sent by the controller.
  • the new flow entry is added to the hardware unit of the OpenFlow switch.
  • the program for executing the flow entry processing method preferably, the OpenFlow switch further includes: a software unit for converting routing information into a flow entry and storing the flow entry; and converting the software unit Converting the format of the flow entry to an adaptation unit of the hardware unit identification format;
  • the converting the routing information into a new flow entry includes: converting, by the software unit, the routing information into a new flow entry in a first format
  • the adding the new flow entry to the hardware unit of the OpenFlow switch includes:
  • the adapting unit converts the new flow entry of the first format into a new flow entry of the second format identifiable by the hardware unit;
  • the program for executing the flow entry processing method preferably, the method further includes:
  • the adapting unit converts the matching flow entry of the first format into a matching flow entry of the second format
  • the matching flow entry of the second format is deleted in the hardware unit.
  • the program for executing the flow entry processing method is preferably that the priority of the newly created flow entry is higher than the priority of the matching flow entry.
  • the matching domain includes: a packet type, an ingress port number, a source hardware access control MAC address, a destination MAC address, a source Internet Protocol IP address, a destination IP address, and a virtual At least one of the LAN VLAN information.

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

一种流表项处理方法和装置,涉及通信技术领域,用以解决OpenFlow交换机中软件单元的流表项和硬件单元的流表项不一致的问题。所述方法包括OpenFlow交换机接收控制器发送的路由信息(S101);将路由信息转换成新建流表项(S102);用存储的数据流的匹配域匹配新建流表项的匹配域,确定出利用新建流表项进行转发的数据流的匹配域,其中,存储的数据流的匹配域为通过硬件单元存储的流表项转发的数据流的匹配域(S103);当确定出利用新建流表项进行转发的数据流的匹配域时,将新建流表项添加到硬件单元中(S104)。所述流表项处理方法和装置,可以应用于对数据传输性能要求较高的OpenFlow交换机。

Description

流表项处理方法和装置 技术领域
本发明实施例涉及通信技术领域,尤其涉及一种流表项处理方法和装置。
背景技术
OpenFlow(开放流)技术是将网络传输设备(如交换机、路由器等设备)的数据转发和路由控制两个功能模块相分离,通过集中式的控制器(Controller)对OpenFlow交换机(OpenFlow Switch)进行管理和配置。
现有技术中,对于基于OpenFlow技术的数据传输,传输设备通常采用三单元数据处理架构,分别为软件单元、适配单元和硬件单元。控制器为传输数据流配置路由,并将路由信息下发到传输设备的软件单元。数据流的路由信息记录在软件单元的数据流流表(FlowTable)中,数据流流表由分级结构的流表项组成,每个流表项对应一个路由转发规则。
流表项包括匹配域(Match Fields)和指令(Actions),匹配域用于记录流表项的标识,指令用于记录与流表项的标识相匹配的数据流应该执行的操作。在数据传输过程中,传输数据流到达OpenFlow交换机,OpenFlow交换机首先在硬件单元查找与所述数据流相匹配的流表项,当查找不到时,再将所述数据流上报给软件单元,在软件单元查找与所述数据流相匹配的流表项,并将查找到的流表项通过适配单元映射到硬件单元,以实现在硬件单元对所述数据流的转发。
但是,如果硬件单元存在与传输数据流相匹配的流表项,则传输数据不会被上报到软件单元,OpenFlow交换机也就不会在软件单元查找与所述传输数据流相匹配的流表项,那么控制器下发到软件单元的与所述传输数据流相匹配的其它流表项无法继续下发到硬件单元,并在硬件单元生效。例如,表1为示意性的硬件单元流表项表,由表1可知,匹配ethtype=0x0800,dstip=2.1.2.2,srcip=2.1.2.1的数据流,优先级为1。表2为示意性的软件单元流表项表,由表2可知,匹配inport=1的数据流,优先级为2。其中,优先级值越大,表示优先级高。当有匹配 ethtype=0x0800,dstip=2.1.2.2,srcip=2.1.2.1,inport=1的数据流到达OpenFlow交换机时,由于表1所示的流表项已在硬件单元生效,OpenFlow交换机直接将该数据流按照表1所示的流表项转发,而不会将该数据流上报给软件单元,因此,表2所示的流表项没能在硬件单元生效。
表1 示意性的硬件单元流表项表
Figure PCTCN2014090273-appb-000001
表2 示意性的软件单元流表项表
匹配域 指令 优先级
inport:1 output:2 2
可见,上述流表项处理方法,存在软件单元的流表项和硬件单元的流表项不一致的问题。
发明内容
本发明的实施例提供一种流表项处理方法和装置,用以解决OpenFlow交换机中软件单元的流表项和硬件单元的流表项不一致的问题。
为达到上述目的,本发明的实施例采用如下技术方案
第一方面,本发明实施例提供一种流表项处理方法,应用于开放流OpenFlow交换机,所述OpenFlow交换机包括硬件单元,所述硬件单元用于存储所述OpenFlow交换机的硬件接口直接转发的数据流的流表项,所述方法包括:
所述OpenFlow交换机接收控制器发送的路由信息;
将所述路由信息转换成新建流表项;
用存储的数据流的匹配域匹配所述新建流表项的匹配域,确定出利用所述新建流表项进行转发的数据流的匹配域;其中,所述存储的数据流的匹配域为通过所述硬件单元存储的流表项转发的数据流的匹配域;
当确定出利用所述新建流表项进行转发的数据流的匹配域时,将所 述新建流表项添加到所述OpenFlow交换机的所述硬件单元中。
结合第一方面,在第一方面的第一种可能的实现方式中,所述OpenFlow交换机还包括:用于将路由信息转换为流表项,并存储流表项的软件单元;和用于将所述软件单元转换的流表项的格式转换为所述硬件单元识别格式的适配单元;
进一步地,所述将所述路由信息转换成新建流表项包括:所述软件单元将所述路由信息转换成第一格式的新建流表项;
进一步地,所述将所述新建流表项添加到所述OpenFlow交换机的所述硬件单元中包括:
所述适配单元将所述第一格式的新建流表项转换为所述硬件单元可识别的第二格式的新建流表项;
将所述第二格式的新建流表项添加到所述OpenFlow交换机的所述硬件单元中。
结合第一方面或第一方面的第一种可能的实现方式,在第二种可能的实现方式中,所述方法还包括:
用确定出的数据流的匹配域匹配所述软件单元存储的流表项的匹配域,得到第一格式的匹配流表项;
所述适配单元将所述第一格式的匹配流表项转换为第二格式的匹配流表项;
在所述硬件单元中删除所述第二格式的匹配流表项。
结合第一方面或第一方面的第二种可能的实现方式或第一方面的第二种可能的实现方式,在第三种可能的实现方式中,所述新建流表项的优先级高于所述匹配流表项的优先级。
结合第一方面或第一方面的第一种可能的实现方式或第一方面的第二种可能的实现方式或第一方面的第三种可能的实现方式,在第四种可能的实现方式中,所述匹配域包括:报文类型、入端口号、源硬件接入控制MAC地址、目的MAC地址、源互联网协议IP地址、目的IP地址、虚拟局域网VLAN信息中的至少一个。
第二方面,本发明实施例提供一种流表项处理装置,应用于开放流OpenFlow交换机,所述OpenFlow交换机包括硬件单元,所述硬件单元用于存储所述OpenFlow交换机的硬件接口直接转发的数据流的流表项,所述装置包括:
接收模块,用于接收控制器发送的路由信息;
转换模块,用于将所述路由信息转换成新建流表项;
匹配模块,用于用存储的数据流的匹配域匹配所述新建流表项的匹配域,确定出利用所述新建流表项进行转发的数据流的匹配域;其中,所述存储的数据流的匹配域为通过所述硬件单元存储的流表项转发的数据流的匹配域;
添加模块,用于当确定出利用所述新建流表项进行转发的数据流的匹配域时,将所述新建流表项添加到所述OpenFlow交换机的所述硬件单元中。
结合第二方面,在第二方面的第一种可能的实现方式中,所述OpenFlow交换机还包括:用于将路由信息转换为流表项,并存储流表项的软件单元;和用于将所述软件单元转换的流表项的格式转换为所述硬件单元识别格式的适配单元;
进一步地,所述软件单元具体用于将所述路由信息转换成第一格式的新建流表项;
进一步地,所述适配单元具体用于将所述第一格式的新建流表项转换为所述硬件单元可识别的第二格式的新建流表项;
所述添加模块具体用于将所述第二格式的新建流表项添加到所述OpenFlow交换机的所述硬件单元中。
结合第二方面或第二方面的第一种可能的实现方式,在第二种可能的实现方式中,所述匹配模块还用于用确定出的数据流的匹配域匹配所述软件单元存储的流表项的匹配域,得到第一格式的匹配流表项;
所述适配单元具体将所述第一格式的匹配流表项转换为第二格式的匹配流表项;
所述装置还包括删除模块,所述删除模块用于在所述硬件单元中删除所述第二格式的匹配流表项。
结合第二方面或第二方面的第二种可能的实现方式或第二方面的第二种可能的实现方式,在第三种可能的实现方式中,所述新建流表项的优先级高于所述匹配流表项的优先级。
结合第二方面或第二方面的第一种可能的实现方式或第二方面的第二种可能的实现方式或第二方面的第三种可能的实现方式,在第四种可能的实现方式中,所述匹配域包括:报文类型、入端口号、源硬件接入 控制MAC地址、目的MAC地址、源互联网协议IP地址、目的IP地址、虚拟局域网VLAN信息中的至少一个。
本发明实施例提供的技术方案,OpenFlow交换机在接收到控制器发送的路由信息后,将所述路由信息转换成新建流表项,并通过将存储的数据流的匹配域匹配新建流表项的匹配域,确定出利用新建流表项进行转发的数据流的匹配域,由于存储的数据流的匹配域为通过硬件单元存储的流表项转发的数据流的匹配域,因此在确定出利用新建流表项进行转发的数据流的匹配域后,进一步的通过将新建流表项添加到OpenFlow交换机的硬件单元中,实现OpenFlow交换机中软件单元的流表项和硬件单元的流表项的一致性。
附图说明
为了更清楚地说明本发明实施例的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本发明流表项处理方法实施例一的流程图;
图2为本发明提供的流表项处理系统实施例的示意图;
图3为本发明流表项处理方法实施例二的流程图;
图4为本发明描述单元中数据流的描述信息的生成实施例一的流程图;
图5为本发明流表项处理方法实施例三的流程图;
图6为本发明流表项处理方法实施例四的流程图;
图7为本发明描述单元中数据流的描述信息生成实施例二的流程图;
图8为本发明流表项处理装置实施例的结构示意图;
图9为本发明实施例提供的流表项处理设备实施例的结构示意图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术 人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
本发明实施例提供的流表项处理方法可以应用于开放流OpenFlow交换机,其中,OpenFlow交换机包括硬件单元,硬件单元用于存储OpenFlow交换机的硬件接口直接转发的数据流的流表项。
图1为本发明流表项处理方法实施例一的流程图,如图1所示,本实施例的方法可以包括以下内容。
S101、OpenFlow交换机接收控制器发送的路由信息。
传输数据流的路由配置由控制器执行,控制器可以根据网络拓扑为传输数据流配置路由或者更新路由,并将路由信息发送给交换机,以使交换机执行数据传输。
S102、将路由信息转换成新建流表项。
数据流的路由信息以流表项的形式存储在在软件单元的数据流流表中,每个流表项对应一个路由转发规则。
S103、用存储的数据流的匹配域匹配新建流表项的匹配域,确定出利用新建流表项进行转发的数据流的匹配域,其中,存储的数据流的匹配域为通过硬件单元存储的流表项转发的数据流的匹配域。
在具体应用中,可以通过在OpenFlow交换机中增设用于存储数据流的描述信息(例如,数据流的匹配域)的描述单元,将与硬件单元中的流表项相匹配的数据流的描述信息存储在描述单元中,以通过描述单元的桥梁作用,使得软件单元的流表项和硬件单元的流表项一致。
S104、当确定出利用新建流表项进行转发的数据流的匹配域时,将新建流表项添加到OpenFlow交换机的硬件单元中。
在数据传输过程中OpenFlow交换机首先在硬件单元查找与数据流相匹配的流表项,因此,当确定出硬件单元中已存在与新建流表项相干的流表项时,则通过将新建流表项添加到硬件单元中来确保按照最新的路由信息对数据流执行传输。优选地,新建流表项的优先级高于匹配流表项的优先级。
本实施例中,OpenFlow交换机在接收到控制器发送的路由信息后,将所述路由信息转换成新建流表项,并通过将存储的数据流的匹配域匹配新建流表项的匹配域,确定出利用新建流表项进行转发的数据流的匹配域,由于存储的数据流的匹配域为通过硬件单元存储的流表项转发的 数据流的匹配域,因此在确定出利用新建流表项进行转发的数据流的匹配域后,进一步的通过将新建流表项添加到OpenFlow交换机的硬件单元中,实现OpenFlow交换机中软件单元的流表项和硬件单元的流表项的一致性。
如上所述的方法,其中,OpenFlow交换机还包括:用于将路由信息转换为流表项,并存储流表项的软件单元;和用于将软件单元转换的流表项的格式转换为硬件单元识别格式的适配单元。进一步地,将路由信息转换成新建流表项包括:软件单元将路由信息转换成第一格式的新建流表项,其中,第一格式的新建流表项为软件单元可识别的流表项。再进一步地,将新建流表项添加到OpenFlow交换机的硬件单元中包括:适配单元将第一格式的新建流表项转换为第二格式的新建流表项,其中第二格式的新建流表项为硬件单元可识别的流表项。再进一步地,通过将第二格式的新建流表项添加到OpenFlow交换机的硬件单元中,最终实现将传输数据流的最新路由信息更新到OpenFlow交换机中硬件单元的流表项中。
图2为本发明提供的流表项处理系统实施例的示意图。如图2所示,本实施例的系统可以包括:控制器和OpenFlow交换机,OpenFlow交换机与其它传输设备连接通信。其中,本实施例的OpenFlow交换机采用四层数据处理架构,从上到下依次为软件单元、描述单元、适配单元和硬件单元。现就本实施例的系统涉及的可能的操作作解释。S201、OpenFlow交换机通过输入端口In Port从其它传输设备接收数据流报文;S202、OpenFlow交换机在硬件单元未查找到与数据流报文相匹配的流表项,将数据流报文上报到软件单元;S203、OpenFlow交换机在软件单元未查找到与数据流报文相匹配的流表项,将数据流报文上报给控制器;S204、控制器根据网络拓扑为数据流报文配置路由,并将路由信息下发到OpenFlow交换机的软件单元;S205、OpenFlow交换机根据控制器下发的路由信息生成数据流报文的流表项后,触发描述单元向软件单元请求获得数据流报文的流表项;S206、OpenFlow交换机将数据流报文的流表项由软件单元下发到描述单元;S207、OpenFlow交换机将数据流报文的流表项由描述单元下发到适配单元;S208、OpenFlow交换机将数据流报文的流表项由适配单元映射到硬件单元;S209、OpenFlow交换机在硬件单元查找到与数据流报文相匹配的流表项后,通过输出端口Out Port将数 据流报文发送给其它传输设备。
如上所述的方法,可选地,所述方法还包括:用确定出的数据流的匹配域匹配软件单元存储的流表项的匹配域,得到第一格式的匹配流表项;适配单元将第一格式的匹配流表项转换为第二格式的匹配流表项;在硬件单元中删除第二格式的匹配流表项。
图3为本发明流表项处理方法实施例二的流程图,如图3所示,本实施例的方法可以包括以下内容。
S301、OpenFlow交换机接收控制器发送的第一数据流的路由信息。
第一数据流可以为任意传输数据流,传输数据流的路由配置由控制器执行,控制器可以根据网络拓扑为传输数据流配置路由或者更新路由,并将路由信息发送给OpenFlow交换机,以使OpenFlow交换机执行数据传输。
需要说明的是,本文中的第一数据流、第二数据流、第三数据流相互之间可以为相同的数据流、部分相同的数据流或者完全不相同的数据流。
S302、OpenFlow交换机根据路由信息生成第一数据流的第一流表项,并记录在软件单元的数据流流表中。
数据流的路由信息以流表项的形式记录在在软件单元的数据流流表中,每个流表项对应一个路由转发规则。
S303、OpenFlow交换机在描述单元查找与第一流表项相匹配的第二数据流的描述信息,描述单元中包括与硬件单元中的流表项相匹配的数据流的描述信息,第二数据流与硬件单元中的第二流表项相匹配。
第二数据流为任意传输数据流,由于软件单元中的流表项映射到硬件单元的过程需要数据流的介入,因此,存在软件单元的流表项和硬件单元的流表项不一致的问题。在软件单元和适配单元之间设置描述单元,将与已由软件单元映射到硬件单元且仍然存在于硬件单元的流表项相匹配的数据流的描述信息记录在描述单元,以通过描述单元的桥梁作用,使得软件单元的流表项和硬件单元的流表项一致。
S304、OpenFlow交换机在软件单元查找与第二数据流相匹配的第三流表项。
S305、OpenFlow交换机将第三流表项通过适配单元下发到硬件单元。
S306、OpenFlow交换机将第二流表项删除。
具体的,第一数据流的第一流表项对应的是第一数据流的最新路由信息,OpenFlow交换机在描述单元查找到了与第一流表项相匹配的第二数据流的描述信息,并获知硬件单元中与第二数据流相匹配的第二流表项,由于第二流表项对应的是过时的路由信息,因此,需要将硬件单元中的第二流表项删除。为了不影响正在传输中的数据流,因此需要进一步的在软件单元查找与第二数据流相匹配的第三流表项,在将第三流表项通过适配单元下发到硬件单元后,再将硬件单元中的第二流表项删除。
本实施例中,OpenFlow交换机在接收到控制器发送的第一数据流的路由信息后,根据第一数据流的路由信息生成第一数据流的第一流表项,并在描述单元查找与第一流表项相匹配的第二数据流的描述信息,由于描述单元中包括与硬件单元中的流表项相匹配的数据流的描述信息,因此可以获知硬件单元中与第二数据流相匹配的第二流表项,然后通过在软件单元查找与第二数据流相匹配的第三流表项,并在将第三流表项通过适配单元下发到硬件单元后,再将硬件单元中第二流表项删除,实现了软件单元的流表项和硬件单元的流表项的一致性。因此,本发明实施例提供的流表项处理方法,解决了网络OpenFlow交换机中软件单元的流表项和硬件单元的流表项不一致的问题,确保了按照最新的路由信息对数据流执行传输。
图4为本发明描述单元中数据流的描述信息的生成实施例一的流程图。本实施例中,描述单元位于软件单元和适配单元之间,如图4所示,描述单元中的数据流的描述信息的生成可以包括:
S401、OpenFlow交换机接收其它传输设备发送的第三数据流。
第三数据流可以为任意传输数据流。
S402、OpenFlow交换机在硬件单元查找与第三数据流相匹配的第四流表项。
S403、当OpenFlow交换机在硬件单元查找不到第四流表项时,将第三数据流上报给软件单元。
在数据传输过程中,OpenFlow交换机首先在硬件单元查找与数据流相匹配的流表项,当查找不到时,才将数据流上报给软件单元。
S404、OpenFlow交换机在软件单元查找第四流表项。
OpenFlow交换机在软件单元查找与第三数据流相匹配的第四流表项,若在软件单元查找不到,可以进一步的通过将第三数据流上报给控 制器,由控制器为第三数据流配置路由,并将路由信息下发到OpenFlow交换机的软件单元,OpenFlow交换机根据该路由信息生成第三数据流的流表项,并记录在软件单元的数据流流表中。
S405、OpenFlow交换机将在软件单元查找到的第四流表项通过适配单元下发到硬件单元,并将第三数据流的描述信息记录到描述单元。
OpenFlow交换机在将第四流表项通过适配单元映射到硬件单元的同时,将第三数据流的描述信息记录到描述单元,以使描述单元中包括与硬件单元中的流表项相匹配的数据流的描述信息。
本实施例中,通过在软件单元和适配单元之间设置描述单元,并在将软件单元中的流表项映射到硬件单元的同时,将与流表项相匹配的数据流的描述信息记录到描述单元,进而可以通过描述单元的桥梁作用,实现软件单元的流表项和硬件单元的流表项的一致性。
图5为本发明流表项处理方法实施例三的流程图。如图5所示,本实施例的方法可以包括:
S501、OpenFlow交换机接收控制器发送的第一数据流的路由信息。
S502、OpenFlow交换机根据路由信息生成第一数据流的第一流表项,并记录在软件单元的数据流流表中。
S503、OpenFlow交换机在描述单元查找与第一流表项相匹配的第二数据流的描述信息,描述单元中包括与硬件单元中的流表项相匹配的数据流的描述信息,第二数据流与硬件单元中的第二流表项相匹配。
上述S501-S503的执行方法与实施例二中的S301-S303的执行方法类似,此处不再赘述。
S504、当软件单元中的第一流表项中的优先级值大于描述单元中的第二数据流的优先级时,OpenFlow交换机在软件单元查找与第二数据流相匹配的第三流表项。
S505、OpenFlow交换机将第三流表项通过适配单元下发到硬件单元。
S506、OpenFlow交换机将第二流表项删除。
具体的,第一数据流的第一流表项对应的是第一数据流的最新路由信息,OpenFlow交换机在描述单元查找到了与第一流表项相匹配的第二数据流的描述信息,并获知硬件单元中与第二数据流相匹配的第二流表项,流表项中的优先级值表示与流表项相匹配的数据流的优先级,优先级值越大,表示优先级高。优选地,可以通过进一步比较第一流表项中 的优先级值和第二数据流的优先级,当第一流表项中的优先级值小于第二数据流的优先级时,选择继续按照第二流表项中的路由信息对第一数据流执行传输;当第一流表项中的优先级值大于第二数据流的优先级时,选择将硬件单元中的第二流表项删除,进而实现按照第一流表项中的路由信息对第一数据流执行传输。为了不影响正在传输中的数据流,因此需要进一步的在软件单元查找与第二数据流相匹配的第三流表项,在将第三流表项通过适配单元下发到硬件单元后,再将硬件单元中的第二流表项删除。
本实施例中,OpenFlow交换机在接收到控制器发送的第一数据流的路由信息后,根据第一数据流的路由信息生成第一数据流的第一流表项,并进一步的在描述单元查找与第一数据流相匹配的第二数据流的描述信息,通过比较第一流表项中的优先级值和第二数据流优先级,当第一流表项中的优先级值大于第二数据流的优先级时,进一步的在软件单元查找与第二数据流相匹配的第三流表项,并在将第三流表项通过适配单元下发到硬件单元后,将硬件单元中的第二流表项删除,实现了按照高的优先级对第一数据流执行传输。
如上所述的方法,优选地,按照数据流的报文类型,将描述单元中的数据流的描述信息分类记录,将报文类型相同的数据流的描述信息记录在同一类型的数据流信息表中。其中,描述单元中的数据流的描述信息包括数据流的匹配域信息和数据流的优先级,数据流的匹配域信息包括:数据流的报文类型、数据流的入端口号、数据流的源MAC地址、数据流的目的MAC地址、数据流的源IP地址、数据流的目的IP地址和数据流的VLAN信息中的至少一个。
例如,数据流的报文类型有:ARP、IPV4、IPV4-TCP、IPV4-UDP、IPV4-ICMP、IPV4-MPLS、IPV6、IPV6-TCP、IPV6-UDP、IPV6-ICMP和IPV6-MPLS,根据数据流的报文类型,可以将流表项信息表的类型也划分为分为:ARP、IPV4、IPV4-TCP、IPV4-UDP、IPV4-ICMP、IPV4-MPLS、IPV6、IPV6-TCP、IPV6-UDP、IPV6-ICMP和IPV6-MPLS。表3为示意性的流表项信息表。如表3所示,流表项信息表的每一行对应为一条流表项的信息,对于ARP类型的流表项信息表,与其中的流表项相匹配的数据流的报文类型为ARP。类似地,与IPV4类型的流表项信息表的流表项相匹配的数据流的报文类型为IPV4,与IPV4-TCP类型的流表项信息表的流表项相匹 配的数据流的报文类型为IPV4-TCP,与IPV4-UDP类型的流表项信息表的流表项相匹配的数据流的报文类型为IPV4-UDP,与IPV4-ICMP类型的流表项信息表的流表项相匹配的数据流的报文类型为IPV4-ICMP,与IPV4-MPLS类型的流表项信息表的流表项相匹配的数据流的报文类型为IPV4-MPLS,与IPV6类型的流表项信息表的流表项相匹配的数据流的报文类型为IPV6,与IPV6-TCP类型的流表项信息表的流表项相匹配的数据流的报文类型为IPV6-TCP,与IPV6-UDP类型的流表项信息表的流表项相匹配的数据流的报文类型为IPV6-UDP,与IPV6-ICMP类型的流表项信息表的流表项相匹配的数据流的报文类型为IPV6-ICMP,与IPV6-MPLS类型的流表项信息表的流表项相匹配的数据流的报文类型为IPV6-MPLS。表字段中的每一行对应为一条流表项的匹配域信息,也可以认为是与流表项相匹配的数据流的匹配标识信息。
表3 示意性的流表项信息表
Figure PCTCN2014090273-appb-000002
Figure PCTCN2014090273-appb-000003
Figure PCTCN2014090273-appb-000004
Figure PCTCN2014090273-appb-000005
Figure PCTCN2014090273-appb-000006
图6为本发明流表项处理方法实施例四的流程图。如图6所示,本实施例的方法可以包括以下内容。
S601、OpenFlow交换机接收控制器发送的流表项新增消息。
控制器发送的新增消息中包括其为传输数据流配置的路由的信息。
S602、OpenFlow交换机根据控制器发送的消息,生成新增流表项。
数据流的路由信息以流表项的形式记录在软件单元的数据流流表中,每个流表项对应一个路由转发规则。
S603、OpenFlow交换机在描述单元查找数据流的描述信息,判断硬件单元是否存在与新增流表项的匹配域条件相同的流表项。
例如,在描述单元查找是否存在与新增流表项相匹配的数据流的描述信息。
若为是,则执行S604;若为否,则执行S605。
S604、OpenFlow交换机将硬件单元中的与新增流表项的匹配域条件相同的流表项删除。
S605、结束。
本实施例中,OpenFlow交换机通过将硬件单元中的相干流表项删除,以使在对与相干流表项相匹配的数据流执行传输时,会将数据流上报给软件单元,在软件单元查找到新增流表项,并将新增流表项通过适配单元映射到硬件单元,进而实现按照新增流表项中的路由信息对数据流执行传输。
图7为本发明描述单元中数据流的描述信息生成实施例二的流程图。如图7所示,描述单元中的数据流的描述信息的生成可以包括:
S701、OpenFlow交换机接收其它OpenFlow交换机发送的数据流。
S702、OpenFlow交换机在硬件单元查找是否存在与数据流相匹配的流表项。
若为否,则执行S703;若为是,则执行S706。
S703、将数据流上报给软件单元。
在数据传输过程中,OpenFlow交换机首先在硬件单元查找与数据流相匹配的流表项,当查找不到时,才将数据流上报给软件单元。
S704、OpenFlow交换机在软件单元查找到与数据流相匹配的流表项。
OpenFlow交换机在软件单元查找与数据流相匹配的流表项,若在软件单元查找不到,可以进一步的通过将数据流上报给控制器,由控制器为数据流配置路由,并将路由信息下发到OpenFlow交换机的软件单元,OpenFlow交换机根据该路由信息生成该数据流的流表项,并记录在软件单元的数据流流表中。
S705、OpenFlow交换机将在软件单元查找到的流表项映射到硬件单元,并将与该流表项相匹配的数据流的描述信息保存到描述单元。
OpenFlow交换机在将流表项通过适配单元映射到硬件单元的同时,将与流表项相匹配的数据流的描述信息保存到描述单元,以使描述单元中包括与硬件单元中的流表项相匹配的数据流的描述信息。
S706、OpenFlow交换机根据硬件单元中的与数据流相匹配的流表项对数据流执行传输。
本实施例中,通过在软件单元和适配单元之间设置描述单元,并在将软件单元中的流表项映射到硬件单元的同时,将与该流表项相匹配的数据流的描述信息保存到描述单元,使得描述单元中包括与硬件单元中的流表项相匹配的数据流的描述信息,进而可以通过描述单元的桥梁作用,实现软件单元的流表项和硬件单元的流表项的一致性。
图8为本发明流表项处理装置实施例的结构示意图。该装置可以应用于开放流OpenFlow交换机,OpenFlow交换机包括硬件单元,硬件单元用于存储OpenFlow交换机的硬件接口直接转发的数据流的流表项。如图8所示,本实施例的流表项处理装置可以包括:接收模块801、转换模块802、匹配模块803和添加模块804。其中,接收模块801用于接收控制器发送的路由信息;转换模块802用于将所述路由信息转换成新建流表项;匹配模块803用于用存储的数据流的匹配域匹配所述新建流表项的匹配域,确定出利用所述新建流表项进行转发的数据流的匹配域;其中,所述存储的数据流的匹配域为通过所述硬件单元存储的流表项转发的数据流的匹配域;添加模块804用于当确定出利用所述新建流表项进 行转发的数据流的匹配域时,将所述新建流表项添加到所述OpenFlow交换机的所述硬件单元中。
本实施例的装置可以用于执行图1所示方法实施例的方法,其实现原理和所要达到的技术效果类似,在此不再赘述。
如上所述的装置,其中,所述OpenFlow交换机还包括:用于将路由信息转换为流表项,并存储流表项的软件单元;和用于将所述软件单元转换的流表项的格式转换为所述硬件单元识别格式的适配单元;进一步地,所述软件单元具体用于将所述路由信息转换成第一格式的新建流表项;进一步地,所述适配单元具体用于将所述第一格式的新建流表项转换为所述硬件单元可识别的第二格式的新建流表项;添加模块804具体可以用于将所述第二格式的新建流表项添加到所述OpenFlow交换机的所述硬件单元中。上述匹配域可以为:报文类型、入端口号、源硬件接入控制MAC地址、目的MAC地址、源互联网协议IP地址、目的IP地址、虚拟局域网VLAN信息中的至少一个。优选地,所述新建流表项的优先级高于所述匹配流表项的优先级。
如上所述的装置,其中,匹配模块803还可以用于用确定出的数据流的匹配域匹配所述软件单元存储的流表项的匹配域,得到第一格式的匹配流表项;所述适配单元具体将所述第一格式的匹配流表项转换为第二格式的匹配流表项。可选地,所述装置还可以包括删除模块805,删除模块805可以用于在所述硬件单元中删除所述第二格式的匹配流表项。
图9为本发明实施例提供的流表项处理设备实施例的结构示意图。该设备可以是OpenFlow交换机,如图9所示,该流表项处理设备包括至少一个处理器901(例如CPU),存储器903,和至少一个通信总线904,用于实现装置之间的连接通信。处理器901用于执行存储器903中存储的可执行模块,例如计算机程序。存储器903可能包含高速随机存取存储器(RAM:Random Access Memory),也可能还包括非不稳定的存储器(non-volatile memory),例如至少一个磁盘存储器。
在一些实施方式中,存储器903存储了程序905,程序905可以被处理器901执行,这个程序包括执行一种流表项处理方法,该方法包括:
OpenFlow交换机接收控制器发送的路由信息;
将路由信息转换成新建流表项;
用存储的数据流的匹配域匹配新建流表项的匹配域,确定出利用新 建流表项进行转发的数据流的匹配域;其中,存储的数据流的匹配域为通过硬件单元存储的流表项转发的数据流的匹配域;
当确定出利用新建流表项进行转发的数据流的匹配域时,将新建流表项添加到OpenFlow交换机的硬件单元中。
上述执行流表项处理方法的程序,优选地,所述OpenFlow交换机还包括:用于将路由信息转换为流表项,并存储流表项的软件单元;和用于将所述软件单元转换的流表项的格式转换为所述硬件单元识别格式的适配单元;
进一步地,所述将所述路由信息转换成新建流表项包括:所述软件单元将所述路由信息转换成第一格式的新建流表项;
进一步地,所述将所述新建流表项添加到所述OpenFlow交换机的所述硬件单元中包括:
所述适配单元将所述第一格式的新建流表项转换为所述硬件单元可识别的第二格式的新建流表项;
将所述第二格式的新建流表项添加到所述OpenFlow交换机的所述硬件单元中。
上述执行流表项处理方法的程序,优选地,所述方法还包括:
用确定出的数据流的匹配域匹配所述软件单元存储的流表项的匹配域,得到第一格式的匹配流表项;
所述适配单元将所述第一格式的匹配流表项转换为第二格式的匹配流表项;
在所述硬件单元中删除所述第二格式的匹配流表项。
上述执行流表项处理方法的程序,优选地,所述新建流表项的优先级高于所述匹配流表项的优先级。
上述执行流表项处理方法的程序,优选地,所述匹配域包括:报文类型、入端口号、源硬件接入控制MAC地址、目的MAC地址、源互联网协议IP地址、目的IP地址、虚拟局域网VLAN信息中的至少一个。
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。

Claims (10)

  1. 一种流表项处理方法,应用于开放流OpenFlow交换机,所述OpenFlow交换机包括硬件单元,所述硬件单元用于存储所述OpenFlow交换机的硬件接口直接转发的数据流的流表项,其特征在于,所述方法包括:
    所述OpenFlow交换机接收控制器发送的路由信息;
    将所述路由信息转换成新建流表项;
    用存储的数据流的匹配域匹配所述新建流表项的匹配域,确定出利用所述新建流表项进行转发的数据流的匹配域;其中,所述存储的数据流的匹配域为通过所述硬件单元存储的流表项转发的数据流的匹配域;
    当确定出利用所述新建流表项进行转发的数据流的匹配域时,将所述新建流表项添加到所述OpenFlow交换机的所述硬件单元中。
  2. 根据权利要求1所述的方法,其特征在于,所述OpenFlow交换机还包括:用于将路由信息转换为流表项,并存储流表项的软件单元;和用于将所述软件单元转换的流表项的格式转换为所述硬件单元识别格式的适配单元;
    进一步地,所述将所述路由信息转换成新建流表项包括:所述软件单元将所述路由信息转换成第一格式的新建流表项;
    进一步地,所述将所述新建流表项添加到所述OpenFlow交换机的所述硬件单元中包括:
    所述适配单元将所述第一格式的新建流表项转换为所述硬件单元可识别的第二格式的新建流表项;
    将所述第二格式的新建流表项添加到所述OpenFlow交换机的所述硬件单元中。
  3. 根据权利要求2所述的方法,其特征在于,所述方法还包括:
    用确定出的数据流的匹配域匹配所述软件单元存储的流表项的匹配域,得到第一格式的匹配流表项;
    所述适配单元将所述第一格式的匹配流表项转换为第二格式的匹配流表项;
    在所述硬件单元中删除所述第二格式的匹配流表项。
  4. 根据权利要求3所述的方法,其特征在于,所述新建流表项的优 先级高于所述匹配流表项的优先级。
  5. 根据权利要求1至4任一权利要求所述的方法,其特征在于,所述匹配域包括:报文类型、入端口号、源硬件接入控制MAC地址、目的MAC地址、源互联网协议IP地址、目的IP地址、虚拟局域网VLAN信息中的至少一个。
  6. 一种流表项处理装置,应用于开放流OpenFlow交换机,所述OpenFlow交换机包括硬件单元,所述硬件单元用于存储所述OpenFlow交换机的硬件接口直接转发的数据流的流表项,其特征在于,所述装置包括:
    接收模块,用于接收控制器发送的路由信息;
    转换模块,用于将所述路由信息转换成新建流表项;
    匹配模块,用于用存储的数据流的匹配域匹配所述新建流表项的匹配域,确定出利用所述新建流表项进行转发的数据流的匹配域;其中,所述存储的数据流的匹配域为通过所述硬件单元存储的流表项转发的数据流的匹配域;
    添加模块,用于当确定出利用所述新建流表项进行转发的数据流的匹配域时,将所述新建流表项添加到所述OpenFlow交换机的所述硬件单元中。
  7. 根据权利要求6所述的装置,其特征在于,所述OpenFlow交换机还包括:用于将路由信息转换为流表项,并存储流表项的软件单元;和用于将所述软件单元转换的流表项的格式转换为所述硬件单元识别格式的适配单元;
    进一步地,所述软件单元具体用于将所述路由信息转换成第一格式的新建流表项;
    进一步地,所述适配单元具体用于将所述第一格式的新建流表项转换为所述硬件单元可识别的第二格式的新建流表项;
    所述添加模块具体用于将所述第二格式的新建流表项添加到所述OpenFlow交换机的所述硬件单元中。
  8. 根据权利要求7所述的装置,其特征在于,
    所述匹配模块还用于用确定出的数据流的匹配域匹配所述软件单元存储的流表项的匹配域,得到第一格式的匹配流表项;
    所述适配单元具体将所述第一格式的匹配流表项转换为第二格式的 匹配流表项;
    所述装置还包括:
    删除模块,用于在所述硬件单元中删除所述第二格式的匹配流表项。
  9. 根据权利要求8所述的装置,其特征在于,所述新建流表项的优先级高于所述匹配流表项的优先级。
  10. 根据权利要求6至9任一权利要求所述的装置,其特征在于,所述匹配域包括:报文类型、入端口号、源硬件接入控制MAC地址、目的MAC地址、源互联网协议IP地址、目的IP地址、虚拟局域网VLAN信息中的至少一个。
PCT/CN2014/090273 2014-11-04 2014-11-04 流表项处理方法和装置 WO2016070332A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2014/090273 WO2016070332A1 (zh) 2014-11-04 2014-11-04 流表项处理方法和装置
CN201480040608.5A CN105765922B (zh) 2014-11-04 2014-11-04 流表项处理方法和装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2014/090273 WO2016070332A1 (zh) 2014-11-04 2014-11-04 流表项处理方法和装置

Publications (1)

Publication Number Publication Date
WO2016070332A1 true WO2016070332A1 (zh) 2016-05-12

Family

ID=55908354

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/090273 WO2016070332A1 (zh) 2014-11-04 2014-11-04 流表项处理方法和装置

Country Status (2)

Country Link
CN (1) CN105765922B (zh)
WO (1) WO2016070332A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110365599A (zh) * 2019-07-12 2019-10-22 中国电信集团工会上海市委员会 一种Openflow交换机转发通道快速更新系统及其方法
CN112511438A (zh) * 2020-11-19 2021-03-16 锐捷网络股份有限公司 一种利用流表转发报文的方法、装置及计算机设备

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107786461B (zh) * 2016-08-25 2021-06-29 中国电信股份有限公司 实现流表切换的方法及控制器
CN110430138B (zh) * 2019-07-26 2022-02-22 新华三技术有限公司合肥分公司 数据流转发状态记录方法及网络设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102957603A (zh) * 2012-11-09 2013-03-06 盛科网络(苏州)有限公司 基于多级流表的Openflow报文转发方法及系统
CN103259718A (zh) * 2013-04-18 2013-08-21 华为技术有限公司 一种流表转换方法和装置
CN103326943A (zh) * 2012-03-23 2013-09-25 日电(中国)有限公司 数据流重路由方法和控制器
US20140269683A1 (en) * 2013-03-14 2014-09-18 International Business Machines Corporation Synchronization of OpenFlow controller devices via OpenFlow switching devices

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103326943A (zh) * 2012-03-23 2013-09-25 日电(中国)有限公司 数据流重路由方法和控制器
CN102957603A (zh) * 2012-11-09 2013-03-06 盛科网络(苏州)有限公司 基于多级流表的Openflow报文转发方法及系统
US20140269683A1 (en) * 2013-03-14 2014-09-18 International Business Machines Corporation Synchronization of OpenFlow controller devices via OpenFlow switching devices
CN103259718A (zh) * 2013-04-18 2013-08-21 华为技术有限公司 一种流表转换方法和装置

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110365599A (zh) * 2019-07-12 2019-10-22 中国电信集团工会上海市委员会 一种Openflow交换机转发通道快速更新系统及其方法
CN112511438A (zh) * 2020-11-19 2021-03-16 锐捷网络股份有限公司 一种利用流表转发报文的方法、装置及计算机设备

Also Published As

Publication number Publication date
CN105765922B (zh) 2019-06-07
CN105765922A (zh) 2016-07-13

Similar Documents

Publication Publication Date Title
EP3490203B1 (en) Method and system for implementing a vxlan control plane
JP5862769B2 (ja) 通信システム、制御装置、通信方法及びプログラム
US20150131666A1 (en) Apparatus and method for transmitting packet
US9325609B2 (en) Segmented source routing in a network
WO2015149563A1 (zh) 通信方法、系统、资源池管理系统、交换机和控制装置
US20170237655A1 (en) Forwarding Data Packets In Software Defined Networks
EP2945330A1 (en) Route management method, route method, network controller and router
JP2016149757A (ja) モジュール式転送テーブル拡張性のための技術
WO2015043327A1 (zh) 路由方法、设备和系统
JPWO2014136864A1 (ja) パケット書換装置、制御装置、通信システム、パケット送信方法及びプログラム
JPWO2011162215A1 (ja) 通信システム、制御装置、ノードの制御方法およびプログラム
US20210399908A1 (en) Multicast routing
WO2016023499A1 (zh) 一种处理修改后的报文方法和装置
WO2017028398A1 (zh) 通信处理方法和装置
WO2016070332A1 (zh) 流表项处理方法和装置
WO2016115698A1 (zh) 数据报文的转发方法、装置及设备
TW201436508A (zh) 轉發乙太網路封包的方法和裝置
JP6260285B2 (ja) 制御装置および転送制御方法
WO2021169514A1 (zh) 一种虚拟机vm的迁移方法及装置
WO2017084448A1 (zh) 一种网络系统及网络运行方法
WO2017193848A1 (zh) 路由建立、报文发送
CN104486227A (zh) 通过VxLAN技术实现IPv6灵活部署的系统及方法
WO2015106623A1 (zh) 一种配置、下发流表项的方法及装置
WO2017080440A1 (zh) 一种路由表更新方法、evpn控制设备及evpn系统
EP3384642B1 (en) Forwarding table compression

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

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

Country of ref document: EP

Kind code of ref document: A1