Physical switch information acquisition method, computing device and physical switch

In the software-defined network architecture, nodes send request messages to physical switches to obtain their relevant information and store these information in the database, solving the problem of invisible physical switch information, realizing the application layer's accurate acquisition and storage of physical switch information, and simplifying the troubleshooting process.

CN119629015APending Publication Date: 2025-03-14XFUSION DIGITAL TECH CO LTD

Patent Information

Application Number
CN202411035807.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

In a software-defined network architecture, the relevant information of the physical switch is invisible to the application layer, making it difficult for users to accurately obtain the relevant information of the physical switch corresponding to the host network port.

Method used

The node sends a request message to the physical switch, requests to obtain information of the physical switch, and stores the information in the response message into the database, so that the application layer can obtain relevant information of the corresponding physical switch.

Benefits of technology

It is realized that in the software-defined network architecture, nodes can record relevant information of their corresponding physical switches, so that the application layer can accurately obtain information of the physical switch, simplifying the physical switch troubleshooting process and improving efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119629015A_ABST
    Figure CN119629015A_ABST
Patent Text Reader

Abstract

The invention discloses a physical switch information acquisition method, computing equipment and a physical switch, and relates to the technical field of cloud computing. The method comprises the following steps: a node sends a request message to a physical switch, so that the physical switch acquires corresponding physical switch information in response to the request message, encapsulates the physical switch information into a response message and returns the response message to the node; obtaining physical switch information carried by a response message based on the received response message returned by the physical switch; and storing the physical switch information carried by the response message into a database, so that the client displays the physical switch information connected with the node on a display interface of the client. In the application, the node can record the information of the corresponding physical switch, so that the application layer can obtain the related information of the corresponding physical switch, and the client displays the information of the node and the physical switch connected with the client, that is, a user can accurately obtain the information of the physical switch corresponding to the node.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud computing technology, and in particular to a method for obtaining physical switch information, a computing device, and a physical switch. Background Art

[0002] With the development of cloud computing and data centers, the software defined networking (SDN) architecture has become one of the mainstream network architectures due to its flexibility and convenience. Software defined networking architecture is a new type of network architecture and a way to implement network virtualization. Its core concept is to separate the control plane from the forwarding plane of the network and to achieve flexible programming and management of network resources through centralized controller software.

[0003] In current technology, in order to achieve dynamic scheduling of network resources, centralized control of policies, and seamless communication across virtual and physical boundaries, software switches are used as part of the network infrastructure in the software-defined network architecture, that is, software switches and physical switches are used to jointly build a network environment that is both virtualized and supported by physical entities. However, since the software-defined network architecture itself improves the flexibility, manageability, and security of the network through mechanisms such as abstraction, centralized control, interface isolation, and automated management, the relevant information of the physical switch is invisible to the application layer.

[0004] It can be seen that in the existing technology, when the software-defined network architecture adopts the implementation method of software switch, the relevant information of the physical switch is invisible to the application layer, which makes it difficult for users to accurately obtain the relevant information of the physical switch corresponding to the host network port. Summary of the invention

[0005] The present application provides a method for obtaining physical switch information, a computing device, and a physical switch. A node can record relevant information of the physical switch corresponding to the node, so that the application layer can obtain relevant information of the corresponding physical switch, that is, the user can accurately obtain relevant information of the physical switch corresponding to the node.

[0006] In order to achieve the above objectives, this application adopts the following technical solutions:

[0007] In the first aspect, the present application provides a method for obtaining physical switch information, which is applied to a node, such as a host. The method includes: sending a request message to the physical switch, the request message is used to request the information of the physical switch, so that the physical switch responds to the request message to obtain the corresponding physical switch information, encapsulates the physical switch information into a response message and returns it to the node; based on the response message returned by the received physical switch, obtains the physical switch information carried by the response message; stores the physical switch information carried by the response message in a database, so that the client can display the physical switch information connected to the node on its display node. The present application implements that in a software-defined network architecture, a node can record the relevant information of its corresponding physical switch, so that the application layer can obtain the relevant information of the corresponding physical switch, so that the client displays the information of the node and the physical switch connected to it, that is, the user can accurately obtain the information of the physical switch corresponding to the node.

[0008] In a possible implementation, the request message is a request message of a first preset format, and the request message of the first preset format at least includes: a protocol type, a protocol length, an operation type, and a destination address; wherein the protocol type is used to indicate the type of physical switch information requested by the request message; the type of physical switch information includes: identification information of the physical switch, identification information of the first port, and configuration information of the first port, and the first port is a port connecting the physical switch to the node; wherein the protocol length is used to indicate the length of the information carried in the protocol type; wherein the operation type is a first operation type, which is used to indicate that the type of the message is a request message; wherein the destination address is used to indicate the MAC address of the network card connecting the node to the physical switch. Physical switch information is obtained in the form of a request message, and the request message of the first preset format is only composed of the protocol type, the protocol length, the operation type, and the destination address, so that resources consumed by transmitting the request message of the first preset format can be saved.

[0009] In a possible implementation, the request message in the first preset format further includes: a destination physical switch identifier, a first port identifier, and first port configuration information, and the destination switch identifier, the first port identifier, and the first port configuration information in the request message are all empty. In this case, the format is the same as that of the response message returned by the physical switch, which can simplify the encapsulation step of the response message.

[0010] In a possible implementation, the protocol type includes a first protocol type, a second protocol type, and a third protocol type; wherein the first protocol type is used to indicate that the type of physical switch information requested by the request message includes: identification information of the physical switch, identification information of the first port, and configuration information of the first port; wherein the second protocol type is used to indicate that the type of physical switch information requested by the request message includes: identification information of the physical switch, identification information of the first port; wherein the third protocol type is used to indicate that the type of physical switch information requested by the request message includes: identification information of the physical switch.

