WO2015074182A1 - 一种基于流表的表项寻址方法、交换机及控制器 - Google Patents

一种基于流表的表项寻址方法、交换机及控制器 Download PDF

Info

Publication number
WO2015074182A1
WO2015074182A1 PCT/CN2013/087434 CN2013087434W WO2015074182A1 WO 2015074182 A1 WO2015074182 A1 WO 2015074182A1 CN 2013087434 W CN2013087434 W CN 2013087434W WO 2015074182 A1 WO2015074182 A1 WO 2015074182A1
Authority
WO
WIPO (PCT)
Prior art keywords
flow table
message
switch
storage index
index information
Prior art date
Application number
PCT/CN2013/087434
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/CN2013/087434 priority Critical patent/WO2015074182A1/zh
Priority to EP13897999.2A priority patent/EP3059906B1/en
Priority to CN201380002319.1A priority patent/CN105052087B/zh
Publication of WO2015074182A1 publication Critical patent/WO2015074182A1/zh
Priority to US15/157,791 priority patent/US10015095B2/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/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/34Signalling channels for network management communication
    • H04L41/342Signalling channels for network management communication between virtual entities, e.g. orchestrators, SDN or NFV entities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0823Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
    • H04L41/083Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability for increasing network speed
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/64Routing or path finding of packets in data switching networks using an overlay routing layer
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering
    • H04L45/7452Multiple parallel or consecutive lookup operations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/30Peripheral units, e.g. input or output ports
    • H04L49/3009Header conversion, routing tables or routing tags
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/35Switches specially adapted for specific applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields

