Network topology construction method and device, electronic equipment and storage medium
By obtaining the probe routing table and the set of commonly used addresses, determining the device type using the number of VLANs and the router startup identifier, and generating the network topology by combining the device fingerprint, the accuracy and efficiency problems of complex network topology construction in existing technologies are solved, and efficient network management and maintenance are achieved.
Patent Information
- Application Number
- CN202410795322.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-19
- Publication Date
- 2026-01-16
- Estimated Expiration
- 2044-06-19
AI Technical Summary
Existing technologies are ineffective in detecting network asset topology in complex network topologies and when using IP/TCP devices. They also struggle to generate accurate network topology data and generate significant network load during the detection process.
By obtaining the probe routing table and common address set of the network to be detected, the device type is determined by the number of VLANs and the router startup identifier. Combined with the device fingerprint, a network topology is generated, reducing unnecessary probes and improving probe efficiency and accuracy.
It enables accurate construction of network topology in complex networks, reduces probe traffic, lowers network load, and improves the reliability and stability of network management and maintenance.
Smart Images

Figure CN118802707B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of network security, and particularly relates to a network topology construction method and device, electronic equipment and storage medium. BACKGROUND
[0002] With the gradual construction of information systems, the expansion of network scale is further promoted. The dynamic, diversity, heterogeneity and huge complexity of complex networks have become the focus and difficulty of network topology discovery technology. The existing network topology detection method is difficult to effectively generate a correct and accurate network topology structure when dealing with subnets and Internet Protocol (IP) devices in complex networks, and injecting a large number of probes during detection brings huge network load pressure and a large amount of time consumption. Therefore, how to ensure the accuracy and efficiency of the network topology discovery method under the complex network topology structure has become a great challenge.
[0003] At present, network asset topology detection is mainly based on Transmission Control Protocol (TCP) / IP network topology discovery algorithm. A large amount of detection traffic and communication expenses are generated during mapping, causing network burden. In addition, the method cannot read network information in real time during the detection process, resulting in network topology structure lag. More seriously, for network devices that do not support or open Simple Network Management Protocol (SNMP), the algorithm cannot be detected, and the topology discovery effect in complex networks is not ideal. SUMMARY
[0004] The present disclosure aims to at least solve one of the technical problems in the related art to some extent.
[0005] To this end, one object of the present disclosure is to provide a network topology construction method.
[0006] A second object of the present disclosure is to provide a network topology construction device.
[0007] A third object of the present disclosure is to provide an electronic equipment.
[0008] A fourth object of the present disclosure is to provide a non-transitory computer readable storage medium.
[0009] A fifth object of the present disclosure is to provide a computer program product.
[0010] To achieve the above object, the first aspect of the present disclosure provides a network topology construction method, comprising: obtaining a probe routing table and a common address set of a network to be detected; probing the common address set based on the probe routing table to detect whether there is a candidate address; in response to the existence of the candidate address, obtaining a VLAN quantity of a network device of the candidate address; determining a device type of the network device corresponding to the candidate address based on the VLAN quantity of the network device, and establishing a network topology of the network to be detected based on the device type.
[0011] According to one embodiment of the present disclosure, the determination of the device type of the network device corresponding to the candidate address based on the VLAN quantity of the network device comprises: obtaining a router startup identifier; and determining the device type of the network device corresponding to the candidate address based on the router startup identifier and the VLAN quantity of the network device.
[0012] According to one embodiment of the present disclosure, the determination of the device type of the network device corresponding to the candidate address based on the router startup identifier and the VLAN quantity of the network device comprises: in response to the VLAN quantity of the network device being greater than 1, determining that the device type is a switch; or, in response to the VLAN quantity of the network device being equal to 1 and the router startup identifier being startup, determining that the device type is a router; or, in response to the VLAN quantity of the network device being equal to 1 and the router startup identifier not being startup, determining that the device type is a terminal host.
[0013] According to one embodiment of the present disclosure, the probing of the common address set based on the probe routing table comprises: obtaining a next hop address of each candidate address in the common address set; in response to the next hop address, taking candidate addresses with the same next hop address as the same network segment address; and probing the same network segment address once.
[0014] According to one embodiment of the present disclosure, the probing of the common address set based on the probe routing table comprises: probing to obtain a node name, a node physical address, a node vendor identifier and a node description of the network device corresponding to the candidate address; generating a device fingerprint of the network device corresponding to the candidate address based on the node name, the node physical address, the node vendor identifier and the node description; and updating a device mapping set based on the device fingerprint.
[0015] According to one embodiment of the present disclosure, the updating the device-access address mapping set based on the device fingerprint comprises: updating, in response to the device fingerprint being contained in the device-access address mapping set, an access address of the candidate address to an access address set corresponding to a device item corresponding to the device fingerprint in the device-access address mapping set; or, in response to the device fingerprint not being contained in the device-access address mapping set, establishing a device item corresponding to the device fingerprint in the device-access address mapping set based on the device fingerprint.
[0016] According to one embodiment of the present disclosure, the generating the device fingerprint of the network device corresponding to the candidate address based on the node name, the node physical address, the node vendor identifier and the node description comprises: calculating the node name, the node physical address, the node vendor identifier and the node description by a hash algorithm to obtain a hash value, and taking the hash value as the device fingerprint of the network device corresponding to the candidate address.
[0017] To achieve the above object, a second aspect of the present disclosure provides a network topology construction apparatus, comprising: a query module configured to obtain a detection routing table and a common address set of a network to be detected; a detection module configured to detect whether there is a candidate address by detecting the common address set based on the detection routing table; an obtaining module configured to obtain a network device VLAN quantity of the candidate address in response to the candidate address existing; and an establishing module configured to determine a device type of a network device corresponding to the candidate address based on the network device VLAN quantity, and establish a network topology of the network to be detected based on the device type.
[0018] To achieve the above object, a third aspect of the present disclosure provides an electronic device, comprising: at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to implement the network topology construction method according to the first aspect of the present disclosure.
[0019] To achieve the above object, a fourth aspect of the present disclosure provides a non-transitory computer readable storage medium storing computer instructions, wherein the computer instructions are used to implement the network topology construction method according to the first aspect of the present disclosure.
[0020] To achieve the above object, a fifth aspect of the present disclosure provides a computer program product, comprising a computer program, wherein the computer program is used to implement the network topology construction method according to the first aspect of the present disclosure when executed by a processor. BRIEF DESCRIPTION OF DRAWINGS
[0021] Figure 1 is a schematic diagram of a network topology construction method according to an embodiment of the present disclosure;
[0022] Figure 2 is a schematic diagram of another network topology construction method according to an embodiment of the present disclosure;
[0023] Figure 3 is a schematic diagram of another network topology construction method according to an embodiment of the present disclosure;
[0024] Figure 4 is a schematic diagram of a network topology construction device according to an embodiment of the present disclosure;
[0025] Figure 5 is a schematic diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0026] Embodiments of the present disclosure are described in detail below with reference to the accompanying drawings, in which the same or similar notations used throughout the drawings and the specification denote the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to explain the present disclosure, and should not be understood as limiting the present disclosure.
[0027] In the technical solutions of the present disclosure, the acquisition, storage, use, processing, etc. of data comply with relevant provisions of relevant laws and regulations.
[0028] Figure 1 is a schematic diagram of a network topology construction method according to an embodiment of the present disclosure, as shown in Figure 1 the network topology construction method comprises the following steps:
[0029] S101, acquiring a probe routing table and a common address set of a network to be detected.
[0030] The network topology construction method of the embodiments of the present disclosure can be applied to the scenario of operator network asset topology detection, and the execution subject of the network topology construction of the embodiments of the present disclosure can be the network topology construction device of the embodiments of the present disclosure, which can be arranged on an electronic device.
[0031] It should be noted that the routing table is a key component in a network device (such as a router, a switch, or a host with routing function) for guiding data packet forwarding decision. It stores path information to different network destinations, ensuring that data can be effectively transmitted from a source address to a target address.
[0032] In the embodiments of the present disclosure, the common address set is a set of historical access network addresses, which can be acquired according to historical access data.
[0033] S102, for any candidate address in the common address set, obtain the network device VLAN quantity corresponding to the candidate address, and obtain the subnet type corresponding to the candidate address based on the probe routing table.
[0034] In the embodiment of the present disclosure, when the candidate address is in the probe routing table, it can be considered that the candidate address is the address of the direct connection subnet, and when the candidate address is not in the probe routing table, the candidate address needs to be probed to determine the position and connection relationship of the candidate address in the network topology.
[0035] It should be noted that the probing of the common address set refers to the process of discovering, identifying and analyzing the router devices in the network and their configurations, performance and connection state through network diagnosis or management tools. This process is crucial for network management, troubleshooting, security audit and network planning. The probing method in the embodiment of the present disclosure can be various, which is not limited here.
[0036] In one possible implementation, the topology probing can be performed through Internet Control Message Protocol (ICMP) / Simple Network Management Protocol (SNMP).
[0037] In one possible implementation, before probing the common address set, the routing forwarding entries can be checked first to remove the entries containing loopback addresses and local addresses, such as 127.0.0.0 / 8 and 127.0.0.1 / 32. Secondly, it is necessary to remove the multiple items in the routing table that can have the same next hop address. In this way, the data volume of the probing can be reduced, the efficiency of the probing can be improved, and the probing cost can be reduced.
[0038] It should be noted that the candidate address is the address of the subnet directly connected or indirectly connected with the network device.
[0039] In the embodiment of the present disclosure, VLAN, which is the full name of Local Area Network, refers to a computer network limited in a relatively small geographical range (such as an office, a school, a building or a park). Compared with a wide area network (WAN), a local area network covers a smaller geographical range, has a faster transmission rate, lower delay and more economical cost.
[0040] S103, determining the device type of the network device corresponding to the candidate address based on the network device VLAN quantity, and establishing the network topology of the network to be detected based on the device type and the subnet type.
[0041] It should be noted that different network devices correspond to different VLAN types and different VLAN quantities, and therefore the device type of the corresponding network device can be determined by the VLAN type and the VLAN quantity.
[0042] In the embodiments of the present disclosure, first, a detection routing table and a common address set of a network to be detected are acquired, then the common address set is detected based on the detection routing table to detect whether there is a candidate address, and then in response to the existence of the candidate address, the network device VLAN quantity of the candidate address is acquired, finally the device type of the network device connected by the candidate address is determined based on the network device VLAN quantity, and the network topology of the network to be detected is established based on the device type. Thus, the candidate address is determined by detection, based on the characteristics that different network devices correspond to different VLAN types and different VLAN quantities, the device type of the network device corresponding to the candidate address can be accurately determined by the VLAN quantity of the candidate address, and the network topology of the network to be detected is established based on the position of each candidate address in the network topology and device information, etc. The device type of the network device can be accurately determined by the VLAN quantity, and therefore a more perfect network topology can be established, and the efficiency and accuracy of network topology establishment can be improved, thereby improving the reliability and stability of network device management and maintenance.
[0043] In the above embodiments, the device type of the network device corresponding to the candidate address is determined based on the network device VLAN quantity, and the device type of the network device corresponding to the candidate address can also be determined by Figure 2 Further explanation, the method comprises:
[0044] S201, acquiring a network device router startup identifier corresponding to the candidate address.
[0045] S202, determining the device type of the network device corresponding to the candidate address based on the router startup identifier and the network device VLAN quantity.
[0046] In the embodiments of the present disclosure, in response to the network device VLAN quantity being greater than 1, the device type is determined to be a switch, in response to the network device VLAN quantity being equal to 1 and the router startup identifier being startup, the device type is determined to be a router, and in response to the network device VLAN quantity being equal to 1 and the router startup identifier not being startup, the device type is determined to be a terminal host.
[0047] It should be noted that the commonly used device type identification method relies on Bridge-MIB and ipForwarding, which is no longer applicable. Bridge-MIB is a MIB unique to switches, and ipForwarding records whether the device has a routing and forwarding function. The main device type identification method is: there is Bridge-MIB for switch; there is no Bridge-MIB and ipForwarding=1 for router; there is no Bridge-MIB and ipForwarding=0 for terminal host. However, with the advancement of technology, routers can already use Bridge-MIB, and switches already have forwarding functions, so this method is obviously no longer applicable. dot1qNumVlans in Q-Bridge-MIB records the number of VLANs configured on the device, and only switches can configure VLANs, while other devices can only use the default VLAN. Therefore, the present scheme proposes a new device type identification method: for a device, when dot1qNumVlans>1 is a switch; when dot1qNumVlans=1 and ipForwarding=1 is a router; when dot1qNumVlans=1 and ipForwarding≠1 is a terminal host.
[0048] Among them, Bridge-MIB (Bridge Management Information Base) is a standard MIB (Management Information Base) module used in network management to monitor and control the behavior of network bridge devices (such as switches). It is based on SNMP (Simple Network Management Protocol) and allows network administrators to remotely monitor and configure various parameters and status information of bridge devices through a network management system (NMS). Bridge-MIB mainly follows RFC 1493 (which defines the original Bridge-MIB) and subsequent RFCs such as RFC 4188, which defines the updated BRIDGE-MIB specification. ipForwarding is a concept related to network device configuration, specifically referring to whether the device enables IP packet forwarding function. In most network devices, especially routers, this is a key setting. When ipForwarding is set to enabled, the device (such as a router) will receive IP packets that are not intended for itself and will determine the next hop in the network according to its routing table, i.e. the next device on the way to the destination of the packet. This function is the basis for interconnection between different networks.
[0049] In the embodiments of the present disclosure, first, the network device router startup identifier corresponding to the candidate address is acquired, and then the device type of the network device corresponding to the candidate address is determined based on the router startup identifier and the network device VLAN quantity. Thus, the device type of the network device can be accurately determined through the router startup identifier and the network device VLAN quantity, which provides accurate data basis for subsequent establishment of the network topology, and can improve the efficiency and accuracy of the network topology establishment, thereby improving the reliability and stability of network device management and maintenance.
[0050] In the embodiments of the present disclosure, in the establishment of the network topology, for any candidate address in the common address set, a spanning tree protocol (STP) is generated from the redundant link, some interfaces are blocked, and thus the current routing device IP is probed for activity. If the current IP is active, the ipRouteTable is read to obtain the routing table of the current IP, and the connection relationship table of the current network node is obtained after de-redundancy.
[0051] If the connection relationship table is empty, the one-time probing ends. If the connection relationship table is not empty, a connection relationship is selected, if it is a neighbor IP, the routing device set is added, and the next connection relationship is selected; if it is a directly connected subnet, the subnet type is identified. If it is a link subnet, the connection relationship between the two routing devices is directly set as directly connected, otherwise the ipNetToMediaTable is read to obtain the active IP set of the subnet. The active IP set is traversed, all switches in the active IP set are identified through the device type identification algorithm and are classified into the switch set. The connection relationship discovery between the network devices in the subnet is completed through the data link layer network topology discovery algorithm. The common address set is traversed, the matched interfaces are removed, and the IP addresses corresponding to the media access control (MAC) addresses of the remaining interface connections are found from the address resolution protocol (ARP) cache table. The connection relationship of the remaining interface IP is determined through the multi-IP device identification algorithm, and the complete network topology of the network to be detected is established.
[0052] It should be noted that for any candidate address in the common address set, the next hop address of the candidate address is acquired, and the candidate address is probed in response to the next hop address being the address of a directly connected subnet in the probing routing table. Thus, unnecessary subnet level probing can be reduced, and the availability and performance evaluation of the key path (i.e. the next hop address) can be directly focused on, thereby improving the efficiency and accuracy of network management.
[0053] In the above embodiments, the network device corresponding to the candidate address is probed, and the network device can also be probed through Figure 3Further explanation, the method comprises:
[0054] S301, for any candidate address in the common address set, the node name, the node physical address, the node vendor identifier and the node description of the network device corresponding to the candidate address are acquired by detection.
[0055] In the embodiment of the present disclosure, the node name, the node physical address, the node vendor identifier and the node description of the network device can be determined through the data in MIB-II. Wherein, MIB-II, full name for Management Information Base, Version 2, is a core component in the SNMP framework, which defines a set of standard object identifiers (OIDs) to describe the management information and configurable parameters of the network device. MIB-II is an extension and improvement of the original MIB specification, aiming to provide more comprehensive network device management capabilities.
[0056] S302, generating the device fingerprint of the network device corresponding to the candidate address based on the node name, the node physical address, the node vendor identifier and the node description.
[0057] It should be noted that for a network device, the software information and the hardware information may be the same as those of other network devices. Whether it is a specific device name given by the network administrator for the convenience of managing the network device, or a device name randomly generated by the edge device, it is almost unique. In addition, the physical address configured by the device when starting the Simple Network Management Protocol (SNMP) service is also one of the identity of the device. Therefore, the node name, the node physical address, the node vendor identifier and the node description can be used to generate the device fingerprint of the candidate address. It should be noted that the device fingerprint corresponding to different network devices is different.
[0058] In the embodiment of the present disclosure, in response to the device fingerprint being contained in the device-access address mapping set, the access address of the candidate address is updated to the access address set corresponding to the target device item in the device-access address mapping set, wherein the target device item is the device item corresponding to the device fingerprint, or in response to the device fingerprint not being contained in the device-access address mapping set, the device item corresponding to the device fingerprint is established in the device-access address mapping set based on the device fingerprint.
[0059] In a possible implementation manner, the node name, the node physical address, the node vendor identifier and the node description are calculated by a hash algorithm to calculate and obtain a hash value, and the hash value is taken as the device fingerprint of the network device corresponding to the candidate address.
[0060] It should be noted that the hash algorithm is set in advance and can be changed according to actual design needs, which is not limited here.
[0061] It should be noted that in a possible implementation, the network device corresponding to the candidate address can be empty, and at this time, the corresponding device fingerprint does not need to be established.
[0062] S303, the candidate addresses with the same device fingerprint are taken as addresses under the same device.
[0063] In the embodiment of the present disclosure, first, for any candidate address in the common address set, the node name, node physical address, node vendor identifier and node description of the network device corresponding to the candidate address are detected and acquired, then the device fingerprint of the network device corresponding to the candidate address is generated based on the node name, node physical address, node vendor identifier and node description, and finally the candidate addresses with the same device fingerprint are taken as addresses under the same device. Therefore, by acquiring the information of the network device corresponding to the candidate address and generating the device fingerprint, the device fingerprint can be used as the identification mark for subsequent storage and analysis.
[0064] Corresponding to the network topology construction method provided by the above several embodiments, one embodiment of the present disclosure also provides a network topology construction device. Since the network topology construction device provided by the embodiment of the present disclosure corresponds to the network topology construction method provided by the above several embodiments, the implementation modes of the above network topology construction method are also applicable to the network topology construction device provided by the embodiment of the present disclosure, which will not be described in detail in the following embodiments.
[0065] Figure 4 is a schematic diagram of a network topology construction device in one embodiment of the present disclosure, as shown in Figure 4 The network topology construction device 400 includes a query module 410, an acquisition module 420 and an establishment module 430.
[0066] The query module 410 is configured to acquire a detection routing table and a common address set of a network to be detected.
[0067] The acquisition module 420 is configured to acquire the VLAN quantity of the network device corresponding to any candidate address in the common address set, and acquire the subnet type corresponding to the candidate address based on the detection routing table.
[0068] The establishment module 430 is configured to determine the device type of the network device corresponding to the candidate address based on the VLAN quantity of the network device, and establish the network topology of the network to be detected based on the device type and the subnet type.
[0069] In an embodiment of the disclosure, the establishing module 430 is further configured to: acquire a network device router startup identifier corresponding to the candidate address; and determine the device type of the network device corresponding to the candidate address based on the router startup identifier and the number of VLANs of the network device.
[0070] In an embodiment of the disclosure, the establishing module 430 is further configured to: determine the device type as a switch in response to the number of VLANs of the network device being greater than 1; or determine the device type as a router in response to the number of VLANs of the network device being equal to 1 and the router startup identifier being startup; or determine the device type as a terminal host in response to the number of VLANs of the network device being equal to 1 and the router startup identifier not being startup.
[0071] In an embodiment of the disclosure, the network topology construction apparatus 400 is further configured to: acquire a next hop address of a candidate address in the set of frequently used addresses; and probe the candidate address in response to the next hop address being an address of a directly connected subnet in the probe routing table.
[0072] In an embodiment of the disclosure, the network topology construction apparatus 400 is further configured to: acquire, for any candidate address in the set of frequently used addresses, a node name, a node physical address, a node vendor identifier, and a node description of a network device corresponding to the candidate address; generate a device fingerprint of the network device corresponding to the candidate address based on the node name, the node physical address, the node vendor identifier, and the node description; and regard candidate addresses with the same device fingerprint as addresses under the same device.
[0073] In an embodiment of the disclosure, the network topology construction apparatus 400 is further configured to: update an access address of the candidate address to an access address set corresponding to a target device item in the device-access address mapping set in response to the device fingerprint being contained in the device-access address mapping set, wherein the target device item is a device item corresponding to the device fingerprint; or establish a device item corresponding to the device fingerprint in the device-access address mapping set based on the device fingerprint in response to the device fingerprint not being contained in the device-access address mapping set.
[0074] In an embodiment of the disclosure, the network topology construction apparatus 400 is further configured to: calculate a hash value by performing calculation on the node name, the node physical address, the node vendor identifier, and the node description through a hash algorithm, and regard the hash value as the device fingerprint of the network device corresponding to the candidate address.
[0075] Thus, the candidate address is determined by detection, the device type of the network device corresponding to the candidate address can be accurately judged based on the characteristics that the VLAN types and the VLAN numbers corresponding to different network devices are different, and the network topology of the network to be detected is established based on the positions of the candidate addresses in the network topology and device information, etc., the device type of the network device can be accurately determined through the VLAN number, a more perfect network topology can be established, and the efficiency and accuracy of network topology establishment are improved, and thus the reliability and stability of network device management and maintenance are improved.
[0076] To achieve the above-mentioned embodiments, the electronic device 500 is also provided in the embodiments of the present disclosure, Figure 5 is a schematic diagram of an electronic device according to an embodiment of the present disclosure, as Figure 5 shown, the electronic device 500 includes a processor 501 and a memory 502 in communication with the processor, the memory 502 stores instructions executable by at least one processor, and the instructions are executed by at least one processor 501 to implement a network topology construction method according to an embodiment of the present disclosure. Figures 1-3
[0077] To achieve the above-mentioned embodiments, the electronic device 500 is also provided in the embodiments of the present disclosure, Figures 1-3
[0078] To achieve the above-mentioned embodiments, the electronic device 500 is also provided in the embodiments of the present disclosure, Figure 1 Figure 3
[0079] It should be noted that personal information from users should be collected for legitimate and reasonable purposes, and should not be shared or sold outside these legitimate uses. In addition, such collection / sharing should be carried out after the user's informed consent is received, including but not limited to informing the user to read the user agreement / user notice before the user uses the function, and signing the agreement / authorization including authorization of relevant user information. In addition, any necessary steps should be taken to protect and ensure access to such personal information data, and to ensure that other people with access to personal information data comply with their privacy policies and processes.
[0080] The present application contemplates an implementation that provides users with the ability to selectively opt in or opt out of permitting the collection and / or use of their personal information data. That is, the present disclosure contemplates providing users with the ability to prevent or limit the collection and / or use of their personal information data. For example, the present disclosure contemplates providing users with the ability to prevent or limit the collection and / or use of their personal information data by, for example, blocking or deleting cookies. In addition, the present disclosure contemplates providing users with the ability to determine whether and how to interact with the present disclosure by, for example, blocking web beacons. Further, the present disclosure contemplates providing users with the ability to access and / or edit their personal information data when such data is collected by the present disclosure. Additionally, the present disclosure contemplates that the collection and / or use of personal information data can be done in a manner that complies with all other applicable laws and regulations, including, for example, the European Union’s General Data Protection Regulation (GDPR), the California Consumer Privacy Act (CCPA), and / or any comparable privacy laws.
[0081] In the foregoing detailed description, the description used with respect to the terms "one embodiment", "some embodiments”, "an example”, "a specific example” or "some examples” etc. means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. The illustrative appearances of the above-mentioned terms in the description are not necessarily referred to the same embodiment or example. Moreover, the particular features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples. Furthermore, the description herein of various embodiments or examples of the present application has been made with reference to the accompanying drawings. However, the description is not intended to be exhaustive or to limit the present application to the precise forms disclosed. As such, many modifications and variations are possible in light of the above teachings. It is intended that the scope of the present application be limited not with this detailed description, but rather determined with reference to the claims appended hereto.
[0082] In addition, the terms "first”, "second”, etc. are used herein only to describe various steps in a method, process, and / or algorithm, and are not intended to refer to ranking or importance of a particular feature, step, etc. That is, a step that follows a first step in some embodiments can be termed a second step in other embodiments or examples, without any implication that it is logically or otherwise a second step relative to the first step. Furthermore, the use of the terms "first”, "second”, etc., is interchangeable with one another, unless otherwise specifically noted, such that the specific identification of a feature, step, etc., as being the "first” or "second” feature, step, etc., is not intended to convey a chronological or sequential order of such feature, step, etc., but is intended solely to identify such feature, step, etc., as the "first” or "second” feature, step, etc., relative to another feature, step, etc.
[0083] Any processes or methods described in the flow charts or otherwise described herein can be understood as representing code modules, segments, or portions of code that include one or more executable instructions for implementing specific logic functions (or steps) of a particular method, process, or algorithm. It should also be understood that the scope of the present application includes other implementations that can not be specifically shown in the flow charts or otherwise described herein. For example, additional or fewer steps can be utilized, and the order of the steps can be changed, depending on the implementation. Furthermore, some steps can be performed in parallel rather than sequentially, as specifically shown and described herein. As such, the particular sequence of steps disclosed herein is illustrative only and does not necessarily reflect an order in which the steps are to be performed, depending upon the implementation, nor is it necessary that all steps be performed in the precise order shown. Additionally, the scope of the present application includes the use of alternative or modified code modules, segments, or portions of code, as well as the use of different or modified algorithms, as long as the intended functionality of the code modules, segments, or portions of code, or the algorithms, is preserved.
[0084] The logic and / or steps represented in the flowcharts and / or described herein, for example, can be considered as a sequence of executable instructions stored in a computer readable medium, which can be executed by an instruction execution system, apparatus or device, such as a computer-based system, a processor-based system, or other system that can fetch the instructions from the instruction execution system, apparatus or device and execute the instructions, or a combination thereof. For the purposes of this specification, a "computer readable medium" can be any apparatus that contains, stores, communicates, propagates or transports a program for use by or in connection with an instruction execution system, apparatus or device. More specific examples (a non-exhaustive list) of the computer readable medium include the following: an electrical connection (electronic) having one or more wires, a portable computer diskette (magnetic), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, and a portable compact disc read-only memory (CDROM). In addition, the computer readable medium can even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, for example, by optically scanning the paper or other suitable medium, then electronically captured, interpreted or processed in a suitable manner if necessary, and then stored in a computer memory.
[0085] It should be understood that aspects of the application can be implemented in hardware, software, firmware or combinations thereof. In the above embodiments, the various steps or methods can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. As such, if implemented in hardware and in another embodiment, any of the following technologies, or combinations thereof, can be used: discrete logic circuitry having logic gates for implementing logic functions upon data signals, application specific integrated circuits having appropriate combinational logic gates, programmable gate arrays (PGA), field programmable gate arrays (FPGA), and so forth.
[0086] Those of skill in the art could readily implement the above described example methods with all or a portion of the disclosed steps carried out by a program for use with a computer system or similar electronic apparatus, or carried out by such a system or apparatus itself. The aforementioned methods can be written as one or more computer programs (for use with different operating systems or platforms) to implement the disclosed example methods.
[0087] In addition, each of the functional units in the various embodiments of the present application can be integrated in one processing module, or each of the units can be physically present separately, or two or more units can be integrated in one module. The integrated module can be implemented in the form of hardware or in the form of a software functional module. When the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer readable storage medium.
[0088] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it should be understood that the above embodiments are exemplary and should not be construed as limiting the present application, and those skilled in the art can make changes, modifications, replacements and variations to the above embodiments within the scope of the present application.
Claims
1. A network topology construction method characterized by comprising: The method comprises: obtaining a probe routing table and a common address set of a network to be detected; for any candidate address in the common address set, obtaining the VLAN quantity of the network device corresponding to the candidate address, and obtaining the subnet type corresponding to the candidate address based on the probe routing table; based on the VLAN quantity of the network device, determining the device type of the network device corresponding to the candidate address, and based on the device type and the subnet type, establishing the network topology of the network to be detected.
2. The method of claim 1, wherein, The device type of the network device corresponding to the candidate address is determined based on the VLAN quantity of the network device, comprising: obtaining the router startup identifier of the network device corresponding to the candidate address; based on the router startup identifier and the VLAN quantity of the network device, determining the device type of the network device corresponding to the candidate address.
3. The method of claim 2, wherein, The device type of the network device corresponding to the candidate address is determined based on the router startup identifier and the VLAN quantity of the network device, comprising: in response to the VLAN quantity of the network device being greater than 1, determining that the device type is a switch; or, in response to the VLAN quantity of the network device being equal to 1 and the router startup identifier being started, determining that the device type is a router; or, in response to the VLAN quantity of the network device being equal to 1 and the router startup identifier not being started, determining that the device type is a terminal host.
4. The method of claim 1, wherein, The method further comprises: for any candidate address in the common address set, obtaining the next hop address of the candidate address; in response to the next hop address being the address of a directly connected subnet in the probe routing table, probing the candidate address.
5. The method of claim 4, wherein, The method further comprises: for any candidate address in the common address set, probing to obtain the node name, node physical address, node vendor identifier and node description of the network device corresponding to the candidate address; based on the node name, node physical address, node vendor identifier and node description, generating the device fingerprint of the network device corresponding to the candidate address; candidate addresses with the same device fingerprint are regarded as addresses under the same device.
6. The method of claim 5, wherein, The method further comprises, comprising: in response to the device fingerprint being contained in the device-access address mapping set, updating the access address of the candidate address to the access address set corresponding to the target device item in the device-access address mapping set, wherein the target device item is the device item corresponding to the device fingerprint; or, in response to the device fingerprint not being contained in the device-access address mapping set, establishing the device item corresponding to the device fingerprint in the device-access address mapping set based on the device fingerprint.
7. The method of claim 5, wherein, The device fingerprint of the network device corresponding to the candidate address is generated based on the node name, node physical address, node vendor identifier and node description, comprising: calculating the node name, node physical address, node vendor identifier and node description by a hash algorithm to calculate a hash value, and taking the hash value as the device fingerprint of the network device corresponding to the candidate address.
8. A network topology building apparatus, characterized by comprising: The method comprises: The query module is configured to acquire a probe routing table and a common address set of a network to be detected. The acquisition module is configured to acquire, for any candidate address in the common address set, a VLAN quantity of a network device corresponding to the candidate address, and acquire a subnet type corresponding to the candidate address based on the probe routing table. The establishment module is configured to determine a device type of the network device corresponding to the candidate address based on the VLAN quantity, and establish a network topology of the network to be detected based on the device type and the subnet type.
9. An electronic device, comprising: comprises a memory, a processor; The processor runs a program corresponding to executable program code stored in the memory by reading the executable program code, to implement the method of any one of claims 1-8.
10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer execution instructions, and the computer execution instructions are executed by the processor to implement the method of any one of claims 1-7.
Citation Information
Patent Citations
Network topology discovery method, device and network equipment
CN102158348A
Network topology structure generation method and device, equipment and medium
CN111600762A