[0011] In a possible implementation, the node can monitor whether the node is successfully connected to the physical switch, and when it is monitored that the node is successfully connected to the physical switch, a request message is sent to the physical switch. In response to the node successfully connecting to the physical switch, the node sends a request message to the physical switch so that the node can obtain the physical switch information in a timely manner.

[0012] In the second aspect, the present application provides a method for obtaining physical switch information, which is applied to a physical switch, and the method includes: receiving a request message sent by a node connected to the physical switch, the request message is used to request to obtain the information of the physical switch; in response to the received request message, obtaining the corresponding physical switch information; encapsulating the corresponding physical switch information into a response message, and returning the response message to the node, so that the node can obtain the corresponding physical switch information carried by the response message based on the response message, and store the physical switch information in its own database, so that the client can display the physical switch information connected to the node on its display node. The present application realizes that in a software-defined network architecture, the physical switch returns the physical switch information to the node in the form of a response message, and the node can obtain the physical switch information from the response message and store it, so that the application layer can obtain the relevant information of the corresponding physical switch, so that the client can display the information of the node and the physical switch connected to it, that is, the user can accurately obtain the information of the physical switch corresponding to the node.

[0013] In a possible implementation, the request message carries a protocol type, and the protocol type includes a first protocol type, a second protocol type, and a third protocol type; based on the protocol type in the request message being the first protocol type, identification information of the physical switch, identification information of the second port, and configuration information of the second port are obtained; wherein the second port is a port connecting the physical switch to the node; based on the protocol type in the request message being the second protocol type, identification information of the physical switch and identification information of the second port are obtained; based on the protocol type in the request message being the third protocol type, identification information of the physical switch is obtained.

[0014] In a possible implementation, the physical switch monitors all its ports, and the ports are set to have two monitoring states, namely, a first monitoring state and a second monitoring state. When the monitoring state of the port of the physical switch is the first monitoring state, the physical switch monitors whether the port receives a request message sent by a node; when the monitoring state of the port of the physical switch is the second monitoring state, the physical switch no longer monitors whether the port receives a request message sent by a node. The monitoring task of all ports is implemented by setting the monitoring state.

[0015] In a possible implementation, when it is determined that the node is successfully connected to the physical switch, the monitoring state of the first port is set to the first monitoring state, so that the physical switch monitors whether the first port receives the request message sent by the node; wherein the first port is the port connecting the physical switch to the node; after returning the response message to the node, the monitoring state of the first port is updated to the second monitoring state. After the physical switch returns the response message to the node through the first port, the monitoring state of the first port is updated from the first monitoring state to the second monitoring state, because the first port has returned the response message carrying the physical switch information, so it is no longer monitored whether the first port receives the request message sent by the node, thereby saving the resources consumed by the physical switch monitoring.

[0016] In a third aspect, the present application provides a computing device, on which a first tool is deployed, and the first tool is used to implement the method described in the first aspect.

[0017] In a fourth aspect, the present application provides a physical switch, on which a second tool is deployed, and the second tool is used to implement the method described in the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 An example diagram of an application scenario of a method for obtaining physical switch information provided in an embodiment of the present application;

[0019] Figure 2 A schematic diagram of an interactive process of a method for obtaining physical switch information provided in an embodiment of the present application;

[0020] Figure 3 An example diagram of a first preset format provided in an embodiment of the present application;

[0021] Figure 4A A schematic diagram of the difference between a response message and a request message provided in an embodiment of the present application;

[0022] Figure 4B A schematic diagram of the difference between another response message and a request message provided in an embodiment of the present application;

[0023] Figure 5 A schematic diagram of an interface for displaying physical switch information provided in an embodiment of the present application;

[0024] Figure 6 A flowchart of a method for obtaining physical switch information provided in an embodiment of the present application. DETAILED DESCRIPTION

[0025] The terms "first", "second", "third", etc. in the specification, claims and drawings of this application are used to distinguish different objects rather than to limit a specific order.

[0026] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0027] In order to make the description of the following embodiments clear and concise, a brief introduction to the related technology is first given:

[0028] Traditional network architecture: usually refers to a network system built on a layered model (e.g., OSI model, TCP / IP model), which relies on control logic distributed in various network devices (e.g., routers, switches, etc.). In other words, in the traditional network architecture, the control function and data forwarding function of these network devices are usually coupled together, and network devices usually operate independently and have fixed configurations.

[0029] Software Defined Networking (SDN) architecture: is a new type of network architecture model, which realizes the centralization and dynamicization of network control by separating the control plane of network devices (responsible for formulating policies and rules for forwarding data packets) from the forwarding plane (responsible for forwarding data packets). In the software defined network architecture, the network control logic is abstracted and centralized in one or more SDN controllers, while the data plane devices (such as switches) are only responsible for forwarding data packets.

[0030] Specifically, the software-defined network architecture is a three-layer architecture, namely the control plane (Control Plane), forwarding plane (Data Plane) and application layer (Application Layer).

[0031] The control plane is the core of the software-defined network architecture, responsible for the logical control and policy formulation of the network, and the control plane is centralized. The control plane is usually composed of one or more SDN controllers, has a global view of the network, and dynamically generates forwarding rules (for example: the MAC address table of the switch, the routing table of the router, etc.) based on application requirements, network status and other information. These forwarding rules will eventually be sent to the devices on the data plane. The control plane communicates with the forwarding plane through an open interface to achieve flexible control of network traffic.

[0032] The forwarding plane, also known as the data plane, is responsible for the actual data packet processing and forwarding. In the software-defined network architecture, the forwarding plane devices (such as switches) become simpler, and forward data packets according to the forwarding rules issued by the control plane. Complex decision logic is no longer required, so that forwarding can focus on high-speed data processing and improve network performance.