Definitions

  • the present application relates to the field of communications technologies, and in particular, to a flow table based entry addressing method, a switch, and a controller. Background technique
  • Each device consists of an internal packet forwarding module and various protocol control modules. This distributed control module deployment method makes the deployment and management of the network very complicated. In order to implement a certain control parameter modification or upgrade, the network operator must perform separate operations for each device.
  • the industry has proposed the concept of Software Defined Network (SDN).
  • SDN decouples the control logic and the forwarding function of the network element, and centrally deploys the control logic, so that the control and maintenance of the network can be realized by the operation of the control plane device, thereby improving the management efficiency of the network.
  • the forwarding plane device is more simplified, which is beneficial to the high performance and reusability of the forwarding device.
  • the current SDN concept is being widely applied to data center networks and telecommunications networks.
  • the Openflow protocol is the most typical and widely used protocol in SDN networks.
  • the network elements in the Openflow protocol include an Openflow controller (OF Controller, the following controller) and an Openflow switch (OF Switch, the following is called a switch), where the controller is responsible for packet characteristics (such as IP quintuple, Ethernet).
  • the frame header, the virtual local area network ID, and the like) determine the forwarding action of the service flow (such as forwarding, discarding, modifying the packet header, encapsulation, decapsulation, etc.), and passing the corresponding flow rule (including the flow matching information (such as IP five)
  • the tuple, the Ethernet frame header, and the like, and the corresponding action are sent to the switch.
  • the switch obtains and stores the flow rule, and performs the corresponding action on the subsequent packets that meet the flow rule, so as to implement packet forwarding or processing.
  • the basic flow of the flow rule is shown in Figure la:
  • the controller sends the flow entry to the switch through the Flow_Mod message.
  • the flow entry includes a flow match and a corresponding action.
  • the flow matching information includes a combination of any of the information of the Ethernet frame header, the IP header information, or the TCP/UDP port number, and the processing action includes the processing type and related parameters. Processing types such as forwarding, discarding, modifying, encapsulating, and so on.
  • the controller can send the flow entry belonging to different flow tables to the switch through multiple Flow_Mod messages. In Figure la, the controller sends the flow entries of the two tables to the switch.
  • step 2 that is, the switch stores (installs) all flow entries and processing actions into the corresponding flow table.
  • step 3 is performed, that is, when the user packet arrives, the switch performs multi-level flow table matching, and performs serial processing on the packet according to the processing action corresponding to the matched flow entry.
  • multi-level flow table matching and processing please refer to Figure lb:
  • the packet enters the switch from an input port.
  • the switch uses the flow table entry of table 0 (tableO) to match the packet. If a flow entry is matched, the packet is processed according to the flow entry. If there are multiple instructions in a flow table entry, they are executed in a certain order (goto-table final execution). If there is a Goto-Table in the instruction, it is sent to the next flow table, and the next flow table further matches the message. Or metadata, for subsequent instruction processing. If there is no goto-table in the instruction, it means that the pipeline needs to be exited, then the switch performs a set of processing actions for saving actions, and the set includes packet modification, forwarding to a port or discarding Wait for the action.
  • table 0 table 0
  • a flow data entry is provided by means of metadata matching.
  • the controller generates matching metadata in the flow table 2.
  • Each entry in the flow table 1 is added with a write metadata command.
  • the entries of the flow table 1 are matched.
  • the corresponding metadata and the message are transmitted to the flow.
  • Table 2 the flow table 2 matches the corresponding metadata, and after the matching is successful, the corresponding instruction is executed.
  • the applicant finds that the method for addressing the flow entry is implemented by means of metadata matching in the prior art, and one way is to perform matching by metadata content. Find, this requires a proprietary hardware implementation, so the cost is higher; the other way is to hash the metadata, get the index of the table in the latter table, this way Need to do another hash operation, and also solve the problem of hash operation conflicts (hash operation conflict, which means that the same value is obtained after hash operation for different metadata), which makes the hash operation less efficient (additional hash operation) And the operation is complicated (additional processing is required for hash conflicts). Therefore, in the prior art, there is a technical problem that the use of metadata matching causes the flow entry to be less efficient, and the operation of matching the flow entry is more complicated and costly. Summary of the invention
  • the present invention provides a flow table-based addressing method, a switch, and a controller, which are used to solve the problem of low efficiency of flow entry matching using metadata matching in the prior art, and the flow entry matching The operation is more complicated technical problem.
  • the first aspect of the present application provides a method for addressing an entry based on a flow table, including: the switch receives a message; the switch matches the packet based on a pre-flow table; after the matching is successful, the switch is based on The storage indexing instruction in the matching flow table entry is sent to the lower-level flow table, and the storage index information is corresponding to the flow entry in the lower-level flow table, and The write storage index instruction is sent by the controller; the switch directly addresses the flow entry corresponding to the storage index information in the lower-level flow table based on the storage index information.
  • the method further includes: the switch receiving, by the controller, the carrying the write storage index instruction The matching successful flow entry, the parameter of the write storage index instruction includes the storage index information.
  • the switch receives, by the switch, the matching that is sent by the controller and that carries the write storage index instruction Before the successful flow entry, the switch further includes: the switch receiving, by the controller, a message for generating or modifying a flow entry for the lower-level flow table; the message carrying a return storage index indication; The return storage index indicates that the storage index information corresponding to the flow entry of the lower-level flow table is sent to the controller.
  • the write storage index instruction is specifically: The operation instruction is defined; or the metadata instruction is written; the storing the index information with the message to the lower-level flow table is specifically: writing the storage index information in a fixed bit of the metadata, and The message is sent to the lower level flow table.
  • the storage index information includes address information of a flow entry of the lower-level flow table, or address information of a flow entry of the lower-level flow table, and a flow table identifier of the lower-level flow table.
  • the flow table identifier of the lower-level flow table is specifically generated by the switch or the controller.
  • the switch sends a flow entry release message to the controller, and notifies the controller that the flow entry in the lower-level flow table needs to be released;
  • the switch locks the flow entry in the lower-level flow table
  • the switch sends a delete response message to the controller after the deletion is completed
  • the switch releases the locking of the flow entry in the lower-level flow table based on the release response message.
  • the switch when the switch locks the flow entry in the lower-level flow table, the switch further includes:
  • the switch discards the message; or The switch sends a message message to the controller, where the message carries the cause value of the message, the storage index information, and the storage index information being invalid.
  • the second aspect of the present application provides a method for addressing an entry based on a flow table, including: the controller sending a first message for generating or modifying a flow entry for a lower-level flow table to a switch, where the first message carries a return And storing, by the controller, storage index information of a flow entry of the lower-level flow table returned by the switch according to the return storage index indication; the controller sending a flow table that modifies or creates a pre-flow table
  • the second message of the item is sent to the switch, where the second message carries a write storage index instruction, where the parameter of the write storage index instruction includes the storage index information, so that the switch can be based on the storage index
  • the information directly addresses the flow entry corresponding to the storage index information in the lower-level flow table.
  • the write storage index instruction is specifically: a newly defined operation instruction; or a write metadata instruction; the storage index information is written in the element In the fixed bits of the data.
  • the storing index information includes address information of a flow entry of the lower-level flow table, Or the address information of the flow entry of the lower-level flow table and the flow table identifier of the lower-level flow table.
  • the flow table identifier of the lower-level flow table is specifically generated by the switch or the controller.
  • the method further includes: the controller receiving a flow table release message sent by the switch; The flow table release message, sending a delete message to the switch, so that the switch can delete the write index instruction in other flow entry using the storage index information based on the delete message; The deletion response information sent by the switch, the deletion response information indicates that the switch has been deleted; the controller generates and sends a release response message to the switch based on the deletion response information, so that the switch is released.
  • Flow in the lower flow table The locking of the entry.
  • the method further includes: The device receives a message message sent by the switch, where the message message carries a reason value of the message, the storage index information, and the storage index information is invalid.
  • a third aspect of the present application provides a switch, including:
  • a first receiving unit configured to receive a message
  • a matching unit configured to match the packet according to the pre-flow table
  • a processing unit configured to: after the matching succeeds, the write storage in the flow entry that is successfully matched
  • the indexing instruction sends the storage index information to the lower-level flow table along with the packet, where the storage index information corresponds to the flow entry in the lower-level flow table, and the write storage index instruction is sent by the controller. And directly addressing the flow entry corresponding to the storage index information in the lower-level flow table based on the storage index information.
  • the method further includes: a second receiving unit, configured to receive, by the controller, the matching that carries the write storage index instruction The flow entry, the parameter of the write storage index instruction includes the storage index information.
  • the method further includes: a first sending unit, where the second receiving unit is further configured by the switch to receive the controller Sending a message for generating or modifying a flow entry for the lower-level flow table; the message carries a return storage index indication; the first sending unit is configured to: according to the return storage index indication, the lower-level flow table The storage index information corresponding to the flow entry is sent to the controller.
  • the write storage index instruction is specifically And the processing unit is configured to write the storage index information in a fixed bit of the metadata, and send the information to the lower-level flow table along with the information.
  • the second transmitting unit and the third receiving unit are configured to send a flow entry release message to the controller, to notify the controller that the flow entry in the lower-level flow table needs to be released;
  • the processing unit is further configured to lock a flow entry in the lower-level flow table
  • the third receiving unit is configured to receive a delete message generated by the controller based on the release message, and delete the write index instruction in another flow entry that uses the storage index information;
  • the second sending unit is further configured to send a delete response message to the controller after the deletion is completed;
  • the third receiving unit is further configured to receive a release response message generated by the controller based on the deletion response message;
  • the processing unit is further configured to cancel the locking of the flow entry in the lower-level flow table based on the release response message.
  • the processing unit is further configured to discard the flow entry in the lower-level flow table.
  • the packet, or the second sending unit is further configured to send a message message to the controller, where the message message carries the cause value of the message, the storage index information, and the storage index information is invalid. .
  • a fourth aspect of the present application provides a switch, including:
  • the interface is configured to receive a message, and the processor is configured to match the packet according to the pre-flow table. After the matching is successful, the index information is stored according to the write storage index instruction in the matching successful flow entry. And sending, to the lower-level flow table, the storage index information corresponding to the flow entry in the lower-level flow table, where the write storage index instruction is sent by the controller; The index information directly addresses the flow entry corresponding to the storage index information in the lower-level flow table.
  • the method further includes: a receiver, configured to receive, by the controller, the matching successful flow table that carries the write storage index instruction
  • the parameter of the write storage index instruction includes the storage index information.
  • the device further includes a transmitter, where the receiver is further configured to receive, by the controller, a message for generating or modifying a flow entry of the current flow table; the message carrying a return storage index indication; the sender is specifically configured to: according to the return storage index indication, correspond to a flow entry of the lower flow table The storage index information is sent to the controller.
  • the write storage index instruction is specifically The metadata instruction
  • the processor is specifically configured to write the storage index information in a fixed bit of the metadata, and send the message to the lower-level flow table.
  • the device further includes a transmitter and a receiver, where the transmitter is configured to send a flow entry release message to the controller, to notify the controller The flow entry in the lower-level flow table needs to be released, and the deletion response message is sent to the controller after the deletion is completed;
  • the receiver is configured to receive the deletion message generated by the controller based on the release message, and Receiving a release response message generated by the controller based on the deletion response message;
  • the processor is further configured to: after the sender sends the flow entry release message, lock a flow entry in the lower-level flow table And deleting, after the receiver receives the deletion message, the write index instruction in another flow entry that uses the storage index information; and releasing the lower-level flow table after the receiver receives the release response message The lock of the flow entry in .
  • the processor when the switch locks the flow entry in the lower-level flow table, the processor further uses The packet is discarded, or the sender is further configured to send a message to the controller, where the message carries the packet, the storage index information, and the reason why the storage index information is invalid. value.
  • the fifth aspect of the present application further provides a controller, including:
  • a sending unit configured to send a first message for generating or modifying a flow entry for the lower-level flow table to the switch, where the first message carries a return storage index indication; and is further configured to send a flow table that modifies or creates the pre-flow table
  • the second message of the item is sent to the switch, where the second message carries a write storage index instruction
  • the receiving unit is configured to receive, by the switch, a flow entry of the lower-level flow table returned by the switch according to the return storage index indication Storage index information; wherein the parameter of the write storage index instruction includes the storage index information to enable the switch to be based on the storage index information
  • the flow table entry corresponding to the storage index information is directly addressed in the lower-level flow table.
  • the receiving unit is further configured to: receive a flow table release message sent by the switch, and receive the deletion response information sent by the switch, where Deleting the response information to indicate that the switch has been deleted; the sending unit is further configured to: send a delete message to the switch based on the flow table release message, so that the switch can delete the use according to the delete message.
  • the receiving unit is further configured to receive a packet message that is sent by the switch, where the packet message is The reason value of carrying the message, the storage index information, and the storage index information is invalid.
  • a sixth aspect of the present application provides a controller, including:
  • a sender configured to send a first message for generating or modifying a flow entry for the lower-level flow table, where the first message carries a return storage index indication; and is further configured to send a flow table that modifies or creates a pre-flow table
  • the second message of the item is sent to the switch, where the second message carries a write storage index instruction, and the receiver is configured to receive a flow entry of the lower-level flow table returned by the switch according to the return storage index indication Storage index information; wherein the parameter of the write storage index instruction includes the storage index information to enable the switch to directly address the storage index information in the lower-level flow table based on the storage index information Corresponding flow entry.
  • the receiver is further configured to: receive a flow table release message sent by the switch, and receive a deletion response message sent by the switch, where Deleting the response information to indicate that the switch has been deleted; the transmitter is further configured to: send a delete message to the switch based on the flow table release message, so that the switch can delete the use according to the deletion message.
  • the receiver is further configured to receive a packet message sent by the switch, where the packet message carries a packet, the storage index information, and a cause value of invalidation of the storage index information.
  • the switch receives a packet; the switch matches the packet based on the pre-flow table; after the matching succeeds, the switch stores the index information along the packet based on the write storage index instruction in the matching matching flow entry.
  • the information is sent to the lower-level flow table, where the storage index information corresponds to the flow entry in the lower-level flow table, and the write storage index instruction is sent by the controller; the switch directly addresses the storage index information in the lower-level flow table based on the storage index information. Corresponding flow entry.
  • the flow entry of the pre-flow table has a write storage index instruction, and based on the write storage index instruction, the storage index information can be sent along with the packet to the lower-level flow table, then
  • the lower-level flow table may directly locate the flow entry corresponding to the storage index information according to the storage index information, and does not need to perform content matching or hash operation in the lower-level flow table. Addressing, so it can solve the technical problems caused by the use of metadata matching, such as low efficiency and complicated operation and high cost. It can improve the processing speed of packets and reduce the technical effect of packet processing delay, so that the open flow switch can achieve more. High wire speed 4 ⁇ text forwarding and lower equipment costs.
  • Figure la- ⁇ lc is a schematic diagram of a flow table based entry addressing method in the prior art
  • FIG. 2 is a flow chart of a method for addressing an entry based on a flow table on a controller side according to an embodiment of the present application
  • FIG. 3 is another schematic diagram of a flow of a method for addressing an entry based on a flow table on a switch side according to an embodiment of the present disclosure
  • FIG. 4 is another schematic diagram of a flow of a method for addressing an entry based on a flow table on a switch side according to an embodiment of the present disclosure
  • FIG. 5 is a schematic diagram of a specific example of a method for addressing an entry based on a flow table according to an embodiment of the present application
  • FIG. 6 is a schematic diagram of a specific example of a method for addressing an entry based on a flow table according to another embodiment of the present application
  • FIG. 7 is a schematic diagram of a specific example of a method for addressing an entry based on a flow table in still another embodiment of the present application.
  • FIG. 8 is a flowchart of a method for releasing a flow entry on a switch side according to an embodiment of the present disclosure
  • FIG. 9 is a flowchart of a method for releasing a flow entry on a controller side according to an embodiment of the present invention.
  • FIG. 10 is a schematic diagram of a specific example of releasing a flow entry in an embodiment of the present application;
  • FIG. 11 is a functional block diagram of a switch in Embodiment 2 of the present application.
  • FIG. 12 is a conceptual diagram of an example of hardware implementation of a switch in Embodiment 3 of the present application.
  • FIG. 13 is a functional block diagram of a controller in Embodiment 4 of the present application.
  • FIG. 14 is a conceptual diagram of an example of a hardware implementation of a controller in Embodiment 5 of the present application. detailed description
  • the embodiment of the present application provides a flow table-based entry method, a switch, and a controller, which are used to solve the problem that the flow entry of the flow entry is low in efficiency and the flow entry is Matching operations are more complex technical issues.
  • the switch receives a packet; the switch matches the packet based on the pre-flow table; after the matching succeeds, the switch succeeds based on the matching.
  • the storage index instruction in the flow entry is sent to the lower-level flow table by the storage index information, where the storage index information corresponds to the flow entry in the lower-level flow table, and the write storage index instruction is the controller.
  • the switch sends the flow entry corresponding to the storage index information directly in the lower-level flow table based on the storage index information.
  • the flow entry of the pre-flow table has a write storage index instruction, and based on the write storage index instruction, the storage index information can be sent along with the packet to the lower-level flow table, then
  • the lower-level flow table can directly locate the flow entry corresponding to the storage index information according to the storage index information, and does not need to perform content matching or hash operation in the lower-level flow table. Addressing, so it can solve the technical problems caused by the use of metadata matching and the complexity of operation
  • the problem is that the processing speed of the packet is improved and the technical effect of the packet processing delay is reduced, so that the open flow switch can achieve higher line rate packet forwarding and lower equipment cost.
  • This embodiment provides a flow table-based table entry addressing method.
  • FIG. 2 it is a flow chart of a flow table-based entry addressing method in the embodiment. The method includes:
  • Step 101 The controller sends a first message to the switch for generating or modifying the flow entry of the lower-level flow table, where the first message carries a return storage index indication.
  • Step 102 The controller receives storage index information of the flow entry of the lower-level flow table returned by the switch based on the return storage index indication.
  • Step 103 The controller sends a second message that modifies or creates a flow entry of the pre-flow table to the switch, where the second message carries a write storage index instruction, and the parameter that writes the storage index instruction includes storing index information, so that The switch can directly address the flow entry corresponding to the storage index information in the lower-level flow table based on the storage index information.
  • the flowchart of the flow table-based entry addressing method on the switch side in this embodiment is as follows. As shown in Figure 3, the method includes:
  • Step 201 The switch receives the generated or modified flow entry for the lower-level flow table sent by the controller.
  • the first message the first message carries a return storage index indication
  • Step 202 The switch installs the flow entry of the lower-level flow table and sends the storage index information of the flow entry based on the lower-level flow table generated by the return storage index indication to the controller.
  • Step 203 The switch receives a second message that is sent by the controller to modify or create a flow entry of the pre-flow table, where the second message carries a storage index instruction, and the parameter that is written into the storage index instruction includes storage index information, so that the switch The flow entry corresponding to the storage index information can be directly addressed in the lower-level flow table based on the storage index information;
  • Step 204 Install a flow entry of the pre-flow table.
  • the controller first performs step 101, that is, the controller sends a first message to the switch for generating or modifying a flow entry for the lower-level flow table, where the first message carries the return storage. Index indication. Further, the first message may further include matching content. When the storage index information is directly indexed, content matching is not required, and when the current flow table is directly indexed without using the storage index information, the content matching manner may still be implemented. Item addressing.
  • the concepts of the lower-level flow table and the pre-flow table appearing in the embodiment of the present application are in the order of matching, and the first matching is the pre-flow table, and the pre-flow table is out of the pre-flow table.
  • the flow table is processed, so the lower flow table and the pre-flow table here are a relative concept, not an absolute one; of course, in actual use, it may also be an actual lower flow table and a higher flow table, for example, according to The layer of the protocol layer is distinguished.
  • the processing of the data link layer is the upper-level flow table, and the processing for the protocol layer is the lower-level flow table.
  • the lower-level flow table refers to a flow table that further processes the packet after the pre-flow table, such as the pre-flow table 1, the sub-flow table 2, and the entry index.
  • the switch performs step 201, that is, receives the first message, and when the switch receives the first message, step 202 is performed, that is, the flow entry of the lower-level flow table is installed and/or modified, and according to the first
  • the return storage index in the message indicates that the storage index of the flow entry of the lower-level flow table is generated.
  • Information and store the storage index information to the controller.
  • the storage index information may be the address information of the flow entry, for example, a memory location where the flow entry is stored, or an offset for the start memory location of the lower flow table; further, for two When the direct index is used, the storage index information includes the flow table identifier of the lower-level flow table.
  • the flow table identifier may be generated by the flow table and returned to the controller, or may be generated by the controller, and the switch only needs to return the address information.
  • the storage index information may be other information, as long as the storage index information can be directly indexed to the corresponding flow entry.
  • the flow entry generation message is a non-response message, so in the embodiment of the present application, a response message is newly defined to return the storage index information to the controller.
  • the controller performs step 102, that is, receiving the storage index information returned by the switch, and after receiving the storage index information, performing step 103, that is, sending a second message of modifying or creating a flow entry of the pre-flow table to the switch
  • the second message carries a write storage index instruction, and the parameter for writing the storage index instruction includes storing index information, so that the switch can directly address the flow entry corresponding to the storage index information in the lower flow table based on the storage index information.
  • the second message also carries matching content and instructions.
  • the write storage index instruction may specifically be a newly defined operation instruction, or may reuse existing metadata (metedata) to transfer the storage index information, so the existing write metadata instruction may be used, When avoiding interference with other flow tables that use metadata matching, format the metadata, and specify certain bits of the metadata for direct indexing, such as using 0 to 7 bits in the metadata to store the stored index information.
  • metadata metadata
  • the switch performs step 203, that is, receives the second message, and then performs step 204 to install a flow entry of the pre-flow table.
  • FIG. 4 it is a flowchart of the method for addressing the entries in the embodiment of the present application, where the method includes :
  • Step 301 The switch receives a message.
  • Step 302 The switch matches 4 ⁇ based on the pre-flow table.
  • Step 303 After the matching is successful, the switch sends the storage index information to the lower-level flow table according to the write storage index instruction in the matching flow entry, where the storage index information corresponds to the flow in the lower-level flow table.
  • the entry, and the write storage index instruction is sent by the controller;
  • Step 304 The switch directly addresses the flow entry corresponding to the storage index information in the lower-level flow table based on the storage index information.
  • step 301 after receiving the packet, the packet arrives at the pre-flow table, and step 302 is performed, that is, the packet is matched based on the pre-flow table, where content matching or metadata matching may be performed.
  • step 302 the storage index information is sent to the lower-level flow table along with the packet according to the write storage index instruction in the flow entry, for example, by the goto table instruction.
  • step 304 When the packet arrives at the lower-level flow table, it is found that it carries the storage index information, and the table entry is directly addressed according to the storage index information, that is, step 304 is executed, and the instruction is executed.
  • the method further includes: the lower flow table determining whether the storage index information is generated by itself, if Yes, step 304 is performed. Therefore, it is possible to avoid direct execution of the flow table error and execute the wrong instruction.
  • it is determined whether the storage index information is generated by itself, and may be determined according to the flow table identifier in the storage information.
  • the controller may send the indication information to the switch, and configure a flow table to not use the direct index, then the flow table that does not use the direct index is in the When the message is received, it is not necessary to judge, but the matching operation is directly performed, that is, step 302 is performed again, and when the message reaches the lower-level flow table using the direct index, step 304 is performed.
  • a two-level flow table is included, where Table 1 uses a direct index, and the method includes:
  • Step 401 The controller sends a flow table modification message to the table 1, where the message indicates that a new flow table entry (OFPFC_ADD) is generated, the message further includes a return storage index indication, and further includes matching content, so that the direct index is not used. When the content is matched, correspondingly, the instruction is also included;
  • the format of the message is, for example, Flow Table Mod (OFPFC_ADD, return index flag, match, instructions);
  • Step 402 According to the return storage index indication in step 401, the table 1 feeds back a flow table modification response message to the controller, and feeds back the stored index information, such as the address information of the flow entry described in the foregoing message; For example, Flow Table Mod ack (return index);
  • Step 403 The controller sends a message for modifying or creating a flow entry to the table 0.
  • the controller further carries a write storage index instruction, where the parameter for storing the index instruction includes the storage index information returned in step 402.
  • the format of the message is Flow Table Mod (OFPFC_ADD/mod, match, write index(index), other instructions);
  • Step 404 The message arrives at the table 0;
  • Step 405 Perform a matching operation. After matching a flow entry, perform each instruction in the flow entry, including sending a parameter (storage index information) along with the message according to the write storage index instruction.
  • the lower flow table, that is, the table 1, is step 406;
  • Step 407 After the packet arrives in the table 1, the table 1 finds that it carries the storage index information, and directly indexes the flow entry according to the storage index information; further, executes each instruction in the flow entry.
  • the controller instructs the switch to return the lower-level flow entry storage index information, and updates the information to the flow entry of the pre-flow table. After the current flow table is successfully matched, the storage index information is transmitted to the switch.
  • the lower-level flow table can directly address the flow entry by storing the index information, thereby avoiding the problem of inefficient or complicated operation caused by addressing the flow entry through the metadata matching.
  • Table 2 and Table 3 use direct indexes
  • Table 0 and Table 1 use content matching.
  • the method includes:
  • Step 501 The step is optional.
  • the controller may use a multi-part message to indicate that the direct index is not used in the table 1 to prevent the packet carrying the index information from interfering with the normal processing of the table 1, that is, when the packet arrives in the table 1, the table 1 It is not necessary to determine whether the storage index information is generated by itself, and the efficiency of message processing can be improved; when the step is not executed, when the processing in Table 1 is performed, a step of determining is added before step 511 to determine whether the storage index information 1 is stored. Generated by itself.
  • the format of the message may be specifically Multipart(OFPMP_TABLE_FEATURES not use index).
  • Step 502 The controller sends a flow entry modification message to the table 2, where the message indicates that a new flow entry (OFPFC_ADD) is generated, the message further includes a return storage index indication, and further includes matching content, which is convenient for not directly using When indexing, the content is matched, and correspondingly, the instruction is also included; the format of the message is, for example, Flow Table Mod (OFPFC_ADD, return index flag, match, instructions).
  • OFPFC_ADD Flow Table Mod
  • Step 503 According to the return storage index indication in step 502, the table 2 feeds back a flow table modification response message to the controller, and feeds back the stored index information, such as the address information of the flow entry described in the foregoing message; For example, Flow Table Mod ack (return indexl).
  • the table 2 feeds back a flow table modification response message to the controller, and feeds back the stored index information, such as the address information of the flow entry described in the foregoing message; For example, Flow Table Mod ack (return indexl).
  • Step 504 Similar to step 502, the controller sends a flow entry modification message to the table 3, where the message indicates a flow entry (OFPFC_ADD) of the generated information, the message further includes a return storage index indication, and may further include matching content, which is convenient. When the direct index is not used, the content matching is performed, and correspondingly, the instruction is included; the format of the message is, for example, Flow Table Mod (OFPFC_ADD, return index flag, match, instmctions).
  • OFPFC_ADD flow entry
  • the message further includes a return storage index indication, and may further include matching content, which is convenient.
  • the format of the message is, for example, Flow Table Mod (OFPFC_ADD, return index flag, match, instmctions).
  • Step 505 According to the return storage index indication in step 504, the table 3 feeds back a flow table modification response message to the controller, and feeds back storage index information, such as the address information of the flow entry described in the foregoing message; format of the message. For example, Flow Table Mod (return index2).
  • Step 506 The controller sends a message to modify or create a flow entry to the table 0.
  • the controller further carries a write storage index instruction, where the parameter for storing the index instruction includes the storage index information 1 returned in step 503.
  • the parameter further includes a flow table identifier of the flow table that generates the storage information, so in the embodiment, storing the index information includes storing the index information.
  • the controller also issued a go to table 1 (goto table 1) indication, the format of the message is Flow Table Mod (OFPFC_ADD / mod, match, write index (index 1 , table ID 2) , other instructions , goto table 1).
  • Flow Table Mod OFPFC_ADD / mod, match, write index (index 1 , table ID 2) , other instructions , goto table 1).
  • Step 507 The controller sends a message for modifying or creating a flow entry to the table 1.
  • the controller further carries a write storage index instruction, where the parameter storing the index instruction includes the storage index information 2 returned in step 505.
  • the parameter further includes a flow table identifier of the flow table that generates the storage information. Therefore, in this embodiment, the storage index information includes the storage index information 2 and the flow table identifier.
  • the controller also sends a table to the table. 2 (goto table 2) indicates that the format of the message is Flow Table Mod (OFPFC_ADD/mod, match, write index(index 2, table ID 3), other instructions, goto table 2).
  • Step 508 The message arrives at the table 0.
  • Step 509 Perform matching based on the table 0.
  • Flow Table 1 (specified by the goto table 1 instruction).
  • step 512 is executed, that is, according to the write storage index instruction in step 507, the parameters (the storage index information 2 and the flow table identification table 3) are sent to the lower flow table 2 together with the message.
  • the storage index information added in this step and the storage index information added in step 510 are superimposed, that is, they are not overwritten.
  • the flow table 2 finds that the packet carries the storage index information, and performs step 513 to determine whether the index is generated by itself according to the flow table identifier generated by the packet and generated by itself. Then, according to the storage index information, the table entry is directly addressed and the instruction is executed. In the embodiment, the result of the judgment is that the storage index information 1 is generated by the table 2, so the flow entry is directly addressed according to the storage index information 1, and Further execution of the instructions. Then, in step 514, the message is sent to the flow table 3. At this time, the storage index information 2 and the flow table identification table 3 are sent together.
  • the flow table 3 finds that it carries the storage index information, and performs step 515 to determine whether the index is generated by itself according to the flow table identifier generated by the packet and generated by itself. Then, according to the storage index, the table entry is directly addressed and the instruction is executed. In this embodiment, the result of the judgment is that the storage index information 2 is generated by the table 3, so the flow entry is directly addressed according to the storage index information 2, and further Execute the instruction.
  • the write storage index instruction uses the newly defined operation instruction.
  • An embodiment of the reuse write metadata instruction will be described below. Referring to FIG. 7, the method package is shown. Includes:
  • Step 601 The controller indicates, by using the multi-part message, that the flow table 1 uses the fixed bits in the metadata as the storage index information, and uses the 0 to 7 bits in the metadata to transmit the index information for the embodiment. In fact, this also constrains that the flow table can only use 256 flow entries (2 to the 8th power).
  • the controller can determine the occupied bits according to the number of flow table entries supported by the flow table. For example, if the flow table 1 uses 1000 entries, it is allocated 10 bits.
  • the format of the message can be Multipart(OFPMP_TABLE_FEATURES metedata_index 0-7bit).
  • Step 602 The controller indicates, by using the multi-part message, that the flow table 2 uses the fixed bit in the metadata as an index, and uses the 8 to 15 bits in the metadata to transmit the index information for the embodiment. It should be noted that different flow tables using direct indexes do not overlap the configured bits.
  • the format of this message can be Multipart(OFPMP_TABLE_FEATURES metedata_index 8 - 15bit).
  • Step 603 The controller sends a flow entry modification message to the flow table 1, where the message indicates a flow entry (OFPFC_ADD) of the generated information, and the message also has a return storage index indication.
  • the storage index information cannot exceed the bit range limit configured in step 601, and cannot exceed 255 for this embodiment.
  • the format of the message can be Flow Table Mod ( OFPFC_ADD , return index flag , instructions).
  • Step 604 After generating the flow entry, the flow table 1 returns the corresponding storage index information XI according to the instruction of step 603.
  • the format of the message can be Flow Table Mod ack ( return index Xl).
  • Step 605 The controller sends a flow entry modification message to the flow table 2, where the message indicates a flow entry (OFPFC_ADD) of the generated information, and the message also has a return storage index indication.
  • the storage index information cannot exceed the bit range limit configured in step 602, and cannot exceed 255 for this embodiment.
  • the format of the message can be Flow Table Mod ( OFPFC_ADD , return index flag , instructions).
  • Step 606 After generating the flow entry, the flow table 2 returns the corresponding storage index information Y1 according to the instruction of step 605.
  • the format of the message can be Flow Table Mod ack ( return index Yl).
  • Step 607 The controller sends a new entry to the flow table 0 or modifies the message of the original entry.
  • the write metadata command is sent, and the step 604 and the step 606 are returned.
  • the storage index information XI and the storage index information Y1 are written to specific bits in the metadata. This process does not require the extension of the open flow protocol, which can be done using existing mechanisms. It should be noted that, compared to the embodiment of FIG. 6, since a specific bit has been defined for direct indexing of a particular flow table, there is no need to additionally write a flow table identifier that generates storage index information in the metadata.
  • Step 608 the message arrives at the table 0, and then step 609 is performed, that is, the matching operation is performed.
  • step 610 is executed, and the parameter is written into the fixed bit of the metadata according to the write metadata instruction. The bit is sent to the lower flow table 1 along with the message.
  • the step 611 is executed, that is, the fixed bit of the metadata is used.
  • the value in the 0-7 bit directly indexes the flow entry, and the instruction of the flow entry is further executed.
  • step 612 is executed to send the message and the metadata to the table 2.
  • step 613 is executed, that is, the fixed bit in the metadata, that is, the 8-15 bit, is used, and the stream is directly indexed according to the value.
  • the flow entry of the pre-flow table has a write storage index instruction, and the storage index information can be sent along with the message according to the write storage index instruction.
  • the lower-level flow table can directly locate the flow entry corresponding to the storage information according to the storage index information, and does not need to perform content matching one by one in the lower-level flow table. Or addressing by hash operation, so that the technical problems caused by the use of metadata matching and the complexity of operation and high cost are solved, and the processing speed of the message is improved, and the technical effect of the packet processing delay is reduced. Open flow switches enable higher line rate packet forwarding and lower equipment costs.
  • the processing is different from the flow entry matching the content matching.
  • the flow table entry whose content matches, when it is released, its memory location can be immediately It is used by a new flow entry.
  • a packet matching the content of the original entry arrives, it will be processed according to the wildcard process because there is no matching flow entry, and no error will be caused.
  • the packet will be directly indexed to the new flow table. Item, and incorrectly execute the instruction corresponding to the new flow entry, and the error cannot be detected by the controller and the switch. Therefore, releasing a direct indexed flow entry requires a strict synchronization process. The following describes in detail the interaction process between the controller and the switch when the flow entry of the direct index is released.
  • Step 205 The switch sends a flow entry release message to the controller, and notifies the controller that the flow entry in the lower-level flow table needs to be released.
  • Step 206 The switch locks the flow entry in the lower-level flow table.
  • Step 207 The switch receives the delete message generated by the release message sent by the controller, and deletes the write index instruction in the other flow entry that uses the storage index information.
  • Step 208 The switch sends a delete response message to the controller after the deletion is completed.
  • Step 209 The switch receives the release response message generated by the controller based on the deletion response message.
  • Step 210 The switch cancels the locking of the flow entry in the lower-level flow table based on the release response message.
  • the method flowchart described in the controller side includes: Step 104: The controller receives a flow table release message sent by the switch.
  • Step 105 The controller releases the message based on the flow table, and sends a delete message to the switch, so that the switch can delete the write index command in the other flow entry that uses the storage index information based on the delete message.
  • Step 106 The controller receives the deletion response information sent by the switch, and deletes the response information to indicate that the switch has been deleted.
  • Step 107 The controller generates and sends a release response message to the switch based on the deletion response information, so that the switch unlocks the flow entry in the lower-level flow table.
  • Step 205 Send a flow entry release message to the controller, and notify the controller that the flow entry in the lower-level flow table needs to be released, and the release message may include storage index information or matching content of the flow entry, and is used by the controller to determine The flow entry to be released.
  • the switch further performs step 206 to lock the flow entry in the lower-level flow table until, in step 209, before the release response is received, the storage location of the locked flow entry cannot be used to store other New flow entry.
  • the switch When the flow entry is locked, if the packet reaches the lower-level flow table, the switch discards the packet; or the switch sends a packet message to the controller, where the packet message carries the packet, stores the index information, and stores The reason value for which the index information is invalid. If no message arrives during the lock, then this step is not performed.
  • step 104 the controller performs step 104, that is, receives the flow table release message sent by the switch, and then the controller performs step 105, that is, based on the flow table release message, sends a delete message to the switch, so that the switch can delete based on the delete message.
  • step 105 that is, based on the flow table release message, sends a delete message to the switch, so that the switch can delete based on the delete message.
  • the switch performs step 207, that is, receives the delete message, and deletes the write index instruction in other flow entry items using the storage index information.
  • the switch performs step 208, that is, sends a delete response message to the controller, to notify the controller that the deletion is complete, so that the controller can directly prevent step 107 from being executed, and the other possible flow entries may be deleted before the flow entry is completed.
  • the subordinate flow table will still be indexed to the error flow entry. Therefore, in this embodiment, the deletion response information is added, so that the controller knows exactly whether the switch is deleted or not.
  • step 107 is executed to generate and send a release response message to the switch based on the deletion response information, so that the switch unlocks the flow entry in the lower flow table.
  • the switch performs step 209, receives the release response information, and performs step 210 to release the lock of the flow entry in the lower-level flow table.
  • the controller further performs step 101 and sends a new message.
  • the memory location can be utilized again.
  • the method includes:
  • Step 701 Table 1 sends a flow table release message to the controller, where the message includes storage index information or matching content of the flow entry.
  • the format of the message can be Flow Table remove (index or match content).
  • Step 702 The switch locks the flow entry.
  • step 703 to the step 705 may be performed, that is, the table 1 receives the message and stores the index information, then step 704 is performed to index the locked flow entry, then the switch can
  • the controller sends a message, where the message may include a message, the storage index information, and a cause value of invalidation of the storage index information.
  • the format of the message may be Packet in (reason invalid index, index value, packet).
  • step 706 the controller executes step 706 to send a flow table modification message to the table 0, and the message indicates that the table 0 will delete the write index instruction in the flow entry using the storage index information, and the format of the message may be Flow Table Mod ( OFPFC_Mod/OFPFC_DELETE , Clear index).
  • Table 0 After the deletion is completed, Table 0 sends a flow table modification response message to the controller to notify the controller that the deletion has been completed.
  • the format of the message can be Flow Table mod ACK.
  • step 708 the controller executes step 708 to send a flow table release response message to Table 1 to notify the switch to perform step 709 to release the lock on the flow entry.
  • the format of the message can be Flow Table remove ACK.
  • control flow between the controller and the switch is such that when the flow entry is released, the instruction corresponding to the flow entry is not caused by the error, and the error processing of the packet is caused.
  • the switch includes: a first receiving unit 801, configured to receive a message; and a matching unit 802, configured to match the packet based on the pre-flow table.
  • the processing unit 803 is configured to: after the matching is successful, send the storage index information to the lower-level flow table according to the write storage index instruction in the matching flow entry, where the storage index information corresponds to the lower-level flow table.
  • the flow entry in the middle, and the write storage index instruction is sent by the controller; and the flow entry corresponding to the storage index information is directly addressed in the lower flow table based on the storage index information.
  • the switch further includes: a second receiving unit, configured to receive, by the controller, a matching flow entry that carries the write storage index instruction, and the parameter that writes the storage index instruction includes the storage index information.
  • the switch further includes a first sending unit, where the second receiving unit is further configured to receive, by the switch, a message that is generated by the controller for generating or modifying a flow entry for the lower-level flow table, where the message carries a return storage index indication.
  • the first sending unit is configured to display the index indication based on the return, The storage index information corresponding to the flow entry of the lower-level flow table is sent to the controller.
  • the write storage index instruction is specifically a write metadata instruction
  • the processing unit 803 is specifically configured to write the storage index information in a fixed bit of the metadata, and send the message to the lower-level flow table.
  • the switch further includes a second sending unit and a third receiving unit: the second sending unit is configured to send a flow entry release message to the controller, to notify the controller that the flow entry in the lower-level flow table needs
  • the processing unit 803 is further configured to: lock the flow entry in the lower-level flow table; the third receiving unit is configured to receive the deletion message generated by the release message generated by the controller, and delete the other flow entry that uses the storage index information.
  • the second sending unit is further configured to send a delete response message to the controller after the deletion is completed;
  • the third receiving unit is further configured to receive a release response message generated by the controller based on the delete response message; and the processing unit 803 It is also used to release the locking of the flow entry in the lower-level flow table based on the release response message.
  • the processing unit 803 is further configured to discard the message, or the second sending unit is further configured to send a message to the controller, where the message carries the packet, The reason value for storing index information and storing index information is invalid.
  • the storage index information includes the address information of the flow entry of the lower-level flow table, or the address information of the flow entry of the lower-level flow table, and the flow table identifier of the lower-level flow table.
  • the flow table identifier of the lower flow table is specifically generated by the processing unit 803 or the controller.
  • the various changes and specific examples in the flow table-based entry addressing method in the foregoing embodiments of FIG. 2 to FIG. 4 are also applicable to the switch in this embodiment, by using the foregoing flow table-based entry addressing method.
  • the implementation method of the switch in this embodiment can be clearly understood by those skilled in the art, so the details of the description are not detailed here.
  • FIG. 12 it is a conceptual diagram of a hardware implementation example of a switch.
  • the switch includes: an interface 901, configured to receive a message; and a processor 902, configured to be based on a pre-flow table.
  • the storage index information is sent to the lower-level flow table along with the write storage index instruction in the matching successful flow entry; wherein the storage index information corresponds to the lower-level flow table.
  • Flow entry, and the write storage index instruction is sent by the controller;
  • the storage index information directly addresses the flow entry corresponding to the storage index information in the lower-level flow table.
  • bus 900 can include any number of interconnected buses 900 and bridges, which will include one or more processors 902 represented by processor 902 and The various circuits of memory 906 represented by memory 906 are linked together.
  • the bus 900 can also link various other circuits, such as peripherals, voltage regulators, and power management circuits, as is well known in the art and, therefore, will not be further described herein.
  • the bus interface 905 provides an interface 901 between the bus 900 and the receiver 903, the transmitter 904.
  • Receiver 903 and transmitter 904 may be the same component, i.e., a transceiver, providing means for communicating with various other devices on a transmission medium.
  • the interface 901 is also used to output a message.
  • the processor 902 is responsible for managing the bus 900 and normal processing, and the memory 906 can be used to store data used by the processor 902 in performing operations, as well as to store flow tables.
  • the switch further includes: a receiver 903, configured to receive a successfully matched flow entry that is sent by the controller and that carries the write storage index instruction, where the parameter that is used to store the index instruction includes the storage index information.
  • the switch further includes a transmitter 904, where the receiver 903 is further configured to receive, by the controller, a message for generating or modifying a flow entry for the lower-level flow table; the message carries a return storage index indication; the transmitter 904 is specifically configured to be based on The storage index indication is returned, and the storage index information corresponding to the flow entry of the lower-level flow table is sent to the controller.
  • the write storage index instruction is specifically a write metadata instruction
  • the processor 902 is specifically configured to write the storage index information in a fixed bit of the metadata, and send the message to the lower-level flow table.
  • the switch further includes a transmitter 904 and a receiver 903, where the sender 904 is configured to send a flow entry release message to the controller, to notify the controller that the flow entry in the lower-level flow table needs to be released, and After the deletion is completed, the deletion response message is sent to the controller; the receiver 903 is configured to receive the release message generated by the controller based on the release message, and receive the release response message generated by the controller based on the deletion response message; the processor 902 is further configured to After the sender 904 sends the flow entry release message, the flow entry in the lower flow table is locked; and after the receiver 903 receives the delete message, the write index instruction in the other flow entry using the storage index information is deleted; Received at receiver 903 After the response message is released, the lock of the flow entry in the lower-level flow table is released.
  • the sender 904 is configured to send a flow entry release message to the controller, to notify the controller that the flow entry in the lower-level flow table needs to be released, and After the deletion is completed, the deletion response
  • the processor 902 when the switch locks the flow entry in the lower-level flow table, the processor 902 is further configured to discard the message, or the sender 904 is further configured to send the message to the controller, the message message.
  • the reason value for carrying the message, storing the index information, and storing the index information is invalid.
  • the storage index information includes the address information of the flow entry of the lower-level flow table, or the address information of the flow entry of the lower-level flow table, and the flow table identifier of the lower-level flow table.
  • the flow table identifier of the lower flow table is specifically generated by the processor 902 or the controller.
  • the switch in this embodiment may be a dedicated open flow switch or a switch that supports open flow.
  • Embodiment 4 is a diagrammatic representation of Embodiment 4:
  • the controller includes:
  • the sending unit 1001 is configured to send a first message for generating or modifying a flow entry for the lower-level flow table to the switch, where the first message carries a return storage index indication, and is further configured to send a flow entry that modifies or creates the pre-flow table.
  • the second message is sent to the switch, and the second message carries the write storage index instruction;
  • the receiving unit 1002 is configured to receive storage index information of the flow entry of the lower-level flow table returned by the switch based on the return storage index indication; wherein, the write storage
  • the parameter of the index instruction includes the storage index information, so that the switch can directly address the flow entry corresponding to the storage index information in the lower-level flow table based on the storage index information.
  • the write storage index instruction is specifically: a newly defined operation instruction; or a write metadata instruction; the storage index information is written in a fixed bit of the metadata.
  • the storage index information includes the address information of the flow entry of the lower-level flow table, or the address information of the flow entry of the lower-level flow table and the flow table identifier of the lower-level flow table.
  • the flow table identifier of the lower-level flow table is specifically generated by a processing unit of the switch or the controller.
  • the receiving unit 1002 is further configured to: receive a flow table release message sent by the switch, receive the delete response information sent by the switch, and delete the response information to indicate that the switch has been deleted;
  • the sending unit 1001 is further configured to: release the message according to the flow table, Sending a delete message to the switch, so that the switch can delete the write index instruction in the other flow entry that uses the storage index information based on the delete message; generate and send a release response message to the switch based on the delete response information, so that the switch releases the lower stream The lock of the flow entry in the table.
  • the receiving unit 1002 is further configured to receive a message message sent by the switch, the message message carrying the message, storing the index information, and storing the index information invalid cause value.
  • This embodiment provides a controller.
  • a block diagram of an example of hardware implementation of the controller may be used.
  • the controller may be an open flow controller.
  • the controller includes:
  • the sender 1101 is configured to send a first message for generating or modifying a flow entry for the lower-level flow table to the switch, where the first message carries a return storage index indication, and is further configured to send a flow entry that modifies or creates the pre-flow table.
  • the second message is sent to the switch, and the second message carries the write storage index instruction;
  • the receiver 1102 is configured to receive storage index information of the flow entry of the lower-level flow table returned by the switch based on the return storage index indication; wherein, the write storage
  • the parameter of the index instruction includes the storage index information, so that the switch can directly address the flow entry corresponding to the storage index information in the lower-level flow table based on the storage index information.
  • bus 1100 can include any number of interconnected buses 1100 and bridges, which will include one or more processors 1104 and memory 1105 represented by processor 1104. The various circuits of the representative memory 1105 are linked together.
  • the bus 1100 can also link various other circuits, such as peripherals, voltage regulators, and power management circuits, as is well known in the art, and therefore, this article does not Further description.
  • Bus interface 1103 provides an interface between bus 1100 and receiver 1102, and/or transmitter 1101.
  • Receiver 1102 and transmitter 1101 may be the same component, i.e., a transceiver, providing means for communicating with various other devices on a transmission medium.
  • the processor 1104 is responsible for managing the bus 1100 and the usual processing, and the processor 1104 is also used to determine flow table entries.
  • the memory 1105 can be used to store data used by the processor 1104 in performing the operations.
  • the processor 1104 can provide various functions including timing, peripheral interfaces, voltage regulation, power management, and other control functions.
  • the receiver 1102 is further configured to: receive a flow table release message sent by the switch, receive the delete response information sent by the switch, and delete the response information to indicate that the switch has been deleted;
  • the transmitter 1101 is further configured to: The table releases the message, and sends a delete message to the switch, so that the switch can delete the write index instruction in the other flow entry that uses the storage index information based on the delete message; generate and send a release response message to the switch based on the delete response information, so that the switch The lock on the flow entry in the lower-level flow table is released.
  • the receiver 1102 is further configured to receive a packet message sent by the switch, where the packet message carries the packet, stores the index information, and stores the index information invalid cause value.
  • the write storage index instruction is specifically: a newly defined operation instruction; or a write metadata instruction; the storage index information is written in a fixed bit of the metadata.
  • the storage index information includes the address information of the flow entry of the lower-level flow table, or the address information of the flow entry of the lower-level flow table and the flow table identifier of the lower-level flow table.
  • the flow table identifier of the lower flow table is specifically generated by the processor or processor 1104 of the switch.
  • the switch receives a packet; the switch matches the packet based on the pre-flow table; after the matching succeeds, the switch stores the index information along the packet based on the write storage index instruction in the matching matching flow entry.
  • the information is sent to the lower-level flow table, where the storage index information corresponds to the flow entry in the lower-level flow table, and the write storage index instruction is sent by the controller; the switch directly addresses the storage index information in the lower-level flow table based on the storage index information. Corresponding flow entry.
  • the flow entry of the pre-flow table has a write storage index instruction, and based on the write storage index instruction, the storage index information can be sent along with the packet to the lower-level flow table, then
  • the lower-level flow table can directly locate the flow entry corresponding to the storage index information according to the storage index information, and does not need to perform content matching one by one in the lower-level flow table, so the content can be solved.
  • embodiments of the present application can be provided as a method, system, or computer program product.
  • the application can take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware.
  • the application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本申请提供一种基于流表的表项寻址方法、交换机及控制器,该方法包括:交换机接收一报文;所述交换机基于前置流表匹配所述报文;在匹配成功后,所述交换机基于匹配成功的流表项中的写入存储索引指令,将存储索引信息随所述报文发送给下级流表;其中,所述存储索引信息对应于所述下级流表中的流表项,且所述写入存储索引指令是控制器发送的;所述交换机基于所述存储索引信息在所述下级流表中直接寻址所述存储索引信息对应的流表项。

