CN114915561A - Network topological graph generation method and device - Google Patents

Network topological graph generation method and device Download PDF

Info

Publication number
CN114915561A
CN114915561A CN202210412439.XA CN202210412439A CN114915561A CN 114915561 A CN114915561 A CN 114915561A CN 202210412439 A CN202210412439 A CN 202210412439A CN 114915561 A CN114915561 A CN 114915561A
Authority
CN
China
Prior art keywords
network
attribute information
target network
equipment
devices
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210412439.XA
Other languages
Chinese (zh)
Other versions
CN114915561B (en
Inventor
易存道
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baolande Software Co ltd
Original Assignee
Beijing Baolande Software Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baolande Software Co ltd filed Critical Beijing Baolande Software Co ltd
Priority to CN202210412439.XA priority Critical patent/CN114915561B/en
Publication of CN114915561A publication Critical patent/CN114915561A/en
Application granted granted Critical
Publication of CN114915561B publication Critical patent/CN114915561B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/12Discovery or management of network topologies

Abstract

The invention provides a method and a device for generating a network topological graph, wherein the method comprises the following steps: configuring different network protocols based on the type of the device in the target network; respectively scanning equipment of corresponding types in the target network based on the configured network protocol to acquire attribute information of the equipment; and determining the equipment in the target network and the connection relation between the equipment based on the acquired attribute information of the equipment to obtain a network topology map of the target network. The invention can automatically discover the equipment in the target network and automatically identify the link between the equipment in the target network, thereby automatically generating the network topological graph of the target network without manual participation, ensuring the accuracy of the generated network topological graph and the generation efficiency of the network topological graph, and accurately and efficiently realizing the visual display of the network link.

Description

Network topological graph generation method and device
Technical Field
The invention relates to the technical field of computers, in particular to a network topology map generation method and device.
Background
With the rapid development of computer technology, especially network technology, a lot of enterprise network devices are supported to be deeper and deeper into core business, which affects the strategy formulation and the development of enterprises. Enterprises put increasing demands on the reliability and availability of networks, and at the same time, enterprise networks become more and more complex, so that links of the enterprise networks are generally required to be displayed quickly and intuitively through network topological graphs.
The existing network topology map generation method mainly comprises a method for manually generating a network topology map according to information of network equipment and a method for generating the network topology map according to a whole link discovered by starting equipment and end equipment.
According to the method for manually generating the network topological graph according to the information of the network equipment, due to the fact that the manual operation is different from the real network, the accuracy of the network topological graph cannot be guaranteed, and under the conditions that the number of the network equipment is large and the network is complex, the workload of the manual operation is large, and the efficiency of generating the network topological graph is low. According to the method for generating the network topological graph by discovering the whole link according to the starting device and the end point device, under the condition that the two devices do not have the link relation, the devices cannot be discovered, so that the generated network topological graph is different from a real network, and the accuracy of the network topological graph cannot be ensured.
Disclosure of Invention
The invention provides a method and a device for generating a network topological graph, which are used for solving the defects that the accuracy of the generated network topological graph cannot be ensured and the generation efficiency of the network topological graph is lower in the prior art, ensuring the accuracy of the generated network topological graph and the generation efficiency of the network topological graph and realizing accurate and efficient visual display of network links.
In a first aspect, the present invention provides a method for generating a network topology, including:
configuring different network protocols based on the type of the device in the target network;
respectively scanning equipment of corresponding types in the target network based on the configured network protocol to acquire attribute information of the equipment;
and determining the equipment in the target network and the connection relation between the equipment based on the acquired attribute information of the equipment to obtain a network topology map of the target network.
According to the method for generating the network topology map provided by the invention, different network protocols are configured based on the types of the devices in the target network, and the method comprises the following steps:
configuring a first type of network protocol based on a host and a virtual machine in the target network; wherein the first type of network protocol comprises an SSH protocol or a Telnet protocol;
configuring a second type of network protocol based on switches and routers in the target network; wherein the second type of network protocol comprises an SNMP protocol;
the scanning, based on the configured network protocol, of the device of the corresponding type in the target network to obtain the attribute information of the device includes:
scanning a host and a virtual machine in the target network based on the first type of network protocol to acquire first attribute information of the host and the virtual machine;
and scanning the switch and the router in the target network based on the second type of network protocol to acquire second attribute information of the switch and the router.
According to the method for generating a network topology map provided by the present invention, the determining the connection relationship between the devices in the target network and the devices based on the acquired attribute information of the devices to obtain the network topology map of the target network includes:
analyzing the acquired attribute information of the equipment to generate list attribute information of the equipment;
and determining the devices in the target network and the connection relationship between the devices based on the generated list attribute information of the devices to obtain a network topology map of the target network.
According to the method for generating the network topology map provided by the invention, the analyzing the acquired attribute information of the equipment to generate the list attribute information of the equipment comprises the following steps:
analyzing the acquired first attribute information to generate network card list attribute information of the host and the virtual machine;
analyzing the acquired second attribute information to generate routing table attribute information, ARP table attribute information, MAC address forwarding table attribute information, base bridge list attribute information and STP port list attribute information of the switch and the router;
the determining, based on the generated list attribute information of the devices, a connection relationship between the devices in the target network and obtaining a network topology map of the target network includes:
determining links among the devices in the target network through IP addresses based on the routing table attribute information and the network card list attribute information;
determining links between devices in the target network through MAC addresses based on the MAC address forwarding table attribute information and the base bridge list attribute information;
determining links between devices in the target network through a cascading port based on the STP port list attribute information and the base bridge list attribute information;
generating a network topology map of the target network based on the links determined by the IP address, the links determined by the MAC address, and the links determined by the tandem ports.
The network topology map generation method provided by the invention further comprises the following steps:
respectively acquiring performance information of equipment and a link in the target network based on the configured network protocol;
counting normal and lost equipment and links based on the acquired performance information, and determining the states of the equipment and the links;
and displaying the network topological graph of the target network, displaying the acquired performance information of the equipment and the link, the counted normal and offline equipment and link information, and displaying different states of the equipment and the link in different colors according to the determined states of the equipment and the link.
According to the method for generating the network topology map provided by the present invention, after the displaying the network topology map of the target network, the method further comprises:
aggregating the devices in the network topology map of the target network, and generating a sub-topology map based on the aggregated devices;
and displaying the network topology map after the target network aggregation and the generated sub-topology map.
According to the network topology generating method provided by the present invention, after the displaying the network topology of the target network, the method further comprises:
receiving retrieval information, and matching the received retrieval information with information of equipment or links in a network topological graph of the target network; wherein the retrieval information comprises information of a link starting device and a link ending device in the target network or information of a link state in the target network;
and displaying the matched link in a highlighted form in the network topological graph of the target network.
In a second aspect, the present invention further provides a network topology generating apparatus, including:
the protocol configuration module is used for configuring different network protocols based on the types of the devices in the target network;
the information discovery module is used for respectively scanning the equipment with the corresponding type in the target network based on the configured network protocol to acquire the attribute information of the equipment;
and the topological graph generating module is used for determining the equipment in the target network and the connection relation between the equipment based on the acquired attribute information of the equipment to obtain a network topological graph of the target network.
In a third aspect, the present invention further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the processor implements the steps of the network topology generation method according to any one of the above.
In a fourth aspect, the invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, which computer program, when executed by a processor, performs the steps of the network topology generation method as described in any of the above.
In a fifth aspect, the invention also provides a computer program product having a computer program stored thereon, which when executed by a processor, implements the steps of the network topology generation method as described in any of the above.
According to the method and the device for generating the network topological graph, different network protocols are configured according to the types of the devices in the target network, the devices of corresponding types in the target network are respectively scanned, the attribute information of the devices is obtained, the devices in the target network can be automatically found, the connection relation between the devices in the target network is determined according to the attribute information of the devices, and the links between the devices in the target network can be automatically identified, so that the network topological graph of the target network is automatically generated, manual participation is not needed, the accuracy of the generated network topological graph can be ensured, the efficiency of generating the network topological graph is ensured, the visual display of the network links can be accurately and efficiently realized, and particularly, the automatic updating of the network topological graph can be realized for the addition, the deletion and the modification of the devices and/or the links in the network.
Drawings
In order to more clearly illustrate the technical solutions of the present invention or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is a schematic flow chart diagram of a network topology generation method provided by the present invention;
FIG. 2 is a schematic flow chart diagram of another network topology generation method provided by the present invention;
FIG. 3 is a flowchart illustrating an application scenario of the network topology generation method provided by the present invention;
fig. 4 is a block diagram schematically illustrating the structure of an executing apparatus for the network topology generating method in fig. 3;
FIG. 5 is a flow chart illustrating the components of the execution apparatus of the network topology generation method of FIG. 4;
FIG. 6 is a flow chart illustrating a network topology provided by the present invention;
fig. 7 is a schematic structural diagram of a network topology generating apparatus provided in the present invention;
fig. 8 is a schematic structural diagram of the electronic device provided in the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The network topology generation method of the present invention is described below in conjunction with fig. 1-6.
Referring to fig. 1, fig. 1 is a schematic flow chart of a network topology generation method provided by the present invention, and the network topology generation method shown in fig. 1 can be executed by a network topology generation device. As shown in fig. 1, the method for generating a network topology map at least includes:
different network protocols are configured based on the type of device in the target network 101.
In this embodiment of the present invention, the target network may be a network deployed by a target subject, and the type of the target subject is not limited in this embodiment of the present invention, for example, the target subject may be an enterprise, a school, a mall, and the like. The embodiment of the present invention does not limit the type of the target network, and for example, the target network may be a local area network, a metropolitan area network, a wide area network, or the like. The target network may include multiple types of devices, such as computers, virtual machines, switches, routers, and the like, and the multiple types of devices may also include devices from different vendors, such as switches of different brands produced by different companies, switches of different models produced by the same company, and the like.
In the embodiment of the invention, the network protocol supported by the device can be determined according to the type of the device in the target network, therefore, a plurality of network protocols are configured according to the network protocols supported by the devices in the target network, so as to respectively manage different types of devices in the target network through different network protocols, and the embodiment of the invention does not limit the types of the configured network protocols, for example, a first type of network protocol may be configured for computers and virtual machines in the target network, a second type of network protocol may be configured for switches and routers in the target network, etc., the first type of Network Protocol may include a Secure Shell (SSH) Protocol or a remote terminal (Telnet) Protocol, and the second type of Network Protocol may include a Simple Network Management Protocol (SNMP) Protocol.
And 102, respectively scanning the corresponding types of equipment in the target network based on the configured network protocol to acquire the attribute information of the equipment.
In the embodiment of the present invention, after different network protocols are configured according to the types of devices in the target network, the devices of corresponding types in the target network may be scanned respectively through the configured network protocols, so as to obtain the attribute information of the devices in the target network. For example, the first type of network protocol may scan a computer and a virtual machine in a target network in a remote login manner, and the second type of network protocol may scan a switch and a router in the target network in a message receiving manner.
In the embodiment of the present invention, different types of devices in a target network are scanned through different network protocols, and the obtained attribute information of the different types of devices is also different, for example, a computer and a virtual machine in the target network are scanned through a first type of network protocol, so that first attribute information of the computer and the virtual machine can be obtained, a switch and a router in the target network are scanned through a second type of network protocol, so that second attribute information of the switch and the router can be obtained, and the like, where the first attribute information may include information such as an IP address, an MAC address, a subnet mask, and the like, and the second attribute information may include information such as a routing table, a MAC address forwarding table (dottdfdbtadtable), and a base bridge list (dotdbasebridge address).
103, determining the devices in the target network and the connection relationship between the devices based on the acquired attribute information of the devices, and obtaining a network topology map of the target network.
In the embodiment of the present invention, after the devices of the corresponding types in the target network are respectively scanned according to the configured network protocol and the attribute information of the devices in the target network is obtained, the connection relationship between the devices in the target network and the devices in the target network may be determined according to the obtained attribute information of the devices in the target network, so that the network topology diagram of the entire target network may be formed by using the determined devices in the target network as nodes and the connection relationship between the devices in the target network as links. The link between devices in the target network may be determined by different methods according to attribute information of different types of devices, which is not limited in the embodiment of the present invention, for example, the link between devices in the target network may be determined by an IP address according to an IP address and a routing table, the link between devices in the target network may be determined by an MAC address according to an MAC address forwarding table and a base bridge list, and the like.
In the embodiment of the present invention, after determining the connection relationship between the devices in the target network according to the attribute information of the devices in the target network, and forming the network topology map of the target network, the formed topology map of the target network may also be displayed.
According to the network topology map generation method provided by the embodiment of the invention, different network protocols are configured according to the types of the devices in the target network, the devices of corresponding types in the target network are respectively scanned, the attribute information of the devices is obtained, the devices in the target network can be automatically found, the connection relation between the devices in the target network is determined according to the attribute information of the devices, and the links between the devices in the target network can be automatically identified, so that the network topology map of the target network is automatically generated, manual participation is not needed, the accuracy of the generated network topology map can be ensured, the generation efficiency of the network topology map is ensured, the visual display of the network links can be accurately and efficiently realized, and particularly, the automatic updating of the network topology map can be realized for the addition, the deletion and the modification of the devices and/or the links in the network.
Referring to fig. 2, fig. 2 is a schematic flow chart of another network topology generating method provided by the present invention, as shown in fig. 2, the network topology generating method at least includes:
different network protocols are configured 201 based on the type of device in the target network.
In the embodiment of the present invention, the description about 201 may refer to the description about 101 in fig. 1, and thus will not be repeated here.
202, scanning the devices of the corresponding type in the target network based on the configured network protocol, respectively, and obtaining the attribute information of the devices.
In the embodiment of the present invention, the description of 202 may refer to the description of 102 in fig. 1, and thus will not be repeated here.
And 203, analyzing the acquired attribute information of the equipment to generate list attribute information of the equipment.
In the embodiment of the invention, after the corresponding types of devices in the target network are respectively scanned according to the configured network protocol and the attribute information of the devices in the target network is acquired, the obtained attribute information of the devices in the target network can be analyzed to generate the list attribute information of the corresponding devices, the implementation method for analyzing the attribute information of the device may be determined according to the type of the network protocol, which is not limited in this embodiment of the present invention, for example, analyzing the acquired first attribute information of the host and the virtual machine to generate network card list attribute information of the corresponding host and the virtual machine, the obtained second attribute information of the switch and the router is analyzed, and routing table attribute information, MAC address forwarding table attribute information, base bridge list attribute information and the like of the corresponding switch and router can be generated.
And 204, determining the devices in the target network and the connection relationship among the devices based on the generated list attribute information of the devices, and obtaining a network topology map of the target network.
In the embodiment of the present invention, after the obtained attribute information of the target network device is analyzed to generate the list attribute information of the corresponding device, the device in the target network and the connection relationship between the devices in the target network may be determined according to the generated list attribute information of the device, so that the network topology map of the entire target network may be formed by using the determined device in the target network as a node and the connection relationship between the devices in the target network as a link. The link between the devices in the target network may be determined by using different methods according to the list attribute information of different types of devices, which is not limited in the embodiment of the present invention, for example, the link between the devices in the target network may be determined according to the network card list attribute information and the routing table through the IP address, the link between the devices in the target network may be determined according to the MAC address forwarding table attribute information and the base bridge list attribute information through the MAC address, and the like.
Referring to fig. 3, fig. 3 is a schematic flowchart of an application scenario of the network topology generation method provided in the present invention, and as shown in fig. 3, the network topology generation method at least includes:
301, configuring SSH protocol or Telnet protocol based on the host and the virtual machine in the target network; the SNMP protocol is configured based on switches and routers in the target network.
In the embodiment of the present invention, as shown in fig. 4, the execution device of the network topology generation method may include a protocol configuration module, an information discovery module, and a topology generation module, as shown in fig. 5, a network scanning rule may be newly created in the protocol configuration module according to hosts, virtual machines, switches, and routers of different manufacturers, different models, in a target network, an SSH protocol or a Telnet protocol may be configured to scan the hosts and the virtual machines according to the newly created network scanning rule, and an SNMP protocol may be configured to scan the switches and the routers. The embodiment of the present invention does not limit the content of the newly created network scanning rule, for example, the newly created network scanning rule may include user names, IP addresses, etc. of the host and the virtual machine, ports, group names, etc. of the switch and the router.
302, scanning a host and a virtual machine in a target network based on an SSH protocol or a Telnet protocol, and acquiring first attribute information of the host and the virtual machine; and scanning the switch and the router in the target network based on the SNMP protocol to acquire second attribute information of the switch and the router.
In the embodiment of the present invention, as shown in fig. 4 and 5, the information discovery module receives, as the first attribute information, information that the host and the virtual machine perform remote login according to the SSH protocol or the Telnet protocol, and receives, as the second attribute information, a message sent by the switch and the router according to the SNMP protocol. The information discovery module may determine whether the received information and message include the attribute information of the device after receiving the information and message from the device in the target network, and if the received information and/or message do not include the attribute information of the device, may feed back to the protocol configuration module, and the protocol configuration module may reconfigure the network protocol according to the fed-back information, and if the received information and/or message include the attribute information of the device, may use the received information and/or message as the first attribute information and/or the second attribute information.
303, analyzing the acquired first attribute information to generate network card list attribute information of the host and the virtual machine; and analyzing the acquired second attribute information to generate routing table attribute information, ARP table attribute information, MAC address forwarding table attribute information, base bridge list attribute information and STP port list attribute information of the switch and the router.
In the embodiment of the present invention, as shown in fig. 4 and 5, after receiving first attribute information of a host and a virtual machine and second attribute information of a switch and a router, an information discovery module may analyze the first attribute information and the second attribute information, respectively, and obtain network card list attribute information of the host and the virtual machine by analyzing the first attribute information, where the network card list attribute information may include information such as an IP address, an MAC address, and a subnet mask, and obtain routing table attribute information, ARP table attribute information, MAC address attribute information, a bridge list attribute information, and a STP port list (dotstpporttable) attribute information of the switch and the router by analyzing the second attribute information.
304, determining links among devices in the target network through the IP address based on the routing table attribute information and the network card list attribute information; determining a link between devices in a target network through an MAC address based on the attribute information of the MAC address forwarding table and the attribute information of the base bridge list; links between devices in the target network are determined through the cascading ports based on the STP port list attribute information and the base bridge list attribute information.
In the embodiment of the present invention, as shown in fig. 4 and 5, the topology generation module may determine the device in the target network as a node according to the list attribute information obtained by analyzing the first attribute information and the second attribute information, and judging whether a link relation exists between the devices in the target network according to the routing table attribute information and the network card list attribute information, the MAC address forwarding table attribute information and the base bridge list attribute information, and the STP port list attribute information and the base bridge list attribute information in the list attribute information, if so, the link between the devices may be determined by IP address based on the routing table attribute information and the network card list attribute information, determining a link between the devices through the MAC address according to the attribute information of the MAC address forwarding table and the attribute information of the base bridge list, and determining links between the devices through the cascade ports according to the STP port list attribute information and the base bridge list attribute information. Optionally, when there is a case of forwarding by a three-layer switch in the target network, the link between the devices may also be determined by the IP address and the MAC address according to the ARP table attribute information in the list attribute information.
A network topology map of the target network is generated based on the links determined by the IP address, the links determined by the MAC address, and the links determined by the tandem ports 305.
In the embodiment of the present invention, as shown in fig. 4 and 5, after the link determined by the IP address, the MAC address, and the cascade port is passed through, the topology map generation module may generate the network topology map of the target network according to the determined device node and link in the target network, and may display the generated network topology map.
Referring to fig. 6, fig. 6 is a schematic flow chart illustrating a network topology diagram provided by the present invention, and as shown in fig. 6, the method for generating the network topology diagram at least includes:
and 601, respectively acquiring the performance information of the device and the link in the target network based on the configured network protocol.
In this embodiment of the present invention, performance information of the device and the link may also be obtained from a device of a corresponding type in the target network through the configured network protocol, where the performance information of the device and the link may include information of availability of internal resources of the device, bandwidth ratio of the link, network delay, availability, rated speed, and the like, which is not limited in this embodiment of the present invention.
And 602, counting normal and lost devices and links based on the acquired performance information, and determining the states of the devices and the links.
In the embodiment of the present invention, after the performance information of the devices and links in the target network is acquired through the configured network protocol, the devices and links in normal and offline states can be counted and the states of the devices and links in the target network can be determined according to the acquired performance information of the devices and links, for example, the states of the devices and links in the target network can include five levels, namely, normal, prompt, warning, severe and urgent.
603, showing the network topology diagram of the target network, displaying the obtained performance information of the equipment and the link, the counted normal and offline equipment and link information, and displaying the different states of the equipment and the link in different colors according to the determined states of the equipment and the link.
In the embodiment of the present invention, while displaying the network topology diagram of the target network, the performance information of the device and the link, the normal and offline device and link information, and the different states of the device and the link in different colors may be displayed in real time in the network topology diagram according to the obtained performance information of the device and the link in the target network, the counted normal and offline device and link information in the target network, and the determined states of the device and the link in the target network, for example, the rated speed of the link may be directly displayed in the network topology diagram with the effect of line thickness.
In the embodiment, the performance information of the device and the link, the normal and offline device and link information, and the states of the device and the link are displayed in the network topology map, so that management personnel can be helped to know the link condition of the network and the running condition of the device in real time, and the fault node is quickly positioned on the basis of the topology map.
Optionally, as shown in fig. 5, after the network topology of the target network is presented, the devices in the network topology of the target network may be aggregated, a sub-topology based on the aggregated devices may be generated, and the aggregated network topology of the target network and the generated sub-topology may be presented. For example, devices in a certain area in the network topology map of the target network may be aggregated, and the devices in the area may be shown in the form of a sub-topology map. The sub-topological graphs are generated by aggregating the equipment, so that the structure displayed on the interface of the network topological graph can be clearer and more visual for the network with large equipment number, management of managers is facilitated, and the management efficiency of the managers can be improved.
Optionally, after the network topology map of the target network is displayed, the retrieval information may be received, and the received retrieval information is matched with the information of the device or the link in the network topology map of the target network; the retrieval information may include information of a link starting device and a link ending device in the target network, or information of a link state in the target network; the matching links are then presented in highlighted form in the network topology map of the target network. By receiving the retrieval information and retrieving in the network topological graph, the link in an abnormal state in the target network can be quickly positioned, and management of a manager on the target network is facilitated.
Optionally, after the network topology map of the target network is displayed, the devices and links in the network topology map may be added, deleted, and modified in a manual manner, and the network topology map and the devices and links thereof may be enlarged, reduced, dragged, and the like. The flexibility of using the network topological graph can be improved by adding the manual function, and the display performance of the network topological graph is enhanced.
The network topology generating device provided by the present invention is described below, and the network topology generating device described below and the network topology generating method described above may be referred to correspondingly.
Referring to fig. 7, fig. 7 is a schematic structural diagram of a network topology generating device provided by the present invention, the network topology generating device shown in fig. 7 can be used to execute the network topology generating method shown in fig. 1, and as shown in fig. 7, the network topology generating device at least includes:
a protocol configuration module 710 for configuring different network protocols based on the type of device in the target network.
The information discovery module 720 is configured to scan the devices of the corresponding types in the target network based on the configured network protocol, and acquire the attribute information of the devices.
The topology map generation module 730 is configured to determine devices in the target network and connection relationships between the devices based on the obtained attribute information of the devices, so as to obtain a network topology map of the target network.
Optionally, the protocol configuration module 710 is configured to:
configuring a first type of network protocol based on a host and a virtual machine in a target network; the first type of network protocol comprises an SSH protocol or a Telnet protocol;
configuring a second type of network protocol based on the switches and routers in the target network; wherein the second type of network protocol comprises an SNMP protocol.
The information discovery module 720 is configured to:
scanning a host and a virtual machine in a target network based on a first type of network protocol to acquire first attribute information of the host and the virtual machine;
and scanning the switch and the router in the target network based on the second type of network protocol to acquire second attribute information of the switch and the router.
Optionally, the topology map generating module 730 includes:
and the information analysis unit is used for analyzing the acquired attribute information of the equipment to generate list attribute information of the equipment.
And the topological graph generating unit is used for determining the devices in the target network and the connection relation among the devices based on the generated list attribute information of the devices to obtain a network topological graph of the target network.
Optionally, the information parsing unit is configured to:
analyzing the acquired first attribute information to generate network card list attribute information of the host and the virtual machine;
analyzing the acquired second attribute information to generate routing table attribute information, ARP table attribute information, MAC address forwarding table attribute information, base bridge list attribute information and STP port list attribute information of the switch and the router;
the topological graph generating unit is used for:
determining links among devices in a target network through IP addresses based on the routing table attribute information and the network card list attribute information;
determining a link between devices in a target network through an MAC address based on the attribute information of the MAC address forwarding table and the attribute information of the base bridge list;
determining links between devices in the target network through the cascade ports based on the STP port list attribute information and the base bridge list attribute information;
a network topology map of the target network is generated based on the links determined by the IP address, the links determined by the MAC address, and the links determined by the tandem ports.
Optionally, the network topology generation apparatus further includes:
and the information acquisition module is used for respectively acquiring the performance information of the equipment and the link in the target network based on the configured network protocol.
And the information counting module is used for counting normal and lost devices and links based on the acquired performance information and determining the states of the devices and the links.
And the topological graph display module is used for displaying the network topological graph of the target network, displaying the acquired performance information of the equipment and the link, the counted normal and offline equipment and link information, and displaying different states of the equipment and the link in different colors according to the determined states of the equipment and the link.
Optionally, the network topology generation apparatus further includes:
and the sub-topological graph generating module is used for aggregating the equipment in the network topological graph of the target network and generating the sub-topological graph based on the aggregated equipment.
And the topological graph display module is also used for displaying the network topological graph after the target network aggregation and the generated sub-topological graph.
Optionally, the network topology generation apparatus further includes:
the information retrieval module is used for receiving retrieval information and matching the received retrieval information with information of equipment or links in a network topological graph of a target network; the retrieval information includes information of a link start device and a link end device in the target network, or information of a link state in the target network.
And the topological graph display module is also used for displaying the matched link in a highlighted form in the network topological graph of the target network.
Fig. 8 illustrates a physical structure diagram of an electronic device, and as shown in fig. 8, the electronic device may include: a processor (processor)810, a communication interface 820, a memory 830 and a communication bus 840, wherein the processor 810, the communication interface 820 and the memory 830 communicate with each other via the communication bus 840. The processor 810 may invoke logic instructions in the memory 830 to perform a network topology generation method comprising:
configuring different network protocols based on the type of the device in the target network;
respectively scanning equipment of corresponding types in the target network based on the configured network protocol to acquire attribute information of the equipment;
and determining the equipment in the target network and the connection relation between the equipment based on the acquired attribute information of the equipment to obtain a network topology map of the target network.
In addition, the logic instructions in the memory 830 may be implemented in software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
In another aspect, the present invention also provides a computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the network topology generation method provided by the above methods, the method comprising:
configuring different network protocols based on the type of the device in the target network;
respectively scanning equipment of corresponding types in the target network based on the configured network protocol to acquire attribute information of the equipment;
and determining the equipment in the target network and the connection relation between the equipment based on the acquired attribute information of the equipment to obtain a network topology map of the target network.
In yet another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, the computer program being implemented by a processor to perform the network topology generation methods provided by the foregoing methods, the method including:
configuring different network protocols based on the type of the device in the target network;
respectively scanning equipment of corresponding types in the target network based on the configured network protocol to acquire attribute information of the equipment;
and determining the equipment in the target network and the connection relation between the equipment based on the acquired attribute information of the equipment to obtain a network topology map of the target network.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for generating a network topology map is characterized by comprising the following steps:
configuring different network protocols based on the type of the device in the target network;
respectively scanning equipment of corresponding types in the target network based on the configured network protocol to acquire attribute information of the equipment;
and determining the equipment in the target network and the connection relation between the equipment based on the acquired attribute information of the equipment to obtain a network topology map of the target network.
2. The method of claim 1, wherein configuring different network protocols based on the type of device in the target network comprises:
configuring a first type of network protocol based on a host and a virtual machine in the target network; wherein the first type of network protocol comprises an SSH protocol or a Telnet protocol;
configuring a second type of network protocol based on switches and routers in the target network; wherein the second type of network protocol comprises an SNMP protocol;
the scanning, based on the configured network protocol, of the device of the corresponding type in the target network to obtain the attribute information of the device includes:
scanning a host and a virtual machine in the target network based on the first type of network protocol to acquire first attribute information of the host and the virtual machine;
and scanning the switch and the router in the target network based on the second type of network protocol to acquire second attribute information of the switch and the router.
3. The method according to claim 2, wherein the determining, based on the obtained attribute information of the device, the connection relationship between the devices in the target network and obtaining the network topology map of the target network includes:
analyzing the acquired attribute information of the equipment to generate list attribute information of the equipment;
and determining the devices in the target network and the connection relationship between the devices based on the generated list attribute information of the devices to obtain a network topology map of the target network.
4. The method according to claim 3, wherein the analyzing the acquired attribute information of the device to generate the list attribute information of the device includes:
analyzing the acquired first attribute information to generate network card list attribute information of the host and the virtual machine;
analyzing the acquired second attribute information to generate routing table attribute information, ARP table attribute information, MAC address forwarding table attribute information, base bridge list attribute information and STP port list attribute information of the switch and the router;
the determining, based on the generated list attribute information of the devices, a connection relationship between the devices in the target network and obtaining a network topology map of the target network includes:
determining links among the devices in the target network through IP addresses based on the routing table attribute information and the network card list attribute information;
determining links between devices in the target network through MAC addresses based on the MAC address forwarding table attribute information and the base bridge list attribute information;
determining links between devices in the target network through a cascading port based on the STP port list attribute information and the base bridge list attribute information;
generating a network topology map of the target network based on the links determined by the IP address, the links determined by the MAC address, and the links determined by the tandem ports.
5. The network topology map generation method according to any one of claims 1 to 4, further comprising:
respectively acquiring performance information of equipment and a link in the target network based on the configured network protocol;
counting normal and lost equipment and links based on the acquired performance information, and determining the states of the equipment and the links;
and displaying the network topological graph of the target network, displaying the acquired performance information of the equipment and the link, the counted normal and offline equipment and link information, and displaying different states of the equipment and the link in different colors according to the determined states of the equipment and the link.
6. The method according to claim 5, further comprising, after presenting the network topology of the target network:
aggregating the devices in the network topology map of the target network, and generating a sub-topology map based on the aggregated devices;
and displaying the network topology map after the target network aggregation and the generated sub-topology map.
7. The method according to claim 5, wherein said displaying the network topology of the target network further comprises:
receiving retrieval information, and matching the received retrieval information with information of equipment or links in a network topological graph of the target network; wherein the retrieval information comprises information of a link starting device and a link ending device in the target network or information of a link state in the target network;
and displaying the matched link in a highlighted form in the network topological graph of the target network.
8. A network topology map generation apparatus, comprising:
the protocol configuration module is used for configuring different network protocols based on the types of the devices in the target network;
the information discovery module is used for respectively scanning the equipment with the corresponding type in the target network based on the configured network protocol to acquire the attribute information of the equipment;
and the topological graph generating module is used for determining the equipment in the target network and the connection relation between the equipment based on the acquired attribute information of the equipment to obtain a network topological graph of the target network.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the network topology generation method according to any of claims 1 to 7 when executing the program.
10. A non-transitory computer readable storage medium having stored thereon a computer program, wherein the computer program, when executed by a processor, implements the steps of the network topology generation method of any of claims 1 to 7.
CN202210412439.XA 2022-04-19 2022-04-19 Network topology graph generation method and device Active CN114915561B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210412439.XA CN114915561B (en) 2022-04-19 2022-04-19 Network topology graph generation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210412439.XA CN114915561B (en) 2022-04-19 2022-04-19 Network topology graph generation method and device

Publications (2)

Publication Number Publication Date
CN114915561A true CN114915561A (en) 2022-08-16
CN114915561B CN114915561B (en) 2024-02-20

Family

ID=82764380

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210412439.XA Active CN114915561B (en) 2022-04-19 2022-04-19 Network topology graph generation method and device

Country Status (1)

Country Link
CN (1) CN114915561B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115514586A (en) * 2022-11-24 2022-12-23 河北纬坤电子科技有限公司 Access control policy configuration method and electronic equipment
CN117176639A (en) * 2023-11-02 2023-12-05 北京邮电大学 Multi-protocol-based network topology automatic discovery method and device

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030156552A1 (en) * 1998-04-20 2003-08-21 Kim K. Banker Apparatus and method for unilateral topology discovery in network management
CN102143007A (en) * 2011-05-03 2011-08-03 中国南方电网有限责任公司 Distribution-based hierarchical network topology discovery method
CN105072039A (en) * 2015-07-31 2015-11-18 山东蚁巡网络科技有限公司 Link layer network topology discovery method
CN106301909A (en) * 2016-08-11 2017-01-04 杭州华三通信技术有限公司 A kind of port detection method and device
CN108055207A (en) * 2017-10-26 2018-05-18 北京天元创新科技有限公司 A kind of network topology cognitive method and device
CN109525417A (en) * 2018-10-09 2019-03-26 广东美的制冷设备有限公司 Household appliance cut-in method, domestic electric appliances controller and storage medium based on network interface
CN109544349A (en) * 2018-11-29 2019-03-29 广东电网有限责任公司 One kind being based on networked asset information collecting method, device, equipment and storage medium
CN109672740A (en) * 2018-10-15 2019-04-23 无锡华云数据技术服务有限公司 The method of deployment configuration information is obtained in a kind of large-scale cluster environment
CN110784358A (en) * 2019-10-31 2020-02-11 北京宝兰德软件股份有限公司 Method and device for constructing network call relation topological graph
CN111901144A (en) * 2020-06-19 2020-11-06 深圳奇迹智慧网络有限公司 Interaction method and device for Internet of things equipment, computer equipment and storage medium
CN112822053A (en) * 2021-01-13 2021-05-18 科大国创云网科技有限公司 SNMP-based link layer network topology structure discovery method and system
CN112910696A (en) * 2021-01-22 2021-06-04 上海三零卫士信息安全有限公司 Automatic modeling analysis method for network topology
CN113452561A (en) * 2021-06-25 2021-09-28 深信服科技股份有限公司 Topology generation method, device and equipment and readable storage medium
CN114257537A (en) * 2021-12-06 2022-03-29 上海新炬网络信息技术股份有限公司 Network topology self-discovery method based on multi-dimensional priority

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030156552A1 (en) * 1998-04-20 2003-08-21 Kim K. Banker Apparatus and method for unilateral topology discovery in network management
CN102143007A (en) * 2011-05-03 2011-08-03 中国南方电网有限责任公司 Distribution-based hierarchical network topology discovery method
CN105072039A (en) * 2015-07-31 2015-11-18 山东蚁巡网络科技有限公司 Link layer network topology discovery method
CN106301909A (en) * 2016-08-11 2017-01-04 杭州华三通信技术有限公司 A kind of port detection method and device
CN108055207A (en) * 2017-10-26 2018-05-18 北京天元创新科技有限公司 A kind of network topology cognitive method and device
CN109525417A (en) * 2018-10-09 2019-03-26 广东美的制冷设备有限公司 Household appliance cut-in method, domestic electric appliances controller and storage medium based on network interface
CN109672740A (en) * 2018-10-15 2019-04-23 无锡华云数据技术服务有限公司 The method of deployment configuration information is obtained in a kind of large-scale cluster environment
CN109544349A (en) * 2018-11-29 2019-03-29 广东电网有限责任公司 One kind being based on networked asset information collecting method, device, equipment and storage medium
CN110784358A (en) * 2019-10-31 2020-02-11 北京宝兰德软件股份有限公司 Method and device for constructing network call relation topological graph
CN111901144A (en) * 2020-06-19 2020-11-06 深圳奇迹智慧网络有限公司 Interaction method and device for Internet of things equipment, computer equipment and storage medium
CN112822053A (en) * 2021-01-13 2021-05-18 科大国创云网科技有限公司 SNMP-based link layer network topology structure discovery method and system
CN112910696A (en) * 2021-01-22 2021-06-04 上海三零卫士信息安全有限公司 Automatic modeling analysis method for network topology
CN113452561A (en) * 2021-06-25 2021-09-28 深信服科技股份有限公司 Topology generation method, device and equipment and readable storage medium
CN114257537A (en) * 2021-12-06 2022-03-29 上海新炬网络信息技术股份有限公司 Network topology self-discovery method based on multi-dimensional priority

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115514586A (en) * 2022-11-24 2022-12-23 河北纬坤电子科技有限公司 Access control policy configuration method and electronic equipment
CN115514586B (en) * 2022-11-24 2023-03-21 河北纬坤电子科技有限公司 Access control policy configuration method and electronic equipment
CN117176639A (en) * 2023-11-02 2023-12-05 北京邮电大学 Multi-protocol-based network topology automatic discovery method and device
CN117176639B (en) * 2023-11-02 2024-03-08 北京邮电大学 Multi-protocol-based network topology automatic discovery method and device

Also Published As

Publication number Publication date
CN114915561B (en) 2024-02-20

Similar Documents

Publication Publication Date Title
JP7108674B2 (en) Failure root cause determination method and device, and computer storage medium
CN110661669B (en) Network topology automatic discovery method of network equipment based on ICMP, TCP and UDP protocols
CN110247784B (en) Method and device for determining network topology structure
CN114915561B (en) Network topology graph generation method and device
US20030225876A1 (en) Method and apparatus for graphically depicting network performance and connectivity
US7860016B1 (en) Method and apparatus for configuration and analysis of network routing protocols
US8675494B2 (en) Conflict identification in label switched services
US20100061257A1 (en) Network monitoring device, network monitoring method, and network monitoring program
CN109672562B (en) Data processing method and device, electronic equipment and storage medium
CN113273135B (en) Network topology discovery in a substation
US20100094994A1 (en) Network structure information acquiring method and device
CN116545861A (en) Network topology graph generation method, device and equipment
CN113452561A (en) Topology generation method, device and equipment and readable storage medium
US20130042020A1 (en) Quick Network Path Discovery
US20040215781A1 (en) Techniques for determining device connectivity in a network using protocol-specific connectivity information
CN108833129B (en) Network topology discovery method and device
US20040158780A1 (en) Method and system for presenting neighbors of a device in a network via a graphical user interface
US11336502B2 (en) Deriving network device and host connection
CN112787930A (en) Method, device and storage medium for monitoring running state of peer
CN113364681B (en) Network path determination method, network path determination device, electronic apparatus, network path determination medium, and program product
US10904123B2 (en) Trace routing in virtual networks
US20220200860A1 (en) Mitigation of physical network misconfigurations for clustered nodes
CN113766363B (en) Fault monitoring method and device and computing equipment
CN111901179A (en) Method and system for managing Internet of things equipment
CN113542192B (en) Illegal network equipment access detection method and device, computing equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant