Flow table configuration method, device, equipment and storage medium for edge nodes in a cluster
By obtaining and processing the latest flow table calculation results and historical flow table information, the problem of insufficient accuracy of flow tables in SDN is solved, and the accuracy and consistency of flow tables are achieved, ensuring the reliability of traffic forwarding.
Patent Information
- Application Number
- CN202411730207.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-11-28
AI Technical Summary
In SDN, the accuracy of the flow table is not high enough, which affects the forwarding of traffic, resulting in the inability to forward traffic according to the predetermined design.
By obtaining the latest flow table calculation results of the target service, querying the historical flow table that has not been updated in the virtual switch, obtaining the second business object information, and querying and processing the historical flow table locally to ensure the accuracy and consistency of the flow table.
Improve the accuracy and consistency of the flow table, ensuring that traffic can be forwarded according to the predetermined design, meeting the needs of upper-level services.
Smart Images

Figure CN119232648B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of communication technology, and in particular to a flow table configuration method, device, equipment and storage medium for edge nodes in a cluster. Background Art
[0002] SDN (Software-Defined Networking) is a network architecture that controls network behavior through software programming. It is a network virtualization and containerization method that can be used to optimize network resources and quickly adjust the network. It separates the control plane of the network from the data forwarding plane through network virtualization technology, and dynamically programs and configures the network through a centralized controller to adapt it to changing business needs, applications, and traffic. In SDN, virtual switches are often used as underlying forwarding devices. Flow tables are configured on virtual switches as traffic forwarding rules. The upper-level controller dynamically adjusts the underlying flow table configuration according to changes in business objects, thereby achieving the purpose of modifying the traffic forwarding path. If the accuracy of the flow table is not high enough, it will affect the forwarding of subsequent traffic. Therefore, the accuracy of the flow table plays a vital role in whether the traffic can be forwarded according to the predetermined design. Summary of the invention
[0003] In view of this, the present disclosure provides a flow table configuration method, apparatus, device and storage medium for edge nodes in a cluster to solve the problem of flow table accuracy.
[0004] In a first aspect, the present disclosure provides a flow table configuration method for an edge node in a cluster, the method comprising:
[0005] Obtaining the latest flow table calculation result corresponding to the target service, the flow table comprising a first flow table identification field and a flow table entry, the first flow table identification field comprising a first version number and first service object information;
[0006] If the flow table calculation result indicates that the flow table calculation is completed, querying the historical flow table whose version has not been updated in the virtual switch to obtain the second business object information in the historical flow table, wherein the flow table calculation completion includes one of the latest flow table update completion, calculation failure, and flow table update failure;
[0007] locally querying the second business object information to obtain a query result of the business object information;
[0008] Based on the query result, the historical flow table is processed.
[0009] In a second aspect, the present disclosure provides a flow table configuration device for an edge node in a cluster, the device comprising:
[0010] A latest flow table acquisition module, used to obtain the latest flow table calculation result corresponding to the target business, the flow table includes a first flow table identification field and a flow table item, the first flow table identification field includes a first version number and first business object information;
[0011] A historical flow table query module, configured to query a historical flow table whose version has not been updated in the virtual switch to obtain second business object information in the historical flow table if the flow table calculation result indicates that the flow table calculation is completed, wherein the flow table calculation completion includes one of the latest flow table update completion, calculation failure, and flow table update failure;
[0012] A second business query module, used to query the second business object information locally to obtain a query result of the business object information;
[0013] A flow table processing module is used to process the historical flow table based on the query result.
[0014] In a third aspect, the present disclosure provides an electronic device comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0015] In a fourth aspect, the present disclosure provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method of the first aspect or any corresponding embodiment thereof.
[0016] In a fifth aspect, the present disclosure provides a computer program product, including computer instructions, where the computer instructions are used to enable a computer to execute the method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the specific embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0018] Figure 1 It is a flowchart of a method for configuring a flow table of an edge node in a cluster according to an embodiment of the present disclosure;
[0019] Figure 2 is a schematic diagram of a flow table identification field according to an embodiment of the present disclosure;
[0020] Figure 3is a flowchart of a method for configuring a flow table of an edge node in another cluster according to an embodiment of the present disclosure;
[0021] Figure 4 is a flow chart of a method for configuring a flow table of an edge node in another cluster according to an embodiment of the present disclosure;
[0022] Figure 5 is a schematic diagram of a flow table configuration method for an edge node in a cluster according to an embodiment of the present disclosure;
[0023] Figure 6 is a schematic diagram of a flow table configuration method of an edge node in another cluster according to an embodiment of the present disclosure;
[0024] Figure 7 is a structural diagram of a flow table configuration according to an embodiment of the present disclosure;
[0025] Figure 8 is a structural block diagram of a flow table configuration device of an edge node in a cluster according to an embodiment of the present disclosure;
[0026] Fig. 9 It is a schematic diagram of the hardware structure of the electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0027] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.
[0028] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0029] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0030] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0031] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0032] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions. SDN (Software-Defined Networking) is a network architecture that controls network behavior through software programming. It is a method of network virtualization and containerization that can be used to optimize network resources and quickly adjust the network to adapt to changing business needs, applications and traffic. In the SDN architecture, the controller is the core component responsible for the behavior and policy management of the entire network. As the central controller of the network, the SDN controller can centrally control and manage the behavior of the entire network. It can automatically discover the topology structure in the network and manage the network topology through network topology discovery and management functions. The SDN controller can achieve flexible control and management of network traffic by controlling the traffic forwarding of network devices, thereby improving the performance and reliability of the network.
[0033] Edge computing deploys computing and data processing capabilities at the edge of the network. Multiple edge nodes in edge computing can form a cluster. A cluster is a computing system composed of multiple physical or virtual nodes. Edge nodes are usually located at the edge of the network. They are an important part of distributed computing and network architecture and are responsible for data collection, processing, storage and communication. Multiple edge nodes contained in the cluster work together to provide distributed data processing and network communication capabilities. In SDN networks, virtual switches are often used as underlying forwarding devices, such as OVS (Open vSwitch). Flow tables can be configured on OVS as forwarding rules for traffic. The upper controller dynamically adjusts the underlying flow table configuration according to changes in business objects, thereby achieving the purpose of modifying the flow table forwarding path. Therefore, the accuracy of the flow table determines whether the traffic can be forwarded according to the predetermined design to meet the needs of the upper-layer business. Each edge node may be configured with a flow table. In order to ensure the accuracy and consistency of the flow table, the underlying flow table will be updated after the controller is started. The accuracy of the generated flow table needs to be guaranteed. If the calculation logic is wrong or the calculation fails, the underlying flow table will be updated abnormally, and the flow table may be deleted by mistake. The overall flow table identification and control accuracy is low. In edge computing clusters, SDN technology is expected to achieve unified management and scheduling of edge nodes. Based on this, an embodiment of the present disclosure provides a flow table configuration method for edge nodes in a cluster.
[0034] According to an embodiment of the present disclosure, an embodiment of a flow table configuration method for an edge node in a cluster is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0035] In this embodiment, a flow table configuration method for edge nodes in a cluster is provided, which is applied to an upper layer controller in SDN. Figure 1 is a flow chart of a method for configuring a flow table of an edge node in a cluster according to an embodiment of the present disclosure, such as Figure 1 As shown, the process includes the following steps:
[0036] Step S101, obtaining the latest flow table calculation result corresponding to the target service.
[0037] The flow table includes a first flow table identification field and a flow table entry, and the first flow table identification field includes a first version number and first business object information.
[0038] The target business refers to the current business object. The upper-layer controller needs to dynamically adjust the underlying flow table configuration according to the current business changes. Therefore, it is necessary to perform flow table calculation according to the target business to obtain the flow table calculation result.
[0039] The flow table identification field (cookie) in the flow table structure is used to identify the flag field of a single or a group of flow tables. It is not used as a match for traffic forwarding. It is mainly used to query, modify and delete flow tables. The length is 64 bits and the default value is 0. In the flow table, the cookie is used as the identifier of the overall version of the virtual switch flow table. Each time the controller is started, the version information of the old cookie is recorded, and then the underlying flow table is fully calculated and updated. In this embodiment, the 64 characters of the flow table identification field are as follows: Figure 2 Divide as shown.
[0040] The meanings of each field are as follows: The length of the cookie format version is 4 bits, which identifies the version of the current cookie itself, and is used to be compatible with subsequent iterations and updates of the cookie format content; the length of the flow table version is 8 bits, which identifies the version of the current overall flow table. This value gradually increases with the number of controller startups, and continues to increase cyclically when it reaches the maximum value; the length of the object type is 8 bits, which identifies the object type to which the current flow table belongs. Each flow table has a fixed object to trigger and send, and there is no situation where different objects trigger and send the same flow table, ensuring the uniqueness of the flow table; the length of the module type is 8 bits, which identifies the controller object processing module type. Each business object has a corresponding processing module. When the flow table is missing or residual, the code logic analysis can be performed through the associated module; the length of the object ID is 32 bits, which identifies the specific object associated with the current flow table. When the flow table calculation fails or the residual flow table is cleared, it is determined whether the object associated with the flow table exists. If it exists, an alarm is issued, and if it does not exist, the flow table can be cleared; the length of the reserved part is 4 bits, and the remaining bits are used as reserved bits. There is no practical use for the time being, and it is reserved as a part for subsequent function expansion.
[0041] Through the above definition, the version of the flow table identification field itself can be defined. If the format is iteratively updated, the version information is used to identify and perform multi-version compatibility processing. In addition, the version of the entire flow table is defined. Each time the controller is upgraded or restarted due to an exception, the flow table will be fully refreshed and the version information will be incremented. The version information can be used to accurately determine whether the underlying flow table remains.
[0042] In some optional implementations, the first business object information includes a business object type, a business object identifier, and a processing module type associated with the business object, and the first flow table identifier field also includes a format version of the flow table identifier field.
[0043] The business object type is the object type, which can identify the object type to which the current flow table belongs. The business object identifier is the object ID, which can identify the specific object associated with the flow table. The processing module type associated with the business object is the module type, which can identify the controller object processing module type. Each business object has a corresponding processing module. The first flow table identification field also includes the format version of the flow table identification field, that is, the cookie format version, which identifies the version of the current cookie itself, which is used for compatibility with subsequent iterations and updates of cookie format content.
[0044] When it is necessary to calculate the flow table according to the target business, you first need to add a basic flow table. The basic flow table is a fixed flow table with global granularity. It does not distinguish between modules and objects. It is first issued each time the controller is started. The basic flow table stores the flow table forwarding rules. After that, each business module in the controller performs parallel calculations according to the target business to obtain the latest flow table. The flow table includes the first flow table identification field (cookie) and flow table items. The first flow table identification field represents the cookie in the latest flow table. The first version number in the first flow table identification field represents the flow table version, and the first business object information represents the object type and object identification (object ID).
[0045] Step S102: If the flow table calculation result indicates that the flow table calculation is completed, query the historical flow table whose version has not been updated in the virtual switch to obtain the second service object information in the historical flow table.
[0046] The flow table calculation completion includes one of the latest flow table update completion, calculation failure and flow table update failure.
[0047] The calculated flow table with the new first flow table identification field is sent to the virtual switch, thereby updating the old version of the flow table in the virtual switch, wherein the virtual switch is deployed on the edge node in the cluster. When updating the old version of the flow table, there may be an update failure, and the calculation can be considered complete when the flow table update is completed, the flow table calculation fails, or the update fails. When the flow table calculation is completed, the historical flow table whose version has not been updated in the virtual switch is queried. Since the version in the first flow table identification field should be the latest version after the calculation is completed, the historical flow table of the old version in the virtual switch can be queried based on this, and then the second business object information in these old versions of the historical flow table can be obtained.
[0048] Step S103: query the second business object information locally to obtain the query result of the business object information.
[0049] The controller stores the information of the flow table locally. As an example, a database (DB) is stored locally, and all flow tables are stored in the database. When querying, the business object information in all relevant flow tables can be queried in the locally stored database, including the business object type and object ID, so as to determine whether there is a flow table with the second business object information locally. The query results of the business object obtained may include queried or not queried.
[0050] Step S104: Process the historical flow table based on the query result.
[0051] The query results include queried and not queried. The corresponding processing is performed based on the query results of the business object information. Different results may indicate that the controller calculation logic is abnormal or there are residual flow tables in the underlying virtual switch. The corresponding processing may include alarms or direct cleanup.
[0052] The flow table configuration method for edge nodes in a cluster provided in this embodiment first obtains the latest flow table calculation result corresponding to the target business. If the flow table calculation result indicates that the flow table calculation is completed, the historical flow table whose version has not been updated in the virtual switch is queried to obtain the corresponding second business object information, and the second business object information is queried locally in the controller, so as to process the historical flow table according to the query result of the second business object information. This adds an additional judgment after the flow table calculation to check whether there are redundant flow tables, and performs corresponding operations according to the inspection results to delete the remaining old version flow table, thereby improving the accuracy of the flow table. In addition, by specifying the meaning of different bits in the flow table identification field, a variety of information is clarified, including flow table version, module type, object type and other information, so as to achieve accurate identification and control of flow tables at the object level.
[0053] In this embodiment, a flow table configuration method for edge nodes in a cluster is provided. Figure 3 is a flow chart of a method for configuring a flow table of an edge node in a cluster according to an embodiment of the present disclosure, such as Figure 3 As shown, the process includes the following steps:
[0054] Step S201, obtaining the latest flow table calculation result corresponding to the target service.
[0055] The flow table includes a first flow table identification field and a flow table entry, and the first flow table identification field includes a first version number and first service object information.
[0056] For details, please see Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.
[0057] Step S202: If the flow table calculation result indicates that the flow table calculation is completed, query the historical flow table whose version is not updated in the virtual switch to obtain the second business object information in the historical flow table. The flow table calculation completion includes one of the latest flow table update completion, calculation failure and flow table update failure.
[0058] Specifically, the above step S202 includes:
[0059] Step S2021, obtaining the second flow table identification field of all flow tables in the virtual switch.
[0060] The second flow table identification field is the cookie of all flow tables in the virtual switch. The cookie of each flow table is extracted from all flow tables in the virtual switch, so as to obtain the second flow table identification fields of all flow tables.
[0061] Step S2022: determine a historical flow table whose version has not been updated based on the second version number in the second flow table identification field to obtain second service object information in the historical flow table.
[0062] The version number in the flow table identification field indicates the version of the flow table, and the second version number refers to the flow table version in the second flow table identification field. If the second version number in the second flow table identification field of the flow table is not the latest updated version number, it indicates that the flow table is an unupdated historical flow table. The business object information of the unupdated historical flow table is obtained, and specifically, the object type and object ID data are obtained from the second flow table identification field of the historical flow table to form the second business object information.
[0063] Step S203: query the second business object information locally to obtain the query result of the business object information.
[0064] Specifically, the above step S203 includes:
[0065] Step S2031: Obtain the second business object identifier in the second business object information.
[0066] The business object information may include a business object type and a business object identifier. After acquiring the second business object information of the flow table whose version has not been updated, the second business object identifier in the second business object information is extracted.
[0067] Step S2032: query whether the second business object identifier exists in the local database to obtain a query result.
[0068] The controller stores all flow tables in a local database. It queries whether there is a second business object identifier in the flow table identifier field of the flow table in the local database to obtain a corresponding query result, which includes whether it exists or not.
[0069] Step S204: Process the historical flow table based on the query result.
[0070] Specifically, the above step S204 includes:
[0071] Step S2041: If the query result indicates that the second business object identifier exists locally, an alarm is issued.
[0072] If the query result indicates that the second business object identifier exists locally, it means that in the process of calculating the flow table in each module, there are flow table rules that fail to be calculated or refreshed, indicating that there is an abnormality in the calculation logic, so an alarm is issued for manual processing.
[0073] Step S2042: If the query result indicates that the second business object identifier does not exist locally, the historical flow table is deleted.
[0074] If the query result indicates that the second business object identifier does not exist locally, it indicates that the flow table is a residual flow table and has no business object associated with it, and can be directly deleted, that is, the historical flow table is deleted.
[0075] This embodiment obtains the second version number by querying the second flow table identification field, and determines whether the flow table is a historical flow table whose version has not been updated by judging whether the second version number is the latest version number, and obtains the second business object information of the historical flow table whose version has not been updated, which can be obtained specifically from the second flow table identification field of the historical flow table. After obtaining the second business object identification, a query is performed in the local database to obtain the query result, and then it is determined whether the historical flow table is a residual flow table or there is a logical error in the calculation. Different operations are performed for different query results. If it is a residual historical flow table, it is deleted. This method defines the second flow table identification field, and determines the judgment of the flow table version by using specific fields in the flow table identification field, thereby improving the accuracy of flow table identification.
[0076] In this embodiment, a flow table configuration method for edge nodes in a cluster is provided. Figure 4 is a flow chart of a method for configuring a flow table of an edge node in a cluster according to an embodiment of the present disclosure, such as Figure 4 As shown, the process includes the following steps:
[0077] Step S301, obtaining the latest flow table.
[0078] Each business module of the controller calculates the flow table according to the target business to obtain the latest flow table. The flow table identification field in the latest flow table calculated will also be updated, such as: flow table version, business object information, etc.
[0079] Step S302: If the latest flow table is obtained after the local restart, the connection status between the local and virtual switches is detected.
[0080] If the controller needs to be restarted, all flow tables need to be fully synchronized. When the latest flow table is obtained after the controller is restarted, when the controller starts, the latest version information of the flow table is obtained through the local database to delete the old version of the flow table. Then establish a connection with the virtual controller. In this step, the connection status between the local and virtual switches is detected. The connection status includes connection failure and connection success.
[0081] Step S303: If the connection status indicates that the initial connection is successful, it is determined whether there is an old version of the flow table in the virtual switch based on the first flow table identification field of the latest flow table.
[0082] If the connection status indicates that the virtual controller and the controller are successfully connected for the first time, obtain the first flow table identification field of the latest flow table, and then obtain the flow table version in the first flow table identification field to determine whether the flow table versions of the flow tables in the virtual switch are consistent. If they are inconsistent, it is determined that an old version of the flow table exists in the virtual switch.
[0083] Step S304: If an old version of the flow table exists in the virtual switch, the old version of the flow table is deleted and the latest flow table is fully updated to the local cache and the virtual switch.
[0084] If an old version of the flow table exists in the virtual switch, delete the old version of the flow table. The old version of the flow table may contain outdated forwarding rules that may interfere with or block normal network traffic. By deleting the old version of the flow table, you can ensure that the virtual switch no longer forwards packets based on these outdated rules. After deleting the old version of the flow table, the system will fully update the latest flow table to the local cache and the virtual switch. Full update means that the complete and latest flow table replaces the old flow table. This update method ensures that the flow table in the virtual switch is up to date and complete, so that network traffic can be processed correctly according to the new forwarding rules. In addition to updating the latest flow table to the virtual switch, the system also stores the flow table in the local cache. Doing so can improve the efficiency of flow table lookup because the system can first look for matching flow table entries in the local cache without retrieving them from the virtual switch each time. In addition, the local cache can also serve as a data backup to prevent the flow table data in the virtual switch from being lost or damaged.
[0085] The flow table configuration method of the edge node in the cluster provided by the embodiment of the present invention obtains the latest flow table, and when the latest flow table is obtained after the local restart, detects the connection status of the local and virtual switches. When the connection status indicates that the initial connection is successful, it is determined whether there is an old version of the flow table based on the first flow table identification field of the latest flow table. If there is an old version of the flow table, the old version of the flow table is deleted and the latest flow table is fully updated to the local cache and the virtual switch. This process ensures the consistency of the flow table in the underlying virtual switch and the controller, and establishes cache data of the full flow table in the controller to prevent the loss or damage of the flow table data. By deleting the old version of the flow table and updating the latest flow table in full to the local cache and the virtual switch, the stability and efficiency of the network environment can be ensured.
[0086] In some optional embodiments, the method further comprises:
[0087] Step S401: If the latest flow table is obtained due to a change in the target service, the first flow table identification field of the latest flow table is obtained by updating only the service object information of the previous flow table.
[0088] When the controller is not restarted, and the latest flow table is calculated only because the target business changes, there is no need to fully update the flow table. The latest flow table corresponding to the target business is calculated, and each field in the first flow table identification field of the latest flow table is related to the target business, wherein the business object information part is updated to the latest target business, that is, the latest business object information of the target business is updated based on the business object information of the previous flow table. The business object information includes the business object type, business object identifier, etc.
[0089] Step S402: Update the latest flow table increment to the local cache and the virtual switch.
[0090] For the latest flow table calculated only because of the change of the target business, it is stored in the local cache and virtual switch in an incremental update manner.
[0091] In some optional embodiments, the method further comprises the following steps:
[0092] Step S501: If the connection status indicates that the initial connection is successful but the reconnection is successful, the latest flow table cached locally is fully updated to the virtual switch.
[0093] After the virtual switch is started, it reconnects with the controller. When the connection is established for the first time and the reconnection is successful, the controller sends the latest flow table in the local cache to the virtual switch.
[0094] Step S502: If an old version of the flow table exists in the virtual switch, the old version of the flow table is deleted.
[0095] After sending the latest flow table, clean up the old version of the flow table in the virtual switch. Specifically, you can first obtain the flow table identification field of the latest flow table, and determine whether there is an old version of the flow table in the virtual switch based on the field indicating the flow table version in the flow table identification field, and delete all old versions of the flow table.
[0096] The flow table configuration method of the edge node in the cluster provided by the embodiment of the present invention can calibrate the flow table configuration in the underlying virtual switch after the controller is started, and establish a full flow table cache. When the virtual switch starts to re-establish the connection, the flow table configuration can be quickly restored according to the established flow table cache. In the case of a forwarding plane failure, the configuration can be quickly restored, thereby improving the disaster recovery capability.
[0097] In this embodiment, a flow table configuration method for edge nodes in a cluster is provided. Figure 5 : is a schematic diagram of a flow table configuration method for edge nodes in a cluster according to an embodiment of the present disclosure, which discloses a method for processing a virtual switch flow table consistency based on cookies. The entire processing method is as follows:
[0098] In this embodiment, the virtual switch uses OVS, and cookie is the flow table identification field. First, the basic flow table is added. The flow table is a fixed flow table of global granularity, which does not distinguish between modules and objects. It is first issued each time the controller is started. Each business module of the controller starts to perform parallel logical calculations based on the existing business objects, and sends the calculated flow table with the new cookie to OVS. If the calculation or update of the flow table fails, it can also be considered that the calculation is completed. If the calculation is successful, it is determined whether it is a full synchronization. If it is a full synchronization process, the full synchronization is for the controller restart scenario. The flow table corresponding to the cookie can be queried according to the module information and object information, and then it is determined whether it is an old version according to the version information in the cookie. If it is an old version, it is directly deleted. If it is not a full synchronization process, the flow table cache in the controller is updated, and the latest flow table is stored in the local cache. After the calculation of each controller module is completed, all relevant flow tables are queried according to the old version information of the cookie saved in the local database, and the object information associated with the flow table is parsed to obtain the object information. The database is queried whether there is a current business object through the object information. If it does not exist, it means that the corresponding flow table is a residual flow table and has no associated business objects, so it can be deleted directly. If it exists, it means that in the calculation process of each module, there are flow table rules that fail to calculate or refresh, indicating that there is an abnormality in the calculation logic, and an alarm can be directly issued for manual processing.
[0099] Through the above method, the controller can perform parallel processing according to the business module, and will not delete the flow table when the calculation fails, which reduces the possibility of accidental deletion of the flow table to a certain extent; during the calculation, the old version of the flow table is cleaned up through the object information and the old version information to avoid large-scale deletion operations and improve the accuracy of deleting the flow table. When cleaning the remaining residual flow table, the corresponding execution operation is determined by judging whether the specific object exists, including alarming or deleting the flow table, which improves the accuracy of deleting the flow table. The cookie format can realize object-level identification and control of the flow table.
[0100] As a specific application example of the embodiment of the present invention, Figure 6 is a schematic diagram of a flow table configuration method for edge nodes in a cluster according to an embodiment of the present disclosure, combined with Figure 7 The structural diagram shown in FIG. 1 is as follows:
[0101] In the controller part, when the controller starts, it can obtain the version information of the current flow table through the local cache, and then delete the old version of the flow table. Then, it establishes a connection with OVS and detects the connection status. If the connection is successful, the above consistency processing is performed. After the consistency processing is completed, the consistency of the underlying OVS flow table configuration is guaranteed, and the cache data of the full flow table is established in the controller.
[0102] In the virtual switch part, after the virtual switch is started, it re-establishes a connection with the controller. The controller sends the full flow table in the cache to OVS. If there is an old version of the flow table, it is cleaned up to ensure the consistency of the OVS flow table configuration.
[0103] Based on the above method, the controller can quickly calibrate the virtual switch's flow table configuration after startup and establish a full flow table cache, which can ensure configuration consistency when the controller is abnormal. When the virtual switch starts to re-establish the connection, the flow table configuration is restored based on the established flow table cache, and the configuration can be quickly restored in the case of a forwarding plane failure.
[0104] In this embodiment, a flow table configuration device for edge nodes in a cluster is also provided, which is used to implement the above embodiments and implementation methods, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0105] This embodiment provides a flow table configuration device for edge nodes in a cluster, such as Figure 8 As shown, including:
[0106] The latest flow table acquisition module 601 is used to obtain the latest flow table calculation result corresponding to the target service, wherein the flow table includes a first flow table identification field and a flow table item, wherein the first flow table identification field includes a first version number and first service object information;
[0107] A historical flow table query module 602 is used to query a historical flow table whose version has not been updated in the virtual switch to obtain the second business object information in the historical flow table if the flow table calculation result indicates that the flow table calculation is completed, wherein the flow table calculation completion includes one of the latest flow table update completion, calculation failure, and flow table update failure;
[0108] The second business query module 603 is used to query the second business object information locally to obtain the query result of the business object information;
[0109] The flow table processing module 604 is used to process the historical flow table based on the query result.
[0110] In some optional implementations, the historical flow table query module 602 includes:
[0111] A field acquisition unit, used to acquire a second flow table identification field of all flow tables in the virtual switch;
[0112] The service object acquisition unit is used to determine the historical flow table whose version has not been updated based on the second version number in the second flow table identification field, so as to obtain the second service object information in the historical flow table.
[0113] In some optional implementations, the second business query module 603 includes:
[0114] A business object identifier obtaining unit, used to obtain the second business object identifier in the second business object information;
[0115] The identifier query unit is used to query whether the second business object identifier exists in the local database to obtain the query result.
[0116] In some optional implementations, the flow table processing module 604 includes:
[0117] The first processing unit is configured to issue an alarm if the query result indicates that the second business object identifier exists locally.
[0118] In some optional implementations, the flow table processing module 604 includes:
[0119] The second processing unit is configured to delete the historical flow table if the query result indicates that the second business object identifier does not exist locally.
[0120] In some optional embodiments, the device further comprises:
[0121] A second flow table acquisition module, used to acquire the latest flow table;
[0122] A status detection module, configured to detect a connection status between the local device and the virtual switch if the latest flow table is obtained after the local device is restarted;
[0123] a flow table determination module, configured to determine whether an old version of a flow table exists in the virtual switch based on a first flow table identification field of the latest flow table if the connection status indicates that the initial connection is successful;
[0124] The flow table deletion module is used to delete the old version of the flow table if there is an old version of the flow table in the virtual switch and update the latest flow table in full to the local cache and the virtual switch.
[0125] In some optional embodiments, the device further comprises:
[0126] A flow table determination module, configured to, if the latest flow table is obtained due to a change in the target service, obtain the first flow table identification field of the latest flow table by updating only the service object information of the previous flow table;
[0127] The cache update module is used to update the latest flow table increment to the local cache and the virtual switch.
[0128] In some optional embodiments, the device further comprises:
[0129] A cache update module, configured to update the latest flow table in the local cache to the virtual switch in full if the connection status indicates that the initial connection is successful but the reconnection is successful;
[0130] The flow table deletion module is used to delete the old version of the flow table if there is an old version of the flow table in the virtual switch.
[0131] In some optional implementations, the first business object information includes a business object type, a business object identifier, and a processing module type associated with the business object, and the first flow table identifier field also includes a format version of the flow table identifier field.
[0132] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0133] The flow table configuration device of the edge node in the cluster in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0134] The present disclosure also provides an electronic device having the above Figure 8 The flow table configuration device of the edge node in the cluster is shown.
[0135] See also Fig. 9 , Fig. 9 is a schematic diagram of the structure of an electronic device provided by an optional embodiment of the present disclosure, such as Fig. 9 As shown, the electronic device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig. 9 A processor 10 is taken as an example.
[0136] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0137] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0138] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0139] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0140] The electronic device further comprises a communication interface 30 for the electronic device to communicate with other devices or a communication network.
[0141] The embodiments of the present disclosure also provide a computer-readable storage medium. The above-mentioned method according to the embodiments of the present disclosure can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium and downloaded through a network, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0142] A part of the present disclosure may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present disclosure through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes, but is not limited to, source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.
[0143] Although the embodiments of the present disclosure are described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations are all within the scope defined by the present invention.
Claims
1. A flow table configuration method for edge nodes in a cluster, characterized in that: The method comprises: Obtaining the latest flow table calculation result corresponding to the target service, the flow table comprising a first flow table identification field and a flow table entry, the first flow table identification field comprising a first version number and first service object information; If the flow table calculation result indicates that the flow table calculation is completed, querying the historical flow table whose version has not been updated in the virtual switch to obtain the second business object information in the historical flow table, wherein the flow table calculation completion includes one of the latest flow table update completion, calculation failure, and flow table update failure; locally querying the second business object information to obtain a query result of the business object information; Based on the query result, processing the historical flow table; The querying of the historical flow table whose version has not been updated in the virtual switch to obtain the second business object information in the historical flow table includes: obtaining the second flow table identification field of all flow tables in the virtual switch; determining the historical flow table whose version has not been updated based on the second version number in the second flow table identification field to obtain the second business object information in the historical flow table; The locally querying the second business object information to obtain the query result of the business object information includes: obtaining the second business object identifier in the second business object information; querying whether the second business object identifier exists in the local database to obtain the query result; The processing of the historical flow table based on the query result includes: issuing an alarm if the query result indicates that the second business object identifier exists locally; and deleting the historical flow table if the query result indicates that the second business object identifier does not exist locally.
2. The method according to claim 1, characterized in that The method further comprises: Obtain the latest flow table; If the latest flow table is obtained after the local restart, detecting the connection status between the local and the virtual switch; If the connection status indicates that the initial connection is successful, determining whether there is an old version of the flow table in the virtual switch based on the first flow table identification field of the latest flow table; If an old version of the flow table exists in the virtual switch, the old version of the flow table is deleted and the latest flow table is fully updated to the local cache and the virtual switch.
3. The method according to claim 2, characterized in that The method further comprises: If the latest flow table is obtained due to a change in the target service, the first flow table identification field of the latest flow table is obtained by updating only the service object information of the previous flow table; The latest flow table increment is updated to the local cache and the virtual switch.
4. The method according to claim 2, characterized in that: The method further comprises: If the connection status indicates that the initial connection is successful but the reconnection is successful, the latest flow table cached locally is fully updated to the virtual switch; If an old version of the flow table exists in the virtual switch, the old version of the flow table is deleted.
5. The method according to any one of claims 1 to 4, characterized in that The first business object information includes a business object type, a business object identifier, and a processing module type associated with the business object, and the first flow table identifier field also includes a format version of the flow table identifier field.
6. A flow table configuration device for an edge node in a cluster, characterized in that: The device comprises: A latest flow table acquisition module, used to obtain the latest flow table calculation result corresponding to the target business, the flow table includes a first flow table identification field and a flow table item, the first flow table identification field includes a first version number and first business object information; A historical flow table query module, configured to query a historical flow table whose version has not been updated in the virtual switch to obtain second business object information in the historical flow table if the flow table calculation result indicates that the flow table calculation is completed, wherein the flow table calculation completion includes one of the latest flow table update completion, calculation failure, and flow table update failure; A second business query module, used to query the second business object information locally to obtain a query result of the business object information; A flow table processing module, used for processing the historical flow table based on the query result; The historical flow table query module includes: a field acquisition unit, which is used to acquire the second flow table identification field of all flow tables in the virtual switch; a business object acquisition unit, which is used to determine the historical flow table whose version has not been updated based on the second version number in the second flow table identification field, so as to obtain the second business object information in the historical flow table; The second business query module includes: a business object identifier acquisition unit, used to obtain the second business object identifier in the second business object information; an identifier query unit, used to query whether the second business object identifier exists in the local database to obtain the query result; The flow table processing module includes: a first processing unit, used to issue an alarm if the query result indicates that the second business object identifier exists locally; a second processing unit, used to delete the historical flow table if the query result indicates that the second business object identifier does not exist locally.
7. An electronic device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the flow table configuration method for an edge node in a cluster according to any one of claims 1 to 5 by executing the computer instructions.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the flow table configuration method for an edge node in a cluster according to any one of claims 1 to 5.
9. A computer program product, characterized in that The method comprises computer instructions, wherein the computer instructions are used to enable a computer to execute the flow table configuration method of an edge node in a cluster according to any one of claims 1 to 5.
Citation Information
Patent Citations
Data processing method, system and equipment based on flow table and storage medium
CN115988574A
Flow table processing method, system and equipment and storage medium
CN116074250A