Switch network configuration method and system based on cloud native environment
By using controllers and actuators in a cloud-native environment to automate the switch configuration process, the problems of complex and inefficient switch configuration in the prior art are solved, and fast and accurate network configuration and efficient operation and maintenance are achieved.
Patent Information
- Application Number
- CN202510039382.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-10
- Publication Date
- 2025-03-11
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing technology has problems such as long environmental preparation time, complex configuration process and inconsistent management models when managing and configuring large batches of switches, resulting in inefficient operation and maintenance of cloud centers.
By introducing controllers and executors in a cloud native environment, the controller obtains the network resource instance declared by the user and selects the target switch node matching the node tag. The executor receives network configuration requests and performs dependency conditions checks, and performs network configuration of the target switch when the conditions are met.
It realizes rapid deployment and efficient operation and maintenance, greatly simplifies the configuration process of multiple switch models, reduces operation and maintenance costs, and improves the accuracy and consistency of network configuration.
Smart Images

Figure CN119603138A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of cloud native environment, and in particular to a switch network configuration method and system based on cloud native environment. Background Art
[0002] As the scale of cloud platforms continues to expand, managing a large number of switches of different models and brands has become a complex and arduous task. At present, cloud centers face many challenges in environment provisioning and operation and maintenance management. These challenges are mainly reflected in the long environment preparation time, complex configuration process and inconsistent management models, which have become bottlenecks restricting the efficient development of cloud centers.
[0003] The mainstream solution for managing large quantities of switches is usually to manually log in to each switch and execute configuration commands through the command line interface (CLI). Although this method has achieved automation of operations to a certain extent, it still has obvious shortcomings. First, when a large number of switches need to be configured, the process of logging in and executing commands one by one takes a long time, which is difficult to meet the needs of rapid deployment and efficient operation and maintenance. Secondly, switches of different manufacturers and models often use their own unique instruction sets, which requires operation and maintenance personnel to learn and master a variety of different grammatical rules, resulting in complicated configuration processes and significantly increased operation and maintenance costs. In addition, since front-line network engineers often have insufficient understanding of specific business requirements when configuring switches, they are prone to introduce errors during the configuration process, resulting in abnormal network operation. The troubleshooting and repair of such configuration errors usually requires the assistance of business personnel, which not only prolongs the fault recovery time, but also increases communication costs. Summary of the invention
[0004] In order to solve the above technical problems, the present invention is proposed. The embodiments of the present invention provide a switch network configuration method and system based on a cloud native environment, which can solve the problem that a large number of switches cannot be configured in the prior art.
[0005] According to one aspect of the present invention, a switch network configuration method based on a cloud native environment is provided, comprising:
[0006] The controller obtains multiple network resource instances declared by the user through the cloud native environment; wherein each of the network resource instances includes a node label;
[0007] The controller selects a target switch node matching the node label from the node resources; wherein the node resources include a plurality of switch nodes, each of which corresponds to a usage label;
[0008] The controller acquires an actuator that communicates with the target switch based on the target switch corresponding to the target switch node;
[0009] The controller creates a network configuration request for each network resource instance according to the network resource instance of the cloud native environment and address related information of the target switch node;
[0010] The executor receives the network configuration request and obtains dependency conditions corresponding to the network resource instance of the network configuration request;
[0011] If the dependency condition satisfies a preset dependency condition, the executor performs network configuration on the target switch based on the network configuration information corresponding to the network resource instance of the network configuration request.
[0012] In one embodiment, the controller selects a target switch node matching the node label from the node resources, including:
[0013] Select a switch node matching the node label from the node resources;
[0014] Determine other node labels corresponding to the selected switch node;
[0015] Selecting a switch node whose usage similarity between other node labels corresponding to the selected switch node and the node label is greater than a preset similarity threshold as a target switch node;
[0016] Based on the target switch node, construct a node list;
[0017] Determine the data processing flow of the network resource instance corresponding to the node label;
[0018] A switch node matching the data processing flow is selected from the node list as a target switch node.
[0019] In one embodiment, the controller selects a target switch node matching the node label from the node resources, including:
[0020] Obtaining a node name from the network resource instance;
[0021] Selecting a switch node matching the node name from the node resources as a target switch node;
[0022] If the target switch node is an abnormal node and the data processing flow of the network resource instance corresponding to the node label is greater than a preset flow threshold, multiple switch nodes with data processing flows less than the preset flow threshold are selected from the node resources as the target switch nodes;
[0023] The controller, based on the target switch corresponding to the target switch node, acquires the actuator communicating with the target switch, including:
[0024] Obtain the switch corresponding to the target switch node;
[0025] Stacking the switches corresponding to the multiple target switch nodes into a target switch;
[0026] Based on the type of the target switch, an executor that communicates with the target switch is acquired.
[0027] In one embodiment, the controller, based on the target switch corresponding to the target switch node, acquires the actuator that communicates with the target switch, including:
[0028] Based on the type of the target switch corresponding to the target switch node, obtaining an executor list;
[0029] An executor is selected from the executor list as the executor for communicating with the target switch.
[0030] In one embodiment, if the dependency condition satisfies a preset dependency condition, the executor performs network configuration on the target switch based on the network configuration information corresponding to the network resource of the network configuration request, including:
[0031] If the network status of the target switch is in a normal operating state and the VLAN identifier in the network configuration information corresponding to the network resource instance of the network configuration request matches the processing identifier of the target switch, and the VLAN identifier is not used by other network configuration devices, the network configuration of the target switch is performed based on the network configuration information corresponding to the network resource instance of the network configuration request.
[0032] In one embodiment, the performing network configuration on the target switch based on the network configuration information corresponding to the network resource of the network configuration request includes:
[0033] Determine a gateway that is communicatively connected to the VLAN identifier;
[0034] If the router corresponding to the gateway communicates with the target switch, network configuration is performed on the target switch based on the network configuration information corresponding to the network resource of the network configuration request.
[0035] In one embodiment, the performing network configuration on the target switch based on the network configuration information corresponding to the network resource of the network configuration request includes:
[0036] Obtaining an IP address of a classless inter-domain route in the network configuration information corresponding to the network resource of the network configuration request;
[0037] If the format of the IP address of the classless inter-domain routing meets the preset format requirement, the target switch is configured for network configuration based on the network configuration information corresponding to the network resource of the network configuration request.
[0038] In one embodiment, the performing network configuration on the target switch based on the network configuration information corresponding to the network resource of the network configuration request includes:
[0039] Obtaining a configured subnet; wherein the configured subnet represents a subnet that is communicatively connected to other network configuration devices;
[0040] If the IP address of the configured subnet has no overlapping fields with the IP address of the classless inter-domain routing, network configuration is performed on the target switch based on the network configuration information corresponding to the network resource of the network configuration request.
[0041] In one embodiment, the switch network configuration method based on the cloud native environment further includes:
[0042] The executor obtains the SSH key of the target switch;
[0043] The executor is connected to the target switch through the SSH key.
[0044] According to one aspect of the present invention, a switch network configuration system based on a cloud native environment is provided, comprising:
[0045] A controller, configured to obtain multiple network resource instances declared by a user through a cloud native environment; wherein each of the network resource instances includes a node label, and a target switch node matching the node label is selected from the node resources; wherein the node resources include multiple switch nodes, each switch node corresponds to a usage label, and based on a target switch corresponding to the target switch node, an actuator communicating with the target switch is obtained, and a network configuration request for each network resource instance is created according to the network resource instance of the cloud native environment and address-related information of the target switch node;
[0046] The executor receives the network configuration request and obtains the dependency condition corresponding to the network resource instance of the network configuration request. If the dependency condition meets the preset dependency condition, the executor performs network configuration on the target switch based on the network configuration information corresponding to the network resource instance of the network configuration request.
[0047] The switch network configuration method and system based on the cloud native environment provided by the present invention include: a controller obtains multiple network resource instances declared by a user through the cloud native environment, wherein each network resource instance includes a node label, the controller selects a target switch node matching the node label from the node resource, wherein the node resource includes multiple switch nodes, each switch node corresponds to a usage label, the controller obtains an actuator communicating with the target switch based on the target switch corresponding to the target switch node, the controller creates a network configuration request for each network resource instance according to the network resource instance of the cloud native environment and the address related information of the target switch node, the actuator receives the network configuration request and obtains the dependency condition corresponding to the network resource instance of the network configuration request, and if the dependency condition of the actuator satisfies the preset dependency condition, the target switch is configured based on the network configuration information corresponding to the network resource instance of the network configuration request. By setting the node label, a suitable target switch node can be selected from the node resource, and the corresponding actuator is selected through the target switch node, so that when the user declares the network resources in batches, the controller performs network configuration on the corresponding switches in batches by controlling the actuator. In addition, since a specific connection method is used between the actuator and the switch, the controller can perform network configuration on the switch through the actuator, without having to log in to the switch account and then perform network configuration on the switch. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The above and other purposes, features and advantages of the present invention will become more apparent by describing the embodiments of the present invention in more detail in conjunction with the accompanying drawings. The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings, the same reference numerals generally represent the same components or steps.
[0049] Figure 1 It is a flowchart of a switch network configuration method based on a cloud native environment provided by an exemplary embodiment of the present invention.
[0050] Figure 2 It is a flowchart of a switch network configuration method based on a native environment provided by an exemplary embodiment of the present invention.
[0051] Figure 3 It is a flowchart of a switch network configuration method based on a cloud native environment provided by another exemplary embodiment of the present invention.
[0052] Figure 4 It is a flowchart of a switch network configuration system based on a cloud native environment provided by an exemplary embodiment of the present invention.
[0053] Figure 5is a structural diagram of an electronic device provided by an exemplary embodiment of the present invention. DETAILED DESCRIPTION
[0054] Below, the exemplary embodiments according to the present invention will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments of the present invention, and it should be understood that the present invention is not limited to the exemplary embodiments described here.
[0055] Figure 1 It is a flowchart of a switch network configuration method based on a cloud native environment provided by an exemplary embodiment of the present invention. Figure 2 FIG. 1 is a flowchart of a method for configuring a switch network based on a native environment provided by an exemplary embodiment of the present invention. Figure 1-2 As shown in the figure, the switch network configuration method based on the cloud native environment includes:
[0056] Step 110: The controller obtains multiple network resource instances declared by the user through the cloud native environment, wherein each network resource instance includes a node label.
[0057] In an embodiment of the present invention, a user can declare network resources in batches, including creating network resources, updating network resources, deleting network resources, etc. Then the declared network resources are sent to the controller through the cloud native environment. The controller obtains the network resources through the cloud native environment and selects a suitable switch based on the network resources, so that the switch performs network configuration based on the network resources.
[0058] Updating network resources means modifying the existing network resource configuration, such as updating the Service type or modifying the Ingress routing rules. Deleting network resources means removing network resources that are no longer needed.
[0059] Step 120: The controller selects a target switch node that matches the node label from the node resources, wherein the node resources include multiple switch nodes, and each switch node corresponds to a usage label.
[0060] In the embodiment of the present invention, the network resources include a node name (SwitchName) or a node label (SwitchSelector), and a switch matching the node name or node label is selected from the node resources through the node name or node label to perform network configuration.
[0061] Among them, node resources (Switch resources) are created in a cloud-native environment. The node resources include multiple switch nodes, and each switch node is classified according to its purpose. The classified switch nodes correspond to purpose labels. In the present invention, each switch node can correspond to multiple purpose labels, that is, each switch node corresponds to a different purpose.
[0062] Step 130: The controller obtains an actuator that communicates with the target switch based on the target switch corresponding to the target switch node.
[0063] Step 140: The controller creates a network configuration request for each network resource instance according to the network resource instance of the cloud native environment and address-related information of the target switch node.
[0064] In the embodiment of the present invention, in order to quickly configure a large number of switches, the controller creates a network configuration request for each network resource instance based on the network resource instance of the cloud native environment and the address-related information of the target switch node, and sends the network configuration request to the executor. Since the executor is customized for different models of switches, that is, the executor contains the specific logic and protocol required to interact with the switch, the executor can process requests from different switches, and the controller does not need to log in to the switch one by one to execute commands, and can manage different models of switches through the executor.
[0065] Among them, the network resource instances of the cloud-native environment represent the network-related resources defined in the cloud-native environment, including Service: a way to access a group of Pods. Ingress: used to manage external access to services. NetworkPolicy: used to define network access rules between Pods. These resource instances are created by Kubernetes (cloud-native environment) users or developers based on actual needs, and they define the expected network configuration and behavior.
[0066] The address-related information of the target switch node includes the IP address or host name of the switch: used to send configuration requests or query status to the switch. The management interface information of the switch: the API or protocol (such as SNMP, REST API, etc.) used to communicate with the switch. The model and other characteristics of the switch: this information helps the controller select the appropriate actuator agent when sending a request.
[0067] Step 150: The executor receives the network configuration request and obtains dependency conditions corresponding to the network resource instance of the network configuration request.
[0068] In an embodiment of the present invention, in order to ensure the stability of the network environment, reduce misconfiguration, optimize resource usage, implement transactional operations, and improve maintainability, after the executor receives a network configuration request, it is necessary to check the dependency conditions corresponding to the network resource instance of the network configuration request to ensure the integrity, stability, and consistency of the network resources.
[0069] Step 160: If the dependency condition satisfies the preset dependency condition, the executor performs network configuration on the target switch based on the network configuration information corresponding to the network resource instance of the network configuration request.
[0070] The switch network configuration method based on the cloud native environment provided by the present invention includes: a controller obtains multiple network resource instances declared by a user through the cloud native environment, wherein each network resource instance includes a node label, the controller selects a target switch node matching the node label from the node resource, wherein the node resource includes multiple switch nodes, each switch node corresponds to a usage label, the controller obtains an actuator communicating with the target switch based on the target switch corresponding to the target switch node, the controller creates a network configuration request for each network resource instance according to the network resource instance of the cloud native environment and the address related information of the target switch node, the actuator receives the network configuration request and obtains the dependency condition corresponding to the network resource instance of the network configuration request, and if the dependency condition of the actuator satisfies the preset dependency condition, the target switch is configured based on the network configuration information corresponding to the network resource instance of the network configuration request. By setting the node label, a suitable target switch node can be selected from the node resource, and the corresponding actuator is selected through the target switch node, so that when the user declares the network resources in batches, the controller performs network configuration on the corresponding switches in batches by controlling the actuator. In addition, since a specific connection method is used between the actuator and the switch, the controller can perform network configuration on the switch through the actuator, without having to log in to the switch account and then perform network configuration on the switch.
[0071] In one embodiment, step 120 can be specifically implemented as follows: selecting a switch node that matches a node label from node resources; determining other node labels corresponding to the selected switch node; selecting a switch node whose usage similarity with the node label of other node labels corresponding to the selected switch node is greater than a preset similarity threshold as a target switch node; building a node list based on the target switch node; determining the data processing flow of the network resource instance corresponding to the node label; and selecting a switch node that matches the data processing flow from the node list as the target switch node.
[0072] In an embodiment of the present invention, since the network resource instance contains a node label, the corresponding switch can be selected through the node label. Therefore, the present invention selects a switch node that matches the node label from the node resources established in the cloud native environment, and selects the corresponding switch through the switch node to perform network configuration.
[0073] Specifically, since each switch node corresponds to multiple usage labels, the selected switch node corresponds to other node labels. The present application can further determine the switch node by the usage similarity between other node labels and node labels. For example, switch node A includes node label: management function label, other node label: management and monitoring function label, and switch node B includes node label: management function label, other node label: optical fiber connection label. Calculate the similarity between the node label in switch node A and other node labels, and calculate the similarity between the node label in switch node B and other switch nodes. After calculation, it can be obtained that the similarity between the node label in switch node A and other node labels is 90%, and the similarity between the node in switch node B and other node labels is 60%. If the preset similarity threshold is set to 80%, then only the usage similarity of switch node A is greater than the preset similarity threshold, so switch node A is determined to be the target switch node.
[0074] Then, all target switch nodes are constructed into a node list, as shown in Table 1.
[0075] Table 1
[0076]
[0077] The node list can be used to intuitively determine the switch nodes that meet the node label. Then determine the data processing flow of the network resource instance corresponding to the node label. Since different switches can handle different data flows, if the network resource instance corresponding to the node label requires a switch that can handle large data flows, then selecting a switch that handles small data flows will exceed the processing capacity of the switch, causing data packet loss and delays. Therefore, this application can select a suitable switch node based on the data processing flow, thereby ensuring that when processing more data flows, the efficiency of the switch in processing data flows can also be guaranteed.
[0078] In one embodiment, step 120 can be specifically implemented as follows: obtaining a node name from a network resource instance; selecting a switch node matching the node name from the node resources as a target switch node; if the target switch node is an abnormal node and the data processing flow of the network resource instance corresponding to the node label is greater than a preset flow threshold, then selecting multiple switch nodes with data processing flows less than the preset flow threshold from the node resources as target switch nodes; wherein step 130 can be specifically implemented as follows: obtaining a switch corresponding to the target switch node; stacking the switches corresponding to the multiple target switch nodes into a target switch; and obtaining an actuator that communicates with the target switch based on the type of the target switch.
[0079] In an embodiment of the present invention, a network resource instance contains a node name, and a unique switch node that matches the node name can be selected from the node resource through the node name, and the switch node is used as the target switch node. Due to the uniqueness of the node name, a unique switch node can be obtained from the node resource, and then a unique switch can be obtained. However, after obtaining the switch, verification is required, because the switch may have other network resources configured, or the switch cannot be started, the port fails, the IP address conflicts and other abnormalities, so the target switch node is determined to be an abnormal node and the network configuration cannot be performed. Usually, a switch node is determined again from the node resource, but if the network resource instance needs to process large data traffic, and the switch that can process large data traffic is occupied, then the present invention can stack multiple switches that process small data traffic, so that the data traffic processed by the stacked switch is the superposition of multiple small data traffic. The stacked switch can process large data traffic, thereby ensuring the smoothness of the network during data transmission, etc., and improving the processing capacity and processing efficiency of the switch.
[0080] Figure 3 FIG. 1 is a flow chart of a switch network configuration method based on a cloud native environment provided by another exemplary embodiment of the present invention. Figure 3 As shown, step 130 may include:
[0081] Step 131: Based on the type of the target switch corresponding to the target switch node, obtain an executor list.
[0082] In the embodiment of the present invention, all available actuators can be obtained by querying a device database or an API, and an actuator list can be made.
[0083] Among them, the executor is deployed in the cloud native environment kubernetes cluster. When the executor is started in the Kubernetes cluster, it will first self-detect and determine the switch models it supports and their management capabilities. This information may include supported protocols (such as SNMP, REST API, etc.), configuration capabilities, monitoring functions, and compatible device types. The executor encapsulates the collected information into a registration message and sends a registration request to the controller through the service discovery mechanism provided by Kubernetes. As the management center, the controller is responsible for maintaining the status and resources of the entire cluster. After receiving the registration request from the executor, the controller stores the executor information in etcd. etcd is a distributed key-value storage system used to store cluster status in Kubernetes. By storing the executor information in etcd, the controller can access and manage all registered executors in real time. The registration information usually includes the executor's unique identifier, supported switch models, management capabilities, network addresses, and other related metadata. This structured information storage method facilitates fast query and management. To ensure that the controller can monitor the status of the executor in real time, the executor sends heartbeat signals regularly. The frequency of the heartbeat can be configured according to specific application requirements, and is usually set to be sent every few seconds or minutes. The heartbeat signal is not only used to confirm the survival status of the executor, but also carries the current status information of the executor, such as whether it is online, the health status of the operation, and the load status. This information will help the controller to detect and handle possible problems in a timely manner. In addition to the heartbeat mechanism, the executor will also periodically report its management capabilities and status information to the controller. This report can include the switch models currently supported by the executor, the number of managed devices, the status of the executed tasks, and possible error logs. The way to implement periodic reporting is usually based on scheduled tasks, and Kubernetes's CronJob or internal scheduling mechanism can be used. In this way, the controller can dynamically understand the changes in the management capabilities of the executor and make intelligent scheduling and resource allocation based on this. After receiving the heartbeat signal, the controller will determine the health status of the executor based on the frequency and effectiveness of the heartbeat. If the heartbeat signal is not received within the predetermined time, the controller will mark the executor as "unavailable" and attempt to failover or reschedule. In addition, the controller can also use the status information reported by the executor to quickly identify performance bottlenecks or insufficient resources, and make corresponding adjustments to ensure the stability and high availability of the overall system.
[0084] Step 132: Select an executor from the executor list as the executor for communicating with the target switch.
[0085] In an embodiment of the present invention, a polling algorithm is applied to the retrieved executor list. The polling algorithm is a simple and effective selection mechanism that traverses the available executors in turn to ensure that each executor can be called fairly.
[0086] In one embodiment, step 160 may be specifically implemented as follows: if the network state of the target switch is a normal operating state and the VLAN identifier in the network configuration information corresponding to the network resource instance of the network configuration request matches the processing identifier of the target switch, and the VLAN identifier is not used by other network configuration devices, then the network configuration of the target switch is performed based on the network configuration information corresponding to the network resource instance of the network configuration request.
[0087] In the embodiment of the present invention, if the port of the target switch has a high packet loss rate, a significantly increased network delay, an abnormally high CPU or memory usage, etc., then the operating state of the target switch is abnormal, and it is necessary to replace other switches for network configuration.
[0088] In addition, the processing identifier corresponding to each target switch is unique, and the processing identifier can be a specific VLAN identifier. The VLAN (Virtual Local Area Network) identifier is a number used to uniquely identify a VLAN. The processing identifier of the target switch must match the VLAN identifier in the network resource instance, or the VLAN identifier needs to be within the range of the processing identifier, because only devices in the same VLAN can communicate directly. If the VLAN ID of the network resource instance is inconsistent with the VLAN ID configured for the target switch, the controller cannot communicate with the target switch, resulting in network failure or access failure.
[0089] In addition, if multiple devices use the same VLAN ID, network traffic will be confused, and communication between devices will become unpredictable, thereby affecting the normal operation of the network. Therefore, the VLAN identifier in the network configuration information of the present invention cannot be used by other network configuration devices. Finally, when all dependent conditions are met, the network configuration of the target switch is performed based on the network configuration information corresponding to the network resource instance of the network configuration request. In one embodiment, step 160 can be specifically implemented as follows: determining a gateway that is connected to the VLAN identifier communication; if the router corresponding to the gateway communicates with the target switch, the network configuration of the target switch is performed based on the network configuration information corresponding to the network resource of the network configuration request.
[0090] In an embodiment of the present invention, during the network configuration process, it is first necessary to identify the gateway associated with a specific VLAN identifier. This step ensures that the data stream can be correctly routed through the specified VLAN. If the router corresponding to the identified gateway can establish a communication connection with the target switch, then the next step is to perform corresponding network configuration on the target switch based on the configuration information corresponding to the network resources contained in the network configuration request. This means that the system will parse the detailed configuration parameters in the request, such as VLAN settings, IP address allocation, access control list (ACL), etc., and apply these configurations to the target switch to ensure that network resources can be effectively managed and optimized according to the expected requirements. Through this automated configuration process, manual operation errors can be greatly reduced, the efficiency and accuracy of network configuration can be improved, and the consistency and scalability of the network architecture can be ensured.
[0091] In one embodiment, step 160 can be specifically implemented as follows: obtaining the IP address of the classless inter-domain routing in the network configuration information corresponding to the network resource of the network configuration request; if the format of the IP address of the classless inter-domain routing meets the preset format requirements, then based on the network configuration information corresponding to the network resource of the network configuration request, performing network configuration on the target switch.
[0092] In an embodiment of the present invention, during the network configuration process, the system first extracts the network configuration information associated with a specific network resource from the network configuration request, and obtains the Classless Inter-Domain Routing (CIDR) IP address therefrom. Because the CIDR IP address determines the routing path of the data packet between different subnets. Next, the system will perform strict format verification on the extracted CIDR IP address to ensure that it meets the preset format requirements, such as the correct IP address format, reasonable subnet mask length, and avoidance of address conflicts. If the CIDR IP address passes the format verification, the system will automatically configure the target switch accordingly based on the detailed network configuration information provided in the network configuration request, including but not limited to subnet division, routing rules, access control list (ACL), and quality of service (QoS) policy. This process can not only ensure the accuracy and consistency of the network configuration, but also significantly improve the configuration efficiency, reduce human errors, and thus optimize the performance and stability of the entire network architecture.
[0093] In one embodiment, step 160 can be specifically implemented as follows: obtaining a configured subnet; wherein the configured subnet represents a subnet that is communicatively connected to other network configuration devices; if the IP address of the configured subnet has no overlapping fields with the IP address of the classless inter-domain routing, then based on the network configuration information corresponding to the network resources of the network configuration request, the target switch is configured for network configuration.
[0094] In an embodiment of the present invention, during the network configuration process, the system first obtains the currently configured subnets, which represent the communication connection with other network configuration devices. Then, the system compares the IP addresses of these configured subnets with the Classless Inter-Domain Routing (CIDR) IP addresses extracted from the network configuration request to ensure that there are no overlapping fields between the two. Because the overlap of IP addresses may cause address conflicts, which in turn cause network communication failures or security risks. If the system detects that the IP address of the configured subnet does not overlap with the CIDR IP address, it will continue to configure the target switch accordingly based on the detailed network configuration information contained in the network configuration request. These configuration information may include subnet division, routing rules, access control lists (ACLs), VLAN settings, and quality of service (QoS) policies. Through the automated configuration process, the system can ensure the compatibility and consistency of the new network configuration with the existing network architecture, while effectively improving configuration efficiency, reducing human operation errors, and ultimately optimizing the performance and stability of the entire network environment.
[0095] In one embodiment, the switch network configuration method based on the cloud native environment can be specifically implemented as follows: the executor obtains the SSH key of the target switch; and the executor communicates with the target switch through the SSH key.
[0096] In an embodiment of the present invention, during the network configuration process, the executor first obtains the SSH key of the target switch, which is a key step to ensure secure communication. When obtaining the SSH key, the executor extracts the public key or private key of the target switch from the pre-configured secure storage to ensure the integrity and confidentiality of the key. Subsequently, the executor uses the obtained SSH key to establish a communication connection with the target switch. Through the SSH key for identity authentication, the executor can securely authenticate the identity of the target switch and establish an encrypted channel on this basis to ensure that all transmitted data is not stolen or tampered with during the transmission process. This encrypted connection not only ensures the confidentiality and integrity of configuration instructions and data, but also prevents potential man-in-the-middle attacks and unauthorized access. In addition, the SSH connection enables the executor to remotely access and manage the target switch and perform necessary network configuration operations, such as updating configuration files, applying new network policies, or troubleshooting. The entire connection process strictly follows security protocols and best practices, thereby ensuring the stability, security, and efficiency of network configuration operations. SSH (Secure Shell) is a protocol for implementing secure remote login and other secure network services on an insecure network.
[0097] In one embodiment, the switch network configuration method based on the cloud native environment can be specifically implemented as follows: adding multiple switch nodes to be processed in the node resources, obtaining a switch node that matches the label of the switch node to be processed from the node resources as a reference switch node; and configuring the switch node to be processed based on the specific resources corresponding to the reference switch node.
[0098] In an embodiment of the present invention, if there are historical switch nodes that have been registered in the controller, these historical switch nodes are marked as common-feature: enabled, and this label indicates that these nodes have some common characteristics or functions, such as specific network functions or protocols. And the historical switch nodes correspond to the switch feature resources SwitchFeature. The controller manages and configures settings related to switch functions through feature resources. When the controller identifies the added switch node to be processed, since the label of the switch node to be processed (also marked as common-feature: enabled) is the same as the label of the historical switch node, then based on the label, the controller can automatically apply the switch feature resource SwitchFeature configuration to the switch node to be processed. Therefore, the network administrator does not need to manually configure each newly added switch node to be processed. The controller will automatically configure the feature resources of the historical switch node to the switch node to be processed with the same node label as the historical switch node according to the node label of the historical switch node.
[0099] In one embodiment, when a switch node (Switch) is deleted, the coordination logic of the system will automatically re-trigger to ensure the integrity of network resources and optimize resource utilization. The specific process is as follows: First, the deletion operation is initiated, and the system immediately identifies and removes the specified switch node. Next, the coordination logic detects all network resource instances associated with the switch node, including but not limited to virtual network interfaces, routing tables, and terminal devices connected to the switch. The system will evaluate whether these resource instances still meet the conditions for existence, such as checking whether there are redundant paths or backup devices that can replace the functions of the deleted nodes. If some resource instances are no longer needed and meet the deletion conditions, the coordination logic will automatically perform the deletion operation, thereby releasing these resources and achieving network capacity reduction. The entire process not only ensures the dynamic adjustment of the network architecture and the efficiency of resource utilization, but also maintains the stability and continuity of the network during the node deletion process, avoiding potential interruptions or performance degradation. In addition, the system may record the log of this adjustment operation for subsequent auditing and optimization. Through this mechanism, network management can respond to environmental changes more flexibly and intelligently, ensuring the reliability and scalability of the overall system.
[0100] Figure 4FIG. 1 is a flow chart of a switch network configuration system based on a cloud native environment provided by an exemplary embodiment of the present invention. Figure 4 As shown, the switch network configuration system based on the cloud native environment includes: a controller 201, which is used to obtain multiple network resource instances declared by the user through the cloud native environment; wherein each network resource instance includes a node label, and a target switch node matching the node label is selected from the node resources; wherein the node resources include multiple switch nodes, each switch node corresponds to a usage label, and based on the target switch corresponding to the target switch node, an executor communicating with the target switch is obtained, and a network configuration request for each network resource instance is created according to the network resource instance of the cloud native environment and the address related information of the target switch node; an executor 202 is used to receive the network configuration request and obtain the dependency condition corresponding to the network resource instance of the network configuration request, and if the dependency condition meets the preset dependency condition, the network configuration of the target switch is performed based on the network configuration information corresponding to the network resource instance of the network configuration request.
[0101] The embodiment of the present invention provides a switch network configuration system based on a cloud native environment. The system embodiment can be implemented by software, or by hardware or a combination of software and hardware. From a hardware perspective, in addition to the CPU, memory, network interface, and non-volatile memory, the device in the embodiment where the system is located can generally include other hardware, such as a forwarding chip responsible for processing messages, etc. Taking software implementation as an example, as a system in a logical sense, it is formed by the CPU of the device where it is located reading the corresponding computer program instructions in the non-volatile memory into the memory for execution.
[0102] In one embodiment, the controller 201 is used to select a switch node that matches a node label from node resources; determine other node labels corresponding to the selected switch node; select a switch node whose usage similarity with the node label of other node labels corresponding to the selected switch node is greater than a preset similarity threshold as a target switch node; build a node list based on the target switch node; determine the data processing flow of the network resource instance corresponding to the node label; and select a switch node that matches the data processing flow from the node list as the target switch node.
[0103] In one embodiment, the controller 201 is used to obtain a node name from a network resource instance; select a switch node matching the node name from the node resources as a target switch node; if the target switch node is an abnormal node and the data processing flow of the network resource instance corresponding to the node label is greater than a preset flow threshold, select multiple switch nodes with data processing flows less than the preset flow threshold from the node resources as target switch nodes; obtain a switch corresponding to the target switch node; stack the switches corresponding to the multiple target switch nodes into a target switch; and based on the type of the target switch, obtain an actuator that communicates with the target switch.
[0104] In one embodiment, the controller 201 is configured to obtain an executor list based on the type of the target switch corresponding to the target switch node; and select an executor from the executor list as the executor for communicating with the target switch.
[0105] In one embodiment, the executor 202 is used to perform network configuration on the target switch based on the network configuration information corresponding to the network resource instance of the network configuration request if the network state of the target switch is a normal operating state and the VLAN identifier in the network configuration information corresponding to the network resource instance of the network configuration request matches the processing identifier of the target switch and the VLAN identifier is not used by other network configuration devices.
[0106] In one embodiment, the executor 202 is used to determine a gateway that is in communication with the VLAN identifier; if a router corresponding to the gateway communicates with the target switch, the target switch is configured based on the network configuration information corresponding to the network resource of the network configuration request.
[0107] In one embodiment, the executor 202 is used to obtain the IP address of the classless inter-domain routing in the network configuration information corresponding to the network resource of the network configuration request; if the format of the IP address of the classless inter-domain routing meets the preset format requirement, the network configuration is performed on the target switch based on the network configuration information corresponding to the network resource of the network configuration request.
[0108] In one embodiment, the executor 202 is used to obtain a configured subnet; wherein the configured subnet represents a subnet that is communicatively connected to other network configuration devices; if the IP address of the configured subnet has no overlapping fields with the IP address of the classless inter-domain routing, the network configuration is performed on the target switch based on the network configuration information corresponding to the network resources requested by the network configuration.
[0109] In one embodiment, the executor 202 is used to obtain the SSH key of the target switch and communicate with the target switch through the SSH key.
[0110] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the storage medium stores a computer program, and the computer program is used to execute the switch network configuration method based on a cloud native environment of any of the above embodiments.
[0111] In addition to the above-mentioned methods and devices, an embodiment of the present invention may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the switch network configuration method based on a cloud native environment according to various embodiments of the present invention described in the above-mentioned "Exemplary Method" section of this specification.
[0112] According to another aspect of the present invention, an electronic device is provided, comprising: a processor; a memory for storing processor executable instructions; and a processor for executing the switch network configuration method based on a cloud native environment of any of the above embodiments.
[0113] In addition, an embodiment of the present invention may also be a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, enables the processor to execute the steps of the switch network configuration method based on a cloud-native environment according to various embodiments of the present invention described in the above “Exemplary Method” section of this specification.
[0114] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A switch network configuration method based on a cloud native environment, characterized in that: include: The controller obtains multiple network resource instances declared by the user through the cloud native environment; wherein each of the network resource instances includes a node label; The controller selects a target switch node matching the node label from the node resources; wherein the node resources include a plurality of switch nodes, each of which corresponds to a usage label; The controller acquires an actuator that communicates with the target switch based on the target switch corresponding to the target switch node; The controller creates a network configuration request for each network resource instance according to the network resource instance of the cloud native environment and address related information of the target switch node; The executor receives the network configuration request and obtains dependency conditions corresponding to the network resource instance of the network configuration request; If the dependency condition satisfies a preset dependency condition, the executor performs network configuration on the target switch based on the network configuration information corresponding to the network resource instance of the network configuration request.
2. The switch network configuration method based on the cloud native environment according to claim 1, characterized in that: The controller selects a target switch node matching the node label from the node resources, including: Select a switch node matching the node label from the node resources; Determine other node labels corresponding to the selected switch node; Selecting a switch node whose usage similarity between other node labels corresponding to the selected switch node and the node label is greater than a preset similarity threshold as a target switch node; Based on the target switch node, construct a node list; Determine the data processing flow of the network resource instance corresponding to the node label; A switch node matching the data processing flow is selected from the node list as a target switch node.
3. The switch network configuration method based on a cloud native environment according to claim 1, characterized in that: The controller selects a target switch node matching the node label from the node resources, including: Obtaining a node name from the network resource instance; Selecting a switch node matching the node name from the node resources as a target switch node; If the target switch node is an abnormal node and the data processing flow of the network resource instance corresponding to the node label is greater than a preset flow threshold, multiple switch nodes with data processing flows less than the preset flow threshold are selected from the node resources as the target switch nodes; The controller, based on the target switch corresponding to the target switch node, acquires the actuator communicating with the target switch, including: Obtain the switch corresponding to the target switch node; Stacking the switches corresponding to the multiple target switch nodes into a target switch; Based on the type of the target switch, an executor that communicates with the target switch is acquired.
4. The switch network configuration method based on a cloud native environment according to claim 1, characterized in that: The controller acquires, based on the target switch corresponding to the target switch node, an actuator communicating with the target switch, including: Based on the type of the target switch corresponding to the target switch node, obtaining an executor list; An executor is selected from the executor list as the executor for communicating with the target switch.
5. The switch network configuration method based on a cloud native environment according to claim 1, characterized in that: If the dependency condition satisfies a preset dependency condition, the executor performs network configuration on the target switch based on the network configuration information corresponding to the network resource of the network configuration request, including: If the network status of the target switch is in a normal operating state and the VLAN identifier in the network configuration information corresponding to the network resource instance of the network configuration request matches the processing identifier of the target switch, and the VLAN identifier is not used by other network configuration devices, the network configuration of the target switch is performed based on the network configuration information corresponding to the network resource instance of the network configuration request.
6. The switch network configuration method based on a cloud native environment according to claim 5, characterized in that: The performing network configuration on the target switch based on the network configuration information corresponding to the network resource of the network configuration request includes: Determine a gateway that is communicatively connected to the VLAN identifier; If the router corresponding to the gateway communicates with the target switch, network configuration is performed on the target switch based on the network configuration information corresponding to the network resource of the network configuration request.
7. The switch network configuration method based on a cloud native environment according to claim 5, characterized in that: The performing network configuration on the target switch based on the network configuration information corresponding to the network resource of the network configuration request includes: Obtaining an IP address of a classless inter-domain route in the network configuration information corresponding to the network resource of the network configuration request; If the format of the IP address of the classless inter-domain routing meets the preset format requirement, the target switch is configured for network configuration based on the network configuration information corresponding to the network resource of the network configuration request.
8. The switch network configuration method based on a cloud native environment according to claim 5, characterized in that: The performing network configuration on the target switch based on the network configuration information corresponding to the network resource of the network configuration request includes: Obtaining a configured subnet; wherein the configured subnet represents a subnet that is communicatively connected to other network configuration devices; If the IP address of the configured subnet has no overlapping fields with the IP address of the classless inter-domain routing, network configuration is performed on the target switch based on the network configuration information corresponding to the network resource of the network configuration request.
9. The switch network configuration method based on a cloud native environment according to claim 1, characterized in that: Also includes: The executor obtains the SSH key of the target switch; The executor is connected to the target switch through the SSH key.
10. A switch network configuration system based on a cloud native environment, characterized in that: include: A controller, configured to obtain multiple network resource instances declared by a user through a cloud native environment; wherein each of the network resource instances includes a node label, and a target switch node matching the node label is selected from the node resources; wherein the node resources include multiple switch nodes, each switch node corresponds to a usage label, and based on a target switch corresponding to the target switch node, an actuator communicating with the target switch is obtained, and a network configuration request for each network resource instance is created according to the network resource instance of the cloud native environment and address-related information of the target switch node; The executor receives the network configuration request and obtains the dependency condition corresponding to the network resource instance of the network configuration request. If the dependency condition meets the preset dependency condition, the executor performs network configuration on the target switch based on the network configuration information corresponding to the network resource instance of the network configuration request.
Citation Information
Patent Citations
Automatic configuration management method, system and device for server network
CN115225475A
Network switch configuration data batch backup method, device, equipment and medium
CN117527585A
Routing method based on programmable switch and container state information unloading
CN117579550A
Flow control method, system and device based on cloud native gateway and medium
CN118555267A