CN111404810B - Openflow flow table recovery method and device, electronic equipment and medium - Google Patents

Openflow flow table recovery method and device, electronic equipment and medium Download PDF

Info

Publication number
CN111404810B
CN111404810B CN201910002348.7A CN201910002348A CN111404810B CN 111404810 B CN111404810 B CN 111404810B CN 201910002348 A CN201910002348 A CN 201910002348A CN 111404810 B CN111404810 B CN 111404810B
Authority
CN
China
Prior art keywords
flow table
switch
openflow
entry
flow
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910002348.7A
Other languages
Chinese (zh)
Other versions
CN111404810A (en
Inventor
于伟明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
China Mobile Communications Ltd Research Institute
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Communications Ltd Research Institute
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 China Mobile Communications Group Co Ltd, China Mobile Communications Ltd Research Institute filed Critical China Mobile Communications Group Co Ltd
Priority to CN201910002348.7A priority Critical patent/CN111404810B/en
Publication of CN111404810A publication Critical patent/CN111404810A/en
Application granted granted Critical
Publication of CN111404810B publication Critical patent/CN111404810B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/02Topology update or discovery
    • H04L45/021Ensuring consistency of routing table updates, e.g. by using epoch numbers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/28Routing or path finding of packets in data switching networks using route fault recovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/25Routing or path finding in a switch fabric
    • H04L49/252Store and forward routing

Abstract

The invention discloses an openflow flow table recovery method, an openflow flow table recovery device, electronic equipment and a storage medium, wherein the method comprises the following steps: receiving a flow table recovery request which is sent by a user and contains address information of the switch of the openflow flow table to be recovered, and sending a flow table recovery notice to the switch of the address information; and determining each flow table entry to be updated in the first openflow flow table according to the first openflow flow table and the generated full openflow flow table of the switch of the address information, and sending each flow table entry to be updated and the corresponding updating method to the switch. In the invention, each flow table item to be updated is determined by comparing the first openflow table with the generated total openflow table of the switch, so that the switch can realize the recovery of the first openflow table according to each flow table item and the corresponding updating method.

Description

Openflow flow table recovery method and device, electronic equipment and medium
Technical Field
The invention relates to the technical field of network function virtualization and software defined networking, in particular to an openflow flow table recovery method, device, electronic equipment and storage medium.
Background
The underlying data paths (switches, routers) in Openflow are "dumb, simple, minimal", and define a public API on the flow table that is open to the outside, while the control server is used to control the entire network. The researcher can freely call the underlying API to program on the control server, thereby realizing the innovation of the network. Openflow converts the original message forwarding process completely controlled by a Switch/router into a process jointly completed by an Openflow Switch (Openflow Switch) and a control server (Controller), thereby realizing the separation of data forwarding and routing control. The control server can control the flow table in the Openflow switch through the interface operation specified in advance, so that the purpose of controlling data forwarding is achieved.
An OVS (OpenvSwitch) is an open-source software switch, and may be installed in a general virtual server environment, where different virtual hosts on a single or multiple physical machines in the virtual environment need to exchange data through the OVS.
After the system runs for a period of time, the openflow service flow table carried by the OVS may be deleted by mistake or artificially, which may cause abnormal flow forwarding and service interruption. However, the current openflow flow table is missing, and the completion of the flow table can only be completed by manually adding the corresponding flow table or by adopting methods such as service re-creation and the like.
Specifically, the process of manually adding is that a software developer calculates and obtains a missing flow entry by analyzing a service code, and then completes the missing flow entry, the missing flow entry is obtained by manual analysis and calculation, and the efficiency of manually adding the flow entry is low; the method for reestablishing the service is adopted, after an abnormal alarm of the system is received, a full amount openflow flow table is generated to replace the openflow flow table in the OVS, and when the openflow flow table is replaced, the service interruption can be caused.
Disclosure of Invention
The embodiment of the invention provides an openflow flow table recovery method, an openflow flow table recovery device, electronic equipment and a storage medium, and aims to solve the problem of service interruption in the prior art.
The embodiment of the invention provides an openflow flow table recovery method, which comprises the following steps:
receiving a flow table recovery request which is sent by a user and contains address information of a switch of an openflow flow table to be recovered, and sending a flow table recovery notice to the switch of the address information;
receiving a first openflow flow table which is sent by the switch and is locally stored by the switch;
determining each flow table entry to be updated in the first openflow flow table according to the first openflow flow table and the generated full-amount openflow flow table of the switch of the address information, and sending each flow table entry to be updated and the corresponding updating method to the switch, so that the switch recovers the first openflow flow table by adopting the corresponding updating method according to each flow table entry.
Further, determining each flow entry to be updated in the first openflow flow table according to the first openflow flow table and the generated full openflow flow table of the switch of the address information includes:
and determining a flow table entry to be added, a flow table entry to be deleted and a flow table entry to be modified in the first openflow flow table according to the first openflow flow table and the generated full openflow table of the switch of the address information.
Further, the sending each flow entry to be updated and the corresponding updating method to the switch includes:
if the flow table entry to be added exists, the flow table entry to be added and an adding instruction are sent to the switch;
if the flow entry to be deleted exists, the flow entry to be deleted and a deletion instruction are sent to the switch;
and if the flow table entry to be modified exists, sending the flow table entry to be modified and a modification instruction to the switch.
Further, the receiving of the flow table recovery request containing the address information of the switch of the openflow flow table to be recovered, which is sent by the user, includes:
and receiving a flow table recovery request which is sent by a user and contains address information of the switch of the openflow flow table to be recovered through the restAPI.
Further, the sending of the flow table recovery notification to the switch of the address information includes:
the control server issues a preset field containing extension configuration through an open virtual switch database protocol, wherein the preset field is a other _ config field in a Controller table.
The embodiment of the invention provides an openflow flow table recovery method, which comprises the following steps:
receiving a flow table recovery notification sent by a control server, and sending a first openflow flow table stored locally to the control server;
receiving each flow table item to be updated and a corresponding updating method sent by the control server;
and recovering the first openflow flow table according to each flow table entry to be updated and the corresponding updating method.
Further, the recovering the first openflow flow table according to each flow table entry to be updated and the corresponding updating method includes:
if the flow table entry to be added and the identification updating method are added adding instructions, adding the flow table entry to be added into the first openflow flow table according to the adding instructions;
if a flow entry to be deleted and a deletion instruction for deleting the identifier updating method are received, deleting the flow entry to be deleted in the first openflow flow table according to the deletion instruction;
and if the received flow table entry to be modified and the identifier updating method are modified modification instructions, modifying the flow table entry to be modified in the first openflow flow table according to the modification instructions.
Further, the receiving of the flow table recovery notification sent by the control server includes:
and receiving a preset field containing extension configuration sent by the control server through an open virtual switch database protocol, wherein the preset field is a other _ config field in a Controller table.
The embodiment of the invention provides an openflow flow table recovery device, which comprises:
the receiving and sending module is used for receiving a flow table recovery request which is sent by a user and contains address information of the switch of the openflow flow table to be recovered, and sending a flow table recovery notice to the switch of the address information;
the receiving module is used for receiving a first openflow flow table which is sent by the switch and locally stored by the switch;
and the determining and sending module is used for determining each flow table item to be updated in the first openflow flow table according to the first openflow flow table and the generated full-capacity openflow flow table of the switch of the address information, and sending each flow table item to be updated and the corresponding updating method to the switch, so that the switch adopts the corresponding updating method to recover the first openflow flow table according to each flow table item.
Further, the determining and sending module is specifically configured to determine, according to the first openflow flow table and the generated full openflow flow table of the switch of the address information, a flow table entry to be added, a flow table entry to be deleted, and a flow table entry to be modified in the first openflow flow table.
Further, the determining and sending module is specifically configured to send the flow entry to be added and the adding instruction to the switch if the flow entry to be added exists;
if the flow table item to be deleted exists, the flow table item to be deleted and a deletion instruction are sent to the switch;
and if the flow table entry to be modified exists, sending the flow table entry to be modified and a modification instruction to the switch.
Further, the receiving and sending module is specifically configured to receive, through the restAPI, a flow table recovery request that is sent by the user and contains address information of the switch of the openflow flow table to be recovered.
Further, the receiving and sending module is specifically configured to send a preset field containing extension configuration by the control server through an open virtual switch database protocol, where the preset field is a other _ config field in the Controller table.
The embodiment of the invention provides an openflow flow table recovery device, which comprises:
the receiving and sending module is used for receiving a flow table recovery notification sent by the control server and sending a first openflow flow table stored locally to the control server;
a receiving module, configured to receive each flow entry to be updated and a corresponding update method sent by the control server;
and the recovery module is used for recovering the first openflow flow table according to each flow table entry to be updated and the corresponding updating method.
Further, the recovery module is specifically configured to, if a flow table entry to be added and an addition instruction for which the identifier update method is added are received, add the flow table entry to be added to the first openflow flow table according to the addition instruction;
if a deleting instruction for deleting the flow entries to be deleted and the identification updating method is received, deleting the flow entries to be deleted in the first openflow flow table according to the deleting instruction;
and if the received flow table entry to be modified and the identifier updating method are modified modification instructions, modifying the flow table entry to be modified in the first openflow flow table according to the modification instructions.
Further, the receiving and sending module is specifically configured to receive a preset field that includes an extended configuration and is sent by the control server through an open virtual switch database protocol, where the preset field is a other _ config field in a Controller table.
The embodiment of the invention provides electronic equipment, which comprises a memory and a processor;
the processor is used for reading the program in the memory and executing the following processes:
receiving a flow table recovery request which is sent by a user and contains address information of a switch of an openflow flow table to be recovered, and sending a flow table recovery notice to the switch of the address information;
receiving a first openflow flow table which is sent by the switch and is locally stored by the switch;
determining each flow table entry to be updated in the first openflow flow table according to the first openflow flow table and the generated full-amount openflow flow table of the switch of the address information, and sending each flow table entry to be updated and the corresponding updating method to the switch, so that the switch recovers the first openflow flow table by adopting the corresponding updating method according to each flow table entry.
Further, the processor is specifically configured to determine, according to the first openflow flow table and the generated full openflow flow table of the switch of the address information, a flow table entry to be added, a flow table entry to be deleted, and a flow table entry to be modified in the first openflow flow table.
Further, the processor is specifically configured to send the flow entry to be added and an addition instruction to the switch if the flow entry to be added exists;
if the flow table item to be deleted exists, the flow table item to be deleted and a deletion instruction are sent to the switch;
and if the flow table entry to be modified exists, sending the flow table entry to be modified and a modification instruction to the switch.
Further, the processor is specifically configured to receive, through the restAPI, a flow table recovery request that is sent by the user and contains address information of the switch of the openflow flow table to be recovered.
Further, the processor is specifically configured to issue, by the control server, a preset field containing an extended configuration through an open virtual switch database protocol, where the preset field is a second _ config field in the Controller table.
The embodiment of the invention provides electronic equipment, which comprises a memory and a processor;
the processor is used for reading the program in the memory and executing the following processes:
receiving a flow table recovery notification sent by a control server, and sending a first openflow flow table stored locally to the control server;
receiving each flow table item to be updated and a corresponding updating method sent by the control server;
and recovering the first openflow flow table according to each flow table entry to be updated and the corresponding updating method.
Further, the processor is specifically configured to, if a flow table entry to be added and an addition instruction for which the identifier update method is added are received, add the flow table entry to be added to the first openflow flow table according to the addition instruction;
if a flow entry to be deleted and a deletion instruction for deleting the identifier updating method are received, deleting the flow entry to be deleted in the first openflow flow table according to the deletion instruction;
and if the received flow table entry to be modified and the identifier updating method are modified modification instructions, modifying the flow table entry to be modified in the first openflow flow table according to the modification instructions.
Further, the processor is specifically configured to receive a preset field that includes an extended configuration and is issued by the control server through an open virtual switch database protocol, where the preset field is a second _ config field in a Controller table.
An embodiment of the present invention further provides an electronic device, where the electronic device includes: the system comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus;
the memory has stored therein a computer program which, when executed by the processor, causes the processor to perform the method steps of any of the above applied to a control server.
An embodiment of the present invention further provides an electronic device, where the electronic device includes: the system comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
the memory has stored therein a computer program which, when executed by the processor, causes the processor to perform the method steps of any of the above applied to a switch.
Embodiments of the present invention further provide a computer-readable storage medium, which stores a computer program executable by an electronic device, and when the program runs on the electronic device, the electronic device is caused to execute any of the method steps applied to a control server.
An embodiment of the present invention further provides a computer-readable storage medium, which stores a computer program executable by an electronic device, and when the program runs on the electronic device, the program causes the electronic device to execute any one of the method steps applied to a switch.
The embodiment of the invention provides a method and a device for recovering an openflow flow table, electronic equipment and a storage medium, wherein the method comprises the following steps: receiving a flow table recovery request which is sent by a user and contains address information of a switch of an openflow flow table to be recovered, and sending a flow table recovery notice to the switch of the address information; receiving a first openflow flow table which is sent by the switch and locally stored by the switch; determining each flow table entry to be updated in the first openflow flow table according to the first openflow flow table and the generated full openflow flow table of the switch of the address information, and sending each flow table entry to be updated and a corresponding updating method to the switch, so that the switch recovers the first openflow flow table according to each flow table entry by adopting the corresponding updating method.
In the embodiment of the invention, the control server sends the flow table recovery notification to the switch according to the flow table recovery request of the user, so that the openflow flow table in the corresponding switch can be recovered based on the requirement of the user, and the first openflow table reported by the switch and the full openflow table are compared when the recovery is carried out, so that each flow table item to be updated is determined, and each flow table item and the corresponding updating method are sent to the switch to recover the local first openflow table, so that the service of the switch is not influenced, and the openflow table recovery efficiency is effectively improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic process diagram of an openflow flow table recovery method according to embodiment 1 of the present invention;
fig. 2 is a second schematic process diagram of an openflow flow table recovery method according to embodiment 5 of the present invention;
fig. 3 is a third process schematic diagram of an openflow flow table recovery method according to embodiment 6 of the present invention;
fig. 4 is a schematic structural diagram of an openflow flow table recovery device according to embodiment 7 of the present invention;
fig. 5 is a second schematic structural diagram of an openflow flow table recovery device according to embodiment 8 of the present invention;
fig. 6 is a schematic view of an electronic device according to embodiment 9 of the present invention;
fig. 7 is a second schematic diagram of an electronic device according to embodiment 10 of the present invention;
fig. 8 is a schematic view of an electronic device according to embodiment 11 of the present invention;
fig. 9 is a second schematic diagram of an electronic device according to embodiment 12 of the present invention.
Detailed Description
The present invention will now be described in further detail with reference to the accompanying drawings, in which it is apparent that the described embodiments are only some, but not all embodiments of the invention. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
Example 1:
fig. 1 provides an openflow flow table recovery method according to an embodiment of the present invention, where the method includes the following steps:
s101: receiving a flow table recovery request containing address information of the switch of the openflow flow table to be recovered, which is sent by a user, and sending a flow table recovery notice to the switch of the address information.
The openflow flow table carried in the switch is an abstraction of the data forwarding function of the network device, and network configuration information of each layer in the network is integrated in the flow table entry of the openflow flow table, so that richer rules can be used during data forwarding. Each flow table entry in the openflow flow table is a packet header field for matching a data packet, a counter for counting the number of the matched data packets, and an action for showing how the matched data packets are processed. After the system runs for a period of time, the flow entry may be deleted by mistake or manually. When a certain flow entry in the flow table is deleted, a service interruption based on the flow entry may be caused, and thus, in order to prevent the service interruption, a recovery operation needs to be performed on the openflow flow table in the switch.
When a certain abnormal alarm is received or a user discovers that the virtual machine flow on the switch is abnormally forwarded, the user sends a flow table recovery request containing the address information of the switch of the openflow flow table to be recovered, wherein the flow table recovery request is used for identifying that the switch of the address information needs to recover the openflow flow table. In the implementation process, a user can send the flow table recovery request to the control server through a client, specifically, a user interaction module is arranged in the client, when a certain abnormal alarm is received or the user finds that virtual machine flow forwarding on the switch is abnormal, the user inputs address information of the switch with the abnormal alarm in an interaction interface, the client generates a flow table recovery request containing the address information of the switch of the openflow table to be recovered according to the address information of the switch input by the user, and sends the flow table recovery request to the control server. After receiving a flow table recovery request sent by a user, the control server sends a flow table recovery notification to the switch of the address information, so that the switch of the address information performs subsequent operations after receiving the flow table recovery notification. In a specific implementation process, the client may be disposed in the control server, or may be disposed in a mobile terminal or other servers.
S102: and receiving a first openflow flow table which is sent by the switch and locally stored by the switch.
After the switch of the address information receives the flow table recovery notification sent by the control server, in order to facilitate subsequent recovery, the switch of the address information sends the first openflow flow table stored locally to the control server. Therefore, the control server receives a first openflow flow table locally stored in the switch, where the first openflow flow table is an openflow flow table currently used in the switch.
S103: determining each flow table entry to be updated in the first openflow flow table according to the first openflow flow table and the generated full openflow flow table of the switch of the address information, and sending each flow table entry to be updated and a corresponding updating method to the switch, so that the switch recovers the first openflow flow table according to each flow table entry by adopting the corresponding updating method.
In order to obtain a flow entry which is missing or changed in a first openflow flow table in a switch, a control server stores a full openflow flow table which the switch actually should have, and determines the flow entry which is missing or changed in the first openflow flow table by comparing the first openflow flow table with the full openflow flow table. The all-quantity openflow flow table stored in the control server and actually due to the switch may be generated when a flow table recovery request containing address information of the switch of the openflow table to be recovered, which is sent by a user, is received, or may be generated according to a preset time period, and the newly generated all-quantity openflow table is replaced with the all-quantity openflow table which is generated and stored before, and the newly generated all-quantity openflow table is stored. For example, the control server may generate a full openflow flow table that the switch of each address information should have every half hour or every hour. Specifically, the control server may generate a full openflow flow table according to existing services, where the existing services include tenants, networks, subnets, virtual machines, routes, firewalls, and security groups.
The process of generating the full openflow flow table by the control server according to the existing service is the prior art, and in the embodiment of the present invention, details of the process are not described.
Because the control server stores the actual total openflow flow table of the switch with the address information, each flow table entry to be updated in the first openflow flow table can be determined by comparing the first openflow flow table with the total openflow flow table. Specifically, each flow entry to be updated may be a flow entry to be added or a flow entry to be deleted, and in order to enable the switch to restore the first openflow flow table, the control server sends each flow entry to be updated and the corresponding update method to the switch of the address information. After receiving each flow table entry to be updated and the corresponding updating method sent by the control server, the switch of the address information adopts the corresponding updating method according to each flow table entry to be updated, thereby realizing the recovery of the first openflow flow table.
In the embodiment of the invention, the control server sends the flow table recovery notification to the switch according to the flow table recovery request of the user, so that the openflow flow table in the corresponding switch can be recovered based on the requirement of the user, and the first openflow table reported by the switch and the full openflow table are compared when the recovery is carried out, so that each flow table item to be updated is determined, and each flow table item and the corresponding updating method are sent to the switch to recover the local first openflow table, so that the service of the switch is not influenced, and the openflow table recovery efficiency is effectively improved.
Example 2:
in order to accurately determine each flow entry to be updated in the first openflow flow table, on the basis of the foregoing embodiment, in an embodiment of the present invention, the determining, according to the first openflow flow table and the full openflow flow table of the switch that generates the address information, each flow entry to be updated in the first openflow flow table includes:
and determining flow table entries to be added, flow table entries to be deleted and flow table entries to be modified in the first openflow flow table according to the first openflow flow table and the generated full-amount openflow table of the switch of the address information.
After the system runs for a period of time, a certain flow entry in the openflow flow table may be deleted by mistake or modified by mistake. Therefore, after the control server receives the first openflow flow table sent by the switch, the full openflow flow table of the switch of the address information is obtained locally, and the flow entry to be added, the flow entry to be deleted and the flow entry to be modified in the first openflow flow table are determined by comparing the first openflow flow table with the full openflow flow table.
Specifically, after receiving a first openflow flow table sent by the switch, the control server compares the first openflow flow table with the full-volume openflow table to perform defect and leakage detection, namely, each flow table entry in the first openflow flow table is respectively matched with each flow table entry in the full-volume openflow table, and according to a matching result, a flow table entry to be added, a flow table entry to be deleted and a flow table entry to be modified are determined.
The flow entry to be added refers to a flow entry that the first openflow flow table is missing, for example, if a certain flow entry in the full-volume openflow flow table does not exist in the first openflow flow table, the flow entry is the flow entry to be added; the flow entry to be deleted refers to a redundant flow entry in the first openflow flow table, for example, if a certain flow entry in the first openflow flow table does not exist in the full openflow flow table, the flow entry is the flow entry to be deleted; the flow table entry to be modified means that a certain flow table entry in the first openflow flow table is different from a certain flow table entry in the full-volume openflow flow table, for example, only source address information in a certain flow table entry in the first openflow flow table is different from source address information of a certain flow table entry in the full-volume openflow table.
In this embodiment of the present invention, in order to enable a switch to recover a first openflow table according to a flow entry to be added, a flow entry to be deleted, and a flow entry to be modified, sending each flow entry to be updated and a corresponding update method to the switch includes:
if the flow entry to be added exists, the flow entry to be added and an adding instruction are sent to the switch;
if the flow table item to be deleted exists, the flow table item to be deleted and a deletion instruction are sent to the switch;
and if the flow table entry to be modified exists, sending the flow table entry to be modified and a modification instruction to the switch.
By comparing the first openflow flow table and the full openflow flow table, at least one of a flow entry to be added, a flow entry to be deleted, and a flow entry to be modified may exist. In order to enable the switch to recover the first openflow flow table according to the received flow table entry to be updated, the control server sends the update method corresponding to each flow table entry to the switch when sending each flow table entry to be updated to the switch, specifically, if the flow table entry to be updated is a flow table entry to be added, the update method corresponding to the flow table entry to be added is an added instruction; if the flow entry to be updated is the flow entry to be deleted, the updating method corresponding to the flow entry to be deleted is a deleting instruction for deleting; and if the flow table entry to be updated is the flow table entry to be modified, the updating method corresponding to the flow table entry to be modified is a modified modifying instruction, so that the switch executes the corresponding updating method for each flow table entry to be updated.
Specifically, when a flow entry to be added exists, the flow entry to be added and a corresponding addition instruction are sent to the switch, where the addition instruction is used to identify that the flow entry to be added needs to be added in the first openflow flow table. And when the flow table entry to be deleted exists, sending the flow table entry to be deleted and a corresponding deletion instruction to the switch, wherein the deletion instruction is used for identifying that the flow table entry to be deleted needs to be deleted in the first openflow flow table. When a flow table entry to be modified exists, sending the flow table entry to be modified and a corresponding modification instruction to the switch, where the modification instruction is used to identify that the flow table entry to be modified needs to be modified in the first openflow flow table, and a specific flow table entry to be modified is specific content of the modified flow table entry or which items in the flow table entry to be modified and the modified content.
Example 3:
in order to better receive a flow table recovery request sent by a user, on the basis of the foregoing embodiments, in an embodiment of the present invention, the receiving of the flow table recovery request sent by the user and containing address information of a switch of an openflow table to be recovered includes:
and receiving a flow table recovery request which is sent by a user and contains address information of the switch of the openflow flow table to be recovered through the restAPI.
When a certain abnormal alarm is received or a user discovers that the virtual machine flow forwarding on the switch is abnormal, the user sends a flow table recovery request containing the address information of the switch of the openflow flow table to be recovered, and the flow table recovery request is used for identifying that the switch of the address information needs to recover the openflow table. In the implementation process, a user can send the flow table recovery request to the control server through a client, specifically, a user interaction module is arranged in the client, when a certain abnormal alarm is received or the user finds that the virtual machine flow on the switch is abnormally forwarded, the user inputs the address information of the switch with the abnormal alarm in an interaction interface, the client generates a flow table recovery request containing the address information of the switch of the openflow table to be recovered according to the address information of the switch input by the user, and sends the flow table recovery request to the control server, wherein the flow table recovery request is used for identifying that the switch of the address information needs to recover the openflow table.
Specifically, the control server receives a flow table recovery request which is sent by the user and contains address information of the switch of the openflow flow table to be recovered through the restAPI. In the embodiment of the present invention, a flow table recovery request containing address information of a switch of an openflow flow table to be recovered, which is sent by a user through a client, is received through the restAPI.
Example 4:
in order to more accurately send a flow table recovery notification to a switch, on the basis of the foregoing embodiments, in an embodiment of the present invention, the sending of the flow table recovery notification to the switch of the address information includes:
and the control server issues a preset field containing extended configuration through an open virtual switch database protocol, wherein the preset field is a other _ config field in a Controller table.
After receiving a flow table recovery request containing address information of a switch of an openflow flow table to be recovered, sent by a user, the control server sends a flow table recovery notification to the switch of the address information, preferably, the flow table recovery notification may be a preset field containing extended configuration, where the preset field is a second _ config field in a Controller table, and the preset field is issued by an open virtual switch database protocol.
For example, an extension configuration is added to the other _ config field in the Controller table, where the extension configuration may be recovery = true, and when the switch receives a preset field containing the extension configuration, the switch sends the first openflow flow table stored locally to the control server.
Example 5:
fig. 2 provides a method for recovering an openflow flow table according to an embodiment of the present invention, where the method includes the following steps:
s201: and receiving a flow table recovery notice sent by the control server, and sending a first openflow flow table stored locally to the control server.
After the system runs for a period of time, a certain flow entry in the first openflow flow table carried in the switch may be deleted by mistake or modified by mistake. When a certain flow entry in the first openflow flow table is deleted, the service corresponding to the flow entry is interrupted, and therefore, in order to prevent the service interruption, a recovery operation needs to be performed on the first openflow flow table in the switch.
When a certain abnormal alarm is received or a user discovers that the virtual machine flow on the switch is abnormally forwarded, the user sends a flow table recovery request containing the address information of the switch of the openflow flow table to be recovered to the control server, wherein the flow table recovery request is used for identifying that the switch of the address information needs to recover the openflow flow table. In the implementation process, a user can send the flow table recovery request to the control server through a client, specifically, a user interaction module is arranged in the client, when a certain abnormal alarm is received or the user finds that virtual machine flow forwarding on the switch is abnormal, the user inputs address information of the switch with the abnormal alarm in an interaction interface, the client generates a flow table recovery request containing the address information of the switch of the openflow table to be recovered according to the address information of the switch input by the user, and sends the flow table recovery request to the control server. After receiving a flow table recovery request sent by a user, the control server sends a flow table recovery notification to the switch of the address information. After receiving the flow table recovery notification sent by the control server, the switch sends a first openflow flow table stored locally to the control server, so that the control server performs subsequent operations according to the first openflow flow table.
S202: and receiving each flow table item to be updated and the corresponding updating method sent by the control server.
In order to obtain a flow entry which is missing or changed in a first openflow flow table in a switch, a control server stores a full openflow flow table which the switch actually should have, and determines the flow entry which is missing or changed in the first openflow flow table by comparing the first openflow flow table with the full openflow flow table. The all-quantity openflow flow table stored in the control server and actually due to the switch may be generated when a flow table recovery request containing address information of the switch of the openflow table to be recovered, which is sent by a user, is received, or may be generated according to a preset time period, and the newly generated all-quantity openflow table is replaced with the all-quantity openflow table which is generated and stored before, and the newly generated all-quantity openflow table is stored.
Because the control server stores the actual total openflow flow table of the switch with the address information, each flow table entry to be updated in the first openflow flow table can be determined by comparing the first openflow flow table with the total openflow flow table. Specifically, each flow entry to be updated may be a flow entry to be added or a flow entry to be deleted, and in order to enable the switch to restore the first openflow flow table, the control server sends each flow entry to be updated and the corresponding update method to the switch of the address information. And the switch receives each flow table item to be updated and the corresponding updating method sent by the control server.
S203: and recovering the first openflow flow table according to each flow table entry to be updated and the corresponding updating method.
After the switch receives each flow table entry to be updated and the corresponding updating method sent by the control server, the switch restores the first openflow table locally stored by the switch according to each flow table entry to be updated and the corresponding updating method. Each flow entry to be updated may be a flow entry to be deleted, may be a flow entry to be added, and may also be a flow entry to be modified, and therefore, corresponding operations need to be performed according to the corresponding updating method.
In the embodiment of the invention, the control server sends the flow table recovery notification to the switch according to the flow table recovery request of the user, so that the openflow flow table in the corresponding switch can be recovered based on the requirement of the user, and the first openflow table reported by the switch and the full openflow table are compared when the recovery is carried out, so that each flow table item to be updated is determined, and each flow table item and the corresponding updating method are sent to the switch to recover the local first openflow table, so that the service of the switch is not influenced, and the openflow table recovery efficiency is effectively improved.
Example 6:
in order to accurately recover the first openflow flow table, on the basis of the foregoing embodiments, in an embodiment of the present invention, recovering the first openflow flow table according to each flow entry to be updated and a corresponding update method includes:
if a flow table entry to be added and an adding instruction for adding the identifier updating method are received, adding the flow table entry to be added into the first openflow flow table according to the adding instruction;
if a deleting instruction for deleting the flow entries to be deleted and the identification updating method is received, deleting the flow entries to be deleted in the first openflow flow table according to the deleting instruction;
and if the received flow table entry to be modified and the identification updating method are modified modification instructions, modifying the flow table entry to be modified in the first openflow flow table according to the modification instructions.
By comparing the first openflow flow table and the full openflow table, at least one of a flow entry to be added, a flow entry to be deleted, and a flow entry to be modified may exist. The switch may recover the first flow table according to receiving the flow entry to be added, the flow entry to be deleted, or the flow entry to be modified, so that when the flow entry to be added, the flow entry to be deleted, or the flow entry to be modified is sent to the switch, the update method corresponding to each flow entry is sent to the switch, specifically, if the flow entry to be updated is the flow entry to be added, the update method corresponding to the flow entry to be added is an addition instruction; if the flow entry to be updated is the flow entry to be deleted, the updating method corresponding to the flow entry to be deleted is a deleting instruction for deleting; and if the flow table entry to be updated is the flow table entry to be modified, the updating method corresponding to the flow table entry to be modified is a modified modifying instruction, so that the switch executes the corresponding updating method for each flow table entry to be updated.
Specifically, when a flow entry to be added exists, the flow entry to be added and a corresponding addition instruction are sent to the switch, where the addition instruction is used to identify that the flow entry to be added needs to be added in the first openflow flow table. And when the flow table entry to be deleted exists, sending the flow table entry to be deleted and a corresponding deletion instruction to the switch, wherein the deletion instruction is used for identifying that the flow table entry to be deleted needs to be deleted in the first openflow flow table. When a flow entry to be modified exists, the flow entry to be modified and a corresponding modification instruction are sent to the switch, where the modification instruction is used to identify that the flow entry to be modified needs to be modified in the first openflow flow table, and a specific flow entry to be modified is specific content of the modified flow entry or which entries in the flow entry to be modified and the modified content.
Specifically, when a flow entry to be added and an addition instruction with an identifier updating method as addition are received, the flow entry to be added is added to the first openflow flow table. And when a deletion instruction that the flow entry to be deleted and the identification updating method are deleted is received, deleting the flow entry to be deleted in the first openflow flow table. And when receiving a modification instruction that the flow table entry to be modified and the identifier updating method are modified, modifying the flow table entry to be modified in the first openflow flow table.
In order to determine when the first openflow flow table locally stored in the switch needs to be sent to the control server, in this embodiment of the present invention, the receiving of the flow table recovery notification sent by the control server includes:
and receiving a preset field containing extension configuration sent by the control server through an open virtual switch database protocol, wherein the preset field is a other _ config field in a Controller table.
After receiving a flow table recovery request containing address information of a switch of an openflow flow table to be recovered, which is sent by a user, the control server sends a flow table recovery notification to the switch of the address information, preferably, the flow table recovery notification may be a preset field containing extended configuration, where the preset field is a second _ config field in a Controller table, and the preset field is issued to the switch of the address information through an open virtual switch database protocol. The switch receives a preset field which is sent by the control server through an open virtual switch database protocol and contains extension configuration. For example, an extension configuration is added to the other _ config field in the Controller table, and the extension configuration may be recovery = true. When the switch receives the preset field containing the extension, the switch packs a first openflow flow table stored locally and uploads the first openflow flow table to the control server.
Fig. 3 is a schematic diagram of an openflow flow table recovery architecture provided in an embodiment of the present invention, in a specific implementation process, a controller and a monitoring module may be disposed in a control server, a software forwarder is disposed in a switch, and a user interaction module may be disposed in the control server, or may be disposed in a mobile terminal or other servers. The specific process of the openflow flow table recovery scheme is described as follows:
1) After a user confirms a software forwarder needing openflow flow table recovery on an interactive interface, the software forwarder is arranged in a switch, a user interaction module generates a flow table recovery request containing address information of the switch of the openflow table to be recovered, and a controller in a control server receives the flow table recovery request containing the address information of the switch of the openflow table to be recovered, which is sent by a user interaction module, from a control through a restAPI.
2) After receiving a flow table recovery request which is sent by a user interaction module and contains address information of a switch of an openflow flow table to be recovered, a controller in a control server starts a monitoring module, wherein the monitoring module can receive a first openflow table sent by a software repeater; meanwhile, the Controller sends a preset field containing the extended configuration through an open virtual switch database protocol, wherein the preset field is a other _ configuration field in a Controller table and is used for triggering a first openflow flow table sent by the software forwarder.
3) When the software forwarder in the switch recognizes that the preset field contains the extended configuration, the first openflow flow table stored locally is packaged, and the packaged first openflow flow table is sent to the monitoring module in the control server through an openflow uploading channel.
4) After receiving the first openflow flow table sent by the software forwarder, the monitoring module determines whether the two flow tables are the same or not according to the first openflow flow table and the generated full openflow table of the switch of the address information, and if the two flow tables are the same, the monitoring module sends a consistent message to the controller; if the flow table entries are different, the monitoring module determines each flow table entry to be updated and the corresponding updating method, determines a flow table difference report according to the flow table entry to be added, the flow table entry to be deleted and the flow table entry to be modified in the determined first openflow flow table, and sends the flow table difference report to the controller.
Specifically, determining each flow entry to be updated and the corresponding updating method include: and determining the flow entries to be added, the flow entries to be deleted and the flow entries to be modified in the first openflow flow table. Sending each flow table entry to be updated and the corresponding updating method to the switch, specifically, if the flow table entry to be added exists, sending the flow table entry to be added and the adding instruction to a software repeater in the switch; if the flow table item to be deleted exists, the flow table item to be deleted and a deletion instruction are sent to a software forwarder in the switch; and if the flow table entry to be modified exists, sending the flow table entry to be modified and the modification instruction to a software forwarder in the switch.
5) And the controller receives the consistent message or the flow table difference report sent by the monitoring module and forwards the received consistent message or the received flow table difference report to the user interaction module. And then deleting the previously configured extension field through an open virtual switch database protocol, and then stopping the monitoring module.
6) The user interaction module receives a consistent message or a flow table difference report sent by the controller, and if the received consistent message is the consistent message, a prompt of 'no error of a flow table' is displayed to a user; if a flow table discrepancy report is received, the flow table discrepancy report is presented on the user interface for subsequent tracking of the problem root cause.
By the openflow flow table recovery method, forwarding services can be quickly recovered, and production loss is reduced to the minimum; meanwhile, the retention of flow table difference report data provides a powerful reference for subsequent developer intervention and root cause analysis.
Example 7:
on the basis of the foregoing embodiments, in an embodiment of the present invention, an openflow flow table recovery device is further provided, and fig. 4 is a schematic structural diagram of the openflow table recovery device provided in the embodiment of the present invention, where the openflow table recovery device includes:
a receiving and sending module 401, configured to receive a flow table recovery request that is sent by a user and includes address information of a switch of an openflow flow table to be recovered, and send a flow table recovery notification to the switch of the address information;
a receiving module 402, configured to receive a first openflow flow table locally stored by the switch and sent by the switch;
a determining and sending module 403, configured to determine each flow entry to be updated in the first openflow flow table according to the first openflow flow table and the generated full openflow flow table of the switch of the address information, and send each flow entry to be updated and the corresponding updating method to the switch, so that the switch recovers the first openflow flow table by using the corresponding updating method according to each flow entry.
Further, the determining and sending module 403 is specifically configured to determine, according to the first openflow flow table and the generated full-amount openflow flow table of the switch of the address information, a flow entry to be added, a flow entry to be deleted, and a flow entry to be modified in the first openflow flow table.
Further, the determining and sending module 403 is specifically configured to send the flow entry to be added and the adding instruction to the switch if the flow entry to be added exists;
if the flow entry to be deleted exists, the flow entry to be deleted and a deletion instruction are sent to the switch;
and if the flow table entry to be modified exists, sending the flow table entry to be modified and a modification instruction to the switch.
Further, the receiving and sending module 401 is specifically configured to receive, through the restAPI, a flow table recovery request that is sent by the user and includes address information of the switch of the openflow flow table to be recovered.
Further, the receiving and sending module 401 is specifically configured to control the server to issue a preset field containing an extended configuration through an open virtual switch database protocol, where the preset field is a other _ config field in the Controller table.
Example 8:
on the basis of the foregoing embodiments, in an embodiment of the present invention, an openflow flow table recovery device is further provided, and fig. 5 is a schematic structural diagram of the openflow table recovery device provided in the embodiment of the present invention, where the openflow table recovery device includes:
a receiving and sending module 501, configured to receive a flow table recovery notification sent by a control server, and send a first openflow flow table stored locally to the control server;
a receiving module 502, configured to receive each flow entry to be updated and a corresponding updating method sent by the control server;
a restoring module 503, configured to restore the first openflow flow table according to each flow table entry to be updated and the corresponding updating method.
Further, the recovery module 503 is specifically configured to, if a flow entry to be added and an addition instruction whose identifier updating method is added are received, add the flow entry to be added to the first openflow flow table according to the addition instruction;
if a deleting instruction for deleting the flow entries to be deleted and the identification updating method is received, deleting the flow entries to be deleted in the first openflow flow table according to the deleting instruction;
and if the received flow table entry to be modified and the identification updating method are modified modification instructions, modifying the flow table entry to be modified in the first openflow flow table according to the modification instructions.
Further, the receiving and sending module 501 is specifically configured to receive a preset field that is sent by the control server through an open virtual switch database protocol and includes an extended configuration, where the preset field is a other _ config field in a Controller table.
Example 9:
on the basis of the foregoing embodiments, an embodiment of the present invention further provides an electronic device 600, as shown in fig. 6, including a memory 601 and a processor 602;
the processor 602 is configured to read the program in the memory 601, and execute the following processes:
receiving a flow table recovery request containing address information of the switch of the openflow flow table to be recovered, which is sent by a user, and sending a flow table recovery notice to the switch of the address information; receiving a first openflow flow table which is sent by the switch and locally stored by the switch; determining each flow table entry to be updated in the first openflow flow table according to the first openflow flow table and the generated full openflow flow table of the switch of the address information, and sending each flow table entry to be updated and a corresponding updating method to the switch, so that the switch recovers the first openflow flow table according to each flow table entry by adopting the corresponding updating method.
In fig. 6, the bus architecture may include any number of interconnected buses and bridges, with one or more processors, represented in particular by processor 602, and various circuits of memory, represented by memory 601, linked together. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein.
Alternatively, the processor 602 may be a CPU (central processing unit), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or a CPLD (Complex Programmable Logic Device).
The processor is specifically configured to determine, according to the first openflow flow table and the generated full-amount openflow flow table of the switch of the address information, a flow entry to be added, a flow entry to be deleted, and a flow entry to be modified in the first openflow flow table.
The processor is specifically configured to send the flow entry to be added and the addition instruction to the switch if the flow entry to be added exists; if the flow table item to be deleted exists, the flow table item to be deleted and a deletion instruction are sent to the switch; and if the flow table entry to be modified exists, sending the flow table entry to be modified and a modification instruction to the switch.
The processor is specifically configured to receive, through the restAPI, a flow table recovery request that is sent by a user and includes address information of a switch of the openflow table to be recovered.
Further, the processor is specifically configured to issue, by the control server, a preset field containing an extended configuration through an open virtual switch database protocol, where the preset field is a second _ config field in the Controller table.
In the embodiment of the invention, the control server sends the flow table recovery notification to the switch according to the flow table recovery request of the user, so that the openflow flow table in the corresponding switch can be recovered based on the requirement of the user, and the first openflow table reported by the switch and the full openflow table are compared when the recovery is carried out, so that each flow table item to be updated is determined, and each flow table item and the corresponding updating method are sent to the switch to recover the local first openflow table, so that the service of the switch is not influenced, and the openflow table recovery efficiency is effectively improved.
Example 10:
on the basis of the foregoing embodiments, an embodiment of the present invention further provides an electronic device 700, as shown in fig. 7, including a memory 701 and a processor 702;
the processor 702 is configured to read the program in the memory 701, and execute the following processes:
receiving a flow table recovery notification sent by a control server, and sending a first openflow flow table stored locally to the control server; receiving each flow table item to be updated and a corresponding updating method sent by the control server; and recovering the first openflow flow table according to each flow table entry to be updated and the corresponding updating method.
In FIG. 7, the bus architecture may include any number of interconnected buses and bridges, with one or more processors, represented by processor 702, and various circuits of memory, represented by memory 701, being linked together. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein.
Alternatively, the processor 702 may be a CPU (central processing unit), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or a CPLD (Complex Programmable Logic Device).
The processor is specifically configured to, if a flow table entry to be added and an addition instruction for which the identifier updating method is to be added are received, add the flow table entry to be added to the first openflow flow table according to the addition instruction; if a deleting instruction for deleting the flow entries to be deleted and the identification updating method is received, deleting the flow entries to be deleted in the first openflow flow table according to the deleting instruction; and if the received flow table entry to be modified and the identification updating method are modified modification instructions, modifying the flow table entry to be modified in the first openflow flow table according to the modification instructions.
The processor is specifically configured to receive a preset field that includes an extended configuration and is issued by the control server through an open virtual switch database protocol, where the preset field is a other _ config field in a Controller table.
Example 11:
on the basis of the foregoing embodiments, an embodiment of the present invention further provides an electronic device 800, as shown in fig. 8, including: the system comprises a processor 801, a communication interface 802, a memory 803 and a communication bus 804, wherein the processor 801, the communication interface 802 and the memory 803 complete mutual communication through the communication bus 804;
the memory 803 has stored therein a computer program which, when executed by the processor 801, causes the processor 801 to perform the steps of:
receiving a flow table recovery request which is sent by a user and contains address information of a switch of an openflow flow table to be recovered, and sending a flow table recovery notice to the switch of the address information; receiving a first openflow flow table which is sent by the switch and locally stored by the switch; determining each flow table entry to be updated in the first openflow flow table according to the first openflow flow table and the generated full openflow flow table of the switch of the address information, and sending each flow table entry to be updated and a corresponding updating method to the switch, so that the switch recovers the first openflow flow table according to each flow table entry by adopting the corresponding updating method.
Further, the processor 801 determines, according to the first openflow flow table and the generated full openflow flow table of the switch of the address information, a flow entry to be added, a flow entry to be deleted, and a flow entry to be modified in the first openflow flow table.
Further, if a flow entry to be added exists, the processor 801 sends the flow entry to be added and an addition instruction to the switch; if the flow table item to be deleted exists, the flow table item to be deleted and a deletion instruction are sent to the switch; and if the flow table entry to be modified exists, sending the flow table entry to be modified and a modification instruction to the switch.
Further, the processor 801 receives a flow table recovery request containing address information of a switch of the openflow table to be recovered, which is sent by the user, through the restAPI.
Further, the processor 801 controls the server to issue a preset field containing the extended configuration through the open virtual switch database protocol, where the preset field is a other _ config field in the Controller table.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface 802 is used for communication between the above-described electronic apparatus and other apparatuses.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Alternatively, the memory may be at least one memory device located remotely from the processor.
The processor may be a general-purpose processor, including a central processing unit, a Network Processor (NP), and the like; but may also be a Digital instruction processor (DSP), an application specific integrated circuit, a field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, etc.
Example 12:
on the basis of the foregoing embodiments, an embodiment of the present invention further provides an electronic device 900, as shown in fig. 9, including: a processor 901, a communication interface 902, a memory 903 and a communication bus 904, wherein the processor 901, the communication interface 902 and the memory 903 are communicated with each other through the communication bus 904;
the memory 903 has stored therein a computer program that, when executed by the processor 901, causes the processor 901 to perform the steps of:
receiving a flow table recovery request which is sent by a user and contains address information of a switch of an openflow flow table to be recovered, and sending a flow table recovery notice to the switch of the address information; receiving a first openflow flow table which is sent by the switch and is locally stored by the switch; determining each flow table entry to be updated in the first openflow flow table according to the first openflow flow table and the generated full openflow flow table of the switch of the address information, and sending each flow table entry to be updated and a corresponding updating method to the switch, so that the switch recovers the first openflow flow table according to each flow table entry by adopting the corresponding updating method.
Further, if the flow table entry to be added and the addition instruction with the identifier updating method as addition are received, the processor 901 adds the flow table entry to be added to the first openflow flow table according to the addition instruction; if a deleting instruction for deleting the flow entries to be deleted and the identification updating method is received, deleting the flow entries to be deleted in the first openflow flow table according to the deleting instruction; and if the received flow table entry to be modified and the identification updating method are modified modification instructions, modifying the flow table entry to be modified in the first openflow flow table according to the modification instructions.
Further, the processor 901 receives a preset field containing an extended configuration sent by the control server through the open virtual switch database protocol, where the preset field is a other _ config field in the Controller table.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this is not intended to represent only one bus or type of bus.
The communication interface 902 is used for communication between the electronic device and other devices.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Alternatively, the memory may be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a central processing unit, a Network Processor (NP), and the like; but may also be a Digital instruction processor (DSP), an application specific integrated circuit, a field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or the like.
Example 13:
on the basis of the foregoing embodiments, an embodiment of the present invention further provides a computer-readable storage medium, in which a computer program executable by an electronic device is stored, and when the program is run on the electronic device, the electronic device is caused to execute the following steps:
the memory having stored therein a computer program that, when executed by the processor, causes the processor to perform the steps of:
receiving a flow table recovery request which is sent by a user and contains address information of a switch of an openflow flow table to be recovered, and sending a flow table recovery notice to the switch of the address information;
receiving a first openflow flow table which is sent by the switch and locally stored by the switch;
determining each flow table entry to be updated in the first openflow flow table according to the first openflow flow table and the generated full openflow flow table of the switch of the address information, and sending each flow table entry to be updated and a corresponding updating method to the switch, so that the switch recovers the first openflow flow table according to each flow table entry by adopting the corresponding updating method.
Further, the processor determines a flow entry to be added, a flow entry to be deleted and a flow entry to be modified in the first openflow flow table according to the first openflow flow table and the generated full-amount openflow table of the switch of the address information.
Further, if the processor has a flow entry to be added, the processor sends the flow entry to be added and an adding instruction to the switch;
if the flow table item to be deleted exists, the flow table item to be deleted and a deletion instruction are sent to the switch;
and if the flow table entry to be modified exists, sending the flow table entry to be modified and a modification instruction to the switch.
Further, the processor receives a flow table recovery request which is sent by the user and contains address information of the switch of the openflow table to be recovered through the restAPI.
Further, the processor control server issues a preset field containing the extended configuration through an open virtual switch database protocol, wherein the preset field is a other _ config field in a Controller table.
The computer readable storage medium may be any available medium or data storage device that can be accessed by a processor in an electronic device, including but not limited to magnetic memory such as floppy disks, hard disks, magnetic tape, magneto-optical disks (MOs), etc., optical memory such as CDs, DVDs, BDs, HVDs, etc., and semiconductor memory such as ROMs, EPROMs, EEPROMs, non-volatile memories (NAND FLASH), solid State Disks (SSDs), etc.
Example 14:
on the basis of the foregoing embodiments, an embodiment of the present invention further provides a computer-readable storage medium, in which a computer program executable by an electronic device is stored, and when the program is run on the electronic device, the electronic device is caused to execute the following steps:
the memory has stored therein a computer program that, when executed by the processor, causes the processor to perform the steps of:
receiving a flow table recovery notification sent by a control server, and sending a first openflow flow table stored locally to the control server;
receiving each flow table item to be updated and a corresponding updating method sent by the control server;
and recovering the first openflow flow table according to each flow table entry to be updated and the corresponding updating method.
Further, if the processor receives a flow table entry to be added and an adding instruction with the identifier updating method as adding, adding the flow table entry to be added into the first openflow flow table according to the adding instruction;
if a deleting instruction for deleting the flow entries to be deleted and the identification updating method is received, deleting the flow entries to be deleted in the first openflow flow table according to the deleting instruction;
and if the received flow table entry to be modified and the identification updating method are modified modification instructions, modifying the flow table entry to be modified in the first openflow flow table according to the modification instructions.
Further, receiving a preset field containing an extended configuration sent by the control server through an open virtual switch database protocol, where the preset field is a other _ config field in a Controller table.
The computer readable storage medium may be any available medium or data storage device that can be accessed by a processor in an electronic device, including but not limited to magnetic memory such as floppy disks, hard disks, magnetic tape, magneto-optical disks (MO), etc., optical memory such as CDs, DVDs, BDs, HVDs, etc., and semiconductor memory such as ROMs, EPROMs, EEPROMs, non-volatile memories (NAND FLASH), solid State Disks (SSDs), etc.
The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including the preferred embodiment and all changes and modifications that fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (22)