[0033] The application layer is located above the control plane and includes various network applications and services (for example, cloud computing management platform). These applications interact with the control plane through the application programming interface (API) provided by the control plane to achieve customized control of network behavior. The application layer can develop a variety of network services, such as traffic engineering, load balancing, and security policy management, to meet the needs of different business scenarios. Through the application programming interface, the application layer can dynamically influence the behavior of the network, enhancing the flexibility and programmability of the network.

[0034] Compared with traditional network architecture, software-defined network architecture achieves centralized control, dynamic adjustment and high automation of the network by decoupling the control plane and the data plane, thereby reducing costs, improving scalability and flexibility, simplifying management, enhancing network programmability, improving network performance and optimizing resource allocation, promoting innovation and open standards, and enhancing network security.

[0035] The software-defined network architecture itself has mechanisms such as abstraction, centralized control, interface isolation, and automated management.

[0036] Abstraction refers to the fact that the software-defined network architecture achieves a high degree of abstraction of network functions by separating the control plane from the forwarding plane. As a software component in the software-defined network architecture, the virtual switch provides a logical network model for the application layer, hiding the specific implementation details of the underlying physical switch.

[0037] Among them, centralized control means that in the software-defined network architecture, network policies and configurations are managed by one or more centralized SDN controllers. The SDN controller dynamically configures all network devices including physical switches according to the needs of the application layer and network policies. This centralized control mode eliminates the need for the application layer to interact with the physical switch, but only needs to interact with the virtualized network interface, thereby improving the flexibility and responsiveness of the network.

[0038] Among them, interface isolation means that the SDN controller provides a northbound interface (for the application layer and network administrators) and a southbound interface (for network devices). The northbound interface is used to formulate network policies and receive network service requests, and the southbound interface is used to process communications with physical devices. This interface isolation mode ensures that the application layer operates through the northbound interface and does not need to interact directly with the physical switch.

[0039] Among them, automated management refers to the software-defined network architecture that supports dynamic configuration and automated management of network resources. The application layer does not need to directly configure the physical switch, which greatly reduces the need for manual intervention and improves the network's operational efficiency.

[0040] The embodiment of the present application provides a method for obtaining physical switch information, through the interaction between the first tool mounted on the node and the second tool mounted on the physical switch, that is, the first tool sends a request message to the physical switch, requesting to obtain relevant information of the physical switch; the second tool obtains relevant information of the physical switch based on the received request message, and encapsulates it into a response message and returns it to the node, and the node stores the relevant information of the physical switch carried by the response message in the database, so as to transmit the relevant information of the physical switch stored in the database of the node to the front end (i.e., the client) through the back-end interface, so as to display the information of the physical switch connected to the node on its display interface. Thus, in the software-defined network architecture, the application layer displays the relevant information of the node and the physical switch connected to it (for example: the identification of the physical switch, the identification of the first port, and the configuration information of the first port), that is, the application layer can obtain the relevant information of the corresponding physical switch, and the user can accurately obtain the relevant information of the physical switch corresponding to the node.

[0041] Embodiment 1:

[0042] Combine the following Figure 1-Figure 5 , a method for obtaining physical switch information provided by an embodiment of the present application is introduced in detail.

[0043] First, combine Figure 1 , an application scenario of a method for obtaining physical switch information provided in an embodiment of the present application is introduced in detail, which can be called a configuration information recording system.

[0044] like Figure 1 As shown, the configuration information recording system includes a node 110 and a physical switch 120, and the node 110 is connected to the physical switch 120. Specifically, the network card of the node 110 is connected to the port of the physical switch 120.

[0045] The node 110 may be any computing device, for example, a server. In the embodiment of the present application, the node 110 is a host. The node 110 has one or more network interface cards (NICs), which are key components for data transmission between the server and the network. Specifically, the one or more NICs on the node 110 provide a physical layer connection, that is, the NICs can be used to connect the node 110 to the physical switch 120.

[0046] Specifically, a first tool 111 is mounted on the node 110 , and a database 112 is running on the node 110 .

[0047] The first tool 111 is a tool pre-written in a programming language, including C language, C++ language, Python, Java, etc. The first tool 111 is used to send a request message in a first preset format to a physical switch connected to the node 110 (eg, the physical switch 121 ).

[0048] In a possible implementation, the first tool 111 supports the user to configure the request message of the first preset format by means of command line parameters. Exemplarily, the first tool 111 can configure the protocol type in the request message of the first preset format by means of the command line parameter "-t 0x0080", where "-t" is a command line option for indicating the type (type), and "0x0080" is a command line parameter, specifically a hexadecimal value for specifying the value of this type, i.e., for indicating a specific type.

[0049] The command line interface (CLI) is a way for users to interact with software by entering text commands on the keyboard to perform operations. For example, in the command line interface, users can type commands or parameters at the prompt. Command line options are special parameters used to customize or extend the functions of commands in the command line. They usually start with a dash "-" or two hyphens "--", followed by a single letter or a complete single word, which is used to enable or set a specific function, mode or parameter value.

[0050] Database 112 is a system that organizes, stores, and manages data according to a specific data structure, which allows users to access, update, manage, and retrieve information in an efficient and systematic manner.

[0051] The physical switch 120 is a network device responsible for forwarding data packets between different network devices. In the software defined network architecture, the physical switch 120 is mainly responsible for the forwarding task of the data plane.

[0052] Specifically, the second tool 121 is mounted on the physical switch 120 .