Description

一种基于流表的表项寻址方法、 交换机及控制器
技术领域
本申请涉及通信技术领域, 尤其涉及一种基于流表的表项寻址方法、 交 换机及控制器。 背景技术
在目前的电信网络中, 存在着众多复杂的网络设备, 如路由器、 网关、 交换机、 防火墙和各类服务器等。 这些设备分别支持各类的网络协议, 从而 实现网元间的互联互通。 每一台设备都由内部的报文转发模块和各类协议控 制模块组成。 这种分布式的控制模块部署方式, 使得网络的部署和管理非常 复杂, 为了实施某个控制参数修改或升级, 网络操作员必须对每台设备进行 单独的操作。
为解决网元的部署灵活性和可管理性, 业界提出了软件定义网络(SDN ) 的概念。 SDN通过将网元的控制逻辑和转发功能解耦, 并将控制逻辑进行集 中部署, 使得对网络的控制和维护工作能够筒单的通过对控制面设备的操作 实现, 从而提高网络的管理效率, 并使得转发面设备更为筒单化, 有利于实 现转发设备的高性能和可重用性。 目前 SDN思想正在被广泛应用到数据中心 网络和电信网络中。 Openflow协议是 SDN网络中的最典型和应用最多的协议。
Openflow协议中的网元包括 Openflow控制器( OF Controller , 以下筒称控 制器)和 Openflow 交换机( OF Switch , 以下筒称交换机), 其中控制器负责 根据报文特征(如 IP五元组、 以太网帧头、 虚拟局域网 ID等)确定该业务流 的转发动作(如转发、 丟弃、 修改报文头、 封装、 解封装等), 并通过将对应 的流规则(包括流匹配信息(如 IP五元组、以太网帧头等 )和对应执行的动作 ) 下发给交换机。 交换机获取并存储该流规则, 对于后续符合该流规则的报文, 执行对应的动作, 从而实现报文的转发或处理。 其流规则下发的基本流程如 图 la所示: 其中, 在步骤 1中, 控制器将流表项通过 Flow_Mod (流表修改) 消息发 送给交换机,流表项包括流匹配内容( flow match )及对应的处理动作( actions )。 流匹配信息包括以太网帧头、 IP头信息或者 TCP/UDP端口号中任意信息的组 合, 处理动作包括处理类型及相关的参数。 处理类型如转发、 丟弃、 修改、 封装解封装等。 控制器可以通过多个 Flow_Mod消息将属于不同流表的流表项 下发给交换机。 在图 la中, 控制器向交换机分别发送了两个表的流表项。
然后执行步骤 2, 即交换机将所有流表项及处理动作存储(安装)到相应 的流表中。
接下来执行步骤 3 , 即当用户报文到来时, 交换机执行多级流表匹配, 并 根据匹配的流表项对应的处理动作对报文进行串行处理。 多级流表匹配和处 理过程请参考图 lb所示:
首先报文从某个输入端口进入交换机, 交换机先用表 0 ( tableO ) 的流表 项和报文进行匹配, 如果匹配上某个流表项后, 按照流表项的指令对报文进 行操作, 如果一个流表项里有多个指令, 则按照一定的顺序执行(goto-table 最后执行), 如果指令里有 Goto-Table , 则发往下一个流表, 下一个流表进一 步匹配报文或者元数据, 进行后续的指令处理, 如果指令里没有 goto-table则 说明需要退出流水线, 则交换机执行保存动作的处理动作集合, 该集合里包 含了报文修改, 转发到某个端口或者丟弃等动作。
现有技术中进一步为了提高流表项寻址的效率, 提供了一种通过元数据 匹配的方式来实现流表项寻址, 如图 lc所示, 控制器在流表 2里生成匹配元数 据的各表项, 在流表 1各表项里加入写入元数据指令, 当报文到达后, 匹配流 表 1的各表项, 匹配成功后, 将对应的元数据和报文传输到流表 2, 流表 2匹配 对应的元数据, 匹配成功后, 执行对应的指令。
然而, 本申请人在实现本申请实施例中的技术方案的过程中发现, 现有 技术中通过元数据匹配的方式来实现流表项寻址的方法, 一种方式是通过元 数据内容进行匹配查找, 这需要专有的硬件实现, 所以成本较高; 另一种方 式是对元数据进行 hash (哈希)运算, 得到后一个表里的表项索引, 这种方式 需要额外做一次 hash运算,另外还要解决 hash运算冲突的问题( hash运算冲突, 指的是对于不同元数据经 hash运算后得到相同的值), 导致 hash运算实现效率 比较低(额外的 hash运算) 以及操作复杂 (hash冲突时需要额外的处理)。 因 此, 现有技术中存在使用元数据匹配导致流表项寻址的效率较低, 而且流表 项匹配的操作较复杂且成本较高的技术问题。 发明内容
本申请提供一种基于流表的表项寻址方法、 交换机及控制器 , 用以解决 现有技术中存在的使用元数据匹配而导致的流表项寻址效率较低 , 而且流表 项匹配的操作较复杂的技术问题。 本申请第一方面提供了一种基于流表的表项寻址方法, 包括: 交换机接 收一报文; 所述交换机基于前置流表匹配所述报文; 在匹配成功后, 所述交 换机基于匹配成功的流表项中的写入存储索引指令, 将存储索引信息随所述 报文发送给下级流表; 其中, 所述存储索引信息对应于所述下级流表中的流 表项, 且所述写入存储索引指令是控制器发送的; 所述交换机基于所述存储 索引信息在所述下级流表中直接寻址所述存储索引信息对应的流表项。
结合第一方面, 在第一方面的第一种可能的实现方式中, 在所述交换机 接收一报文之前, 还包括: 所述交换机接收所述控制器发送的携带所述写入 存储索引指令的所述匹配成功的流表项, 所述写入存储索引指令的参数包含 所述存储索引信息。
结合第一方面的第一种可能的实现方式, 在第一方面的第二种可能的实 现方式中, 在所述交换机接收所述控制器发送的携带所述写入存储索引指令 的所述匹配成功的流表项之前, 还包括: 所述交换机接收所述控制器发送的 针对所述下级流表的生成或者修改流表项的消息; 所述消息中携带返回存储 索引指示; 所述交换机基于所述返回存储索引指示, 将所述下级流表的流表 项对应的所述存储索引信息发送给所述控制器。 结合第一方面的第一种可能的实现方式或第一方面的第二种可能的实现 方式, 在第一方面的第三种可能的实现方式中, 所述写入存储索引指令具体 为: 新定义的操作指令; 或写入元数据指令; 所述将存储索引信息随所述报 文发送给下级流表具体为: 将所述存储索引信息写在元数据的固定比特位中, 并随所述报文发送给所述下级流表。
结合第一方面, 或第一方面的第一种可能的实现方式至第一方面的第三 种可能的实现方式中的任意一种, 在第一方面的第四种可能的实现方式中, 所述存储索引信息包括所述下级流表的流表项的地址信息, 或所述下级流表 的流表项的地址信息和所述下级流表的流表标识。
结合第一方面的第四种可能的实现方式, 在第一方面的第五种可能的实 现方式中, 所述下级流表的流表标识具体由所述交换机或者所述控制器生成。
结合第一方面, 或第一方面的第一种可能的实现方式至第一方面的第五 种可能的实现方式中的任意一种, 在第一方面的第六种可能的实现方式中, 还包括:
所述交换机发送流表项释放消息给所述控制器, 通知所述控制器所述下 级流表中的流表项需要释放;
所述交换机锁定所述下级流表中的流表项;
所述交换机接收所述控制器发送的基于所述释放消息生成的删除消息, 删除使用所述存储索引信息的其他流表项中的所述写入索引指令;
所述交换机在删除完成后发送删除响应消息给所述控制器;
所述交换机接收所述控制器基于所述删除响应消息生成的释放应答消 息;
所述交换机基于所述释放应答消息, 解除所述下级流表中的流表项的锁 定。
结合第一方面的第六种可能的实现方式, 在第一方面的第七种可能的实 现方式中, 在所述交换机锁定所述下级流表中的流表项时, 还包括:
所述交换机丟弃所述报文; 或 所述交换机向所述控制器发送报文消息, 所述报文消息携带所述报文、 所述存储索引信息和存储索引信息无效的原因值。
本申请第二方面提供了一种基于流表的表项寻址方法, 包括: 控制器发 送针对下级流表的生成或者修改流表项的第一消息给交换机, 所述第一消息 中携带返回存储索引指示; 所述控制器接收所述交换机基于所述返回存储索 引指示返回的所述下级流表的流表项的存储索引信息; 所述控制器发送修改 或者创建前置流表的流表项的第二消息给所述交换机, 所述第二消息中携带 写入存储索引指令, 所述写入存储索引指令的参数包含所述存储索引信息, 以使所述交换机能够基于所述存储索引信息在所述下级流表中直接寻址所述 存储索引信息对应的流表项。
结合第二方面, 在第二方面的第一种可能的实现方式中, 所述写入存储 索引指令具体为: 新定义的操作指令; 或写入元数据指令; 所述存储索引信 息写在元数据的固定比特位中。
结合第二方面或第二方面的第一种可能的实现方式, 在第二方面的第二 种可能的实现方式中, 所述存储索引信息包括所述下级流表的流表项的地址 信息, 或所述下级流表的流表项的地址信息和所述下级流表的流表标识。
结合第二方面的第二种可能的实现方式, 在第二方面的第三种可能的实 现方式中, 所述下级流表的流表标识具体由所述交换机或者所述控制器生成。
结合第二方面或第二方面的第一种可能的实现方式至第二方面的第三种 可能的实现方式中的任意一种, 在第二方面的第四种可能的实现方式中, 在 所述控制器发送修改或者创建前置流表的流表项的第二消息给所述交换机之 后, 还包括: 所述控制器接收所述交换机发送的流表释放消息; 所述控制器 基于所述流表释放消息, 发送删除消息给所述交换机, 以使所述交换机能够 基于所述删除消息删除使用所述存储索引信息的其他流表项中的所述写入索 引指令; 所述控制器接收所述交换机发送的删除响应信息, 所述删除响应信 息表征所述交换机已删除完成; 所述控制器基于所述删除响应信息生成并发 送释放应答消息给所述交换机, 以使所述交换机解除对所述下级流表中的流 表项的锁定。
结合第二方面的第四种可能的实现方式, 在第二方面的第五种可能的实 现方式中, 在所述控制器接收所述交换机发送的流表释放消息之后, 还包括: 所述控制器接收所述交换机发送的报文消息, 所述报文消息携带报文、 所述 存储索引信息和存储索引信息无效的原因值。
本申请第三方面提供一种交换机, 包括:
第一接收单元, 用于接收一报文; 匹配单元, 用于基于前置流表匹配所 述报文; 处理单元, 用于在匹配成功后, 基于匹配成功的流表项中的写入存 储索引指令, 将存储索引信息随所述报文发送给下级流表; 其中, 所述存储 索引信息对应于所述下级流表中的流表项, 且所述写入存储索引指令是控制 器发送的; 并基于所述存储索引信息在所述下级流表中直接寻址所述存储索 引信息对应的流表项。
结合第三方面, 在第三方面的第一种可能的实现方式中, 还包括: 第二 接收单元, 用于接收所述控制器发送的携带所述写入存储索引指令的所述匹 配成功的流表项, 所述写入存储索引指令的参数包含所述存储索引信息。
结合第三方面的第一种可能的实现方式中, 在第三方面的第二种可能的 实现方式中, 还包括第一发送单元, 所述第二接收单元还用于交换机接收所 述控制器发送的针对所述下级流表的生成或者修改流表项的消息; 所述消息 中携带返回存储索引指示; 所述第一发送单元用于基于所述返回存储索引指 示, 将所述下级流表的流表项对应的所述存储索引信息发送给所述控制器。
结合第三方面的第一种可能的实现方式或第三方面的第二种可能的实现 方式, 在第三方面的第三种可能的实现方式中, 所述写入存储索引指令具体 为写入元数据指令, 所述处理单元具体用于将所述存储索引信息写在元数据 的固定比特位中, 并随所述 ·^艮文发送给所述下级流表。
结合第三方面或第三方面的第一种可能的实现方式至第三方面的第三种 可能的实现方式中的任意一种, 在第三方面的第四种可能的实现方式中, 还 包括第二发送单元和第三接收单元: 所述第二发送单元, 用于发送流表项释放消息给所述控制器, 通知所述 控制器所述下级流表中的流表项需要释放;
所述处理单元, 还用于锁定所述下级流表中的流表项;
所述第三接收单元, 用于接收所述控制器发送的基于所述释放消息生成 的删除消息, 删除使用所述存储索引信息的其他流表项中的所述写入索引指 令;
所述第二发送单元, 还用于在删除完成后发送删除响应消息给所述控制 器;
所述第三接收单元, 还用于接收所述控制器基于所述删除响应消息生成 的释放应答消息;
所述处理单元, 还用于基于所述释放应答消息, 解除所述下级流表中的 流表项的锁定。
结合第三方面的第四种可能的实现方式中, 在第三方面的第五种可能的 实现方式中, 在所述下级流表中的流表项时, 所述处理单元还用于丟弃所述 报文, 或, 所述第二发送单元还用于向所述控制器发送报文消息, 所述报文 消息携带所述报文、 所述存储索引信息和存储索引信息无效的原因值。
本申请第四方面提供一种交换机, 包括:
接口, 用于接收一报文; 处理器, 用于基于前置流表匹配所述报文; 在 匹配成功后, 还基于匹配成功的流表项中的写入存储索引指令, 将存储索引 信息随所述报文发送给下级流表; 其中, 所述存储索引信息对应于所述下级 流表中的流表项, 且所述写入存储索引指令是控制器发送的; 还基于所述存 储索引信息在所述下级流表中直接寻址所述存储索引信息对应的流表项。
结合第四方面, 在第四方面的第一种可能的实现方式中, 还包括: 接收 器, 用于接收所述控制器发送的携带所述写入存储索引指令的所述匹配成功 的流表项, 所述写入存储索引指令的参数包含所述存储索引信息。
结合第四方面的第一种可能的实现方式, 在第四方面的第二种可能的实 现方式中, 还包括发送器, 所述接收器还用于接收所述控制器发送的针对所 述下级流表的生成或者修改流表项的消息; 所述消息中携带返回存储索引指 示; 所述发送器具体用于基于所述返回存储索引指示, 将所述下级流表的流 表项对应的所述存储索引信息发送给所述控制器。
结合第四方面的第一种可能的实现方式或第四方面的第二种可能的实现 方式, 在第四方面的第三种可能的实现方式中, 所述写入存储索引指令具体 为写入元数据指令, 所述处理器具体用于将所述存储索引信息写在元数据的 固定比特位中, 并随所述报文发送给所述下级流表。
结合第四方面, 在第四方面的第四种可能的实现方式中, 还包括发送器 和接收器, 所述发送器用于发送流表项释放消息给所述控制器, 通知所述控 制器所述下级流表中的流表项需要释放, 并在删除完成后发送删除响应消息 给所述控制器; 所述接收器用于接收所述控制器发送的基于所述释放消息生 成的删除消息, 并接收所述控制器基于所述删除响应消息生成的释放应答消 息; 所述处理器还用于在所述发送器发送所述流表项释放消息之后, 锁定所 述下级流表中的流表项; 并在接收器接收到所述删除消息后, 删除使用所述 存储索引信息的其他流表项中的所述写入索引指令; 并在接收器接收到释放 应答消息之后解除所述下级流表中的流表项的锁定。
结合第四方面的第四种可能的实现方式, 在第四方面的第五种可能的实 现方式中, 在所述交换机锁定所述下级流表中的流表项时, 所述处理器还用 于丟弃所述报文, 或, 所述发送器还用于向所述控制器发送报文消息, 所述 报文消息携带所述报文、 所述存储索引信息和存储索引信息无效的原因值。
本申请第五方面还提供一种控制器, 包括:
发送单元, 用于发送针对下级流表的生成或者修改流表项的第一消息给 交换机, 所述第一消息中携带返回存储索引指示; 还用于发送修改或者创建 前置流表的流表项的第二消息给所述交换机, 所述第二消息中携带写入存储 索引指令; 接收单元, 用于接收所述交换机基于所述返回存储索引指示返回 的所述下级流表的流表项的存储索引信息; 其中, 所述写入存储索引指令的 参数包含所述存储索引信息, 以使所述交换机能够基于所述存储索引信息在 所述下级流表中直接寻址所述存储索引信息对应的流表项。
结合第五方面, 在第五方面的第一种可能的实现方式中, 所述接收单元 具体还用于: 接收所述交换机发送的流表释放消息, 接收所述交换机发送的 删除响应信息, 所述删除响应信息表征所述交换机已删除完成; 所述发送单 元具体还用于: 基于所述流表释放消息, 发送删除消息给所述交换机, 以使 所述交换机能够基于所述删除消息删除使用所述存储索引信息的其他流表项 中的所述写入索引指令; 基于所述删除响应信息生成并发送释放应答消息给 所述交换机, 以使所述交换机解除对所述下级流表中的流表项的锁定。
结合第五方面的第一种可能的实现方式, 在第五方面的第二种可能的实 现方式中, 所述接收单元具体还用于接收所述交换机发送的报文消息, 所述 报文消息携带报文、 所述存储索引信息和存储索引信息无效的原因值。
本申请第六方面提供一种控制器, 包括:
发送器, 用于发送针对下级流表的生成或者修改流表项的第一消息给交 换机, 所述第一消息中携带返回存储索引指示; 还用于发送修改或者创建前 置流表的流表项的第二消息给所述交换机, 所述第二消息中携带写入存储索 引指令; 接收器, 用于接收所述交换机基于所述返回存储索引指示返回的所 述下级流表的流表项的存储索引信息; 其中, 所述写入存储索引指令的参数 包含所述存储索引信息, 以使所述交换机能够基于所述存储索引信息在所述 下级流表中直接寻址所述存储索引信息对应的流表项。
结合第六方面, 在第六方面的第一种可能的实现方式中, 所述接收器具 体还用于: 接收所述交换机发送的流表释放消息, 接收所述交换机发送的删 除响应信息, 所述删除响应信息表征所述交换机已删除完成; 所述发送器具 体还用于: 基于所述流表释放消息, 发送删除消息给所述交换机, 以使所述 交换机能够基于所述删除消息删除使用所述存储索引信息的其他流表项中的 所述写入索引指令; 基于所述删除响应信息生成并发送释放应答消息给所述 交换机, 以使所述交换机解除对所述下级流表中的流表项的锁定。
结合第六方面的第一种可能的实现方式, 在第六方面的第二种可能的实 现方式中, 所述接收器具体还用于接收所述交换机发送的报文消息, 所述报 文消息携带报文、 所述存储索引信息和存储索引信息无效的原因值。
本申请实施例中提供的一个或多个技术方案, 至少具有如下技术效果或 优点:
本申请实施例中, 交换机接收一报文; 交换机基于前置流表匹配报文; 在匹配成功后, 交换机基于匹配成功的流表项中的写入存储索引指令, 将存 储索引信息随报文发送给下级流表; 其中, 存储索引信息对应于下级流表中 的流表项, 且写入存储索引指令是控制器发送的; 交换机基于存储索引信息 在下级流表中直接寻址存储索引信息对应的流表项。 因此, 在本申请实施例 中, 首先前置流表的流表项里具有写入存储索引指令, 而基于该写入存储索 引指令能够将存储索引信息随报文一起发送给下级流表, 那么下级流表在收 到该报文时, 可根据该存储索引信息直接定位到与该存储索引信息对应的流 表项,而不需要在下级流表中一个个进行内容匹配或者采用 hash运算的方式进 行寻址, 所以能够解决使用元数据匹配导致的效率低和操作复杂和成本高的 技术问题, 达到提高报文的处理速度, 减少报文处理时延的技术效果, 使得 open flow交换机可以实现更高线速的 4艮文转发和更低的设备成本。 附图说明
图 la-图 lc为现有技术中的基于流表的表项寻址方法的示意图;
图 2为本申请一实施例中的控制器侧的基于流表的表项寻址方法的流程 图;
图 3为本申请一实施例中的交换机侧基于流表的表项寻址方法的流程的 另一示意图;
图 4为本申请一实施例中的交换机侧基于流表的表项寻址方法的流程的 另一示意图;
图 5为本申请一实施例中的基于流表的表项寻址方法的具体实例示意图; 图 6为本申请另一实施例中的基于流表的表项寻址方法的具体实例示意 图;
图 7为本申请再一实施例中的基于流表的表项寻址方法的具体实例示意 图;
图 8为本申请一实施例中的交换机侧释放流表项的方法流程图
图 9为本申请一实施例中的控制器侧释放流表项的方法流程图; 图 10为本申请一实施例中的释放流表项的具体实例的示意图;
图 11为本申请实施例二中的交换机的功能框图;
图 12为本申请实施例三中的交换机的硬件实现的实例概念图;
图 13为本申请实施例四中的控制器的功能框图;
图 14为本申请实施例五中的控制器的硬件实现的实例概念图。 具体实施方式
本申请实施例提供一种基于流表的表项寻址方法、 交换机及控制器, 用 以解决现有技术中存在的使用内容匹配而导致的流表项寻址效率较低, 而且 流表项匹配的操作较复杂的技术问题。
本申请实施例中的技术方案为解决上述的技术问题, 总体思路如下: 本申请实施例中, 交换机接收一报文; 交换机基于前置流表匹配报文; 在匹配成功后, 交换机基于匹配成功的流表项中的写入存储索引指令, 将存 储索引信息随报文发送给下级流表; 其中, 存储索引信息对应于下级流表中 的流表项, 且写入存储索引指令是控制器发送的; 交换机基于存储索引信息 在下级流表中直接寻址存储索引信息对应的流表项。 因此, 在本申请实施例 中, 首先前置流表的流表项里具有写入存储索引指令, 而基于该写入存储索 引指令能够将存储索引信息随报文一起发送给下级流表, 那么下级流表在收 到该报文时, 可根据该存储索引信息直接定位到与该存储索引信息对应的流 表项, 而不需要在下级流表中一个个进行内容匹配或者采用 hash运算的方式 进行寻址, 所以能够解决使用元数据匹配导致的效率低和操作复杂的技术问 题,达到提高报文的处理速度,减少报文处理时延的技术效果,使得 open flow 交换机可以实现更高线速的报文转发和更低的设备成本。
为使本申请实施例的目的、 技术方案和优点更加清楚, 下面将结合本申 请实施例中的附图, 对本申请实施例中的技术方案进行清楚、 完整地描述, 显然, 所描述的实施例是本申请一部分实施例, 而不是全部的实施例。 基于 本申请中的实施例, 本领域普通技术人员在没有作出创造性劳动前提下所获 得的所有其他实施例, 都属于本申请保护的范围。
本文中术语 "和 /或", 仅仅是一种描述关联对象的关联关系, 表示可以存 在三种关系, 例如, A和 /或 B , 可以表示: 单独存在 A, 同时存在 A和 B , 单独存在 B 这三种情况。 另外, 本文中字符 "/" , 一般表示前后关联对象是 一种 "或" 的关系。
下面结合附图对本申请优选的实施方式进行详细说明。
实施例一
本实施例提供一种基于流表的表项寻址方法, 请参考图 2所示, 为本实 施例中的基于流表的表项寻址方法的流程图, 该方法包括:
步骤 101 :控制器发送针对下级流表的生成或者修改流表项的第一消息给 交换机, 第一消息中携带返回存储索引指示;
步骤 102:控制器接收交换机基于返回存储索引指示返回的下级流表的流 表项的存储索引信息;
步骤 103:控制器发送修改或者创建前置流表的流表项的第二消息给交换 机, 该第二消息中携带写入存储索引指令, 写入存储索引指令的参数包含存 储索引信息, 以使交换机能够基于存储索引信息在下级流表中直接寻址存储 索引信息对应的流表项。
图 2中所示的方法流程是从控制器侧进行描述的, 请再参考图 3所示, 为本实施例中的基于流表的表项寻址方法在交换机侧的方法流程图, 请参考 图 3所示, 该方法包括:
步骤 201 :交换机接收控制器发送的针对下级流表的生成或者修改流表项 的第一消息, 该第一消息中携带返回存储索引指示;
步骤 202:交换机安装该下级流表的流表项并发送基于返回存储索引指示 生成的下级流表的流表项的存储索引信息给控制器;
步骤 203:交换机接收控制器发送的修改或者创建前置流表的流表项的第 二消息, 该第二消息中携带存储索引指令, 写入存储索引指令的参数包含存 储索引信息, 以使交换机能够基于存储索引信息在下级流表中直接寻址存储 索引信息对应的流表项;
步骤 204: 安装该前置流表的流表项。
以下将结合图 2和图 3对本实施例中的基于流表的表项寻址方法进行详 细描述。
其中, 请先参考图 2所示, 控制器先执行步骤 101 , 即控制器向交换机发 送针对下级流表的生成或者修改流表项的第一消息, 其中, 在该第一消息中 携带返回存储索引指示。 进一步, 该第一消息还可以包括匹配内容, 在使用 存储索引信息直接索引时, 不需要进行内容匹配, 而当前置流表不使用存储 索引信息直接索引时, 依然可以采用内容匹配的方式实现表项寻址。
另外, 对于本申请实施例中出现的下级流表和前置流表的概念是从匹配 的先后顺序来讲的, 先匹配的即为前置流表, 从前置流表出来, 就到了下级 流表进行处理, 所以这里的下级流表和前置流表是一个相对的概念, 而非绝 对的; 当然, 在实际运用中, 也可以是实际上的下级流表和上级流表, 例如 根据协议层的层级来区分的, 对于数据链路层的处理即为上级流表, 对于协 议层的处理即为下级流表。 进一步, 需要特别说明的是, 下级流表指的是在 前置流表后对报文做进一步处理的流表, 比如前置流表 1 , 经过下级流表 2, 再到使用表项索引的下级流表 3 ,而不是要求使用表项索引的下级流表 3必须 仅在流表 1后。
对应的, 交换机就执行步骤 201 , 即接收该第一消息, 当交换机接收到该 第一消息时, 就执行步骤 202, 即安装和 /或修改该下级流表的流表项, 并根 据第一消息中的返回存储索引指示生成下级流表的该流表项的存储索引信 息, 并将存储索引信息发送给控制器。 其中, 存储索引信息具体可以是该流 表项的地址信息, 例如是存储该流表项的内存位置, 也可以是一个针对该下 级流表起始内存位置的偏移量; 进一步, 对于有两个或两个以上的流表使用 直接索引时, 为了区分地址信息分别是来自哪个表中的流表项, 存储索引信 息还包括下级流表的流表标识。 对于流表标识可以是由流表产生并返回给控 制器的, 也可以是由控制器生成, 而交换机只要返回地址信息即可。 当然, 在实际运用中, 存储索引信息还可以是其他的信息, 只要能够根据该存储索 引信息直接索引到对应的流表项即可。 进一步, 在内容匹配的方式中, 流表 项生成消息是没有响应消息的, 所以在本申请实施例中, 新定义了一个响应 消息以返回存储索引信息给控制器。
对应的, 控制器执行步骤 102 , 即接收交换机返回的存储索引信息, 在接 收到存储索引信息之后, 就执行步骤 103 , 即发送修改或者创建前置流表的流 表项的第二消息给交换机, 该第二消息中携带写入存储索引指令, 写入存储 索引指令的参数包含存储索引信息, 以使交换机能够基于存储索引信息在下 级流表中直接寻址存储索引信息对应的流表项。 当然, 第二消息中还携带有 匹配内容和指令。
其中, 写入存储索引指令具体可以是新定义的操作指令, 也可以是重用 现有的元数据 ( metedata )来传输存储索引信息, 所以就使用现有的写入元数 据指令即可, 在使用时, 避免干扰其他使用元数据匹配的流表, 将元数据格 式化, 将元数据的某些比特位规定用于直接索引, 例如使用元数据里的 0到 7 比特位传递存储索引信息。
对应的, 交换机就执行步骤 203 , 即接收该第二消息, 然后执行步骤 204, 安装该前置流表的流表项。
接下来将详细介绍当报文到来时, 交换机如何基于前述这些流表进行表 项寻址, 请参考图 4所示, 为本申请实施例中的表项寻址方法的流程图, 该 方法包括:
步骤 301 : 交换机接收一报文; 步骤 302: 交换机基于前置流表匹配 4艮文;
步骤 303: 在匹配成功后, 交换机基于匹配成功的流表项中的写入存储索 引指令, 将存储索引信息随报文发送给下级流表; 其中, 存储索引信息对应 于下级流表中的流表项, 且写入存储索引指令是控制器发送的;
步骤 304:交换机基于存储索引信息在下级流表中直接寻址存储索引信息 对应的流表项。
其中,在步骤 301中,接收到报文后,报文到达前置流表,执行步骤 302, 即基于前置流表匹配报文, 此处可以是内容匹配, 也可以是元数据匹配, 当 匹配到某个流表项后, 即匹配成功后, 根据该流表项中的写入存储索引指令, 将存储索引信息随报文一起发送给下级流表, 例如由 goto table 指令指定。
当报文到达下级流表时, 发现其携带有存储索引信息, 则根据存储索引 信息直接寻址表项, 即执行步骤 304, 并执行指令。
在实际运用中, 当使用直接索引的流表为两个或两个以上时, 在步骤 303 之后, 步骤 304之前, 该方法还包括: 该下级流表判断该存储索引信息是否 由自身生成, 如果是, 就执行步骤 304。 因此可以避免流表错误的执行直接索 引, 执行错误的指令。 在具体实施过程中, 判断存储索引信息是否由自身生 成, 具体可以是根据存储索弓 I信息中的流表标识来判断。
在进一步的实施例中, 避免引入额外的判断操作, 影响报文的处理效率, 控制器可以发送指示信息给交换机, 配置某个流表不使用直接索引, 那么该 不使用直接索引的流表在收到报文时就不需要再判断, 而是直接执行匹配操 作, 即再次执行步骤 302, 直到报文到达使用直接索引的下级流表时, 就执行 步骤 304。
接下来将分别详细介绍几个具体的例子, 首先请参考图 5 所示, 在本实 施例中, 包含两级流表, 其中表 1使用直接索引, 该方法包括:
步骤 401 : 控制器向表 1下发流表修改消息, 该消息指示生成新的流表项 ( OFPFC_ADD ), 该消息还包括返回存储索引指示, 进一步还可以包括匹配 内容, 便于在不使用直接索引时, 进行内容匹配, 相应的, 也包括指令; 该 消息的格式例如是 Flow Table Mod(OFPFC_ADD , return index flag, match, instructions);
步骤 402: 根据步骤 401中的返回存储索引指示,表 1向控制器反馈流表 修改响应消息, 在该消息中反馈存储索引信息, 例如前述描述的该流表项的 地址信息; 该消息的格式例如是 Flow Table Mod ack (return index);
步骤 403: 控制器向表 0下发修改或者创建流表项的消息, 除了匹配内容 和指令外, 还携带写入存储索引指令, 存储索引指令的参数包括步骤 402 中 返回的存储索引信息; 该消息的格式为 Flow Table Mod (OFPFC_ADD/mod , match, write index(index ) , other instructions);
步骤 404: 报文到达表 0;
步骤 405: 执行匹配操作; 当匹配成功某个流表项后, 执行该流表项里的 各项指令, 其中包括根据写入存储索引指令, 将参数(存储索引信息) 随报 文一起发送给下级流表, 即表 1 , 即为步骤 406; 。
步骤 407: 当报文到达表 1后, 表 1发现其携带有存储索引信息, 则根据 存储索引信息直接索引流表项; 进一步, 执行该流表项里的各项指令。
通过本实施例可以看出, 控制器指示交换机返回下级流表项存储索引信 息, 并将其更新到前置流表的流表项中, 当前置流表匹配成功后, 将存储索 引信息传输到下级流表, 下级流表可以通过存储索引信息直接寻址流表项, 从而避免了通过元数据匹配来寻址流表项导致的效率过低或者操作复杂的问 题。
接下来请参考图 6所示, 在本实施例中, 包含四个流表, 其中表 2和表 3 使用直接索引, 表 0和表 1使用内容匹配, 该方法包括:
步骤 501 : 该步骤为可选, 控制器可以通过多部分消息, 指示表 1不使用 直接索引, 以避免携带有索引信息的报文干扰表 1 的正常处理, 即报文到达 表 1时, 表 1不用判断存储索引信息是否由自身生成, 可以提高报文处理的 效率; 当不执行该步骤时, 在表 1处理时, 就会在步骤 511之前增加一个判 断的步骤, 判断存储索引信息 1 是否由自身生成。 该消息的格式具体可以为 Multipart(OFPMP_TABLE_FEATURES not use index)。
步骤 502: 控制器向表 2下发流表项修改消息, 该消息指示生成新的流表 项 (OFPFC_ADD ), 该消息还包括返回存储索引指示, 进一步还可以包括匹 配内容, 便于在不使用直接索引时, 进行内容匹配, 相应的, 也包括指令; 该消息的格式例如是 Flow Table Mod(OFPFC_ADD , return index flag , match , instructions)。
步骤 503: 根据步骤 502中的返回存储索引指示,表 2向控制器反馈流表 修改响应消息, 在该消息中反馈存储索引信息, 例如前述描述的该流表项的 地址信息; 该消息的格式例如是 Flow Table Mod ack (return indexl)。
步骤 504: 类似步骤 502, 控制器向表 3下发流表项修改消息, 该消息指 示生成信息的流表项 (OFPFC_ADD ), 该消息还包括返回存储索引指示, 进 一步还可以包括匹配内容, 便于在不使用直接索引时, 进行内容匹配, 相应 的, 也包括指令; 该消息的格式例如是 Flow Table Mod(OFPFC_ADD, return index flag, match, instmctions)。
步骤 505: 根据步骤 504中的返回存储索引指示,表 3向控制器反馈流表 修改响应消息, 在该消息中反馈存储索引信息, 例如前述描述的该流表项的 地址信息; 该消息的格式例如是 Flow Table Mod (return index2)。
步骤 506: 控制器向表 0下发修改或者创建流表项的消息, 除了匹配内容 和指令外, 还携带写入存储索引指令, 存储索引指令的参数包括步骤 503 中 返回的存储索引信息 1 , 另外, 在本实施例中, 因为多个流表使用直接索引, 所以参数还包括生成该存储索弓 I信息的流表的流表标识, 所以在本实施例中, 存储索引信息包括存储索引信息 1 和流表标识; 另外, 控制器还下发了转至 表 1 ( goto table 1 )指示, 该消息的格式为 Flow Table Mod(OFPFC_ADD/mod , match, write index(index 1 , table ID 2) , other instructions , goto table 1)。
步骤 507: 控制器向表 1下发修改或者创建流表项的消息, 除了匹配内容 和指令外, 还携带写入存储索引指令, 存储索引指令的参数包括步骤 505 中 返回的存储索引信息 2, 另外, 在本实施例中, 因为多个流表使用直接索引, 所以参数还包括生成该存储索弓 I信息的流表的流表标识, 所以在本实施例中, 存储索引信息包括存储索引信息 2和流表标识; 另外, 控制器还下发了转至 表 2 ( goto table 2 )指示, 该消息的格式为 Flow Table Mod(OFPFC_ADD/mod , match, write index(index 2 , table ID 3), other instructions , goto table 2)。
步骤 508: 报文到达表 0。
步骤 509:基于表 0进行匹配, 当匹配成功某个流表项时,执行步骤 510: 将写入存储索引指令的参数 (存储索引信息 1和流表标识表 2 )随报文一起发 送给下级流表 1 (由 goto table 1指令指定)。
当报文到达表 1后, 由于流表 1 已经配置了不使用直接索引, 所以表 1 不需要处理随报文携带的存储索引信息,而是执行步骤 511 ,即执行匹配操作, 当成功匹配某个流表项后,执行步骤 512, 即根据步骤 507中的写入存储索引 指令, 将其参数(存储索引信息 2和流表标识表 3 )随报文一起发送给下级流 表表 2。在此步骤中添加的存储索引信息和步骤 510中添加的存储索引信息是 叠加的关系, 即彼此不会覆盖。
当报文到达表 2后, 流表 2发现报文携带有存储索引信息, 就执行步骤 513 , 根据报文携带的生成该索引的流表标识判断该索引是否由自己生成, 如 果由自己生成, 则根据存储索引信息, 直接寻址表项并执行指令, 在本实施 例中, 判断的结果是存储索引信息 1为表 2生成的, 所以就根据存储索引信 息 1直接寻址流表项, 并进一步执行指令。 然后执行步骤 514, 将报文发送给 流表 3 , 此时对 4艮文一起发送的是存储索引信息 2和流表标识表 3。
当报文到达流表 3后, 流表 3发现其携带有存储索引信息, 就执行步骤 515 , 根据报文携带的生成该索引的流表标识判断该索引是否由自己生成, 如 果由自己生成, 则根据存储索引, 直接寻址表项并执行指令, 在本实施例中, 判断的结果是存储索引信息 2为表 3生成的, 所以就根据存储索引信息 2直 接寻址流表项, 并进一步执行指令。
在前述两个实施例中, 写入存储索引指令使用的是新定义的操作指令, 以下将介绍一个重用写入元数据指令的实施例, 请参考图 7所示, 该方法包 括:
步骤 601 : 控制器通过多部分消息, 指示流表 1使用元数据里固定比特位 作为存储索引信息, 针对本实施例使用元数据里的 0到 7比特位传递索引信 息。 实际上这也约束了该流表可以使用的流表项只能为 256个( 2的 8次方)。 控制器可以根据该流表支持的流表项数来决定所占用的比特位, 比如流表 1 使用 1000 个表项, 则要给其分配 10 个比特位。 该消息的格式可以为 Multipart(OFPMP_TABLE_FEATURES metedata_index 0-7bit)。
步骤 602: 控制器通过多部分消息, 指示流表 2使用元数据里固定比特位 作为索引, 针对本实施例使用元数据里的 8到 15比特位传递索引信息。 需要 说明的是使用直接索引的不同流表, 其配置的比特位不重叠。 该消息的格式 可以为 Multipart(OFPMP_TABLE_FEATURES metedata_index 8 - 15bit)。
步骤 603: 控制器向流表 1下发流表项修改消息, 该消息指示生成信息的 流表项 (OFPFC_ADD ), 该消息还带有返回存储索引指示。 该存储索引信息 不能超过步骤 601里配置的比特位范围限制,针对本实施例,即不能超过 255。 该消息的格式可以是 Flow Table Mod ( OFPFC_ADD , return index flag , instructions)。
步骤 604: 流表 1在生成流表项后, 根据步骤 603的指示, 返回对应的存 储索引信息 XI。该消息的格式可以是 Flow Table Mod ack ( return index Xl)。
步骤 605: 控制器向流表 2下发流表项修改消息, 该消息指示生成信息的 流表项 (OFPFC_ADD ), 该消息还带有返回存储索引指示。 该存储索引信息 不能超过步骤 602里配置的比特位范围限制,针对本实施例,即不能超过 255。 该消息的格式可以是 Flow Table Mod ( OFPFC_ADD , return index flag , instructions)。
步骤 606: 流表 2在生成流表项后, 根据步骤 605的指示, 返回对应的存 储索引信息 Y1。该消息的格式可以是 Flow Table Mod ack ( return index Yl)。
步骤 607: 控制器向流表 0下发新的表项或者修改原有表项的消息, 除了 原有的匹配内容指令外, 下发写入元数据指令, 将步骤 604和步骤 606返回 的存储索引信息 XI和储索引信息 Y1写入到元数据里特定的比特位。 这个过 程不需要扩展 open flow协议, 利用现有机制即可。 需要注意的是, 与图 6中 实施例相比, 由于已经限定了特定比特位用于特定流表的直接索引, 所以不 需要在元数据里额外写入生成存储索引信息的流表标识。
步骤 608 , 报文到达表 0, 然后执行步骤 609, 即执行匹配操作, 当成功 匹配某个流表项后, 执行步骤 610 , 根据写入元数据指令, 将其参数写入元数 据的固定比特位中, 并随报文一起发送给下级流表表 1。
当报文到达表 1后, 执行步骤 611 , 即使用元数据的固定比特位, 本实施 例中为 0-7比特位中的值直接索引流表项, 并进一步执行该流表项的指令。
然后执行步骤 612 , 将报文和元数据发送至表 2, 在报文到达表 2后, 执 行步骤 613 , 即使用元数据里固定比特位, 即 8-15比特位, 根据其值直接索 引流表项, 并进一步执行该流表项的指令。
由以上描述可以看出, 在本申请实施例中, 首先前置流表的流表项里具 有写入存储索引指令, 而基于该写入存储索引指令能够将存储索引信息随报 文一起发送给下级流表, 那么下级流表在收到该报文时, 可根据该存储索引 信息直接定位到与该存储索 )信息对应的流表项, 而不需要在下级流表中一 个个进行内容匹配或以 hash运算的方式进行寻址, 所以能够解决使用元数据 匹配导致的效率低和操作复杂即成本高的技术问题, 达到提高报文的处理速 度, 减少报文处理时延的技术效果, 使得 open flow交换机可以实现更高线速 的报文转发和更低的设备成本。
另外, 使用直接索引的流表, 在流表项因为超时等原因释放后, 其处理 和使用内容匹配的流表项处理不同, 对于内容匹配的流表项, 当释放后, 其 内存位置可以立即被新的流表项利用, 当匹配原表项内容的报文到达后, 由 于没有匹配流表项, 会按照通配流程处理, 并不会造成错误。 而对于直接索 引的流表项, 其删除后, 其内存位置如果被新的流表项占用并且前置流表还 没有释放原有的内存索引指令, 会导致报文直接索引到新的流表项, 并错误 的执行该新流表项对应的指令, 而这种错误无法被控制器和交换机检测到, 所以释放直接索引的流表项需要严格的同步过程。 以下将详细介绍释放直接 索引的流表项时控制器和交换机的交互过程。
首先, 请参考图 8所示, 具体为从交换机侧描述的方法流程图, 包括: 步骤 205: 交换机发送流表项释放消息给控制器, 通知控制器下级流表中 的流表项需要释放;
步骤 206: 交换机锁定下级流表中的流表项;
步骤 207: 交换机接收控制器发送的基于释放消息生成的删除消息, 删除 使用存储索引信息的其他流表项中的写入索引指令;
步骤 208: 交换机在删除完成后发送删除响应消息给控制器;
步骤 209: 交换机接收控制器基于删除响应消息生成的释放应答消息; 步骤 210: 交换机基于释放应答消息, 解除下级流表中的流表项的锁定。 再请参考图 9所示, 具体为从控制器侧描述的方法流程图, 包括: 步骤 104: 控制器接收交换机发送的流表释放消息;
步骤 105: 控制器基于流表释放消息, 发送删除消息给交换机, 以使交换 机能够基于删除消息删除使用存储索引信息的其他流表项中的写入索引指 令;
步骤 106: 控制器接收交换机发送的删除响应信息, 删除响应信息表征交 换机已删除完成;
步骤 107: 控制器基于删除响应信息生成并发送释放应答消息给交换机, 以使交换机解除对下级流表中的流表项的锁定。
请同时参考图 8和图 9所示, 当由于某些原因, 例如长时间没有报文索 引到该流表项, 导致流表项定时器超时, 交换机需要释放该流表项, 那么交 换机就执行步骤 205 ,发送流表项释放消息给控制器, 通知控制器下级流表中 的流表项需要释放, 该释放消息中可以包含该流表项的存储索引信息或者匹 配内容, 用于控制器确定需要释放的流表项。 在步骤 205 的同时或者之后, 交换机还执行步骤 206, 即锁定下级流表中的该流表项, 直到在步骤 209中, 接收到释放应答前, 锁定流表项的存储位置不能用于存储其他新的流表项。 而当在锁定流表项期间, 如果有报文到达该下级流表, 那么交换机丟弃 所述报文; 或交换机向控制器发送报文消息, 报文消息携带报文、 存储索引 信息和存储索引信息无效的原因值, 如果在锁定期间没有报文到达, 那么就 不执行该步骤。
对应于步骤 205 , 控制器就执行步骤 104, 即接收交换机发送的流表释放 消息, 然后控制器执行步骤 105 , 即基于流表释放消息, 发送删除消息给交换 机, 以使交换机能够基于删除消息删除使用存储索引信息的其他流表项中的 写入索引指令。
对应于步骤 105 , 交换机就执行步骤 207 , 即接收该删除消息, 并删除使 用该存储索引信息的其他流表项中的写入索引指令。 当删除完成后, 交换机 执行步骤 208 , 即发送删除响应消息给控制器, 以通知控制器已删除完成, 如 此可以避免控制器直接执行步骤 107 ,而造成可能在其他流表项完成删除操作 前, 下级流表仍会出现索引到错误流表项的情况。 因此, 在本实施例中, 增 加删除响应信息, 使得控制器确切的获知交换机是否删除完成。
当控制器在步骤 106中接收删除响应信息后, 就执行步骤 107, 即基于删 除响应信息生成并发送释放应答消息给交换机, 以使交换机解除对下级流表 中的流表项的锁定。 对应的, 交换机执行步骤 209, 接收该释放应答信息, 并 执行步骤 210, 即解除下级流表中的该流表项的锁定, 在解除锁定后, 后续当 控制器再执行步骤 101 , 下发新的流表项时, 可以再次利用该内存位置。
接下来请参考图 10, 为释放流表项的一个具体的实例, 且与图 5中的情 况类似, 该方法包括:
步骤 701 : 表 1向控制器发送流表释放消息, 该消息中包含该流表项的存 储索引信息或者匹配内容。 该消息的格式可以是 Flow Table remove(index or match content)。
步骤 702: 交换机锁定该流表项。
在锁定期间, 可能执行步骤 703至步骤 705 , 即表 1接收报文和存储索引 信息, 那么就会执行步骤 704, 索引到该锁定的流表项, 那么交换机就可以向 控制器发送报文消息, 该消息中可以包括报文、 所述存储索引信息和存储索 引信息无效的原因值。该 4艮文消息的格式可以是 Packet in (reason invalid index, index value , packet)。
然后控制器执行步骤 706, 向表 0发送流表修改消息, 通过该消息指示表 0将删除使用该存储索引信息的流表项中的写入索引指令,该消息的格式可以 是 Flow Table Mod ( OFPFC_Mod/OFPFC_DELETE , Clear index)。
在删除完成后, 表 0向控制器发送流表修改应答消息, 以通知控制器已 删除完成。 该消息的格式可以是 Flow Table mod ACK。
接下来控制器执行步骤 708 , 向表 1发送流表释放应答消息, 以通知交换 机执行步骤 709, 解除对该流表项的锁定。 该消息的格式可以是 Flow Table remove ACK。
通过以上描述可以看出, 通过控制器和交换机之间的控制流程, 使得在 释放流表项时, 不会造成错误的执行流表项对应的指令, 而导致对报文的错 误处理。
实施例二
本申请一实施例中还提供一种交换机,请参考图 11所示,该交换机包括: 第一接收单元 801 , 用于接收一报文; 匹配单元 802, 用于基于前置流表匹配 报文; 处理单元 803 , 用于在匹配成功后, 基于匹配成功的流表项中的写入存 储索引指令, 将存储索引信息随报文发送给下级流表; 其中, 存储索引信息 对应于下级流表中的流表项, 且写入存储索引指令是控制器发送的; 并基于 存储索引信息在下级流表中直接寻址存储索引信息对应的流表项。
进一步, 该交换机还包括: 第二接收单元, 用于接收控制器发送的携带 写入存储索引指令的匹配成功的流表项, 写入存储索引指令的参数包含存储 索引信息。
在进一步的实施例中, 该交换机还包括第一发送单元, 第二接收单元还 用于交换机接收控制器发送的针对下级流表的生成或者修改流表项的消息; 消息中携带返回存储索引指示; 第一发送单元用于基于返回存储索引指示, 将下级流表的流表项对应的存储索引信息发送给控制器。
可选的, 写入存储索引指令具体为写入元数据指令, 处理单元 803具体 用于将存储索引信息写在元数据的固定比特位中, 并随报文发送给下级流表。
在进一步的实施例中, 该交换机还包括第二发送单元和第三接收单元: 第二发送单元, 用于发送流表项释放消息给控制器, 通知控制器下级流表中 的流表项需要释放; 处理单元 803 , 还用于锁定下级流表中的流表项; 第三接 收单元, 用于接收控制器发送的基于释放消息生成的删除消息, 删除使用存 储索引信息的其他流表项中的写入索引指令; 第二发送单元, 还用于在删除 完成后发送删除响应消息给控制器; 第三接收单元, 还用于接收控制器基于 删除响应消息生成的释放应答消息;处理单元 803 ,还用于基于释放应答消息, 解除下级流表中的流表项的锁定。
进一步, 在下级流表中的流表项时, 处理单元 803还用于丟弃 ·^艮文, 或, 第二发送单元还用于向控制器发送报文消息, 报文消息携带报文、 存储索引 信息和存储索引信息无效的原因值。
结合以上各实施例, 存储索引信息包括下级流表的流表项的地址信息, 或下级流表的流表项的地址信息和下级流表的流表标识。
进一步, 下级流表的流表标识具体由处理单元 803或者控制器生成。 前述图 2-图 4实施例中的基于流表的表项寻址方法中的各种变化方式和 具体实例同样适用于本实施例的交换机, 通过前述对基于流表的表项寻址方 法的详细描述, 本领域技术人员可以清楚的知道本实施例中交换机的实施方 法, 所以为了说明书的筒洁, 在此不再详述。
实施例三
本实施例提供一种交换机, 请参考图 12所示, 为交换机的硬件实现示例 的概念图, 该交换机包括: 接口 901 , 用于接收一报文; 处理器 902, 用于基 于前置流表匹配 4艮文; 在匹配成功后, 还基于匹配成功的流表项中的写入存 储索引指令, 将存储索引信息随报文发送给下级流表; 其中, 存储索引信息 对应于下级流表中的流表项, 且写入存储索引指令是控制器发送的; 还基于 存储索引信息在下级流表中直接寻址存储索引信息对应的流表项。 其中, 在图 12中, 总线 900架构 (用总线 900来代表), 总线 900可以 包括任意数量的互联的总线 900和桥, 总线 900将包括由处理器 902代表的 一个或多个处理器 902和存储器 906代表的存储器 906的各种电路链接在一 起。 总线 900还可以将诸如***设备、 稳压器和功率管理电路等之类的各种 其他电路链接在一起, 这些都是本领域所公知的, 因此, 本文不再对其进行 进一步描述。 总线接口 905在总线 900和接收器 903、发送器 904之间提供接 口 901。 接收器 903和发送器 904可以是同一个元件, 即收发机, 提供用于在 传输介质上与各种其他装置通信的单元。 接口 901还用于输出报文。
处理器 902负责管理总线 900和通常的处理, 而存储器 906可以被用于 存储处理器 902在执行操作时所使用的数据, 还用于存储流表。
进一步, 该交换机还包括: 接收器 903 , 用于接收控制器发送的携带写入 存储索引指令的匹配成功的流表项, 写入存储索引指令的参数包含存储索引 信息。
进一步, 该交换机还包括发送器 904,接收器 903还用于接收控制器发送 的针对下级流表的生成或者修改流表项的消息; 消息中携带返回存储索引指 示; 发送器 904具体用于基于返回存储索引指示, 将下级流表的流表项对应 的存储索引信息发送给控制器。
可选的, 写入存储索引指令具体为写入元数据指令, 处理器 902具体用 于将存储索引信息写在元数据的固定比特位中, 并随报文发送给下级流表。
在另一实施例中, 该交换机还包括发送器 904和接收器 903 , 发送器 904 用于发送流表项释放消息给控制器, 通知控制器下级流表中的流表项需要释 放, 并在删除完成后发送删除响应消息给控制器; 接收器 903用于接收控制 器发送的基于释放消息生成的删除消息, 并接收控制器基于删除响应消息生 成的释放应答消息; 处理器 902还用于在发送器 904发送流表项释放消息之 后, 锁定下级流表中的流表项; 并在接收器 903接收到删除消息后, 删除使 用存储索引信息的其他流表项中的写入索引指令; 并在接收器 903接收到释 放应答消息之后解除下级流表中的流表项的锁定。
在进一步的实施例中, 在交换机锁定下级流表中的流表项时, 处理器 902 还用于丟弃报文, 或, 发送器 904还用于向控制器发送报文消息, 报文消息 携带报文、 存储索引信息和存储索引信息无效的原因值。
结合以上各实施例, 存储索引信息包括下级流表的流表项的地址信息, 或下级流表的流表项的地址信息和下级流表的流表标识。
进一步, 下级流表的流表标识具体由处理器 902或者控制器生成。
本实施例中的交换机具体可以是专用的 open flow交换机, 也可以是支持 open flow的交换机。
前述图 2-图 4实施例中的基于流表的表项寻址方法中的各种变化方式和 具体实例同样适用于本实施例的交换机, 通过前述对基于流表的表项寻址方 法的详细描述, 本领域技术人员可以清楚的知道本实施例中交换机的实施方 法, 所以为了说明书的筒洁, 在此不再详述。
实施例四:
本实施例提供一种控制器, 请参考图 13所示, 该控制器包括:
发送单元 1001 , 用于发送针对下级流表的生成或者修改流表项的第一消 息给交换机, 第一消息中携带返回存储索引指示; 还用于发送修改或者创建 前置流表的流表项的第二消息给交换机, 第二消息中携带写入存储索引指令; 接收单元 1002, 用于接收交换机基于返回存储索引指示返回的下级流表的流 表项的存储索引信息; 其中, 写入存储索引指令的参数包含存储索引信息, 以使交换机能够基于存储索引信息在下级流表中直接寻址存储索引信息对应 的流表项。
其中, 写入存储索引指令具体为: 新定义的操作指令; 或写入元数据指 令; 存储索引信息写在元数据的固定比特位中。
进一步, 存储索引信息包括下级流表的流表项的地址信息, 或下级流表 的流表项的地址信息和下级流表的流表标识。
进一步, 下级流表的流表标识具体由交换机或者控制器的处理单元生成。 进一步, 接收单元 1002具体还用于: 接收交换机发送的流表释放消息, 接收交换机发送的删除响应信息, 删除响应信息表征交换机已删除完成; 发 送单元 1001具体还用于: 基于流表释放消息, 发送删除消息给交换机, 以使 交换机能够基于删除消息删除使用存储索引信息的其他流表项中的写入索引 指令; 基于删除响应信息生成并发送释放应答消息给交换机, 以使交换机解 除对下级流表中的流表项的锁定。
进一步, 接收单元 1002具体还用于接收交换机发送的报文消息, 报文消 息携带报文、 存储索引信息和存储索引信息无效的原因值。
前述图 2-图 4实施例中的基于流表的表项寻址方法中的各种变化方式和 具体实例同样适用于本实施例的控制器, 通过前述对基于流表的表项寻址方 法的详细描述, 本领域技术人员可以清楚的知道本实施例中控制器的实施方 法, 所以为了说明书的筒洁, 在此不再详述。
实施例五
本实施例提供一种控制器, 请参考图 14所示, 为控制器的硬件实现示例 的框图, 该控制器具体可以是 open flow控制器。 该控制器包括:
发送器 1101 , 用于发送针对下级流表的生成或者修改流表项的第一消息 给交换机, 第一消息中携带返回存储索引指示; 还用于发送修改或者创建前 置流表的流表项的第二消息给交换机, 第二消息中携带写入存储索引指令; 接收器 1102, 用于接收交换机基于返回存储索引指示返回的下级流表的流表 项的存储索引信息; 其中, 写入存储索引指令的参数包含存储索引信息, 以 使交换机能够基于存储索引信息在下级流表中直接寻址存储索引信息对应的 流表项。
在图 14中, 总线 1100架构 (用总线 1100来代表), 总线 1100可以包括 任意数量的互联的总线 1100和桥, 总线 1100将包括由处理器 1104代表的一 个或多个处理器 1104和存储器 1105代表的存储器 1105的各种电路链接在一 起。 总线 1100还可以将诸如***设备、 稳压器和功率管理电路等之类的各种 其他电路链接在一起, 这些都是本领域所公知的, 因此, 本文不再对其进行 进一步描述。 总线接口 1103在总线 1100和接收器 1102、 和 /或发送器 1101 之间提供接口。 接收器 1102和发送器 1101可以是同一个元件, 即收发机, 提供用于在传输介质上与各种其他装置通信的单元。
处理器 1104负责管理总线 1100和通常的处理, 处理器 1104还用于确定 流表项。 而存储器 1105可以被用于存储处理器 1104在执行操作时所使用的 数据。
处理器 1104可以提供各种功能, 包括定时, ***接口, 电压调节、 电源 管理以及其他控制功能。
在一实施例中, 接收器 1102具体还用于: 接收交换机发送的流表释放消 息, 接收交换机发送的删除响应信息, 删除响应信息表征交换机已删除完成; 发送器 1101具体还用于: 基于流表释放消息, 发送删除消息给交换机, 以使 交换机能够基于删除消息删除使用存储索引信息的其他流表项中的写入索引 指令; 基于删除响应信息生成并发送释放应答消息给交换机, 以使交换机解 除对下级流表中的流表项的锁定。
进一步, 接收器 1102具体还用于接收交换机发送的报文消息, 报文消息 携带报文、 存储索引信息和存储索引信息无效的原因值。
其中, 写入存储索引指令具体为: 新定义的操作指令; 或写入元数据指 令; 存储索引信息写在元数据的固定比特位中。
进一步, 存储索引信息包括下级流表的流表项的地址信息, 或下级流表 的流表项的地址信息和下级流表的流表标识。
进一步, 下级流表的流表标识具体由交换机或者控制器的处理器 1104生 成。
前述图 2-图 4实施例中的基于流表的表项寻址方法中的各种变化方式和 具体实例同样适用于本实施例的控制器, 通过前述对基于流表的表项寻址方 法的详细描述, 本领域技术人员可以清楚的知道本实施例中控制器的实施方 法, 所以为了说明书的筒洁, 在此不再详述。
本申请实施例中提供的一个或多个技术方案, 至少具有如下技术效果或 优点:
本申请实施例中, 交换机接收一报文; 交换机基于前置流表匹配报文; 在匹配成功后, 交换机基于匹配成功的流表项中的写入存储索引指令, 将存 储索引信息随报文发送给下级流表; 其中, 存储索引信息对应于下级流表中 的流表项, 且写入存储索引指令是控制器发送的; 交换机基于存储索引信息 在下级流表中直接寻址存储索引信息对应的流表项。 因此, 在本申请实施例 中, 首先前置流表的流表项里具有写入存储索引指令, 而基于该写入存储索 引指令能够将存储索引信息随报文一起发送给下级流表, 那么下级流表在收 到该报文时, 可根据该存储索引信息直接定位到与该存储索引信息对应的流 表项, 而不需要在下级流表中一个个进行内容匹配, 所以能够解决使用内容 匹配导致的效率低和操作复杂的技术问题, 达到提高报文的处理速度, 减少 报文处理处理时延的技术效果, 使得 open flow交换机可以实现更高线速的报 文转发和更低的设备成本。
本领域内的技术人员应明白, 本申请的实施例可提供为方法、 ***、 或 计算机程序产品。 因此, 本申请可采用完全硬件实施例、 完全软件实施例、 或结合软件和硬件方面的实施例的形式。 而且, 本申请可采用在一个或多个 其中包含有计算机可用程序代码的计算机可用存储介质 (包括但不限于磁盘 存储器和光学存储器等 )上实施的计算机程序产品的形式。
本申请是参照根据本申请实施例的方法、 设备(***)、 和计算机程序产 品的流程图和 /或方框图来描述的。 应理解可由计算机程序指令实现流程图 和 /或方框图中的每一流程和 /或方框、 以及流程图和 /或方框图中的流程 和 /或方框的结合。 可提供这些计算机程序指令到通用计算机、 专用计算机、 嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器, 使得通 过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流 程图一个流程或多个流程和 /或方框图一个方框或多个方框中指定的功能的 备以特定方式工作的计算机可读存储器中, 使得存储在该计算机可读存储器 中的指令产生包括指令装置的制造品, 该指令装置实现在流程图一个流程或 多个流程和 /或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上, 使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的 处理, 从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图 一个流程或多个流程和 /或方框图一个方框或多个方框中指定的功能的步 骤。
显然, 本领域的技术人员可以对本申请进行各种改动和变型而不脱离本 申请的精神和范围。 这样, 倘若本申请的这些修改和变型属于本申请权利要 求及其等同技术的范围之内, 则本申请也意图包含这些改动和变型在内。