1. An openflow flow table recovery method applied to a control server, the method comprising:
receiving a flow table recovery request containing address information of the switch of the openflow flow table to be recovered, which is sent by a user, and sending a flow table recovery notice to the switch of the address information; wherein, the switch is an open virtual switch OVS;
receiving a first openflow flow table which is sent by the switch and locally stored by the switch;
determining each flow table entry to be updated in the first openflow flow table according to the first openflow flow table and the generated full openflow flow table of the switch of the address information, and sending each flow table entry to be updated and a corresponding updating method to the switch, so that the switch recovers the first openflow flow table according to each flow table entry by adopting the corresponding updating method.
2. The method of claim 1, wherein the determining each flow table entry to be updated in the first openflow flow table according to the first openflow flow table and the generated full openflow table of the switch for the address information comprises:
and determining flow table entries to be added, flow table entries to be deleted and flow table entries to be modified in the first openflow flow table according to the first openflow flow table and the generated full-amount openflow table of the switch of the address information.
3. The method of claim 2, wherein the sending each flow table entry to be updated and the corresponding update method to the switch comprises:
if the flow entry to be added exists, the flow entry to be added and an adding instruction are sent to the switch;
if the flow table item to be deleted exists, the flow table item to be deleted and a deletion instruction are sent to the switch;
and if the flow table entry to be modified exists, sending the flow table entry to be modified and a modification instruction to the switch.
4. The method of claim 1, wherein the receiving of the flow table recovery request sent by the user and containing address information of the switch of the openflow flow table to be recovered comprises:
and receiving a flow table recovery request which is sent by a user and contains address information of the switch of the openflow flow table to be recovered through the restAPI.
5. The method of claim 1, wherein the sending a flow table recovery notification to the switch of the address information comprises:
and the control server issues a preset field containing extended configuration through an open virtual switch database protocol, wherein the preset field is a other _ config field in a Controller table.
6. An openflow flow table recovery method applied to a switch, wherein the switch is an Open Virtual Switch (OVS), and the method includes:
receiving a flow table recovery notification sent by a control server, and sending a first openflow flow table stored locally to the control server; the flow table recovery notification is sent to the switch of the address information after the control server receives a flow table recovery request which is sent by a user and contains the address information of the switch of the openflow table to be recovered;
receiving each flow table item to be updated and a corresponding updating method sent by the control server; the control server stores a full openflow flow table actually due to the switch, and each flow table entry to be updated is determined by the control server through comparing the first openflow table with the full openflow table;
and recovering the first openflow flow table according to each flow table entry to be updated and the corresponding updating method.
7. The method of claim 6, wherein the restoring the first openflow flow table according to each flow table entry to be updated and the corresponding update method comprises:
if the flow table entry to be added and the identification updating method are added adding instructions, adding the flow table entry to be added into the first openflow flow table according to the adding instructions;
if a flow entry to be deleted and a deletion instruction for deleting the identifier updating method are received, deleting the flow entry to be deleted in the first openflow flow table according to the deletion instruction;
and if the received flow table entry to be modified and the identification updating method are modified modification instructions, modifying the flow table entry to be modified in the first openflow flow table according to the modification instructions.
8. The method of claim 6, wherein the receiving the flow table recovery notification sent by the control server comprises:
and receiving a preset field containing extended configuration sent by the control server through an open virtual switch database protocol, wherein the preset field is a other _ config field in a Controller table.
9. An openflow flow table restoration device applied to a control server, the device comprising:
the receiving and sending module is used for receiving a flow table recovery request which is sent by a user and contains address information of the switch of the openflow flow table to be recovered, and sending a flow table recovery notice to the switch of the address information; wherein, the switch is an open virtual switch OVS;
the receiving module is used for receiving a first openflow flow table which is sent by the switch and locally stored by the switch;
and the determining and sending module is configured to determine each flow entry to be updated in the first openflow flow table according to the first openflow flow table and the generated full openflow flow table of the switch of the address information, and send each flow entry to be updated and a corresponding updating method to the switch, so that the switch recovers the first openflow flow table according to each flow entry by using the corresponding updating method.
10. An openflow flow table recovery device, applied to a switch, wherein the switch is an Open Virtual Switch (OVS), the device comprising:
the receiving and sending module is used for receiving a flow table recovery notification sent by the control server and sending a first openflow flow table stored locally to the control server; the flow table recovery notification is sent to the switch of the address information after the control server receives a flow table recovery request which is sent by a user and contains the address information of the switch of the openflow table to be recovered;
a receiving module, configured to receive each flow entry to be updated and a corresponding update method sent by the control server; the control server stores a full openflow flow table actually due to the switch, and each flow table entry to be updated is determined by the control server through comparing the first openflow table with the full openflow table;
and the recovery module is used for recovering the first openflow flow table according to each flow table entry to be updated and the corresponding updating method.
11. An electronic device, comprising a memory and a processor;
the processor is used for reading the program in the memory and executing the following processes: receiving a flow table recovery request which is sent by a user and contains address information of a switch of an openflow flow table to be recovered, and sending a flow table recovery notice to the switch of the address information; the switch is an Open Virtual Switch (OVS); receiving a first openflow flow table which is sent by the switch and locally stored by the switch; determining each flow table entry to be updated in the first openflow flow table according to the first openflow flow table and the generated full openflow flow table of the switch of the address information, and sending each flow table entry to be updated and a corresponding updating method to the switch, so that the switch recovers the first openflow flow table according to each flow table entry by adopting the corresponding updating method.
12. The electronic device according to claim 11, wherein the processor is specifically configured to determine, according to the first openflow flow table and a full openflow flow table of the switch that generates the address information, a flow entry to be added, a flow entry to be deleted, and a flow entry to be modified in the first openflow flow table.
13. The electronic device of claim 12, wherein the processor is specifically configured to send the flow entry to be added and an add instruction to the switch if there is a flow entry to be added; if the flow table item to be deleted exists, the flow table item to be deleted and a deletion instruction are sent to the switch; and if the flow table entry to be modified exists, sending the flow table entry to be modified and a modification instruction to the switch.
14. The electronic device of claim 11, wherein the processor is specifically configured to receive, through the restAPI, a flow table recovery request sent by a user and containing address information of a switch of the openflow table to be recovered.
15. The electronic device according to claim 11, wherein the processor is specifically configured to control the server to issue a preset field containing an extended configuration through an open virtual switch database protocol, where the preset field is a other _ config field in a Controller table.
16. An electronic device, comprising a memory and a processor; the electronic equipment is an Open Virtual Switch (OVS);
the processor is used for reading the program in the memory and executing the following processes: receiving a flow table recovery notification sent by a control server, and sending a first openflow flow table stored locally to the control server; the flow table recovery notification is sent to the switch of the address information after the control server receives a flow table recovery request which is sent by a user and contains the address information of the switch of the openflow table to be recovered; receiving each flow table item to be updated and a corresponding updating method sent by the control server; the control server stores a full openflow flow table which is actually due to the OVS, and each flow table item to be updated is determined by the control server through comparing the first openflow flow table with the full openflow flow table; and recovering the first openflow flow table according to each flow table entry to be updated and the corresponding updating method.
17. The electronic device according to claim 16, wherein the processor is specifically configured to, if an add instruction that a flow entry to be added and an identifier update method are added is received, add the flow entry to be added to the first openflow flow table according to the add instruction; if a deleting instruction for deleting the flow entries to be deleted and the identification updating method is received, deleting the flow entries to be deleted in the first openflow flow table according to the deleting instruction; and if the received flow table entry to be modified and the identification updating method are modified modification instructions, modifying the flow table entry to be modified in the first openflow flow table according to the modification instructions.
18. The electronic device according to claim 16, wherein the processor is specifically configured to receive a preset field that includes an extended configuration and is issued by the control server through an open virtual switch database protocol, where the preset field is a other _ config field in a Controller table.
19. An electronic device, comprising: the system comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus;
the memory has stored therein a computer program which, when executed by the processor, causes the processor to carry out the steps of the method of any one of claims 1 to 5.
20. An electronic device, comprising: the system comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
the memory has stored therein a computer program which, when executed by the processor, causes the processor to carry out the steps of the method of any one of claims 6 to 8.
21. A computer-readable storage medium, characterized in that it stores a computer program executable by an electronic device, which program, when run on the electronic device, causes the electronic device to carry out the steps of the method according to any one of claims 1-5.
22. A computer-readable storage medium, having stored thereon a computer program executable by an electronic device, for causing the electronic device to perform the steps of the method of any one of claims 6-8, when the program is run on the electronic device.
CN201910002348.7A 2019-01-02 2019-01-02 Openflow flow table recovery method and device, electronic equipment and medium Active CN111404810B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910002348.7A CN111404810B (en) 2019-01-02 2019-01-02 Openflow flow table recovery method and device, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910002348.7A CN111404810B (en) 2019-01-02 2019-01-02 Openflow flow table recovery method and device, electronic equipment and medium

