Flow table synchronization method, device, equipment and computer storage medium
By matching the verification characteristics of the flow table data in the controller and the switch, determining the flow table to be synchronized and synchronized, the problems of low efficiency and low accuracy of flow table synchronization in the prior art are solved, and more efficient flow table synchronization is achieved.
Patent Information
- Application Number
- CN202111624146.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-28
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2041-12-28
AI Technical Summary
The existing table entry synchronization method of controllers and virtual switches has problems such as low accuracy, low efficiency, or the synchronization process will affect normal business.
By determining the verification characteristics corresponding to the flow table data of the target controller and the switch, matching is performed to determine the flow table to be synchronized, and only the flow table to be synchronized is synchronized to avoid synchronization of all table entries.
Improves the efficiency and accuracy of flow table synchronization and reduces the impact on normal business.
Smart Images

Figure CN116366531B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of network technology, and in particular to a flow table synchronization method, apparatus, device, and computer storage medium. Background Art
[0002] The goal is to control the VSW (Virtual Switch) by issuing OpenFlow flow tables through the controller in the SDN (Software Defined Network) architecture. However, the OpenFlow protocol itself does not have a well-defined mechanism to ensure the consistency of the flow tables of the controller and VSW. Therefore, the flow tables of the controller and VSW need to be synchronized.
[0003] During the implementation of the present invention, the inventors discovered that the existing method for synchronizing entries between a controller and a virtual switch has problems such as low accuracy, low efficiency, or the synchronization process affecting normal services. Summary of the Invention
[0004] In view of the above problems, embodiments of the present invention provide a flow table synchronization method, apparatus, device, and computer storage medium to solve the problem of low efficiency of flow table synchronization in the prior art.
[0005] According to one aspect of an embodiment of the present invention, a flow table synchronization method is provided, the method comprising:
[0006] Determining a first verification feature corresponding to the first flow table data sent by the target controller;
[0007] Determining a second verification feature corresponding to the second flow table data received by the target switch; the target switch is a switch connected to the target controller;
[0008] Matching the first verification feature with the second verification feature to obtain a first matching result;
[0009] Determine a flow table to be synchronized in the target switch according to the first matching result;
[0010] Synchronize the flow table to be synchronized.
[0011] In an optional manner, the method further includes:
[0012] Before the synchronization operation on the flow table to be synchronized is completed, the operation of the target switch on the second flow table data is locked.
[0013] In an optional manner, the method further includes:
[0014] The first flow table data includes a plurality of optional flow tables; the first checksum includes a total number of entries and a total checksum of all the optional flow tables in the target controller;
[0015] The second flow table data includes the multiple optional flow tables; the second check feature includes the total number of table entries and the total checksum of all the optional flow tables in the target switch.
[0016] In an optional manner, the method further includes:
[0017] When the first matching result is no match, dividing the multiple optional flow tables into multiple flow table subsets; each of the flow table subsets includes at least one of the optional flow tables;
[0018] determining, according to the first flow table data, a third verification feature corresponding to each of the flow table subsets in the target controller;
[0019] Determine, according to the second flow table data, a fourth verification feature corresponding to each of the flow table subsets in the target switch;
[0020] Matching each of the third verification features with each of the fourth verification features respectively to obtain a second matching result corresponding to each of the flow table subsets;
[0021] The flow table to be synchronized is determined according to the second matching result.
[0022] In an optional manner, the method further includes:
[0023] Determining the flow table subset for which the second matching result is mismatch as a subset to be synchronized;
[0024] Determining a fifth verification feature corresponding to the to-be-synchronized subset in the target controller according to the first flow table data;
[0025] Determining, according to the second flow table data, a sixth verification feature corresponding to the to-be-synchronized subset in the target switch;
[0026] Matching the fifth verification feature with the sixth verification feature to obtain a third matching result;
[0027] The flow table to be synchronized is determined from the subset to be synchronized according to the third matching result.
[0028] In an optional manner, the method further includes:
[0029] Determining the total number of optional flow tables in the subset to be synchronized;
[0030] When the total number of tables is greater than a number threshold, dividing the subset to be synchronized into a plurality of sub-subsets to be synchronized;
[0031] determining, according to the first flow table data, a seventh verification feature corresponding to each of the to-be-synchronized sub-subsets in the target controller;
[0032] determining, according to the second flow table data, an eighth verification feature corresponding to each of the to-be-synchronized sub-subsets in the target switch;
[0033] Matching the seventh verification feature with the eighth verification feature to obtain a fourth matching result;
[0034] The flow table to be synchronized is determined from the sub-subset to be synchronized according to the fourth matching result.
[0035] In an optional manner, the method further includes:
[0036] The fifth verification feature includes the number of entries and the checksum of each optional flow table in the to-be-synchronized subset in the target controller;
[0037] The sixth verification feature includes the number of entries and the checksum of each optional flow table in the to-be-synchronized subset in the target switch.
[0038] According to another aspect of an embodiment of the present invention, a flow table synchronization device is provided, including:
[0039] A first determining module, configured to determine a first verification feature corresponding to the first flow table data sent by the target controller;
[0040] A second determining module is configured to determine a second verification feature corresponding to the second flow table data received by a target switch; the target switch is a switch connected to the target controller;
[0041] a matching module, configured to match the first verification feature with the second verification feature to obtain a first matching result;
[0042] a third determining module, configured to determine a flow table to be synchronized in the target switch according to the first matching result;
[0043] A synchronization module is used to synchronize the flow table to be synchronized.
[0044] According to another aspect of an embodiment of the present invention, a flow table synchronization device is provided, including:
[0045] A processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other via the communication bus;
[0046] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations of the flow table synchronization method.
[0047] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, wherein the storage medium stores at least one executable instruction, and the executable instruction enables a flow table synchronization device to perform the operations of the flow table synchronization method described below.
[0048] In an embodiment of the present invention, a first verification feature corresponding to first flow table data sent by a target controller and a second verification feature corresponding to second flow table data received by a target switch are determined; wherein the target switch is a switch connected to the target controller; the first verification feature and the second verification feature are matched to obtain a first matching result; a flow table to be synchronized in the target switch is determined based on the first matching result, and the flow table to be synchronized is synchronized.
[0049] Different from the prior art that synchronizes all table items, resulting in low flow table synchronization efficiency, the embodiment of the present invention matches the verification features corresponding to the flow table data in the controller and the switch to obtain the flow table to be synchronized, and only the flow table to be synchronized needs to be synchronized, thereby improving the efficiency of flow table synchronization.
[0050] The above description is only an overview of the technical solutions of the embodiments of the present invention. In order to more clearly understand the technical means of the embodiments of the present invention, they can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the embodiments of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are specifically listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The accompanying drawings are only used to illustrate the embodiments and are not to be considered as limiting the present invention. In addition, the same reference symbols are used to represent the same components throughout the drawings. In the drawings:
[0052] Figure 1 A schematic diagram of a flow table synchronization method provided by an embodiment of the present invention is shown;
[0053] Figure 2 A schematic structural diagram of a flow table synchronization device provided by an embodiment of the present invention is shown;
[0054] Figure 3 A schematic structural diagram of a flow table synchronization device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0055] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited to the embodiments set forth herein.
[0056] Figure 1 The flow chart of the flow table synchronization method provided by the embodiment of the present invention is shown, and the method is executed by a computer processing device. The computer processing device may include a mobile phone, a laptop computer, etc. Figure 1 As shown, the method includes the following steps:
[0057] Step 10: Determine a first verification feature corresponding to the first flow table data sent by the target controller.
[0058] In one embodiment of the present invention, when a flow table synchronization trigger is detected, the target controller is controlled to deliver multiple optional flow tables to the target switch connected to it. Flow table synchronization triggers can include actions such as the target switch re-establishing an OpenFlow connection with the target controller, manual flow table synchronization triggered by a user, and the target controller detecting errors in previous flow table delivery. Communication between the target controller and the target switch occurs using the optimized OpenFlow protocol.
[0059] The optimization of the Openflow protocol is used to ensure that the operation of the target switch on the second flow table data is locked before the synchronization operation of the to-be-synchronized flow table in the delivered optional flow table is completed.
[0060] Specifically, the optimization of the OpenFlow protocol refers to extending the OpenFlow protocol to add synchronization start and synchronization end markers to support flow table synchronization. Specifically, the flow table between the synchronization start and synchronization end markers is used for consistency verification. Operations on the flow table between these two markers on the target controller are atomic, thereby ensuring the timeliness of the flow table used for verification during the flow table synchronization process, avoiding the controller's operations on the flow table during the synchronization process that may cause the flow table verification results to be inconsistent with the actual situation, and improving the accuracy of flow table synchronization.
[0061] In one embodiment of the present invention, the message types corresponding to the synchronization start marker and the synchronization end marker are defined on the outermost header of the Openflow protocol.
[0062] The OFPT_EXPERIMENTER message format is defined as follows:
[0063] struct ofp_experiment_header{
[0064] struct oftp_header header;
[0065] uint32_t experimenter;
[0066] uint32_t exp_type;}
[0067] Among them, experimenter = 0xF000F000; exp_type is used to characterize the message type, which can include three values: Start, End, and Check; Start is a synchronization start mark, End is a synchronization end mark, and Check is a verification mark. When the exp_type in the message received by the target switch is "Check", the return value of the message is the second verification feature.
[0068] In one embodiment of the present invention, the first flow table data includes a plurality of optional flow tables; and the first checksum includes a total number of entries and a total checksum of all the optional flow tables in the target controller.
[0069] For example, in a verification type message, the following fields are included: the total number of table entries of the N+1 tables of optional flow tables 0-N, the total checksum of the N+1 tables of optional flow tables 0-N, the number of table entries of each table of optional flow table 0-optional flow table N, and the checksum of each table of optional flow table 0-optional flow table N, where N represents the identifier of each table in OpenFlow. In an optional embodiment, the table may also include a group table and a meter table, etc.
[0070] Step 20: Determine a second verification feature corresponding to the second flow table data received by the target switch; the target switch is a switch connected to the target controller.
[0071] In one embodiment of the present invention, the second flow table data includes the plurality of optional flow tables, and the second checksum includes the total number of entries and the total checksum of all the optional flow tables in the target switch.
[0072] In one embodiment of the present invention, flow table data corresponding to the optional flow tables issued by each of the aforementioned target controllers in the target switch is obtained, and statistics are performed on two dimensions, namely, the total number of table entries and the total checksum, to obtain a second check feature.
[0073] Step 30: Match the first verification feature and the second verification feature to obtain a first matching result.
[0074] In one embodiment of the present invention, for each optional flow table, the number of entries and the checksum of the optional flow table in the target controller and the target switch are compared to obtain a first matching result.
[0075] Taking into account the high time and computational cost of comparing the entry information of all optional flow tables one by one, which will result in low efficiency of flow table synchronization, in another embodiment of the present invention, all optional flow tables can be matched first with respect to the total number of entries and the total checksum corresponding to the target controller and the target switch respectively, and the optional flow tables can be further divided according to the matching results to obtain multiple subsets, and the verification features of the aforementioned dimensions can be matched for each subset.
[0076] Therefore, in yet another embodiment of the present invention, the first matching result may further include matching results of the total number of entries and the total checksum of all optional flow tables corresponding to the target controller and the target switch respectively.
[0077] Step 40: Determine the flow table to be synchronized in the target switch according to the first matching result.
[0078] In one embodiment of the present invention, when the first matching result includes the number of entries and checksums of each optional flow table in the target controller and the target switch, the optional flow table having mismatched number of entries or checksums is determined as the flow table to be synchronized.
[0079] In another embodiment of the present invention, when the first matching result includes the total number of table entries and the total checksum corresponding to all optional flow tables in the target controller and the target switch respectively, it is determined whether the flow table data in the target controller and the target switch are consistent based on the total number of table entries and the total checksum. If the total number of table entries and the total checksum corresponding to the set of all tables are inconsistent, the optional flow tables are divided into multiple subsets, and the verification features of the aforementioned dimensions are matched for each subset.
[0080] Therefore, in one embodiment of the present invention, step 40 further includes:
[0081] Step 401: When the first matching result is no match, the multiple optional flow tables are divided into multiple flow table subsets; each of the flow table subsets includes at least one of the optional flow tables.
[0082] In one embodiment of the present invention, when the first matching result includes the total number of table entries and the total checksum corresponding to all optional flow tables in the target controller and the target switch respectively, the multiple optional flow tables can be divided into multiple flow table subsets with a preset step size, and the total number of flow tables in all flow table subsets is the total number of optional flow tables.
[0083] For example, the target controller issues a total of 200 optional flow tables during flow table synchronization, and flow table subset A includes 50 optional flow tables, namely, optional flow table 50 to optional flow table 99.
[0084] Step 402: Determine the third verification feature corresponding to each of the flow table subsets in the target controller according to the first flow table data.
[0085] In one embodiment of the present invention, the third verification feature includes the total number of entries and the total checksum of all optional flow tables in each flow table subset in the target controller.
[0086] Step 403: Determine, based on the second flow table data, the fourth verification feature corresponding to each of the flow table subsets in the target switch.
[0087] In one embodiment of the present invention, the fourth verification feature includes the total number of entries and the total checksum of all optional flow tables in each flow table subset in the target switch.
[0088] Step 404: Match each of the third verification features with each of the fourth verification features respectively to obtain a second matching result corresponding to each of the flow table subsets.
[0089] In one embodiment of the present invention, the second matching result includes matching results under the verification feature dimension corresponding to each flow table subset, wherein the verification feature dimension includes the aforementioned total table entry sum and total checksum.
[0090] Step 405: Determine the flow table to be synchronized according to the second matching result.
[0091] In one embodiment of the present invention, when the second matching result for a flow table subset is consistent, it indicates that the flow table data corresponding to each optional sub-table in the flow table subset in the target controller and the target switch are consistent, and therefore no flow tables need to be synchronized. However, when the second matching result for a flow table subset is inconsistent, it is necessary to further determine the flow table to be synchronized from the flow table subset. Specifically, this determination can be performed by matching each optional flow table in the flow table subset one by one.
[0092] In one embodiment of the present invention, when the number of optional flow tables in the flow table subset is large, the flow table subset can be further divided into multiple flow table sub-subsets, and the aforementioned verification feature dimension matching is performed again for each flow table sub-subset, thereby speeding up the flow table synchronization.
[0093] Therefore, in one embodiment of the present invention, step 405 further includes:
[0094] Step 51: Determine the flow table subset for which the second matching result is mismatch as a subset to be synchronized.
[0095] In yet another embodiment of the present invention, step 51 further includes:
[0096] Step 511: Determine the total number of optional flow tables in the subset to be synchronized.
[0097] Step 512: When the total number of tables is greater than the number threshold, the subset to be synchronized is divided into multiple sub-subsets to be synchronized.
[0098] In one embodiment of the present invention, the number threshold may be 50, and the division and supplement of the subset to be synchronized may be adaptively determined according to the total number of tables in the subset to be synchronized.
[0099] Step 513: Determine the seventh verification feature corresponding to each of the to-be-synchronized sub-subsets in the target controller according to the first flow table data.
[0100] In one embodiment of the present invention, the seventh verification feature includes the total checksum and the total number of entries corresponding to all optional flow tables in the sub-subset to be synchronized in the target controller.
[0101] Step 514: Determine, based on the second flow table data, the eighth verification feature corresponding to each of the to-be-synchronized sub-subsets in the target switch.
[0102] In one embodiment of the present invention, the eighth verification feature includes the total checksum and the total number of entries corresponding to all optional flow tables in the to-be-synchronized sub-subset in the target switch.
[0103] Step 515: Match the seventh verification feature with the eighth verification feature to obtain a fourth matching result.
[0104] In one embodiment of the present invention, the fourth matching result includes matching results of each optional flow table in the sub-subset to be synchronized in the target switch and the target controller under the verification feature dimension, wherein the verification feature dimension includes the checksum and the number of entries.
[0105] Step 516: Determine the flow table to be synchronized from the sub-subset to be synchronized according to the fourth matching result.
[0106] In one embodiment of the present invention, the optional flow table whose fourth matching result in the to-be-synchronized secondary subset is inconsistent is determined as the to-be-synchronized flow table.
[0107] Step 52: Determine a fifth verification feature corresponding to the to-be-synchronized subset in the target controller according to the first flow table data.
[0108] In one embodiment of the present invention, the fifth verification feature includes the number of entries and the checksum of each of the optional flow tables in the to-be-synchronized subset in the target controller.
[0109] Step 53: Determine a sixth verification feature corresponding to the to-be-synchronized subset in the target switch according to the second flow table data.
[0110] In one embodiment of the present invention, the sixth verification feature includes the number of entries and the checksum of each optional flow table in the to-be-synchronized subset in the target switch.
[0111] Step 54: Match the fifth verification feature with the sixth verification feature to obtain a third matching result.
[0112] In one embodiment of the present invention, the third matching result includes whether the number of entries and the checksum of each optional flow table in the subset to be synchronized are consistent in the target controller and the target switch.
[0113] Step 55: Determine the flow table to be synchronized from the subset to be synchronized according to the third matching result.
[0114] In one embodiment of the present invention, the optional flow table for which the third matching result is inconsistent is determined as the flow table to be synchronized.
[0115] Step 50: Synchronize the flow table to be synchronized.
[0116] In one embodiment of the present invention, the flow table data to be synchronized in the target switch is synchronized based on the flow table data corresponding to the flow table to be synchronized in the target controller. Whether there are any entry differences is determined based on the data in the target controller. If so, the entry content is updated based on the flow table data issued by the controller, redundant entries are deleted, discrepant entries are modified, and missing entries are supplemented, thereby completing the synchronization of the flow table to be synchronized.
[0117] In yet another embodiment of the present invention, after it is determined that the synchronization of the flow table to be synchronized is completed, the operation lock on the flow table data in the target switch is released.
[0118] The flow table synchronization method provided by an embodiment of the present invention determines a first verification feature corresponding to first flow table data sent by a target controller, and determines a second verification feature corresponding to second flow table data received by a target switch; wherein the target switch is a switch connected to the target controller; the first verification feature and the second verification feature are matched to obtain a first matching result; based on the first matching result, a flow table to be synchronized in the target switch is determined, and the flow table to be synchronized is synchronized.
[0119] Different from the prior art that synchronizes all table items, resulting in low flow table synchronization efficiency, the flow table synchronization method provided by the embodiment of the present invention matches the verification features corresponding to the flow table data in the controller and the switch to obtain the flow table to be synchronized, and only the flow table to be synchronized needs to be synchronized, thereby improving the efficiency of flow table synchronization.
[0120] Figure 2 FIG. 1 shows a schematic diagram of the structure of a flow table synchronization device provided by an embodiment of the present invention. Figure 2 As shown, the apparatus 600 includes: a first determination module 601 , a second determination module 602 , a matching module 603 , a third determination module 604 and a synchronization module 605 .
[0121] The first determining module 601 is configured to determine a first verification feature corresponding to the first flow table data sent by the target controller;
[0122] A second determining module 602 is configured to determine a second verification feature corresponding to the second flow table data received by the target switch; the target switch is a switch connected to the target controller;
[0123] A matching module 603 is configured to match the first verification feature with the second verification feature to obtain a first matching result;
[0124] A third determining module 604 is configured to determine a flow table to be synchronized in the target switch according to the first matching result;
[0125] The synchronization module 605 is configured to synchronize the flow table to be synchronized.
[0126] In an optional manner, the synchronization module 605 is further configured to: lock the operation of the target switch on the second flow table data before the synchronization operation on the flow table to be synchronized is completed.
[0127] In an optional manner, the first flow table data includes multiple optional flow tables; the first verification feature includes the total number of entries and the total checksum of all the optional flow tables in the target controller;
[0128] The second flow table data includes the multiple optional flow tables; the second check feature includes the total number of table entries and the total checksum of all the optional flow tables in the target switch.
[0129] In an optional manner, the third determining module 604 is further configured to:
[0130] When the first matching result is no match, dividing the multiple optional flow tables into multiple flow table subsets; each of the flow table subsets includes at least one of the optional flow tables;
[0131] determining, according to the first flow table data, a third verification feature corresponding to each of the flow table subsets in the target controller;
[0132] Determine, according to the second flow table data, a fourth verification feature corresponding to each of the flow table subsets in the target switch;
[0133] Matching each of the third verification features with each of the fourth verification features respectively to obtain a second matching result corresponding to each of the flow table subsets;
[0134] The flow table to be synchronized is determined according to the second matching result.
[0135] In an optional manner, the third determining module 604 is further configured to:
[0136] Determining the flow table subset for which the second matching result is mismatch as a subset to be synchronized;
[0137] Determining a fifth verification feature corresponding to the to-be-synchronized subset in the target controller according to the first flow table data;
[0138] Determining, according to the second flow table data, a sixth verification feature corresponding to the to-be-synchronized subset in the target switch;
[0139] Matching the fifth verification feature with the sixth verification feature to obtain a third matching result;
[0140] The flow table to be synchronized is determined from the subset to be synchronized according to the third matching result.
[0141] In an optional manner, the third determining module 604 is further configured to:
[0142] Determining the total number of optional flow tables in the subset to be synchronized;
[0143] When the total number of tables is greater than a number threshold, dividing the subset to be synchronized into a plurality of sub-subsets to be synchronized;
[0144] determining, according to the first flow table data, a seventh verification feature corresponding to each of the to-be-synchronized sub-subsets in the target controller;
[0145] determining, according to the second flow table data, an eighth verification feature corresponding to each of the to-be-synchronized sub-subsets in the target switch;
[0146] Matching the seventh verification feature with the eighth verification feature to obtain a fourth matching result;
[0147] The flow table to be synchronized is determined from the sub-subset to be synchronized according to the fourth matching result.
[0148] In an optional manner, the fifth verification feature includes the number of entries and the checksum of each optional flow table in the to-be-synchronized subset in the target controller;
[0149] The sixth verification feature includes the number of entries and the checksum of each optional flow table in the to-be-synchronized subset in the target switch.
[0150] The flow table synchronization device provided by an embodiment of the present invention determines a first verification feature corresponding to first flow table data sent by a target controller, and determines a second verification feature corresponding to second flow table data received by a target switch; wherein the target switch is a switch connected to the target controller; matches the first verification feature and the second verification feature to obtain a first matching result; determines a flow table to be synchronized in the target switch based on the first matching result, and synchronizes the flow table to be synchronized.
[0151] Different from the prior art that synchronizes all table items, resulting in low flow table synchronization efficiency, the flow table synchronization device provided in the embodiment of the present invention matches the verification features corresponding to the flow table data in the controller and the switch to obtain the flow table to be synchronized, and only the flow table to be synchronized needs to be synchronized, thereby improving the efficiency of flow table synchronization.
[0152] Figure 3 The diagram shows a schematic diagram of the structure of a flow table synchronization device provided by an embodiment of the present invention. The specific embodiment of the present invention does not limit the specific implementation of the flow table synchronization device.
[0153] like Figure 3 As shown, the flow table synchronization device may include: a processor (processor) 702 , a communication interface (Communications Interface) 704 , a memory (memory) 706 , and a communication bus 708 .
[0154] Processor 702, communication interface 704, and memory 706 communicate with each other via communication bus 708. Communication interface 704 is used to communicate with other devices, such as clients or other server network elements. Processor 702 is used to execute program 710, which may specifically perform the steps described in the aforementioned embodiment of the flow table synchronization method.
[0155] Specifically, the program 710 may include program code including computer-executable instructions.
[0156] Processor 702 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention. The one or more processors included in the flow table synchronization device may be processors of the same type, such as one or more CPUs, or processors of different types, such as one or more CPUs and one or more ASICs.
[0157] The memory 706 is used to store the program 710. The memory 706 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0158] The program 710 may be specifically called by the processor 702 to cause the flow table synchronization device to perform the following operations:
[0159] Determining a first verification feature corresponding to the first flow table data sent by the target controller;
[0160] Determining a second verification feature corresponding to the second flow table data received by the target switch; the target switch is a switch connected to the target controller;
[0161] Matching the first verification feature with the second verification feature to obtain a first matching result;
[0162] Determine a flow table to be synchronized in the target switch according to the first matching result;
[0163] Synchronize the flow table to be synchronized.
[0164] In an optional manner, the program 710 is called by the processor 702 to enable the flow table synchronization device to perform the following operations:
[0165] Before the synchronization operation on the flow table to be synchronized is completed, the operation of the target switch on the second flow table data is locked.
[0166] In an optional manner, the first flow table data includes multiple optional flow tables; the first verification feature includes the total number of entries and the total checksum of all the optional flow tables in the target controller;
[0167] The second flow table data includes the multiple optional flow tables; the second check feature includes the total number of table entries and the total checksum of all the optional flow tables in the target switch.
[0168] In an optional manner, the program 710 is called by the processor 702 to enable the flow table synchronization device to perform the following operations:
[0169] When the first matching result is no match, dividing the multiple optional flow tables into multiple flow table subsets; each of the flow table subsets includes at least one of the optional flow tables;
[0170] determining, according to the first flow table data, a third verification feature corresponding to each of the flow table subsets in the target controller;
[0171] Determine, according to the second flow table data, a fourth verification feature corresponding to each of the flow table subsets in the target switch;
[0172] Matching each of the third verification features with each of the fourth verification features respectively to obtain a second matching result corresponding to each of the flow table subsets;
[0173] The flow table to be synchronized is determined according to the second matching result.
[0174] In an optional manner, the program 710 is called by the processor 702 to enable the flow table synchronization device to perform the following operations:
[0175] Determining the flow table subset for which the second matching result is mismatch as a subset to be synchronized;
[0176] Determining a fifth verification feature corresponding to the to-be-synchronized subset in the target controller according to the first flow table data;
[0177] Determining, according to the second flow table data, a sixth verification feature corresponding to the to-be-synchronized subset in the target switch;
[0178] Matching the fifth verification feature with the sixth verification feature to obtain a third matching result;
[0179] The flow table to be synchronized is determined from the subset to be synchronized according to the third matching result.
[0180] In an optional manner, the program 710 is called by the processor 702 to enable the flow table synchronization device to perform the following operations:
[0181] Determining the total number of optional flow tables in the subset to be synchronized;
[0182] When the total number of tables is greater than a number threshold, dividing the subset to be synchronized into a plurality of sub-subsets to be synchronized;
[0183] determining, according to the first flow table data, a seventh verification feature corresponding to each of the to-be-synchronized sub-subsets in the target controller;
[0184] determining, according to the second flow table data, an eighth verification feature corresponding to each of the to-be-synchronized sub-subsets in the target switch;
[0185] Matching the seventh verification feature with the eighth verification feature to obtain a fourth matching result;
[0186] The flow table to be synchronized is determined from the sub-subset to be synchronized according to the fourth matching result.
[0187] In an optional manner, the fifth verification feature includes the number of entries and the checksum of each optional flow table in the to-be-synchronized subset in the target controller;
[0188] The sixth verification feature includes the number of entries and the checksum of each optional flow table in the to-be-synchronized subset in the target switch.
[0189] The flow table synchronization device provided by an embodiment of the present invention determines a first verification feature corresponding to first flow table data sent by a target controller, and determines a second verification feature corresponding to second flow table data received by a target switch; wherein the target switch is a switch connected to the target controller; matches the first verification feature and the second verification feature to obtain a first matching result; determines a flow table to be synchronized in the target switch based on the first matching result, and synchronizes the flow table to be synchronized.
[0190] Different from the prior art that synchronizes all table items, resulting in low flow table synchronization efficiency, the flow table synchronization device provided by the embodiment of the present invention obtains the flow table to be synchronized by matching the verification features corresponding to the flow table data in the controller and the switch, and only needs to synchronize the flow table to be synchronized, thereby improving the efficiency of flow table synchronization.
[0191] An embodiment of the present invention provides a computer-readable storage medium storing at least one executable instruction. When the executable instruction runs on a flow table synchronization device, the flow table synchronization device executes the flow table synchronization method in any of the above method embodiments.
[0192] The executable instructions may be used to cause the flow table synchronization device to perform the following operations:
[0193] Determining a first verification feature corresponding to the first flow table data sent by the target controller;
[0194] Determining a second verification feature corresponding to the second flow table data received by the target switch; the target switch is a switch connected to the target controller;
[0195] Matching the first verification feature with the second verification feature to obtain a first matching result;
[0196] Determine a flow table to be synchronized in the target switch according to the first matching result;
[0197] Synchronize the flow table to be synchronized.
[0198] In an optional manner, the executable instruction causes the flow table synchronization device to perform the following operations:
[0199] Before the synchronization operation on the flow table to be synchronized is completed, the operation of the target switch on the second flow table data is locked.
[0200] In an optional manner, the first flow table data includes multiple optional flow tables; the first verification feature includes the total number of entries and the total checksum of all the optional flow tables in the target controller;
[0201] The second flow table data includes the multiple optional flow tables; the second check feature includes the total number of table entries and the total checksum of all the optional flow tables in the target switch.
[0202] In an optional manner, the executable instruction causes the flow table synchronization device to perform the following operations:
[0203] When the first matching result is no match, dividing the multiple optional flow tables into multiple flow table subsets; each of the flow table subsets includes at least one of the optional flow tables;
[0204] determining, according to the first flow table data, a third verification feature corresponding to each of the flow table subsets in the target controller;
[0205] Determine, according to the second flow table data, a fourth verification feature corresponding to each of the flow table subsets in the target switch;
[0206] Matching each of the third verification features with each of the fourth verification features respectively to obtain a second matching result corresponding to each of the flow table subsets;
[0207] The flow table to be synchronized is determined according to the second matching result.
[0208] In an optional manner, the executable instruction causes the flow table synchronization device to perform the following operations:
[0209] Determining the flow table subset for which the second matching result is mismatch as a subset to be synchronized;
[0210] Determining a fifth verification feature corresponding to the to-be-synchronized subset in the target controller according to the first flow table data;
[0211] Determining, according to the second flow table data, a sixth verification feature corresponding to the to-be-synchronized subset in the target switch;
[0212] Matching the fifth verification feature with the sixth verification feature to obtain a third matching result;
[0213] The flow table to be synchronized is determined from the subset to be synchronized according to the third matching result.
[0214] In an optional manner, the executable instruction causes the flow table synchronization device to perform the following operations:
[0215] Determining the total number of optional flow tables in the subset to be synchronized;
[0216] When the total number of tables is greater than a number threshold, dividing the subset to be synchronized into a plurality of sub-subsets to be synchronized;
[0217] determining, according to the first flow table data, a seventh verification feature corresponding to each of the to-be-synchronized sub-subsets in the target controller;
[0218] determining, according to the second flow table data, an eighth verification feature corresponding to each of the to-be-synchronized sub-subsets in the target switch;
[0219] Matching the seventh verification feature with the eighth verification feature to obtain a fourth matching result;
[0220] The flow table to be synchronized is determined from the sub-subset to be synchronized according to the fourth matching result.
[0221] In an optional manner, the fifth verification feature includes the number of entries and the checksum of each optional flow table in the to-be-synchronized subset in the target controller;
[0222] The sixth verification feature includes the number of entries and the checksum of each optional flow table in the to-be-synchronized subset in the target switch.
[0223] The computer-readable storage medium provided in an embodiment of the present invention determines a first verification feature corresponding to first flow table data sent by a target controller, and determines a second verification feature corresponding to second flow table data received by a target switch; wherein the target switch is a switch connected to the target controller; matches the first verification feature and the second verification feature to obtain a first matching result; determines a flow table to be synchronized in the target switch based on the first matching result, and synchronizes the flow table to be synchronized.
[0224] Different from the prior art method of synchronizing all table items, which leads to low flow table synchronization efficiency, the computer-readable storage medium provided in the embodiment of the present invention matches the verification features corresponding to the flow table data in the controller and the switch to obtain the flow table to be synchronized, and only the flow table to be synchronized needs to be synchronized, thereby improving the efficiency of flow table synchronization.
[0225] An embodiment of the present invention provides a flow table synchronization device for executing the above flow table synchronization method.
[0226] An embodiment of the present invention provides a computer program, which can be called by a processor to enable a flow table synchronization device to execute the flow table synchronization method in any of the above method embodiments.
[0227] An embodiment of the present invention provides a computer program product, which includes a computer program stored on a computer-readable storage medium. The computer program includes program instructions. When the program instructions are run on a computer, the computer executes the flow table synchronization method in any of the above method embodiments.
[0228] The algorithm or demonstration provided herein are not inherently relevant to any particular computer, virtual system or other equipment. Various general-purpose systems may also be used together with the teachings based on this. According to the above description, it is apparent that the structure required for constructing this type of system. In addition, the embodiment of the present invention is not directed to any specific programming language yet. It should be understood that various programming languages can be utilized to realize the content of the present invention described herein, and the above description of specific languages is for the purpose of disclosing the best mode of the present invention.
[0229] In the description provided herein, numerous specific details are described. However, it is understood that embodiments of the present invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques are not shown in detail so as not to obscure the understanding of this description.
[0230] Similarly, it should be understood that in order to streamline the present invention and facilitate understanding of one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the embodiments of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this method of disclosure should not be interpreted as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim.
[0231] Those skilled in the art will appreciate that the modules in the devices in the embodiments can be adaptively changed and set in one or more devices different from the embodiments. The modules or units or components in the embodiments can be combined into one module or unit or component, and can be divided into multiple sub-modules or sub-units or sub-components. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed so far can be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) can be replaced by an alternative feature that provides the same, equivalent or similar purpose.
[0232] It should be noted that the above embodiments illustrate rather than limit the invention, and that alternative embodiments may be devised by a person skilled in the art without departing from the scope of the appended claims. In the claims, any reference signs placed between brackets should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising several different elements and by means of appropriately programmed computers. In a unit claim enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third etc. does not indicate any order. These words may be interpreted as names. The steps in the above embodiments should not be understood as limiting the order of execution unless otherwise specified.
Claims
1. A flow table synchronization method, characterized in that: The method comprises: Determining a first verification feature corresponding to first flow table data sent by a target controller; the first flow table data includes multiple optional flow tables; the first verification feature includes a total number of table entries and a total checksum of all the optional flow tables in the target controller; Determining a second verification feature corresponding to second flow table data received by a target switch; the target switch is a switch connected to the target controller; the second flow table data includes the multiple optional flow tables; the second verification feature includes a total number of entries and a total checksum of all the optional flow tables in the target switch; Matching the first verification feature with the second verification feature to obtain a first matching result; Determine a flow table to be synchronized in the target switch according to the first matching result; Synchronize the flow table to be synchronized.
2. The method according to claim 1, characterized in that Before the synchronization operation on the flow table to be synchronized is completed, the operation of the target switch on the second flow table data is locked.
3. The method according to claim 1, characterized in that The determining the flow table to be synchronized in the target switch according to the first matching result includes: When the first matching result is no match, dividing the multiple optional flow tables into multiple flow table subsets; each of the flow table subsets includes at least one of the optional flow tables; determining, according to the first flow table data, a third verification feature corresponding to each of the flow table subsets in the target controller; Determine, according to the second flow table data, a fourth verification feature corresponding to each of the flow table subsets in the target switch; Matching each of the third verification features with each of the fourth verification features respectively to obtain a second matching result corresponding to each of the flow table subsets; The flow table to be synchronized is determined according to the second matching result.
4. The method according to claim 3, characterized in that The determining the flow table to be synchronized according to the second matching result includes: Determining the flow table subset for which the second matching result is mismatch as a subset to be synchronized; Determining a fifth verification feature corresponding to the to-be-synchronized subset in the target controller according to the first flow table data; Determine, according to the second flow table data, a sixth verification feature corresponding to the subset to be synchronized in the target switch; Matching the fifth verification feature with the sixth verification feature to obtain a third matching result; The flow table to be synchronized is determined from the subset to be synchronized according to the third matching result.
5. The method according to claim 4, characterized in that After determining the flow table subset for which the second matching result is mismatch as the subset to be synchronized, the method further includes: Determining the total number of optional flow tables in the subset to be synchronized; When the total number of tables is greater than a number threshold, dividing the subset to be synchronized into a plurality of sub-subsets to be synchronized; determining, according to the first flow table data, a seventh verification feature corresponding to each of the to-be-synchronized sub-subsets in the target controller; determining, according to the second flow table data, an eighth verification feature corresponding to each of the to-be-synchronized sub-subsets in the target switch; Matching the seventh verification feature with the eighth verification feature to obtain a fourth matching result; The flow table to be synchronized is determined from the sub-subset to be synchronized according to the fourth matching result.
6. The method according to claim 4, characterized in that The fifth verification feature includes the number of entries and the checksum of each optional flow table in the to-be-synchronized subset in the target controller; The sixth verification feature includes the number of entries and the checksum of each optional flow table in the to-be-synchronized subset in the target switch.
7. A flow table synchronization device, characterized in that: The device comprises: a first determination module, configured to determine a first verification feature corresponding to first flow table data sent by a target controller; the first flow table data including a plurality of optional flow tables; the first verification feature including a total number of entries and a total checksum of all the optional flow tables in the target controller; a second determination module, configured to determine a second verification feature corresponding to second flow table data received by a target switch; the target switch being a switch connected to the target controller; the second flow table data including the plurality of optional flow tables; the second verification feature including a total number of entries and a total checksum of all the optional flow tables in the target switch; a matching module, configured to match the first verification feature with the second verification feature to obtain a first matching result; a third determining module, configured to determine a flow table to be synchronized in the target switch according to the first matching result; A synchronization module is used to synchronize the flow table to be synchronized.
8. A flow table synchronization device, characterized in that: include: A processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform the operation of the flow table synchronization method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that The storage medium stores at least one executable instruction. When the executable instruction is executed on the flow table synchronization device, the flow table synchronization device performs the operation of the flow table synchronization method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Flow table modifying method, flow table modifying device, and openflow network system
WO2015109497A1