Claims

权 利 要 求
1、 一种基于流表的表项寻址方法, 其特征在于, 包括:
交换机接收一报文;
所述交换机基于前置流表匹配所述报文;
在匹配成功后, 所述交换机基于匹配成功的流表项中的写入存储索引指 令, 将存储索引信息随所述报文发送给下级流表; 其中, 所述存储索引信息 对应于所述下级流表中的流表项, 且所述写入存储索引指令是控制器发送的; 所述交换机基于所述存储索引信息在所述下级流表中直接寻址所述存储 索引信息对应的流表项。
2、 如权利要求 1所述的方法, 其特征在于, 在所述交换机接收一报文之 前, 还包括:
所述交换机接收所述控制器发送的携带所述写入存储索引指令的所述匹 配成功的流表项, 所述写入存储索引指令的参数包含所述存储索引信息。
3、 如权利要求 2所述的方法, 其特征在于, 在所述交换机接收所述控制 器发送的携带所述写入存储索引指令的所述匹配成功的流表项之前, 还包括: 所述交换机接收所述控制器发送的针对所述下级流表的生成或者修改流 表项的消息; 所述消息中携带返回存储索引指示;
所述交换机基于所述返回存储索引指示, 将所述下级流表的流表项对应 的所述存储索引信息发送给所述控制器。
4、 如权利要求 2或 3所述的方法, 其特征在于, 所述写入存储索引指令 具体为:
新定义的操作指令; 或
写入元数据指令; 所述将存储索引信息随所述报文发送给下级流表具体 为: 将所述存储索引信息写在元数据的固定比特位中, 并随所述报文发送给 所述下级流表。
5、 如权利要求 1至 4任一项所述的方法, 其特征在于, 所述存储索引信 息包括所述下级流表的流表项的地址信息, 或所述下级流表的流表项的地址 信息和所述下级流表的流表标识。
6、 如权利要求 5所述的方法, 其特征在于, 所述下级流表的流表标识具 体由所述交换机或者所述控制器生成。
7、 如权利要求 1至 6任一项所述的方法, 其特征在于, 还包括: 所述交换机发送流表项释放消息给所述控制器, 通知所述控制器所述下 级流表中的流表项需要释放;
所述交换机锁定所述下级流表中的流表项;
所述交换机接收所述控制器发送的基于所述释放消息生成的删除消息, 删除使用所述存储索引信息的其他流表项中的所述写入索引指令;
所述交换机在删除完成后发送删除响应消息给所述控制器;
所述交换机接收所述控制器基于所述删除响应消息生成的释放应答消 息;
所述交换机基于所述释放应答消息, 解除所述下级流表中的流表项的锁 定。
8、 如权利要求 7所述的方法, 其特征在于, 在所述交换机锁定所述下级 流表中的流表项时, 还包括:
所述交换机丟弃所述报文; 或
所述交换机向所述控制器发送报文消息, 所述报文消息携带所述报文、 所述存储索引信息和存储索引信息无效的原因值。
9、 一种基于流表的表项寻址方法, 其特征在于, 包括:
控制器发送针对下级流表的生成或者修改流表项的第一消息给交换机, 所述第一消息中携带返回存储索引指示;
所述控制器接收所述交换机基于所述返回存储索引指示返回的所述下级 流表的流表项的存储索引信息;
所述控制器发送修改或者创建前置流表的流表项的第二消息给所述交换 机, 所述第二消息中携带写入存储索引指令, 所述写入存储索引指令的参数 包含所述存储索引信息, 以使所述交换机能够基于所述存储索引信息在所述 下级流表中直接寻址所述存储索引信息对应的流表项。
10、 如权利要求 9所述的方法, 其特征在于, 所述写入存储索引指令具 体为:
新定义的操作指令; 或
写入元数据指令; 所述存储索引信息写在元数据的固定比特位中。
11、 如权利要求 9或 10所述的方法, 其特征在于, 所述存储索引信息包 括所述下级流表的流表项的地址信息, 或所述下级流表的流表项的地址信息 和所述下级流表的流表标识。
12、 如权利要求 11所述的方法, 其特征在于, 所述下级流表的流表标识 具体由所述交换机或者所述控制器生成。
13、 如权利要求 9至 12任一项所述的方法, 其特征在于, 在所述控制器 发送修改或者创建前置流表的流表项的第二消息给所述交换机之后, 还包括: 所述控制器接收所述交换机发送的流表释放消息;
所述控制器基于所述流表释放消息, 发送删除消息给所述交换机, 以使 所述交换机能够基于所述删除消息删除使用所述存储索引信息的其他流表项 中的所述写入索引指令;
所述控制器接收所述交换机发送的删除响应信息, 所述删除响应信息表 征所述交换机已删除完成;
所述控制器基于所述删除响应信息生成并发送释放应答消息给所述交换 机, 以使所述交换机解除对所述下级流表中的流表项的锁定。
14、 如权利要求 13所述的方法, 其特征在于, 在所述控制器接收所述交 换机发送的流表释放消息之后, 还包括:
所述控制器接收所述交换机发送的报文消息, 所述报文消息携带报文、 所述存储索引信息和存储索引信息无效的原因值。
15、 一种交换机, 其特征在于, 包括:
第一接收单元, 用于接收一报文; 匹配单元, 用于基于前置流表匹配所述报文;
处理单元, 用于在匹配成功后, 基于匹配成功的流表项中的写入存储索 引指令, 将存储索引信息随所述报文发送给下级流表; 其中, 所述存储索引 信息对应于所述下级流表中的流表项, 且所述写入存储索引指令是控制器发 送的; 并基于所述存储索引信息在所述下级流表中直接寻址所述存储索引信 息对应的流表项。
16、 如权利要求 15所述的交换机, 其特征在于, 还包括:
第二接收单元, 用于接收所述控制器发送的携带所述写入存储索引指令 的所述匹配成功的流表项, 所述写入存储索引指令的参数包含所述存储索引 信息。
17、 如权利要求 16所述的交换机, 其特征在于, 还包括第一发送单元, 所述第二接收单元还用于交换机接收所述控制器发送的针对所述下级流 表的生成或者修改流表项的消息; 所述消息中携带返回存储索引指示;
所述第一发送单元用于基于所述返回存储索引指示, 将所述下级流表的 流表项对应的所述存储索引信息发送给所述控制器。
18、 如权利要求 16或 17所述的交换机, 其特征在于, 所述写入存储索 引指令具体为写入元数据指令, 所述处理单元具体用于将所述存储索引信息 写在元数据的固定比特位中, 并随所述报文发送给所述下级流表。
19、 如权利要求 15-18任一项所述的交换机, 其特征在于, 还包括第二发 送单元和第三接收单元:
所述第二发送单元, 用于发送流表项释放消息给所述控制器, 通知所述 控制器所述下级流表中的流表项需要释放;
所述处理单元, 还用于锁定所述下级流表中的流表项;
所述第三接收单元, 用于接收所述控制器发送的基于所述释放消息生成 的删除消息, 删除使用所述存储索引信息的其他流表项中的所述写入索引指 令;
所述第二发送单元, 还用于在删除完成后发送删除响应消息给所述控制 器;
所述第三接收单元, 还用于接收所述控制器基于所述删除响应消息生成 的释放应答消息;
所述处理单元, 还用于基于所述释放应答消息, 解除所述下级流表中的 流表项的锁定。
20、 如权利要求 19所述的交换机, 其特征在于, 在所述下级流表中的流 表项时, 所述处理单元还用于丟弃所述报文, 或, 所述第二发送单元还用于 向所述控制器发送报文消息, 所述报文消息携带所述报文、 所述存储索引信 息和存储索引信息无效的原因值。
21、 一种控制器, 其特征在于, 包括:
发送单元, 用于发送针对下级流表的生成或者修改流表项的第一消息给 交换机, 所述第一消息中携带返回存储索引指示; 还用于发送修改或者创建 前置流表的流表项的第二消息给所述交换机, 所述第二消息中携带写入存储 索引指令;
接收单元, 用于接收所述交换机基于所述返回存储索引指示返回的所述 下级流表的流表项的存储索引信息;
其中, 所述写入存储索引指令的参数包含所述存储索引信息, 以使所述 交换机能够基于所述存储索引信息在所述下级流表中直接寻址所述存储索引 信息对应的流表项。
22、 如权利要求 21所述的控制单元, 其特征在于, 所述接收单元具体还 用于: 接收所述交换机发送的流表释放消息, 接收所述交换机发送的删除响 应信息, 所述删除响应信息表征所述交换机已删除完成;
所述发送单元具体还用于: 基于所述流表释放消息, 发送删除消息给所 述交换机, 以使所述交换机能够基于所述删除消息删除使用所述存储索引信 息的其他流表项中的所述写入索引指令; 基于所述删除响应信息生成并发送 释放应答消息给所述交换机, 以使所述交换机解除对所述下级流表中的流表 项的锁定。
23、 如权利要求 22所述的控制单元, 其特征在于, 所述接收单元具体还 用于接收所述交换机发送的报文消息, 所述报文消息携带报文、 所述存储索 引信息和存储索引信息无效的原因值。
PCT/CN2013/087434 2013-11-19 2013-11-19 一种基于流表的表项寻址方法、交换机及控制器 WO2015074182A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
PCT/CN2013/087434 WO2015074182A1 (zh) 2013-11-19 2013-11-19 一种基于流表的表项寻址方法、交换机及控制器
EP13897999.2A EP3059906B1 (en) 2013-11-19 2013-11-19 Table items addressing method, switch, and controller based on flow table
CN201380002319.1A CN105052087B (zh) 2013-11-19 2013-11-19 一种基于流表的表项寻址方法、交换机及控制器
US15/157,791 US10015095B2 (en) 2013-11-19 2016-05-18 Flow table-based table entry addressing method, switch, and controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2013/087434 WO2015074182A1 (zh) 2013-11-19 2013-11-19 一种基于流表的表项寻址方法、交换机及控制器

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US15/157,791 Continuation US10015095B2 (en) 2013-11-19 2016-05-18 Flow table-based table entry addressing method, switch, and controller