[0053] The second tool 121 is a tool pre-written in a programming language, and the programming languages ​​include: C language, C++ language, Python, Java, etc. The second tool 121 is used to respond to the request message sent by the first tool 111, obtain relevant information of the port corresponding to the physical switch 120, such as: the identifier of the physical switch, the identifier of the source port, and the configuration information of the source port, and encapsulate the obtained relevant information according to the second preset format to obtain a response message, and return the response message to the first tool 111 of the node 110 through the source port. The source port is the port of the physical switch 120 that receives the request message in the first preset format sent by the node 110.

[0054] Further, the first tool 111 of the node 110 receives a response message in a second preset format returned by the physical switch 120, obtains the physical switch identifier, the source port identifier, and the configuration information of the source port carried in the response message in the first preset format, and stores the physical switch identifier, the source port identifier, and the configuration information of the source port in the database 112, so as to facilitate the user's need to view the configuration of the physical switch 120 at the front end.

[0055] Combine the following Figure 2 , a method for obtaining physical switch information provided by an embodiment of the present application is described in detail. For the convenience of description, a method for obtaining physical switch information provided by an embodiment of the present application is applied to Figure 1 The configuration information shown is recorded in the system.

[0056] Before performing a method for obtaining physical switch information provided in an embodiment of the present application, it is necessary to ensure that the node 110 has been mounted with the first tool 111 and the physical switch 120 has been mounted with the second tool 121 .

[0057] S201 . When the node 110 is successfully connected to the physical switch 120 , the first tool 111 sends a request message in a first preset format to the second tool 121 of the physical switch 120 .

[0058] The request message in the first preset format is used to request to obtain the relevant configuration corresponding to the node 110 in the physical switch 120. Specifically, the relevant configuration corresponding to the node 110 in the physical switch 120 includes: the identifier of the physical switch 120, the identifier of the first port, and the configuration information of the first port.

[0059] The first port of the physical switch 120 is a port through which the physical switch 120 is connected to the node 110 .

[0060] In a possible implementation, the first tool 111 can monitor whether the node 110 is successfully connected to the physical switch 120. When the first tool 111 can monitor whether the node 110 is successfully connected to the physical switch 120, a request message in a first preset format is sent to the second tool 121 of the physical switch 120.

[0061] Exemplarily, when the node 110 is successfully connected to the physical switch 120, the physical switch 120 sends a connection message to the node 110 to inform the node 110 that it has been successfully connected to the physical switch 120. At this time, the first tool 111 monitors the successful connection between the node 110 and the physical switch 120 based on the connection message, and then sends a request message in a first preset format to the second tool 121 of the physical switch 120.

[0062] It should be noted that when the first tool 111 of the node 110 sends a request message in the first preset format to the second tool 121 of the physical switch 120, in fact, the first tool 111 sends a request message in the first preset format to the physical switch 120, and the second tool 121 on the physical switch 120 can monitor the request message in the first preset format, that is, the first tool 111 sends a request message in the first preset format to the second tool 121.

[0063] In a possible implementation, the request message in the first preset format consists of a protocol type, a protocol length, an operation type, a destination address, a destination physical switch identifier, a first port identifier, and first port configuration information, and for the request message in the first preset format, the destination physical switch identifier, the first port identifier, and the first port configuration information are empty.

[0064] For ease of understanding, the following Figure 3 , a detailed introduction to the request message in the first preset format is given.

[0065] The protocol type is used to indicate the type of information that the request message is used to request the second tool 121 to obtain. Exemplarily, when the protocol type of the request message is the first protocol type, the request message is used to request the second tool 121 to obtain the identification information of the physical switch 120, the identification information of the first port, and the configuration information of the first port; when the protocol type of the request message is the second protocol type, the request message is used to request the second tool 121 to obtain the identification information of the physical switch 120 and the identification information of the first port; when the protocol type of the request message is the third protocol type, the request message is used to request the second tool 121 to obtain only the identification information of the physical switch 120. In the embodiment of the present application, the protocol type in the request message of the first preset format sent by the first tool 111 to the physical switch 120 is the first protocol type.

[0066] The protocol length is used to indicate the length of information carried in the protocol type of the request message, and can also be understood as the length of the message header of the request message, that is, the protocol type is the message header part of the request message.

[0067] The operation type is used to indicate the type of the message, that is, to indicate whether the message is a request message sent by the first tool 111 to the second tool 121, or a response message sent by the second tool 121 to the first tool 111. Specifically, the operation type of the request message should be the first operation type, whereas the operation type of the response message should be the second operation type.

[0068] The destination address is used to represent the MAC address of the network card connected to the physical switch 120 in the node 110. The MAC address (Media Access Control Address) is a physical address fixed in the network card (such as NIC, Ethernet card, etc.), which is used to uniquely identify the network card in the network. Each network card has a unique MAC address assigned by the network card manufacturer.

[0069] The destination physical switch identifier is used to carry the identification information of the physical switch 120, such as the IP address of the physical switch 120; the first port identifier is used to carry the identification information of the port to which the physical switch 120 is connected to the node 110, that is, the identification information of the first port, such as the port number of the first port; the first port configuration information is used to carry the configuration information of the port to which the physical switch 120 is connected to the node 110, that is, the configuration information of the first port. The configuration information of the port is used to optimize the connection, ensure security and improve network efficiency. For example, the configuration information of the port may include: port enablement status information, port speed information and duplex mode information, port description information, flow control information, etc.

[0070] The port startup status information is used to indicate whether the port is in the startup state, that is, whether the port allows data to pass.

[0071] The port speed information is used to characterize the working rate of the port, for example: 10Mbps, 100Mbps, 1Gbps, 10Gbps, etc.; the duplex mode information is used to characterize the duplex mode of the port, for example: full-duplex mode, half-duplex mode.

[0072] The port description information is the description information added for the port to help the administrator better identify and manage the purpose of the port.

