Automatic configuration method of spanning tree protocol in K8s cluster based on DPU, controller and system
By using the DPU-based spanning tree protocol automatic configuration method in K8s cluster, the defect that OVN-Kubernetes does not support STP and RSTP is solved, and the automatic configuration of the spanning tree protocol is realized, improving the efficiency and quality of network operation and maintenance.
Patent Information
- Application Number
- CN202510257650.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-05
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2045-03-05
AI Technical Summary
OVN-Kubernetes does not provide direct STP and RSTP spanning tree protocol support, resulting in network administrators having to manually configure and manage these traditional network protocols, increasing the risk of management complexity and error introduction, especially in large-scale or dynamically changing network environments.
Provides a DPU-based spanning tree protocol automatic configuration method, which can monitor whether configuration data changes occur in the spanning tree protocol configuration instance in the K8s cluster in real time, update the bridge device table of the virtual switch database, and configure data to configure or start the STP and/or RSTP protocol according to the spanning tree protocol.
The automatic configuration of spanning tree protocol in K8s cluster is realized, which improves the real-time and reliability of automated configuration, thereby improving the efficiency and quality of network operation and maintenance.
Smart Images

Figure CN120166028A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data processing, and particularly to an automatic configuration method, a controller, and a system of the spanning tree protocol based on DPU in a K8s cluster. Background Art
[0002] The K8s (Kubernetes) cluster is an open-source container orchestration system cluster. OVN-Kubernetes is a Kubernetes network component based on the open virtual network OVN (Open Virtual Network), mainly focusing on the implementation of virtualized networks and overlay networks, rather than the traditional network device management function. Therefore, to make up for this deficiency, a solution is needed to finely control the network topology to meet the requirements in terms of performance, security, and manageability. And it has the function of customizing the configuration of the spanning tree protocol according to the specific network architecture and application requirements. Expand the software-defined network SDN (Software Defined Network) function of the existing virtual switch OVS (Open vSwitch).
[0003] The original design intention of the existing OVN-Kubernetes is to provide high performance and flexibility for the Kubernetes network. Its core functions are concentrated on the implementation of virtualized networks and overlay networks, rather than traditional network device management functions such as the spanning tree protocol STP and the rapid spanning tree protocol RSTP. Therefore, its function set may not include these traditional network protocols.
[0004] However, since OVNs-Kubernetes does not provide direct support for the spanning tree protocols of STP and RSTP, network administrators must configure and manage these traditional network protocols manually. This manual configuration increases the management complexity and the risk of error introduction, especially in large-scale or dynamically changing network environments.
[0005] Therefore, there is an urgent need to design a method for automatically configuring the spanning tree protocol in a K8s cluster. Summary of the Invention
[0006] In view of this, embodiments of this application provide an automatic configuration method, a controller, and a system of the spanning tree protocol based on DPU in a K8s cluster to eliminate or improve one or more defects existing in the prior art.
[0007] One aspect of this application provides an automatic configuration method of the spanning tree protocol based on DPU in a K8s cluster, including:
[0008] Monitor in real time whether the configuration data of the spanning tree protocol configuration instance in the K8s cluster has changed. If so, update the bridging device table of the virtual switch database according to the spanning tree protocol configuration instance, so that the virtual switch set in the data processor DPU receives the currently updated configuration data based on the updated bridging device table of the virtual switch database, and determine whether the configuration data contains spanning tree protocol configuration data. If so, configure or start the corresponding Spanning Tree Protocol (STP) and / or Rapid Spanning Tree Protocol (RSTP) according to the spanning tree protocol configuration data;
[0009] Monitor in real time whether the corresponding Spanning Tree Protocol (STP) and / or Rapid Spanning Tree Protocol (RSTP) is configured or started on the virtual switch. If so, update the status of the custom resource definition unit for the spanning tree protocol accordingly, so that the user can learn the current spanning tree protocol setting status of the virtual switch from the custom resource definition unit.
[0010] In some embodiments of the present application, the updating the bridging device table of the virtual switch database according to the spanning tree protocol configuration instance includes:
[0011] Parse the resource desired state field of the spanning tree protocol configuration instance, and map the parsed resource desired state field to the custom setting option of the bridging device table of the virtual switch database;
[0012] Merge the mapped custom setting option with the original custom setting option in the virtual switch database;
[0013] Update the bridging device table of the virtual switch database based on the database operation structure;
[0014] Update the status of the custom resource definition unit for the spanning tree protocol according to the updated bridging device table of the virtual switch database.
[0015] In some embodiments of the present application, before monitoring in real time whether the configuration data of the spanning tree protocol configuration instance in the K8s cluster has changed, it further includes:
[0016] Establish a connection with the virtual switch database and communicate with the daemon process of the virtual switch through the virtual switch database protocol.
[0017] In some embodiments of the present application, the custom resource definition unit for the spanning tree protocol is pre-created in the K8s cluster and is used to control the distribution of the spanning tree protocol configuration data of the virtual switch; the spanning tree protocol configuration data includes various configuration parameters corresponding to the Spanning Tree Protocol (STP) and / or Rapid Spanning Tree Protocol (RSTP);
[0018] Correspondingly, the spanning tree protocol configuration instance is pre-created in the K8s cluster and is used to configure various configuration parameters corresponding to the spanning tree protocol STP and / or rapid spanning tree protocol RSTP of the virtual switch according to the spanning tree protocol configuration data sent from the custom resource definition unit.
[0019] In some embodiments of the present application, various configuration parameters corresponding to the spanning tree protocol STP include: the priority parameter of the spanning tree protocol STP, the timer parameter, the maximum survivable time parameter of the bridge protocol data unit BPDU in the network, and the transition time parameter of the specified virtual switch port between the blocking state and the forwarding state.
[0020] In some embodiments of the present application, various configuration parameters corresponding to the rapid spanning tree protocol RSTP include: the priority parameter of the rapid spanning tree protocol RSTP, the address parameter of the virtual switch, the virtual switch aging time parameter, the version parameter, the maximum aging time parameter of the bridge, the bridge forwarding delay time parameter, and the maximum number of bridge protocol data units BPDU allowed to be sent per second.
[0021] In some embodiments of the present application, the corresponding update for the status of the custom resource definition unit for the spanning tree protocol includes:
[0022] Updating the running status monitoring field of the custom resource definition unit for the spanning tree protocol, where the running status monitoring field includes: the unique identifier of the bridging device, the root bridge information, the designated bridge, the designated port, and the bridging port information.
[0023] Another aspect of the present application provides a controller, including:
[0024] A spanning tree protocol configuration module, configured to monitor in real time whether there is a change in the configuration data of the spanning tree protocol configuration instance in the K8s cluster. If so, update the bridging device table of the virtual switch database according to the spanning tree protocol configuration instance, so that the virtual switch set in the data processor DPU receives the currently updated configuration data based on the updated bridging device table of the virtual switch database, and determine whether the configuration data contains spanning tree protocol configuration data. If so, configure or start the corresponding spanning tree protocol STP and / or rapid spanning tree protocol RSTP according to the spanning tree protocol configuration data;
[0025] A virtual switch monitoring module is used to monitor in real time whether the virtual switch configures or starts the corresponding Spanning Tree Protocol (STP) and / or Rapid Spanning Tree Protocol (RSTP). If so, the status of the custom resource definition unit for the Spanning Tree Protocol is updated accordingly, so that the user can learn the current Spanning Tree Protocol setting status of the virtual switch from the custom resource definition unit.
[0026] The third aspect of the present application provides an automatic configuration system for the Spanning Tree Protocol based on DPU in a K8s cluster, including: a controller, a host, and a data processor DPU arranged in the K8s cluster;
[0027] The controller is used to execute the automatic configuration method for the Spanning Tree Protocol based on DPU in the K8s cluster;
[0028] A virtual switch agent is provided in the host; a virtual switch is provided in the data processor DPU, and the controller is communicatively connected to the virtual switch via the virtual switch agent.
[0029] In some embodiments of the present application, the controller is further communicatively connected to at least one of a distributed search engine, a service monitoring system, and a distributed real-time data tracking system.
[0030] The third aspect of the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the automatic configuration method for the Spanning Tree Protocol based on DPU in the K8s cluster is implemented.
[0031] The fourth aspect of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the automatic configuration method for the Spanning Tree Protocol based on DPU in the K8s cluster is implemented.
[0032] The fifth aspect of the present application provides a computer program product, including a computer program. When the computer program is executed by a processor, the automatic configuration method for the Spanning Tree Protocol based on DPU in the K8s cluster is implemented.
[0033] The automatic configuration method of the spanning tree protocol based on DPU in the K8s cluster provided by this application listens in real time whether the configuration data of the spanning tree protocol configuration instance in the K8s cluster changes. If so, the bridging device table of the virtual switch database is updated according to the spanning tree protocol configuration instance, so that the virtual switch set in the DPU receives the currently updated configuration data based on the updated bridging device table of the virtual switch database, and determines whether the configuration data contains spanning tree protocol configuration data. If so, the corresponding spanning tree protocol STP and / or rapid spanning tree protocol RSTP are configured or started according to the spanning tree protocol configuration data; it listens in real time whether the virtual switch configures or starts the corresponding spanning tree protocol STP and / or rapid spanning tree protocol RSTP. If so, the status of the custom resource definition unit for the spanning tree protocol is updated accordingly, so that the user can learn the current spanning tree protocol setting status of the virtual switch from the custom resource definition unit, which can realize the automatic configuration of the spanning tree protocol in the K8s cluster, and can effectively improve the real-time performance and reliability of the automatic configuration, and further can effectively improve the efficiency and quality of network operation and maintenance.
[0034] Additional advantages, objects, and features of this application will be partially described below and will become partially apparent to those of ordinary skill in the art after studying the following. Or can be learned according to the practice of this application. The objects and other advantages of this application can be achieved and obtained through the structure specifically pointed out in the specification and the drawings.
[0035] Those skilled in the art will understand that the objects and advantages that can be achieved by this application are not limited to the above specifically described, and the above and other objects that can be achieved by this application will be more clearly understood according to the following detailed description. Brief Description of the Drawings
[0036] The drawings described herein are used to provide a further understanding of this application, form a part of this application, and do not limit this application. The components in the drawings are not drawn to scale, but are only for showing the principle of this application. In order to facilitate showing and describing some parts of this application, the corresponding parts in the drawings may be enlarged, that is, may become larger relative to other components in the exemplary device actually manufactured according to this application. In the drawings:
[0037] Figure 1 It is the first flow schematic diagram of the automatic configuration method of the spanning tree protocol based on DPU in the K8s cluster in an embodiment of this application.
[0038] Figure 2 It is the second flow schematic diagram of the automatic configuration method of the spanning tree protocol based on DPU in the K8s cluster in an embodiment of this application.
[0039] Figure 3 This is a schematic structural diagram of a controller in an embodiment of the present application.
[0040] Figure 4 This is a first schematic architecture diagram of an automatic configuration system for the spanning tree protocol based on DPU in a K8s cluster in an embodiment of the present application.
[0041] Figure 5 This is a second schematic architecture diagram of an automatic configuration system for the spanning tree protocol based on DPU in a K8s cluster in an embodiment of the present application.
[0042] Figure 6 This is an execution interaction schematic diagram of an automatic configuration method for the spanning tree protocol based on DPU in a K8s cluster in an application example of the present application. Detailed implementation manners
[0043] To make the objectives, technical solutions and advantages of the present application more clear and understandable, the present application will be further described in detail below in conjunction with the implementation manners and the accompanying drawings. Herein, the illustrative implementation manners of the present application and their descriptions are used to explain the present application, but are not intended to limit the present application.
[0044] Herein, it should also be noted that in order to avoid obscuring the present application due to unnecessary details, only the structures and / or processing steps closely related to the solution of the present application are shown in the drawings, while other details less related to the present application are omitted.
[0045] It should be emphasized that the term "including / comprising" when used herein refers to the presence of features, elements, steps or components, but does not exclude the presence or addition of one or more other features, elements, steps or components.
[0046] Herein, it should also be noted that if not otherwise specified, the term "connection" in this article can not only refer to a direct connection, but also represent an indirect connection with an intermediate.
[0047] In the following, embodiments of the present application will be described with reference to the accompanying drawings. In the drawings, the same reference numerals represent the same or similar components, or the same or similar steps.
[0048] Since the existing solutions can only manage the STP and RSTP protocols of network devices in a manual management and configuration manner. Modern cloud-native and automated network architectures emphasize automatic configuration and self-healing capabilities, while manual management of STP and RSTP protocols is contrary to these principles. The lack of automated support may lead to slow network deployment and fault recovery speeds, thus affecting business flexibility and reliability. With the changes in network topologies and the evolution of requirements, the manually configured STP and RSTP parameters require continuous maintenance and updates. This not only increases the operational burden but also may lead to risks of configuration inconsistencies or errors, affecting the overall network stability and performance. The existing manual management methods usually lack the ability to integrate into the overall monitoring and management platform. The lack of real-time monitoring and automatic alert mechanisms may result in delays in response times to network problems, thereby affecting the efficiency of troubleshooting and performance optimization.
[0049] In summary, without supporting STP and RSTP, OVN-Kubernetes mainly faces challenges in manual management and configuration, which not only affect the efficiency and quality of network operation and maintenance but also limit its application scenarios and applicability in traditional network management.
[0050] To solve the above problems, the embodiments of the present application respectively provide an automatic configuration method of the spanning tree protocol based on DPU in a K8s cluster, a controller, a system, an electronic device, a computer-readable storage medium, and a computer program product for executing the automatic configuration method of the spanning tree protocol based on DPU in a K8s cluster, which will be described in detail through the following embodiments.
[0051] Based on this, the embodiments of the present application provide an automatic configuration method of the spanning tree protocol based on DPU in a K8s cluster that can be implemented by a controller. Refer to Figure 1 The automatic configuration method of the spanning tree protocol based on DPU in a K8s cluster specifically includes the following content:
[0052] Step 100: Real-time monitor whether there is a change in the configuration data of the spanning tree protocol configuration instance in the K8s cluster. If so, update the bridge device table of the virtual switch database according to the spanning tree protocol configuration instance, so that the virtual switch set in the DPU receives the currently updated configuration data based on the updated bridge device table of the virtual switch database, and determine whether the configuration data contains spanning tree protocol configuration data. If so, configure or start the corresponding spanning tree protocol STP and / or rapid spanning tree protocol RSTP according to the spanning tree protocol configuration data.
[0053] Step 200: Monitor in real time whether the virtual switch is configured or starts the corresponding Spanning Tree Protocol (STP) and / or Rapid Spanning Tree Protocol (RSTP). If so, update the status of the custom resource definition unit for the Spanning Tree Protocol accordingly, so that the user can learn the current Spanning Tree Protocol setting status of the virtual switch from this custom resource definition unit.
[0054] It can be understood that a Spanning Tree Protocol configuration instance is pre-created in the K8s cluster and is used to configure various configuration parameters corresponding to the Spanning Tree Protocol (STP) and / or Rapid Spanning Tree Protocol (RSTP) of the virtual switch with the Spanning Tree Protocol configuration data sent from the custom resource definition unit. The custom resource definition unit for the Spanning Tree Protocol can be abbreviated as OvsStp CRD.
[0055] In one or more embodiments of the present application, the Spanning Tree Protocol configuration instance can be abbreviated as an OvsStp instance or an OvsStp CRD instance; the virtual switch database can refer to the Open vSwitch database, and the Open vSwitch database can be abbreviated as OVSDB; the bridge device table can be abbreviated as the bridge table. The controller can be written as the OvsStp controller.
[0056] It can be understood that the Data Processing Unit (DPU) is also known as the data processing unit. The DPU is a processor dedicated to network and storage acceleration and is usually used in high-performance computing (HPC) and data centers. It can relieve the burden on the CPU, providing higher network throughput and lower latency.
[0057] The Open vSwitch (OVS) is a virtual switching software mainly used in the virtual machine (VM) environment. As a virtual switch, it supports multiple virtualization technologies. In the virtualization environment of a certain machine, a virtual switch mainly has two functions: transmitting traffic between virtual machines (VMs) and enabling communication between the VM and the external network. It provides some important functions and drivers for VPP.
[0058] From the above description, it can be seen that the automatic configuration method of the Spanning Tree Protocol based on DPU in the K8s cluster provided by the embodiments of the present application develops an OvsStp controller responsible for monitoring and processing changes in the OvsStp CRD. The controller can map the configuration in the CRD to the custom setting option (other_config option) of the bridge device table of the virtual switch OVS through the OVSDB protocol. The controller synchronizes the status changes of STP and RSTP by monitoring the bridge device table of the virtual switch OVS to ensure the real-time and correctness of the configuration.
[0059] In order to further improve the reliability and effectiveness of updating the bridging device table of the virtual switch database according to the spanning tree protocol configuration instance, in an automatic configuration method of the spanning tree protocol based on DPU in a K8s cluster provided in an embodiment of the present application, refer to Figure 2 Step 100 in the automatic configuration method of the spanning tree protocol based on DPU in a K8s cluster specifically includes the following content:
[0060] Step 110: Monitor in real time whether the configuration data of the spanning tree protocol configuration instance in the K8s cluster changes. If so, parse the resource desired state field of the spanning tree protocol configuration instance, and map the parsed resource desired state field to the custom setting option of the bridging device table of the virtual switch database.
[0061] Step 120: Merge the mapped custom setting option with the original custom setting option in the virtual switch database.
[0062] Step 130: Update the bridging device table of the virtual switch database based on the database operation structure.
[0063] Step 140: Update the state of the custom resource definition unit for the spanning tree protocol corresponding to the updated bridging device table of the virtual switch database, so that the virtual switch set in the DPU receives the currently updated configuration data based on the updated bridging device table of the virtual switch database, and determine whether the configuration data contains spanning tree protocol configuration data. If so, configure or start the corresponding spanning tree protocol STP and / or rapid spanning tree protocol RSTP according to the spanning tree protocol configuration data.
[0064] It can be understood that the resource desired state field can be abbreviated as the spec field; the custom setting option can be abbreviated as the otherconfig option or the other_config option.
[0065] In order to further improve the efficiency and reliability of the automatic configuration of the spanning tree protocol based on DPU in a K8s cluster, in an automatic configuration method of the spanning tree protocol based on DPU in a K8s cluster provided in an embodiment of the present application, refer to Figure 2 Before step 100 in the automatic configuration method of the spanning tree protocol based on DPU in a K8s cluster, it specifically includes the following content:
[0066] Step 010: Establish a connection with the virtual switch database and communicate with the daemon process of the virtual switch through the virtual switch database protocol.
[0067] Specifically, a connection is established with the OVS database (OVSDB) through the libovsdb library, and secure TLS communication is conducted with the OVS daemon process through the OVSDB protocol. The libovsdb library is an OVSDB client library designed specifically for handling OVSDB interactions. It provides powerful functions and flexible APIs, making the management and operation of network infrastructure more efficient and convenient.
[0068] In order to further improve the application reliability and effectiveness of the custom resource definition unit for the spanning tree protocol and the spanning tree protocol configuration instance in an automatic configuration method of the spanning tree protocol based on DPU in a K8s cluster provided in an embodiment of the present application, the custom resource definition unit for the spanning tree protocol is pre-created in the K8s cluster and is used to control the distribution of the spanning tree protocol configuration data of the virtual switch; the spanning tree protocol configuration data includes various configuration parameters corresponding to the spanning tree protocol STP and / or the rapid spanning tree protocol RSTP.
[0069] Correspondingly, the spanning tree protocol configuration instance is pre-created in the K8s cluster and is used to configure various configuration parameters corresponding to the spanning tree protocol STP and / or the rapid spanning tree protocol RSTP of the virtual switch from the spanning tree protocol configuration data distributed by the custom resource definition unit.
[0070] Specifically, the administrator first creates a custom resource definition (CRD) in the Kubernetes cluster to control the configuration distribution of the spanning tree protocol (STP) and the rapid spanning tree protocol (RSTP) of Open vSwitch (OVS). The CRD defines a custom resource type named OVSSTPConfig, and this type contains multiple configuration parameters. These parameters allow users to finely control the behavior of STP and RSTP.
[0071] Then, an OvsStp instance can be created to specifically configure the STP and RSTP parameters of OVS. For example, by configuring rstpEnable to true to enable the RSTP function and setting various RSTP parameters such as priority, path cost, port edge attribute, etc. The rstpEnable command is used to enable the RSTP function on the device.
[0072] In an embodiment of the present application, various configuration parameters corresponding to the Spanning Tree Protocol (STP) include: the priority parameter stpPriority of the Spanning Tree Protocol (STP), the timer parameter stpHelloTime, the maximum survivable time parameter stpMaxAge of the Bridge Protocol Data Unit (BPDU) in the network, and the transition time parameter stpForwardDelay of the specified virtual switch port from the blocking state to the forwarding state.
[0073] In an embodiment of the present application, various configuration parameters corresponding to the Rapid Spanning Tree Protocol (RSTP) include: the priority parameter RstpPriority of the Rapid Spanning Tree Protocol (RSTP), the address parameter rstpAddress of the virtual switch, the virtual switch aging time parameter rstpAgeingTime, the version parameter rstpForceProtocolVersion, the maximum aging time parameter rstpMaxAge of the bridge, the forwarding delay time parameter rstpForwardDelay of the bridge, and the maximum number parameter rstpTransmitHoldCount of the Bridge Protocol Data Unit (BPDU) allowed to be sent per second.
[0074] To further improve the efficiency and reliability of the automatic configuration of the DPU-based Spanning Tree Protocol in the K8s cluster, in an automatic configuration method of the DPU-based Spanning Tree Protocol in the K8s cluster provided in the embodiments of the present application, refer to Figure 2 , step 200 in the automatic configuration method of the DPU-based Spanning Tree Protocol in the K8s cluster specifically includes the following content:
[0075] Step 210: Monitor in real time whether the virtual switch is configured or starts the corresponding Spanning Tree Protocol (STP) and / or Rapid Spanning Tree Protocol (RSTP). If so, update the running status monitoring field of the custom resource definition unit for the Spanning Tree Protocol, so that the user can learn the current Spanning Tree Protocol setting status of the virtual switch from the custom resource definition unit.
[0076] Among them, the running status monitoring field is the status field, and the running status monitoring field includes: the unique identifier rstp_bridge_id of the bridging device, the root bridge information rstp_root_id and rstp_root_path_cost, the designated bridge rstp_designated_id, the designated port rstp_designated_port_id, and the bridging port information rstp_bridge_port_id.
[0077] At the software level, the present application also provides a controller for executing all or part of the automatic configuration method of the DPU-based spanning tree protocol in the K8s cluster. See Figure 3 , the controller specifically includes the following content:
[0078] The spanning tree protocol configuration module 10 is used to monitor in real time whether the configuration data of the spanning tree protocol configuration instance in the K8s cluster has changed. If so, the bridging device table of the virtual switch database is updated according to the spanning tree protocol configuration instance, so that the virtual switch set in the DPU receives the currently updated configuration data based on the updated bridging device table of the virtual switch database, and it is judged whether the configuration data contains spanning tree protocol configuration data. If so, the corresponding spanning tree protocol STP and / or rapid spanning tree protocol RSTP are configured or started according to the spanning tree protocol configuration data.
[0079] The virtual switch monitoring module 20 is used to monitor in real time whether the corresponding spanning tree protocol STP and / or rapid spanning tree protocol RSTP are configured or started for the virtual switch. If so, the status of the custom resource definition unit for the spanning tree protocol is updated correspondingly, so that the user can learn the current spanning tree protocol setting status of the virtual switch from the custom resource definition unit.
[0080] The embodiment of the controller provided by the present application can specifically be used to execute the processing flow of the embodiment of the automatic configuration method of the DPU-based spanning tree protocol in the K8s cluster in the above embodiment. Its functions will not be elaborated here, and reference can be made to the detailed description of the embodiment of the automatic configuration method of the DPU-based spanning tree protocol in the K8s cluster above.
[0081] The part of the controller for automatically configuring the DPU-based spanning tree protocol in the K8s cluster can be completed in the server or the client device. Specifically, it can be selected according to the processing capacity of the client device and the limitations of the user usage scenario, etc. The present application does not make a limitation on this. If all operations are completed in the client device, the client device may further include a processor for specifically processing the automatic configuration of the DPU-based spanning tree protocol in the K8s cluster.
[0082] The above-mentioned client device may have a communication module (i.e., communication unit), which can communicate with a remote server to achieve data transmission with the server. The server may include a server on the task scheduling center side, and in other implementation scenarios, it may also include a server of an intermediate platform, such as a server of a third-party server platform that has a communication link with the task scheduling center server. The server may include a single computer device, or a server cluster composed of multiple servers, or a server structure of a distributed device.
[0083] Any suitable network protocol can be used for communication between the above-mentioned server and the client device side, including network protocols that have not been developed as of the filing date of this application. The network protocol may, for example, include TCP / IP protocol, UDP / IP protocol, HTTP protocol, HTTPS protocol, etc. Of course, the network protocol may also, for example, include the RPC protocol (Remote Procedure Call Protocol) and REST protocol (Representational State Transfer) used on top of the above-mentioned protocols.
[0084] As can be seen from the above description, the controller provided in the embodiment of this application can realize the automatic configuration of the spanning tree protocol in the K8s cluster, and can effectively improve the real-time performance and reliability of the automatic configuration, and further can effectively improve the efficiency and quality of network operation and maintenance.
[0085] This application also provides an automatic configuration system for the spanning tree protocol based on DPU in the K8s cluster, which includes a controller for executing all or part of the method for automatically configuring the spanning tree protocol based on DPU in the K8s cluster. See Figure 4 The automatic configuration system for the spanning tree protocol based on DPU in the K8s cluster specifically includes the following:
[0086] A controller, a host, and a data processor DPU set in the K8s cluster;
[0087] The controller is used to execute the method for automatically configuring the spanning tree protocol based on DPU in the K8s cluster provided in the foregoing embodiment.
[0088] A virtual switch agent is provided in the host; a virtual switch is provided in the data processor DPU, and the controller is communicatively connected to the virtual switch via the virtual switch agent.
[0089] See Figure 5, in the automatic configuration system of the spanning tree protocol based on DPU in the K8s cluster, the controller is also communicatively connected to at least one of a distributed search engine, a service monitoring system, and a distributed real-time data tracking system.
[0090] To further illustrate the above embodiments, the present application also provides a specific application example of the automatic configuration method of the spanning tree protocol based on DPU in the K8s cluster implemented by the automatic configuration system of the spanning tree protocol based on DPU in the K8s cluster. By introducing custom resource definitions (CRDs), developing an OvsStp controller, and utilizing the mechanisms of OVSDB and Open vSwitch, the present application effectively solves the disadvantages that OVn-Kubernetes does not support STP and RSTP management. A CRD named OVSSTPConfig is created to control the STP and RSTP configurations of OVS. These configurations include the priorities of STP and RSTP, various time parameters such as hello-time, max-age, forward-delay, etc., and other related configuration options. Users can specifically configure the STP and RSTP parameters of OVS by creating an instance of OvsStp. For example, the RSTP function can be enabled, and various parameters can be set to meet the network topology and performance requirements.
[0091] It is understandable that a Pod (Pod of containers) is the smallest deployment unit in a Kubernetes cluster. It encapsulates containers and provides some shared resources and context. VPP is the abbreviation of Vector Packet Processor of FD.io, which is a fast and scalable layer 2-4 multi-platform network stack. It can run in the Linux user space of multiple architectures including x86, ARM, and Power architectures. The Data Plane Development Kit (DPDK) is an open-source software project managed by the Linux Foundation. It provides a set of data plane libraries and network interface controller poll mode drivers for offloading TCP packet processing from the operating system kernel to a process running in the user space. This offloading can achieve higher computing efficiency and higher packet throughput than using the interrupt-driven processing provided in the kernel. BPDU (Bridge Protocol Data Unit) is a control message used in the Spanning Tree Protocol (STP) and its improved versions (such as the Rapid Spanning Tree Protocol, RSTP) to exchange spanning tree information and maintain the network topology. BPDU helps switches in the network elect a root bridge. The root bridge is the reference point for all paths in the network. Switches understand the network topology by periodically sending BPDUs. This allows for rapid adjustment in case of topology changes, thus avoiding loops. BPDU is the basis of the spanning tree protocol. By exchanging BPDUs, the spanning tree protocol can identify and prevent loops in the network, ensuring that network data does not enter an infinite loop. BPDU contains information about switches and path costs, and the spanning tree protocol uses this information to calculate and select the best path.
[0092] See Figure 6 , a specific application example of the automatic configuration method of the DPU-based spanning tree protocol in a K8s cluster implemented by the automatic configuration system of the DPU-based spanning tree protocol in a K8s cluster specifically includes the following content:
[0093] Step 1: Create a CRD for OVS STP configuration.
[0094] First, create a Custom Resource Definition (CRD) in the Kubernetes cluster to control the configuration distribution of the Spanning Tree Protocol (STP) and Rapid Spanning Tree Protocol (RSTP) of Open vSwitch (OVS). The CRD defines a custom resource type called OVSSTPConfig, which contains multiple configuration parameters, such as stpPriority, stpHelloTime, stpMaxAge, stpForwardDelay, and RstpPriority, rstpAgeingTime, etc. These parameters allow users to finely control the behavior of STP and RSTP.
[0095] Step 2: Create an OvsStp instance and configure stp and rstp.
[0096] An OvsStp instance can be created to specifically configure the STP and RSTP parameters of OVS. For example, by configuring rstpEnable to true, the RSTP function can be enabled, and various RSTP parameters, such as priority, path cost, port edge attribute, etc., can be set. It can be understood that the abbreviated expressions appearing in this application are not case-sensitive. For example, stp and STP have the same meaning and both represent the Spanning Tree Protocol.
[0097] Specifically, the stp configuration process is as follows:
[0098] 1) Enable stp;
[0099] 2) Configure the priority parameter of the Spanning Tree Protocol (STP) of stpPriority to determine which switch or bridge device in the network becomes the Root Bridge. In the Spanning Tree Protocol, the root bridge is the most important node in the network topology, and all paths are built around the root bridge. The range is from 0 to 65,535 because it occupies a 16-bit field. The numerical range that a 16-bit field can represent is from 0 to 2^16 - 1, which is 0 to 65,535. This range design provides sufficient precision and flexibility to ensure that network administrators can finely control and manage the behavior of the Spanning Tree Protocol.
[0100] 3) Configure stpHelloTime, which is a timer parameter in the Spanning Tree Protocol (STP) and determines the time interval at which the Root Bridge of the Spanning Tree Protocol sends "Hello" BPDUs (Bridge Protocol Data Units). The value range of this parameter is from 1 to 10 seconds. Transmission period: stp-hello-time specifies the time interval at which the root bridge sends "Hello" BPDUs. BPDUs are control messages used by the Spanning Tree Protocol to exchange information and maintain the network topology. By sending BPDUs regularly, the Spanning Tree Protocol can detect changes in the network topology in a timely manner, such as link failures or the addition of new devices.
[0101] 4) Network convergence: A shorter hello-time interval can speed up the detection of network topology changes, thus accelerating network convergence. However, setting it too short may increase network load and unnecessary BPDU traffic.
[0102] 5) Configure stpMaxAge: It is used to specify the maximum time that a BPDU (Bridge Protocol Data Unit) can survive in the network. It determines the time required for a switch to consider a path as failed after it stops receiving BPDUs on a certain path. The default value is usually 20 seconds. Values within this range allow network administrators to adjust the survival time of BPDUs according to specific network requirements and topology to optimize network performance and stability. In a large network, a longer stp-max-age can ensure that BPDUs have enough time to spread to all parts of the network. In a network with frequent topology changes, a shorter stp-max-age can enable the Spanning Tree Protocol to detect and respond to path changes faster, improving the network convergence speed.
[0103] 6) Configure stpForwardDelay: It is used to specify the transition time of the switch port from the blocking state to the forwarding state. This transition time includes two phases: the learning state and the listening state. When the network topology changes, the spanning tree protocol requires a certain amount of time to recalculate and stabilize the topology. stp-forward-delay ensures that the port goes through the learning and listening states before changing from the blocking state to the forwarding state, avoiding the generation of temporary loops. During the topology change process, it ensures that the port learns the correct MAC address entries before forwarding data packets, thus effectively forwarding data packets. Parameter range: 4 to 30 seconds, and the default value is usually 15 seconds. In an environment where the network topology changes frequently, stp-forward-delay ensures that there is enough time to stabilize the network before the port starts forwarding traffic, avoiding data packet loss and loops. In a large network, appropriately adjusting stp-forward-delay can help the spanning tree protocol better manage topology changes and improve network reliability.
[0104] Specifically, the RSTP configuration process is as follows:
[0105] 1) Configure rstpEnable to true to enable the RSTP function;
[0106] 2) Configure RstpPriority to configure the priority of the root bridge. The lower the value, the more likely it is to become the root bridge. The maximum value is 0xFFFF, and the default value is 0x8000. Network administrators can ensure that certain specific devices become the root bridge in the spanning tree protocol by setting a lower priority value, optimizing network performance and path selection. Suppose there are three OVS virtual switches A, B, and C in the network. By default, their priorities are all 32,768. If the administrator wants switch A to become the root bridge, its priority can be set to 16,384 while keeping the default priorities of the other two switches. In this way, switch A will become the root bridge first. Through this method, network administrators can ensure the optimization and reliability of the network topology.
[0107] 3) Configure rstpAddress to configure the address parameters of the switch in the Rapid Spanning Tree Protocol (RSTP). The rstpAddress parameter represents the address of the switch configured in the RSTP network. This address is usually the MAC address of the switch, which is used to uniquely identify the switch in the network. In the RSTP protocol, the switch sends and receives BPDU (Bridge Protocol Data Unit) messages, and these messages will contain the address of the switch, which is used for path selection and network convergence in the protocol.
[0108] 4) The rstpAgeingTime is a parameter for configuring the switch ageing time in the Rapid Spanning Tree Protocol (RSTP). It determines how long an entry in the MAC address table remains without communication. The rstpAgeingTime parameter defines the time for which the switch retains an entry in the MAC address table. If no traffic for that entry is detected within this period, the entry will be deleted. By controlling the ageing time of the MAC address table, the switch can manage the network topology more effectively and prevent stale entries from occupying table entries. The value range is from 10 to 1,000,000 seconds. Default value: The default ageing time for most switches is 300 seconds.
[0109] 5) The rstpForceProtocolVersion is a parameter used to configure the Rapid Spanning Tree Protocol version. It allows forcing the switch to use a specific Spanning Tree Protocol version. By setting the rstp-force-protocol-version parameter, the switch can be forced to use the specified Spanning Tree Protocol version. In some network environments, it may be necessary to maintain compatibility with old devices or specific configurations, so this parameter can be used to specify the use of an older STP version. The integer values that this parameter can accept are generally 0 or 2: 0 represents the Standard Spanning Tree Protocol (STP); 2 represents the Rapid Spanning Tree Protocol (RSTP).
[0110] 6) The rstpMaxAge is a configuration option for setting the maximum ageing time of the bridge in RSTP (Rapid Spanning Tree Protocol). This parameter determines the maximum time for which the bridge in the Spanning Tree Protocol retains Bridge Protocol Data Unit (BPDU) information. If no new BPDUs are received after this time, the bridge will consider the path no longer valid and recalculate the Spanning Tree. By setting rstp-max-age, the time for which the bridge retains BPDU information before re-evaluating the path can be determined. This time setting helps avoid loops in the network and ensures that the Spanning Tree can be recalculated in a timely manner after the path fails. The integer values that this parameter can accept are between 6 and 40, in seconds. Minimum value 6: indicates that the minimum ageing time for BPDU information is 6 seconds. Maximum value 40: indicates that the maximum ageing time for BPDU information is 40 seconds.
[0111] 7) Configuring rstpForwardDelay is a configuration option used to set the forwarding delay time of a bridge in RSTP (Rapid Spanning Tree Protocol). This parameter determines the time a port needs to go through the learning and listening states before transitioning from the blocking state to the forwarding state. This mechanism can effectively avoid temporary loops and broadcast storms. When the network topology changes, the port does not immediately transition to the forwarding state but goes through a period of learning and listening, preventing the generation of temporary loops. During the learning phase, the bridge learns the mapping between MAC addresses and ports in the network, enabling it to correctly forward data frames during the forwarding phase. The acceptable integer values for this parameter range from 4 to 30 seconds.
[0112] 8) Configuring rstpTransmitHoldCount is a configuration option used to set the maximum number of BPDUs (Bridge Protocol Data Units) allowed to be sent per second in RSTP (Rapid Spanning Tree Protocol). This parameter determines how many BPDUs can be sent within a time interval, thereby controlling the transmission frequency of BPDUs in the network. By limiting the number of BPDUs sent per second, unnecessary network load caused by excessive BPDUs in the network can be prevented. An appropriate BPDU transmission frequency can ensure the effective operation of the spanning tree protocol without affecting the overall network performance. The acceptable integer values for this parameter range from 1 to 10.
[0113] Step 3: Develop the OvsStp controller.
[0114] Develop an OvsStp controller to monitor and handle changes to the CRD objects defined above. This controller needs to:
[0115] Establish a connection to the OVS database (OVSDB) through the libovsdb library and conduct secure TLS communication with the OVS daemon process via the OVSDB protocol.
[0116] Monitor the creation, update, and deletion events of the OvsStp CRD and map the spec field of the CRD to the other_config option of the OVSDB's bridge table.
[0117] Retrieve the original other_config, merge the new configuration from the CRD with it, and then perform operations (add, delete, modify, query) on the OVSDB's bridge table using the ovsdb.Operation structure.
[0118] Specifically, the Ovs Stp controller listens for and processes changes to the CRD objects defined above, establishes a connection with the Open vSwitch database (OVSDB) through the libovsdb library, and conducts secure tls communication with the Open vSwitch daemon process via the OVSDB protocol. After establishing a connection with the OVSDB server, to manage and configure the stp functions and parameters of OVS, the controller maps the spec field of the above-mentioned crd to the otherconfig option of the bridge in the ovs db, obtains the original otherconfig, merges the two, and then operates on the Bridge of the OVSDB (add, delete, modify, query) the otherconfig of the stp of the Bridge through the ovsdb.Operation structure, thereby sending the changes of the above-mentioned crd as the configuration of OVS.
[0119] Step 4: OVS internal processing of configuration updates.
[0120] After receiving the configuration update, Open vSwitch enables the corresponding STP or RSTP function according to the parameters specified in the configuration (such as stpEnable = true or rstpEnable = true). The ports on each bridge of OVS will be managed according to the STP or RSTP protocol state. Each port has a status (such as Disabled, Blocking, Listening, Learning, Forwarding, etc.), and these statuses are dynamically adjusted by the protocol according to the network topology and configuration.
[0121] Specifically, after receiving the configuration update, Open vSwitch enables the corresponding STP or RSTP function according to the parameters specified in the configuration (such as stp_enable = true or rstp_enable = true). Participate in the Spanning Tree Protocol or Rapid Spanning Tree Protocol operations in the network. The ports on each Open vSwitch bridge will be managed according to the STP or RSTP protocol state. Each port has a status (such as Disabled, Blocking, Listening, Learning, Forwarding, etc.), and these statuses are dynamically adjusted by the protocol according to the network topology and configuration.
[0122] Step 5: Controller synchronization of status.
[0123] The OvsStp controller also needs to monitor the OVS bridge table. If it detects a change in the STP status of the bridge, it updates the status field of the corresponding OvsStp CRD so that users can understand the current STP status of the OVS through the CRD.
[0124] Specifically, the Ovs stp controller monitors the ovs bridge table. If it receives a change in the stp status configuration of the bridge, it sets the status of the corresponding OvsStp crd.
[0125] Step 6: The user adjusts the configuration.
[0126] Users can view the status field of the OvsStp CRD and check whether it meets the expectations based on the status and network diagnosis results. If not, they can adjust the spec configuration of the OvsStp CRD. By adjusting configuration parameters (such as hello-time, max-age, forward-delay, etc.), Open vSwitch can dynamically adjust the network topology to optimize performance and reliability.
[0127] Specifically, users can view the status of the ovsstpcrd and check whether it meets the expectations based on the status and network diagnosis. If not, they can adjust the spec configuration of the ovs stp crd (for example, according to the configuration parameters of STP and RSTP, such as hello-time, max-age, forward-delay, etc., Open vSwitch adjusts the status transition time of ports to achieve the purpose of quickly converging the network topology).
[0128] The status field is mainly used to monitor and diagnose the running status of RSTP in the network. For example:
[0129] (1) Unique identifier of the bridging device: Each bridging device can be uniquely identified by rstp_bridge_id, which is convenient for management and maintenance.
[0130] (2) Root bridge information: Through rstp_root_id and rstp_root_path_cost, you can know the root bridge of the current network topology and the path cost to the root bridge, so as to understand the quality of the network path.
[0131] (3) Designated bridge and port: Through rstp_designated_id and rstp_designated_port_id, you can know the designated bridge and port of each network segment, which helps to maintain the topology structure of the spanning tree.
[0132] (4) Bridging port information: Through the rstp_bridge_port_id, each port on the bridging device participating in the spanning tree protocol can be known, facilitating configuration and management.
[0133] In summary, the automatic configuration method of the spanning tree protocol based on DPU in the K8s cluster provided by the application example of this application has the following beneficial effects:
[0134] 1) Flexibility and scalability
[0135] Custom Resource Definition (CRD): By defining CRD, the STP and RSTP configurations of OVS can be flexibly extended and customized without modifying the OVS source code.
[0136] Scalability of configuration parameters: The configuration parameters in CRD can be flexibly adjusted according to requirements to meet the needs of different network environments.
[0137] 2) Automation and simplified management
[0138] Automated configuration distribution: The OvsStp controller automatically distributes the configurations in CRD to OVS, reducing the complexity and error risk of manual configuration.
[0139] Centralized management: In the Kubernetes environment, the STP and RSTP configurations of multiple OVS instances are managed through a unified CRD, improving management efficiency.
[0140] 3) Real-time monitoring and dynamic adjustment
[0141] Status synchronization: The controller can synchronize the STP status of OVS to the status field of CRD in real time, facilitating administrators to understand the current network topology status.
[0142] Dynamic adjustment: Administrators can dynamically adjust the configuration parameters in CRD according to real-time monitoring and network diagnosis results, quickly respond to network changes, and improve the reliability and stability of the network.
[0143] 4) Improve network reliability
[0144] Prevent network loops: By finely configuring STP and RSTP parameters such as hello-time, max-age, forward-delay, etc., ensure the stability and fast convergence of the network topology and prevent network loops.
[0145] Optimize path selection: Configuring parameters such as rstpPriority can optimize network path selection and ensure the efficiency of data transmission.
[0146] 5) Security
[0147] Secure Communication: Establish TLS secure communication with OVSDB through the libovsdb library to ensure the security and integrity of configuration data during transmission.
[0148] 6) Compatibility and Standardization
[0149] Compatibility with Existing Protocols: The solution is compatible with STP and RSTP protocol standards and is applicable to existing network devices and configurations.
[0150] Standardized Management: Through the standardized management of Kubernetes CRD and controllers, the standardization level of network configuration and management is improved.
[0151] 8) Easy Integration and Deployment
[0152] Native Kubernetes Support: The solution utilizes the native functions of Kubernetes and is easy to integrate into existing Kubernetes clusters, facilitating deployment and maintenance.
[0153] Simplified Operations: Administrators can perform STP and RSTP configuration management of OVS through familiar Kubernetes tools and interfaces, reducing the learning and operation costs.
[0154] The embodiment of the present application also provides an electronic device, which may include a processor, a memory, a receiver, and a transmitter. The processor is used to execute the automatic configuration method of the spanning tree protocol based on DPU in the K8s cluster mentioned in the above embodiment. The processor and the memory may be connected through a bus or other means. Taking the connection through the bus as an example, the receiver can be connected to the processor and the memory in a wired or wireless manner.
[0155] The processor may be a Central Processing Unit (CPU). The processor may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. chips, or combinations of the above types of chips.
[0156] The memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as the program instructions / modules corresponding to the method for automatically configuring the spanning tree protocol based on DPU in the K8s cluster in the embodiments of the present application. The processor executes various functional applications and data processing of the processor by running the non-transitory software programs, instructions, and modules stored in the memory, that is, to implement the method for automatically configuring the spanning tree protocol based on DPU in the K8s cluster in the above method embodiments.
[0157] The memory may include a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function; the data storage area can store data created by the processor, etc. In addition, the memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the memory may optionally include a memory remotely set relative to the processor, and these remote memories can be connected to the processor through a network. Examples of the above networks include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0158] The one or more modules are stored in the memory and, when executed by the processor, execute the method for automatically configuring the spanning tree protocol based on DPU in the K8s cluster in the embodiments.
[0159] In some embodiments of the present application, the user equipment may include a processor, a memory, and a transceiver unit. The transceiver unit may include a receiver and a transmitter. The processor, the memory, the receiver, and the transmitter may be connected through a bus system. The memory is used to store computer instructions, and the processor is used to execute the computer instructions stored in the memory to control the transceiver unit to transmit and receive signals.
[0160] As an implementation manner, the functions of the receiver and the transmitter in the present application may be considered to be implemented through a transceiver circuit or a dedicated chip for transceiver, and the processor may be considered to be implemented through a dedicated processing chip, a processing circuit, or a general-purpose chip.
[0161] As another implementation manner, it may be considered to use a general-purpose computer to implement the server provided in the embodiments of the present application. That is, the program codes for implementing the functions of the processor, the receiver, and the transmitter are stored in the memory, and the general-purpose processor implements the functions of the processor, the receiver, and the transmitter by executing the codes in the memory.
[0162] The embodiments of the present application further provide a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the foregoing method for automatically configuring the spanning tree protocol based on DPU in a K8s cluster are implemented. The computer-readable storage medium may be a tangible storage medium, such as a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, floppy disks, hard disks, removable storage disks, CD-ROMs, or any other form of storage medium well-known in the technical field.
[0163] The embodiments of the present application further provide a computer program product, including a computer program. When the computer program is executed by a processor, the steps of the foregoing method for automatically configuring the spanning tree protocol based on DPU in a K8s cluster are implemented.
[0164] Those of ordinary skill in the art should understand that the various exemplary components, systems, and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software, or a combination of both. Specifically, whether to implement in hardware or software depends on the specific application and design constraints of the technical solution. A professional technician can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (ASIC), appropriate firmware, a plug-in, a functional card, etc. When implemented in software, the elements of the present application are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium or transmitted through a data signal carried in a carrier wave on a transmission medium or a communication link.
[0165] It should be clear that the present application is not limited to the specific configurations and processes described above and illustrated in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and illustrated as examples. However, the method process of the present application is not limited to the specific steps described and illustrated. Those skilled in the art can make various changes, modifications, and additions, or change the order between steps after understanding the spirit of the present application.
[0166] In the present application, the features described and / or illustrated for one embodiment can be used in the same or similar manner in one or more other embodiments, and / or combined with the features of other embodiments or replace the features of other embodiments.
[0167] The above are only the preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, various changes and modifications can be made to the embodiments of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the protection scope of the present application.
Claims
1. A method for automatic configuration of a spanning tree protocol based on a DPU in a K8s cluster, characterized in that: include: Monitor in real time whether the spanning tree protocol configuration instance in the K8s cluster has any configuration data changes. If so, update the bridge device table of the virtual switch database according to the spanning tree protocol configuration instance, so that the virtual switch set in the data processor DPU receives the currently updated configuration data based on the updated bridge device table of the virtual switch database, and determines whether the configuration data contains spanning tree protocol configuration data. If so, configure or start the corresponding spanning tree protocol STP and / or rapid spanning tree protocol RSTP according to the spanning tree protocol configuration data; Monitor in real time whether the virtual switch is configured or started with the corresponding spanning tree protocol STP and / or rapid spanning tree protocol RSTP. If so, update the status of the custom resource definition unit for the spanning tree protocol accordingly, so that the user can learn the current spanning tree protocol setting status of the virtual switch from the custom resource definition unit.
2. According to claim 1, the automatic configuration method of the spanning tree protocol based on DPU in the K8s cluster is characterized in that: The updating of the bridging device table of the virtual switch database according to the spanning tree protocol configuration instance includes: Parsing the resource expected state field of the spanning tree protocol configuration instance, and mapping the parsed resource expected state field to a custom setting option of a bridge device table of a virtual switch database; Merging the mapped custom setting options with the original custom setting options in the virtual switch database; Update the bridging device table of the virtual switch database based on the database operation structure; The state of the custom resource definition unit for the spanning tree protocol is correspondingly updated according to the updated bridging device table of the virtual switch database.
3. The automatic configuration method of the spanning tree protocol based on DPU in the K8s cluster according to claim 1 is characterized in that: Before the real-time monitoring of whether the spanning tree protocol configuration instance in the K8s cluster has a configuration data change, the method further includes: Establish a connection with the virtual switch database and communicate with the daemon process of the virtual switch through the virtual switch database protocol.
4. The automatic configuration method of the spanning tree protocol based on DPU in the K8s cluster according to claim 2 is characterized in that: The custom resource definition unit for the spanning tree protocol is created in advance in the K8s cluster and is used to control the delivery of the spanning tree protocol configuration data of the virtual switch; The spanning tree protocol configuration data includes: various configuration parameters corresponding to the spanning tree protocol STP and / or the rapid spanning tree protocol RSTP; Correspondingly, the spanning tree protocol configuration instance is created in advance in the K8s cluster, and is used to configure the spanning tree protocol configuration data issued from the custom resource definition unit to configure various configuration parameters corresponding to the spanning tree protocol STP and / or rapid spanning tree protocol RSTP of the virtual switch.
5. The automatic configuration method of the spanning tree protocol based on DPU in the K8s cluster according to claim 4 is characterized in that: The various configuration parameters corresponding to the spanning tree protocol STP include: the priority parameter of the spanning tree protocol STP, the timer parameter, the maximum survivable time parameter of the bridge protocol data unit BPDU in the network, and the transition time parameter of the designated virtual switch port from the blocking state to the forwarding state.
6. The automatic configuration method of the spanning tree protocol based on DPU in the K8s cluster according to claim 4 is characterized in that: The various configuration parameters corresponding to the Rapid Spanning Tree Protocol RSTP include: the priority parameter of the Rapid Spanning Tree Protocol RSTP, the address parameter of the virtual switch, the aging time parameter of the virtual switch, the version parameter, the maximum aging time parameter of the bridge, the forwarding delay time parameter of the bridge, and the maximum number parameter of the Bridge Protocol Data Unit BPDU allowed to be sent per second.
7. The automatic configuration method of the spanning tree protocol based on DPU in the K8s cluster according to claim 1 is characterized in that: The corresponding updating of the state of the custom resource definition unit for the spanning tree protocol includes: The running status monitoring field of the custom resource definition unit for the spanning tree protocol is updated, wherein the running status monitoring field includes: a unique identifier of a bridging device, root bridge information, a designated bridge, a designated port, and bridge port information.
8. A controller, characterized in that: include: A spanning tree protocol configuration module is used to monitor in real time whether a spanning tree protocol configuration instance in a K8s cluster has any configuration data changes. If so, the bridging device table of the virtual switch database is updated according to the spanning tree protocol configuration instance, so that the virtual switch set in the data processor DPU receives the currently updated configuration data based on the updated bridging device table of the virtual switch database, and determines whether the configuration data contains spanning tree protocol configuration data. If so, the corresponding spanning tree protocol STP and / or rapid spanning tree protocol RSTP are configured or started according to the spanning tree protocol configuration data; The virtual switch monitoring module is used to monitor in real time whether the virtual switch is configured or started with the corresponding spanning tree protocol STP and / or rapid spanning tree protocol RSTP. If so, the status of the custom resource definition unit for the spanning tree protocol is updated accordingly, so that the user can learn the current spanning tree protocol setting status of the virtual switch from the custom resource definition unit.
9. An automatic configuration system of spanning tree protocol based on DPU in K8s cluster, characterized in that: include: Set up the controller, host and data processor DPU in the K8s cluster; The controller is used to execute the automatic configuration method of the spanning tree protocol based on the DPU in the K8s cluster according to any one of claims 1 to 7; The host is provided with a virtual switch agent; the data processor DPU is provided with a virtual switch, and the controller is connected to the virtual switch through the virtual switch agent.
10. The automatic configuration system of the spanning tree protocol based on DPU in the K8s cluster according to claim 9, characterized in that: The controller is also respectively connected to at least one of a distributed search engine, a service monitoring system and a distributed real-time data tracking system for communication.
Citation Information
Patent Citations
Topology trimming method and device for ring network and virtual switch
CN112671583A
Kubernetes-based DPU (Data Processing Unit) system-on-chip management method and Kubernetes-based DPU system-on-chip management device
CN118964116A
Network interface device-based computing
CN119011309A
Spanning tree protocol synchronization method and device based on MLAG protocol, equipment and storage medium
CN119383068A
A method for implementing multiple spanning tree protocol on single spanning tree switching chip
CN1525715A
Cited By
Switch control method and device based on containerized spanning tree protocol, equipment and storage medium
CN120729820A
Switch management method and device applied to kubernetes GPU cluster, electronic equipment, storage medium and computer program product
CN121151353A