Publications (2)

Publication Number Publication Date
CN111404810A CN111404810A (en) 2020-07-10
CN111404810B true CN111404810B (en) 2022-11-15

Family

ID=71432024

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910002348.7A Active CN111404810B (en) 2019-01-02 2019-01-02 Openflow flow table recovery method and device, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN111404810B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112615783B (en) * 2020-11-17 2022-02-22 新华三大数据技术有限公司 Table item updating method and device, electronic equipment and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106453099A (en) * 2016-10-21 2017-02-22 杭州华三通信技术有限公司 Flow table information recovery method and device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105247831B (en) * 2014-01-23 2018-10-30 华为技术有限公司 Flow table amending method, flow table modification device and open flows network system
CN104852867B (en) * 2014-02-19 2018-02-06 华为技术有限公司 Data packet forwarding method, apparatus and system
CN104780071B (en) * 2015-04-21 2018-12-25 新华三技术有限公司 The upgrade method and device of virtual switch
US9948518B2 (en) * 2015-07-22 2018-04-17 International Business Machines Corporation Low latency flow cleanup of openflow configuration changes
US11271850B2 (en) * 2017-03-23 2022-03-08 Nec Corporation Software defined network forwarding

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106453099A (en) * 2016-10-21 2017-02-22 杭州华三通信技术有限公司 Flow table information recovery method and device