[0073] Flow control information is used to indicate whether the port has enabled the flow control mechanism. The flow control mechanism is a mechanism used to manage the data flow rate in data communication. The purpose is to prevent the data receiver from being unable to process the data sent quickly by the sender, resulting in data packet loss or blocking.

[0074] It should be noted that, for the request message whose protocol type is the first protocol type, the target physical switch identifier, the first port identifier and the first port configuration information are information requested to be obtained by the second tool 121, so the target physical switch identifier, the first port identifier and the first port configuration information in the request message of the first preset format are empty.

[0075] Further, when the protocol type of the request message is the second protocol type, the request message of the first preset format is composed of the protocol type, protocol length, operation type, destination address, destination physical switch identifier, and first port identifier; when the protocol type of the request message is the third protocol type, the request message of the first preset format is composed of the protocol type, protocol length, operation type, destination address, and destination physical switch identifier. Figure 3 Take for example that the request message in the first preset format is composed of the protocol type, protocol length, operation type, destination address, destination physical switch identifier, first port identifier and first port configuration information.

[0076] In another possible implementation, the request message in the first preset format is only composed of the protocol type, the protocol length, the operation type, and the destination address, which can save resources consumed by transmitting the request message in the first preset format.

[0077] S202 : The second tool 121 obtains the identifier of the physical switch 120 , the identifier of the first port, and the configuration information of the first port based on the request message in the first preset format received from the first tool 111 .

[0078] Specifically, the second tool 121 parses the received request message, and acquires the identifier of the physical switch 120 , the identifier of the first port, and the configuration information of the first port based on the first protocol type carried by the protocol type in the request message.

[0079] It should be noted that the second tool 121 parses the received request message, which can be understood as the process of the second tool 121 unpacking and analyzing the request message. Exemplarily, the second tool 121 unpacks and analyzes the request message to obtain the first protocol type carried by the protocol type in the request message; the second tool 121 obtains the identifier of the physical switch 120, the identifier of the first port, and the configuration information of the first port by parsing the first protocol type.

[0080] Further, the second tool 121 is a first port determined in the following manner:

[0081] After the second tool 121 is mounted to the physical switch 120, the second tool 121 can monitor all ports of the physical switch 120 in real time. When the second tool 121 receives the request message sent by the first tool 111, the second tool 121 monitors the port of the physical switch 120 that receives the request message, and the port that receives the request message is the first port.

[0082] In a possible implementation, the second tool 121 is a tool mounted to the physical switch 120. When the second tool 121 receives the request message, it can directly obtain the identifier of the physical switch 120; and the second tool 121 can monitor all ports of the physical switch 120 in real time, so as to determine the first port that receives the request message, and can directly obtain the identifier of the first port; the second tool 121 then obtains the configuration information of the first port according to the identifier of the first port, thereby obtaining the identifier of the physical switch 120, the identifier of the first port, and the configuration information of the first port. Exemplarily, the configuration information of the first port includes: port enablement status information, port speed information and duplex mode information, port description information, flow control information, etc.

[0083] S203 . The second tool 121 encapsulates a response message in a second preset format based on the identifier of the physical switch 120 , the identifier of the first port, and the configuration information of the first port.

[0084] Specifically, the response message of the second preset format is composed of a protocol type, a protocol length, an operation type, a destination address, a destination physical switch identifier, a first port identifier, and first port configuration information. In a possible implementation, the first preset format is the same as the second preset format, that is, the request message of the first preset format is composed of a protocol type, a protocol length, an operation type, a destination address, a destination physical switch identifier, a first port identifier, and first port configuration information.

[0085] like Figure 4AAs shown, when the first preset format is the same as the second preset format, the difference between the response message and the request message lies in the operation type, the destination physical switch identifier, the first port identifier, and the first port configuration information. Specifically, the operation type in the request message is the first operation type, and the operation type in the response message is the second operation type; the destination physical switch identifier, the first port identifier, and the first port configuration information in the request message are empty, and the physical switch identifier, the first port identifier, and the first port configuration information in the response message encapsulate the identifier of the physical switch 120, the identifier of the first port, and the configuration information of the first port obtained by the second tool 121.

[0086] When the first preset format is the same as the second preset format, a response message of the second preset format is encapsulated. It is only necessary to modify the operation type in the request message, and encapsulate the identifier of the physical switch 120, the identifier of the first port, and the configuration information of the first port into the destination physical switch identifier, the first port identifier, and the first port configuration information part, respectively, to obtain the response message, which can simplify the encapsulation step of the response message.

[0087] In another possible implementation manner, the first preset format is different from the second preset format, that is, the request message in the first preset format consists of a protocol type, a protocol length, an operation type, and a destination address.

[0088] like Figure 4B As shown, to encapsulate a response message in a second preset format, it is necessary to modify the operation type in the request message, and add the identifier of the physical switch 120, the identifier of the first port, and the configuration information of the first port to the request message according to the second preset format, thereby obtaining a response message in the second preset format.

[0089] It should be noted that, since the second tool 121 unpacks the request message in the process of S202 (i.e., obtaining the identifier of the physical switch 120, the identifier of the first port, and the configuration information of the first port), the second tool 121 needs to repack the response message in the second preset format based on the identifier of the physical switch 120, the identifier of the first port, the configuration information of the first port, the second operation type, and the protocol type, protocol length, and destination address in the request message. Following the prescribed unpacking and packaging process can ensure the correctness, reliability, and security of data transmission, and the unpacking and packaging process is also the basis for standardized communication protocols to collaborate across different devices or network platforms.

[0090] S204 . The second tool 121 returns a response message in a second preset format to the node 110 .

[0091] Specifically, the second tool 121 returns a response message in the second preset format to the node 110 through the first port. That is, the second tool 121 only transmits the response message back from the source port and does not forward the response message.

[0092] In a possible implementation, the second tool 121 can set two monitoring states for the port of the physical switch 120, namely true (first monitoring state) and false (second monitoring state). When the physical switch 120 is connected to a node (including the node 110), the monitoring state of the port of the physical switch 120 connected to the node is true, and the second tool 121 will monitor whether the port receives the request message sent by the node. After receiving the request message sent by the first tool of the node and returning the corresponding response message, the monitoring state of the port of the physical switch 120 connected to the node is updated to false, that is, the second tool 121 no longer monitors / receives the request message sent by the port. Further, after the port of the physical switch 120 is disconnected from the node and subsequently reconnected to any node, the monitoring state of the port is updated to true.

[0093] Exemplarily, taking the connection between node 110 and port A of the physical switch 120, that is, the first port is port A as an example, when node 110 successfully establishes a connection with the physical switch 120, the listening state of port A is true, and at this time the second tool 121 can monitor whether port A receives the request message sent by the first tool 111; when the second tool 121 monitors that port A receives the request message sent by the first tool 111, the second tool 121 obtains the relevant information, encapsulates it into a response message and returns it to the node 110. At this time, the listening state of port A is updated to false, and the second tool 121 no longer monitors whether port A receives the request message sent by the first tool 111; when port A of the physical switch 120 is disconnected from the node 110 and port A is reconnected to the node, the listening state of port A is updated to true, so that the second tool 121 listens again to whether port A receives the request message.

[0094] S205 . The first tool 111 parses the response message to obtain the identifier of the corresponding physical switch 120 , the identifier of the first port, and the configuration information of the first port.

[0095] In one possible implementation, while the first tool 111 obtains the identifier of the corresponding physical switch 120, the identifier of the first port, and the configuration information of the first port, it can also obtain the MAC address of the network card used by the node 110 to connect to the physical switch 120 (first port), so as to facilitate the subsequent storage of the connection relationship (correspondence relationship) between the network card and the physical switch, and the connection relationship (correspondence relationship) between the network card and the port.

[0096] Specifically, the first tool 111 parses the response message to obtain the MAC address of the network card of the node 110 , or the first tool 111 directly obtains the MAC address of the network card of the node 110 . The first tool 111 knows the network card connected to the first port of the physical switch 120 .

[0097] S206 . The first tool 111 stores the identifier of the physical switch 120 , the identifier of the first port, and the configuration information of the first port in the database 112 .

[0098] In a possible implementation, the first tool 111 stores the identifier of the physical switch 120 , the identifier of the first port, and the configuration information of the first port in the database 112 through an HTTP request.

[0099] Among them, HTTP request (Hypertext Transfer Protocol Request) is a way of communication between a client (for example: the first tool 111, the first tool 111 is essentially a software application) and a node, and is used to transmit information, request files or services.

[0100] In one possible implementation, the first tool 111 encapsulates the identifier of the physical switch 120, the identifier of the first port, and the configuration information of the first port into an HTTP request, and the HTTP request is then encapsulated into an IP data packet and transmitted to the database 112; the database 112 processes the HTTP request and stores the information therein in the database 112.

[0101] Furthermore, in a possible implementation, the information in the database 112 may be transmitted to the front end through the back end interface and displayed in the application layer, that is, the information in the database 112 may be displayed to the user through the front end application.

[0102] The backend usually refers to the software module running on the server, which is responsible for processing data, executing business logic, and interacting with the database. The backend interface refers to the interface (Application Programming Interface, API) provided by the backend service for communicating with the front-end application, other back-end servers, or external systems.

[0103] The front end can also be called the client, which is a platform that interacts with the back end server and is mainly responsible for receiving user input, displaying data, and communicating with the back end. For example, the front end can be a management platform for hyper-converged management software, a management platform for an out-of-band management controller BMC, etc.

[0104] Specifically, the information stored in the database 112 of the node 110 is transmitted to the front end through the back end interface, and the front end application displays the node 110 (or the network card of the node 110) and the data stored in the database 112 of the node 110 to the user in a corresponding manner, that is, the client displays the physical switch information connected to the node 110 on its display interface. In this way, in the SDN architecture, the application layer can obtain the relevant information of the corresponding physical switch, so that the user can accurately obtain the relevant information of the physical switch corresponding to the node network port.

[0105] In the current technology, since the user cannot obtain the relevant information of the physical switch corresponding to the node (host) network card, it is necessary to rely on the traditional method to troubleshoot the physical switch, which makes the troubleshooting process complicated, consumes a lot of human resources, and is difficult and inefficient, and even cannot guarantee the accuracy of the troubleshooting of the physical switch. In the embodiment of the present application, the user can directly troubleshoot the physical switch through the displayed relevant information of the physical switch, which simplifies the troubleshooting process of the physical switch, thereby reducing the difficulty of troubleshooting the physical switch, improving the efficiency of troubleshooting, and ensuring the accuracy of the troubleshooting of the physical switch to a certain extent.

[0106] For ease of understanding, the following Figure 5 , this article gives an example of how to display relevant information about a physical switch to the user.

[0107] like Figure 5 As shown in (a) of FIG. 1 , the display screen of the front-end device provides a query interface 510 to the user. Exemplarily, the query interface 510 includes a queryable node list 511 and a query button 512. The user can control the cursor by a mouse or other peripheral device to select the node to be queried in the node list 511. For example, the user controls the cursor by a mouse to select the node H1. After the node is selected, the user controls the cursor by a mouse or other peripheral device to click the query button 512, and the display screen displays the relevant information display interface 520 (such as Figure 5 , as shown in (b) in the figure).

[0108] like Figure 5 As shown in (b), the related information display interface 520 displays the identifier of the physical switch connected to the node H1: physical switch IP521, the identifier of the first port (i.e., the port where the physical switch IP521 is connected to the node H1): port number 522, and the configuration information of the first port: the configuration information of the port corresponding to the port number 522, for example: protocol configuration, port aggregation settings, routing information, etc.