Publications (1)

Publication Number Publication Date
WO2015074182A1 true WO2015074182A1 (zh) 2015-05-28

Family

ID=53178782

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/087434 WO2015074182A1 (zh) 2013-11-19 2013-11-19 一种基于流表的表项寻址方法、交换机及控制器

Country Status (4)

Country Link
US (1) US10015095B2 (zh)
EP (1) EP3059906B1 (zh)
CN (1) CN105052087B (zh)
WO (1) WO2015074182A1 (zh)

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103595647B (zh) * 2013-11-27 2014-08-06 北京邮电大学 一种基于OpenFlow的SDN虚拟化平台下行信令处理方法
CN105099913B (zh) * 2014-04-21 2018-07-20 新华三技术有限公司 一种报文转发方法及设备
CN105556916B (zh) * 2014-08-25 2019-03-08 华为技术有限公司 网络流的信息统计方法和装置
CN105471744B (zh) * 2014-09-19 2018-10-09 新华三技术有限公司 一种虚拟机迁移方法和装置
US9880768B2 (en) 2015-01-27 2018-01-30 Barefoot Networks, Inc. Dynamic memory reallocation for match-action packet processing
US9910615B2 (en) 2015-02-23 2018-03-06 Barefoot Networks, Inc. Coding scheme for indirect addressing of multiple action memories
US10225161B2 (en) * 2016-10-31 2019-03-05 Accedian Networks Inc. Precise statistics computation for communication networks
CN107682266B (zh) * 2017-09-12 2021-02-26 杭州迪普科技股份有限公司 流表项的匹配方法及装置、计算机可读存储介质
US10938819B2 (en) * 2017-09-29 2021-03-02 Fisher-Rosemount Systems, Inc. Poisoning protection for process control switches
CN108322391B (zh) * 2017-12-29 2020-08-25 ***股份有限公司 基于流表的数据传送方法
JP2020005051A (ja) * 2018-06-26 2020-01-09 富士通株式会社 制御プログラム、制御装置、及び制御方法
CN109921996B (zh) * 2018-12-29 2021-11-09 长沙理工大学 一种高性能的OpenFlow虚拟流表查找方法
CN109818834B (zh) * 2019-03-25 2020-09-15 国家计算机网络与信息安全管理中心 一种轻量级的sdn流表规则探测工具及探测方法
CN112383479B (zh) * 2020-10-15 2022-03-22 国家计算机网络与信息安全管理中心 规则查询方法、装置、计算机设备和存储介质
CN116527568B (zh) * 2023-07-03 2023-10-31 北京左江科技股份有限公司 一种网络报文处理实时更新流表关联的实现方法
CN117336169A (zh) * 2023-09-28 2024-01-02 南京金阵微电子技术有限公司 以太网流表的配置方法、装置、芯片、交换机和介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101267331A (zh) * 2008-04-23 2008-09-17 华为技术有限公司 一种组播转发表查找方法和装置
CN101540723A (zh) * 2009-04-20 2009-09-23 杭州华三通信技术有限公司 一种流表查找方法和装置
CN101594319A (zh) * 2009-06-26 2009-12-02 华为技术有限公司 表项查找方法和装置
CN102301663A (zh) * 2011-07-06 2011-12-28 华为技术有限公司 一种报文处理方法及相关设备
US20130275592A1 (en) * 2012-04-11 2013-10-17 Meng Xu Adaptive session forwarding following virtual machine migration detection

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7657725B2 (en) * 2005-06-24 2010-02-02 Sigmatel, Inc. Integrated circuit with memory-less page table
CN100396015C (zh) * 2006-03-29 2008-06-18 华为技术有限公司 一种tcam路由表管理方法和***
US8483096B2 (en) * 2008-07-22 2013-07-09 The Regents Of The University Of California Scalable commodity data center network architecture
JP5561366B2 (ja) * 2010-09-08 2014-07-30 日本電気株式会社 スイッチシステム、スイッチ制御方法、及び記憶媒体
US8971338B2 (en) * 2012-01-09 2015-03-03 Telefonaktiebolaget L M Ericsson (Publ) Expanding network functionalities for openflow based split-architecture networks
US20140040459A1 (en) * 2012-08-01 2014-02-06 Hewlett-Packard Development Company, L.P. System and method for data communication using a classified flow table in openflow networks

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101267331A (zh) * 2008-04-23 2008-09-17 华为技术有限公司 一种组播转发表查找方法和装置
CN101540723A (zh) * 2009-04-20 2009-09-23 杭州华三通信技术有限公司 一种流表查找方法和装置
CN101594319A (zh) * 2009-06-26 2009-12-02 华为技术有限公司 表项查找方法和装置
CN102301663A (zh) * 2011-07-06 2011-12-28 华为技术有限公司 一种报文处理方法及相关设备
US20130275592A1 (en) * 2012-04-11 2013-10-17 Meng Xu Adaptive session forwarding following virtual machine migration detection

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3059906A4 *