Also Published As

Publication number Publication date
CN111404810A (en) 2020-07-10

Similar Documents

Publication Publication Date Title
CN107809367B (en) Device online method of SDN (software defined network), SDN controller and network device
CN108243106B (en) Method for controlling network slicing, forwarding device, control device and communication system
US10644952B2 (en) VNF failover method and apparatus
CN112866004B (en) Control plane equipment switching method and device and transfer control separation system
US20230318906A1 (en) Fault recovery plan determining method, apparatus, and system, and computer storage medium
US20220200844A1 (en) Data processing method and apparatus, and computer storage medium
TW201723744A (en) Server system, method for managing power supply units and automatic transfer switches, and non-transitory computer-readable storage medium
WO2020030000A1 (en) Disaster recovery switching method, related device and computer storage medium
WO2017215441A1 (en) Self-recovery method and apparatus for board configuration in distributed system
WO2018137520A1 (en) Service recovery method and apparatus
CN106302076B (en) Method and system for establishing VXLAN tunnel and SDN controller
WO2020121293A1 (en) Orchestration of activities of entities operating in a network cloud
CN109391526B (en) Network loop detection method and device
WO2017190339A1 (en) Fault processing method and device
WO2017038089A1 (en) Virtual network monitoring system, virtual network monitoring method, and recording medium
US10374924B1 (en) Virtualized network device failure detection
CN111404810B (en) Openflow flow table recovery method and device, electronic equipment and medium
CN110603798B (en) System and method for providing elastic consistency platform with high availability
CN108141374B (en) Network sub-health diagnosis method and device
US11824704B2 (en) Computer network troubleshooting and diagnostics using metadata
US20230060758A1 (en) Orchestration of Activities of Entities Operating in a Network Cloud
CN114679295B (en) Firewall security configuration method and device
US11658889B1 (en) Computer network architecture mapping using metadata
Muthumanikandan et al. Switch failure detection in software-defined networks
CN109450702A (en) A kind of data processing method and device

Legal Events

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