CN110995483B - Network topology discovery method and device - Google Patents
Network topology discovery method and device Download PDFInfo
- Publication number
- CN110995483B CN110995483B CN201911200198.7A CN201911200198A CN110995483B CN 110995483 B CN110995483 B CN 110995483B CN 201911200198 A CN201911200198 A CN 201911200198A CN 110995483 B CN110995483 B CN 110995483B
- Authority
- CN
- China
- Prior art keywords
- network
- queue
- network device
- network equipment
- information
- 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.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/12—Discovery or management of network topologies
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE 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/00—Reducing energy consumption in communication networks
Abstract
The application provides a method and a device for discovering network topology, which are applied to each network device of a target subnet, wherein the method comprises the following steps: determining a network equipment queue to be searched according to the IP address of each network equipment and the selected network segment which are included by the target subnet; obtaining a direct connection network equipment queue according to attribute information and connection information of each network equipment in the network equipment queue to be searched, which are obtained through at least one preset protocol; determining type information and state information of each network device in a direct connection network device queue; generating a local topological structure according to the attribute information, the connection information, the type information and the state information of each network device in the direct connection network device queue; and sending the local topological structure to a network management center so that the network management center generates a network topological structure of the target subnet according to the received local topological structure sent by each network device. By applying the embodiment of the application, the application range is larger and the limitation is smaller.
Description
Technical Field
The present application relates to the field of network communication technologies, and in particular, to a method and an apparatus for discovering a network topology.
Background
The current development of computer networks is characterized by continuously enlarged scale, continuously increased complexity and higher heterogeneity, and a network is often composed of a plurality of sub-networks with different sizes and integrates various operating systems, network devices including a plurality of device manufacturers and various network software to provide various services. After a subnet is deployed, network topology discovery is usually required to facilitate network management. The network topology discovery is that all network devices included in a searched subnet and connection relations among the network devices are visually displayed in a graphic mode to obtain a network topology map, and faults, flow and other important device information of subsequent network devices can be directly reflected on the network topology map, so that related personnel can conveniently master the real-time running state of the network devices in time.
At present, a Network topology method is that each Network device in a subnet announces its own existence through a Link Layer Discovery Protocol (LLDP), receives announcement Information of a neighboring Network device at the same time, and stores the Information in a Management Information Base (MIB), and a Network Management center can acquire the Information through a Simple Network Management Protocol (SNMP) interface, and can accurately discover a Network topology structure of the subnet after analyzing the Information.
In the above method for discovering network topology, each network device of the subnet and the network management center need to operate the SNMP, which is not suitable for the network device not operating the SNMP. Therefore, the method has limited application range and great limitation.
Disclosure of Invention
In view of this, the present application provides a method and an apparatus for discovering a network topology, so as to solve the problems of limited application range and large limitation in the related art.
Specifically, the method is realized through the following technical scheme:
a method for discovering network topology is applied to each network device included in a target subnet, and the method comprises the following steps:
determining a network equipment queue to be searched according to the Internet protocol IP address and the selected network segment of each network equipment included in the target subnet;
obtaining a direct connection network equipment queue according to attribute information and connection information of each network equipment in the to-be-searched network equipment queue, which are obtained through at least one preset protocol;
determining type information and state information of each network device in the direct connection network device queue;
generating a local topological structure according to the attribute information, the connection information, the type information and the state information of each network device in the direct connection network device queue;
and sending the local topological structure to a network management center so that the network management center generates the network topological structure of the target subnet according to the received local topological structure sent by each network device.
An apparatus for discovering a network topology, applied to each network device included in a target subnet, the apparatus comprising:
the first determining module is used for determining a network equipment queue to be searched according to the IP address of each network equipment and the selected network segment which are included in the target subnet;
the acquisition module is used for acquiring a direct connection network equipment queue according to the attribute information and the connection information of each network equipment in the network equipment queue to be searched, which are acquired through at least one preset protocol;
the second determining module is used for determining the type information and the state information of each network device in the direct connection network device queue;
the generating module is used for generating a local topological structure according to the attribute information, the connection information, the type information and the state information of each network device in the direct connection network device queue;
and the sending module is used for sending the local topological structure to a network management center so that the network management center generates the network topological structure of the target subnet according to the received local topological structure sent by each network device.
An electronic device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the above-described method steps when executing the program stored on the memory.
A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the above-mentioned method steps.
According to the technical scheme provided by the application, the same protocol does not need to be operated between the network devices in the target subnet, the SNMP does not need to be operated between the network devices in the target subnet and the network management center, the network topology discovery of the target subnet can be finally realized, and the network topology structure of the target subnet is generated.
Drawings
Fig. 1 is a flowchart illustrating a method for discovering a network topology according to the present application;
fig. 2 is a schematic structural diagram of a discovery apparatus of a network topology shown in the present application;
fig. 3 is a schematic structural diagram of an electronic device shown in the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. The following description refers to the accompanying drawings in which the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at" \8230; "or" when 8230; \8230; "or" in response to a determination ", depending on the context.
In order to solve the above problem, an embodiment of the present invention provides a method for discovering a network topology. Referring to fig. 1, fig. 1 is a flowchart of a network topology discovery method shown in the present application, which is applied to each network device included in a target subnet, that is, the target subnet needs to be discovered to generate a network topology structure of the target subnet.
S11: and determining the network equipment queue to be searched according to the Internet Protocol (IP) address and the selected network segment of each network equipment included in the target subnet.
After each network device of the target subnet is deployed, the IP address and the connection relation of each network device are determined, for each network device of the target subnet, the network device to be searched needs to be determined from each network device of the target subnet, and the devices can form a queue of the network devices to be searched.
Wherein, the selected network segment can be set according to actual needs.
S12: and obtaining a direct connection network equipment queue according to the attribute information and the connection information of each network equipment in the network equipment queue to be searched, which are obtained through at least one preset protocol.
Because the protocols on each network device in the target subnet may be different, at least one communication protocol commonly used may be selected as the at least one preset protocol, then the attribute information and the connection information of each network device in the network devices to be searched are obtained through the at least one preset protocol, and then the directly connected network devices are determined according to the information, and the directly connected network devices form a directly connected network device queue.
S13: and determining the type information and the state information of each network device in the direct connection network device queue.
S14: and generating a local topological structure according to the attribute information, the connection information, the type information and the state information of each network device in the direct connection network device queue.
When a local topological structure is generated, in order to avoid cross overlapping of the topological structures, different topological algorithms are provided according to different topological structures, and an independent method is designed for each algorithm, so that expandability can be ensured, for example, but not limited to, the following three algorithms can be adopted: realizing the topological structures of tree shapes, right-angle types (grid types) and divergent types (fountain types).
For facilitating the network management center to query and use the attribute information, connection information, type information and state information of each network device in the direct connection network device queue conveniently, the information may be stored in the MIB.
S15: and sending the local topological structure to a network management center so that the network management center generates a network topological structure of a target subnet according to the received local topological structure sent by each network device.
The local topology can be generated to a network management center periodically, and the network management center generates the network topology of the target subnet according to the received local topology sent by each network device.
According to the technical scheme provided by the application, the same protocol does not need to be operated between the network devices in the target subnet, the SNMP does not need to be operated between the network devices in the target subnet and the network management center, the network topology discovery of the target subnet can be finally realized, and the network topology structure of the target subnet is generated.
Specifically, the determining, according to the IP address and the selected network segment of each network device included in the target subnet in S11, a queue of the network device to be searched includes:
acquiring IP addresses of all network devices included in the selected network segment and the target subnet;
selecting network equipment with IP addresses included in the selected network segment from each network equipment of the target subnet;
and adding the selected network equipment into a queue of the network equipment to be searched.
The network device queue to be searched can be initialized in advance, and the IP address is selected from each network device of the target subnet and included in the network device of the selected network segment, and then the IP address is added into the network device queue to be searched, so that the accuracy of the network device queue to be searched can be ensured.
Specifically, in the S12, the directly connected network device queue is obtained according to the attribute information and the connection information of each network device in the network devices to be searched, which are obtained through at least one preset protocol, and the implementation process specifically includes:
sequentially accessing each network device in the network device queue to be searched through at least one preset protocol to obtain attribute information and connection information of each network device in the network device to be searched;
determining the directly connected network equipment from the connection information of each network equipment in the network equipment queue to be searched;
and adding the determined network equipment into a direct connection network equipment queue.
The direct connection network device queue can be initialized in advance, the connection information of each network device in the network device queue to be searched can comprise information such as connection interfaces with other network devices, and the direct connection network device can be determined based on the information and then added to the direct connection network device queue, so that the accuracy of the direct connection network device queue can be ensured.
Specifically, the determining type information and state information of each network device in the queue of the directly connected network device in S13 specifically includes:
determining type information of corresponding network equipment according to selected information in attribute information of each network equipment in the direct connection network equipment queue;
and acquiring the state information of each network device in the directly connected network device queue through an Internet Control Message Protocol (ICMP).
Wherein the selected information may be, but is not limited to, communication protocol, operating system, etc. information.
Referring to fig. 2, fig. 2 is a schematic structural diagram of a discovery apparatus of a network topology shown in the present application, which is applied to each network device included in a target subnet, and the apparatus includes:
a first determining module 21, configured to determine a to-be-searched network device queue according to the IP address and the selected network segment of each network device included in the target subnet;
the acquiring module 22 is configured to acquire a direct connection network device queue according to attribute information and connection information of each network device in the to-be-searched network device queue, which are acquired through at least one preset protocol;
a second determining module 23, configured to determine type information and state information of each network device in the queue of the directly connected network device;
a generating module 24, configured to generate a local topology structure according to attribute information, connection information, type information, and state information of each network device in the direct connection network device queue;
and a sending module 25, configured to send the local topology to a network management center, so that the network management center generates a network topology of the target subnet according to the received local topology sent by each network device.
According to the technical scheme provided by the application, the same protocol does not need to be operated between each network device in the target subnet, the SNMP does not need to be operated between each network device of the target subnet and the network management center, and finally, the network topology discovery of the target subnet can be realized, and the network topology structure of the target subnet is generated.
In an optional implementation manner, the first determining module 21 determines, according to the IP address of each network device included in the target subnet and the selected network segment, a to-be-searched network device queue, which is specifically configured to:
acquiring IP addresses of all network devices included in the selected network segment and the target subnet;
selecting network equipment with IP addresses included in the selected network segment from each network equipment of the target subnet;
and adding the selected network equipment into a queue of the network equipment to be searched.
In an optional embodiment, the obtaining module 22 is configured to obtain, according to attribute information and connection information of each network device in the network devices to be searched, which are obtained through at least one preset protocol, a direct connection network device queue, and is specifically configured to:
sequentially accessing each network device in the network device queue to be searched through at least one preset protocol to obtain attribute information and connection information of each network device in the network device to be searched;
determining the directly connected network equipment from the connection information of each network equipment in the network equipment queue to be searched;
and adding the determined network equipment into a direct connection network equipment queue.
In an optional implementation manner, the second determining module 23 is configured to determine type information and state information of each network device in the queue of the directly connected network device, and specifically configured to:
determining type information of corresponding network equipment according to selected information in attribute information of each network equipment in the direct connection network equipment queue;
and acquiring the state information of each network device in the direct connection network device queue through the ICMP.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. 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 can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
The embodiment of the present application further provides an electronic device, please refer to fig. 3, which includes a processor 310, a communication interface 320, a memory 330, and a communication bus 340, wherein the processor 310, the communication interface 320, and the memory 330 complete communication with each other through the communication bus 340.
A memory 330 for storing a computer program;
the processor 310 is configured to implement the method for discovering the network topology according to any of the above embodiments when executing the program stored in the memory 330.
The communication interface 320 is used for communication between the electronic device and other devices.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
According to the technical scheme provided by the application, the same protocol does not need to be operated between each network device in the target subnet, the SNMP does not need to be operated between each network device of the target subnet and the network management center, and finally, the network topology discovery of the target subnet can be realized, and the network topology structure of the target subnet is generated.
Accordingly, an embodiment of the present application further provides a computer-readable storage medium, in which instructions are stored, and when the instructions are executed on a computer, the computer is caused to execute the method for discovering a network topology as described in any of the above embodiments.
According to the technical scheme provided by the application, the same protocol does not need to be operated between the network devices in the target subnet, the SNMP does not need to be operated between the network devices in the target subnet and the network management center, the network topology discovery of the target subnet can be finally realized, and the network topology structure of the target subnet is generated.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.
Claims (6)
1. A method for discovering network topology, applied to each network device included in a target subnet, is characterized in that the method comprises:
determining a network equipment queue to be searched according to the Internet protocol IP address and the selected network segment of each network equipment included in the target subnet;
sequentially accessing each network device in the network device queue to be searched through at least one preset protocol to obtain attribute information and connection information of each network device in the network device queue to be searched;
determining the directly connected network equipment from the connection information of each network equipment in the network equipment queue to be searched;
adding the determined network equipment into a direct connection network equipment queue;
determining type information of corresponding network equipment according to selected information in the attribute information of each network equipment in the direct connection network equipment queue;
acquiring the state information of each network device in the direct connection network device queue through an Internet Control Message Protocol (ICMP);
generating a local topological structure according to the attribute information, the connection information, the type information and the state information of each network device in the direct connection network device queue;
and sending the local topological structure to a network management center so that the network management center generates the network topological structure of the target subnet according to the received local topological structure sent by each network device.
2. The method according to claim 1, wherein determining the queue of network devices to be searched according to the IP address and the selected network segment of each network device included in the target subnet specifically comprises:
acquiring IP addresses of all network devices included in the selected network segment and the target subnet;
selecting network equipment with an IP address included in the selected network segment from the network equipment of the target subnet;
and adding the selected network equipment into a queue of the network equipment to be searched.
3. An apparatus for discovering network topology, applied to each network device included in a target subnet, the apparatus comprising:
the first determining module is used for determining a network equipment queue to be searched according to the IP address and the selected network segment of each network equipment included in the target subnet;
the acquisition module is used for sequentially accessing each network device in the network device queue to be searched through at least one preset protocol to obtain attribute information and connection information of each network device in the network device queue to be searched;
determining the directly connected network equipment from the connection information of each network equipment in the network equipment queue to be searched;
adding the determined network equipment into a direct connection network equipment queue;
the second determining module is used for determining the type information of the corresponding network equipment according to the selected information in the attribute information of each network equipment in the direct connection network equipment queue;
acquiring the state information of each network device in the direct connection network device queue through ICMP;
the generating module is used for generating a local topological structure according to the attribute information, the connection information, the type information and the state information of each network device in the direct connection network device queue;
and the sending module is used for sending the local topological structure to a network management center so that the network management center generates the network topological structure of the target subnet according to the received local topological structure sent by each network device.
4. The apparatus according to claim 3, wherein the first determining module determines the queue of network devices to be searched according to the IP addresses of the network devices included in the target subnet and the selected network segment, and is specifically configured to:
acquiring IP addresses of all network devices included in the selected network segment and the target subnet;
selecting network equipment with IP addresses included in the selected network segment from all network equipment of the target subnet;
and adding the selected network equipment into a queue of the network equipment to be searched.
5. An electronic device, characterized in that the electronic device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any one of claims 1-2 when executing a program stored on a memory.
6. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of the claims 1-2.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911200198.7A CN110995483B (en) | 2019-11-29 | 2019-11-29 | Network topology discovery method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911200198.7A CN110995483B (en) | 2019-11-29 | 2019-11-29 | Network topology discovery method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110995483A CN110995483A (en) | 2020-04-10 |
CN110995483B true CN110995483B (en) | 2022-11-01 |
Family
ID=70088357
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911200198.7A Active CN110995483B (en) | 2019-11-29 | 2019-11-29 | Network topology discovery method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110995483B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112636968B (en) * | 2020-12-18 | 2023-03-28 | 中国建设银行股份有限公司 | Network scheme construction method, device, readable medium and equipment |
CN115514586B (en) * | 2022-11-24 | 2023-03-21 | 河北纬坤电子科技有限公司 | Access control policy configuration method and electronic equipment |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108055207A (en) * | 2017-10-26 | 2018-05-18 | 北京天元创新科技有限公司 | A kind of network topology cognitive method and device |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10412042B2 (en) * | 2016-09-21 | 2019-09-10 | Rockwell Automation Technologies, Inc. | Topology based internet protocol (IP) addressing |
-
2019
- 2019-11-29 CN CN201911200198.7A patent/CN110995483B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108055207A (en) * | 2017-10-26 | 2018-05-18 | 北京天元创新科技有限公司 | A kind of network topology cognitive method and device |
Also Published As
Publication number | Publication date |
---|---|
CN110995483A (en) | 2020-04-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110661669B (en) | Network topology automatic discovery method of network equipment based on ICMP, TCP and UDP protocols | |
CN111181801B (en) | Node cluster testing method and device, electronic equipment and storage medium | |
US20090070773A1 (en) | Method for efficient thread usage for hierarchically structured tasks | |
US10587475B2 (en) | Network discovery optimization using supplemental information published by devices | |
CN110995483B (en) | Network topology discovery method and device | |
CN109189758B (en) | Operation and maintenance flow design method, device and equipment, operation method, device and host | |
CN112953774B (en) | Network topology generation method, system, equipment and computer storage medium | |
CN110474960B (en) | Method and device for service deployment in virtual network | |
WO2020232667A1 (en) | Network topology discovery in substation | |
US10749784B2 (en) | Test system and method for IoT e2e testing | |
CN108023763A (en) | The creation method and device of a kind of network topological diagram | |
JP2010097273A (en) | Network configuration information acquisition method and device | |
CN107465621B (en) | Router discovery method, SDN controller, router and network system | |
CN108833129B (en) | Network topology discovery method and device | |
CN110855566B (en) | Method and device for dragging upstream flow | |
CN111988439B (en) | ARP request suppression system, method, equipment and storage medium | |
CN103685405B (en) | Network service system and the method updating firmware thereof | |
US10367710B2 (en) | Method and apparatus for generating network dependencies | |
EP4207702A1 (en) | Dynamic prediction of system resource requirement of network software in a live network using data driven models | |
CN112866011B (en) | Method, device, equipment and medium for determining network topology structure | |
CN113364681B (en) | Network path determination method, network path determination device, electronic apparatus, network path determination medium, and program product | |
CN110769462B (en) | Network access control method and device | |
CN110661655B (en) | Cluster deployment method and system, electronic device and storage medium | |
CN112039696A (en) | Method, device, equipment and medium for generating network topology structure | |
CN111092777B (en) | Method and device for learning forwarding table item |
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 |