A topology discovery method, device, terminal and storage medium
By acquiring SDN switch and host information in a hybrid SDN-IP network, using OpenFlow messages and LLDP packets combined with MIB information, a collection of IPs to be tested and analyzing the switch forwarding table, the problem of not being able to obtain the topology relationship of the hybrid SDN-IP network in the prior art is solved, and the complete acquisition and fault location of the network topology are achieved.
Patent Information
- Application Number
- CN202211101217.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-09
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2042-09-09
AI Technical Summary
The prior art is difficult to obtain a complete topological relationship in a hybrid SDN-IP network, especially since most SDN controllers do not support the SNMP protocol, making it difficult to analyze the connection between traditional switches and SDN switches and between traditional switches.
By obtaining SDN switch information and host information, accessing the device's management information database MIB, building a collection of IPs to be tested, and obtaining the direct connection relationship between the switch and the host based on OpenFlow messages and LLDP messages, combining MIB information to establish the connection relationship between the traditional switch and the router, analyzing the forwarding list of the switches one by one, and finally building the topological relationship of the hybrid SDN-IP network.
Without requiring the SDN controller to support the SNMP protocol, the complete topological relationship of the hybrid SDN-IP network can be obtained, which accurately locates the on-off and congestion conditions of the network link and the identification of fault locations.
Smart Images

Figure CN116260726B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network communications, and in particular to a topology discovery method, device, terminal and storage medium. Background Art
[0002] Software-defined networking (SDN) is a new type of network. Its core technology, OpenFlow, separates the control and data planes of network devices, providing tremendous flexibility for fine-grained data plane control, making the network more intelligent as a pipeline. Currently, traditional Internet Protocol (IP) networks are gradually transitioning to SDN networks. During this transition, a single operator's network may include both traditional and SDN switches, forming a hybrid SDN-IP network where traditional and SDN switches coexist.
[0003] Network management and performance monitoring require network administrators to have ready access to network topology information, which helps measure link connectivity, congestion, and accurately locate network faults. For hybrid SDN-IP networks, existing technologies require SDN controllers to support OpenFlow, Simple Network Management Protocol (SNMP), and Link Layer Discovery Protocol (LLDP), and traditional switches to support both LLDP and SNMP. However, most SDN controllers lack SNMP support, and existing technologies primarily analyze connections between SDN switches and traditional switches, and between traditional switches, making it difficult to analyze the entire topology of a hybrid SDN-IP network. Summary of the Invention
[0004] The present invention provides a topology discovery method, device, terminal and storage medium, which can obtain a complete hybrid SDN-IP network topology relationship without requiring the SDN controller to support the SNMP protocol.
[0005] To achieve the above objectives, in a first aspect, an embodiment of the present invention provides a topology discovery method applicable to a hybrid SDN-IP network, comprising:
[0006] Obtaining SDN switch information and host information directly connected to the SDN switch, wherein the SDN switch information includes the main capabilities, management address, device identifier, port identifier, etc. of the SDN switch, and the host information includes a VLAN tag and a host IP address;
[0007] Accessing the management information base (MIB) of the device to obtain MIB information, wherein the device includes a router and a traditional switch, and the MIB information includes the port IP address, port identifier, device identifier, and physical address of the SDN switch port connected to the device;
[0008] According to the SDN switch information, the host information, and the MIB information, a set of IP addresses to be tested is constructed and a direct connection relationship between all ports of the SDN switch is established, wherein the set of IP addresses to be tested includes all IP addresses in the hybrid SDN-IP network;
[0009] Based on the IP set to be tested, the traditional switch is traversed, the forwarding table of each port of the traditional switch is analyzed one by one, and a direct connection relationship is established for all ports of the traditional switch; the IPs in the IP set to be tested that have not established the direct connection relationship are connected according to the subnet analysis relationship, and a direct connection relationship of the router is established, until all IPs in the IP set to be tested establish the direct connection relationship, thereby obtaining a complete topological relationship of the hybrid SDN-IP network.
[0010] As an improvement to the above solution, the SDN switch information and the host information directly connected to the SDN switch are obtained, wherein the SDN switch information includes the main capabilities, management address, device identifier, port identifier, etc. of the SDN switch, and the host information includes a VLAN tag and a host IP address, specifically including:
[0011] After obtaining the SDN switch information, construct an OpenFlow message containing a Link Layer Discovery Protocol (LLDP) message and send it to the SDN switch, and instruct the SDN switch to flood forward the message from ports other than its ingress port to obtain a connection between the SDN switch and the SDN switch;
[0012] Constructing an OpenFlow message containing an Address Resolution Protocol (ARP) packet and sending it to the SDN switch, and instructing the SDN switch to flood forward the message from ports other than its ingress port to obtain information about all hosts directly connected to the SDN switch;
[0013] The SDN switch information includes the main capabilities, management address, device identification, port identification, etc. of the SDN switch; and the host information includes a VLAN tag and a host IP.
[0014] As an improvement to the above solution, the IP set to be tested is constructed based on the SDN switch information, the host information, and the MIB information, and a direct connection relationship is established between all ports of the SDN switch; wherein the IP set to be tested contains all IPs in the hybrid SDN-IP network, specifically including:
[0015] According to the SDN switch information, the host information, and the MIB information, a set of IP addresses to be tested is constructed and matched with traditional switch and router ports directly connected to the SDN switch, so as to establish a direct connection relationship between the SDN switch and the traditional switch and router;
[0016] According to the connection between the SDN switches and the host information, a direct connection relationship between the SDN switches and a direct connection relationship between the SDN switches and the host are established, thereby obtaining a direct connection relationship of all ports of the SDN switch; wherein the IP set to be tested contains all IPs in the hybrid SDN-IP network.
[0017] As an improvement to the above solution, after obtaining the SDN switch information, constructing an OpenFlow message containing a Link Layer Discovery Protocol (LLDP) message and sending it to the SDN switch, and instructing the SDN switch to flood forward the message from ports other than its ingress port, so as to obtain a connection between the SDN switches, specifically including:
[0018] After obtaining the SDN switch information, construct an OpenFlow message containing a Link Layer Discovery Protocol (LLDP) message and send it to the SDN switch, and instruct the SDN switch to flood forward the message from all ports except its ingress port.
[0019] If the LLDP message is received by a traditional switch or router, the traditional switch or router parses the LLDP message and stores the physical address of the SDN switch port in the LLDP message in the MIB library;
[0020] If the host receiving the LLDP message is a host, the host does not respond to the LLDP message;
[0021] If the LLDP message is received by another SDN switch, the LLDP message is reported to obtain the connection between the SDN switch and the SDN switch.
[0022] As an improvement to the above solution, the method traverses the traditional switch based on the IP set to be tested, analyzes the forwarding table of each port of the traditional switch one by one, and establishes a direct connection relationship for all ports of the traditional switch; analyzes the connection relationship of the IPs in the IP set to be tested that do not have the direct connection relationship according to the subnet, and establishes a direct connection relationship with the router, until all the IPs in the IP set to be tested have the direct connection relationship, thereby obtaining a complete topology relationship of the hybrid SDN-IP network, which specifically includes:
[0023] S41: Based on the MIB information, a list initially storing all traditional switches in the hybrid SDN-IP network is used as a first list, a list storing traditional switches waiting to be processed is used as a second list, the traditional switch storing the most device addresses in the first list is recorded as a root switch, and all port forwarding tables of a traditional switch are recorded as a port forwarding table set;
[0024] S42: Find the root switch, delete the root switch from the first list, and add it to the end of the second list;
[0025] S43: Take the first traditional switch from the second list, record it as traditional switch 1, and record all port forwarding tables of the traditional switch 1 as the port forwarding table set of the traditional switch 1;
[0026] S44: Record a port of the traditional switch 1 as port 1 and analyze the port 1;
[0027] Determine the connection status of the port 1, and delete the forwarding table of the port 1 from the port forwarding table set of the traditional switch 1;
[0028] S45: Determine whether the port forwarding table set of the traditional switch 1 is an empty set;
[0029] If the port forwarding table set of the traditional switch 1 is not an empty set, repeat step S44 until the port forwarding table set of the traditional switch 1 is an empty set, delete the traditional switch 1 from the second list, and delete the IP with which the direct connection has been established from the IP list to be tested;
[0030] S46: Determine whether the second list is empty. If not, return to execute S43-S45 until the second list is empty.
[0031] S47: Determine whether the first list is empty. If not, return to execute S42-S46 until the first list is empty, indicating that all traditional switches in the hybrid SDN-IP network have been processed.
[0032] S48: Determine whether the IP set to be tested is an empty set. If it is not an empty set, analyze the connection relationship according to the subnet and establish a direct connection relationship of the router. Until the IP set to be tested is an empty set, it means that all devices in the hybrid SDN-IP network have been analyzed, the topology discovery is completed, and the complete topology relationship of the hybrid SDN-IP network is obtained.
[0033] As an improvement to the above solution, the connection status of the port 1 is determined, and the forwarding table of the port 1 is deleted from the port forwarding table set of the traditional switch 1, specifically:
[0034] If the port 1 establishes a direct connection with another traditional switch port, the traditional switch directly connected to the port 1 is deleted from the first list and added to the end of the second list. At the same time, the forwarding table of the port 1 is deleted from the port forwarding table set of the traditional switch 1.
[0035] If port 1 of the traditional switch 1 cannot establish a direct connection with other traditional switch ports, and the number of addresses in the port 1 forwarding table is equal to 1, it can be determined that the port 1 is directly connected to a router or a host, and the port 1 forwarding table is deleted from the port forwarding table set of the traditional switch 1.
[0036] In a second aspect, an embodiment of the present invention provides a topology discovery device, including:
[0037] An SDN controller is configured to obtain information about an SDN switch and information about a host directly connected to the SDN switch, wherein the information about the SDN switch includes the main capabilities, management address, device identifier, port identifier, etc. of the SDN switch, and the information about the host includes a VLAN tag and a host IP address;
[0038] An SNMP server is used to access the management information base (MIB) of a device to obtain MIB information, wherein the device includes a router and a traditional switch, and the MIB information includes the port IP address, port identifier, device identifier, and physical address of the SDN switch port connected to the device;
[0039] A topology information management server is configured to construct a set of IP addresses to be tested and establish direct connection relationships between all ports of the SDN switch based on the SDN switch information, the host information, and the MIB information, wherein the set of IP addresses to be tested includes all IP addresses in the hybrid SDN-IP network;
[0040] The topology information management server is also used to traverse the traditional switch based on the IP set to be tested, analyze the forwarding table of each port of the traditional switch one by one, and establish a direct connection relationship for all ports of the traditional switch; analyze the connection relationship of the IPs in the IP set to be tested that have not established the direct connection relationship according to the subnet, and establish a direct connection relationship of the router, until all IPs in the IP set to be tested establish the direct connection relationship, thereby obtaining a complete topology relationship of the hybrid SDN-IP network.
[0041] In a third aspect, an embodiment of the present invention provides a terminal device, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements a topology discovery method as described in any one of the above items when executing the computer program.
[0042] In addition, an embodiment of the present invention further provides a computer-readable storage medium, characterized in that the computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute any of the above-mentioned topology discovery methods.
[0043] Compared with the prior art, the present invention discloses a topology discovery method, device, terminal, and storage medium. The method obtains SDN switch information and host information directly connected to the SDN switch; accesses the device's management information base (MIB) to obtain MIB information; constructs a set of IP addresses to be tested and establishes direct connection relationships for all ports of the SDN switch based on the SDN switch information, the host information, and the MIB information; traverses the traditional switch based on the set of IP addresses to be tested, establishes direct connection relationships for all ports of the traditional switch, analyzes the connection relationships for IP addresses in the set of IP addresses to be tested that do not have direct connection relationships according to subnet analysis, and establishes direct connection relationships for the routers. This process continues until all IP addresses in the set of IP addresses to be tested have direct connection relationships, thereby obtaining a complete topology relationship for the hybrid SDN-IP network. The present invention provides a topology discovery method, device, terminal, and storage medium that can obtain a complete topology relationship for the hybrid SDN-IP network without requiring the SDN controller to support the SNMP protocol. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 This is a flowchart of a topology discovery method provided by an embodiment of the present invention;
[0045] Figure 2 This is a schematic diagram of the structure of a topology discovery device provided by an embodiment of the present invention;
[0046] Figure 3This is a schematic diagram of the structure of a terminal device provided by an embodiment of the present invention;
[0047] Figure 4 This is an architectural diagram of a hybrid SDN-IP network. DETAILED DESCRIPTION
[0048] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0049] It should be noted that the terms "comprises" and "specifically" and any variations thereof in the present invention are intended to cover non-exclusive inclusions. For example, a process, method, system, product or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or are inherent to these processes, methods, products or apparatuses.
[0050] LLDP is a standard link layer discovery method that organizes a device's key capabilities, management address, device identifier, and interface identifiers into different type / length / value (TLV) formats. These information is encapsulated in Link Layer Discovery Protocol Data Units (LLDPDUs) and published to directly connected neighbors in the form of LLDP messages. Upon receiving this information, the neighbor stores it as MIB information for system query and to determine the link's communication status.
[0051] The MIB is part of the Transmission Control Protocol / Internet Protocol (TCP / IP) standard framework. It defines the data items that must be stored by managed devices, the operations allowed on each data item, and their meaning. Specifically, all data variables accessible to the management system, such as control and status information, are stored in the MIB. In this embodiment, information such as the connection relationships between devices in the hybrid SDN-IP network is stored in the MIB of each network device.
[0052] Figure 4 This is an architectural diagram of a hybrid SDN-IP network. A hybrid SDN-IP network is a hybrid SDN-IP network that transitions from a traditional IP network to a new SDN network. Figure 4 As shown in Figure 1, the hybrid SDN-IP network includes four types of network devices: router R, traditional switch S, host H, SDN switch OVS, and a server C as the control center.
[0053] Still Figure 4 As shown in the figure, the hybrid SDN-IP network includes both OVS using the OpenFlow protocol and S using the TCP / IP protocol. Therefore, the OVS MIB in this application includes at least the OpenFlow MIB and the IP MIB. The OpenFlow MIB is mainly used to store OVS device information, link information between OVSs, and link information from S to OVS; the IP MIB is mainly used to store S MIB information requested from S.
[0054] Optionally, a hybrid SDN-IP network can centrally manage OVS and S through a network management system. For example, a server in the control center could deploy an SDN controller that communicates with OVS via the OpenFlow protocol and an SNMP server that communicates with S via the SNMP protocol. The SDN controller manages the OpenFlow MIB, parsing received messages and storing required content in the OpenFlow MIB or IP MIB. Correspondingly, the SNMP server manages the MIB information of the hybrid SDN-IP network and calculates the network topology based on the information stored in the OpenFlow MIB and IP MIB.
[0055] It should be noted that in normal operation, the switch periodically sends LLDP packets to neighboring devices to inform them of local device information. When the switch's local configuration changes, it immediately sends LLDP packets to notify neighboring devices of the change.
[0056] For example, S1 constructs a first LLDP message and periodically multicasts it from each local active port. This message carries S1's device information. After receiving the first LLDP message, S2 parses the LLDPDU to obtain S1's device information and updates it to S2's local remote MIB. Traditional switch MIBs are divided into local MIBs and remote MIBs, which store local device information and other device information, respectively.
[0057] For example, S1 multicasts a first LLDP message, which can also be received by the adjacent OVS1. After receiving the first LLDP message, OVS1 encapsulates the entire message in a first Packet In message and reports it to the SDN controller. After receiving the first Packet In message from OVS1, the SDN controller parses the first LLDP message and obtains the link information from S1 to OVS1.
[0058] It should be noted that complete link information includes the source device's identification information, the source device's port information, the destination device's identification information, and the destination device's port information. The device's identification information can be its IP address, MAC address, or device ID, or other information that uniquely identifies the device. The device's port information can be the port number of the port through which the device accesses the link.
[0059] See also Figure 1 , Figure 1 1 is a flow chart of a topology discovery method provided by an embodiment of the present invention. The topology discovery method is applicable to an SDN-IP network and includes steps S1 to S4:
[0060] S1: Acquire information about an SDN switch and a host directly connected to the SDN switch, wherein the information about the SDN switch includes the main capabilities, management address, device identifier, port identifier, etc. of the SDN switch, and the host information includes a VLAN tag and a host IP address.
[0061] S2: Accessing the management information base (MIB) of the device to obtain MIB information, wherein the device includes a router and a traditional switch, and the MIB information includes the port IP address, port identifier, device identifier, and physical address of the SDN switch port connected to the device;
[0062] Optionally, the subnet in the MIB information can be obtained by traversing all devices in a breadth-first search. For devices in different VLANs, their VLAN related information needs to be stored.
[0063] S3: Constructing a set of IP addresses to be tested and establishing direct connection relationships between all ports of the SDN switch based on the SDN switch information, the host information, and the MIB information, wherein the set of IP addresses to be tested includes all IP addresses in the hybrid SDN-IP network;
[0064] S4: Traverse the traditional switch based on the IP set to be tested, analyze the forwarding table of each port of the traditional switch one by one, and establish a direct connection relationship for all ports of the traditional switch; analyze the connection relationship of the IPs in the IP set to be tested that have not established the direct connection relationship according to the subnet, and establish a direct connection relationship with the router, until all IPs in the IP set to be tested establish the direct connection relationship, and obtain the topology relationship of the complete hybrid SDN-IP network.
[0065] In a preferred embodiment, in step S1, the SDN switch information and the host information directly connected to the SDN switch are obtained, wherein the SDN switch information includes the main capabilities, management address, device identification, port identification, etc. of the SDN switch, and the host information includes a VLAN tag and a host IP address, specifically including:
[0066] S11: After obtaining the SDN switch information, construct an OpenFlow message containing a Link Layer Discovery Protocol (LLDP) message and send it to the SDN switch, and instruct the SDN switch to flood forward the message from ports other than its ingress port, so as to establish a connection between the SDN switch and the SDN switch;
[0067] Specifically, if the LLDP message is received by a traditional switch or router, the traditional switch or router parses the LLDP message and stores the physical address of the SDN switch port in the LLDP message in the MIB library;
[0068] If the host receiving the LLDP message is a host, the host does not respond to the LLDP message;
[0069] If the LLDP message is received by another SDN switch, the LLDP message is reported to obtain the connection between the SDN switch and the SDN switch.
[0070] S12: Construct an OpenFlow message containing an Address Resolution Protocol (ARP) packet and send it to the SDN switch, and instruct the SDN switch to flood forward the message from ports other than its ingress port to obtain information about all hosts directly connected to the SDN switch.
[0071] The SDN switch information includes the main capabilities, management address, device identification, port identification, etc. of the SDN switch; and the host information includes a VLAN tag and a host IP.
[0072] It should be noted that the sending and receiving of LLDP packets and ARP packets are both based on the Packet-Out and Packet-In messages of the OpenFlow protocol, using an active measurement method.
[0073] In a preferred embodiment, in step S3, the IP set to be tested is constructed based on the SDN switch information, the host information, and the MIB information, and a direct connection relationship is established between all ports of the SDN switch; wherein the IP set to be tested contains all IPs in the hybrid SDN-IP network, specifically including:
[0074] S31: Constructing a set of IP addresses to be tested based on the SDN switch information, the host information, and the MIB information, matching traditional switch and router ports directly connected to the SDN switch, and establishing direct connections between the SDN switch and the traditional switches and routers;
[0075] S32: Based on the connection between the SDN switches and the host information, establish a direct connection relationship between the SDN switches and a direct connection relationship between the SDN switches and the host, thereby obtaining a direct connection relationship of all ports of the SDN switch; wherein the IP set to be tested includes all IPs in the hybrid SDN-IP network.
[0076] In a preferred embodiment, in step S4, the conventional switch is traversed based on the IP set to be tested, the forwarding table of each port of the conventional switch is analyzed one by one, and a direct connection relationship is established for all ports of the conventional switch; the IPs in the IP set to be tested that do not have the direct connection relationship are analyzed for connection relationship according to the subnet, and a direct connection relationship of the router is established, until all the IPs in the IP set to be tested have the direct connection relationship established, thereby obtaining a complete topological relationship of the hybrid SDN-IP network, which specifically includes:
[0077] S41: Based on the MIB information, a list initially storing all traditional switches in the hybrid SDN-IP network is used as a first list, a list storing traditional switches waiting to be processed is used as a second list, the traditional switch storing the most device addresses in the first list is recorded as a root switch, and all port forwarding tables of a traditional switch are recorded as a port forwarding table set;
[0078] S42: Find the root switch, delete the root switch from the first list, and add it to the end of the second list;
[0079] S43: Take the first traditional switch from the second list, record it as traditional switch 1, and record all port forwarding tables of the traditional switch 1 as the port forwarding table set of the traditional switch 1;
[0080] S44: Record a port of the traditional switch 1 as port 1 and analyze the port 1;
[0081] Determine the connection status of the port 1, and delete the forwarding table of the port 1 from the port forwarding table set of the traditional switch 1;
[0082] Specifically, if the port 1 establishes a direct connection with another traditional switch port, the traditional switch directly connected to the port 1 is deleted from the first list and added to the end of the second list, and the forwarding table of the port 1 is deleted from the port forwarding table set of the traditional switch 1;
[0083] If port 1 of the traditional switch 1 cannot establish a direct connection with other traditional switch ports, and the number of addresses in the port 1 forwarding table is equal to 1, it can be determined that the port 1 is directly connected to a router or a host, and the port 1 forwarding table is deleted from the port forwarding table set of the traditional switch 1.
[0084] S45: Determine whether the port forwarding table set of the traditional switch 1 is an empty set;
[0085] If the port forwarding table set of the traditional switch 1 is not an empty set, repeat step S44 until the port forwarding table set of the traditional switch 1 is an empty set, delete the traditional switch 1 from the second list, and delete the IP with which the direct connection has been established from the IP list to be tested;
[0086] S46: Determine whether the second list is empty. If not, return to execute S43-S45 until the second list is empty.
[0087] S47: Determine whether the first list is empty. If not, return to execute S42-S46 until the first list is empty, indicating that all traditional switches in the hybrid SDN-IP network have been processed.
[0088] S48: Determine whether the IP set to be tested is an empty set. If it is not an empty set, analyze the connection relationship according to the subnet and establish a direct connection relationship of the router. Until the IP set to be tested is an empty set, it means that all devices in the hybrid SDN-IP network have been analyzed, the topology discovery is completed, and the complete topology relationship of the hybrid SDN-IP network is obtained.
[0089] It's important to note that the completeness of the ARP tables of the switches in the actual network under test is unknown. They could be empty in the initial state, complete after all switches have communicated with each other, or incomplete somewhere in between. After pinging all IP addresses, the forwarding tables for some ports on a traditional switch are complete. This means that the forwarding tables for these ports contain the IP addresses of all manageable devices reachable by those ports.
[0090] See also Figure 2 , Figure 2 1 is a schematic diagram of the structure of a topology discovery device provided by an embodiment of the present invention, the topology discovery device comprising:
[0091] The SDN controller 21 is configured to obtain information about an SDN switch and information about a host directly connected to the SDN switch, wherein the information about the SDN switch includes the main capabilities, management address, device identifier, port identifier, etc. of the SDN switch, and the information about the host includes a VLAN tag and a host IP address;
[0092] SNMP server 22, used to access the management information base (MIB) of the device to obtain MIB information, wherein the device includes a router and a traditional switch, and the MIB information includes the port IP address, port identifier, device identifier, and physical address of the SDN switch port connected to the device;
[0093] The topology information management server 23 is configured to construct a set of IP addresses to be tested and establish direct connections between all ports of the SDN switch based on the SDN switch information, the host information, and the MIB information, wherein the set of IP addresses to be tested includes all IP addresses in the hybrid SDN-IP network;
[0094] The topology information management server 23 is also used to traverse the traditional switch based on the IP set to be tested, analyze the forwarding table of each port of the traditional switch one by one, and establish a direct connection relationship for all ports of the traditional switch; analyze the connection relationship of the IPs in the IP set to be tested that have not established the direct connection relationship according to the subnet, and establish a direct connection relationship of the router, until all IPs in the IP set to be tested establish the direct connection relationship, and obtain the complete topology relationship of the hybrid SDN-IP network.
[0095] Combine Figure 4In one specific embodiment, after the SDN switch is powered on and configured with an IP address, it will proactively report port status information and other information when establishing a connection with the SDN controller 21. After obtaining device information for each SDN switch, the SDN controller 21 controls the SDN switch to send LLDP packets to its neighboring nodes through the OpenFlow protocol. The SDN controller 21 first constructs a Packet-Out message containing the LLDP data packet and sends it to the SDN switches OVS1 and OVS2, specifying that it should be flooded out from ports other than the inbound port. The SDN switch OVS1 forwards the LLDP packet from different ports to the traditional switch S1 and host H1. S1 stores the MAC address of port 1 of OVS1 in the MIB library, while H1 does not respond to the LLDP message. The SDN switch OVS2 forwards the LLDP packet from different ports to the traditional switches S4 and S5 and router R2. Since S4, S5, and R2 all support the LLDP protocol, the source port information of OVS2 can be stored in the MIB library.
[0096] The SDN controller 21 reconstructs a Packet-Out message containing the ARP packet and sends it to the SDN switches OVS1 and OVS2, and specifies to flood forward it from ports other than the ingress port, so that the information of all hosts connected to the SDN switches can be obtained.
[0097] SNMP server 22 obtains MIB information for all manageable devices (including routers and traditional switches) and reports the obtained subnet and switch set information to topology management server 23. Subnets are obtained by traversing the MIB information of all traditional devices using a breadth-first search. For devices in different VLANs, VLAN-related information needs to be stored.
[0098] The topology management server 23 analyzes the collected MIB data, matches the switch / router port directly connected to the SDN switch, finds the first traditional switch, establishes a direct connection relationship between the SDN switch and the first traditional switch, and combines the obtained direct connection between the SDN switches and the host information connected to the SDN switch to establish a direct connection relationship between the SDN switches and the connection relationship between the SDN switch and the host; constructs an IP set to be tested, and adds all the obtained IP addresses to the IP set to be tested.
[0099] The topology management server 23 traverses the traditional switches in the acquired set of IP addresses to be tested, analyzes the forwarding tables of the ports of each traditional switch, and establishes direct connections of the traditional switches based on direct connection inference.
[0100] After traversing all traditional switches, the topology management server 23 analyzes any remaining IP addresses in the set of IP addresses to be tested, based on subnets. If a subnet contains only one router R interface IP address and one host IP address, this indicates that router R is directly connected to host H. If a subnet contains two router R interface IP addresses, this indicates that router R is directly connected to router R. If the set of IP addresses to be tested is empty, all devices have been analyzed, topology discovery is complete, and the complete hybrid SDN-IP network topology is obtained.
[0101] A topology discovery device provided in an embodiment of the present invention can implement all processes of the topology discovery method of any of the above embodiments. The functions and technical effects achieved by each module in the device are respectively the same as those of the topology discovery method of the above embodiments, and will not be repeated here.
[0102] See also Figure 3 , Figure 3 A schematic diagram of the structure of a terminal device provided in an embodiment of the present invention. The terminal device 3 in this embodiment includes a processor 31, a memory 32, and a computer program stored in the memory 32 and executable on the processor 31. When the processor 31 executes the computer program, it implements the steps in the above-described topology discovery method embodiment. Alternatively, when the processor 31 executes the computer program, it implements the functions of the modules in the above-described topology discovery device embodiment.
[0103] Exemplarily, the computer program may be divided into one or more modules, which are stored in the memory 32 and executed by the processor 31 to implement the present invention. The one or more modules may be a series of computer program instruction segments capable of implementing specific functions, and the instruction segments are used to describe the execution process of the computer program in the terminal device 3.
[0104] The terminal device 3 can be a computing device such as a desktop computer, laptop, PDA, or cloud server. The terminal device 3 may include, but is not limited to, a processor 31 and a memory 32. Those skilled in the art will appreciate that the schematic diagram is merely an example of a terminal device and does not limit the terminal device. The terminal device 3 may include more or fewer components than shown, or a combination of certain components, or different components. For example, the terminal device 3 may also include input / output devices, network access devices, buses, and the like.
[0105] The processor 31 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor. The processor 31 is the control center of the terminal device 3, and connects various parts of the entire terminal device 3 using various interfaces and lines.
[0106] The memory 32 can be used to store the computer programs and / or modules. The processor 31 implements the various functions of the terminal device 3 by running or executing the computer programs and / or modules stored in the memory 32 and accessing the data stored in the memory 32. The memory 32 may mainly include a program storage area and a data storage area. The program storage area may store an operating system and at least one application required for a function (such as a sound playback function, an image playback function, etc.); the data storage area may store data generated based on the use of the mobile phone (such as audio data, a phone book, etc.). In addition, the memory 32 may include high-speed random access memory and non-volatile memory, such as a hard disk, internal memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one disk storage device, a flash memory device, or other volatile solid-state storage device.
[0107] If the module integrated in the terminal device 3 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor 31, it can implement the steps of the above-mentioned various method embodiments. The computer program includes computer program code, which can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0108] It should be noted that the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed across multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. In addition, in the drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art can understand and implement the present invention without inventive effort.
[0109] An embodiment of the present invention further provides a computer-readable storage medium, which includes a stored computer program. When the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the topology discovery method as described above.
[0110] In summary, the embodiments of the present invention disclose a topology discovery method, device, terminal and storage medium, which obtains SDN switch information and host information directly connected to the SDN switch; accesses the management information base MIB of the device to obtain MIB information; constructs a set of IPs to be tested and establishes a direct connection relationship for all ports of the SDN switch based on the SDN switch information, the host information and the MIB information; traverses the traditional switch based on the set of IPs to be tested, establishes a direct connection relationship for all ports of the traditional switch, analyzes the connection relationship for the IPs in the set of IPs to be tested that do not have the direct connection relationship according to the subnet, establishes a direct connection relationship for the router, and obtains a complete topology relationship of the hybrid SDN-IP network until all the IPs in the set of IPs to be tested have the direct connection relationship. The present invention provides a topology discovery method, device, terminal and storage medium, which can obtain a complete topology relationship of the hybrid SDN-IP network without requiring the SDN controller to support the SNMP protocol.
[0111] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A topology discovery method, applicable to a hybrid software-defined network (SDN)-Internet Protocol (IP) network, characterized in that: include: Acquire information about an SDN switch and information about a host directly connected to the SDN switch, wherein the information about the SDN switch includes the main capabilities, management address, device identifier, and port identifier of the SDN switch, and the information about the host includes a VLAN tag and a host IP address; Accessing the management information base (MIB) of the device to obtain MIB information, wherein the device includes a router and a traditional switch, and the MIB information includes the port IP address, port identifier, device identifier, and physical address of the SDN switch port connected to the device; According to the SDN switch information, the host information, and the MIB information, a set of IP addresses to be tested is constructed and a direct connection relationship between all ports of the SDN switch is established, wherein the set of IP addresses to be tested includes all IP addresses in the hybrid SDN-IP network; Based on the IP set to be tested, the traditional switch is traversed, the forwarding table of each port of the traditional switch is analyzed one by one, and a direct connection relationship is established for all ports of the traditional switch; the IPs in the IP set to be tested that have not established the direct connection relationship are connected according to the subnet analysis relationship, and a direct connection relationship of the router is established, until all IPs in the IP set to be tested establish the direct connection relationship, thereby obtaining a complete topological relationship of the hybrid SDN-IP network.
2. The topology discovery method according to claim 1, wherein: The obtaining of SDN switch information and host information directly connected to the SDN switch, wherein the SDN switch information includes the main capabilities, management address, device identifier, and port identifier of the SDN switch, and the host information includes a VLAN tag and a host IP address, specifically includes: After obtaining the SDN switch information, construct an OpenFlow message containing a Link Layer Discovery Protocol (LLDP) message and send it to the SDN switch, and instruct the SDN switch to flood forward the message from ports other than its ingress port to obtain a connection between the SDN switch and the SDN switch; Constructing an OpenFlow message containing an Address Resolution Protocol (ARP) packet and sending it to the SDN switch, and instructing the SDN switch to flood forward the message from ports other than its ingress port to obtain information about all hosts directly connected to the SDN switch; The SDN switch information includes the main capabilities, management address, device identifier, and port identifier of the SDN switch; and the host information includes a VLAN tag and a host IP.
3. The topology discovery method according to claim 2, wherein: The step of constructing a set of IP addresses to be tested and establishing a direct connection relationship between all ports of the SDN switch based on the SDN switch information, the host information, and the MIB information; wherein the set of IP addresses to be tested includes all IP addresses in the hybrid SDN-IP network, specifically including: According to the SDN switch information, the host information, and the MIB information, a set of IP addresses to be tested is constructed and matched with traditional switch and router ports directly connected to the SDN switch, so as to establish a direct connection relationship between the SDN switch and the traditional switch and router; According to the connection between the SDN switches and the host information, a direct connection relationship between the SDN switches and a direct connection relationship between the SDN switches and the host are established, thereby obtaining a direct connection relationship of all ports of the SDN switch; wherein the IP set to be tested contains all IPs in the hybrid SDN-IP network.
4. The topology discovery method according to claim 2, wherein: After obtaining the SDN switch information, constructing an OpenFlow message containing a Link Layer Discovery Protocol (LLDP) message and sending it to the SDN switch, and instructing the SDN switch to flood forward the message from ports other than its ingress port to obtain a connection between the SDN switches, specifically including: After obtaining the SDN switch information, construct an OpenFlow message containing a Link Layer Discovery Protocol (LLDP) message and send it to the SDN switch, and instruct the SDN switch to flood forward the message from all ports except its ingress port. If the LLDP message is received by a traditional switch or router, the traditional switch or router parses the LLDP message and stores the physical address of the SDN switch port in the LLDP message in the MIB library; If the host receiving the LLDP message is a host, the host does not respond to the LLDP message; If the LLDP message is received by another SDN switch, the LLDP message is reported to obtain the connection between the SDN switch and the SDN switch.
5. The topology discovery method according to any one of claims 1 to 4, wherein: The method traverses the traditional switch based on the IP set to be tested, analyzes the forwarding table of each port of the traditional switch one by one, and establishes a direct connection relationship for all ports of the traditional switch; analyzes the connection relationship of the IPs in the IP set to be tested that do not have the direct connection relationship according to the subnet, and establishes a direct connection relationship with the router, until all the IPs in the IP set to be tested have the direct connection relationship, thereby obtaining a complete topology relationship of the hybrid SDN-IP network, which specifically includes: S41: Based on the MIB information, a list initially storing all traditional switches in the hybrid SDN-IP network is used as a first list, a list storing traditional switches waiting to be processed is used as a second list, the traditional switch storing the most device addresses in the first list is recorded as a root switch, and all port forwarding tables of a traditional switch are recorded as a port forwarding table set; S42: Find the root switch, delete the root switch from the first list, and add it to the end of the second list; S43: Take the first traditional switch from the second list, record it as traditional switch 1, and record all port forwarding tables of the traditional switch 1 as the port forwarding table set of the traditional switch 1; S44: Record a port of the traditional switch 1 as port 1 and analyze the port 1; Determine the connection status of the port 1, and delete the forwarding table of the port 1 from the port forwarding table set of the traditional switch 1; S45: Determine whether the port forwarding table set of the traditional switch 1 is an empty set; If the port forwarding table set of the traditional switch 1 is not an empty set, repeat step S44 until the port forwarding table set of the traditional switch 1 is an empty set, delete the traditional switch 1 from the second list, and delete the IP address with which the direct connection has been established from the set of IP addresses to be tested; S46: Determine whether the second list is empty. If not, return to execute S43-S45 until the second list is empty. S47: Determine whether the first list is empty. If not, return to execute S42-S46 until the first list is empty, indicating that all traditional switches in the hybrid SDN-IP network have been processed. S48: Determine whether the IP set to be tested is an empty set. If it is not an empty set, analyze the connection relationship according to the subnet and establish a direct connection relationship of the router. Until the IP set to be tested is an empty set, it means that all devices in the hybrid SDN-IP network have been analyzed, the topology discovery is completed, and the complete topology relationship of the hybrid SDN-IP network is obtained.
6. The topology discovery method according to claim 5, wherein: The determining of the connection status of the port 1 and deleting the forwarding table of the port 1 from the port forwarding table set of the traditional switch 1 is specifically as follows: If the port 1 establishes a direct connection with another traditional switch port, the traditional switch directly connected to the port 1 is deleted from the first list and added to the end of the second list. At the same time, the forwarding table of the port 1 is deleted from the port forwarding table set of the traditional switch 1. If port 1 of the traditional switch 1 cannot establish a direct connection with other traditional switch ports, and the number of addresses in the port 1 forwarding table is equal to 1, it is determined that the port 1 is directly connected to a router or a host, and the port 1 forwarding table is deleted from the port forwarding table set of the traditional switch 1.
7. A topology discovery device, characterized in that: include: An SDN controller is configured to obtain information about an SDN switch and information about a host directly connected to the SDN switch, wherein the information about the SDN switch includes the main capabilities, management address, device identifier, and port identifier of the SDN switch, and the information about the host includes a VLAN tag and a host IP address; An SNMP server is used to access the management information base (MIB) of a device to obtain MIB information, wherein the device includes a router and a traditional switch, and the MIB information includes the port IP address, port identifier, device identifier, and physical address of the SDN switch port connected to the device; A topology information management server is configured to construct a set of IP addresses to be tested and establish direct connection relationships between all ports of the SDN switch based on the SDN switch information, the host information, and the MIB information, wherein the set of IP addresses to be tested includes all IP addresses in the hybrid SDN-IP network; The topology information management server is also used to traverse the traditional switch based on the IP set to be tested, analyze the forwarding table of each port of the traditional switch one by one, and establish a direct connection relationship for all ports of the traditional switch; analyze the connection relationship of the IPs in the IP set to be tested that have not established the direct connection relationship according to the subnet, and establish a direct connection relationship of the router, until all IPs in the IP set to be tested establish the direct connection relationship, thereby obtaining a complete topology relationship of the hybrid SDN-IP network.
8. A terminal device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the topology discovery method according to any one of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the topology discovery method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Network topology discovering method facing to data link layer
CN101136782A
Topology determination method, message response method, controller and switch
CN107566277A