CN117176639A - Multi-protocol-based network topology automatic discovery method and device - Google Patents

Multi-protocol-based network topology automatic discovery method and device Download PDF

Info

Publication number
CN117176639A
CN117176639A CN202311445871.XA CN202311445871A CN117176639A CN 117176639 A CN117176639 A CN 117176639A CN 202311445871 A CN202311445871 A CN 202311445871A CN 117176639 A CN117176639 A CN 117176639A
Authority
CN
China
Prior art keywords
network
network equipment
topology
forwarding
network device
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
CN202311445871.XA
Other languages
Chinese (zh)
Other versions
CN117176639B (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 MT-HIRISUN INFORMATION TECHNOLOGY DEVELOPMENT CO LTD
Beijing University of Posts and Telecommunications
Original Assignee
BEIJING MT-HIRISUN INFORMATION TECHNOLOGY DEVELOPMENT CO LTD
Beijing University of Posts and Telecommunications
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 MT-HIRISUN INFORMATION TECHNOLOGY DEVELOPMENT CO LTD, Beijing University of Posts and Telecommunications filed Critical BEIJING MT-HIRISUN INFORMATION TECHNOLOGY DEVELOPMENT CO LTD
Priority to CN202311445871.XA priority Critical patent/CN117176639B/en
Publication of CN117176639A publication Critical patent/CN117176639A/en
Application granted granted Critical
Publication of CN117176639B publication Critical patent/CN117176639B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application provides a network topology automatic discovery method and device based on multiple protocols, wherein the method comprises the following steps: acquiring an IP address of the initial network equipment, and acquiring network information of the network equipment based on the IP address of the initial network equipment; adding the initial network equipment into a discovery queue, acquiring network information of the network equipment in the discovery queue, acquiring the network equipment with a connection relation with the network equipment based on the network information of the network equipment, adding the acquired network equipment into the discovery queue, acquiring the network information of the network equipment in the discovery queue again, repeatedly acquiring the network equipment based on the steps, and constructing a first topological structure; determining a connection relation of network equipment based on the STP forwarding information table of the network equipment in the first topological structure, and supplementing the first topological structure based on the forwarding information to obtain a second topological structure; and constructing a topological graph based on the second topological structure.

Description

Multi-protocol-based network topology automatic discovery method and device
Technical Field
The present application relates to the field of network monitoring technologies, and in particular, to a method and an apparatus for automatically discovering a network topology based on multiple protocols.
Background
Network monitoring, i.e., the real-time sensing and management of the network environment. As the degree of social informatization increases, the number and variety of network devices for various enterprises, government and other social organizations increases rapidly. The amount of daily network management and monitoring is increased and the monitoring content is more complicated due to the variety of network device types and vendors providing network devices. Traditional monitoring approaches have been difficult to follow in the face of changes in the network environment. In the face of the change of network environment, an informationized and automatic network topology discovery tool is needed to sense a complex network environment and acquire network topology information of heterogeneous network equipment so as to perform convenient network sensing and management.
However, the existing network topology discovery tools are not mature in sensing and managing the network, and topology information constructed according to the IP address information and the MAC address information in the actual network is very different, so that errors exist in the topology constructed by using either one of the two modes.
Disclosure of Invention
In view of the foregoing, embodiments of the present application provide a multi-protocol based network topology auto-discovery method and apparatus that obviate or mitigate one or more disadvantages in the prior art.
A first aspect of the present application provides a method for automatically discovering a network topology based on multiple protocols, the method comprising the steps of:
acquiring an IP address of an initial network device, and acquiring network information of the network device based on the IP address of the initial network device, wherein the network information comprises an IP address forwarding table and an MAC address forwarding table;
adding the initial network equipment into a discovery queue, acquiring network information of the network equipment in the discovery queue, acquiring the network equipment with a connection relation with the network equipment based on the network information of the network equipment, adding the acquired network equipment into the discovery queue, acquiring the network information of the network equipment in the discovery queue again, repeatedly acquiring the network equipment based on the steps, and constructing a first topological structure;
the network information also comprises an STP forwarding information table, the connection relation of the network equipment is determined based on the STP forwarding information table of the network equipment in the first topological structure, and the first topological structure is supplemented based on the forwarding information to obtain a second topological structure;
and constructing a topological graph based on the second topological structure.
By adopting the scheme, the scheme is firstly different from the mode of adopting the topology information of one of the link layer and the network layer in the prior art, the scheme comprehensively builds the first topology structure based on the topology information of the IP address forwarding table and the MAC address forwarding table, the accuracy of building the topology graph is improved, the scheme further obtains the forwarding relation of network equipment in the network according to the STP forwarding information table, supplements the forwarding relation of partial network equipment which is missing in the first topology structure, and further improves the accuracy of the topology graph.
In some embodiments of the present application, the step of obtaining a network device having a connection relationship with a network device based on network information of the network device, and adding the obtained network device to a discovery queue includes:
determining whether the network device is in a forwarding state;
if the network equipment is not in a forwarding state, the network equipment is determined to be non-forwarding network equipment;
and if the network equipment is in a forwarding state, determining the network equipment as forwarding network equipment, and adding the forwarding network equipment into a discovery queue.
In some embodiments of the application, the step of determining the network device as a forwarding network device further comprises:
determining whether the forwarding network device has a MAC address forwarding table; if yes, marking the forwarding network equipment as a switch; if not, marking the forwarding network device as a router.
In some embodiments of the present application, the STP forwarding information table stores forwarding relationships of network devices, and the step of determining, based on the STP forwarding information table of the network devices in the first topology, connection relationships of the network devices is to determine connection relationships of the network devices based on the forwarding relationships of the network devices.
In some embodiments of the present application, the step of constructing a topology map based on the second topology further comprises:
acquiring leaf node network equipment from the second topological structure, wherein the leaf node network equipment is forwarding network equipment which has a connection relationship with only one forwarding network equipment;
and acquiring network equipment connected with the leaf node network equipment, adding the network equipment into a second topological structure, acquiring the network equipment connected with the acquired network equipment again, adding the network equipment into the second topological structure again until new network equipment cannot be acquired, and constructing the finally acquired second topological structure into a topological graph.
In some embodiments of the present application, the step of constructing the finally obtained second topology structure into the topology map includes using the network devices in the second topology structure as nodes, and constructing edges on the network devices with connection relations to obtain the topology map.
In some embodiments of the present application, the step of constructing the resulting second topology as a topology map includes sending the topology map to the client, such that the topology map is presented at the client.
In some embodiments of the present application, the step of acquiring the network device connected to the acquired network device includes determining the connected network device based on the destination port based on the port information of the leaf node network device, wherein the port information includes a local port and the destination port.
In some embodiments of the present application, in the steps of adding the acquired network device to the discovery queue, and acquiring the network information of the network device in the discovery queue again, repeatedly acquiring the network device based on the steps, and constructing the first topology structure, repeatedly acquiring the network device based on the steps and adding the network device to the discovery queue until no new network device is added to the discovery queue.
A second aspect of the present application provides a multi-protocol based network topology auto-discovery apparatus comprising a computer device comprising a processor and a memory, the memory having stored therein computer instructions for executing the computer instructions stored in the memory, the apparatus implementing the steps of the above method when the computer instructions are executed by the processor.
A third aspect of the present application provides a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of the aforementioned multi-protocol based network topology automatic discovery method.
Additional advantages, objects, and features of the application will be set forth in part in the description which follows and in part will become apparent to those having ordinary skill in the art upon examination of the following or may be learned from practice of the application. The objectives and other advantages of the application may be realized and attained by the structure particularly pointed out in the written description and drawings.
It will be appreciated by those skilled in the art that the objects and advantages that can be achieved with the present application are not limited to the above-described specific ones, and that the above and other objects that can be achieved with the present application will be more clearly understood from the following detailed description.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate and together with the description serve to explain the application.
FIG. 1 is a schematic diagram of an embodiment of a network topology auto-discovery method based on multiple protocols according to the present application;
FIG. 2 is a schematic diagram of obtaining network topology connection information of a network device according to the present application;
FIG. 3 is a schematic diagram of an architecture of an embodiment of the present application;
FIG. 4 is a general flow diagram of the network topology auto-discovery method based on multiple protocols of the present application;
FIG. 5 is a schematic diagram of another embodiment of a network topology auto-discovery method based on multiple protocols according to the present application;
FIG. 6 is a schematic diagram of an embodiment of the present application for resolving single device network topology data;
fig. 7 is a schematic flow chart of an embodiment of the present application for analyzing network topology data of multiple devices.
Detailed Description
The present application will be described in further detail with reference to the following embodiments and the accompanying drawings, in order to make the objects, technical solutions and advantages of the present application more apparent. The exemplary embodiments of the present application and the descriptions thereof are used herein to explain the present application, but are not intended to limit the application.
It should be noted here that, in order to avoid obscuring the present application due to unnecessary details, only structures and/or processing steps closely related to the solution according to the present application are shown in the drawings, while other details not greatly related to the present application are omitted.
It should be emphasized that the term "comprises/comprising" when used herein is taken to specify the presence of stated features, elements, steps or components, but does not preclude the presence or addition of one or more other features, elements, steps or components.
It is also noted herein that the term "coupled" may refer to not only a direct connection, but also an indirect connection in which an intermediate is present, unless otherwise specified.
Hereinafter, embodiments of the present application will be described with reference to the accompanying drawings. In the drawings, the same reference numerals represent the same or similar components, or the same or similar steps.
In order to solve the above problems, as shown in fig. 1, the present application proposes a network topology automatic discovery method based on multiple protocols, the steps of the method include:
step S100, an IP address of an initial network device is obtained, and network information of the network device is obtained based on the IP address of the initial network device, wherein the network information comprises an IP address forwarding table and an MAC address forwarding table;
in the implementation process, the MAC address forwarding table records the mapping relationship between the MAC address and the port by network devices such as a switch, which represents which port the switch learns from to a certain MAC address, the switch records the information, and the following switch can forward data according to the MAC address table when the following switch needs to forward data.
In the implementation process, the IP address forwarding table records the IP of the destination network device, where the IP of the destination network device is the IP of the directly connected network device, and may also be the IP of the one-hop network device.
As shown in fig. 3, in a specific implementation process, the topology automatic discovery tool of the present solution is provided with a parameter setting module, a data acquisition module, a data analysis module and a topology map generation module, where functions of the parameter setting module include setting an IP address of an initial network device, acquiring network information of the network device through the data acquisition module, and analyzing the network information through the data analysis module to obtain an IP address forwarding table and an MAC address forwarding table.
In the specific implementation process, the data analysis module analyzes the two-layer network and the three-layer network to obtain the IP address forwarding table and the MAC address forwarding table, the work flow of the two-layer network is relatively simple, and the switch forwards the data packet according to the MAC address table. If the MAC address of the destination terminal exists, directly forwarding the data packet to the address; if not, the packet broadcast is sent to all ports. If the destination terminal receives and responds, the switch adds the MAC address to the address table. The network has the advantages of simple operation, but has the disadvantage of easy occurrence of frequent broadcasting operation, resulting in network storm, thereby limiting the networking capability thereof, and generally only a few small local area networks can be built; the three-layer network is more complex and comprises an access layer, a convergence layer and a core layer. The access layer faces the terminal client and provides access functions. In the data transmission process, the two-layer network can realize communication only through MAC addressing, but only supports the same conflict domain; and the three-layer network needs to realize the communication across network segments through IP routing and can cross a plurality of conflict domains. The network devices of the three-layer network have the highest requirements, and high-performance data redundancy switching network devices and balanced load network devices for preventing excessive load are required to be equipped, so that the data volume required to be carried by each core layer switch is reduced.
Step S200, adding the initial network equipment into a discovery queue, acquiring network information of the network equipment in the discovery queue, acquiring the network equipment with a connection relation with the network equipment based on the network information of the network equipment, adding the acquired network equipment into the discovery queue, acquiring the network information of the network equipment in the discovery queue again, repeatedly acquiring the network equipment based on the steps, and constructing a first topological structure;
in a specific implementation process, the topology map generation module acquires topology information to obtain a first topology structure.
In the implementation process, the data analysis module comprises single network equipment network data analysis, multi-network equipment network data analysis and the like. The scheme is oriented to users with network management requirements, can support parameter configuration, topology automatic discovery and automatic analysis, graphical topology display and drilling and acquisition of detailed information of network equipment.
The method comprises the steps of constructing a first topological structure, namely analyzing network data of single network equipment, and analyzing each network equipment in a discovery queue one by one to obtain a connection relation of each network equipment to obtain the first topological structure.
Step S300, the network information further comprises an STP forwarding information table, the connection relation of the network equipment is determined based on the STP forwarding information table of the network equipment in the first topological structure, and the first topological structure is supplemented based on the forwarding information to obtain a second topological structure;
in a specific implementation process, the step of analyzing the network data of the single network device further includes determining, by using the STP forwarding information table, a connection relationship of the network device, supplementing the first topology structure based on the forwarding information, and specifically STP (Spanning Tree Protocol) is a two-layer link management protocol, which is used for preventing a network from generating a loop while providing link redundancy, where the STP forwarding information table records the connection relationship of the network device.
As shown in fig. 6, in the implementation process, the step of analyzing the network data of the single network device specifically includes performing three-layer data analysis on the network device, and if the route entry is a direct connection route on the premise of excluding the self-loop route, adding the current network device and the connecting edge of the destination IP address; if the route entry is a profile route, adding the connecting edge of the current network device and the next hop network device, and adding the destination network device into the discovered vertex network device. And then resolving the IP address forwarding table of the network equipment, adding the current network equipment and the destination network equipment to connect, and recording the corresponding relation between the IP address and the MAC address of the destination network equipment after removing invalid entries such as self-ring and 0.0.0.0. And then resolving the IP port table of the network equipment to acquire all the IP addresses and the corresponding ports of the network equipment on the network. If the network device provides two-layer service for the switch and the like, the MAC address forwarding table of the network device is also analyzed, the connection relation and the MAC address of the network device are acquired through the two layers, and then the corresponding network device is found through the corresponding relation between the IP and the MAC address of the network device. And finally, analyzing the root bridge and the port selected by the STP protocol of the network equipment to prepare for analyzing the network data of the multi-network equipment.
And step S400, constructing a topological graph based on the second topological structure.
In the implementation process, the network equipment in the second topological structure is used as a node, and an edge is built on the network equipment with a connection relationship, so that the topological graph is obtained.
In a specific implementation process, the scheme is further provided with a task timing module, and the step of constructing the topological graph can be executed according to preset time based on the task timing module.
As shown in fig. 4, in the implementation process, the task timing module is provided with a discovery period, the data acquisition module performs validity check on the set parameters, if the set parameters are not legal, the user is prompted to input again, if the set parameters are legal, the topology automatic discovery task is started according to the user setting, and if the user manually starts single automatic discovery, the data acquisition module creates a disposable automatic discovery task and starts immediately.
As shown in fig. 5, in the implementation process, the data acquisition module will discover from the IP address of the initial network device set by the user, and if the IP address of the initial network device is not set, default takes the local as the initial network device. And taking out the first equipment from the discovery queue each time, acquiring network information of the first equipment, carrying out data analysis through a data analysis module, and adding newly discovered equipment in the process into the discovery queue. And circulating the process until the discovery queue is empty, integrating and analyzing the network topology data of the multiple devices by the topology discovery tool, and adding the device detailed information. Finally, it is arranged into the form required by the topological graph.
In some embodiments of the present application, vertex and edge data required for constructing the topology map is generated based on topology information in the second topology structure, and then presented to the front end. The user can intuitively view the current network state and detailed information of certain key devices at the front end.
By adopting the scheme, the scheme is firstly different from the mode of adopting the topology information of one of the link layer and the network layer in the prior art, the scheme comprehensively builds the first topology structure based on the topology information of the IP address forwarding table and the MAC address forwarding table, the accuracy of building the topology graph is improved, the scheme further obtains the forwarding relation of network equipment in the network according to the STP forwarding information table, supplements the forwarding relation of partial network equipment which is missing in the first topology structure, and further improves the accuracy of the topology graph.
As shown in fig. 2, in some embodiments of the present application, the step of acquiring a network device having a connection relationship with a network device based on network information of the network device, and adding the acquired network device to a discovery queue includes:
determining whether the network device is in a forwarding state;
if the network equipment is not in a forwarding state, the network equipment is determined to be non-forwarding network equipment;
in a specific implementation, if the network device is determined to be a non-forwarding network device, the network device may be a storage network device, a virtual machine, or a server.
And if the network equipment is in a forwarding state, determining the network equipment as forwarding network equipment, and adding the forwarding network equipment into a discovery queue.
In some embodiments of the application, the step of determining the network device as a forwarding network device further comprises:
determining whether the forwarding network device has a MAC address forwarding table; if yes, marking the forwarding network equipment as a switch; if not, marking the forwarding network device as a router.
By adopting the scheme, the forwarding state of the equipment is firstly obtained, if the equipment is not forwarding equipment, the equipment is the non-network equipment such as a server, a virtual machine or a storage device, and the equipment is only added into an equipment list, and information is not further obtained; if the equipment is forwarding equipment, further acquiring equipment level service information, judging and marking the equipment as link layer equipment or network layer equipment, then acquiring data information owned by a switch such as an MAC address forwarding table and STP information of the equipment, and if the data information can be acquired, marking the equipment as the switch; otherwise, the marking device is a router. And then, obtaining other network topology information such as a routing table, an IP address conversion table, a device IP port table and the like. Through the acquisition of the basic network topology information of the equipment, the marking of the characteristics of equipment type, the level, forwarding state and the like is completed, meanwhile, the network topology connection information of various protocols of the equipment and the data of the corresponding relation of the equipment ports, IP and MAC addresses are acquired, and preparation is made for the next step of analyzing the equipment network topology data.
Specifically, different parsing flows are adopted for different kinds of network devices. If the device is a router, the routing table of the network device is analyzed, and the connection relation between the current network device and the destination address of the direct connection route and the connection relation between the current network device and the next address of the non-direct connection route are added. Meanwhile, the routing relationship between the network equipment and the subnetwork can be obtained; if the equipment is a switch, analyzing an equipment MAC address forwarding table and an STP protocol, and acquiring the connection relation of the two-layer physical link and the corresponding relation between the ports of the equipment and the MAC address. Then, the general information of the network equipment is analyzed. Firstly, analyzing an IP address conversion table of network equipment, acquiring the relation between the IP address and the MAC address of the equipment, then analyzing an IP port table of the network equipment, and recording all network ports and states of the network ports. For non-network devices, since network topology data cannot be obtained from them, only it is marked as a discovered device, and no additional parsing is performed.
In some embodiments of the present application, the STP forwarding information table stores forwarding relationships of network devices, and the step of determining, based on the STP forwarding information table of the network devices in the first topology, connection relationships of the network devices is to determine connection relationships of the network devices based on the forwarding relationships of the network devices.
By adopting the scheme, the system type, the supported network level and whether the network equipment is in a forwarding state are firstly determined aiming at different types of network equipment, and the network equipment can be divided into a router, a switch and other network equipment which does not bear network functions according to the information.
In some embodiments of the present application, the step of constructing a topology map based on the second topology further comprises:
acquiring leaf node network equipment from the second topological structure, wherein the leaf node network equipment is forwarding network equipment which has a connection relationship with only one forwarding network equipment;
and acquiring network equipment connected with the leaf node network equipment, adding the network equipment into a second topological structure, acquiring the network equipment connected with the acquired network equipment again, adding the network equipment into the second topological structure again until new network equipment cannot be acquired, and constructing the finally acquired second topological structure into a topological graph.
With the above scheme, because the network device generates the tree structure, the topology discovery tool first searches all discovered network devices for the network device with the initial leaf node, i.e. the network device with other network devices on only one port. If the tree structure cannot be found, the network is not generated yet, and analysis is finished; if the starting leaf node network device is found, it is added to the tree structure of the discovered network device connection. And then, iteratively searching the next network device connected with the current tree structure, namely, the network devices of which a certain port appears are all network devices in the current tree structure. And adding the connection relation between the tree structure and the tree structure, and adding the tree structure into the current tree structure. Repeating the steps until all the network devices are added into the tree structure or the network devices meeting the conditions cannot be found, completing the connection relation construction among the network devices, and ending the analysis of the multi-device network data.
In some embodiments of the present application, the step of constructing the finally obtained second topology structure into the topology map includes using the network devices in the second topology structure as nodes, and constructing edges on the network devices with connection relations to obtain the topology map.
In some embodiments of the present application, the step of constructing the resulting second topology as a topology map includes sending the topology map to the client, such that the topology map is presented at the client.
In some embodiments of the present application, the step of acquiring the network device connected to the acquired network device includes determining the connected network device based on the destination port based on the port information of the leaf node network device, wherein the port information includes a local port and the destination port.
As shown in fig. 7, in a specific implementation process, the method further includes analyzing the network data of the multiple network devices that supplements the second topology structure based on port information, where the step of analyzing the network data of the multiple network devices specifically includes: and obtaining the leaf node network equipment from the second topological structure, wherein the network equipment at the leaf node is known to have and only one interface connected with other network equipment due to the nature of the tree structure. By this property, in combination with the connection table entry of the single network device and the port where the connection occurs, a network device conforming to the definition of the leaf node can be found, and then starting from the leaf node, it is added into the set of connected network devices, and the network device connection relationship is built hop by hop. For the discovered tree structure, if the discovered tree structure contains all network devices on a port of a certain network device, the network device is connected with the discovered tree structure, the network device is added into the discovered tree structure, and the connection relation among the network devices is added. And repeating the steps until all network devices are added into the tree structure or no network device meeting the conditions is added, so that the connection relation construction of the tree structure of the network devices can be completed, the network data analysis of the multiple network devices of the topology discovery tool is completed, and the supplement of the second topology structure is completed.
In some embodiments of the present application, in the steps of adding the acquired network device to the discovery queue, and acquiring the network information of the network device in the discovery queue again, repeatedly acquiring the network device based on the steps, and constructing the first topology structure, repeatedly acquiring the network device based on the steps and adding the network device to the discovery queue until no new network device is added to the discovery queue.
By adopting the scheme, the network topology automatic discovery tool can obtain the basic information of the topology map through basic data acquisition and data analysis. And then, generating a topological graph, and graphically displaying the topological graph in the form of vertexes and continuous edges, so that a manager of the network can know the current network condition clearly and intuitively. Meanwhile, the topology discovery tool can compare the discovered equipment with the monitored equipment of the network integrated management system, find out the equipment with the same IP characteristics, further display the detailed information of the equipment on the topology graph, and provide the function of jumping to the equipment details for further operation. According to different strategies set by a user in a parameter setting stage, the topology discovery tool can select any time interval to periodically scan the network environment and update the network environment to a topology graph in real time, so that a network manager can timely sense the change of the network environment. The topology discovery tool also supports a one-touch discovery function, and after a user sends a response request, the topology discovery tool immediately acquires current network environment information according to default parameters and presents the current network environment information to a topology graph.
A second aspect of the present application provides a multi-protocol based network topology auto-discovery apparatus comprising a computer device comprising a processor and a memory, the memory having stored therein computer instructions for executing the computer instructions stored in the memory, the apparatus implementing the steps of the above method when the computer instructions are executed by the processor.
A third aspect of the present application provides a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of the aforementioned multi-protocol based network topology automatic discovery method. The computer readable storage medium may be a tangible storage medium such as Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, floppy disks, hard disk, a removable memory disk, a CD-ROM, or any other form of storage medium known in the art.
Those of ordinary skill in the art will appreciate that the various illustrative components, systems, and methods described in connection with the embodiments disclosed herein can be implemented as hardware, software, or a combination of both. The particular implementation is hardware or software dependent on the specific application of the solution and the design constraints. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application. When implemented in hardware, it may be, for example, an electronic circuit, an Application Specific Integrated Circuit (ASIC), suitable firmware, a plug-in, a function card, or the like. When implemented in software, the elements of the application are the programs or code segments used to perform the required tasks. The program or code segments may be stored in a machine readable medium or transmitted over transmission media or communication links by a data signal carried in a carrier wave.
It should be understood that the application is not limited to the particular arrangements and instrumentality described above and shown in the drawings. For the sake of brevity, a detailed description of known methods is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method processes of the present application are not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between steps, after appreciating the spirit of the present application.
In this disclosure, features that are described and/or illustrated with respect to one embodiment may be used in the same way or in a similar way in one or more other embodiments and/or in combination with or instead of the features of the other embodiments.
The above description is only of the preferred embodiments of the present application and is not intended to limit the present application, and various modifications and variations can be made to the embodiments of the present application by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (10)

1. A multi-protocol based network topology auto-discovery method, the method comprising the steps of:
acquiring an IP address of an initial network device, and acquiring network information of the network device based on the IP address of the initial network device, wherein the network information comprises an IP address forwarding table and an MAC address forwarding table;
adding the initial network equipment into a discovery queue, acquiring network information of the network equipment in the discovery queue, acquiring the network equipment with a connection relation with the network equipment based on the network information of the network equipment, adding the acquired network equipment into the discovery queue, acquiring the network information of the network equipment in the discovery queue again, repeatedly acquiring the network equipment based on the steps, and constructing a first topological structure;
the network information also comprises an STP forwarding information table, the connection relation of the network equipment is determined based on the STP forwarding information table of the network equipment in the first topological structure, and the first topological structure is supplemented based on the forwarding information to obtain a second topological structure;
and constructing a topological graph based on the second topological structure.
2. The automatic discovery method of network topology based on multi-protocol according to claim 1, wherein the step of acquiring a network device having a connection relation with a network device based on the network information of the network device, and adding the acquired network device to a discovery queue comprises:
determining whether the network device is in a forwarding state;
if the network equipment is not in a forwarding state, the network equipment is determined to be non-forwarding network equipment;
and if the network equipment is in a forwarding state, determining the network equipment as forwarding network equipment, and adding the forwarding network equipment into a discovery queue.
3. The multi-protocol based network topology auto-discovery method of claim 2, wherein the step of determining the network device as a forwarding network device further comprises:
determining whether the forwarding network device has a MAC address forwarding table; if yes, marking the forwarding network equipment as a switch; if not, marking the forwarding network device as a router.
4. The automatic discovery method of network topology based on multiple protocols of claim 1, wherein the STP forwarding information table stores forwarding relationships of network devices, and the step of determining connection relationships of network devices based on the STP forwarding information table of network devices in the first topology is to determine connection relationships of network devices based on the forwarding relationships of network devices.
5. The method for automatically discovering a network topology based on multiple protocols of any one of claims 1 to 4, wherein the step of constructing a topology map based on the second topology further comprises:
acquiring leaf node network equipment from the second topological structure, wherein the leaf node network equipment is forwarding network equipment which has a connection relationship with only one forwarding network equipment;
and acquiring network equipment connected with the leaf node network equipment, adding the network equipment into a second topological structure, acquiring the network equipment connected with the acquired network equipment again, adding the network equipment into the second topological structure again until new network equipment cannot be acquired, and constructing the finally acquired second topological structure into a topological graph.
6. The method for automatically discovering network topology based on multiple protocols according to claim 1, wherein the step of constructing the second topology as a topology map comprises constructing edges of network devices having connection relations with the network devices in the second topology as nodes to obtain the topology map.
7. The method for automatically discovering network topology based on multiple protocols according to claim 1, wherein the step of constructing the resulting second topology as a topology map comprises sending the topology map to a client to cause the topology map to be presented at the client.
8. The automatic discovery method of network topology based on multiple protocols of claim 5, wherein the step of acquiring the network device connected to the acquired network device comprises determining the connected network device based on the destination port based on port information of the leaf node network device, the port information including a local port and the destination port.
9. The automatic discovery method of network topology based on multiple protocols according to claim 1, wherein in the steps of adding the acquired network device to a discovery queue and acquiring network information of the network device in the discovery queue again, repeatedly acquiring the network device based on the above steps and constructing a first topology, repeatedly acquiring the network device based on the above steps and adding the network device to the discovery queue until no new network device is added to the discovery queue.
10. A multiprotocol based network topology auto-discovery apparatus, characterized in that the apparatus comprises a computer device comprising a processor and a memory, the memory having stored therein computer instructions for executing the computer instructions stored in the memory, the apparatus realizing the steps of the method according to any of claims 1-9 when the computer instructions are executed by the processor.
CN202311445871.XA 2023-11-02 2023-11-02 Multi-protocol-based network topology automatic discovery method and device Active CN117176639B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311445871.XA CN117176639B (en) 2023-11-02 2023-11-02 Multi-protocol-based network topology automatic discovery method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311445871.XA CN117176639B (en) 2023-11-02 2023-11-02 Multi-protocol-based network topology automatic discovery method and device

Publications (2)

Publication Number Publication Date
CN117176639A true CN117176639A (en) 2023-12-05
CN117176639B CN117176639B (en) 2024-03-08

Family

ID=88930147

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311445871.XA Active CN117176639B (en) 2023-11-02 2023-11-02 Multi-protocol-based network topology automatic discovery method and device

Country Status (1)

Country Link
CN (1) CN117176639B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090285128A1 (en) * 2008-05-15 2009-11-19 Solarwinds.Net, Inc. Using spanning tree protocol (STP) to enhance layer-2 network topology maps
CN101610178A (en) * 2009-07-20 2009-12-23 南京联创科技股份有限公司 Method for obtaining physical layer link network topology based on address forwarding mechanism
CN104579979A (en) * 2015-01-21 2015-04-29 武汉微创光电股份有限公司 Network topology discovery method based on MAC information
CN111224802A (en) * 2018-11-23 2020-06-02 北京国基科技股份有限公司 SNMP-based data link layer network topology discovery method and device
CN114915561A (en) * 2022-04-19 2022-08-16 北京宝兰德软件股份有限公司 Network topological graph generation method and device
CN116545861A (en) * 2023-04-19 2023-08-04 北京宝兰德软件股份有限公司 Network topology graph generation method, device and equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090285128A1 (en) * 2008-05-15 2009-11-19 Solarwinds.Net, Inc. Using spanning tree protocol (STP) to enhance layer-2 network topology maps
CN101610178A (en) * 2009-07-20 2009-12-23 南京联创科技股份有限公司 Method for obtaining physical layer link network topology based on address forwarding mechanism
CN104579979A (en) * 2015-01-21 2015-04-29 武汉微创光电股份有限公司 Network topology discovery method based on MAC information
CN111224802A (en) * 2018-11-23 2020-06-02 北京国基科技股份有限公司 SNMP-based data link layer network topology discovery method and device
CN114915561A (en) * 2022-04-19 2022-08-16 北京宝兰德软件股份有限公司 Network topological graph generation method and device
CN116545861A (en) * 2023-04-19 2023-08-04 北京宝兰德软件股份有限公司 Network topology graph generation method, device and equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
RAKSHIT MEHRA 等: "Analyzing Security Attack on Layer 2 and Comparing the Performance of Different Routing Protocols", 2018 3RD IEEE INTERNATIONAL CONFERENCE ON RECENT TRENDS IN ELECTRONICS, INFORMATION & COMMUNICATION TECHNOLOGY (RTEICT-2018), pages 611 - 616 *
杨裕: "东软NetPatrol拓扑发现子系统的设计与实现", 中国优秀硕士学位论文全文数据库信息科技辑, no. 03, pages 16 - 19 *

Also Published As

Publication number Publication date
CN117176639B (en) 2024-03-08

Similar Documents

Publication Publication Date Title
US9118587B2 (en) Network multi-path discovery
US11171914B2 (en) Systems and methods for automatic inventory and DNS record generation
US9391886B2 (en) Identification of the paths taken through a network of interconnected devices
WO2022037322A1 (en) Network topology management system and method for home networking
CA2457928C (en) Topology discovery by partitioning multiple discovery techniques
US7380025B1 (en) Method and apparatus providing role-based configuration of a port of a network element
JP4018638B2 (en) Method for providing topology awareness information in an IP network
US9544217B2 (en) Identification of paths in a network of mixed routing/switching devices
CN108011746B (en) IP-level global Internet topology mapping method based on Traceroute and SNMP protocol
US9537760B2 (en) Executing loops
EP1560379A1 (en) Methods and systems for unnumbered network link discovery
US9559909B2 (en) Identifying an egress port of a device
US20050047350A1 (en) Apparatus and methods for discovery of network elements in a network
CN107733713B (en) Method, system, device and storage medium for acquiring network topology in hybrid network
CN113452561B (en) Topology generation method, device, equipment and readable storage medium
US9531598B2 (en) Querying a traffic forwarding table
CN108206792B (en) Topological structure discovery method and device of switch
JP2005348051A (en) Device and method for searching topology of network equipment
EP2451125A1 (en) Method and system for realizing network topology discovery
US20130042020A1 (en) Quick Network Path Discovery
CN116545861A (en) Network topology graph generation method, device and equipment
US20040215781A1 (en) Techniques for determining device connectivity in a network using protocol-specific connectivity information
CN116827801B (en) Network topology construction method, device, computer equipment and readable storage medium
CN117176639B (en) Multi-protocol-based network topology automatic discovery method and device
Zhou et al. Discovery algorithm for network topology based on SNMP

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