[0109] Furthermore, in a possible implementation, the application layer can obtain relevant information of multiple nodes and physical switches corresponding to the multiple nodes, so as to clarify the corresponding relationship between the nodes and the physical switches, for example: the nodes and the physical switches are one-to-many, many-to-one, or many-to-many, etc. Furthermore, according to the corresponding relationship between the nodes and the physical switches, the corresponding network topology diagram can be drawn and displayed, and the user can intuitively perceive the corresponding relationship between the nodes and the switches according to the network topology diagram.

[0110] The embodiment of the present application is through the interaction between the first tool mounted on the node and the second tool mounted on the physical switch, that is, the first tool sends a request message to the physical switch, requesting to obtain the relevant information of the physical switch; the second tool obtains the relevant information of the physical switch based on the received request message, and encapsulates it into a response message and returns it to the node, and the node stores the relevant information of the physical switch carried by the response message in the database, so as to transmit the relevant information of the physical switch stored in the database of the node to the front end through the back-end interface, so that the client displays the information of the physical switch connected to the node on its display interface. Thus, in the software-defined network architecture, the application layer displays the relevant information of the node network card and the physical switch connected to it (for example: the identification of the physical switch, the identification of the first port, the configuration information of the first port), that is, the application layer can obtain the relevant information of the corresponding physical switch, that is, the user can accurately obtain the relevant information of the physical switch corresponding to the node network port.

[0111] Furthermore, the front-end device can directly display relevant information of the physical switch corresponding to the node, especially the configuration information of the port connecting the physical switch to the node. The user can directly troubleshoot the physical switch through the displayed relevant information of the physical switch, which simplifies the troubleshooting process of the physical switch, thereby reducing the difficulty of troubleshooting the physical switch, improving the efficiency of troubleshooting, and ensuring the accuracy of troubleshooting the physical switch to a certain extent.

[0112] In the above Figure 2-Figure 5 In the method shown, the steps are described by taking the case where the first tool 111 of the node 110 sends a request message in a first preset format to the physical switch 120, and the protocol type in the request message in the first preset format is the first protocol type. Figure 6 , a detailed description is given of how the second tool 121 in the physical switch 120 implements a method for obtaining physical switch information provided in an embodiment of the present application.

[0113] like Figure 6As shown, a method for obtaining physical switch information provided in an embodiment of the present application is applied to a second tool 121 mounted in a physical switch 120, and the method includes the following steps:

[0114] S601 . Monitor all ports of the physical switch 120 .

[0115] S602: When monitoring that the second port of the physical switch 120 receives a message, check whether the operation type of the message is the first operation type.

[0116] Specifically, at this time, the monitoring state of the second port is true.

[0117] The second port is a port of the physical switch 120 connected to the node. The node may be the node 110 or another node.

[0118] It should be noted that the second port of the physical switch 120 in the second embodiment may be the first port in the first embodiment, or may be other ports of the physical switch 120 , which is determined according to actual monitoring conditions and is not specifically limited in this application.

[0119] When it is verified that the operation type of the message is the first operation type, it is determined that the message is a request message sent by the first tool of the node, and S603 is performed;

[0120] When it is checked that the operation type of the message is not the first operation type, it is determined that the message is not a request message sent by the first tool of the node, and no processing is performed.

[0121] S603 . Obtain relevant information of the corresponding physical switch 120 based on the protocol type of the request message.

[0122] When the protocol type of the request message is the first protocol type, identification information of the physical switch 120 , identification information of the second port, and configuration information of the second port are acquired.

[0123] When the protocol type of the request message is the second protocol type, identification information of the physical switch 120 and identification information of the second port are obtained.

[0124] When the protocol type of the request message is the third protocol type, only the identification information of the physical switch 120 is obtained.

[0125] The identification information of the physical switch 120 may be a MAC address (Media Access Control Address), an IP address, a serial number (SN), etc. of the physical switch 120. The identification information of the physical switch 120 plays an important role in the monitoring and troubleshooting of the physical switch. That is, when a problem is detected in the physical switch 120, the user can quickly locate and solve the problem based on the identification information of the physical switch 120.

[0126] The identification information of the second port may be the port number of the second port, etc. When a problem is detected with the second port later, the user can quickly locate the problem based on the identification information of the second port; further, the configuration information of the second port may be obtained based on the identification information of the second port, so as to quickly diagnose and solve possible problems according to the configuration information of the second port.

[0127] S604: Encapsulate the relevant information of the corresponding physical switch 120 into a response message in a second preset format, and send it to the sender of the request message through the second port.

[0128] Specifically, after the corresponding message in the second preset format is sent to the sender of the request message through the second port, the monitoring state of the second port is updated to false.

[0129] Further, after the request message is sent and the response message is received, the first tool mounted on the sender of the request message stores the relevant information of the physical switch 120 carried in the response message into the database, so that the application layer can obtain the relevant information of the physical switch 120 corresponding to the sender from the database.

[0130] In addition, the embodiment of the present application further provides a computing device, namely a node, on which a first tool is deployed. The first tool is used to implement the method for obtaining physical switch information in the above embodiment.

[0131] The embodiment of the present application also provides a physical switch, on which a second tool is deployed. The second tool is used to implement the method for obtaining physical switch information in the above embodiment. The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is run on a computer, the computer executes the method for obtaining physical switch information in the above embodiment.

[0132] For the explanation of the relevant contents and description of the beneficial effects of any of the above-mentioned computer-readable storage media, reference may be made to the above-mentioned corresponding embodiments, which will not be repeated here.

