Network topology discovery method, device, storage medium and program product
Patent Information
- Application Number
- CN202510421311.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-04
- Publication Date
- 2026-10-16
AI Technical Summary
[0009] This application also provides a computer program product, including a computer program/instructions, which, when executed by a processor, cause the processor to implement the steps in the network topology discovery method provided in this application.
Smart Images

Figure CN122933438A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of cloud computing technology, and in particular to a network topology discovery method, device, storage medium, and program product. Background Technology
[0002] With the rapid development of Software Defined Networking (SDN), numerous SDN networks have emerged, such as Virtual Private Cloud (VPC), VPC Peering, and Cloud Enterprise Network (CEN).
[0003] These SDN networks include components with forwarding capabilities (referred to as forwarding components). Forwarding components within the same SDN network can be used in various combinations (referred to as networking), which can meet the diverse networking needs of users within the same SDN network. Furthermore, the forwarding components between these SDN networks can also be flexibly combined to further meet users' cross-network networking needs.
[0004] Within the same SDN network or between SDN networks, different networking methods among forwarding components may result in varying network performance and functionality. In practical applications, a suitable networking method can be selected from the possible methods based on performance and functionality. However, comprehensively identifying all possible networking methods within the same SDN network and even between SDN networks is fundamental for on-demand secure use. Summary of the Invention
[0005] This application provides a network topology discovery method, device, storage medium, and program product for comprehensively discovering network topologies between SDN networks.
[0006] This application provides a network topology discovery method, comprising: determining a software-defined network and multiple forwarding components and endpoint devices included in the software-defined network; constructing forwarding input atomic information and forwarding output atomic information for each of the multiple forwarding components based on the input packet types and output packet types supported by the multiple forwarding components; performing topology role marking processing on the multiple forwarding components and endpoint devices to obtain at least one source node, at least one destination node, and at least one relay node; and recursively generating network topologies between at least one destination node and at least one relay node, starting from at least one source node, based on the forwarding input atomic information and forwarding output atomic information of each of the multiple forwarding components, to obtain multiple network topologies in the software-defined network.
[0007] This application also provides an electronic device, including: a memory and a processor; the memory for storing a computer program; and the processor, coupled to the memory, for executing the computer program to implement the steps in the network topology discovery method provided in this application.
[0008] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to implement the steps in the network topology discovery method provided in this application.
[0009] This application also provides a computer program product, including a computer program / instructions, which, when executed by a processor, cause the processor to implement the steps in the network topology discovery method provided in this application.
[0010] In this embodiment, forwarding input atomic information and forwarding output atomic information are constructed for multiple forwarding components included in a Software-Defined Network (SDN). Topology roles are labeled for the forwarding components and endpoint devices in the SDN network. Based on the forwarding input atomic information, forwarding output atomic information, and topology roles of the forwarding components, modeling is performed to better understand the network architecture composed of multiple forwarding components and endpoint devices. Based on this modeling, multiple network topologies in the SDN network are automatically and recursively generated, comprehensively discovering the networking patterns existing between multiple forwarding components and endpoint devices. Furthermore, discovering the network topology lays the foundation for subsequent coupling testing, technical support, and service optimization, enabling the provision of higher-quality services to users. Attached Figure Description
[0011] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0012] Figure 1 A flowchart illustrating a network topology discovery method provided for an exemplary embodiment of this application;
[0013] Figure 2 A flowchart illustrating another network topology discovery method provided for an exemplary embodiment of this application;
[0014] Figure 3 A schematic diagram of the structure of a network topology discovery device provided as an exemplary embodiment of this application;
[0015] Figure 4 This is a schematic diagram of the structure of an electronic device provided as an exemplary embodiment of this application. Detailed Implementation
[0016] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0017] It should be noted that, in the cases involving user information in the embodiments of this application, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0018] Currently, the flexible combination of different forwarding components can meet the diverse networking needs of users, but it also brings some challenges. The following is an example illustrating the challenges encountered.
[0019] For example, in testing scenarios, the testing of forwarding components mainly focuses on end-to-end (E2E) testing of a single forwarding component. It's impossible to perform coupled testing on network topologies composed of multiple forwarding components. However, in real-world user applications, multiple forwarding components are typically used in combination, which necessitates coupled testing of the network topology across these components. Currently, from an SDN network perspective, there's a lack of methods for discovering network topologies, making it impossible to perform targeted coupled testing on network topologies.
[0020] For example, users can combine different forwarding components from different SDN networks to create new network topologies based on their service needs. These new topologies may contain flaws, and because SDN networks cannot predict new topologies in advance, they cannot determine whether a new topology is flawed, nor can they provide technical support or service optimization for it.
[0021] To address the aforementioned technical challenge of discovering network topology, this application embodiment constructs forwarding input atomic information and forwarding output atomic information for multiple forwarding components included in a Software-Defined Network (SDN). Topology roles are assigned to the forwarding components and endpoint devices within the SDN network. Based on the forwarding input atomic information, forwarding output atomic information, and topology roles of the forwarding components, a model is constructed to better understand the network architecture composed of multiple forwarding components and endpoint devices. Based on this modeling, multiple network topologies in the SDN network are automatically and recursively generated, comprehensively discovering the networking patterns existing between multiple forwarding components and endpoint devices. Furthermore, discovering the network topology lays the foundation for subsequent coupling testing, technical support, and service optimization, enabling the provision of higher-quality services to users.
[0022] The following describes in detail a solution provided by an embodiment of this application, with reference to the accompanying drawings.
[0023] Figure 1 This is a flowchart illustrating a network topology discovery method provided as an exemplary embodiment of this application. Figure 1 As shown, the method includes:
[0024] 101. Identify the software-defined network and the multiple forwarding components and at least two endpoint devices included in the software-defined network.
[0025] 102. Based on the input and output message types supported by multiple forwarding components, construct the forwarding input atomic information and forwarding output atomic information for each of the multiple forwarding components.
[0026] 103. Perform topology role marking on multiple forwarding components and endpoint devices to obtain at least one source node, at least one destination node, and at least one relay node.
[0027] 104. Based on the forwarding input atomic information and forwarding output atomic information of each of the multiple forwarding components, starting from at least one source node, recursively generate the network topology between at least one target node and at least one relay node to obtain multiple network topologies in the software-defined network.
[0028] In this embodiment, the software-defined network (SDN) is an SDN network designed and implemented based on a software-defined network architecture. By separating the network's control plane and data plane, and using a centralized control plane as the core, combined with distributed forwarding components and endpoint devices, SDN enables flexible scheduling, efficient management, and rapid response of network resources. This product not only improves network scalability and agility but also provides enterprises and service providers with more powerful network service capabilities, suitable for various scenarios such as cloud computing, data centers, wide area networks (WANs), and the Internet of Things (IoT). For example, SDN can include, but is not limited to, virtual private networks (VPNs), VPC peering connections, and cloud-based enterprise networks.
[0029] Software-defined networking (SDN) comprises multiple network nodes. A network node is a physical or logical entity that performs a specific function within the network. Network nodes can collaborate to complete data transmission, processing, forwarding, or control tasks. Network nodes can be hardware devices (such as gateways, routers, and switches) or software modules (such as virtual routers).
[0030] For example, network nodes can include, but are not limited to, forwarding components and endpoint devices. Forwarding components, also known as SDN forwarding components, are physical or logical entities in an SDN network responsible for receiving, processing, and forwarding data packets. They are a core component of the network architecture, responsible for forwarding data packets and ensuring efficient and reliable data transmission through operations such as routing, traffic scheduling, and protocol conversion. Forwarding components can include, but are not limited to, leased gateways, transit routers (TRs), and NAT gateways.
[0031] In this context, endpoint devices refer to physical or virtual entities that provide computing resources, storage resources, or application services within an SDN network. In an SDN network, endpoint devices are responsible for generating or consuming network traffic. In this embodiment, to automatically identify potential available network topology information in an SDN network, forwarding components and endpoint devices in the SDN network are modeled. The model represents the possible combinations between various forwarding components and endpoint devices, thereby exhaustively generating partial or complete network topologies that exist between multiple forwarding components and endpoint devices.
[0032] The modeling method is not limited. For example, forwarding input atomic capabilities and forwarding output atomic information are constructed for multiple forwarding components, and topological roles are defined for forwarding components and endpoint devices. Based on the forwarding input atomic capabilities and forwarding output atomic information of multiple forwarding components, as well as the topological roles of forwarding components and endpoint devices, modeling is performed, and based on the modeling results, the network topology in the SDN network is discovered. The following section provides a detailed introduction to the modeling and network topology generation process.
[0033] In this embodiment, the forwarding component maintains message types. From the perspective of the Open Systems Interconnection Model (OSI), the network protocol information supported by the forwarding component can include, but is not limited to, network layer protocols, transport layer protocols, data link layer protocols, and physical layer protocols. For example, message types include input message types and output message types. Input message types represent the message protocol formats that the forwarding component can receive, and output message types represent the message protocol formats that the forwarding component can generate. Input message types include, but are not limited to, Internet Protocol version 4 (IPv4), Internet Protocol version 6 (IPv6), Ethernet, Virtual eXtensible Local Area Network (VXLAN), and General Routing Encapsulation Protocol (GRP). Output message types can be the same as input message types, or they can be different, depending on the function of the forwarding component. For example, if the forwarding component's function is native protocol forwarding, then the input and output message types are the same. For example, if the forwarding component's function is protocol conversion, then the input and output packet types will be different. For instance, if the input packet type of the forwarding component is IPv4_in, after address translation, the output packet type will be IPv6_out. As another example, if the forwarding component's function is tunnel encapsulation or decapsulation, for instance, if the input packet type of the forwarding component is IPv4_in, after encapsulation by the forwarding component, the output packet type will be vxlan_out (VXLAN encapsulation). Similarly, if the input packet type of the forwarding component is vxlan_in, after decapsulation by the forwarding component, the output packet type will be IPv4_out.
[0034] From the perspective of function, purpose and technical implementation, message types can include, but are not limited to: underlying network protocols or upper-layer virtual network protocols. Underlying network protocols are used to provide the infrastructure of the underlying physical network, such as the basic physical connection and data transmission channel between hardware devices such as routers and switches. Underlying network protocol information mainly describes the communication method and configuration of the underlying network. Underlying network protocol information can include, but is not limited to: Internet Protocol version 4 (IPv4), Internet Protocol version 6 (IPv6), Ethernet protocol and routing protocol, etc. Upper-layer virtual network protocols describe the virtual network built on top of the physical network. Upper-layer virtual networks can include, but are not limited to: VXLAN, etc. Among them, virtual extended LAN includes at least one subtype. Different subtypes may be optimizations, improvements or enhancements of standard VXLAN functions, or simplifications of standard VXLAN functions, etc., which are not limited. For example, the subtype of virtual extended LAN can be represented as: std_vxlan, 0_vxlan or VXLAN(1), etc.
[0035] In this embodiment, forwarding input atomic information and forwarding output atomic information for multiple forwarding components can be constructed based on the input and output packet types supported by these components. Atomic information is the basic functional unit of a forwarding component, describing its protocol support capabilities in both the input and output directions. For example, forwarding input atomic information describes how the forwarding component receives external packets, while forwarding output atomic information describes how it forwards the packets processed by itself. Forwarding input atomic information indicates the packet types that the forwarding component can receive, and forwarding output atomic information indicates the packet types that the forwarding component can generate. When generating a network topology, forwarding input atomic information and forwarding output atomic information can verify the feasibility of a path. Forwarding atomic information can be represented as: the protocol name supported by the forwarding component, combined with one or more combinations of letters, characters, and symbols.
[0036] For example, forwarding atomic information can be represented as: ipv4_in_0_vxlan, ipv4_in_std_vxlan, ipv6_in_std_vxlan, ipv6_in_0_vxlan, ipv6_underlay, and ipv4_underlay. Among these, ipv4_in_0_vxlan indicates that the upper-layer network protocol is VXLAN and the upper-layer network protocol (lay) is IPv4; ipv6_underlay indicates that the underlying physical network uses the IPv6 protocol. For the meanings of other network protocols, please refer to the preceding text, which will not be repeated here.
[0037] In this embodiment, topology roles refer to the different responsibilities or roles assigned to forwarding components and endpoint devices within the network topology, based on their functions and positions in the network data flow. Topology roles describe the specific functions of forwarding components and endpoint devices during data transmission, typically including source nodes, relay nodes, and destination nodes. The source node is the starting point of the traffic and is responsible for generating data; the relay node is responsible for forwarding data and is an intermediate point on the traffic transmission path; the destination node is the endpoint of the traffic and is responsible for receiving and processing data. All three work together to complete end-to-end data transmission, ensuring that data can be transmitted efficiently and reliably from the starting point to the destination.
[0038] In this embodiment, topology roles can be marked for multiple forwarding components and at least two endpoint devices to obtain at least one source node, at least one destination node, and at least one relay node. In some application scenarios, topology roles may change dynamically. For example, an endpoint device may act as a source node in one scenario and as a destination node in another. Similarly, a network forwarding component may act as a source node in one application scenario and as a relay node in another. Furthermore, in bidirectional communication, the roles of source and destination nodes may interchange. For instance, an endpoint device may be a source node when sending a request and become a destination node when receiving a response.
[0039] Among them, modeling can be carried out based on the topology roles, forwarding input atomic information and forwarding output atomic information corresponding to multiple forwarding components and endpoint devices. The model includes at least one source node, at least one target node and at least one relay node. The modeling process is the process of generating the network topology that exists between at least one source node, at least one target node and at least one relay node.
[0040] Based on this, multiple network topologies in a software-defined network can be recursively generated, starting from at least one source node and passing through at least one target node and at least one relay node, according to the forwarding input atomic information and the forwarding output atomic information.
[0041] In the network topology generation scenario, recursive generation automatically generates a network topology that meets the requirements by progressively expanding path or node connections and based on forwarding input atomic information and forwarding output atomic information. Multiple network topologies can meet the requirements; these can be a subset or all of the existing network topologies in the SDN, depending on the topology discovery needs. This involves the adaptation of forwarding input atomic information and forwarding output atomic information between multiple forwarding components. For example, for ease of distinction and description, forwarding components and endpoint devices are referred to as nodes. Nodes A1, A2, and A3 are connected sequentially. Adaptation of forwarding input atomic information and forwarding output atomic information between nodes A1 and A2 indicates that the data output by node A1 can be processed as input data for node A2. Similarly, adaptation of forwarding atomic information between nodes A2 and A3 indicates that the output data of node A2 can be used as input data for node A3.
[0042] In this embodiment, each network topology may include a source node, a target node, and at least one relay node.
[0043] The following is an example of a network topology:
[0044] Virtual machine + virtual switch -- ipv4_in_a_vxlan --> VPC gateway -- ipv4_in_a_vxlan --> load balancing gateway -- ipv4_underlay --> classic_server.
[0045] in:
[0046] Virtual Machine + Virtual Switch -- ipv4_in_a_vxlan --> VPC Gateway: This indicates that the source node "Virtual Machine + Virtual Switch" outputs packet B1, which is then sent to the relay node VPC gateway. Packet B1 is ipv4_in_a_vxlan, meaning the packet is encapsulated using both VXLAN and IPv4.
[0047] VPC Gateway -- ipv4_in_a_vxlan --> Load Balancing Gateway: This indicates that the relay node VPC gateway processes packet B1 to generate packet B2, and then provides packet B2 to the relay node load balancing gateway. Packet B2 is: ipv4_in_a_vxlan.
[0048] Load balancing gateway -- ipv4_underlay --> classic_server: This means that the relay node load balancing gateway processes packet B2, obtains packet B3, and outputs packet B3 to the target node classic_server. The topology terminates when the target node appears. Packet B3 is ipv4_underlay, indicating that packet 3 is encapsulated using IPv4 technology in the underlying network.
[0049] Since this network topology includes a load balancing gateway, which can distribute incoming network requests to multiple backend servers based on different algorithms (such as round-robin, least connections, etc.), the analysis indicates that this network topology involves a Server Load Balancer (SLB) scenario, with the backends being physical machines. Subsequent end-to-end testing can cover this network topology by adding application programming interface (API) parameters such as the protocols used by the SLB. The protocols used by the SLB can include, but are not limited to, Transmission Control Protocol (TCP), User Datagram Protocol (UDP), and Internet Control Message Protocol (ICMP). Another exemplary network topology is provided as follows: Virtual Machine + Virtual Switch -- ipv6_in_a_vxlan --> VPC Gateway -- ipv6_in_ali_vxlan --> Load Balancing Gateway -- ipv4_underlay --> classic_server.
[0050] This demonstrates a path using the ipv6_in_a_vxlan packet type. The packet first originates from the virtual machine + virtual switch (source node), passes through the relay node VPC gateway and the relay node load balancer gateway, and finally reaches the target node classic_server. During this process, the packet type changes from IPv6 to IPv4 after the load balancer gateway.
[0051] In this embodiment, forwarding input atomic information and forwarding output atomic information are constructed for multiple forwarding components included in a Software-Defined Network (SDN). Topology roles are labeled for the forwarding components and endpoint devices in the SDN network. Based on the forwarding input atomic information, forwarding output atomic information, and topology roles of the forwarding components, modeling is performed to better understand the network architecture composed of multiple forwarding components and endpoint devices. Based on this modeling, multiple network topologies in the SDN network are automatically and recursively generated, comprehensively discovering the networking patterns existing between multiple forwarding components and endpoint devices. Furthermore, discovering the network topology lays the foundation for subsequent coupling testing, technical support, and service optimization, enabling the provision of higher-quality services to users.
[0052] In one optional embodiment, network topology constraints are pre-defined, which are restrictions or requirements imposed on the behavior, performance, and connectivity of forwarding components. These constraints can be derived from expert experience, service requirements, technical limitations, resource availability, and network management strategies, ensuring that the SDN network meets specific functional, performance, and security objectives. Network topology constraints can filter out unreasonable network topologies, resulting in a usable network topology.
[0053] Based on this, an implementation method for obtaining multiple network topologies in a software-defined network by recursively generating network topologies between at least one target node and at least one relay node, starting from at least one source node and based on the forwarding input atomic information and forwarding output atomic information of each of multiple forwarding components, includes: recursively generating network topologies between at least one target node and at least one relay node, starting from at least one source node and based on set network topology constraints and combining the forwarding input atomic information and forwarding output atomic information of each of multiple forwarding components, to obtain multiple network topologies in a software-defined network.
[0054] In the network topology generation scenario, recursive generation automatically generates a network topology that meets the requirements by progressively expanding path or node connections, based on network topology constraints, forwarding input atomic information, and forwarding output atomic information. Each network topology existing between multiple forwarding components and endpoint devices satisfies the network topology constraints, and the forwarding input atomic information and forwarding output atomic information between forwarding components are compatible.
[0055] Optionally, based on the set network topology constraints and combining the forwarding input atomic information and forwarding output atomic information of each of the multiple forwarding components, a network topology is recursively generated from at least one source node to at least one target node and at least one relay node to obtain multiple network topologies in the software-defined network. The implementation method is not limited. An example is given below: a source node is selected from at least one source node; starting from the selected source node, based on the forwarding input atomic information and forwarding output atomic information of each of the multiple forwarding components, a next-hop node that meets the network topology constraints is recursively searched from at least one target node and at least one relay node; if the next-hop node is a target node, a network topology from the selected source node to the target node is obtained.
[0056] The method of selecting source nodes from at least one source node is not limited. For example, a source node can be selected one at a time from at least one source node, and network topology can be generated for the selected source node until a set number of source nodes are selected for network topology generation. The set number can be the total number of source nodes or a subset of source nodes, and is not limited thereto. The implementation method of selecting a source node one at a time from at least one source node is also not limited. For example, a source node can be randomly selected from at least one source node each time. Another example is selecting source nodes whose load is higher than a set load threshold, or whose response time is lower than a set time threshold, from at least one source node; this is not limited thereto.
[0057] The recursive search process is not limited. For example, starting a recursive branch from the selected source node, and taking the selected source node as the current node, for the current node, based on the forwarding atomic information, search for a next-hop node that meets the network topology constraints from at least one target node and at least one relay node. The number of next-hop nodes that meet the network topology constraints can be one or more.
[0058] For the next-hop node of the current node, determine whether the next-hop node is the target node. If the next-hop node is the target node, the path from the selected source node to the target node is taken as a network topology, and other next-hop nodes are checked to see if they are target nodes. If the next-hop node is a relay node, the next-hop node is taken as the current node, a new recursive branch is started, and the search for the next-hop node continues.
[0059] If no next-hop node satisfying the network topology constraints is found for the current node, the recursive branch of the current node is terminated, and the recursive call to the previous hop node is backtracked to attempt recursion for possible next-hop nodes of that previous hop node. The recursive process ends when all possible paths have been attempted or a pre-defined termination condition is met. Termination conditions may include, but are not limited to, reaching a set recursion time, reaching a set number of recursions, or resource limitations such as memory usage or processor time.
[0060] By matching forwarding atomic information and network topology constraints, usable network topologies can be quickly generated, reducing unnecessary searches and improving efficiency. Recursively searching for next-hop nodes that meet the network topology constraints allows for rapid location of compatible next-hop nodes, avoiding blind searches of all paths and effectively reducing the time and computational resources required to find topology paths. Furthermore, during the recursive process, each node's adjacent nodes are checked one by one to ensure they meet the network topology constraints, guaranteeing no potential next-hop nodes are missed and identifying all network topologies that meet the constraints, thus avoiding omissions.
[0061] Optionally, the implementation of recursively searching for a next-hop node that meets the network topology constraints from at least one target node and at least one relay node, starting from the selected source node, based on the forwarding input atomic information and forwarding output atomic information of each of the multiple forwarding components, is not limited. In the following example, for ease of description, the forwarding input atomic information and the forwarding output atomic information are collectively referred to as forwarding atomic information.
[0062] In one example, during the recursive search, the node to be searched for the next hop is taken as the current node. The forwarding atomic information of the current node is matched with the forwarding atomic information of at least one target node and at least one relay node. It is determined whether the matched nodes meet the network topology constraints. The matched nodes that meet the network topology constraints are taken as the next hop nodes. Alternatively, for the current node, an intermediate node that meets the network topology constraints is found from at least one target node and at least one relay node. It is determined whether the forwarding atomic information of the intermediate node matches the forwarding atomic information of the current node. The intermediate node that matches the forwarding atomic information of the current node is taken as the next hop node of the current node.
[0063] Another example is that network topology constraints include connection constraint information for a specific relay node. The connection constraint information includes at least one of the following: information defining the previous hop node of the specific relay node, and information defining the next hop node of the specific relay node, etc. The specific relay node is some or all of at least one relay node. An exemplary description follows.
[0064] For example, a specific trunk node might be a virtual switch, and the upstream node of that virtual switch might be another virtual switch or gateway. Gateways can include, but are not limited to, VPC gateways, NAT gateways, and leased line gateways. Another example is a proxy node whose upstream node is a virtual switch. Yet another example is a leased line gateway whose upstream or next-hop node is a hardware switch (HSW). Yet another example is an HSW whose upstream node is a leased line gateway and whose next-hop node is an Internet Data Center (IDC), or vice versa.
[0065] Based on the above-described implementation method of recursively searching for a next-hop node that meets network topology constraints from at least one target node and at least one relay node, starting from a selected source node and according to forwarding input atomic information and forwarding output atomic information, the method includes: starting from a selected source node, recursively searching for a next-hop node from at least one target node and at least one relay node according to forwarding input atomic information, forwarding output atomic information and connection constraint information of a specific relay node.
[0066] For example, during the recursive search process, the node to be searched for the next hop is taken as the current node. The forwarding atomic information of the current node is matched with the forwarding atomic information of at least one target node and at least one relay node. It is determined whether the matched node is a specific relay node. If so, it is determined whether the current node satisfies the connection constraint information of the specific relay node. If it does, the specific relay node in the match is taken as the next hop node of the current node. If the current node does not satisfy the connection constraint information of the specific relay node, it is determined that the specific relay node cannot be taken as the next hop node of the current node.
[0067] The recursive search process can be found in the aforementioned embodiments. In this optional embodiment, in addition to recursively searching for the next-hop node from at least one relay node and the target node based on forwarding atomic information, the connection constraint information of a specific relay node is also considered, which can more accurately generate a network topology that meets the network topology constraints. Furthermore, the connection constraint information of a specific relay node can flexibly generate the network topology.
[0068] Further optionally, the implementation of recursively searching for the next-hop node from at least one target node and at least one relay node, starting from the selected source node, based on the forwarding input atomic information, the forwarding output atomic information, and the connection constraint information of a specific relay node, is not limited. An exemplary implementation is provided below.
[0069] In addition to connection constraints for specific relay nodes, network topology constraints also include: a maximum network hop count and the packet processing capabilities required for next-hop nodes. The maximum network hop count refers to the upper limit on the number of relay nodes between the source and destination nodes. That is, the number of relay nodes between the source and destination nodes can be less than or equal to this upper limit. The upper limit is not fixed; for example, it can be 6, 8, or 10, etc.
[0070] The packet processing capabilities of a next-hop node can include, but are not limited to, network address translation (NAT), high-speed forwarding, load balancing, error detection and correction, access control, and encryption / decryption. For example, a next-hop node's packet processing capability could be the ability to communicate between a private network and the external public internet. Since private networks typically use private IP addresses, these need to be translated into public IP addresses to access the internet. For instance, in an IPv4 environment, this translation can be achieved through VPC gateways, NAT gateways, and virtual switches. A VPC gateway is a key component connecting a VPC to the internet, allowing resources within the VPC to access the internet via public IP addresses and receive requests from the internet. A NAT gateway allows instances in a private subnet to securely access the internet. Virtual switches can perform complex load balancing and traffic management tasks, allowing specific types of traffic to be forwarded to the internet, especially in scenarios requiring high-level traffic control and optimization. Similarly, in an IPv6 environment, a VPC gateway can be used to connect a VPC to the internet.
[0071] Based on this, an implementation method for recursively searching for a next-hop node from at least one target node and at least one relay node, starting from a selected source node, based on forwarding input atomic information, forwarding output atomic information, and connection constraint information of a specific relay node, includes: starting from a selected source node, recursively searching for a next-hop node from at least one target node and at least one relay node based on forwarding input atomic information, forwarding output atomic information, connection constraint information of a specific relay node, and the packet processing capabilities of the next-hop node, until the recursive search terminates when the number of hops in the network topology reaches any set network hop count; wherein, the number of set network hop counts is one or more, and the set network hop count is less than or equal to the upper limit of the network hop count.
[0072] The detailed implementation of the recursive search can be found in the aforementioned embodiments. In this optional embodiment, the focus is on how to recursively search for the next hop node from at least one target node and at least one relay node during the recursive search process, based on the forwarding input atomic information, forwarding output atomic information, connection constraint information of a specific relay node, and the message processing capabilities of the next hop node.
[0073] For example, in the recursive search process for the current node, a first node can be selected from at least one target node and at least one relay node based on the packet processing capabilities of the current node's next-hop node. This first node must possess the packet processing capabilities of the current node's next-hop node (e.g., converting a private IP address to a public IP address). From the first node, a second node is selected whose forwarding input atomic information matches the forwarding output atomic information corresponding to the current node. If the second node is not a specific relay node, it is selected as the current node's next-hop node. If the second node is a specific relay node, it is determined whether the current node satisfies the second node's connection constraint information. If it does, the second node is selected as the current node's next-hop node; otherwise, it is not allowed.
[0074] By appropriately configuring next-hop nodes with varying packet forwarding capabilities, network resource utilization efficiency can be maximized while ensuring security. When packet processing capabilities are limited to private network access to the public network, potential security threats can be significantly reduced, and the security of the generated network topology can be improved.
[0075] In one optional embodiment, the implementation method for constructing the forwarding input atomic information and forwarding output atomic information of multiple forwarding components based on the input and output message types supported by the multiple forwarding components is not limited. An example is provided below: for any forwarding component, based on the forwarding component's identification information, a supported input message type, and the input transmission direction, one type of input forwarding atomic information corresponding to the forwarding component is generated; based on the forwarding component's identification information, a supported output message type, and the output transmission direction, one type of output forwarding atomic information corresponding to the forwarding component is generated.
[0076] For example, the protocol processing capability of a forwarding component can be broken down into indivisible basic capability units using a triplet format of "identification information + transmission direction + protocol type". This atomic modeling approach can accurately describe the capability boundary of each forwarding component in processing packets at the data plane. For instance, it is possible to iterate through the input packet types of each forwarding component and generate a triplet for each input packet type. Similarly, it is possible to iterate through the output packet types of each forwarding component and generate a triplet for each output packet type. The identification information of the forwarding component may include, but is not limited to, name, function, number, or other descriptive information. The transmission direction includes both input and output transmission directions. The protocol type can be either an input packet type or an output packet type.
[0077] Among them, generating forwarding atomic information based on the input and output message types supported by the forwarding components helps to understand the protocols supported by each forwarding component and determine whether data packets can be successfully transmitted in the network topology.
[0078] For example, the forwarding component is implemented as a VPC gateway. The input packet types supported by the VPC gateway include ipv4_in_0_vxlan and ipv6_in_0_vxlan. Here, "in" indicates the input transmission direction, vxlan is the upper-layer network protocol, and ipv4 is the lower-layer network protocol. "VPC gateway input + ipv4_in_0_vxlan" constitutes a forwarding atomic capability, and "VPC gateway input + ipv6_in_0_vxlan" is also a forwarding atomic capability. The output protocol information supported by the VPC gateway includes ipv4_in_0_vxlan and ipv6_in_0_vxlan. Therefore, "VPC gateway output + ipv4_in_0_vxlan" is a forwarding atomic capability, and "VPC gateway output + ipv6_in_0_vxlan" is also a forwarding atomic capability. Here, 0_vxlan is a packet encapsulation type information; for details, please refer to the aforementioned embodiments, which will not be repeated here.
[0079] In one optional embodiment, the implementation of marking multiple forwarding components and at least two endpoint devices for topology roles to obtain at least one source node, at least one destination node, and at least one relay node is not limited. An example is provided below: for any forwarding component, it is determined whether a virtualization instance is deployed on the physical device carrying the forwarding component. If the forwarding component is implemented as a physical node, and a virtualization instance is deployed on the physical node (the virtualization instance may include, but is not limited to, virtual machines or containers), and the forwarding component can provide data forwarding services to the virtualization instance (i.e., the virtualization instance can provide packets to the forwarding component for external forwarding), then the physical node carrying the forwarding component and the virtualization instance can be considered a source node. In this embodiment, the focus is on the forwarding component; therefore, the topology role of the forwarding component can be marked as a source node.
[0080] If the forwarding component is implemented as a physical node, and no virtualization instance is deployed on the physical node, the forwarding component receives data packets sent from other physical nodes and forwards them outwards. The forwarding component itself is not the source of traffic; therefore, its topology role is marked as a relay node. For endpoint devices, which can act as both traffic generators and receivers, their topology roles can be marked as source and destination nodes, respectively. When an endpoint device sends data outwards, it acts as a source node; when it receives data forwarded from external sources, it acts as a destination node.
[0081] This mechanism dynamically assigns the role (source node or relay node) of the forwarding component in the network by judging the deployment environment of the forwarding component, and defines explicit roles (source node and destination node) for the endpoint device, thereby improving the flexibility of network topology discovery.
[0082] In one optional embodiment, after obtaining multiple network topologies in the software-defined network, considering that some unreasonable network topologies may exist among these topologies, and that these unreasonable topologies are difficult to filter out using network topology constraints, an exclusion list can be used to filter out some unreasonable network topologies, or an allow list can be used to retain reasonable network topologies to prevent the loss of important network topologies. Here, an unreasonable network topology refers to a topology structure that does not meet actual or logical requirements. Unreasonable situations may include, but are not limited to: isolated nodes, prohibited specific node combinations, or specific connection patterns (e.g., loops). The exclusion list may include, but is not limited to: disabled network topologies or topology branches. The allow list includes specific network topologies or topology branches.
[0083] In one alternative embodiment, an exclusion list can be determined, and multiple network topologies can be filtered according to the exclusion list to obtain at least one usable network topology. For example, disabled network topologies or topology branches can be removed from multiple network topologies to obtain at least one usable network topology.
[0084] In another alternative embodiment, an allowable list can be determined, and multiple network topologies can be filtered based on the allowable list to obtain at least one usable network topology. For example, a network topology that includes a specific network topology or a branch of a topology can be selected from multiple network topologies as at least one usable network topology.
[0085] In another alternative embodiment, an exclusion list and an allow list are determined; wherein, in the case of overlap between the exclusion list and the allow list, the allow list has a higher priority than the exclusion list; based on the exclusion list and the allow list, multiple network topologies are filtered to obtain at least one usable network topology.
[0086] For example, first select the network topology to be removed by an exclusion list, then select the reserved network topology, which includes a specific network topology or a branch of the topology, from the network topology to be removed by an allow list, and then select the remaining network topology from multiple network topologies except for the network topology to be removed, as well as the reserved network topology, as at least one available network topology.
[0087] Exclusion lists can effectively filter out unreasonable network topologies. Meanwhile, allow lists ensure that essential services and connections are protected and supported, enhancing the accuracy of network topology discovery.
[0088] Optionally, the method in this application embodiment further includes: testing the connectivity performance of at least one available network topology; and selecting at least one target network topology that meets the requirements from the at least one available network topology based on the test results. When conducting performance testing, it can be clearly specified which network performance indicators are being tested. Network performance indicators may include, but are not limited to, latency, jitter, packet loss rate, and bandwidth. In addition to considering network performance indicators, performance indicators such as cost, scalability, and ease of maintenance can also be considered. Based on the test results, a network topology with high maintainability, high scalability, low cost, and ease of maintenance is selected as at least one target network topology that meets the requirements, and at least one target network topology is provided to the user to improve the user experience.
[0089] In one optional embodiment, based on the forwarding input atomic information and forwarding output atomic information of each of the multiple forwarding components, a recursive generation of network topology is performed, starting from at least one source node and proceeding between at least one target node and at least one relay node, to obtain multiple network topologies in the software-defined network. The implementation method is not limited. For example, a network topology generation script is generated based on the topology roles of multiple forwarding components and at least two endpoint devices, as well as the forwarding input atomic information and forwarding output atomic information of the multiple forwarding components. The network topology generation script is then run to recursively generate network topologies, starting from at least one source node and proceeding between at least one target node and at least one relay node, to obtain multiple network topologies in the software-defined network. For example... Figure 2 The diagram illustrates a method for discovering network topology. While the process of generating the network topology generation script considers network topology constraints, it is not limited to these constraints.
[0090] The process involves running a generated script that recursively generates network paths between at least one source node, at least one destination node, and at least one relay node. This process may involve dynamic path selection algorithms to ensure that set performance standards are met. It can quickly adjust the network topology according to different network environments and requirements, supporting dynamically changing network configurations. By precisely controlling the roles of nodes and path selection, network topology can be generated effectively.
[0091] During script execution, connections can be created between various actual networks. For example, if a network topology exists between the source node and the target node, the execution entity in this embodiment can send network topology creation instructions to each node involved in the network topology, instructing upstream and downstream nodes in the network topology to establish communication connections. A node (forwarding component or endpoint device) can receive the network topology creation instructions, which include the address information of its next-hop node. Based on the address information of the next-hop node, it can send connection information to the next-hop node to establish a connection; and it can also receive connection information sent by the previous-hop node and establish a connection with the previous-hop node based on that connection information.
[0092] Optionally, before establishing a connection, it can be determined whether the connection already exists. If it does not exist, a connection between the nodes is created; if it already exists, the already created response information is returned directly.
[0093] Regarding the embodiments provided in this application Figure 1 The detailed implementation methods and beneficial effects of each step in the method shown have been described in detail in the foregoing embodiments, and will not be elaborated here.
[0094] It should be noted that the execution subject of each step of the method provided in the above embodiments can be the same device, or the method can be executed by different devices. For example, the execution subject of steps 101 to 103 can be device A; or the execution subject of steps 101 and 102 can be device A, and the execution subject of step 103 can be device B; and so on.
[0095] Furthermore, some processes described in the above embodiments and accompanying drawings include multiple operations appearing in a specific order. However, it should be clearly understood that these operations may not be executed in the order they appear herein, or they may be executed in parallel. The operation numbers, such as 101, 102, etc., are merely used to distinguish different operations and do not represent any execution order. Additionally, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel. It should be noted that the descriptions such as "first" and "second" in this document are used to distinguish different messages, devices, modules, etc., and do not represent a sequential order, nor do they limit "first" and "second" to different types.
[0096] Figure 3 A schematic diagram of a network topology discovery device provided as an exemplary embodiment of this application is shown below. Figure 3 As shown, the network topology discovery device includes: a determination module 31, a construction module 32, a marking module 33, and a generation module 34.
[0097] The determination module 31 is used to determine the software-defined network and the multiple forwarding components and at least two endpoint devices included in the software-defined network.
[0098] Module 32 is used to construct the forwarding input atomic information and forwarding output atomic information of each of the multiple forwarding components based on the input packet types and output packet types supported by the multiple forwarding components.
[0099] The marking module 33 is used to mark the topology roles of multiple forwarding components and at least two endpoint devices to obtain at least one source node, at least one destination node and at least one relay node.
[0100] The generation module 34 is used to recursively generate network topologies between at least one target node and at least one relay node, starting from at least one source node, based on the forwarding input atomic information and forwarding output atomic information of each of the multiple forwarding components, so as to obtain multiple network topologies in the software-defined network.
[0101] In an optional embodiment, the generation module is specifically used to: based on the set network topology constraints, and combining the forwarding input atomic information and forwarding output atomic information of each of the multiple forwarding components, recursively generate the network topology between at least one source node and at least one target node and at least one relay node, so as to obtain multiple network topologies in the software-defined network.
[0102] Optionally, the generation module is specifically used to: select a source node from at least one source node; starting from the selected source node, recursively search for a next-hop node that meets the network topology constraints from at least one target node and at least one relay node based on the forwarding input atomic information and forwarding output atomic information of each of the multiple forwarding components; and, if the next-hop node is a target node, obtain a network topology from the selected source node to the target node.
[0103] Further optionally, the network topology constraints include: connection constraint information for a specific relay node, which is used to limit the previous hop node and / or next hop node of the specific relay node; the generation module is specifically used to: starting from the selected source node, recursively search for the next hop node from at least one target node and at least one relay node based on the forwarding input atom information, the forwarding output atom and the connection constraint information of the specific relay node.
[0104] Further optionally, the network topology constraints also include: an upper limit for the number of network hops and the packet processing capability of the next-hop node; the generation module is specifically used to: starting from the selected source node, recursively search for the next-hop node from at least one target node and at least one relay node based on the forwarding input atomic information, forwarding output atomic information, connection constraint information of a specific relay node, and the packet processing capability of the next-hop node, until the recursive search terminates when the number of hops in the network topology reaches any set number of network hops; wherein, the number of set network hops is one or more, and the set number of network hops is less than or equal to the upper limit for the number of network hops.
[0105] In an optional embodiment, the construction module is specifically used to: for any forwarding component, generate an input forwarding atomic information corresponding to the forwarding component based on the identification information of the forwarding component, a supported input message type, and the input transmission direction; and generate an output forwarding atomic information corresponding to the forwarding component based on the identification information of the forwarding component, a supported output message type, and the output transmission direction.
[0106] In an optional embodiment, the marking module is specifically used for: for any forwarding component, if the forwarding component is implemented as a physical node and a virtualization instance is also deployed on the physical node, then the topology role of the forwarding component is marked as a source node, and the forwarding component is used to provide data forwarding services for the virtualization instance; if the forwarding component is implemented as a physical node and no virtualization instance is deployed on the physical node, then the topology role of the forwarding component is marked as a relay node; for endpoint devices, the topology roles of the endpoint devices are marked as source node and destination node respectively.
[0107] In an optional embodiment, the apparatus further includes a filtering module. After obtaining multiple network topologies in the software-defined network, the determining module is further configured to determine an exclusion list and / or an allow list. The exclusion list includes disabled network topologies or topology branches, and the allow list includes specific network topologies or topology branches. Wherein, if the exclusion list and the allow list overlap, the allow list has a higher priority than the exclusion list. The filtering module is configured to filter the multiple network topologies according to the exclusion list and / or the allow list to obtain at least one usable network topology.
[0108] Optionally, the device further includes: a testing module and a selection module, wherein the testing module is used to test the connectivity performance of at least one available network topology; and the selection module is used to select at least one target network topology that meets the requirements from the at least one available network topology based on the test results.
[0109] In an optional embodiment, the generation module is specifically used to: generate a network topology generation script based on the topology roles of multiple forwarding components and at least two endpoint devices, as well as the forwarding input atomic information and forwarding output atomic information of multiple forwarding components; and run the network topology generation script to recursively generate network topologies between at least one target node and at least one relay node, starting from at least one source node, to obtain multiple network topologies in the software-defined network.
[0110] Regarding the embodiments provided in this application Figure 3 The detailed implementation methods and beneficial effects of each step in the apparatus shown have been described in detail in the foregoing embodiments, and will not be elaborated here.
[0111] Figure 4 A schematic diagram of the structure of an electronic device provided for an exemplary embodiment of this application, such as... Figure 4 As shown, the device includes a memory 44 and a processor 45.
[0112] Memory 44 is used to store computer programs and can be configured to store various other data to support operation on the electronic device. Examples of this data include instructions for any application or method used to operate on the electronic device.
[0113] The processor 45, coupled to the memory 44, is used to execute the computer program in the memory 44 for executing the network topology discovery method described in the foregoing embodiments. For details, please refer to the descriptions in the foregoing embodiments, which will not be repeated here.
[0114] Regarding the embodiments provided in this application Figure 4 The detailed implementation methods and beneficial effects of each step in the device shown have been described in detail in the foregoing embodiments, and will not be elaborated here.
[0115] Furthermore, such as Figure 4 As shown, the electronic device also includes other components such as a communication component 46, a display 47, a power supply component 48, and an audio component 49. Figure 4 The diagram only shows some components and does not mean that the electronic device includes only these components. Figure 4 The components shown. Additionally... Figure 4 The components within the dashed box are optional, not mandatory, and their specific requirements depend on the product form of the electronic device. The electronic device in this embodiment can be a desktop computer, laptop computer, smartphone, IoT (Internet of Things) device, or smart wearable device (such as a smartwatch or smart bracelet), or a server-side device such as a conventional server, cloud server, or server array. If the electronic device in this embodiment is a desktop computer, laptop computer, smartphone, or other terminal device, it may include... Figure 4 The components within the dashed box; if the electronic device in this embodiment is implemented as a conventional server, cloud server, or server array, etc., it may be omitted. Figure 4 The component within the dashed box.
[0116] The aforementioned memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random-Access Memory (SRAM), Electrically Erasable Programmable Read Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0117] The aforementioned communication components are configured to facilitate wired or wireless communication between the device containing the communication components and other devices. The device containing the communication components can access wireless networks based on communication standards, such as WiFi, 2G, 3G, 4G / LTE, 5G, or combinations thereof. In one exemplary embodiment, the communication components receive broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication components also include a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID), Infrared Data Association (IrDA), Ultra Wide Band (UWB), Bluetooth (BT), and other technologies.
[0118] The aforementioned display includes a screen, which may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a Touch Panel, the screen can be implemented as a touchscreen to receive input signals from the user. The Touch Panel includes one or more touch sensors to sense touches, swipes, and gestures on the Touch Panel. The touch sensors can sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation.
[0119] The aforementioned power supply components provide power to various components within the device in which they reside. These power supply components may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power to the device in which they reside.
[0120] The aforementioned audio component can be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC) configured to receive external audio signals when the device containing the audio component is in an operating mode, such as call mode, recording mode, or voice recognition mode. The received audio signals can be further stored in memory or transmitted via a communication component. In some embodiments, the audio component also includes a speaker for outputting audio signals.
[0121] Accordingly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to implement the steps in the above-described method embodiments. The computer-readable storage medium includes volatile or non-volatile components, or a combination thereof, and can be removable or non-removable. Examples of computer-readable storage media include, but are not limited to, phase-change random access memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random-access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), flash memory or other memory technologies, CD-ROM, Digital Video Disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium.
[0122] Accordingly, this application also provides a computer program product, which includes a computer program or instructions that, when executed by a processor, cause the processor to implement the steps in the above method embodiments. It should be understood that each step or combination of steps in the above method flow can be implemented by the computer program or instructions. Furthermore, these computer programs or instructions can be applied to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device, enabling the processor of the general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to function as an apparatus for implementing the corresponding functions in the above method embodiments.
[0123] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-readable storage media (including, but not limited to, disk storage, compact disc read-only memory (CD-ROM), optical storage, etc.) containing computer-usable program code.
[0124] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0125] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0126] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0127] In a typical configuration, a computing device includes one or more processors (Central Processing Unit, CPU), input / output interfaces, network interfaces, and memory.
[0128] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0129] Computer-readable media, including both permanent and non-permanent, removable and non-removable media, can store information using any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change random access memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, Digital Video Disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0130] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0131] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A network topology discovery method, characterized in that, include: Identify the software-defined network, including multiple forwarding components and at least two endpoint devices within the software-defined network; Based on the input and output message types supported by the multiple forwarding components, construct the forwarding input atomic information and forwarding output atomic information for each of the multiple forwarding components; The multiple forwarding components and at least two endpoint devices are labeled with topology roles to obtain at least one source node, at least one destination node, and at least one relay node; Based on the forwarding input atomic information and forwarding output atomic information of the multiple forwarding components, starting from the at least one source node, a recursive generation of network topology is performed between the at least one target node and the at least one relay node to obtain multiple network topologies in the software-defined network.
2. The method according to claim 1, characterized in that, Based on the forwarding input atomic information and forwarding output atomic information of the multiple forwarding components, starting from the at least one source node, a recursive generation of network topology is performed between the at least one target node and the at least one relay node to obtain multiple network topologies in the software-defined network, including: Based on the set network topology constraints, and combining the forwarding input atomic information and forwarding output atomic information of each of the multiple forwarding components, the network topology is recursively generated between the at least one source node and the at least one target node and the at least one relay node to obtain multiple network topologies in the software-defined network.
3. The method according to claim 1, characterized in that, Based on the set network topology constraints, and combining the forwarding input atomic information and forwarding output atomic information of each of the multiple forwarding components, a recursive generation of the network topology is performed between the at least one source node and the at least one target node and the at least one relay node to obtain multiple network topologies in the software-defined network, including: Select a source node from the at least one source node; Starting from the selected source node, based on the forwarding input atom information and the forwarding output atom of each of the multiple forwarding components, the next-hop node that meets the network topology constraints is recursively searched from the at least one target node and the at least one relay node. If the next-hop node is the target node, a network topology from the selected source node to the target node is obtained.
4. The method according to claim 3, characterized in that, The network topology constraints include: connection constraint information for a specific relay node, which is used to limit the previous hop node and / or next hop node of the specific relay node. Starting from the selected source node, based on the forwarding input atom information and the forwarding output atom, a next-hop node that meets the network topology constraints is recursively searched from the at least one target node and the at least one relay node, including: Starting from the selected source node, the next-hop node is recursively searched from the at least one target node and the at least one relay node based on the forwarding input atomic information, the forwarding output atomic information, and the connection constraint information of the specific relay node.
5. The method according to claim 4, characterized in that, The network topology constraints also include: the upper limit of the number of network hops and the packet processing capabilities of the next-hop node; Starting from the selected source node, based on the forwarding input atomic information, the forwarding output atomic information, and the connection constraint information of the specific relay node, the next-hop node is recursively searched from the at least one target node and the at least one relay node, including: Starting from the selected source node, based on the forwarding input atomic information, forwarding output atomic information, connection constraint information of the specific relay node, and the packet processing capabilities of the next-hop node, the next-hop node is recursively searched from the at least one target node and the at least one relay node until the number of hops in the network topology reaches any set network hop count, at which point the recursive search terminates. The number of network hops set can be one or more, and the number of network hops set is less than or equal to the upper limit of the number of network hops.
6. The method according to claim 1, characterized in that, Based on the input and output packet types supported by the multiple forwarding components, construct the forwarding input atomic information and forwarding output atomic information for each of the multiple forwarding components, including: For any forwarding component, based on the identification information of the forwarding component, a supported input message type, and the input transmission direction, an input forwarding atomic information corresponding to the forwarding component is generated; based on the identification information of the forwarding component, a supported output message type, and the output transmission direction, an output forwarding atomic information corresponding to the forwarding component is generated.
7. The method according to claim 1, characterized in that, The topology role marking process is performed on the plurality of forwarding components and at least two endpoint devices to obtain at least one source node, at least one destination node, and at least one relay node, including: For any forwarding component, if the forwarding component is implemented as a physical node and a virtualization instance is also deployed on the physical node, then the topology role of the forwarding component is marked as the source node, and the forwarding component is used to provide data forwarding services for the virtualization instance; If the forwarding component is implemented as a physical node and no virtualization instance is deployed on the physical node, then the topology role of the forwarding component is marked as a relay node; For the endpoint device, the topology roles of the endpoint device are marked as source node and target node, respectively.
8. The method according to any one of claims 1-7, characterized in that, After obtaining multiple network topologies in the software-defined network, the process also includes: Determine an exclusion list and / or an allow list, wherein the exclusion list includes disabled network topologies or topology branches, and the allow list includes specific network topologies or topology branches; wherein, in the case of overlap between the exclusion list and the allow list, the allow list has a higher priority than the exclusion list; The multiple network topologies are filtered according to the exclusion list and / or the allow list to obtain at least one usable network topology.
9. The method according to claim 8, characterized in that, Also includes: The connectivity performance of at least one available network topology is tested; Based on the test results, select at least one target network topology that meets the requirements from the at least one available network topology.
10. The method according to any one of claims 1-7, characterized in that, Based on the forwarding input atomic information and forwarding output atomic information of the multiple forwarding components, starting from the at least one source node, a recursive generation of network topology is performed between the at least one target node and the at least one relay node to obtain multiple network topologies in the software-defined network, including: Based on the topology roles of the multiple forwarding components and at least two endpoint devices, as well as the forwarding input atomic information and forwarding output atomic information of the multiple forwarding components, a network topology generation script is generated. Run the network topology generation script to recursively generate network topologies between the at least one source node and the at least one target node and the at least one relay node, so as to obtain multiple network topologies in the software-defined network.
11. An electronic device, characterized in that, include: Memory and processor; The memory is used to store a computer program; the processor, coupled to the memory, is used to execute the computer program to implement the steps of the method according to any one of claims 1-10.
12. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it causes the processor to perform the steps of the method according to any one of claims 1-10.
13. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, the processor is caused to perform the steps of the method according to any one of claims 1-10.