CN111953507B - Network topology discovery method and device and computer storage medium - Google Patents

Network topology discovery method and device and computer storage medium Download PDF

Info

Publication number
CN111953507B
CN111953507B CN201910413274.6A CN201910413274A CN111953507B CN 111953507 B CN111953507 B CN 111953507B CN 201910413274 A CN201910413274 A CN 201910413274A CN 111953507 B CN111953507 B CN 111953507B
Authority
CN
China
Prior art keywords
resource information
network
topology
interface
target network
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
Application number
CN201910413274.6A
Other languages
Chinese (zh)
Other versions
CN111953507A (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.)
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software Technology 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 China Mobile Communications Group Co Ltd, China Mobile Suzhou Software Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN201910413274.6A priority Critical patent/CN111953507B/en
Publication of CN111953507A publication Critical patent/CN111953507A/en
Application granted granted Critical
Publication of CN111953507B publication Critical patent/CN111953507B/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
    • 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/02Standardisation; Integration
    • H04L41/0213Standardised network management protocols, e.g. simple network management protocol [SNMP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the invention discloses a method, a device and a computer storage medium for discovering network topology, wherein the method comprises the following steps: acquiring full resource information corresponding to a target network; acquiring resource information of all devices in the target network; preprocessing the full resource information to obtain preprocessed resource information; performing network topology discovery based on the preprocessed resource information and a Spark calculation model to construct a network topology of the target network; therefore, the resource information of all the devices in the target network is acquired in a one-time full-scale manner, so that the acquisition time is greatly shortened, and the efficiency of network topology discovery is improved; in addition, through preprocessing the full resource information, the logical topology of the large-scale IP network can be rapidly discovered, and a Spark calculation model can be applied, so that the physical topology is further analyzed and discovered based on the logical topology, and the network topology discovery efficiency is further improved.

Description

Network topology discovery method and device and computer storage medium
Technical Field
The present invention relates to the field of computer network technologies, and in particular, to a method and an apparatus for discovering a network topology, and a computer storage medium.
Background
With the continuous development of computer network technology, the network topology is increasingly complicated and diversified, and the requirement on network management is higher and higher. In the management aspect of an Internet Protocol (IP) network, configuration management provides various resource data such as a network structure, a logical/physical topology connection relation, link information and the like for fault management, performance management and the like, and is used for supporting network management functions such as fault monitoring, fault positioning, performance analysis, congestion analysis and the like, so that accurate network topology is the basis for realizing the management function in the IP network.
In general, a network topology represents a connection relationship between devices in a network. The principle of network topology discovery is to collect information of each device in the network by using a protocol, and generate a complete topology structure through a certain algorithm to display the connection relationship between each device in the network. At present, a network topology discovery method based on a routing forwarding table is common, but in a large-scale network, due to the large number of entries of the routing forwarding table, the method has the problems of long time consumption, low efficiency and easiness in occurrence of acquisition failure or interruption. And based on the heuristic and greedy thought, the network topology discovery method based on the router interface IP address repeated iteration, although the data volume collected and calculated is greatly reduced, the method can not discover the physical layer topology, and the problem of long time consumption still exists in the topology discovery of large networks.
Disclosure of Invention
The invention mainly aims to provide a network topology discovery method, a device and a computer storage medium, which greatly shorten the time consumption for acquisition and improve the efficiency of network topology discovery by acquiring the resource information of all devices in a target network in a one-time full-scale manner; in addition, a Spark calculation model can be applied, so that the physical topology can be further analyzed and found based on the logic topology, and the efficiency of network topology discovery is further improved.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
in a first aspect, an embodiment of the present invention provides a method for discovering a network topology, where the method includes:
acquiring full resource information corresponding to a target network; the total resource information is obtained by collecting resource information of all devices in the target network;
preprocessing the full resource information to obtain preprocessed resource information;
and discovering network topology based on the preprocessed resource information and a Spark calculation model, and constructing the network topology of the target network.
In the above scheme, before the obtaining of the full resource information corresponding to the target network, the method further includes:
And acquiring resource information of all equipment in the target network to obtain full resource information corresponding to the target network.
In the above solution, the acquiring resource information of all devices in the target network to obtain full resource information corresponding to the target network includes:
acquiring resource information of all devices in the target network based on a Simple Network Management Protocol (SNMP);
acquiring total resource information corresponding to the target network according to the acquired result; the full resource information comprises an interface information table, an internet protocol IP address mapping table and a logic bearing relation table.
In the above scheme, the preprocessing the full amount of resource information to obtain preprocessed resource information includes:
determining associated resource information associated with the IP address mapping table; wherein, the associated resource information is obtained after the interface information table is associated with the IP address mapping table;
and preprocessing the associated resource information according to a preset filtering strategy to obtain preprocessed resource information.
In the above solution, the determining associated resource information associated with the IP address mapping table includes:
Acquiring an interface index and an interface IP address corresponding to the interface index according to the IP address mapping table;
and correspondingly adding the interface IP address into the interface information table based on the interface index in the interface information table to obtain the associated resource information.
In the above scheme, the discovering the network topology based on the preprocessed resource information and the Spark calculation model to construct the network topology of the target network includes:
matching the preprocessed resource information to obtain the logic topology of the target network;
analyzing the logical topology based on a Spark calculation model to obtain the physical topology of the target network; wherein the network topology includes a logical topology and a physical topology.
In the above solution, before the matching processing is performed on the preprocessed resource information to obtain the logical topology of the target network, the method further includes:
and sequencing the preprocessed resource information to obtain sequenced resource information.
In the above scheme, the matching the preprocessed resource information to obtain the logical topology of the target network includes:
According to the sorted resource information, two adjacent interface IP addresses and two ports corresponding to the two interface IP addresses are obtained;
judging whether the IP addresses of the two adjacent interfaces meet a preset mask rule or not;
when the IP addresses of the two adjacent interfaces meet a preset mask rule, matching the two ports as an intra-network link in the target network;
when the two adjacent interface IP addresses do not meet a preset mask rule, constructing an interface IP address of an opposite end port according to the preset mask rule, and matching a source end port of the two ports with the opposite end port to form an internetwork interconnection link in the target network;
and obtaining the logic topology of the target network based on the intra-network link and the inter-network interconnection link.
In the foregoing solution, the analyzing the logical topology based on the Spark calculation model to obtain the physical topology of the target network includes:
acquiring a logic bearing relation table based on the full resource information;
based on a Spark calculation model, performing traversal query on the logic bearing relation table according to the equipment IP address and the port index in the logic topology, and determining a physical interface corresponding to each port index;
And acquiring the physical topology of the target network based on the physical interface corresponding to each port index.
In the above scheme, the determining the physical interface corresponding to each port index includes:
and in the process of traversing and inquiring the logic bearing relation table, when the lower bearing interface index is 0, determining a physical interface corresponding to each port index.
In a second aspect, an embodiment of the present invention provides a network topology discovery apparatus, where the network topology discovery apparatus includes: an acquisition unit, a pre-processing unit and a network topology discovery unit, wherein,
the acquisition unit is configured to acquire full resource information corresponding to a target network; the total resource information is obtained by collecting resource information of all devices in the target network;
the preprocessing unit is configured to preprocess the full resource information to obtain preprocessed resource information;
the network topology discovering unit is configured to discover a network topology based on the preprocessed resource information and a Spark calculation model, and construct a network topology of the target network.
In a third aspect, an embodiment of the present invention provides a network topology discovery apparatus, where the network topology discovery apparatus includes: a memory and a processor; wherein the content of the first and second substances,
The memory for storing a computer program operable on the processor;
the processor, when executing the computer program, is configured to perform the steps of the method according to any of the first aspects.
In a fourth aspect, an embodiment of the present invention provides a computer storage medium storing a network topology discovery program, which when executed by at least one processor implements the steps of the method according to any one of the first aspect.
The embodiment of the invention provides a method, a device and a computer storage medium for discovering network topology, which are characterized in that full resource information corresponding to a target network is obtained; the total resource information is obtained by collecting resource information of all devices in the target network; preprocessing the full resource information to obtain preprocessed resource information; performing network topology discovery based on the preprocessed resource information and a Spark calculation model to construct a network topology of the target network; therefore, the resource information of all the devices in the target network is acquired in a full amount at one time, iterative acquisition and analysis of one device to another device are not needed, the acquisition time is greatly shortened, and the efficiency of network topology discovery is improved; in addition, through preprocessing the full resource information, the logical topology of the large-scale IP network can be rapidly discovered, and a Spark calculation model can be applied, so that the physical topology is further analyzed and discovered based on the logical topology, and the network topology discovery efficiency is further improved.
Drawings
Fig. 1 is a schematic flowchart of a network topology discovery method according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of another network topology discovery method according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of another network topology discovery method according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of another network topology discovery method according to an embodiment of the present invention;
fig. 5 is a schematic flowchart of another network topology discovery method according to an embodiment of the present invention;
fig. 6 is a schematic flowchart of a further network topology discovery method according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a network topology discovery architecture according to an embodiment of the present invention;
fig. 8 is a schematic diagram illustrating an effect of network topology discovery according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a network topology discovery apparatus according to an embodiment of the present invention;
fig. 10 is a schematic diagram of a specific hardware structure of a network topology discovery apparatus according to an embodiment of the present invention.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
Network Topology (Network Topology) refers to the distribution and connection status between Network nodes in a communication Network, including routers, switches, bridges, hubs, and end devices. Network Topology Discovery (Network Topology Discovery) refers to acquiring and maintaining existence information of Network nodes and connection relation information between the Network nodes, and provides a diagram of the connection state of the whole Network on the basis of the information, so that not only can Network managers know and understand the whole Network Topology structure integrally, but also the Network managers can be helped to perform Network fault positioning and performance analysis.
The network management comprises five functions of fault management, configuration management, charging management, performance management, safety management and the like. In the management aspect of the IP network, configuration management provides various resource data such as a network structure, a logical/physical topology connection relationship, link information, and the like for functions such as fault management, performance management, and the like, and is used to support network management functions such as fault monitoring, fault location, performance analysis, congestion analysis, and the like, so that accurate network topology is the basis for implementing all management functions in the IP network.
For the discovery of network topology, the existing technical solution is mainly a network topology discovery method based on a routing forwarding table, which includes logical topology discovery based on the routing forwarding table and physical topology discovery based on an Address Resolution Protocol (ARP) cache table. Specifically, generally, an initial router needs to be selected to find a logical topology, then a Simple Network Management Protocol (SNMP) or a login device is used to collect a routing forwarding table, and subnet information directly connected to the initial router and a next hop address of the routing forwarding table are obtained through analysis, so as to determine which devices the initial router has topological connection with; the above steps are repeatedly performed for newly discovered devices until no new devices are discovered. The similar method is still adopted for discovering the physical topology, the ARP cache tables of all the switches are collected firstly, the direct connection relation between the switches is calculated, and then the physical topology is discovered. However, the method is still applicable to a small IP network, but in a large IP network, for example, an operator backbone network, because the network size is large and the number of routing entries is large (for example, hundreds of thousands of orders), on one hand, reading a routing forwarding table through an SNMP protocol consumes a long time and is easy to fail in acquisition or interrupt in acquisition; on the other hand, when information such as a direct connection route and a next hop address is searched in a traversal mode based on a route forwarding table due to the fact that redundant data are too much, the problems of large resource consumption and low efficiency exist.
In order to improve the efficiency of network topology discovery in a large IP network, Qinghua university provides a network topology discovery method based on heuristic and greedy methods and repeated iteration based on the IP address of a router interface. The method comprises the steps of firstly, acquiring all interface addresses and subnet masks of an initial router, then calculating subnet addresses connected with the initial router according to the interface addresses and the subnet masks, and deducing subnet IP addresses according to the calculated subnet addresses; then, for the deduced subnet IP address, the type of the equipment is judged by using the identifier provided by the SNMP protocol and the border gateway protocol; if the type is the router, determining that the new routing equipment is discovered this time, and continuously repeating the steps for the new routing equipment until no new routing equipment is discovered. Compared with a topology discovery method based on a routing forwarding table, the method has the advantages that the basic data of the inferred topological connection is replaced by the interface IP address from the routing forwarding table, so that the data volume needing to be collected and calculated is greatly reduced, and the discovery efficiency of the network topology is improved; however, the method still needs to detect, infer and verify equipment by equipment, and the efficiency is reduced along with the increase of the number of the equipment or the network scale, so that the problem of long time consumption still exists in the topology discovery of the large-scale IP network; in addition, the method can only discover three-layer logical topology, and cannot discover two-layer physical topology.
Because a large number of interface IP addresses, interface index iterative query, matching and other processes can be involved in the discovery of the logical topology and the physical topology of a large IP network, the performance and timeliness requirements cannot be met by adopting the existing technical scheme at present; based on this, the embodiment of the present invention provides a process for discovering a network topology by using a Spark calculation model. Among them, Spark was developed by AMP laboratories, burley division, university of california, and was used to build large, low-latency data analysis applications. Spark is an open source distributed computing framework that can distribute programs to multiple devices in a cluster, and also provides an elegant programming model. Compared with the general framework of MapReduce, Spark inherits the linear expansibility and the fault tolerance of MapReduce, and meanwhile, the computation of Spark is based on a memory, so that the computation task based on Spark is processed more quickly; in addition, Spark also enables a missile-type Distributed data sets (RDD), and the RDD has the characteristics of abstraction, delay calculation and the like, so Spark is very suitable for algorithms or calculation tasks involving a large number of iterations. Thus, in the embodiment of the invention, by using the Spark calculation model, the physical topology can be further analyzed and found based on the logical topology, and the efficiency of network topology discovery is further improved.
In the embodiment of the invention, the full resource information corresponding to the target network is obtained; acquiring resource information of all devices in the target network; preprocessing the full resource information to obtain preprocessed resource information; performing network topology discovery based on the preprocessed resource information and a Spark calculation model to construct a network topology of the target network; therefore, the resource information of all the devices in the target network is acquired in a full amount at one time, iterative acquisition and analysis of one device to another device are not needed, the acquisition time is greatly shortened, and the efficiency of network topology discovery is improved; in addition, through preprocessing the full resource information, the logical topology of the large-scale IP network can be rapidly discovered, and a Spark calculation model can be applied, so that the physical topology is further analyzed and discovered based on the logical topology, and the network topology discovery efficiency is further improved.
Embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
Referring to fig. 1, a flowchart of a network topology discovery method according to an embodiment of the present invention is shown. As shown in fig. 1, the method may include:
S101: acquiring full resource information corresponding to a target network; the total resource information is obtained by collecting resource information of all devices in the target network;
it should be noted that the total resource information is obtained by collecting resource information of all devices in the target network; for example, the basic data such as interface information, interface IP address information, and relationship information between an interface and a logic layer of each device in the target network may be acquired based on the SNMP protocol, so that the total resource information such as an interface information table (represented by RFC-2863IF-MIB, ifTable), an IP address mapping table (represented by RFC1312-MIB, ipAddrTable), and a logic bearer relationship table (represented by RFC-2863IF-MIB, ifStackTable) may be sequentially obtained, and thus the total resource information corresponding to the target network may be obtained.
S102: preprocessing the full resource information to obtain preprocessed resource information;
it should be noted that after the full resource information is acquired, the full resource information may be preprocessed. The preprocessing may be to filter the full resource information, or to perform correlation processing on the full resource information before the filtering, and then perform filtering processing on the correlated resource information. Therefore, non-service interfaces can be filtered out by preprocessing the full resource information, so that redundant data can be reduced, and subsequent network topology discovery is facilitated.
S103: and discovering network topology based on the preprocessed resource information and a Spark calculation model, and constructing the network topology of the target network.
It should be noted that the network topology includes a logical topology and a physical topology. After the preprocessing of the full resource information, the network topology discovery may be performed on the preprocessed resource information to respectively construct a logical topology and a physical topology. The preprocessed resource information may be first subjected to matching processing (for example, links are matched by using a method based on a mask rule), so that a logical topology may be constructed; and then, analyzing the logical topology by using a Spark calculation model based on a divide-and-conquer idea, and quickly disassembling a physical layer circuit so as to construct the physical topology.
It should be further noted that the computation of the Spark calculation model is based on the memory, so that the Spark-based calculation task is processed more quickly; meanwhile, the Spark calculation model also enables RDD, and the RDD has the characteristics of abstraction, delay calculation and the like, so that the Spark calculation model is very suitable for algorithms or calculation tasks involving a large number of iterations. In addition, Spark is an open source distributed computing framework, and can distribute a program to a plurality of devices in a cluster; in this way, the physical topology is calculated based on the Spark calculation model, and the efficiency of network topology discovery can be greatly improved by simultaneously analyzing the physical layer circuit by a plurality of devices.
In the embodiment of the invention, first, the full resource information corresponding to a target network is obtained, wherein the full resource information is obtained by collecting the resource information of all devices in the target network; therefore, the resource information of all the devices in the target network is acquired at one time, and iterative acquisition and analysis of the devices one by one are not needed, so that the acquisition time is greatly shortened, and the network topology discovery efficiency is improved; then, preprocessing the full resource information to obtain preprocessed resource information; performing network topology discovery based on the preprocessed resource information and a Spark calculation model to construct a network topology of the target network; through preprocessing the full resource information, the logic topology of the large IP network can be quickly discovered, and a Spark calculation model can be applied, so that the physical topology can be further analyzed and discovered based on the logic topology, and the network topology discovery efficiency is further improved.
It can be understood that, in order to acquire the full amount of resource information, the resource information of all the devices in the target network needs to be acquired. Thus, in some embodiments, prior to S101, the method may further include:
S201: and acquiring resource information of all equipment in the target network to obtain the full resource information corresponding to the target network.
The target network includes devices such as a router, a switch, a bridge, a hub, and a terminal device; the embodiment of the invention can carry out one-time full-scale collection on the resource information of the devices. Specifically, in some embodiments, referring to fig. 2, a flowchart of another network topology discovery method provided by an embodiment of the present invention is shown. As shown in fig. 2, for S201, the method may include:
s201 a: acquiring resource information of all devices in the target network based on an SNMP (simple network management protocol);
s201 b: acquiring the total resource information corresponding to the target network according to the acquired result; the full resource information comprises an interface information table, an Internet Protocol (IP) address mapping table and a logic bearing relation table.
It should be further noted that the total resource information is obtained by collecting the resource information of all the devices in the target network. The method can acquire basic data such as interface information, interface IP address information and relationship information of interfaces and logic layers of all devices in a target network through an SNMP protocol, so that total resource information such as an interface information table (expressed by RFC-2863IF-MIB and ifTable), an IP address mapping table (expressed by RFC1312-MIB and ipAddrTable) and a logic bearing relationship table (expressed by RFC-2863IF-MIB and ifStackTable) can be obtained in sequence. Specifically, the interface information table includes information such as interface indexes, interface names, and interface descriptions of all interfaces and logical ports of the collected device; the IP address mapping table describes interface information corresponding to the IP address of the collected equipment, and the IP address mapping table comprises an interface index, an interface IP address, a subnet mask and the like; the logical bearing relation table describes the bearing relation between each logical layer and its lower logical layer or interface, and the logical bearing relation table includes an upper bearing interface index, a lower bearing interface index, a bearing state and the like.
In the embodiment of the invention, the full resource information corresponding to the target network is obtained, and the full resource information is obtained by collecting the resource information of all the devices in the target network; therefore, the resource information of all the devices in the target network is acquired at one time, and iterative acquisition and analysis of the devices one by one are not needed, so that the acquisition time is greatly shortened, and the efficiency of network topology discovery can be improved.
Further, in some embodiments, referring to fig. 3, a flowchart of another network topology discovery method provided by an embodiment of the present invention is shown. As shown in fig. 3, for S102, the preprocessing the full resource information to obtain preprocessed resource information, where the method may include:
s102 a: determining associated resource information associated with the IP address mapping table; wherein, the associated resource information is obtained after the interface information table is associated with the IP address mapping table;
it should be noted that the associated resource information is obtained by associating the interface information table with the IP address mapping table. After the full resource information is obtained, an interface information table and an IP address mapping table can be obtained according to the full resource information; because the interface information table and the IP address mapping table both contain interface indexes, the interface information table and the IP address mapping table can be associated based on the interface indexes. Specifically, in some embodiments, S102a may include:
S102 a-1: acquiring an interface index and an interface IP address corresponding to the interface index according to the IP address mapping table;
s102 a-2: and correspondingly adding the interface IP address into the interface information table based on the interface index in the interface information table to obtain the associated resource information.
It should be noted that, according to the IP address mapping table, the interface index and the interface IP address corresponding to the interface index can be obtained; the interface information table also comprises an interface index, so that the interface IP address association can be supplemented to the interface information table based on the interface index, and the associated resource information can be obtained.
After the associated information is obtained, the associated resource information may be analyzed and filtered, so that the preprocessed resource information may be obtained. Specifically, the associated resource information is filtered according to a preset filtering policy to implement preprocessing of the full resource information.
S102 b: and preprocessing the associated resource information according to a preset filtering strategy to obtain preprocessed resource information.
It should be noted that the preset filtering policy represents a pre-designed filtering rule for performing non-service interface filtering on the associated resource information, so that redundant data can be reduced. The preset filtering policy may be designed based on a service type carried by a target network, may also be designed based on a usage rule of an equipment interconnection address, and may even be designed based on a filtering rule.
Specifically, when the preset filtering policy is designed based on the type of traffic carried by the target network, for example, for an IP network carrying public network traffic, all private network addresses 10.0.0.0/8, 172.16.0.0/12, 192.168.0/16 may be filtered, and a loopback address and a local address 127.0.0.1 may also be filtered; if the IP bearer network is used for carrying the internal traffic, signaling and IT system flow of the operator, the filtering process can be carried out according to the filtering rule designed by the address field division condition. In addition, when the preset filtering policy is designed based on the usage rule of the device interconnection address, in order to save IP address resources, the device interconnection addresses in the large IP network may also all follow the usage rule of a pair of 30-bit mask addresses, and at this time, the filtering process may be performed on the subnet mask not equal to 255.255.255.252.
Generally, the target network is a layered design, for example, divided into a core layer, a convergence layer, an access layer, and the like; in order to facilitate network management, a logical link usually uses the higher-level end as the source end, so that after the filtering processing of the resource information is completed, the logical link can be sorted once according to the device level, the device name, the interface name, and the like, and the sorting result is numbered, and then the source end port and the destination end port of the logical link are determined according to the size of the sorting number.
In the embodiment of the invention, the preprocessed resource information is obtained by preprocessing the full resource information; because the preprocessed resource information filters illegal addresses, non-service interfaces and the like, redundant data in the whole resource information is reduced, and the subsequent network topology discovery is facilitated.
It can be understood that after the full resource information is preprocessed, the preprocessed resource information can be matched with the link by adopting a method based on a mask rule to construct a logic topology; and then analyzing the logical topology according to a Spark calculation model, and quickly disassembling a physical layer circuit to construct the physical topology. Therefore, in some embodiments, refer to fig. 4, which illustrates a flowchart of another network topology discovery method provided in the embodiments of the present invention. As shown in fig. 4, for S103, the performing network topology discovery based on the preprocessed resource information and the spare computation model to construct the network topology of the target network, the method may include:
s103 a: matching the preprocessed resource information to obtain the logic topology of the target network;
It should be noted that, in combination with the usage rule of the device interconnection address in the target network, it is assumed that the source port and the destination port of each logical link both use a pair of 30-bit mask addresses, and the 30-bit mask addresses only include 4 addresses; wherein, the 1 st is a subnet address, the 4 th is a broadcast address, only the 2 nd and the 3 rd of the actual available addresses are available IP addresses, the two available IP addresses need to satisfy the condition that the first three segments are completely consistent, and the last segment has a numerical difference of 1. For example, the source port has an interface IP address of 221.176.23.37, and the destination port that satisfies the 30-bit mask rule has an interface IP address of 221.176.23.38. The matching process of the logical link in the target network will be performed based on this masking rule.
Further, before performing the matching processing, the preprocessed resource information needs to be sequenced; after the sorting processing, only two adjacent pieces of record information may be subjected to matching processing, for example, whether two interface IP addresses corresponding to two adjacent pieces of record information meet a preset mask rule is compared, and whether the two interface IP addresses can be matched is determined according to a comparison result. Therefore, in some embodiments, refer to fig. 5, which shows a flowchart of another network topology discovery method provided by an embodiment of the present invention. As shown in fig. 5, before S103a, the method may further include:
S103 a-1: sequencing the preprocessed resource information to obtain sequenced resource information;
it should be noted that, the resource information after the preprocessing is subjected to sorting processing, which may be performed according to device hierarchy or device name, interface name, or even interface IP address. In the embodiment of the present invention, the sorting process according to the interface IP addresses will be described as an example.
Taking the interface IP address sorting process as an example, because the interface IP address is in a decimal point system, in order to facilitate the sorting process, the interface IP address in the decimal point system may be first converted into an integer interface IP address, and then the sorting process is performed on the preprocessed resource information based on the integer interface IP address. In this way, each piece of record information in the sorted resource information only needs to be matched with the adjacent record information.
In some embodiments, after step S103a-1, the sorted resource information needs to be subjected to matching processing. Thus, as shown in fig. 5, for S103a, the matching the preprocessed resource information to obtain the logical topology of the target network, the method may include:
S103 a-2: according to the sorted resource information, two adjacent interface IP addresses and two ports corresponding to the two interface IP addresses are obtained;
s103 a-3: judging whether the IP addresses of the two adjacent interfaces meet a preset mask rule or not;
s103 a-4: when the IP addresses of the two adjacent interfaces meet a preset mask rule, matching the two ports as an intra-network link in the target network;
s103 a-5: when the two adjacent interface IP addresses do not meet a preset mask rule, constructing an interface IP address of an opposite end port according to the preset mask rule, and matching a source end port of the two ports with the opposite end port to form an internetwork interconnection link in the target network;
s103 a-6: and obtaining the logic topology of the target network based on the intra-network link and the inter-network interconnection link.
It should be noted that each logical link includes a source port and a destination port. After the full resource information is preprocessed, the preprocessed resource information can be sequenced, and then matching processing is performed on the sequenced resource information, so that the construction of the logic topology is realized. When two adjacent interface IP addresses meet a preset mask rule, two ports corresponding to the two interface IP addresses can be directly matched as an intra-network link in the target network (namely, a source port and a destination port of the link belong to the same target network); when the two adjacent interface IP addresses do not satisfy the preset mask rule, at this time, an interface IP address of an opposite end port needs to be established according to the preset mask rule, and then a source end port and an opposite end port of the two ports are matched as an internetwork interconnection link in the target network (that is, the source end port and the destination end port of the link do not belong to the same target network).
It should be further noted that the preset mask rule represents a preset link matching rule for performing logical topology construction on the target network. Generally, the preset mask rule may be a rule used by a 30-bit mask address, and is also referred to as a 30-bit mask rule in the embodiment of the present invention. Exemplarily, after the sorted resource information is obtained, each piece of record information in the sorted resource information only needs to be compared with adjacent record information, that is, two adjacent interface IP addresses are compared, and whether the two adjacent interface IP addresses meet a preset mask rule is determined; if two adjacent interface IP addresses meet a preset mask rule, namely the difference between the integral interface IP addresses corresponding to the two pieces of record information is 1, the two pieces of record information are matched into an intra-network link, and a source end port and a destination end port of the link belong to the same IP network; the record information with small sequence number is selected as a source port, and the record information with large sequence number is selected as a destination port. Otherwise, if the two adjacent interface IP addresses do not satisfy the preset mask rule, that is, the difference between the integral interface IP addresses corresponding to the two pieces of record information is not 1, the two pieces of record information cannot be matched as an intra-network link, and at this time, the interface IP address of a destination port (i.e., an opposite port) needs to be constructed according to the 30-bit mask rule, so that an inter-network interconnection link can be matched, and a source port and the destination port of the link belong to different IP networks. In addition, for the internetwork interconnection link, the network type of the opposite terminal port can be further determined by combining the keywords in the interface description information. After the intra-network links and the internetwork interconnection links are completely matched, all intra-network links (generally, belonging to intra-network three-layer logical links) and internetwork interconnection links in the target network are discovered, and therefore logical topology discovery of the target network is completed.
In the embodiment of the invention, the preprocessed resource information is matched to obtain the logical topology of the target network, and the automatic discovery of the whole network topology can be completed by one-time sequencing matching; compared with the prior art, the method for calculating the IP address and verifying and analyzing the IP address by adopting the direct-connected subnet, the next hop of the route and the heuristic and greedy methods can reduce the analysis times from N times (N is the number of equipment in the target network) to 1 time, thereby further improving the efficiency of network topology discovery.
S103 b: analyzing the logical topology based on a Spark calculation model to obtain the physical topology of the target network; wherein the network topology includes a logical topology and a physical topology.
It should be noted that, after the logical topology is constructed, the logical topology may be analyzed according to a Spark calculation model, and a physical layer circuit is rapidly disassembled to construct the physical topology. Therefore, in some embodiments, refer to fig. 6, which shows a flowchart of another network topology discovery method provided by an embodiment of the present invention. As shown in fig. 6, for S103b, the analyzing the logical topology based on the Spark calculation model to obtain the physical topology of the target network, the method may include:
S103 b-1: based on the total resource information, a logic bearing relation table is obtained;
it should be noted that after the full resource information is obtained, the logical bearer relationship table may be obtained; the logical layer bearing structures of different manufacturers are different, that is, the logical bearing relationship tables corresponding to different manufacturers are also different. Thus, different manufacturers need to adapt the corresponding logical bearer relationship table. In addition, the logical bearer relationship table may be represented by an ifStackTable, thereby building a physical topology based on the ifStackTable.
S103 b-2: based on a Spark calculation model, performing traversal query on the logic bearing relation table according to the equipment IP address and the port index in the logic topology, and determining a physical interface corresponding to each port index;
it should be noted that, for the logical topology, the logical link includes a source port and a destination port, and each port corresponds to its own port index. The ifStackTable can be subjected to traversal query according to the equipment IP address (namely the network management IP address) and the port index in the logical topology, so that a physical interface corresponding to each port index is determined; that is, traversal query is performed on the ifStackTable until a physical interface is found; wherein, the lower layer of the physical interface carries the interface index to be 0. Here, the upper layer bearer interface index may also be referred to as a higher layer bearer interface index, and the lower layer bearer interface index may also be referred to as a lower layer bearer interface index.
Therefore, in some embodiments, the determining a physical interface corresponding to each port index may include:
and in the process of traversing and inquiring the logic bearing relation table, when the lower bearing interface index is 0, determining a physical interface corresponding to each port index.
Note that, the logical bearer relationship table, i.e., ifStackTable, may be marked by equation (1),
Figure BDA0002063512480000161
wherein, IPiFor a device IP address, HINdexiFor upper layer bearer interface indexing, LIndexiFor the lower layer bearer interface index, i is 1,2, …, and N is the number of devices in the target network. IP address for arbitrary deviceiPort IndexiThe bearing relationship between each logic layer and its lower logic layer or interface layer can be TifStackTable(IPi) And (4) showing.
Specifically, the process of physical interface discovery is as follows:
Procedure FoundCirCuitIndexs(TifStackTable(IPi),Indexi) // Port Index of any logical linkiQuery process for corresponding physical interface
HIndex←Indexi// assignment
LIndexSet←TifStackTable(IPiH index// all lower bearer interface index sets to get upper bearer interface index H index
For all LIndexkBelongs to the index of each lower layer bearing interface in the LIndexset do// traversal LIndexset set
IFLIndexkJudging whether the lower layer bearing interface index is 0THEN// or not
HINdex is a physical interface
ELSE
FoundCirCuitIndexs(TifStackTable(IPi),LIndexk) // recursive lookup physical interface
END IF
END FOR
Thus, according to the above processing procedure, in the process of performing traversal query on the logical bearer relationship table (represented by ifStackTable), when the lower layer bearer interface index is 0, the physical interface corresponding to each port index can be determined.
S103 b-3: and acquiring the physical topology of the target network based on the physical interface corresponding to each port index.
In addition, according to the above-described processing procedure, IP addresses are assigned to arbitrary devicesiPort IndexiThe inquiry processes of the corresponding physical interfaces are independent. The existing technical scheme is based on a discovery mode of a single device, so that the consumption time can be increased sharply along with the increase of the target network scale, and the processing performance can be reduced along with the increase. In the embodiment of the inventionBy using a Spark calculation model, the physical topology discovery tasks of all the logical links can be uniformly distributed on a plurality of devices in a target network, so that the data volume required to be processed by a single device is reduced; and the processing efficiency can be further accelerated by utilizing the memory-based computing characteristic of Spark.
It should be further noted that, the physical interface discovery of the embodiment of the present invention is processed by using a Spark calculation model. Thus, after the physical interface corresponding to each logical link is found, because the logical layer contains three situations of aggregation link (1 logical port corresponds to a plurality of physical interfaces), sub-interface (a plurality of logical ports correspond to 1 physical interface) and direct use of physical interface configuration IP address (1 logical port corresponds to 1 physical interface or corresponds to itself), and the like, the physical interface found by the sub-interface has a duplication phenomenon, and at the moment, deduplication processing is required; thereby completing the physical topology discovery of the target network.
In the embodiment of the invention, the logical topology is analyzed based on the Spark calculation model, so that the physical layer circuit can be rapidly disassembled, and the physical topology can be found by one-step searching from the logical topology; in the prior art, a method for discovering physical topology based on an ARP cache table is adopted, and the method needs to collect ARP cache tables of all physical layer devices (such as switches) and then calculate the direct connection relationship between the devices; in a large IP network, the data volume acquired by the method is large, the data accuracy is difficult to guarantee due to the network performance bottleneck, the data volume to be analyzed is large, the noise data is large, and the processing process is complicated; compared with the prior art, the embodiment of the invention is based on the divide-and-conquer thought, and the efficiency of physical topology discovery is greatly improved by utilizing the Spark calculation model.
Referring to fig. 7, a schematic diagram of an overall structure of a network topology discovery architecture 70 according to an embodiment of the present invention is shown. As shown in fig. 7, the network topology discovery architecture 70 may include a collection unit 710, a preprocessing unit 720, a logical topology discovery unit 730, and a physical topology discovery unit 740. In the acquisition unit 710, by acquiring resource information of all devices in the target network, full resource information, such as an interface information table 7101, an IP address mapping table 7102, and a logical bearing relationship table 7103, can be obtained; in the preprocessing unit 720, the associated resource information associated with the IP address mapping table 7102 may be determined according to the interface information table 7101 and the IP address mapping table 7102; then, filtering the associated resource information for filtering illegal addresses, non-service interfaces and the like; besides the filtering processing, the preprocessed resource information can be sorted according to the device hierarchy, the device name, the interface name and the like, and the sorting result is numbered, so that the source port and the destination port of the logical link can be judged according to the size of the sorting number; in the logical topology discovery unit 730, the interface IP addresses are used for sorting, and then two adjacent interface IP addresses are obtained according to the sorted resource information; judging whether the IP addresses of two adjacent interfaces meet a preset mask rule or not; when the judgment result is yes, namely the two adjacent interface IP addresses meet the preset mask rule, matching two ports corresponding to the two interface IP addresses as an intra-network link in the target network; if the judgment result is negative, that is, the two adjacent interface IP addresses do not meet the preset mask rule, then an interface IP address of a destination port needs to be constructed according to the preset mask rule, and then a source port and the destination port in the two ports are matched to be an internetwork link in a target network; thereby completing the logic topology realization of the target network; in the physical topology discovery unit 740, a Spark calculation model 7401 is included; in this way, the Spark calculation model 7401 is used to distribute the task to a plurality of devices through a Distributed File System (HDFS) and perform query processing of the physical interface at the same time. Such as distributing it over three shards (e.g., shard 1, shard 2, and shard 3); then, the three fragments are respectively used for carrying out physical layer circuit matching, and the processing processes are mutually independent; inquiring a lower layer circuit 1 (namely a lower layer bearing interface index 1) according to the port index and the equipment IP address of the fragment 1, inquiring a lower layer circuit 2 (namely a lower layer bearing interface index 2) according to the port index and the equipment IP address of the fragment 2, and inquiring a lower layer circuit 3 (namely a lower layer bearing interface index 3) according to the port index and the equipment IP address of the fragment 3; only when the lower layer bearing interface index is 0, the physical interface is inquired, and thus the physical topology discovery is completed.
Based on the network topology discovery architecture 70 shown in fig. 7, fig. 8 is a schematic diagram illustrating an effect of network topology discovery provided by an embodiment of the present invention. In fig. 8, there are a plurality of network nodes in the target network, such as Xinjiang, Heilongjiang, Jilin, inner Mongolia, Hebei, Beijing, Shaanxi, Shandong, and so on, and the existence information of these network nodes and the connection relationship between them are shown in fig. 8.
In the embodiment of the invention, on one hand, the network topology discovery is carried out based on the interface IP address, and compared with the prior technical scheme that the network topology discovery is carried out by adopting a routing forwarding table, the data volume needing to be collected is greatly reduced; in addition, the embodiment of the invention adopts one-time full-quantity acquisition of the interface information of all the devices in the target network, while the prior technical scheme needs iterative acquisition and analysis of the devices one by one, which are equivalent to parallel acquisition and serial acquisition, so that the acquisition time can be greatly shortened; in addition, the embodiment of the invention also adopts a method of finding the network topology through one-time sequencing matching, and compared with the method of calculating the IP address and carrying out verification analysis by adopting a direct-connection subnet, a next hop of a route and a heuristic method and a greedy method in the prior art, the method can also reduce the analysis times from N times (N is the number of equipment in a target network) to 1 time, thereby further improving the efficiency of finding the network topology; on the other hand, the physical topology can be discovered through one-step analysis based on the logical topology by utilizing the Spark calculation model, so that the discovery of the logical topology and the physical topology is completed; in the embodiment of the invention, the physical topology can be queried from the logical topology in one step by analyzing and querying the logical bearing relation table, and the prior technical scheme needs to acquire an ARP forwarding table and analyze the physical topology, so that the analyzed data volume is large, the time consumption is large, the efficiency is poor, and the prior technical scheme does not have the capability of discovering the physical topology by one-step analysis in the embodiment of the invention; compared with the prior art, the embodiment of the invention greatly improves the discovery efficiency of the network topology, particularly the discovery efficiency of the physical topology.
The embodiment provides a network topology discovery method, which includes acquiring full resource information corresponding to a target network; the total resource information is obtained by collecting resource information of all devices in the target network; preprocessing the full resource information to obtain preprocessed resource information; performing network topology discovery based on the preprocessed resource information and a Spark calculation model to construct a network topology of the target network; therefore, the resource information of all the devices in the target network is acquired in a full amount at one time, iterative acquisition and analysis of one device to another device are not needed, the acquisition time is greatly shortened, and the efficiency of network topology discovery is improved; in addition, through preprocessing the full resource information, the logical topology of the large-scale IP network can be rapidly discovered, and a Spark calculation model can be applied, so that the physical topology is further analyzed and discovered based on the logical topology, and the network topology discovery efficiency is further improved.
Based on the same inventive concept of the foregoing embodiment, referring to fig. 9, it shows a composition of a network topology discovery apparatus 90 provided by the embodiment of the present invention, and the network topology discovery apparatus may include: an acquisition unit 901, a preprocessing unit 902 and a network topology discovery unit 903, wherein,
The acquiring unit 901 is configured to acquire the full resource information corresponding to the target network; the total resource information is obtained by collecting resource information of all devices in the target network;
the preprocessing unit 902 is configured to preprocess the full resource information to obtain preprocessed resource information;
the network topology discovery unit 903 is configured to perform network topology discovery based on the preprocessed resource information and the Spark calculation model, and construct a network topology of the target network.
In the above scheme, referring to fig. 9, the network topology discovery apparatus 90 further includes an acquisition unit 904 configured to acquire resource information of all devices in the target network, so as to obtain total resource information corresponding to the target network.
In the above scheme, the acquisition unit 904 is specifically configured to acquire resource information of all devices in the target network based on an SNMP protocol; acquiring a total amount of resource information corresponding to the target network according to an acquired result; the full resource information comprises an interface information table, an IP address mapping table and a logic bearing relation table.
In the above solution, referring to fig. 9, the network topology discovering apparatus 90 further includes a determining unit 905 configured to determine associated resource information associated with the IP address mapping table; the associated resource information is obtained after the interface information table is associated with the IP address mapping table;
the preprocessing unit 902 is specifically configured to preprocess the associated resource information according to a preset filtering policy, and obtain preprocessed resource information.
In the foregoing solution, the determining unit 905 is specifically configured to obtain, according to the IP address mapping table, an interface index and an interface IP address corresponding to the interface index; and correspondingly adding the interface IP address into the interface information table based on the interface index in the interface information table to obtain the associated resource information.
In the above solution, referring to fig. 9, the network topology discovering device 90 further includes a matching unit 906 and a parsing unit 907, wherein,
the matching unit 906 is configured to perform matching processing on the preprocessed resource information to obtain a logical topology of the target network;
the analyzing unit 907 is configured to analyze the logical topology based on a Spark calculation model to obtain a physical topology of the target network; wherein the network topology includes a logical topology and a physical topology.
In the above solution, referring to fig. 9, the network topology discovering device 90 further includes a sorting unit 908 configured to perform sorting processing on the preprocessed resource information to obtain sorted resource information.
In the above solution, referring to fig. 9, the network topology discovering apparatus 90 further includes a determining unit 909, wherein,
the obtaining unit 901 is further configured to obtain two adjacent interface IP addresses and two ports corresponding to the two adjacent interface IP addresses according to the sorted resource information;
the judging unit 909 is configured to judge whether the two adjacent interface IP addresses satisfy a preset mask rule;
the matching unit 906 is specifically configured to match the two ports as an intra-network link in the target network when the two adjacent interface IP addresses meet a preset mask rule; when the two adjacent interface IP addresses do not meet a preset mask rule, constructing an interface IP address of an opposite end port according to the preset mask rule, and matching a source end port of the two ports with the opposite end port to form an internetwork interconnection link in the target network;
the network topology discovering unit 903 is specifically configured to obtain a logical topology of the target network based on the intra-network link and the inter-network interconnection link.
In the above solution, referring to fig. 9, the network topology discovering device 90 further includes a query unit 910, wherein,
the obtaining unit 901 is further configured to obtain a logic bearing relation table based on the total resource information;
the query unit 910 is configured to perform traversal query on the logical bearer relationship table according to the device IP address and the port index in the logical topology based on a Spark calculation model, and determine a physical interface corresponding to each port index;
the network topology discovering unit 903 is specifically configured to obtain the physical topology of the target network based on the physical interface corresponding to each port index.
In the above scheme, the querying unit 910 is specifically configured to determine, in the process of performing traversal query on the logical bearer relationship table, when the lower bearer interface index is 0, a physical interface corresponding to each port index.
It is understood that, in this embodiment, a "unit" may be a part of a circuit, a part of a processor, a part of a program or software, etc., and may also be a module, or may be non-modular. Moreover, each component in the embodiment may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware or a form of a software functional module.
Based on the understanding that the technical solution of the present embodiment essentially or a part contributing to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, and include several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to execute all or part of the steps of the method of the present embodiment. 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.
Accordingly, the present embodiments provide a computer storage medium storing a network topology discovery program that, when executed by at least one processor, implements the steps of the method in the preceding embodiments.
Based on the above-mentioned components of the network topology discovery apparatus 90 and the computer storage medium, referring to fig. 10, which shows a specific hardware structure of the network topology discovery apparatus 90 provided in the embodiment of the present invention, the specific hardware structure may include: a network interface 1001, a memory 1002, and a processor 1003; the various components are coupled together by a bus system 1004. It is understood that the bus system 1004 is used to enable communications among the components. The bus system 1004 includes a power bus, a control bus, and a status signal bus in addition to a data bus. But for the sake of clarity the various busses are labeled in fig. 10 as the bus system 1004. The network interface 1001 is used for receiving and transmitting signals during information transmission and reception with other external network elements;
a memory 1002 for storing a computer program capable of running on the processor 1003;
a processor 1003 configured to, when running the computer program, perform:
acquiring full resource information corresponding to a target network; the total resource information is obtained by collecting resource information of all devices in the target network;
preprocessing the full resource information to obtain preprocessed resource information;
And carrying out network topology discovery based on the preprocessed resource information and a Spark calculation model, and constructing the network topology of the target network.
It is to be understood that the memory 1002 in embodiments of the present invention may be either volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The non-volatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable PROM (EEPROM), or a flash Memory. The volatile Memory may be a Random Access Memory (RAM) which serves as an external cache. By way of illustration and not limitation, many forms of RAM are available, such as Static random access memory (Static RAM, SRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic random access memory (Synchronous DRAM, SDRAM), Double Data Rate Synchronous Dynamic random access memory (ddr Data Rate SDRAM, ddr SDRAM), Enhanced Synchronous SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memory 1002 of the subject systems and methods is intended to comprise, without being limited to, these and any other suitable types of memory.
And the processor 1003 may be an integrated circuit chip having signal processing capability. In implementation, the steps of the method may be implemented by integrated logic circuits of hardware in the processor 1003 or instructions in the form of software. The Processor 1003 may be a general-purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, or discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory 1002, and the processor 1003 reads the information in the memory 1002 and performs the steps of the above method in combination with the hardware thereof.
It is to be understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For a hardware implementation, the Processing units may be implemented within one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), general purpose processors, controllers, micro-controllers, microprocessors, other electronic units designed to perform the functions described herein, or a combination thereof.
For a software implementation, the techniques described herein may be implemented with modules (e.g., procedures, functions, and so on) that perform the functions described herein. The software codes may be stored in a memory and executed by a processor. The memory may be implemented within the processor or external to the processor.
Optionally, as another embodiment, the processor 1003 is further configured to execute the steps of the method in the foregoing embodiments when running the computer program.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are only for description, and do not represent the advantages and disadvantages of the embodiments.
Through the description of the foregoing embodiments, it is clear to those skilled in the art that the method of the foregoing embodiments may be implemented by software plus a necessary general hardware platform, and certainly may also be implemented by hardware, but in many cases, the former is a better implementation. Based on such understanding, the technical solutions of the present invention or portions thereof contributing to the prior art may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the methods according to the embodiments of the present invention.
While the present invention has been described with reference to the particular illustrative embodiments, it is to be understood that the invention is not limited to the disclosed embodiments, but is intended to cover various modifications, equivalent arrangements, and equivalents thereof, which may be made by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (12)

1. A method of network topology discovery, the method comprising:
acquiring full resource information corresponding to a target network; the total resource information is obtained by collecting resource information of all devices in the target network;
preprocessing the full resource information to obtain preprocessed resource information;
performing network topology discovery based on the preprocessed resource information and a Spark calculation model to construct a network topology of the target network;
the network topology discovery based on the preprocessed resource information and the Spark calculation model to construct the network topology of the target network includes:
matching the preprocessed resource information to obtain the logic topology of the target network;
analyzing the logical topology based on a Spark calculation model to obtain the physical topology of the target network; wherein the network topology includes a logical topology and a physical topology.
2. The method according to claim 1, wherein before the obtaining the full resource information corresponding to the target network, the method further comprises:
and acquiring resource information of all equipment in the target network to obtain the full resource information corresponding to the target network.
3. The method according to claim 2, wherein the acquiring resource information of all devices in the target network to obtain the full resource information corresponding to the target network comprises:
acquiring resource information of all devices in the target network based on a Simple Network Management Protocol (SNMP);
acquiring the total resource information corresponding to the target network according to the acquired result; the full resource information comprises an interface information table, an Internet Protocol (IP) address mapping table and a logic bearing relation table.
4. The method according to claim 3, wherein the preprocessing the full amount of resource information to obtain preprocessed resource information comprises:
determining associated resource information associated with the IP address mapping table; wherein, the associated resource information is obtained after the interface information table is associated with the IP address mapping table;
and preprocessing the associated resource information according to a preset filtering strategy to obtain preprocessed resource information.
5. The method of claim 4, wherein the determining associated resource information associated with the IP address mapping table comprises:
Acquiring an interface index and an interface IP address corresponding to the interface index according to the IP address mapping table;
and correspondingly adding the interface IP address into the interface information table based on the interface index in the interface information table to obtain the associated resource information.
6. The method according to claim 1, wherein before the matching the preprocessed resource information to obtain the logical topology of the target network, the method further comprises:
and sequencing the preprocessed resource information to obtain sequenced resource information.
7. The method according to claim 6, wherein the matching the preprocessed resource information to obtain the logical topology of the target network comprises:
according to the sorted resource information, two adjacent interface IP addresses and two ports corresponding to the two interface IP addresses are obtained;
judging whether the IP addresses of the two adjacent interfaces meet a preset mask rule or not;
when the IP addresses of the two adjacent interfaces meet a preset mask rule, matching the two ports as an intra-network link in the target network;
When the two adjacent interface IP addresses do not meet a preset mask rule, constructing an interface IP address of an opposite end port according to the preset mask rule, and matching a source end port of the two ports with the opposite end port to form an internetwork interconnection link in the target network;
and obtaining the logic topology of the target network based on the intra-network link and the inter-network interconnection link.
8. The method according to claim 1, wherein the analyzing the logical topology based on a Spark calculation model to obtain a physical topology of the target network comprises:
based on the total resource information, a logic bearing relation table is obtained;
based on a Spark calculation model, performing traversal query on the logic bearing relation table according to the equipment IP address and the port index in the logic topology, and determining a physical interface corresponding to each port index;
and acquiring the physical topology of the target network based on the physical interface corresponding to each port index.
9. The method of claim 8, wherein determining the physical interface corresponding to each port index comprises:
and in the process of traversing and inquiring the logic bearing relation table, when the lower bearing interface index is 0, determining a physical interface corresponding to each port index.
10. A network topology discovery apparatus, the network topology discovery apparatus comprising: an acquisition unit, a preprocessing unit and a network topology discovery unit, wherein,
the acquisition unit is configured to acquire the full resource information corresponding to the target network; the total resource information is obtained by collecting resource information of all devices in the target network;
the preprocessing unit is configured to preprocess the full resource information to obtain preprocessed resource information;
the network topology discovering unit is configured to discover network topology based on the preprocessed resource information and a Spark calculation model, and construct a network topology of the target network;
the network topology discovery apparatus further includes:
the matching unit is configured to perform matching processing on the preprocessed resource information to obtain the logic topology of the target network;
the analysis unit is configured to analyze the logical topology based on a Spark calculation model to obtain a physical topology of the target network; wherein the network topology includes a logical topology and a physical topology.
11. A network topology discovery apparatus, the network topology discovery apparatus comprising: a memory and a processor; wherein the content of the first and second substances,
The memory for storing a computer program operable on the processor;
the processor, when executing the computer program, is adapted to perform the steps of the method of any of claims 1 to 9.
12. A computer storage medium storing a network topology discovery program that when executed by at least one processor implements the steps of the method of any of claims 1 to 9.
CN201910413274.6A 2019-05-17 2019-05-17 Network topology discovery method and device and computer storage medium Active CN111953507B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910413274.6A CN111953507B (en) 2019-05-17 2019-05-17 Network topology discovery method and device and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910413274.6A CN111953507B (en) 2019-05-17 2019-05-17 Network topology discovery method and device and computer storage medium

Publications (2)

Publication Number Publication Date
CN111953507A CN111953507A (en) 2020-11-17
CN111953507B true CN111953507B (en) 2022-06-28

Family

ID=73335895

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910413274.6A Active CN111953507B (en) 2019-05-17 2019-05-17 Network topology discovery method and device and computer storage medium

Country Status (1)

Country Link
CN (1) CN111953507B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114553706B (en) * 2020-11-18 2023-09-19 中国移动通信集团广东有限公司 Network topology discovery method and device and electronic equipment
CN112714010B (en) * 2020-12-07 2023-09-05 大连市共进科技有限公司 Network topology management method and device, expansion unit and storage medium
CN112579518B (en) * 2020-12-24 2023-02-17 成都海光集成电路设计有限公司 Network topology structure construction method, access method and device
CN112671588B (en) * 2020-12-30 2023-10-17 普联国际有限公司 Network topology generation method, device, medium and network control equipment
CN112787866B (en) * 2021-01-22 2022-10-14 北京网瑞达科技有限公司 Method and device for determining network topological relation, electronic equipment and storage medium
CN113194004B (en) * 2021-05-20 2023-04-07 中国工商银行股份有限公司 Network topology construction method and device, and network change processing method and device
CN113568860B (en) * 2021-07-23 2022-08-19 北京百度网讯科技有限公司 Deep learning-based multi-machine cluster topology mapping method and device and program product
CN114221848B (en) * 2021-12-16 2023-06-02 中国人民公安大学 Distributed data backhaul network construction method
CN114900435B (en) * 2022-01-30 2023-12-08 华为技术有限公司 Connection relation prediction method and related equipment
CN115277510B (en) * 2022-07-28 2023-12-01 科来网络技术股份有限公司 Method for automatically identifying equipment, equipment interface and equipment path in network session

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1756189A (en) * 2004-09-30 2006-04-05 北京航空航天大学 IP network topology discovering method based on SNMP
CN101610178A (en) * 2009-07-20 2009-12-23 南京联创科技股份有限公司 Method for obtaining physical layer link network topology based on address forwarding mechanism
CN102891765A (en) * 2012-09-05 2013-01-23 曙光云计算技术有限公司 SNMP (Simple Network Management Protocol) and HTML5 (Hypertext Markup Language 5)-based method for realizing web network topology
CN108833129A (en) * 2018-04-17 2018-11-16 国网冀北电力有限公司信息通信分公司 A kind of method for discovering network topology and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1756189A (en) * 2004-09-30 2006-04-05 北京航空航天大学 IP network topology discovering method based on SNMP
CN101610178A (en) * 2009-07-20 2009-12-23 南京联创科技股份有限公司 Method for obtaining physical layer link network topology based on address forwarding mechanism
CN102891765A (en) * 2012-09-05 2013-01-23 曙光云计算技术有限公司 SNMP (Simple Network Management Protocol) and HTML5 (Hypertext Markup Language 5)-based method for realizing web network topology
CN108833129A (en) * 2018-04-17 2018-11-16 国网冀北电力有限公司信息通信分公司 A kind of method for discovering network topology and device

Also Published As

Publication number Publication date
CN111953507A (en) 2020-11-17

Similar Documents

Publication Publication Date Title
CN111953507B (en) Network topology discovery method and device and computer storage medium
CN110661666B (en) Method and device for establishing ring network resources of packet transport network
US9106443B2 (en) Forwarding table optimization with flow data
EP2552059B1 (en) Packet transfer system, control apparatus, transfer apparatus, method of creating processing rules, and program
US10348603B1 (en) Adaptive forwarding tables
US8432914B2 (en) Method for optimizing a network prefix-list search
CN112965824B (en) Message forwarding method and device, storage medium and electronic equipment
EP3057270A1 (en) Technologies for modular forwarding table scalability
US9736053B2 (en) Layer 2 path tracing through context encoding in software defined networking
CN108462594B (en) Virtual private network and rule table generation method, device and routing method
US20130246698A1 (en) Hybrid Memory for Search Operations
CN107733713B (en) Method, system, device and storage medium for acquiring network topology in hybrid network
WO2016210207A1 (en) Source imposition of network routes in computing networks
US9021098B1 (en) Allocation of interface identifiers within network device having multiple forwarding components
EP2429132B1 (en) Table creating and searching method used by network processor
EP3884641B1 (en) Apparatus and method for migrating existing access control list policies to intent based policies and vice versa
CN108400922B (en) Virtual local area network configuration system and method and computer readable storage medium thereof
CN110932971A (en) Inter-domain path analysis method based on layer-by-layer reconstruction of request information
WO2012155430A1 (en) Method and network management for calculating network element interfaces
CN107528794B (en) Data processing method and device
JPWO2006059787A1 (en) Overlay link computing device and its computing method and program
CN111200542B (en) Network flow management method and system based on deterministic replacement strategy
CN114553706A (en) Network topology discovery method and device and electronic equipment
CN114145002B (en) Reachable matrix of network verification system
CN111641729A (en) Inter-domain path identification prefix conflict detection and decomposition method based on prefix tree

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