[0133] The embodiment of the present application also provides a computer program product including instructions, when the instructions are run on a computer, the computer executes any one of the methods for obtaining physical switch information in the above embodiments. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that may be integrated with one or more available media. The available media may be magnetic media (e.g., floppy disk, hard disk, tape), optical media (e.g., DVD), or semiconductor media (e.g., SSD), etc.

[0134] It should be noted that the above-mentioned devices for storing computer instructions or computer programs provided in the embodiments of the present application, such as but not limited to the above-mentioned memories, computer-readable storage media and communication chips, etc., are all non-transitory.

[0135] Although the present application is described herein in conjunction with various embodiments, in the process of implementing the claimed application, those skilled in the art may understand and implement other changes to the disclosed embodiments by viewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "one" or "an" does not exclude multiple situations. A single processor or other unit may implement several functions listed in the claims. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.

[0136] Although the present application has been described in conjunction with specific features and embodiments thereof, it is obvious that various modifications and combinations may be made thereto without departing from the spirit and scope of the present application. Accordingly, this specification and the drawings are merely exemplary illustrations of the present application as defined by the appended claims, and are deemed to have covered any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, those skilled in the art may make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for obtaining physical switch information, characterized in that: Applied to a node, the method comprises: Sending a request message to the physical switch, wherein the request message is used to request information of the physical switch, so that the physical switch obtains corresponding physical switch information in response to the request message, encapsulates the physical switch information into a response message and returns it to the node; Based on the received response message returned by the physical switch, obtain the physical switch information carried in the response message; The physical switch information carried in the response message is stored in a database, so that the client can display the physical switch information connected to the node on its display interface.

2. The method according to claim 1, characterized in that The request message is a request message in a first preset format; The request message in the first preset format includes at least: a protocol type, a protocol length, an operation type, and a destination address; The protocol type is used to indicate the type of the physical switch information requested by the request message; the type of the physical switch information includes: identification information of the physical switch, identification information of the first port, and configuration information of the first port, where the first port is a port connecting the physical switch to the node; The protocol length is used to indicate the length of information carried in the protocol type; The operation type is a first operation type, and the first operation type is used to indicate that the type of the message is a request message; The destination address is used to represent the MAC address of the network card connecting the node to the physical switch.

3. The method according to claim 2, characterized in that The request message in the first preset format further includes: a destination physical switch identifier, a first port identifier, and first port configuration information, and the destination physical switch identifier, the first port identifier, and the first port configuration information in the request message are all empty.

4. The method according to claim 2, characterized in that: The protocol type includes a first protocol type, a second protocol type and a third protocol type; The first protocol type is used to indicate that the type of the physical switch information requested by the request message includes: identification information of the physical switch, identification information of the first port, and configuration information of the first port; The second protocol type is used to indicate that the type of the physical switch information requested by the request message includes: identification information of the physical switch and identification information of the first port; The third protocol type is used to indicate that the type of the physical switch information requested by the request message includes: identification information of the physical switch.

5. The method according to claim 1, characterized in that The node can monitor whether the node is successfully connected to the physical switch; The sending of a request message to the physical switch includes: When the monitoring node is successfully connected to the physical switch, a request message is sent to the physical switch.

6. A method for obtaining physical switch information, characterized in that: Applied to a physical switch, the method comprises: receiving a request message sent by a node connected to the physical switch; the request message is used to request to obtain information of the physical switch; In response to the received request message, obtain corresponding physical switch information; The corresponding physical switch information is encapsulated into a response message, and the response message is returned to the node, so that the node obtains the corresponding physical switch information carried by the response message based on the response message, and stores the physical switch information in its own database, so that the client can display the physical switch information connected to the node on its display interface.

7. The method according to claim 6, characterized in that The request message carries a protocol type, and the protocol type includes a first protocol type, a second protocol type, and a third protocol type; The step of obtaining corresponding physical switch information in response to the received request message includes: Based on the protocol type in the request message being the first protocol type, acquiring identification information of the physical switch, identification information of the second port, and configuration information of the second port; wherein the second port is a port through which the physical switch is connected to the node; Based on the protocol type in the request message being the second protocol type, acquiring identification information of the physical switch and identification information of the second port; Based on the protocol type in the request message being the third protocol type, identification information of the physical switch is acquired.

8. The method according to claim 6, characterized in that The physical switch monitors all its ports, and the ports are set with two monitoring states, namely a first monitoring state and a second monitoring state; When the monitoring state of the port of the physical switch is the first monitoring state, the physical switch monitors whether the port receives a request message sent by the node; When the monitoring state of the port of the physical switch is the second monitoring state, the physical switch no longer monitors whether the port receives the request message sent by the node.

9. The method according to claim 8, characterized in that Before receiving the request message sent by the node connected to the physical switch, the method further includes: When it is determined that the node is successfully connected to the physical switch, the monitoring state of the first port is set to the first monitoring state, so that the physical switch monitors whether the first port receives the request message sent by the node; wherein the first port is the port connecting the physical switch to the node; After returning the response message to the node, the method further includes: The listening state of the first port is updated to a second listening state.

10. A computing device, characterized in that: The computing device is deployed with a first tool; The first tool is used to implement the method according to any one of claims 1 to 5.

11. A physical switch, characterized in that: The physical switch is deployed with a second tool; The second tool is used to implement the method according to any one of claims 6 to 9.

Citation Information

Patent Citations

  • Method for collecting exchange information, collecting units and system

    CN104539448A

  • SAN switch monitoring system and method

    CN105208079A

  • Method and device for acquiring information of node equipment, equipment, and storage medium

    CN109510717A

  • Intelligent management switch address query method, electronic equipment and storage medium

    CN117692430A

Cited By

  • Secret-related switch port communication processing method and device, secret-related switch and system

    CN119996077A