Also Published As

Publication number Publication date
EP3059906B1 (en) 2018-06-20
CN105052087A (zh) 2015-11-11
EP3059906A1 (en) 2016-08-24
EP3059906A4 (en) 2016-11-16
US10015095B2 (en) 2018-07-03
US20160269287A1 (en) 2016-09-15
CN105052087B (zh) 2018-10-09

Similar Documents

Publication Publication Date Title
WO2015074182A1 (zh) 一种基于流表的表项寻址方法、交换机及控制器
JP5846221B2 (ja) ネットワークシステム、及びトポロジー管理方法
TWI521437B (zh) 用於網路的方法和系統
WO2016000362A1 (zh) 一种配置流表项的方法、装置和***
US10050859B2 (en) Apparatus for processing network packet using service function chaining and method for controlling the same
WO2015143802A1 (zh) 业务功能链处理方法及装置
WO2014089799A1 (zh) 一种确定虚拟机漂移的方法和装置
WO2015184771A1 (zh) 一种业务功能链操作、管理和维护方法及节点设备
US20210399908A1 (en) Multicast routing
KR101355062B1 (ko) 낮은 지연시간의 네트워킹을 위한 방법 및 시스템
CN101741855A (zh) 地址解析协议缓存表维护方法和网络设备
JP5682846B2 (ja) ネットワークシステム、パケット処理方法、及び記憶媒体
CN110235417B (zh) 一种sdn及其报文转发的方法和装置
WO2015103869A1 (zh) 一种软件定义网络中OpenFlow消息跟踪和过滤的方法
CN103841016A (zh) 一种可编程虚拟化路由器多协议类型数据包并行处理方法及装置
CN100579075C (zh) 一种快速响应icmp回送请求报文的方法
CN112994928B (zh) 一种虚拟机的管理方法、装置及***
WO2012139448A1 (zh) 一种生成组播转发表、组播传输的方法及装置
CN108270675B (zh) 流表实现控制器、转发设备、***和方法
JP4988053B2 (ja) ネットワーク装置
JP4728436B2 (ja) インターネットワーク装置
JP4728435B2 (ja) インターネットワーク装置
JP4786749B2 (ja) インターネットワーク装置
JP2016005146A (ja) 中継装置
CN106034115B (zh) 虚拟网络的实现方法、装置及***

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 201380002319.1

Country of ref document: CN

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13897999

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

REEP Request for entry into the european phase

Ref document number: 2013897999

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 2013897999

Country of ref document: EP